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

345 lines
643 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[224,7,10],{"+NIl":function(Ut,ut,C){(function(B){B(C("VrN/"))})(function(B){"use strict";B.defineMode("stex",function(Ce,me){"use strict";function Q(se,J){se.cmdState.push(J)}function x(se){return se.cmdState.length>0?se.cmdState[se.cmdState.length-1]:null}function Se(se){var J=se.cmdState.pop();J&&J.closeBracket()}function j(se){for(var J=se.cmdState,U=J.length-1;U>=0;U--){var P=J[U];if(P.name=="DEFAULT")continue;return P}return{styleIdentifier:function(){return null}}}function oe(se,J,U){return function(){this.name=se,this.bracketNo=0,this.style=J,this.styles=U,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var le={};le.importmodule=oe("importmodule","tag",["string","builtin"]),le.documentclass=oe("documentclass","tag",["","atom"]),le.usepackage=oe("usepackage","tag",["atom"]),le.begin=oe("begin","tag",["atom"]),le.end=oe("end","tag",["atom"]),le.label=oe("label","tag",["atom"]),le.ref=oe("ref","tag",["atom"]),le.eqref=oe("eqref","tag",["atom"]),le.cite=oe("cite","tag",["atom"]),le.bibitem=oe("bibitem","tag",["atom"]),le.Bibitem=oe("Bibitem","tag",["atom"]),le.RBibitem=oe("RBibitem","tag",["atom"]),le.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function we(se,J){se.f=J}function W(se,J){var U;if(se.match(/^\\[a-zA-Z@]+/)){var P=se.current().slice(1);return U=le.hasOwnProperty(P)?le[P]:le.DEFAULT,U=new U,Q(J,U),we(J,be),U.style}if(se.match(/^\\[$&%#{}_]/))return"tag";if(se.match(/^\\[,;!\/\\]/))return"tag";if(se.match("\\["))return we(J,function(ee,Ee){return H(ee,Ee,"\\]")}),"keyword";if(se.match("\\("))return we(J,function(ee,Ee){return H(ee,Ee,"\\)")}),"keyword";if(se.match("$$"))return we(J,function(ee,Ee){return H(ee,Ee,"$$")}),"keyword";if(se.match("$"))return we(J,function(ee,Ee){return H(ee,Ee,"$")}),"keyword";var q=se.next();if(q=="%")return se.skipToEnd(),"comment";if(q=="}"||q=="]"){if(U=x(J),U)U.closeBracket(q),we(J,be);else return"error";return"bracket"}else return q=="{"||q=="["?(U=le.DEFAULT,U=new U,Q(J,U),"bracket"):/\d/.test(q)?(se.eatWhile(/[\w.%]/),"atom"):(se.eatWhile(/[\w\-_]/),U=j(J),U.name=="begin"&&(U.argument=se.current()),U.styleIdentifier())}function H(se,J,U){if(se.eatSpace())return null;if(U&&se.match(U))return we(J,W),"keyword";if(se.match(/^\\[a-zA-Z@]+/))return"tag";if(se.match(/^[a-zA-Z]+/))return"variable-2";if(se.match(/^\\[$&%#{}_]/))return"tag";if(se.match(/^\\[,;!\/]/))return"tag";if(se.match(/^[\^_&]/))return"tag";if(se.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(se.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var P=se.next();return P=="{"||P=="}"||P=="["||P=="]"||P=="("||P==")"?"bracket":P=="%"?(se.skipToEnd(),"comment"):"error"}function be(se,J){var U=se.peek(),P;return U=="{"||U=="["?(P=x(J),P.openBracket(U),se.eat(U),we(J,W),"bracket"):/[ \t\r]/.test(U)?(se.eat(U),null):(we(J,W),Se(J),W(se,J))}return{startState:function(){var se=me.inMathMode?function(J,U){return H(J,U)}:W;return{cmdState:[],f:se}},copyState:function(se){return{cmdState:se.cmdState.slice(),f:se.f}},token:function(se,J){return J.f(se,J)},blankLine:function(se){se.f=W,se.cmdState.length=0},lineComment:"%"}}),B.defineMIME("text/x-stex","stex"),B.defineMIME("text/x-latex","stex")})},"19Vz":function(Ut,ut,C){(function(B){B(C("VrN/"))})(function(B){B.defineOption("placeholder","",function(oe,le,we){var W=we&&we!=B.Init;if(le&&!W)oe.on("blur",x),oe.on("change",Se),oe.on("swapDoc",Se),B.on(oe.getInputField(),"compositionupdate",oe.state.placeholderCompose=function(){Q(oe)}),Se(oe);else if(!le&&W){oe.off("blur",x),oe.off("change",Se),oe.off("swapDoc",Se),B.off(oe.getInputField(),"compositionupdate",oe.state.placeholderCompose),Ce(oe);var H=oe.getWrapperElement();H.className=H.className.replace(" CodeMirror-empty","")}le&&!oe.hasFocus()&&x(oe)});function Ce(oe){oe.state.placeholder&&(oe.state.placeholder.parentNode.removeChild(oe.state.placeholder),oe.state.placeholder=null)}function me(oe){Ce(oe);var le=oe.state.placeholder=document.createElement("pre");le.style.cssText="height: 0; overflow: visible",le.style.direction=oe.getOption("direction"),le.className="CodeMirror-placeholder CodeMirror-line-like";var we=oe.getOption("placeholder");typeof we=="string"&&(we=document.createTextNode(we)),le.appendChild(we),oe.display.lineSpace.insertBefore(le,oe.display.lineSpace.firstChild)}function Q(oe){setTimeout(function(){var le=!1,we=oe.getInputField();we.nodeName=="TEXTAREA"?le=!we.value:oe.lineCount()==1&&(le=!/[^\u200b]/.test(we.querySelector(".CodeMirror-line").textContent)),le?me(oe):Ce(oe)},20)}function x(oe){j(oe)&&me(oe)}function Se(oe){var le=oe.getWrapperElement(),we=j(oe);le.className=le.className.replace(" CodeMirror-empty","")+(we?" CodeMirror-empty":""),we?me(oe):Ce(oe)}function j(oe){return oe.lineCount()===1&&oe.getLine(0)===""}})},"1eCo":function(Ut,ut,C){(function(B){B(C("VrN/"))})(function(B){"use strict";var Ce={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},me={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};B.defineMode("xml",function(Q,x){var Se=Q.indentUnit,j={},oe=x.htmlMode?Ce:me;for(var le in oe)j[le]=oe[le];for(var le in x)j[le]=x[le];var we,W;function H(k,ve){function ie(Oe){return ve.tokenize=Oe,Oe(k,ve)}var N=k.next();if(N=="<")return k.eat("!")?k.eat("[")?k.match("CDATA[")?ie(J("atom","]]>")):null:k.match("--")?ie(J("comment","-->")):k.match("DOCTYPE",!0,!0)?(k.eatWhile(/[\w\._\-]/),ie(U(1))):null:k.eat("?")?(k.eatWhile(/[\w\._\-]/),ve.tokenize=J("meta","?>"),"meta"):(we=k.eat("/")?"closeTag":"openTag",ve.tokenize=be,"tag bracket");if(N=="&"){var ye;return k.eat("#")?k.eat("x")?ye=k.eatWhile(/[a-fA-F\d]/)&&k.eat(";"):ye=k.eatWhile(/[\d]/)&&k.eat(";"):ye=k.eatWhile(/[\w\.\-:]/)&&k.eat(";"),ye?"atom":"error"}else return k.eatWhile(/[^&<]/),null}H.isInText=!0;function be(k,ve){var ie=k.next();if(ie==">"||ie=="/"&&k.eat(">"))return ve.tokenize=H,we=ie==">"?"endTag":"selfcloseTag","tag bracket";if(ie=="=")return we="equals",null;if(ie=="<"){ve.tokenize=H,ve.state=Ee,ve.tagName=ve.tagStart=null;var N=ve.tokenize(k,ve);return N?N+" tag error":"tag error"}else return/[\'\"]/.test(ie)?(ve.tokenize=se(ie),ve.stringStartCol=k.column(),ve.tokenize(k,ve)):(k.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function se(k){var ve=function(ie,N){for(;!ie.eol();)if(ie.next()==k){N.tokenize=be;break}return"string"};return ve.isInAttribute=!0,ve}function J(k,ve){return function(ie,N){for(;!ie.eol();){if(ie.match(ve)){N.tokenize=H;break}ie.next()}return k}}function U(k){return function(ve,ie){for(var N;(N=ve.next())!=null;){if(N=="<")return ie.tokenize=U(k+1),ie.tokenize(ve,ie);if(N==">")if(k==1){ie.tokenize=H;break}else return ie.tokenize=U(k-1),ie.tokenize(ve,ie)}return"meta"}}function P(k,ve,ie){this.prev=k.context,this.tagName=ve,this.indent=k.indented,this.startOfLine=ie,(j.doNotIndent.hasOwnProperty(ve)||k.context&&k.context.noIndent)&&(this.noIndent=!0)}function q(k){k.context&&(k.context=k.context.prev)}function ee(k,ve){for(var ie;;){if(!k.context)return;if(ie=k.context.tagName,!j.contextGrabbers.hasOwnProperty(ie)||!j.contextGrabbers[ie].hasOwnProperty(ve))return;q(k)}}function Ee(k,ve,ie){return k=="openTag"?(ie.tagStart=ve.column(),je):k=="closeTag"?xe:Ee}function je(k,ve,ie){return k=="word"?(ie.tagName=ve.current(),W="tag",ue):j.allowMissingTagName&&k=="endTag"?(W="tag bracket",ue(k,ve,ie)):(W="error",je)}function xe(k,ve,ie){if(k=="word"){var N=ve.current();return ie.context&&ie.context.tagName!=N&&j.implicitlyClosed.hasOwnProperty(ie.context.tagName)&&q(ie),ie.context&&ie.context.tagName==N||j.matchClosing===!1?(W="tag",de):(W="tag error",Fe)}else return j.allowMissingTagName&&k=="endTag"?(W="tag bracket",de(k,ve,ie)):(W="error",Fe)}function de(k,ve,ie){return k!="endTag"?(W="error",de):(q(ie),Ee)}function Fe(k,ve,ie){return W="error",de(k,ve,ie)}function ue(k,ve,ie){if(k=="word")return W="attribute",ge;if(k=="endTag"||k=="selfcloseTag"){var N=ie.tagName,ye=ie.tagStart;return ie.tagName=ie.tagStart=null,k=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(N)?ee(ie,N):(ee(ie,N),ie.context=new P(ie,N,ye==ie.indented)),Ee}return W="error",ue}function ge(k,ve,ie){return k=="equals"?Ae:(j.allowMissing||(W="error"),ue(k,ve,ie))}function Ae(k,ve,ie){return k=="string"?fe:k=="word"&&j.allowUnquoted?(W="string",ue):(W="error",ue(k,ve,ie))}function fe(k,ve,ie){return k=="string"?fe:ue(k,ve,ie)}return{startState:function(k){var ve={tokenize:H,state:Ee,indented:k||0,tagName:null,tagStart:null,context:null};return k!=null&&(ve.baseIndent=k),ve},token:function(k,ve){if(!ve.tagName&&k.sol()&&(ve.indented=k.indentation()),k.eatSpace())return null;we=null;var ie=ve.tokenize(k,ve);return(ie||we)&&ie!="comment"&&(W=null,ve.state=ve.state(we||ie,k,ve),W&&(ie=W=="error"?ie+" error":W)),ie},indent:function(k,ve,ie){var N=k.context;if(k.tokenize.isInAttribute)return k.tagStart==k.indented?k.stringStartCol+1:k.indented+Se;if(N&&N.noIndent)return B.Pass;if(k.tokenize!=be&&k.tokenize!=H)return ie?ie.match(/^(\s*)/)[0].length:0;if(k.tagName)return j.multilineTagIndentPastTag!==!1?k.tagStart+k.tagName.length+2:k.tagStart+Se*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(ve))return 0;var ye=ve&&/^<(\/)?([\w_:\.-]*)/.exec(ve);if(ye&&ye[1])for(;N;)if(N.tagName==ye[2]){N=N.prev;break}else if(j.implicitlyClosed.hasOwnProperty(N.tagName))N=N.prev;else break;else if(ye)for(;N;){var Oe=j.contextGrabbers[N.tagName];if(Oe&&Oe.hasOwnProperty(ye[2]))N=N.prev;else break}for(;N&&N.prev&&!N.startOfLine;)N=N.prev;return N?N.indent+Se:k.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(k){k.state==Ae&&(k.state=ue)},xmlCurrentTag:function(k){return k.tagName?{name:k.tagName,close:k.type=="closeTag"}:null},xmlCurrentContext:function(k){for(var ve=[],ie=k.context;ie;ie=ie.prev)ie.tagName&&ve.push(ie.tagName);return ve.reverse()}}}),B.defineMIME("text/xml","xml"),B.defineMIME("application/xml","xml"),B.mimeModes.hasOwnProperty("text/html")||B.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"3TLj":function(Ut,ut,C){Ut.exports={flex_box_center:"flex_box_center____TbjK",flex_space_between:"flex_space_between___2coRZ",flex_box_vertical_center:"flex_box_vertical_center___3NVFE",flex_box_center_end:"flex_box_center_end___3GKhy",flex_box_column:"flex_box_column___2SLfn",bg:"bg___3oKWe",formWrap:"formWrap___2Y1wq"}},"5v/u":function(Ut,ut,C){"use strict";C.r(ut);var B=C("5NDa"),Ce=C("5rEg"),me=C("2qtc"),Q=C("kLXV"),x=C("9og8"),Se=C("k1fw"),j=C("y8nQ"),oe=C("Vl3Y"),le=C("tJVT"),we=C("PpiC"),W=C("Znn+"),H=C("ZTPi"),be=C("WmNS"),se=C.n(be),J=C("q1tI"),U=C.n(J),P=C("9kvl"),q=C("Ot1p"),ee=C("HBuW"),Ee=C("3TLj"),je=C.n(Ee),xe=C("xKgJ"),de=C("UqFu"),Fe=C("9ZNV"),ue=C("nuEh"),ge=H.a.TabPane,Ae=function(k){var ve,ie,N=k.shixunsDetail,ye=k.dispatch,Oe=k.match,pe=k.practiceSetting,Ze=Object(we.a)(k,["shixunsDetail","dispatch","match","practiceSetting"]),O=oe.a.useForm(),v=Object(le.a)(O,1),ae=v[0],Pe=Object(J.useState)({}),Ne=Object(le.a)(Pe,2),it=Ne[0],ft=Ne[1],He=N.challengesNew,Ve=Object(J.useRef)(null),Ie=pe.selectQuestionParams,We=pe.id,re=pe.newQuestion,R=Object(J.useState)(!0),qe=Object(le.a)(R,2),vt=qe[0],At=qe[1];Object(J.useEffect)(function(){At(!0),ye({type:"shixunsDetail/getChallengesNew",payload:Object(Se.a)({},Oe.params)}),At(!1)},[Oe.params]);var ot=function(){var ct=Object(x.a)(se.a.mark(function Qe(Be){var Ye,Ot,pt;return se.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return Ye=Object(Se.a)({},it),Ot=!(!Be.unity_3d_routes||Be.unity_3d_routes==""),Ye.identifier=Oe.params.id,Ye.st=1,rt.next=6,Object(ee.b)(Object(Se.a)(Object(Se.a)({},Ye),{},{unity_3d_routes:Ot?Be.unity_3d_routes:null,unity_3d:Ot}));case 6:pt=rt.sent,pt.status===1&&(P.d.replace("/shixuns/".concat(Oe.params.id,"/edit/").concat(pt.challenge_id,"/editquestion?tab=2")),setTimeout(function(){ye({type:"practiceSetting/setParams",payload:{newQuestion:null}}),ye({type:"practiceSetting/setUpdateIndex"})},200));case 8:case"end":return rt.stop()}},Qe)}));return function(Be){return ct.apply(this,arguments)}}(),dt=function(){tt()},Te=function(Qe){clearTimeout(Ve.current),Ve.current=setTimeout(function(){"subject"in Qe&&re&&ye({type:"practiceSetting/setParams",payload:{newQuestion:{st:1,name:Qe==null?void 0:Qe.subject}}});var Be=ae.getFieldsValue(),Ye=Be.subject,Ot=Be.task_pass;Ye!==""||Ot!==Object(de.a)(He.task_pass_default)?ye({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):ye({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},500)},Ke=function(Qe){ft(Object(Se.a)({},ae.getFieldsValue())),Te(Qe)},tt=function(){var Qe,Be=function(){P.d.push("/shixuns/".concat(We,"/challenges")),ye({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};pe!=null&&(Qe=pe.sideBar)!==null&&Qe!==void 0&&Qe.confirmLeave?Q.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){Be()}}):Be()};return U.a.createElement("section",{className:je.a.bg},U.a.createElement(H.a,{activeKey:"1"},U.a.createElement(ge,{tab:"\u672C\u5173\u4EFB\u52A1",key:"1"},U.a.createElement(oe.a,{form:ae,className:je.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Ke,onFinish:ot},U.a.createElement("div",{className:je.a.fieldWrap},U.a.createElement(oe.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},U.a.createElement(Ce.a,{bordered:!1,maxLength:60,suffix:"".concat(((ve=it.subject)===null||ve===void 0?void 0:ve.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),U.a.createElement("div",{className:je.a.mdWrap},U.a.createElement(oe.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},U.a.createElement(q.a,{watch:!0,defaultValue:He.task_pass_default}))),Object(xe.o)()&&U.a.createElement("div",{className:je.a.fieldWrap},U.a.createElement(oe.a.Item,{initialValue:"",name:"unity_3d_routes",label:"\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0:"},U.a.createElement(Ce.a,{bordered:!1,maxLength:60,suffix:"".concat(((ie=it.unity_3d_routes)===null||ie===void 0?void 0:ie.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0\u5730\u5740"}))),U.a.createElement(oe.a.Item,{noStyle:!0},U.a.createElement(Fe.a,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:dt}))))),U.a.createElement(ue.a,{loading:vt}))};ut.default=Object(P.a)(function(fe){var k=fe.shixunsDetail,ve=fe.practiceSetting;return{shixunsDetail:k,practiceSetting:ve}})(Ae)},"7Cbv":function(Ut,ut,C){"use strict";var B=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Ce=new Uint8Array(16);function me(){if(!B)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return B(Ce)}var Q=/^(?:[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 x(be){return typeof be=="string"&&Q.test(be)}for(var Se=x,j=[],oe=0;oe<256;++oe)j.push((oe+256).toString(16).substr(1));function le(be){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,J=(j[be[se+0]]+j[be[se+1]]+j[be[se+2]]+j[be[se+3]]+"-"+j[be[se+4]]+j[be[se+5]]+"-"+j[be[se+6]]+j[be[se+7]]+"-"+j[be[se+8]]+j[be[se+9]]+"-"+j[be[se+10]]+j[be[se+11]]+j[be[se+12]]+j[be[se+13]]+j[be[se+14]]+j[be[se+15]]).toLowerCase();if(!Se(J))throw TypeError("Stringified UUID is invalid");return J}var we=le;function W(be,se,J){be=be||{};var U=be.random||(be.rng||me)();if(U[6]=U[6]&15|64,U[8]=U[8]&63|128,se){J=J||0;for(var P=0;P<16;++P)se[J+P]=U[P];return se}return we(U)}var H=ut.a=W},"7ahc":function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return je});var B=C("k1fw"),Ce=C("0Owb"),me=C("+L6B"),Q=C("2/Rp"),x=C("y8nQ"),Se=C("Vl3Y"),j=C("tJVT"),oe=C("OaEy"),le=C("2fM7"),we=C("q1tI"),W=C.n(we),H=C("VrN/"),be=C.n(H),se=C("p77/"),J=C.n(se),U=C("c5Ni"),P=C.n(U),q=le.a.Option,ee={labelCol:{span:4},wrapperCol:{span:20}},Ee={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"]};ut.b=function(xe){var de=xe.callback,Fe=xe.onCancel,ue=Object(we.useState)("python"),ge=Object(j.a)(ue,2),Ae=ge[0],fe=ge[1];function k(ie){fe(Ee[ie][1])}function ve(ie){de(ie)}return W.a.createElement(Se.a,Object(Ce.a)({},ee,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ve}),W.a.createElement(Se.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},W.a.createElement(le.a,{onChange:k},Object.keys(Ee).map(function(ie){return W.a.createElement(q,{key:ie,value:ie},Ee[ie][0])}))),W.a.createElement(Se.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},W.a.createElement(je,{mode:Ae})),W.a.createElement("div",{className:"flex-container flex-end"},W.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),W.a.createElement(Q.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function je(xe){var de=xe.value,Fe=xe.onChange,ue=xe.mode,ge=xe.options,Ae=ge===void 0?{}:ge,fe=Object(we.useRef)(),k=Object(we.useState)(),ve=Object(j.a)(k,2),ie=ve[0],N=ve[1];return Object(we.useEffect)(function(){if(ie){function ye(Oe){var pe=Oe.getValue();Fe&&Fe(pe)}return ie.on("change",ye),function(){ie.off("change",ye)}}},[ie,Fe]),Object(we.useEffect)(function(){ie&&ie.setOption("mode",ue)},[ie,ue]),Object(we.useEffect)(function(){ie&&((de!==ie.getValue()||de==="")&&setTimeout(function(){ie.setValue(de||" ")},300))},[ie,de]),Object(we.useEffect)(function(){if(fe.current&&!ie){var ye=be.a.fromTextArea(fe.current,Object(B.a)({mode:ue,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ae));N(ye)}},[fe.current,ie]),W.a.createElement("div",{className:"my-codemirror-container"},W.a.createElement("textarea",{ref:fe}))}},"7ixt":function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return me});var B={adjustX:1,adjustY:1},Ce=[0,0],me={left:{points:["cr","cl"],overflow:B,offset:[-4,0],targetOffset:Ce},right:{points:["cl","cr"],overflow:B,offset:[4,0],targetOffset:Ce},top:{points:["bc","tc"],overflow:B,offset:[0,-4],targetOffset:Ce},bottom:{points:["tc","bc"],overflow:B,offset:[0,4],targetOffset:Ce},topLeft:{points:["bl","tl"],overflow:B,offset:[0,-4],targetOffset:Ce},leftTop:{points:["tr","tl"],overflow:B,offset:[-4,0],targetOffset:Ce},topRight:{points:["br","tr"],overflow:B,offset:[0,-4],targetOffset:Ce},rightTop:{points:["tl","tr"],overflow:B,offset:[4,0],targetOffset:Ce},bottomRight:{points:["tr","br"],overflow:B,offset:[0,4],targetOffset:Ce},rightBottom:{points:["bl","br"],overflow:B,offset:[4,0],targetOffset:Ce},bottomLeft:{points:["tl","bl"],overflow:B,offset:[0,4],targetOffset:Ce},leftBottom:{points:["br","bl"],overflow:B,offset:[-4,0],targetOffset:Ce}},Q=me},"8EBN":function(Ut,ut,C){(function(B){B(C("VrN/"))})(function(B){"use strict";B.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 Ce=0;Ce<B.modeInfo.length;Ce++){var me=B.modeInfo[Ce];me.mimes&&(me.mime=me.mimes[0])}B.findModeByMIME=function(Q){Q=Q.toLowerCase();for(var x=0;x<B.modeInfo.length;x++){var Se=B.modeInfo[x];if(Se.mime==Q)return Se;if(Se.mimes){for(var j=0;j<Se.mimes.length;j++)if(Se.mimes[j]==Q)return Se}}if(/\+xml$/.test(Q))return B.findModeByMIME("application/xml");if(/\+json$/.test(Q))return B.findModeByMIME("application/json")},B.findModeByExtension=function(Q){Q=Q.toLowerCase();for(var x=0;x<B.modeInfo.length;x++){var Se=B.modeInfo[x];if(Se.ext){for(var j=0;j<Se.ext.length;j++)if(Se.ext[j]==Q)return Se}}},B.findModeByFileName=function(Q){for(var x=0;x<B.modeInfo.length;x++){var Se=B.modeInfo[x];if(Se.file&&Se.file.test(Q))return Se}var j=Q.lastIndexOf("."),oe=j>-1&&Q.substring(j+1,Q.length);if(oe)return B.findModeByExtension(oe)},B.findModeByName=function(Q){Q=Q.toLowerCase();for(var x=0;x<B.modeInfo.length;x++){var Se=B.modeInfo[x];if(Se.name.toLowerCase()==Q)return Se;if(Se.alias){for(var j=0;j<Se.alias.length;j++)if(Se.alias[j].toLowerCase()==Q)return Se}}}})},"8hTe":function(Ut,ut,C){Ut.exports={button:"button___1wy9m"}},"9Bee":function(Ut,ut,C){"use strict";var B=C("DYRE"),Ce=C("zeV3"),me=C("+L6B"),Q=C("2/Rp"),x=C("k1fw"),Se=C("9og8"),j=C("tJVT"),oe=C("WmNS"),le=C.n(oe),we=C("q1tI"),W=C.n(we),H=C("vg9a"),be=C("DlQD"),se=C.n(be),J=C("rUJ1");function U(h,o){var a=h.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(d){var c=d.match(/^\s+/);if(c===null)return d;var F=Object(j.a)(c,1),De=F[0];return De.length>=u.length?d.slice(u.length):d}).join(`
`)}var P=[],q=["<ul>"],ee=new se.a.Renderer,Ee=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function je(){P.length=0,q=["<ul>"]}var xe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function de(h,o,a,u){if(o>=h.length||h[o].level<=a)return o;var d=h[o];u.push("<li><a href='#"+d.anchor+"'>"+d.text+"</a>"),o++;var c=[];return o=de(h,o,d.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(F){u.push(F)}),u.push("</ul>")),u.push("</li>"),o=de(h,o,a,u),o}function Fe(){return de(P,0,0,q),q.push("</ul>"),q.join("")}var ue={heading:function(o){var a=Ee.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],d=U(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var F=fe(),De=d;d=F,k[F]={type:"block",expression:De}}return{type:"code",raw:u,lang:c,text:d}}}},ge=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Ae=0,fe=function(){return"__special_katext_id_".concat(Ae++,"__")},k={};function ve(){return k}function ie(){Ae=0,k={}}function N(h){return h=h.replace(ge,function(o,a){var u=fe();return k[u]={type:"inline",expression:a},u}),h}var ye=ee.listitem;ee.listitem=function(h){return ye(N(h))};var Oe=ee.paragraph;ee.paragraph=function(h){return Oe(N(h))};var pe=ee.tablecell;ee.tablecell=function(h,o){return pe(N(h),o)},ee.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(J.escape)(h,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(J.escape)(h,!0))+"</code></pre>"},ee.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+">"},se.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),se.a.use({tokenizer:ue,renderer:ee});var Ze=se.a,O=C("SJMd"),v=C("ulZh"),ae=C.n(v),Pe=C("m3rI"),Ne=C("Oy/b"),it=C("p5ED"),ft=C("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 He=function(h,o){return(He=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(h,o)};function Ve(h,o){function a(){this.constructor=h}He(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Ie(h,o,a,u){return new(a||(a=Promise))(function(d,c){function F(bt){try{nt(u.next(bt))}catch(Ue){c(Ue)}}function De(bt){try{nt(u.throw(bt))}catch(Ue){c(Ue)}}function nt(bt){var Ue;bt.done?d(bt.value):(Ue=bt.value,Ue instanceof a?Ue:new a(function(Bt){Bt(Ue)})).then(F,De)}nt((u=u.apply(h,o||[])).next())})}function We(h,o){var a,u,d,c,F={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return c={next:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function De(nt){return function(bt){return function(Ue){if(a)throw new TypeError("Generator is already executing.");for(;F;)try{if(a=1,u&&(d=2&Ue[0]?u.return:Ue[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Ue[1])).done)return d;switch(u=0,d&&(Ue=[2&Ue[0],d.value]),Ue[0]){case 0:case 1:d=Ue;break;case 4:return F.label++,{value:Ue[1],done:!1};case 5:F.label++,u=Ue[1],Ue=[0];continue;case 7:Ue=F.ops.pop(),F.trys.pop();continue;default:if(!(d=F.trys,(d=d.length>0&&d[d.length-1])||Ue[0]!==6&&Ue[0]!==2)){F=0;continue}if(Ue[0]===3&&(!d||Ue[1]>d[0]&&Ue[1]<d[3])){F.label=Ue[1];break}if(Ue[0]===6&&F.label<d[1]){F.label=d[1],d=Ue;break}if(d&&F.label<d[2]){F.label=d[2],F.ops.push(Ue);break}d[2]&&F.ops.pop(),F.trys.pop();continue}Ue=o.call(h,F)}catch(Bt){Ue=[6,Bt],u=0}finally{a=d=0}if(5&Ue[0])throw Ue[1];return{value:Ue[0]?Ue[1]:void 0,done:!0}}([nt,bt])}}}function re(){for(var h=0,o=0,a=arguments.length;o<a;o++)h+=arguments[o].length;var u=Array(h),d=0;for(o=0;o<a;o++)for(var c=arguments[o],F=0,De=c.length;F<De;F++,d++)u[d]=c[F];return u}var R=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,d=a;u<d.length;u++){var c=d[u],F=c[0],De=c[1];o.setAttribute(F,De)}},h.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&h.setAttributes(d,u),d},h.createLine=function(o,a,u,d,c){var F=document.createElementNS("http://www.w3.org/2000/svg","line");return F.setAttribute("x1",o.toString()),F.setAttribute("y1",a.toString()),F.setAttribute("x2",u.toString()),F.setAttribute("y2",d.toString()),c&&h.setAttributes(F,c),F},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 d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(d,u),d},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,d,c,F,De){var nt=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(nt,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",c.toString()],["refY",F.toString()]]),nt.appendChild(De),nt},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}(),qe=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}(),vt=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,a,u){var d=this;return new Promise(function(c){var F=u!==void 0?u:document.createElement("canvas");o===null&&(d.markersOnly=!0,d.naturalSize=!1);var De=document.createElementNS("http://www.w3.org/2000/svg","svg");De.setAttribute("xmlns","http://www.w3.org/2000/svg"),De.setAttribute("width",a.width.baseVal.valueAsString),De.setAttribute("height",a.height.baseVal.valueAsString),De.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),De.innerHTML=a.innerHTML,d.naturalSize===!0?(De.width.baseVal.value=o.naturalWidth,De.height.baseVal.value=o.naturalHeight):d.width!==void 0&&d.height!==void 0&&(De.width.baseVal.value=d.width,De.height.baseVal.value=d.height),F.width=De.width.baseVal.value,F.height=De.height.baseVal.value;var nt=De.outerHTML,bt=F.getContext("2d");d.markersOnly!==!0&&bt.drawImage(o,0,0,F.width,F.height);var Ue=window.URL,Bt=new Image(F.width,F.height);Bt.setAttribute("crossOrigin","anonymous");var nn=new Blob([nt],{type:"image/svg+xml"}),An=Ue.createObjectURL(nn);Bt.onload=function(){bt.drawImage(Bt,0,0),Ue.revokeObjectURL(An);var Ti=F.toDataURL(d.imageType,d.imageQuality);c(Ti)},Bt.src=An})},h}(),At=function(){},ot=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 dt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Te("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Te("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}(),dt=function(h,o){this.selector=h,this.style=o},Te=function(h,o){this.localName=h,this.style=o},Ke=function(){function h(o,a,u,d,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=d,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 F=document.createElement("div");F.className=""+a.toolbarButtonStyleClass.name,F.setAttribute("data-type-name",c.typeName),F.innerHTML=c.icon,F.addEventListener("click",function(){a.markerToolbarButtonClicked(F,c)}),a.buttons.push(F),a.markerButtons.push(F)}),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 d=document.createElement("div");d.className=this.toolbarBlockStyleClass.name,d.style.whiteSpace="nowrap",d.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(d),this.addActionButton(d,'<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(d,'<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 d=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){d.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 Te("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 Te("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Te("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Te("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 Te("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new dt("."+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}(),tt=function(){function h(o,a,u,d){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=d,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Te("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 Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("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 Te("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new dt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new dt("."+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,d=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 F;c.uiStyleSettings=d.uiStyleSettings;var De=document.createElement("div");De.className=d.toolboxButtonStyleClass.name+" "+((F=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&F!==void 0?F:d.toolboxButtonStyleColorsClass.name),De.innerHTML=c.icon,De.title=c.title,De.addEventListener("click",function(){d.panelButtonClick(c)}),d.panelButtons.push(De),d.buttonRow.appendChild(De)}),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 d=o.getUi();d.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(d),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,F){var De,nt;c.className=a.toolboxButtonStyleClass.name+" "+(F===u?""+((De=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&De!==void 0?De:a.toolboxActiveButtonStyleColorsClass.name):""+((nt=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&nt!==void 0?nt:a.toolboxButtonStyleColorsClass.name))})},h}(),ct=function(h,o){this.title=h,this.icon=o},Qe=function(h){function o(a,u,d,c){var F=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 F.colors=[],F.addTransparent=!1,F.colorBoxes=[],F.colors=u,F.currentColor=d,F.setCurrentColor=F.setCurrentColor.bind(F),F.getColorBox=F.getColorBox.bind(F),F}return Ve(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(d){var c=a.getColorBox(d);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,d=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-d,F=document.createElement("div");F.style.display="inline-block",F.style.boxSizing="content-box",F.style.width=c-2+"px",F.style.height=c-2+"px",F.style.padding="1px",F.style.marginRight="2px",F.style.marginBottom="2px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderRadius=(c+2)/2+"px",F.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){u.setCurrentColor(a,F)});var De=document.createElement("div");return De.style.display="inline-block",De.style.width=c-2+"px",De.style.height=c-2+"px",De.style.backgroundColor=a,De.style.borderRadius=c/2+"px",a==="transparent"&&(De.style.fill=this.uiStyleSettings.toolboxAccentColor,De.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>`),F.appendChild(De),F},o.prototype.setCurrentColor=function(a,u){var d=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(ct),Be=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}(),Ye=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}(),Ot=function(){function h(){this.GRIP_SIZE=10,this.visual=R.createGroup(),this.visual.appendChild(R.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(R.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}(),pt=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}(),mt=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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(R.createTransform()),c.setupControlBox(),c}return Ve(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=R.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 d=this.unrotatePoint(a);if(this.manipulationStartX=d.x,this.manipulationStartY=d.y,this.offsetX=d.x-this.left,this.offsetY=d.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 F=this.container.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(F,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,d=this.manipulationStartWidth,c=this.manipulationStartTop,F=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,d=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:d=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,F=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:F=this.manipulationStartHeight+a.y-this.manipulationStartY}d>=0?(this.left=u,this.width=d):(this.left=u+d,this.width=-d),F>=0?(this.top=c,this.height=F):(this.top=c+F,this.height=-F),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(),d=R.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var d=R.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.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=R.createGroup();var a=R.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=R.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=R.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 Ye,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 Ot;return a.visual.transform.baseVal.appendItem(R.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,d=u,c=(this.width+this.CB_DISTANCE)/2-a/2,F=(this.height+this.CB_DISTANCE)/2-a/2,De=this.height+this.CB_DISTANCE-a/2,nt=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,d),this.positionGrip(this.controlGrips.topCenter.visual,c,d),this.positionGrip(this.controlGrips.topRight.visual,nt,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,F),this.positionGrip(this.controlGrips.centerRight.visual,nt,F),this.positionGrip(this.controlGrips.bottomLeft.visual,u,De),this.positionGrip(this.controlGrips.bottomCenter.visual,c,De),this.positionGrip(this.controlGrips.bottomRight.visual,nt,De),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,d-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,d){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,d),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:pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:pt.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(pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u);var d=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:d.x*a,y:d.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Be),rt=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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 Ve(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=R.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),R.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&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&R.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}(mt),Rt=function(h){function o(a,u,d,c){var F=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return F.widths=[],F.widthBoxes=[],F.widths=u,F.currentWidth=d,F.setCurrentWidth=F.setCurrentWidth.bind(F),F}return Ve(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(d){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=d===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(d,c)}),u.appendChild(c);var F=document.createElement("div");F.innerText=d.toString(),F.style.marginRight="5px",c.appendChild(F);var De=document.createElement("div");De.style.minHeight="20px",De.style.flexGrow="2",De.style.display="flex",De.style.alignItems="center";var nt=document.createElement("hr");nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,nt.style.flexGrow="2",De.appendChild(nt),c.appendChild(De),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var d=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(ct),Mt=function(h){function o(a,u,d,c){var F=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 F.styles=[],F.styleBoxes=[],F.styles=u,F.currentStyle=d,F.setCurrentStyle=F.setCurrentStyle.bind(F),F}return Ve(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(d){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=d===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(d,c)}),u.appendChild(c);var F=document.createElement("div");F.style.minHeight="20px",F.style.flexGrow="2",F.style.overflow="hidden";var De=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(d!==""?'stroke-dasharray="'+d+'"':"")+` />
</svg>`;F.innerHTML=De,c.appendChild(F),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var d=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(ct),Ct=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.strokeColor=d.defaultColor,c.strokeWidth=d.defaultStrokeWidth,c.strokeDasharray=d.defaultStrokeDasharray,c.strokePanel=new Qe("Line color",d.defaultColorSet,d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Rt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Mt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ve(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}(rt),_e=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},jt=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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 Ve(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=R.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 Ot;return a.visual.transform.baseVal.appendItem(R.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,d){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,d),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}(Be),wt=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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=d.defaultColor,c.strokeWidth=d.defaultStrokeWidth,c.strokeDasharray=d.defaultStrokeDasharray,c.strokePanel=new Qe("Line color",d.defaultColorSet,d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Rt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Mt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ve(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=R.createGroup(),this.selectorLine=R.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=R.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()),R.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),R.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}(jt),Le=function(h){function o(a,u,d,c){var F=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 F.fonts=[],F.fontBoxes=[],F.fonts=u,F.currentFont=d,F.setCurrentFont=F.setCurrentFont.bind(F),F}return Ve(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(d){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=d===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(d,c)}),u.appendChild(c);var F=document.createElement("div");F.style.display="flex",F.style.minHeight="20px",F.style.flexGrow="2",F.style.fontFamily=d,F.style.overflow="hidden";var De=document.createElement("div");De.style.whiteSpace="nowrap",De.style.overflow="hidden",De.style.textOverflow="ellipsis",De.innerHTML="The quick brown fox jumps over the lazy dog",F.appendChild(De),c.appendChild(F),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var d=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(ct),Je=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=d.defaultColor,c.fontFamily=d.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 Qe("Color",d.defaultColorSet,d.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new Le("Font",d.defaultFontFamilies,d.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return Ve(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(d){d===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=R.createGroup(),this.bgRectangle=R.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=R.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.textElement.transform.baseVal.appendItem(R.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(R.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 d=(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(d,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),d=0,c=0;return u.width>0&&u.height>0&&(d=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:d,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),d=this.getTextPosition(u);d.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+d.x+"px, "+d.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(d.x,d.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&&(R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.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 d=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(d)),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}),d=this.textElement.getBBox(),c={x:d.width*a,y:d.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&&R.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&&R.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}(mt),$=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=d.defaultColor,c.lineWidth=d.defaultStrokeWidth,c.pixelRatio=d.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 Qe("Color",d.defaultColorSet,d.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Rt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return Ve(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=R.createGroup(),this.drawingImage=R.createImage(),this.visual.appendChild(this.drawingImage);var a=R.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),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.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],d=u[0],c=u[1],F=u[2],De=u[3],nt=!1,bt=0;bt<this.canvasElement.height;bt++)for(var Ue=0;Ue<this.canvasElement.width;Ue++)a.data[bt*this.canvasElement.width*4+4*Ue+3]>0&&(nt=!0,bt<c&&(c=bt),Ue<d&&(d=Ue),bt>De&&(De=bt),Ue>F&&(F=Ue));if(nt){this.left=d/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(F-d)/this.pixelRatio,this.height=(De-c)/this.pixelRatio;var Bt=document.createElement("canvas");Bt.width=F-d,Bt.height=De-c,Bt.getContext("2d").putImageData(this.canvasContext.getImageData(d,c,F-d,De-c),0,0),this.drawingImgUrl=Bt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),R.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}(mt),z=function(h){function o(a,u,d){var c=h.call(this,a,d||'<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 Ve(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 d=function(De){var nt="both";switch(De){case 0:nt="both";break;case 1:nt="start";break;case 2:nt="end";break;case 3:nt="none"}var bt=document.createElement("div");if(bt.style.display="flex",bt.style.flexGrow="2",bt.style.alignItems="center",bt.style.justifyContent="space-between",bt.style.padding="5px",bt.style.borderWidth="2px",bt.style.borderStyle="solid",bt.style.borderColor=nt===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",bt.addEventListener("click",function(){a.setCurrentType(nt,bt)}),u.appendChild(bt),nt==="both"||nt==="start"){var Ue=document.createElement("div");Ue.style.display="flex",Ue.style.alignItems="center",Ue.style.minHeight="20px",Ue.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>`,Ue.style.marginLeft="5px",bt.appendChild(Ue)}var Bt=document.createElement("div");Bt.style.display="flex",Bt.style.alignItems="center",Bt.style.minHeight="20px",Bt.style.flexGrow="2";var nn=document.createElement("hr");if(nn.style.minWidth="20px",nn.style.border="0px",nn.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),nn.style.flexGrow="2",Bt.appendChild(nn),bt.appendChild(Bt),nt==="both"||nt==="end"){var An=document.createElement("div");An.style.display="flex",An.style.alignItems="center",An.style.minHeight="20px",An.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>`,An.style.marginRight="5px",bt.appendChild(An)}c.typeBoxes.push(bt)},c=this,F=0;F<4;F++)d(F);return u},o.prototype.setCurrentType=function(a,u){var d=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(ct),K=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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 Ve(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 d=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-d/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+d/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=R.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=R.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(R.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",R.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),R.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 d=this.arrow2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(d,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}(wt),b=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.fillColor=d.defaultFillColor,c.strokeWidth=0,c.fillPanel=new Qe("Color",d.defaultColorSet,d.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return Ve(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}(rt),w=function(h){function o(a,u,d,c){var F=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 F.opacities=[],F.opacityBoxes=[],F.opacities=u,F.currentOpacity=d,F.setCurrentOpacity=F.setCurrentOpacity.bind(F),F}return Ve(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(d){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=d===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(d,c)}),u.appendChild(c);var F=document.createElement("div");F.innerText=100*d+"%",c.appendChild(F),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var d=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(ct),S=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=d.defaultHighlightColor,c.strokeWidth=0,c.opacity=d.defaultHighlightOpacity,c.fillPanel=new Qe("Color",d.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new w("Opacity",d.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ve(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&R.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}(b),T='<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>',ce=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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=d.defaultStrokeColor,c.bgColor=d.defaultFillColor,c.fontFamily=d.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 Qe("Text color",d.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 Qe("Fill color",d.defaultColorSet,c.bgColor,T),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new Le("Font",d.defaultFontFamilies,d.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new Ot,c.tipGrip.visual.transform.baseVal.appendItem(R.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return Ve(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(){R.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=R.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&&(R.setAttributes(this.bgRectangle,[["fill",a]]),R.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),d=this.height/5;a&&(this.tipPosition={x:u+d/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))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+d,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+d}):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))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+d}):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))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-d},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+d,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-d})},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){R.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}(Je),Y=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=d.defaultColor,c.strokeWidth=d.defaultStrokeWidth,c.strokeDasharray=d.defaultStrokeDasharray,c.fillColor=d.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 Qe("Line color",re(d.defaultColorSet,["transparent"]),d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new Qe("Fill color",re(d.defaultColorSet,["transparent"]),c.fillColor,T),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Rt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Mt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new w("Opacity",d.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ve(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=R.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),R.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&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&R.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}(mt),Re=function(h){function o(a,u,d){return h.call(this,a,u,d)||this}return Ve(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=R.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(R.createTransform()),this.visual.appendChild(this.tip1),this.tip2=R.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(R.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&&(R.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()]]),R.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 d=this.tip2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(d,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}(wt),ht=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||this;return c.strokePanel.colors=d.defaultColorSet,c.fillColor="transparent",c}return Ve(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}(Y),kt=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}(),xt=function(h){function o(a,u,d){var c=h.call(this,a,u,d)||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=d.defaultColor,c.strokeWidth=d.defaultStrokeWidth,c.strokeDasharray=d.defaultStrokeDasharray,c.strokePanel=new Qe("Line color",d.defaultColorSet,d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Rt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Mt("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ve(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=R.createGroup(),this.selectorCurve=R.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=R.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()),R.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=R.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=R.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}(jt),Xt=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}(),Vt=function(h){function o(a,u,d){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=d,c}return Ve(o,h),o}(Xt),yt=function(h){function o(a,u,d){d===void 0&&(d=!1);var c=h.call(this,a,d)||this;return c.marker=u,c}return Ve(o,h),o}(Xt),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}(),cn=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 _e,this._isOpen=!1,this.undoRedoManager=new kt,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 ot(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[Ct,$,K,Je,ht,Y,S,ce,Re,b,wt,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ct,$,K,Je,Y,S,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ct,$,K,Je,S]},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 d=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});d!==void 0&&a._availableMarkerTypes.push(d)}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(),qe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&At.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=At.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Xt(o))})},h.prototype.render=function(){return Ie(this,void 0,void 0,function(){var o;return We(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new vt).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(d){var c=new Xt(a,!0);d(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(d){return d(new Xt(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,d=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,d),this._isResizing=!1},h.prototype.scaleMarkers=function(o,a){var u,d=this;this._currentMarker&&this._currentMarker instanceof Je?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==d._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=R.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 Ke(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 tt(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(d){var c=new yt(o,o._currentMarker,!0);d(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(d){return d(new yt(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(F){var De=new yt(o,void 0,!0);F(De),De.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(F){var De=d.markers[F];d.setCurrentMarker(d.markers[F]),d._currentMarker.dispose(),d.markerImage.removeChild(d._currentMarker.container),d.markers.splice(d.markers.indexOf(d._currentMarker),1),d.eventListeners.markerdelete.forEach(function(nt){return nt(new yt(o,De))})},d=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 d=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),d<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new Xt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new Xt(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 Xt(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 Xt(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 Ie(this,void 0,void 0,function(){var o,a,u=this;return We(this,function(d){switch(d.label){case 0:return[4,this.render()];case 1:return o=d.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new Vt(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 d=a._availableMarkerTypes.find(function(F){return F.typeName===u.typeName});if(d!==void 0){var c=a.addNewMarker(d);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 Xt(a))})},h.prototype.addNewMarker=function(o){var a=R.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(d){return d.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(d){return d(new yt(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 $&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker($):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new yt(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 yt(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 yt(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 yt(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){qe.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 Xt(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 Xt(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 d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(h,o)};function Cn(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 Gt(h,o,a,u){return new(a||(a=Promise))(function(d,c){function F(bt){try{nt(u.next(bt))}catch(Ue){c(Ue)}}function De(bt){try{nt(u.throw(bt))}catch(Ue){c(Ue)}}function nt(bt){var Ue;bt.done?d(bt.value):(Ue=bt.value,Ue instanceof a?Ue:new a(function(Bt){Bt(Ue)})).then(F,De)}nt((u=u.apply(h,o||[])).next())})}function pi(h,o){var a,u,d,c,F={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return c={next:De(0),throw:De(1),return:De(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function De(nt){return function(bt){return function(Ue){if(a)throw new TypeError("Generator is already executing.");for(;F;)try{if(a=1,u&&(d=2&Ue[0]?u.return:Ue[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Ue[1])).done)return d;switch(u=0,d&&(Ue=[2&Ue[0],d.value]),Ue[0]){case 0:case 1:d=Ue;break;case 4:return F.label++,{value:Ue[1],done:!1};case 5:F.label++,u=Ue[1],Ue=[0];continue;case 7:Ue=F.ops.pop(),F.trys.pop();continue;default:if(!(d=F.trys,(d=d.length>0&&d[d.length-1])||Ue[0]!==6&&Ue[0]!==2)){F=0;continue}if(Ue[0]===3&&(!d||Ue[1]>d[0]&&Ue[1]<d[3])){F.label=Ue[1];break}if(Ue[0]===6&&F.label<d[1]){F.label=d[1],d=Ue;break}if(d&&F.label<d[2]){F.label=d[2],F.ops.push(Ue);break}d[2]&&F.ops.pop(),F.trys.pop();continue}Ue=o.call(h,F)}catch(Bt){Ue=[6,Bt],u=0}finally{a=d=0}if(5&Ue[0])throw Ue[1];return{value:Ue[0]?Ue[1]:void 0,done:!0}}([nt,bt])}}}var Oi=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}(),Lt=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,d=a;u<d.length;u++){var c=d[u],F=c[0],De=c[1];o.setAttribute(F,De)}},h.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&h.setAttributes(d,u),d},h.createLine=function(o,a,u,d,c){var F=document.createElementNS("http://www.w3.org/2000/svg","line");return F.setAttribute("x1",o.toString()),F.setAttribute("y1",a.toString()),F.setAttribute("x2",u.toString()),F.setAttribute("y2",d.toString()),c&&h.setAttributes(F,c),F},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 d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(d,u),d},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,d,c,F,De){var nt=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(nt,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",c.toString()],["refY",F.toString()]]),nt.appendChild(De),nt},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,d,c,F,De,nt){return"M"+o+","+a+"V"+(a+d)+"H"+(o+u)+"V"+a+"H"+c+"V"+F+"H"+(c+De)+"V"+(F+nt)+"H"+c+"V"+a+"Z"},h}(),ji=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 Qn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Qn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Qn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ri("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ri("_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}(),Qn=function(h,o){this.selector=h,this.style=o},ri=function(h,o){this.localName=h,this.style=o},Ki=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}(),sr=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}(),lr=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return Cn(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}(sr),mn=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}(),St=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return Cn(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}(sr),Ii=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 Ii(o,a),d=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),F=document.createElementNS("http://www.w3.org/2000/svg","svg");F.setAttribute("xmlns","http://www.w3.org/2000/svg"),F.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(F);var De=Lt.createDefs();F.appendChild(De);var nt=Lt.createElement("clipPath",[["id","text-bg-clip"]]);De.appendChild(nt);var bt=Lt.createPath(Lt.getHollowRectanglePath((24-d)/2,(24-c)/2,d,c,(24-d)/2+2,(24-c)/2+2,d-4,c-4));F.appendChild(bt);var Ue=Lt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ue.appendChild(Lt.createTSpan(o+":"+a)),F.appendChild(Ue);var Bt=Ue.getBBox();Lt.setAttributes(Ue,[["x",((24-Bt.width)/2).toString()],["y",((24-Bt.height)/2-Bt.y).toString()]]);var nn=Lt.createPath(Lt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Bt.width))/2,(24-Math.ceil(Bt.height))/2,Math.ceil(Bt.width),Math.ceil(Bt.height)));return nt.appendChild(nn),Lt.setAttributes(bt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(F),F.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}(),wi=function(h){function o(a,u,d){var c=h.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=d,c}return Cn(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}(mn),qt=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=Lt.createGroup(),this.visual.appendChild(Lt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Lt.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 Lt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),Ui=function(){function h(o,a,u,d){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=d,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&&Lt.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=Lt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Lt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(Lt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Lt.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=Lt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new qt(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),Lt.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,F){var De=a.y+u*(F+1);Lt.setAttributes(c,[["x1",""+a.x],["y1",""+De],["x2",""+(a.x+a.width)],["y2",""+De]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,F){var De=a.x+d*(F+1);Lt.setAttributes(c,[["x1",""+De],["y1",""+a.y],["x2",""+De],["y2",""+(a.y+a.height)]])}),Lt.setAttributes(this.cropShadeElement,[["d",Lt.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,d=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+=d,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+=d}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),d=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<d/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=d,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,d,c,F){var De=u/o,nt=d/a;return{x:(c.x-F)*De+F,y:(c.y-F)*nt+F,width:c.width*De,height:c.height*nt}},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}(),Ji=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();Lt.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 d=u%5==0?this.height/3:this.height/6;a+="h4v"+-d+"h1v"+d}a+="v1H0Z",this.scaleShape=Lt.createPath(a);var c=Lt.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=Lt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Lt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var F=Lt.createTSpan("");return F.innerHTML="&deg;",this.angleLabelElement.appendChild(F),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),ur=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,d,c,F,De){var nt=this;return new Promise(function(bt){var Ue=document.createElement("canvas");Ue.width=o.width.baseVal.value-2*d,Ue.height=o.height.baseVal.value-2*d;var Bt=1,nn=1;nt.naturalSize===!0?(Bt=a.naturalWidth/(o.width.baseVal.value-2*d)/F,nn=a.naturalHeight/(o.height.baseVal.value-2*d)/De,Ue.width=a.naturalWidth/F,Ue.height=a.naturalHeight/De):nt.width!==void 0&&nt.height!==void 0&&(Bt=nt.width/u.width,nn=nt.height/u.height,Ue.width*=Bt,Ue.height*=nn);var An=Ue.getContext("2d");An.translate(Ue.width/2,Ue.height/2),An.rotate(c*Math.PI/180),An.scale(F,De),An.translate(-Ue.width/2,-Ue.height/2),An.drawImage(a,0,0,Ue.width,Ue.height);var Ti=document.createElement("canvas");Ti.width=u.width*Bt,Ti.height=u.height*nn,Ti.getContext("2d").putImageData(An.getImageData((u.x-d)*Bt,(u.y-d)*nn,u.width*Bt,u.height*nn),0,0),bt(Ti.toDataURL(nt.imageType,nt.imageQuality))})},h}(),Ge=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 ji(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",Lt.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();Lt.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=Lt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Lt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Lt.createGroup(),this.editingTargetRotationScaleContainer=Lt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=Lt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=Lt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=Lt.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=Lt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ui(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 Ki,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 lr;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(nn){var An=new mn(dr.getIcon(nn.horizontal,nn.vertical),nn.horizontal===0&&nn.vertical===0?"FREE":nn.horizontal+":"+nn.vertical);An.onClick=function(){return o.ratioButtonClicked(nn)},u.push(An)}),this.aspectRatioButton=new wi(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 d=new mn('<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");d.isActive=this.isGridVisible,d.onClick=function(){o.isGridVisible=!o.isGridVisible,d.isActive=o.isGridVisible},a.addButton(d);var c=new mn('<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),!Oi.isLicensed){var F=new St;this.topToolbar.addElementBlock(F);var De=document.createElement("div");De.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var nt=document.createElement("a");nt.style.color="currentColor",nt.href="https://markerjs.com/products/cropro",nt.target="_blank",nt.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>',De.appendChild(nt),F.addElement(De)}var bt=new lr;bt.minWidth=3*this.toolbarHeight+"px",bt.contentAlign="end",this.topToolbar.addButtonBlock(bt);var Ue=new mn('<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");Ue.onClick=this.startRenderAndClose,bt.addButton(Ue),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ue.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Bt=new mn('<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");Bt.onClick=this.close,bt.addButton(Bt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Bt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Ki,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 lr;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new mn('<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 d=new mn('<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");d.onClick=this.rotateRightButtonClicked,a.addButton(d);var c=new St;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new Ji("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(bt){o.rotateBy(bt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var F=new lr;F.minWidth=2*this.toolbarHeight+"px",F.contentAlign="end",this.bottomToolbar.addButtonBlock(F);var De=new mn('<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");De.onClick=this.flipHorizontallyButtonClicked,F.addButton(De);var nt=new mn('<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");nt.onClick=this.flipVerticallyButtonClicked,F.addButton(nt)},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 Ii(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 Gt(this,void 0,void 0,function(){var o,a;return pi(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(d){return d(o,a)}),this.close(!0),[2]}})})},h.prototype.render=function(){return Gt(this,void 0,void 0,function(){var o;return pi(this,function(a){switch(a.label){case 0:return(o=new ur).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),Lt.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 ri("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 ri("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ri("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ri("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 ri("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ri("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Qn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Qn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ri("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 ri("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ri("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 ri("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 ri("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},h.instanceCounter=0,h}(),Ft=C("8hTe"),Qi=C.n(Ft),Er=/<pre[^>]*>/g;function fr(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var pr=ut.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,d=u===void 0?!1:u,c=h.className,F=h.showTextOnly,De=h.showLines,nt=h.replaces,bt=h.zoomImg,Ue=h.hasMask,Bt=h.style,nn=Bt===void 0?{}:Bt,An=h.stylesPrev,Ti=An===void 0?{}:An,Bi=String(a),$n=Object(we.useRef)(),Xi=Object(we.useRef)(),Hr=Object(we.useState)(""),yi=Object(j.a)(Hr,2),Fi=yi[0],Mi=yi[1],mr=Object(we.useState)("office"),Wi=Object(j.a)(mr,2),gr=Wi[0],cr=Wi[1],ao=function(){var vn=new Ge(Xi.current);vn.displayMode="popup",vn.addRenderEventListener(function(){var Vn=Object(Se.a)(le.a.mark(function hn(Gn){var xn;return le.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return $n.current.style.display="none",Kn.next=3,Object(ft.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Gn}});case 3:xn=Kn.sent,xn!=null&&xn.id&&nt(Xi.current.getAttribute("src").replace(Pe.a.API_SERVER,""),"/api/attachments/".concat(xn==null?void 0:xn.id,"?type=").concat(xn.content_type));case 5:case"end":return Kn.stop()}},hn)}));return function(hn){return Vn.apply(this,arguments)}}()),vn.show()},Vr=function(){var vn=new cn(Xi.current);vn.settings.displayMode="popup",vn.addEventListener("render",function(){var Vn=Object(Se.a)(le.a.mark(function hn(Gn){var xn;return le.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if($n.current.style.display="none",!Xi.current){Kn.next=6;break}return Kn.next=4,Object(ft.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Gn.dataUrl}});case 4:xn=Kn.sent,xn!=null&&xn.id&&nt(Xi.current.getAttribute("src").replace(Pe.a.API_SERVER,""),"/api/attachments/".concat(xn==null?void 0:xn.id,"?type=").concat(xn.content_type));case 6:case"end":return Kn.stop()}},hn)}));return function(hn){return Vn.apply(this,arguments)}}()),vn.show(),window.markerArea=vn},qi=Object(we.useMemo)(function(){try{var In=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,vn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Vn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Bi=Bi.replace(In,"("+Pe.a.API_SERVER+"/api/attachments/").replace(vn,'"'+Pe.a.API_SERVER+"/api/attachments/").replace(Vn,'"'+Pe.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,`
`),Bi=Bi.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(er){}var hn=Ze(Bi),Gn=ve();if(Bi.match(/\[TOC\]/)&&(hn=hn.replace("<p>[TOC]</p>",Fe()),je()),hn=hn.replace(/(__special_katext_id_\d+__)/g,function(er,Kn){var bi=Gn[Kn],Gr=bi.type,Kr=bi.expression;return Object(Ne.renderToString)(fr(Kr)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),hn=hn.replace(/▁/g,"\u2581\u2581\u2581"),ie(),F){var xn=document.createElement("div");return xn.innerHTML=hn,xn.innerText}return setTimeout(function(){return Pr()},500),hn},[Bi]),qn=Object(we.useRef)();xe.WebkitLineClamp=De,De&&(nn=Object(x.a)(Object(x.a)({},nn),xe));function Sr(In){var vn=In.target;if(vn.tagName.toUpperCase()==="IMG"){if(bt){var Vn=vn.getAttribute("src");Mi(Vn),cr("image")}}else if(vn.tagName.toUpperCase()==="A"){var hn=vn.getAttribute("href");if(hn.indexOf("office")>-1)In.preventDefault(),Mi(hn),cr("office");else if(hn.indexOf("application/pdf")>-1)In.preventDefault(),Mi(hn),cr("pdf");else if(hn.indexOf("type=text")>-1)In.preventDefault(),Mi(hn),cr("html");else if(hn.startsWith("#")){In.preventDefault();var Gn=document.getElementById(hn.replace("#",""));Gn&&Gn.scrollIntoView(!0)}}}var Pr=function(){var vn,Vn=(vn=qn.current)===null||vn===void 0?void 0:vn.querySelectorAll("video");Vn==null||Vn.forEach(function(hn){if(hn.oncontextmenu=function(){return!1},hn.src.indexOf(".m3u8")>-1&&!hn.canPlayType("application/vnd.apple.mpegurl")){if(ae.a.isSupported()){var Gn=new ae.a;Gn.loadSource(hn.src),Gn.attachMedia(hn)}}})};Object(we.useEffect)(function(){if(qn.current&&qi&&(qi.match(Er)&&window.PR.prettyPrint()),qn.current)return qn.current.addEventListener("click",Sr),function(){qn.current.removeEventListener("click",Sr),ie(),je()}},[qi,qn.current,Sr]);var yo=function(vn){if(!d)return;vn.target.nodeName==="IMG"?($n.current.style.display="flex",$n.current.style.width=vn.target.clientWidth+"px",$n.current.style.height=vn.target.clientHeight+"px",$n.current.style.top=vn.target.offsetTop+"px",$n.current.style.left=vn.target.offsetLeft+"px",Xi.current.src=vn.target.getAttribute("src")):$n.current.style.display="none"};return W.a.createElement("div",{style:{position:"relative"}},W.a.createElement("div",{ref:qn,style:Object(x.a)({},nn),className:"".concat(c||""," markdown-body ").concat(Qi.a.mdBody),onMouseOver:yo,dangerouslySetInnerHTML:{__html:qi}}),W.a.createElement("div",{ref:$n,className:Qi.a.button},W.a.createElement(Ce.a,null,W.a.createElement(Q.a,{onClick:function(){return ao()}},"\u88C1\u526A"),W.a.createElement(Q.a,{onClick:function(){return Vr()}},"\u7F16\u8F91"))),W.a.createElement("img",{ref:Xi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),W.a.createElement(it.a,{close:!0,data:Fi,hasMask:Ue,type:Fi!=null&&Fi.length?gr:"",style:Object(x.a)({},Ti),onClose:function(){return Mi("")}}))}},"9VGf":function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return me});var B=C("q1tI"),Ce=C.n(B);function me(Q,x){var Se=Object(B.useRef)();Object(B.useEffect)(function(){Se.current=Q}),Object(B.useEffect)(function(){function j(){Se.current()}if(x!==null){var oe=setInterval(j,x);return function(){return clearInterval(oe)}}},[x])}},"9ZNV":function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return we});var B=C("0Owb"),Ce=C("+L6B"),me=C("2/Rp"),Q=C("q1tI"),x=C.n(Q),Se=C("UUDw"),j=C.n(Se),oe=C("TSYQ"),le=C.n(oe),we=function(H){var be=H.cancelText,se=be===void 0?"\u53D6\u6D88":be,J=H.okText,U=J===void 0?"\u786E\u5B9A":J,P=H.loading,q=P===void 0?!1:P,ee=H.hasOkBtn,Ee=ee===void 0?!0:ee,je=H.okButtonProps,xe=je===void 0?{}:je,de=H.onCancel,Fe=de===void 0?function(){}:de,ue=H.onOk,ge=ue===void 0?function(){}:ue,Ae=H.className,fe=Ae===void 0?"":Ae;return x.a.createElement("div",{className:le()(j.a.buttonFixed,fe)},x.a.createElement("div",{className:j.a.buttonWrap},x.a.createElement(me.a,{size:"large",className:"".concat(j.a.button," mr20"),onClick:Fe},se),Ee&&x.a.createElement(me.a,Object(B.a)({size:"large",type:"primary",className:"".concat(j.a.button," mr20"),loading:q,onClick:ge},xe),U)))}},Bd2K:function(Ut,ut,C){(function(B){B(C("VrN/"),C("osHv"))})(function(B){B.defineOption("autoCloseTags",!1,function(le,we,W){if(W!=B.Init&&W&&le.removeKeyMap("autoCloseTags"),!we)return;var H={name:"autoCloseTags"};(typeof we!="object"||we.whenClosing!==!1)&&(H["'/'"]=function(be){return Se(be)}),(typeof we!="object"||we.whenOpening!==!1)&&(H["'>'"]=function(be){return Q(be)}),le.addKeyMap(H)});var Ce=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],me=["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 Q(le){if(le.getOption("disableInput"))return B.Pass;for(var we=le.listSelections(),W=[],H=le.getOption("autoCloseTags"),be=0;be<we.length;be++){if(!we[be].empty())return B.Pass;var se=we[be].head,J=le.getTokenAt(se),U=B.innerMode(le.getMode(),J.state),P=U.state,q=U.mode.xmlCurrentTag&&U.mode.xmlCurrentTag(P),ee=q&&q.name;if(!ee)return B.Pass;var Ee=U.mode.configuration=="html",je=typeof H=="object"&&H.dontCloseTags||Ee&&Ce,xe=typeof H=="object"&&H.indentTags||Ee&&me;J.end>se.ch&&(ee=ee.slice(0,ee.length-J.end+se.ch));var de=ee.toLowerCase();if(!ee||J.type=="string"&&(J.end!=se.ch||!/[\"\']/.test(J.string.charAt(J.string.length-1))||J.string.length==1)||J.type=="tag"&&q.close||J.string.indexOf("/")==se.ch-J.start-1||je&&j(je,de)>-1||oe(le,U.mode.xmlCurrentContext&&U.mode.xmlCurrentContext(P)||[],ee,se,!0))return B.Pass;var Fe=typeof H=="object"&&H.emptyTags;if(Fe&&j(Fe,ee)>-1){W[be]={text:"/>",newPos:B.Pos(se.line,se.ch+2)};continue}var ue=xe&&j(xe,de)>-1;W[be]={indent:ue,text:">"+(ue?`
`:"")+"</"+ee+">",newPos:ue?B.Pos(se.line+1,0):B.Pos(se.line,se.ch+1)}}for(var ge=typeof H=="object"&&H.dontIndentOnAutoClose,be=we.length-1;be>=0;be--){var Ae=W[be];le.replaceRange(Ae.text,we[be].head,we[be].anchor,"+insert");var fe=le.listSelections().slice(0);fe[be]={head:Ae.newPos,anchor:Ae.newPos},le.setSelections(fe),!ge&&Ae.indent&&(le.indentLine(Ae.newPos.line,null,!0),le.indentLine(Ae.newPos.line+1,null,!0))}}function x(le,we){for(var W=le.listSelections(),H=[],be=we?"/":"</",se=le.getOption("autoCloseTags"),J=typeof se=="object"&&se.dontIndentOnSlash,U=0;U<W.length;U++){if(!W[U].empty())return B.Pass;var P=W[U].head,q=le.getTokenAt(P),ee=B.innerMode(le.getMode(),q.state),Ee=ee.state;if(we&&(q.type=="string"||q.string.charAt(0)!="<"||q.start!=P.ch-1))return B.Pass;var je,xe=ee.mode.name!="xml"&&le.getMode().name=="htmlmixed";if(xe&&ee.mode.name=="javascript")je=be+"script";else if(xe&&ee.mode.name=="css")je=be+"style";else{var de=ee.mode.xmlCurrentContext&&ee.mode.xmlCurrentContext(Ee);if(!de||de.length&&oe(le,de,de[de.length-1],P))return B.Pass;je=be+de[de.length-1]}le.getLine(P.line).charAt(q.end)!=">"&&(je+=">"),H[U]=je}if(le.replaceSelections(H),W=le.listSelections(),!J)for(var U=0;U<W.length;U++)(U==W.length-1||W[U].head.line<W[U+1].head.line)&&le.indentLine(W[U].head.line)}function Se(le){return le.getOption("disableInput")?B.Pass:x(le,!0)}B.commands.closeTag=function(le){return x(le)};function j(le,we){if(le.indexOf)return le.indexOf(we);for(var W=0,H=le.length;W<H;++W)if(le[W]==we)return W;return-1}function oe(le,we,W,H,be){if(!B.scanForClosingTag)return!1;var se=Math.min(le.lastLine()+1,H.line+500),J=B.scanForClosingTag(le,H,null,se);if(!J||J.tag!=W)return!1;for(var U=be?1:0,P=we.length-1;P>=0&&we[P]==W;P--)++U;H=J.to;for(var P=1;P<U;P++){var q=B.scanForClosingTag(le,H,null,se);if(!q||q.tag!=W)return!1;H=q.to}return!0}})},BjJ7:function(Ut,ut,C){"use strict";C.d(ut,"d",function(){return Ce}),C.d(ut,"c",function(){return me}),C.d(ut,"e",function(){return Q}),C.d(ut,"b",function(){return x}),C.d(ut,"a",function(){return j});var B=C("m3rI");function Ce(oe){var le=!0;if(oe.length>0){for(var we=0;we<oe.length;we++)if(oe[we].compile_success==0||!oe[we].compile_success){le=!1;break}}else le=!1;return le}function me(oe){for(var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",we=[],W=0;W<oe.length;W++){var H=oe[W],be=le?"".concat(le,"/").concat(H.name):"".concat(H.name);we.push({title:H.name,isLeaf:!(H.type==="tree"),key:be})}return we}function Q(oe,le,we){for(var W=0;W<oe.length;W++){var H=oe[W];if(H.key===le){H.children=we;break}H.children&&Q(H.children,le,we)}return oe}function x(oe,le,we){var W;return function(){var H=this,be=arguments,se=function(){W=null,we||oe.apply(H,be)},J=we&&!W;clearTimeout(W),W=setTimeout(se,le),J&&oe.apply(H,be)}}var Se=!0,j=B.a.API_SERVER},"C+DQ":function(Ut,ut,C){},DlQD:function(Ut,ut,C){(function(B,Ce){Ut.exports=Ce()})(this,function(){"use strict";function B($,z){for(var K=0;K<z.length;K++){var b=z[K];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty($,b.key,b)}}function Ce($,z,K){return z&&B($.prototype,z),K&&B($,K),$}function me($,z){if(!$)return;if(typeof $=="string")return Q($,z);var K=Object.prototype.toString.call($).slice(8,-1);if(K==="Object"&&$.constructor&&(K=$.constructor.name),K==="Map"||K==="Set")return Array.from($);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return Q($,z)}function Q($,z){(z==null||z>$.length)&&(z=$.length);for(var K=0,b=new Array(z);K<z;K++)b[K]=$[K];return b}function x($,z){var K;if(typeof Symbol=="undefined"||$[Symbol.iterator]==null){if(Array.isArray($)||(K=me($))||z&&$&&typeof $.length=="number"){K&&($=K);var b=0;return function(){return b>=$.length?{done:!0}:{done:!1,value:$[b++]}}}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 K=$[Symbol.iterator](),K.next.bind(K)}function Se($,z){return z={exports:{}},$(z,z.exports),z.exports}var j=Se(function($){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 K(b){$.exports.defaults=b}$.exports={defaults:z(),getDefaults:z,changeDefaults:K}}),oe=j.defaults,le=j.getDefaults,we=j.changeDefaults,W=/[&<>"']/,H=/[&<>"']/g,be=/[<>"']|&(?!#?\w+;)/,se=/[<>"']|&(?!#?\w+;)/g,J={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},U=function(z){return J[z]};function P($,z){if(z){if(W.test($))return $.replace(H,U)}else if(be.test($))return $.replace(se,U);return $}var q=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ee($){return $.replace(q,function(z,K){return K=K.toLowerCase(),K==="colon"?":":K.charAt(0)==="#"?K.charAt(1)==="x"?String.fromCharCode(parseInt(K.substring(2),16)):String.fromCharCode(+K.substring(1)):""})}var Ee=/(^|[^\[])\^/g;function je($,z){$=$.source||$,z=z||"";var K={replace:function(w,S){return S=S.source||S,S=S.replace(Ee,"$1"),$=$.replace(w,S),K},getRegex:function(){return new RegExp($,z)}};return K}var xe=/[^\w:]/g,de=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Fe($,z,K){if($){var b;try{b=decodeURIComponent(ee(K)).replace(xe,"").toLowerCase()}catch(w){return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}z&&!de.test(K)&&(K=k(z,K));try{K=encodeURI(K).replace(/%25/g,"%")}catch(w){return null}return K}var ue={},ge=/^[^:]+:\/*[^/]*$/,Ae=/^([^:]+:)[\s\S]*$/,fe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function k($,z){ue[" "+$]||(ge.test($)?ue[" "+$]=$+"/":ue[" "+$]=ye($,"/",!0)),$=ue[" "+$];var K=$.indexOf(":")===-1;return z.substring(0,2)==="//"?K?z:$.replace(Ae,"$1")+z:z.charAt(0)==="/"?K?z:$.replace(fe,"$1")+z:$+z}var ve={exec:function(){}};function ie($){for(var z=1,K,b;z<arguments.length;z++){K=arguments[z];for(b in K)Object.prototype.hasOwnProperty.call(K,b)&&($[b]=K[b])}return $}function N($,z){var K=$.replace(/\|/g,function(S,T,ce){for(var Y=!1,Re=T;--Re>=0&&ce[Re]==="\\";)Y=!Y;return Y?"|":" |"}),b=K.split(/ \|/),w=0;if(b.length>z)b.splice(z);else for(;b.length<z;)b.push("");for(;w<b.length;w++)b[w]=b[w].trim().replace(/\\\|/g,"|");return b}function ye($,z,K){var b=$.length;if(b===0)return"";for(var w=0;w<b;){var S=$.charAt(b-w-1);if(S===z&&!K)w++;else if(S!==z&&K)w++;else break}return $.substr(0,b-w)}function Oe($,z){if($.indexOf(z[1])===-1)return-1;for(var K=$.length,b=0,w=0;w<K;w++)if($[w]==="\\")w++;else if($[w]===z[0])b++;else if($[w]===z[1]&&(b--,b<0))return w;return-1}function pe($){$&&$.sanitize&&!$.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 Ze={escape:P,unescape:ee,edit:je,cleanUrl:Fe,resolveUrl:k,noopTest:ve,merge:ie,splitCells:N,rtrim:ye,findClosingBracket:Oe,checkSanitizeDeprecation:pe},O=j.defaults,v=Ze.rtrim,ae=Ze.splitCells,Pe=Ze.escape,Ne=Ze.findClosingBracket;function it($,z,K){var b=z.href,w=z.title?Pe(z.title):null,S=$[1].replace(/\\([\[\]])/g,"$1");return $[0].charAt(0)!=="!"?{type:"link",raw:K,href:b,title:w,text:S}:{type:"image",raw:K,href:b,title:w,text:Pe(S)}}function ft($,z){var K=$.match(/^(\s+)(?:```)/);if(K===null)return z;var b=K[1];return z.split(`
`).map(function(w){var S=w.match(/^\s+/);if(S===null)return w;var T=S[0];return T.length>=b.length?w.slice(b.length):w}).join(`
`)}var He=function(){function $(K){this.options=K||O}var z=$.prototype;return z.space=function(b){var w=this.rules.block.newline.exec(b);if(w)return w[0].length>1?{type:"space",raw:w[0]}:{raw:`
`}},z.code=function(b,w){var S=this.rules.block.code.exec(b);if(S){var T=w[w.length-1];if(T&&T.type==="paragraph")return{raw:S[0],text:S[0].trimRight()};var ce=S[0].replace(/^ {4}/gm,"");return{type:"code",raw:S[0],codeBlockStyle:"indented",text:this.options.pedantic?ce:v(ce,`
`)}}},z.fences=function(b){var w=this.rules.block.fences.exec(b);if(w){var S=w[0],T=ft(S,w[3]||"");return{type:"code",raw:S,lang:w[2]?w[2].trim():w[2],text:T}}},z.heading=function(b){var w=this.rules.block.heading.exec(b);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},z.nptable=function(b){var w=this.rules.block.nptable.exec(b);if(w){var S={type:"table",header:ae(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
`):[],raw:w[0]};if(S.header.length===S.align.length){var T=S.align.length,ce;for(ce=0;ce<T;ce++)/^ *-+: *$/.test(S.align[ce])?S.align[ce]="right":/^ *:-+: *$/.test(S.align[ce])?S.align[ce]="center":/^ *:-+ *$/.test(S.align[ce])?S.align[ce]="left":S.align[ce]=null;for(T=S.cells.length,ce=0;ce<T;ce++)S.cells[ce]=ae(S.cells[ce],S.header.length);return S}}},z.hr=function(b){var w=this.rules.block.hr.exec(b);if(w)return{type:"hr",raw:w[0]}},z.blockquote=function(b){var w=this.rules.block.blockquote.exec(b);if(w){var S=w[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:w[0],text:S}}},z.list=function(b){var w=this.rules.block.list.exec(b);if(w){for(var S=w[0],T=w[2],ce=T.length>1,Y=T[T.length-1]===")",Re={type:"list",raw:S,ordered:ce,start:ce?+T.slice(0,-1):"",loose:!1,items:[]},ht=w[0].match(this.rules.block.item),kt=!1,xt,Xt,Vt,yt,On,cn,En,Cn=ht.length,Gt=0;Gt<Cn;Gt++)xt=ht[Gt],S=xt,Xt=xt.length,xt=xt.replace(/^ *([*+-]|\d+[.)]) */,""),~xt.indexOf(`
`)&&(Xt-=xt.length,xt=this.options.pedantic?xt.replace(/^ {1,4}/gm,""):xt.replace(new RegExp("^ {1,"+Xt+"}","gm"),"")),Gt!==Cn-1&&(Vt=this.rules.block.bullet.exec(ht[Gt+1])[0],(ce?Vt.length===1||!Y&&Vt[Vt.length-1]===")":Vt.length>1||this.options.smartLists&&Vt!==T)&&(yt=ht.slice(Gt+1).join(`
`),Re.raw=Re.raw.substring(0,Re.raw.length-yt.length),Gt=Cn-1)),On=kt||/\n\n(?!\s*$)/.test(xt),Gt!==Cn-1&&(kt=xt.charAt(xt.length-1)===`
`,On||(On=kt)),On&&(Re.loose=!0),cn=/^\[[ xX]\] /.test(xt),En=void 0,cn&&(En=xt[1]!==" ",xt=xt.replace(/^\[[ xX]\] +/,"")),Re.items.push({type:"list_item",raw:S,task:cn,checked:En,loose:On,text:xt});return Re}},z.html=function(b){var w=this.rules.block.html.exec(b);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]):Pe(w[0]):w[0]}},z.def=function(b){var w=this.rules.block.def.exec(b);if(w){w[3]&&(w[3]=w[3].substring(1,w[3].length-1));var S=w[1].toLowerCase().replace(/\s+/g," ");return{tag:S,raw:w[0],href:w[2],title:w[3]}}},z.table=function(b){var w=this.rules.block.table.exec(b);if(w){var S={type:"table",header:ae(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
`):[]};if(S.header.length===S.align.length){S.raw=w[0];var T=S.align.length,ce;for(ce=0;ce<T;ce++)/^ *-+: *$/.test(S.align[ce])?S.align[ce]="right":/^ *:-+: *$/.test(S.align[ce])?S.align[ce]="center":/^ *:-+ *$/.test(S.align[ce])?S.align[ce]="left":S.align[ce]=null;for(T=S.cells.length,ce=0;ce<T;ce++)S.cells[ce]=ae(S.cells[ce].replace(/^ *\| *| *\| *$/g,""),S.header.length);return S}}},z.lheading=function(b){var w=this.rules.block.lheading.exec(b);if(w)return{type:"heading",raw:w[0],depth:w[2].charAt(0)==="="?1:2,text:w[1]}},z.paragraph=function(b){var w=this.rules.block.paragraph.exec(b);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(b,w){var S=this.rules.block.text.exec(b);if(S){var T=w[w.length-1];return T&&T.type==="text"?{raw:S[0],text:S[0]}:{type:"text",raw:S[0],text:S[0]}}},z.escape=function(b){var w=this.rules.inline.escape.exec(b);if(w)return{type:"escape",raw:w[0],text:Pe(w[1])}},z.tag=function(b,w,S){var T=this.rules.inline.tag.exec(b);if(T)return!w&&/^<a /i.test(T[0])?w=!0:w&&/^<\/a>/i.test(T[0])&&(w=!1),!S&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?S=!0:S&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(S=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:w,inRawBlock:S,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):Pe(T[0]):T[0]}},z.link=function(b){var w=this.rules.inline.link.exec(b);if(w){var S=Ne(w[2],"()");if(S>-1){var T=w[0].indexOf("!")===0?5:4,ce=T+w[1].length+S;w[2]=w[2].substring(0,S),w[0]=w[0].substring(0,ce).trim(),w[3]=""}var Y=w[2],Re="";if(this.options.pedantic){var ht=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Y);ht?(Y=ht[1],Re=ht[3]):Re=""}else Re=w[3]?w[3].slice(1,-1):"";Y=Y.trim().replace(/^<([\s\S]*)>$/,"$1");var kt=it(w,{href:Y&&Y.replace(this.rules.inline._escapes,"$1"),title:Re&&Re.replace(this.rules.inline._escapes,"$1")},w[0]);return kt}},z.reflink=function(b,w){var S;if((S=this.rules.inline.reflink.exec(b))||(S=this.rules.inline.nolink.exec(b))){var T=(S[2]||S[1]).replace(/\s+/g," ");if(T=w[T.toLowerCase()],!T||!T.href){var ce=S[0].charAt(0);return{type:"text",raw:ce,text:ce}}var Y=it(S,T,S[0]);return Y}},z.strong=function(b,w,S){S===void 0&&(S="");var T=this.rules.inline.strong.start.exec(b);if(T&&(!T[1]||T[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){w=w.slice(-1*b.length);var ce=T[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ce.lastIndex=0;for(var Y;(T=ce.exec(w))!=null;)if(Y=this.rules.inline.strong.middle.exec(w.slice(0,T.index+3)),Y)return{type:"strong",raw:b.slice(0,Y[0].length),text:b.slice(2,Y[0].length-2)}}},z.em=function(b,w,S){S===void 0&&(S="");var T=this.rules.inline.em.start.exec(b);if(T&&(!T[1]||T[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){w=w.slice(-1*b.length);var ce=T[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ce.lastIndex=0;for(var Y;(T=ce.exec(w))!=null;)if(Y=this.rules.inline.em.middle.exec(w.slice(0,T.index+2)),Y)return{type:"em",raw:b.slice(0,Y[0].length),text:b.slice(1,Y[0].length-1)}}},z.codespan=function(b){var w=this.rules.inline.code.exec(b);if(w){var S=w[2].replace(/\n/g," "),T=/[^ ]/.test(S),ce=S.startsWith(" ")&&S.endsWith(" ");return T&&ce&&(S=S.substring(1,S.length-1)),S=Pe(S,!0),{type:"codespan",raw:w[0],text:S}}},z.br=function(b){var w=this.rules.inline.br.exec(b);if(w)return{type:"br",raw:w[0]}},z.del=function(b){var w=this.rules.inline.del.exec(b);if(w)return{type:"del",raw:w[0],text:w[1]}},z.autolink=function(b,w){var S=this.rules.inline.autolink.exec(b);if(S){var T,ce;return S[2]==="@"?(T=Pe(this.options.mangle?w(S[1]):S[1]),ce="mailto:"+T):(T=Pe(S[1]),ce=T),{type:"link",raw:S[0],text:T,href:ce,tokens:[{type:"text",raw:T,text:T}]}}},z.url=function(b,w){var S;if(S=this.rules.inline.url.exec(b)){var T,ce;if(S[2]==="@")T=Pe(this.options.mangle?w(S[0]):S[0]),ce="mailto:"+T;else{var Y;do Y=S[0],S[0]=this.rules.inline._backpedal.exec(S[0])[0];while(Y!==S[0]);T=Pe(S[0]),S[1]==="www."?ce="http://"+T:ce=T}return{type:"link",raw:S[0],text:T,href:ce,tokens:[{type:"text",raw:T,text:T}]}}},z.inlineText=function(b,w,S){var T=this.rules.inline.text.exec(b);if(T){var ce;return w?ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):Pe(T[0]):T[0]:ce=Pe(this.options.smartypants?S(T[0]):T[0]),{type:"text",raw:T[0],text:ce}}},$}(),Ve=Ze.noopTest,Ie=Ze.edit,We=Ze.merge,re={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ve,table:Ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};re._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,re._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,re.def=Ie(re.def).replace("label",re._label).replace("title",re._title).getRegex(),re.bullet=/(?:[*+-]|\d{1,9}[.)])/,re.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,re.item=Ie(re.item,"gm").replace(/bull/g,re.bullet).getRegex(),re.list=Ie(re.list).replace(/bull/g,re.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+re.def.source+")").getRegex(),re._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",re._comment=/<!--(?!-?>)[\s\S]*?-->/,re.html=Ie(re.html,"i").replace("comment",re._comment).replace("tag",re._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),re.paragraph=Ie(re._paragraph).replace("hr",re.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",re._tag).getRegex(),re.blockquote=Ie(re.blockquote).replace("paragraph",re.paragraph).getRegex(),re.normal=We({},re),re.gfm=We({},re.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*|$)"}),re.gfm.nptable=Ie(re.gfm.nptable).replace("hr",re.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",re._tag).getRegex(),re.gfm.table=Ie(re.gfm.table).replace("hr",re.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",re._tag).getRegex(),re.pedantic=We({},re.normal,{html:Ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ve,paragraph:Ie(re.normal._paragraph).replace("hr",re.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",re.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var R={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ve,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};R._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",R.punctuation=Ie(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",R._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",R.em.start=Ie(R.em.start).replace(/punctuation/g,R._punctuation).getRegex(),R.em.middle=Ie(R.em.middle).replace(/punctuation/g,R._punctuation).replace(/overlapSkip/g,R._overlapSkip).getRegex(),R.em.endAst=Ie(R.em.endAst,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.em.endUnd=Ie(R.em.endUnd,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.strong.start=Ie(R.strong.start).replace(/punctuation/g,R._punctuation).getRegex(),R.strong.middle=Ie(R.strong.middle).replace(/punctuation/g,R._punctuation).replace(/blockSkip/g,R._blockSkip).getRegex(),R.strong.endAst=Ie(R.strong.endAst,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.strong.endUnd=Ie(R.strong.endUnd,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=Ie(R._blockSkip,"g").getRegex(),R.overlapSkip=Ie(R._overlapSkip,"g").getRegex(),R._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,R._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,R._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])?)+(?![-_])/,R.autolink=Ie(R.autolink).replace("scheme",R._scheme).replace("email",R._email).getRegex(),R._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,R.tag=Ie(R.tag).replace("comment",re._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=Ie(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=Ie(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=Ie(R.reflinkSearch,"g").replace("reflink",R.reflink).replace("nolink",R.nolink).getRegex(),R.normal=We({},R),R.pedantic=We({},R.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:Ie(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:Ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=We({},R.normal,{escape:Ie(R.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),R.gfm.url=Ie(R.gfm.url,"i").replace("email",R.gfm._extended_email).getRegex(),R.breaks=We({},R.gfm,{br:Ie(R.br).replace("{2,}","*").getRegex(),text:Ie(R.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var qe={block:re,inline:R},vt=j.defaults,At=qe.block,ot=qe.inline;function dt($){return $.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 Te($){var z="",K,b,w=$.length;for(K=0;K<w;K++)b=$.charCodeAt(K),Math.random()>.5&&(b="x"+b.toString(16)),z+="&#"+b+";";return z}var Ke=function(){function $(K){this.tokens=[],this.tokens.links=Object.create(null),this.options=K||vt,this.options.tokenizer=this.options.tokenizer||new He,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var b={block:At.normal,inline:ot.normal};this.options.pedantic?(b.block=At.pedantic,b.inline=ot.pedantic):this.options.gfm&&(b.block=At.gfm,this.options.breaks?b.inline=ot.breaks:b.inline=ot.gfm),this.tokenizer.rules=b}$.lex=function(b,w){var S=new $(w);return S.lex(b)};var z=$.prototype;return z.lex=function(b){return b=b.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(b,this.tokens,!0),this.inline(this.tokens),this.tokens},z.blockTokens=function(b,w,S){w===void 0&&(w=[]),S===void 0&&(S=!0),b=b.replace(/^ +$/gm,"");for(var T,ce,Y,Re;b;){if(T=this.tokenizer.space(b)){b=b.substring(T.raw.length),T.type&&w.push(T);continue}if(T=this.tokenizer.code(b,w)){b=b.substring(T.raw.length),T.type?w.push(T):(Re=w[w.length-1],Re.raw+=`
`+T.raw,Re.text+=`
`+T.text);continue}if(T=this.tokenizer.fences(b)){b=b.substring(T.raw.length),w.push(T);continue}if(T=this.tokenizer.heading(b)){b=b.substring(T.raw.length),w.push(T);continue}if(T=this.tokenizer.nptable(b)){b=b.substring(T.raw.length),w.push(T);continue}if(T=this.tokenizer.hr(b)){b=b.substring(T.raw.length),w.push(T);continue}if(T=this.tokenizer.blockquote(b)){b=b.substring(T.raw.length),T.tokens=this.blockTokens(T.text,[],S),w.push(T);continue}if(T=this.tokenizer.list(b)){for(b=b.substring(T.raw.length),Y=T.items.length,ce=0;ce<Y;ce++)T.items[ce].tokens=this.blockTokens(T.items[ce].text,[],!1);w.push(T);continue}if(T=this.tokenizer.html(b)){b=b.substring(T.raw.length),w.push(T);continue}if(S&&(T=this.tokenizer.def(b))){b=b.substring(T.raw.length),this.tokens.links[T.tag]||(this.tokens.links[T.tag]={href:T.href,title:T.title});continue}if(T=this.tokenizer.table(b)){b=b.substring(T.raw.length),w.push(T);continue}if(T=this.tokenizer.lheading(b)){b=b.substring(T.raw.length),w.push(T);continue}if(S&&(T=this.tokenizer.paragraph(b))){b=b.substring(T.raw.length),w.push(T);continue}if(T=this.tokenizer.text(b,w)){b=b.substring(T.raw.length),T.type?w.push(T):(Re=w[w.length-1],Re.raw+=`
`+T.raw,Re.text+=`
`+T.text);continue}if(b){var ht="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return w},z.inline=function(b){var w,S,T,ce,Y,Re,ht=b.length;for(w=0;w<ht;w++){Re=b[w];switch(Re.type){case"paragraph":case"text":case"heading":{Re.tokens=[],this.inlineTokens(Re.text,Re.tokens);break}case"table":{for(Re.tokens={header:[],cells:[]},ce=Re.header.length,S=0;S<ce;S++)Re.tokens.header[S]=[],this.inlineTokens(Re.header[S],Re.tokens.header[S]);for(ce=Re.cells.length,S=0;S<ce;S++)for(Y=Re.cells[S],Re.tokens.cells[S]=[],T=0;T<Y.length;T++)Re.tokens.cells[S][T]=[],this.inlineTokens(Y[T],Re.tokens.cells[S][T]);break}case"blockquote":{this.inline(Re.tokens);break}case"list":{for(ce=Re.items.length,S=0;S<ce;S++)this.inline(Re.items[S].tokens);break}}}return b},z.inlineTokens=function(b,w,S,T,ce){w===void 0&&(w=[]),S===void 0&&(S=!1),T===void 0&&(T=!1),ce===void 0&&(ce="");var Y,Re=b,ht;if(this.tokens.links){var kt=Object.keys(this.tokens.links);if(kt.length>0)for(;(ht=this.tokenizer.rules.inline.reflinkSearch.exec(Re))!=null;)kt.includes(ht[0].slice(ht[0].lastIndexOf("[")+1,-1))&&(Re=Re.slice(0,ht.index)+"["+"a".repeat(ht[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ht=this.tokenizer.rules.inline.blockSkip.exec(Re))!=null;)Re=Re.slice(0,ht.index)+"["+"a".repeat(ht[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;b;){if(Y=this.tokenizer.escape(b)){b=b.substring(Y.raw.length),w.push(Y);continue}if(Y=this.tokenizer.tag(b,S,T)){b=b.substring(Y.raw.length),S=Y.inLink,T=Y.inRawBlock,w.push(Y);continue}if(Y=this.tokenizer.link(b)){b=b.substring(Y.raw.length),Y.type==="link"&&(Y.tokens=this.inlineTokens(Y.text,[],!0,T)),w.push(Y);continue}if(Y=this.tokenizer.reflink(b,this.tokens.links)){b=b.substring(Y.raw.length),Y.type==="link"&&(Y.tokens=this.inlineTokens(Y.text,[],!0,T)),w.push(Y);continue}if(Y=this.tokenizer.strong(b,Re,ce)){b=b.substring(Y.raw.length),Y.tokens=this.inlineTokens(Y.text,[],S,T),w.push(Y);continue}if(Y=this.tokenizer.em(b,Re,ce)){b=b.substring(Y.raw.length),Y.tokens=this.inlineTokens(Y.text,[],S,T),w.push(Y);continue}if(Y=this.tokenizer.codespan(b)){b=b.substring(Y.raw.length),w.push(Y);continue}if(Y=this.tokenizer.br(b)){b=b.substring(Y.raw.length),w.push(Y);continue}if(Y=this.tokenizer.del(b)){b=b.substring(Y.raw.length),Y.tokens=this.inlineTokens(Y.text,[],S,T),w.push(Y);continue}if(Y=this.tokenizer.autolink(b,Te)){b=b.substring(Y.raw.length),w.push(Y);continue}if(!S&&(Y=this.tokenizer.url(b,Te))){b=b.substring(Y.raw.length),w.push(Y);continue}if(Y=this.tokenizer.inlineText(b,T,dt)){b=b.substring(Y.raw.length),ce=Y.raw.slice(-1),w.push(Y);continue}if(b){var xt="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(xt);break}else throw new Error(xt)}}return w},Ce($,null,[{key:"rules",get:function(){return{block:At,inline:ot}}}]),$}(),tt=j.defaults,ct=Ze.cleanUrl,Qe=Ze.escape,Be=function(){function $(K){this.options=K||tt}var z=$.prototype;return z.code=function(b,w,S){var T=(w||"").match(/\S*/)[0];if(this.options.highlight){var ce=this.options.highlight(b,T);ce!=null&&ce!==b&&(S=!0,b=ce)}return T?'<pre><code class="'+this.options.langPrefix+Qe(T,!0)+'">'+(S?b:Qe(b,!0))+`</code></pre>
`:"<pre><code>"+(S?b:Qe(b,!0))+`</code></pre>
`},z.blockquote=function(b){return`<blockquote>
`+b+`</blockquote>
`},z.html=function(b){return b},z.heading=function(b,w,S,T){return this.options.headerIds?"<h"+w+' id="'+this.options.headerPrefix+T.slug(S)+'">'+b+"</h"+w+`>
`:"<h"+w+">"+b+"</h"+w+`>
`},z.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},z.list=function(b,w,S){var T=w?"ol":"ul",ce=w&&S!==1?' start="'+S+'"':"";return"<"+T+ce+`>
`+b+"</"+T+`>
`},z.listitem=function(b){return"<li>"+b+`</li>
`},z.checkbox=function(b){return"<input "+(b?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},z.paragraph=function(b){return"<p>"+b+`</p>
`},z.table=function(b,w){return w&&(w="<tbody>"+w+"</tbody>"),`<table>
<thead>
`+b+`</thead>
`+w+`</table>
`},z.tablerow=function(b){return`<tr>
`+b+`</tr>
`},z.tablecell=function(b,w){var S=w.header?"th":"td",T=w.align?"<"+S+' align="'+w.align+'">':"<"+S+">";return T+b+"</"+S+`>
`},z.strong=function(b){return"<strong>"+b+"</strong>"},z.em=function(b){return"<em>"+b+"</em>"},z.codespan=function(b){return"<code>"+b+"</code>"},z.br=function(){return this.options.xhtml?"<br/>":"<br>"},z.del=function(b){return"<del>"+b+"</del>"},z.link=function(b,w,S){if(b=ct(this.options.sanitize,this.options.baseUrl,b),b===null)return S;var T='<a href="'+Qe(b)+'"';return w&&(T+=' title="'+w+'"'),T+=">"+S+"</a>",T},z.image=function(b,w,S){if(b=ct(this.options.sanitize,this.options.baseUrl,b),b===null)return S;var T='<img src="'+b+'" alt="'+S+'"';return w&&(T+=' title="'+w+'"'),T+=this.options.xhtml?"/>":">",T},z.text=function(b){return b},$}(),Ye=function(){function $(){}var z=$.prototype;return z.strong=function(b){return b},z.em=function(b){return b},z.codespan=function(b){return b},z.del=function(b){return b},z.html=function(b){return b},z.text=function(b){return b},z.link=function(b,w,S){return""+S},z.image=function(b,w,S){return""+S},z.br=function(){return""},$}(),Ot=function(){function $(){this.seen={}}var z=$.prototype;return z.slug=function(b){var w=b.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(w)){var S=w;do this.seen[S]++,w=S+"-"+this.seen[S];while(this.seen.hasOwnProperty(w))}return this.seen[w]=0,w},$}(),pt=j.defaults,mt=Ze.unescape,rt=function(){function $(K){this.options=K||pt,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ye,this.slugger=new Ot}$.parse=function(b,w){var S=new $(w);return S.parse(b)};var z=$.prototype;return z.parse=function(b,w){w===void 0&&(w=!0);var S="",T,ce,Y,Re,ht,kt,xt,Xt,Vt,yt,On,cn,En,Cn,Gt,pi,Oi,Lt,ji=b.length;for(T=0;T<ji;T++){yt=b[T];switch(yt.type){case"space":continue;case"hr":{S+=this.renderer.hr();continue}case"heading":{S+=this.renderer.heading(this.parseInline(yt.tokens),yt.depth,mt(this.parseInline(yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{S+=this.renderer.code(yt.text,yt.lang,yt.escaped);continue}case"table":{for(Xt="",xt="",Re=yt.header.length,ce=0;ce<Re;ce++)xt+=this.renderer.tablecell(this.parseInline(yt.tokens.header[ce]),{header:!0,align:yt.align[ce]});for(Xt+=this.renderer.tablerow(xt),Vt="",Re=yt.cells.length,ce=0;ce<Re;ce++){for(kt=yt.tokens.cells[ce],xt="",ht=kt.length,Y=0;Y<ht;Y++)xt+=this.renderer.tablecell(this.parseInline(kt[Y]),{header:!1,align:yt.align[Y]});Vt+=this.renderer.tablerow(xt)}S+=this.renderer.table(Xt,Vt);continue}case"blockquote":{Vt=this.parse(yt.tokens),S+=this.renderer.blockquote(Vt);continue}case"list":{for(On=yt.ordered,cn=yt.start,En=yt.loose,Re=yt.items.length,Vt="",ce=0;ce<Re;ce++)Gt=yt.items[ce],pi=Gt.checked,Oi=Gt.task,Cn="",Gt.task&&(Lt=this.renderer.checkbox(pi),En?Gt.tokens.length>0&&Gt.tokens[0].type==="text"?(Gt.tokens[0].text=Lt+" "+Gt.tokens[0].text,Gt.tokens[0].tokens&&Gt.tokens[0].tokens.length>0&&Gt.tokens[0].tokens[0].type==="text"&&(Gt.tokens[0].tokens[0].text=Lt+" "+Gt.tokens[0].tokens[0].text)):Gt.tokens.unshift({type:"text",text:Lt}):Cn+=Lt),Cn+=this.parse(Gt.tokens,En),Vt+=this.renderer.listitem(Cn,Oi,pi);S+=this.renderer.list(Vt,On,cn);continue}case"html":{S+=this.renderer.html(yt.text);continue}case"paragraph":{S+=this.renderer.paragraph(this.parseInline(yt.tokens));continue}case"text":{for(Vt=yt.tokens?this.parseInline(yt.tokens):yt.text;T+1<ji&&b[T+1].type==="text";)yt=b[++T],Vt+=`
`+(yt.tokens?this.parseInline(yt.tokens):yt.text);S+=w?this.renderer.paragraph(Vt):Vt;continue}default:{var Qn='Token with "'+yt.type+'" type was not found.';if(this.options.silent){console.error(Qn);return}else throw new Error(Qn)}}}return S},z.parseInline=function(b,w){w=w||this.renderer;var S="",T,ce,Y=b.length;for(T=0;T<Y;T++){ce=b[T];switch(ce.type){case"escape":{S+=w.text(ce.text);break}case"html":{S+=w.html(ce.text);break}case"link":{S+=w.link(ce.href,ce.title,this.parseInline(ce.tokens,w));break}case"image":{S+=w.image(ce.href,ce.title,ce.text);break}case"strong":{S+=w.strong(this.parseInline(ce.tokens,w));break}case"em":{S+=w.em(this.parseInline(ce.tokens,w));break}case"codespan":{S+=w.codespan(ce.text);break}case"br":{S+=w.br();break}case"del":{S+=w.del(this.parseInline(ce.tokens,w));break}case"text":{S+=w.text(ce.text);break}default:{var Re='Token with "'+ce.type+'" type was not found.';if(this.options.silent){console.error(Re);return}else throw new Error(Re)}}}return S},$}(),Rt=Ze.merge,Mt=Ze.checkSanitizeDeprecation,Ct=Ze.escape,_e=j.getDefaults,jt=j.changeDefaults,wt=j.defaults;function Le($,z,K){if(typeof $=="undefined"||$===null)throw new Error("marked(): input parameter is undefined or null");if(typeof $!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call($)+", string expected");if(typeof z=="function"&&(K=z,z=null),z=Rt({},Le.defaults,z||{}),Mt(z),K){var b=z.highlight,w;try{w=Ke.lex($,z)}catch(Y){return K(Y)}var S=function(Re){var ht;if(!Re)try{ht=rt.parse(w,z)}catch(kt){Re=kt}return z.highlight=b,Re?K(Re):K(null,ht)};if(!b||b.length<3)return S();if(delete z.highlight,!w.length)return S();var T=0;Le.walkTokens(w,function(Y){Y.type==="code"&&(T++,setTimeout(function(){b(Y.text,Y.lang,function(Re,ht){if(Re)return S(Re);ht!=null&&ht!==Y.text&&(Y.text=ht,Y.escaped=!0),T--,T===0&&S()})},0))}),T===0&&S();return}try{var ce=Ke.lex($,z);return z.walkTokens&&Le.walkTokens(ce,z.walkTokens),rt.parse(ce,z)}catch(Y){if(Y.message+=`
Please report this to https://github.com/markedjs/marked.`,z.silent)return"<p>An error occurred:</p><pre>"+Ct(Y.message+"",!0)+"</pre>";throw Y}}Le.options=Le.setOptions=function($){return Rt(Le.defaults,$),jt(Le.defaults),Le},Le.getDefaults=_e,Le.defaults=wt,Le.use=function($){var z=Rt({},$);if($.renderer&&function(){var b=Le.defaults.renderer||new Be,w=function(ce){var Y=b[ce];b[ce]=function(){for(var Re=arguments.length,ht=new Array(Re),kt=0;kt<Re;kt++)ht[kt]=arguments[kt];var xt=$.renderer[ce].apply(b,ht);return xt===!1&&(xt=Y.apply(b,ht)),xt}};for(var S in $.renderer)w(S);z.renderer=b}(),$.tokenizer&&function(){var b=Le.defaults.tokenizer||new He,w=function(ce){var Y=b[ce];b[ce]=function(){for(var Re=arguments.length,ht=new Array(Re),kt=0;kt<Re;kt++)ht[kt]=arguments[kt];var xt=$.tokenizer[ce].apply(b,ht);return xt===!1&&(xt=Y.apply(b,ht)),xt}};for(var S in $.tokenizer)w(S);z.tokenizer=b}(),$.walkTokens){var K=Le.defaults.walkTokens;z.walkTokens=function(b){$.walkTokens(b),K&&K(b)}}Le.setOptions(z)},Le.walkTokens=function($,z){for(var K=x($),b;!(b=K()).done;){var w=b.value;z(w);switch(w.type){case"table":{for(var S=x(w.tokens.header),T;!(T=S()).done;){var ce=T.value;Le.walkTokens(ce,z)}for(var Y=x(w.tokens.cells),Re;!(Re=Y()).done;)for(var ht=Re.value,kt=x(ht),xt;!(xt=kt()).done;){var Xt=xt.value;Le.walkTokens(Xt,z)}break}case"list":{Le.walkTokens(w.items,z);break}default:w.tokens&&Le.walkTokens(w.tokens,z)}}},Le.Parser=rt,Le.parser=rt.parse,Le.Renderer=Be,Le.TextRenderer=Ye,Le.Lexer=Ke,Le.lexer=Ke.lex,Le.Tokenizer=He,Le.Slugger=Ot,Le.parse=Le;var Je=Le;return Je})},ELLl:function(Ut,ut,C){(function(B){B(C("VrN/"))})(function(B){var Ce={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},me=B.Pos;B.defineOption("autoCloseBrackets",!1,function(J,U,P){P&&P!=B.Init&&(J.removeKeyMap(x),J.state.closeBrackets=null),U&&(Se(Q(U,"pairs")),J.state.closeBrackets=U,J.addKeyMap(x))});function Q(J,U){return U=="pairs"&&typeof J=="string"?J:typeof J=="object"&&J[U]!=null?J[U]:Ce[U]}var x={Backspace:le,Enter:we};function Se(J){for(var U=0;U<J.length;U++){var P=J.charAt(U),q="'"+P+"'";x[q]||(x[q]=j(P))}}Se(Ce.pairs+"`");function j(J){return function(U){return H(U,J)}}function oe(J){var U=J.state.closeBrackets;if(!U||U.override)return U;var P=J.getModeAt(J.getCursor());return P.closeBrackets||U}function le(J){var U=oe(J);if(!U||J.getOption("disableInput"))return B.Pass;for(var P=Q(U,"pairs"),q=J.listSelections(),ee=0;ee<q.length;ee++){if(!q[ee].empty())return B.Pass;var Ee=be(J,q[ee].head);if(!Ee||P.indexOf(Ee)%2!=0)return B.Pass}for(var ee=q.length-1;ee>=0;ee--){var je=q[ee].head;J.replaceRange("",me(je.line,je.ch-1),me(je.line,je.ch+1),"+delete")}}function we(J){var U=oe(J),P=U&&Q(U,"explode");if(!P||J.getOption("disableInput"))return B.Pass;for(var q=J.listSelections(),ee=0;ee<q.length;ee++){if(!q[ee].empty())return B.Pass;var Ee=be(J,q[ee].head);if(!Ee||P.indexOf(Ee)%2!=0)return B.Pass}J.operation(function(){var je=J.lineSeparator()||`
`;J.replaceSelection(je+je,null),J.execCommand("goCharLeft"),q=J.listSelections();for(var xe=0;xe<q.length;xe++){var de=q[xe].head.line;J.indentLine(de,null,!0),J.indentLine(de+1,null,!0)}})}function W(J){var U=B.cmpPos(J.anchor,J.head)>0;return{anchor:new me(J.anchor.line,J.anchor.ch+(U?-1:1)),head:new me(J.head.line,J.head.ch+(U?1:-1))}}function H(J,U){var P=oe(J);if(!P||J.getOption("disableInput"))return B.Pass;var q=Q(P,"pairs"),ee=q.indexOf(U);if(ee==-1)return B.Pass;for(var Ee=Q(P,"closeBefore"),je=Q(P,"triples"),xe=q.charAt(ee+1)==U,de=J.listSelections(),Fe=ee%2==0,ue,ge=0;ge<de.length;ge++){var Ae=de[ge],fe=Ae.head,k,ve=J.getRange(fe,me(fe.line,fe.ch+1));if(Fe&&!Ae.empty())k="surround";else if((xe||!Fe)&&ve==U)xe&&se(J,fe)?k="both":je.indexOf(U)>=0&&J.getRange(fe,me(fe.line,fe.ch+3))==U+U+U?k="skipThree":k="skip";else if(xe&&fe.ch>1&&je.indexOf(U)>=0&&J.getRange(me(fe.line,fe.ch-2),fe)==U+U){if(fe.ch>2&&/\bstring/.test(J.getTokenTypeAt(me(fe.line,fe.ch-2))))return B.Pass;k="addFour"}else if(xe){var ie=fe.ch==0?" ":J.getRange(me(fe.line,fe.ch-1),fe);if(!B.isWordChar(ve)&&ie!=U&&!B.isWordChar(ie))k="both";else return B.Pass}else if(Fe&&(ve.length===0||/\s/.test(ve)||Ee.indexOf(ve)>-1))k="both";else return B.Pass;if(!ue)ue=k;else if(ue!=k)return B.Pass}var N=ee%2?q.charAt(ee-1):U,ye=ee%2?U:q.charAt(ee+1);J.operation(function(){if(ue=="skip")J.execCommand("goCharRight");else if(ue=="skipThree")for(var Oe=0;Oe<3;Oe++)J.execCommand("goCharRight");else if(ue=="surround"){for(var pe=J.getSelections(),Oe=0;Oe<pe.length;Oe++)pe[Oe]=N+pe[Oe]+ye;J.replaceSelections(pe,"around"),pe=J.listSelections().slice();for(var Oe=0;Oe<pe.length;Oe++)pe[Oe]=W(pe[Oe]);J.setSelections(pe)}else ue=="both"?(J.replaceSelection(N+ye,null),J.triggerElectric(N+ye),J.execCommand("goCharLeft")):ue=="addFour"&&(J.replaceSelection(N+N+N+N,"before"),J.execCommand("goCharRight"))})}function be(J,U){var P=J.getRange(me(U.line,U.ch-1),me(U.line,U.ch+1));return P.length==2?P:null}function se(J,U){var P=J.getTokenAt(me(U.line,U.ch+1));return/\bstring/.test(P.type)&&P.start==U.ch&&(U.ch==0||!/\bstring/.test(J.getTokenTypeAt(U)))}})},F8wB:function(Ut,ut,C){Ut.exports={loading:"loading___1SIOG"}},Gytx:function(Ut,ut){Ut.exports=function(B,Ce,me,Q){var x=me?me.call(Q,B,Ce):void 0;if(x!==void 0)return!!x;if(B===Ce)return!0;if(typeof B!="object"||!B||typeof Ce!="object"||!Ce)return!1;var Se=Object.keys(B),j=Object.keys(Ce);if(Se.length!==j.length)return!1;for(var oe=Object.prototype.hasOwnProperty.bind(Ce),le=0;le<Se.length;le++){var we=Se[le];if(!oe(we))return!1;var W=B[we],H=Ce[we];if(x=me?me.call(Q,W,H,we):void 0,x===!1||x===void 0&&W!==H)return!1}return!0}},HmJG:function(Ut,ut,C){},I8Z2:function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return Q}),C.d(ut,"b",function(){return be}),C.d(ut,"c",function(){return J});var B=C("q1tI"),Ce=function(){var U=function(P,q){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ee,Ee){ee.__proto__=Ee}||function(ee,Ee){for(var je in Ee)Ee.hasOwnProperty(je)&&(ee[je]=Ee[je])},U(P,q)};return function(P,q){U(P,q);function ee(){this.constructor=P}P.prototype=q===null?Object.create(q):(ee.prototype=q.prototype,new ee)}}(),me=B.createContext(null),Q=function(U){Ce(P,U);function P(){return U!==null&&U.apply(this,arguments)||this}return P.prototype.render=function(){return B.createElement(me.Provider,{value:this.props.store},this.props.children)},P}(B.Component),x=C("Gytx"),Se=C.n(x),j=C("2mql"),oe=C.n(j),le=function(){var U=function(P,q){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ee,Ee){ee.__proto__=Ee}||function(ee,Ee){for(var je in Ee)Ee.hasOwnProperty(je)&&(ee[je]=Ee[je])},U(P,q)};return function(P,q){U(P,q);function ee(){this.constructor=P}P.prototype=q===null?Object.create(q):(ee.prototype=q.prototype,new ee)}}(),we=function(){return we=Object.assign||function(U){for(var P,q=1,ee=arguments.length;q<ee;q++){P=arguments[q];for(var Ee in P)Object.prototype.hasOwnProperty.call(P,Ee)&&(U[Ee]=P[Ee])}return U},we.apply(this,arguments)};function W(U){return U.displayName||U.name||"Component"}var H=function(){return{}};function be(U,P){P===void 0&&(P={});var q=!!U,ee=U||H;return function(je){var xe=function(Fe){le(ue,Fe);function ue(ge,Ae){var fe=Fe.call(this,ge,Ae)||this;return fe.unsubscribe=null,fe.handleChange=function(){if(!fe.unsubscribe)return;var k=ee(fe.store.getState(),fe.props);fe.setState({subscribed:k})},fe.store=fe.context,fe.state={subscribed:ee(fe.store.getState(),ge),store:fe.store,props:ge},fe}return ue.getDerivedStateFromProps=function(ge,Ae){return U&&U.length===2&&ge!==Ae.props?{subscribed:ee(Ae.store.getState(),ge),props:ge}:{props:ge}},ue.prototype.componentDidMount=function(){this.trySubscribe()},ue.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},ue.prototype.shouldComponentUpdate=function(ge,Ae){return!Se()(this.props,ge)||!Se()(this.state.subscribed,Ae.subscribed)},ue.prototype.trySubscribe=function(){q&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},ue.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},ue.prototype.render=function(){var ge=we(we(we({},this.props),this.state.subscribed),{store:this.store});return B.createElement(je,we({},ge,{ref:this.props.miniStoreForwardedRef}))},ue.displayName="Connect("+W(je)+")",ue.contextType=me,ue}(B.Component);if(P.forwardRef){var de=B.forwardRef(function(Fe,ue){return B.createElement(xe,we({},Fe,{miniStoreForwardedRef:ue}))});return oe()(de,je)}return oe()(xe,je)}}var se=function(){return se=Object.assign||function(U){for(var P,q=1,ee=arguments.length;q<ee;q++){P=arguments[q];for(var Ee in P)Object.prototype.hasOwnProperty.call(P,Ee)&&(U[Ee]=P[Ee])}return U},se.apply(this,arguments)};function J(U){var P=U,q=[];function ee(xe){P=se(se({},P),xe);for(var de=0;de<q.length;de++)q[de]()}function Ee(){return P}function je(xe){return q.push(xe),function(){var Fe=q.indexOf(xe);q.splice(Fe,1)}}return{setState:ee,getState:Ee,subscribe:je}}},LdHM:function(Ut,ut,C){"use strict";C.d(ut,"b",function(){return Ee}),C.d(ut,"a",function(){return xe});var B=C("1OyB"),Ce=C("vuIU"),me=C("Ji7U"),Q=C("LK+K"),x=C("q1tI"),Se=C("rePB"),j=C("Ff2n"),oe=C("ODXe"),le=C("4IlW"),we=C("bX4T"),W=C("YrtM"),H=C("TSYQ"),be=C.n(H),se=C("+nKL"),J=C("8OUc"),U=function(ae,Pe){var Ne=ae.prefixCls,it=ae.id,ft=ae.flattenOptions,He=ae.childrenAsData,Ve=ae.values,Ie=ae.searchValue,We=ae.multiple,re=ae.defaultActiveFirstOption,R=ae.height,qe=ae.itemHeight,vt=ae.notFoundContent,At=ae.open,ot=ae.menuItemSelectedIcon,dt=ae.virtual,Te=ae.onSelect,Ke=ae.onToggleOpen,tt=ae.onActiveValue,ct=ae.onScroll,Qe=ae.onMouseEnter,Be="".concat(Ne,"-item"),Ye=Object(W.a)(function(){return ft},[At,ft],function(Je,$){return $[0]&&Je[1]!==$[1]}),Ot=x.useRef(null),pt=function($){$.preventDefault()},mt=function($){Ot.current&&Ot.current.scrollTo({index:$})},rt=function($){for(var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=Ye.length,b=0;b<K;b+=1){var w=($+b*z+K)%K,S=Ye[w],T=S.group,ce=S.data;if(!T&&!ce.disabled)return w}return-1},Rt=x.useState(function(){return rt(0)}),Mt=Object(oe.a)(Rt,2),Ct=Mt[0],_e=Mt[1],jt=function($){_e($);var z=Ye[$];if(!z){tt(null,-1);return}tt(z.data.value,$)};x.useEffect(function(){jt(re!==!1?rt(0):-1)},[Ye.length,Ie]),x.useEffect(function(){var Je=setTimeout(function(){if(!We&&At&&Ve.size===1){var $=Array.from(Ve)[0],z=Ye.findIndex(function(K){var b=K.data;return b.value===$});jt(z),mt(z)}});return function(){return clearTimeout(Je)}},[At]);var wt=function($){$!==void 0&&Te($,{selected:!Ve.has($)}),We||Ke(!1)};if(x.useImperativeHandle(Pe,function(){return{onKeyDown:function($){var z=$.which;switch(z){case le.a.UP:case le.a.DOWN:{var K=0;if(z===le.a.UP?K=-1:z===le.a.DOWN&&(K=1),K!==0){var b=rt(Ct+K,K);mt(b),jt(b)}break}case le.a.ENTER:{var w=Ye[Ct];w&&!w.data.disabled?wt(w.data.value):wt(void 0),At&&$.preventDefault();break}case le.a.ESC:Ke(!1)}},onKeyUp:function(){},scrollTo:function($){mt($)}}}),Ye.length===0)return x.createElement("div",{role:"listbox",id:"".concat(it,"_list"),className:"".concat(Be,"-empty"),onMouseDown:pt},vt);function Le(Je){var $=Ye[Je];if(!$)return null;var z=$.data||{},K=z.value,b=z.label,w=z.children,S=Object(we.a)(z,!0),T=He?w:b;return $?x.createElement("div",Object.assign({"aria-label":typeof T=="string"?T:null},S,{key:Je,role:"option",id:"".concat(it,"_list_").concat(Je),"aria-selected":Ve.has(K)}),K):null}return x.createElement(x.Fragment,null,x.createElement("div",{role:"listbox",id:"".concat(it,"_list"),style:{height:0,width:0,overflow:"hidden"}},Le(Ct-1),Le(Ct),Le(Ct+1)),x.createElement(se.a,{itemKey:"key",ref:Ot,data:Ye,height:R,itemHeight:qe,fullHeight:!1,onMouseDown:pt,onScroll:ct,virtual:dt,onMouseEnter:Qe},function(Je,$){var z,K=Je.group,b=Je.groupOption,w=Je.data,S=w.label,T=w.key;if(K)return x.createElement("div",{className:be()(Be,"".concat(Be,"-group"))},S!==void 0?S:T);var ce=w.disabled,Y=w.value,Re=w.title,ht=w.children,kt=w.style,xt=w.className,Xt=Object(j.a)(w,["disabled","value","title","children","style","className"]),Vt=Ve.has(Y),yt="".concat(Be,"-option"),On=be()(Be,yt,xt,(z={},Object(Se.a)(z,"".concat(yt,"-grouped"),b),Object(Se.a)(z,"".concat(yt,"-active"),Ct===$&&!ce),Object(Se.a)(z,"".concat(yt,"-disabled"),ce),Object(Se.a)(z,"".concat(yt,"-selected"),Vt),z)),cn=He?ht:S,En=!ot||typeof ot=="function"||Vt;return x.createElement("div",Object.assign({},Xt,{"aria-selected":Vt,className:On,title:Re,onMouseMove:function(){if(Ct===$||ce)return;jt($)},onClick:function(){ce||wt(Y)},style:kt}),x.createElement("div",{className:"".concat(yt,"-content")},cn||Y),x.isValidElement(ot)||Vt,En&&x.createElement(J.a,{className:"".concat(Be,"-option-state"),customizeIcon:ot,customizeIconProps:{isSelected:Vt}},Vt?"\u2713":null))}))},P=x.forwardRef(U);P.displayName="OptionList";var q=P,ee=function(){return null};ee.isSelectOption=!0;var Ee=ee,je=function(){return null};je.isSelectOptGroup=!0;var xe=je,de=C("VTBJ"),Fe=C("Zm9Q");function ue(v){var ae=v.key,Pe=v.props,Ne=Pe.children,it=Pe.value,ft=Object(j.a)(Pe,["children","value"]);return Object(de.a)({key:ae,value:it!==void 0?it:ae,children:Ne},ft)}function ge(v){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Fe.a)(v).map(function(Pe,Ne){if(!x.isValidElement(Pe)||!Pe.type)return null;var it=Pe.type.isSelectOptGroup,ft=Pe.key,He=Pe.props,Ve=He.children,Ie=Object(j.a)(He,["children"]);return ae||!it?ue(Pe):Object(de.a)(Object(de.a)({key:"__RC_SELECT_GRP__".concat(ft===null?Ne:ft,"__"),label:ft},Ie),{},{options:ge(Ve)})}).filter(function(Pe){return Pe})}var Ae=C("2Qr1"),fe=C("qNPg"),k=C("U8pU"),ve=C("Kwbf"),ie=C("WKfj");function N(v){var ae=v.mode,Pe=v.options,Ne=v.children,it=v.backfill,ft=v.allowClear,He=v.placeholder,Ve=v.getInputElement,Ie=v.showSearch,We=v.onSearch,re=v.defaultOpen,R=v.autoFocus,qe=v.labelInValue,vt=v.value,At=v.inputValue,ot=v.optionLabelProp,dt=ae==="multiple"||ae==="tags",Te=Ie!==void 0?Ie:dt||ae==="combobox",Ke=Pe||ge(Ne);if(Object(ve.a)(ae!=="tags"||Ke.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ae==="tags"||ae==="combobox"){var tt=Ke.some(function(Be){return Be.options?Be.options.some(function(Ye){return typeof("value"in Ye?Ye.value:Ye.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(ve.a)(!tt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ve.a)(ae!=="combobox"||!ot,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ve.a)(ae==="combobox"||!it,"`backfill` only works with `combobox` mode."),Object(ve.a)(ae==="combobox"||!Ve,"`getInputElement` only work with `combobox` mode."),Object(ve.b)(ae!=="combobox"||!Ve||!ft||!He,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),We&&!Te&&ae!=="combobox"&&ae!=="tags"&&Object(ve.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ve.b)(!re||R,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),vt!=null){var ct=Object(ie.d)(vt);Object(ve.a)(!qe||ct.every(function(Be){return Object(k.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ve.a)(!dt||Array.isArray(vt),"`value` should be array when `mode` is `multiple` or `tags`")}if(Ne){var Qe=null;Object(Fe.a)(Ne).some(function(Be){if(!x.isValidElement(Be)||!Be.type)return!1;var Ye=Be.type;if(Ye.isSelectOption)return!1;if(Ye.isSelectOptGroup){var Ot=Object(Fe.a)(Be.props.children).every(function(pt){return!x.isValidElement(pt)||!Be.type||pt.type.isSelectOption?!0:(Qe=pt.type,!1)});return!Ot}return Qe=Ye,!0}),Qe&&Object(ve.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Qe.displayName||Qe.name||Qe,"`.")),Object(ve.a)(At===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var ye=N,Oe=Object(fe.a)({prefixCls:"rc-select",components:{optionList:q},convertChildrenToData:ge,flattenOptions:Ae.d,getLabeledValue:Ae.e,filterOptions:Ae.b,isValueDisabled:Ae.g,findValueOption:Ae.c,warningProps:ye,fillOptionsWithMissingValue:Ae.a}),pe=function(v){Object(me.a)(Pe,v);var ae=Object(Q.a)(Pe);function Pe(){var Ne;return Object(B.a)(this,Pe),Ne=ae.apply(this,arguments),Ne.selectRef=x.createRef(),Ne.focus=function(){Ne.selectRef.current.focus()},Ne.blur=function(){Ne.selectRef.current.blur()},Ne}return Object(Ce.a)(Pe,[{key:"render",value:function(){return x.createElement(Oe,Object.assign({ref:this.selectRef},this.props))}}]),Pe}(x.Component);pe.Option=Ee,pe.OptGroup=xe;var Ze=pe,O=ut.c=Ze},M8RZ:function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return le});var B=C("fWQN"),Ce=C("mtLc"),me=C("yKVA"),Q=C("879j"),x=C("q1tI"),Se=C.n(x),j=C("i8i4"),oe=C.n(j),le=function(we){Object(me.a)(H,we);var W=Object(Q.a)(H);function H(be){var se;Object(B.a)(this,H),se=W.call(this,be);var J=window.document;return se.node=J.createElement("div"),J.body.appendChild(se.node),se}return Object(Ce.a)(H,[{key:"render",value:function(){var se=this.props.children;return Object(j.createPortal)(se,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),H}(Se.a.Component)},OLES:function(Ut,ut,C){"use strict";var B=C("U8pU"),Ce=C("VTBJ"),me=C("Ff2n"),Q=C("q1tI"),x=C("uciX"),Se=C("7ixt"),j=function(be){var se=be.overlay,J=be.prefixCls,U=be.id,P=be.overlayInnerStyle;return Q.createElement("div",{className:"".concat(J,"-inner"),id:U,role:"tooltip",style:P},typeof se=="function"?se():se)},oe=j,le=function(be,se){var J=be.overlayClassName,U=be.trigger,P=U===void 0?["hover"]:U,q=be.mouseEnterDelay,ee=q===void 0?0:q,Ee=be.mouseLeaveDelay,je=Ee===void 0?.1:Ee,xe=be.overlayStyle,de=be.prefixCls,Fe=de===void 0?"rc-tooltip":de,ue=be.children,ge=be.onVisibleChange,Ae=be.afterVisibleChange,fe=be.transitionName,k=be.animation,ve=be.placement,ie=ve===void 0?"right":ve,N=be.align,ye=N===void 0?{}:N,Oe=be.destroyTooltipOnHide,pe=Oe===void 0?!1:Oe,Ze=be.defaultVisible,O=be.getTooltipContainer,v=be.overlayInnerStyle,ae=Object(me.a)(be,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Pe=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(se,function(){return Pe.current});var Ne=Object(Ce.a)({},ae);"visible"in be&&(Ne.popupVisible=be.visible);var it=function(){var We=be.arrowContent,re=We===void 0?null:We,R=be.overlay,qe=be.id;return[Q.createElement("div",{className:"".concat(Fe,"-arrow"),key:"arrow"},re),Q.createElement(oe,{key:"content",prefixCls:Fe,id:qe,overlay:R,overlayInnerStyle:v})]},ft=!1,He=!1;if(typeof pe=="boolean")ft=pe;else if(pe&&Object(B.a)(pe)==="object"){var Ve=pe.keepParent;ft=Ve===!0,He=Ve===!1}return Q.createElement(x.a,Object.assign({popupClassName:J,prefixCls:Fe,popup:it,action:P,builtinPlacements:Se.a,popupPlacement:ie,ref:Pe,popupAlign:ye,getPopupContainer:O,onPopupVisibleChange:ge,afterPopupVisibleChange:Ae,popupTransitionName:fe,popupAnimation:k,defaultPopupVisible:Ze,destroyPopupOnHide:ft,autoDestroy:He,mouseLeaveDelay:je,popupStyle:xe,mouseEnterDelay:ee},Ne),ue)},we=Object(Q.forwardRef)(le),W=ut.a=we},Ot1p:function(Ut,ut,C){"use strict";var B=C("2qtc"),Ce=C("kLXV"),me=C("rAM+"),Q=C("miYZ"),x=C("tsqr"),Se=C("9og8"),j=C("tJVT"),oe=C("jrin"),le=C("WmNS"),we=C.n(le),W=C("q1tI"),H=C.n(W),be=C("VrN/"),se=C.n(be),J=C("bdgK"),U=C("p77/"),P=C("Bd2K"),q=C("ELLl"),ee=C("19Vz"),Ee=C("lZu9"),je=C("+NIl"),xe=C("kSUc"),de=C("9Bee"),Fe=function(Y){var Re=Y.value,ht=Re===void 0?"":Re,kt=Y.className,xt=Y.showTextOnly,Xt=Y.showLines,Vt=Y.style,yt=Vt===void 0?{}:Vt,On=Object(W.useMemo)(function(){return""},[ht]);return H.a.createElement(H.a.Fragment,null,H.a.createElement("div",{dangerouslySetInnerHTML:{__html:On}}))},ue=C("0Owb"),ge=C("dejd"),Ae=C("C+DQ"),fe=C("1vsH"),k=C("m3rI"),ve=[{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 ie(Y){var Re=Y.onActionCallback,ht=Y.title,kt=Y.icon,xt=Y.actionName,Xt=Y.className,Vt=Xt===void 0?"":Xt,yt=Y.children;function On(){Re(xt)}return H.a.createElement("a",{title:ht,className:Vt,onClick:On},H.a.createElement("i",{className:"md-iconfont ".concat(kt)}),yt)}var N=function(Y){var Re=Y.watch,ht=Y.showNullButton,kt=Y.onActionCallback,xt=Y.fullScreen,Xt=Y.insertTemp,Vt=Y.hidetoolBar,yt=Y.uuid,On=Y.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(fe.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(fe.E)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(k.a.PROXY_SERVER)));var cn=[].concat(ve,[{title:"".concat(Re?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Re?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return H.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&cn.map(function(En,Cn){return H.a.createElement("li",{key:Cn},En.actionName?H.a.createElement(ie,Object(ue.a)({},En,{onActionCallback:kt})):H.a.createElement("span",{className:"v-line"}))}),ht?H.a.createElement("li",null,H.a.createElement(ie,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:kt},H.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Xt&&H.a.createElement("li",null,H.a.createElement(ie,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Xt),onActionCallback:kt},H.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),H.a.createElement("li",{className:"btn-full-screen"},H.a.createElement(ie,{icon:"".concat(xt?"icon-shrink":"icon-enlarge"),title:xt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:kt})))},ye=C("M8RZ"),Oe=C("+L6B"),pe=C("2/Rp"),Ze=C("y8nQ"),O=C("Vl3Y"),v=C("5NDa"),ae=C("5rEg"),Pe={labelCol:{span:4},wrapperCol:{span:20}},Ne=function(Y){var Re=Y.callback,ht=Y.onCancel;function kt(xt){Re(xt)}return H.a.createElement(O.a,Object(ue.a)({},Pe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:kt}),H.a.createElement(O.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},H.a.createElement(ae.a,null)),H.a.createElement(O.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},H.a.createElement(ae.a,null)),H.a.createElement("div",{className:"flex-container flex-end"},H.a.createElement(pe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),H.a.createElement(pe.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},it=C("7ahc"),ft=C("k1fw"),He=C("HmJG"),Ve=C("BjJ7"),Ie=O.a.useForm,We={width:280,marginRight:10},re={labelCol:{span:5},wrapperCol:{span:19}},R=function(Y){var Re=Y.callback,ht=Y.onCancel,kt=Ie(),xt=Object(j.a)(kt,1),Xt=xt[0],Vt=Object(W.useRef)();function yt(En){Re(Object(ft.a)(Object(ft.a)({},En),{},{name:Vt.current}))}function On(En,Cn){Xt.setFieldsValue({src:"/api/attachments/".concat(En.id,"?type=").concat(En.content_type),type:Cn.type})}function cn(En){var Cn=En.target.files[0];Vt.current=Cn.name,vt(Cn,On)}return H.a.createElement(O.a,Object(ue.a)({form:Xt},re,{className:"upload-image-panel",onFinish:yt}),H.a.createElement(O.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},H.a.createElement("div",{className:"flex-container"},H.a.createElement(O.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},H.a.createElement(ae.a,{style:We})),H.a.createElement(qe,{onFileChange:cn}))),H.a.createElement(O.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},H.a.createElement(ae.a,{style:{width:264}})),H.a.createElement(O.a.Item,{style:{textAlign:"right"}},H.a.createElement(pe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),H.a.createElement(pe.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))};function qe(Y){var Re=Y.onFileChange;return H.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",H.a.createElement("input",{type:"file",onChange:Re}))}function vt(Y,Re){if(!Y)throw new String("\u6CA1\u6709\u6587\u4EF6");var ht=new FormData;ht.append("editormd-image-file",Y),ht.append("file_param_name","editormd-image-file"),ht.append("byxhr","true");var kt=new window.XMLHttpRequest;kt.withCredentials=!0,kt.addEventListener("load",function(xt){Re(JSON.parse(xt.target.responseText),Y)},!1),kt.addEventListener("error",function(xt){console.error(xt)},!1),kt.open("POST","".concat(Ve.a,"/api/attachments.json")),kt.send(ht)}var At=C("giR+"),ot=C("fyUT"),dt=C("7Kak"),Te=C("9yH6"),Ke=Te.a.Group,tt={margin:"0 8px"},ct=function(Y){var Re=Y.callback,ht=Y.onCancel;function kt(xt){Re(xt)}return H.a.createElement(O.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:kt},H.a.createElement("div",{className:"flex-container"},H.a.createElement("span",{style:tt},"\u5355\u5143\u683C\u6570\uFF1A"),H.a.createElement("span",{style:tt},"\u884C\u6570"),H.a.createElement(O.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},H.a.createElement(ot.a,null)),H.a.createElement("span",{style:tt},"\u5217\u6570"),H.a.createElement(O.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},H.a.createElement(ot.a,null))),H.a.createElement("div",{className:"flex-container",style:{marginTop:12}},H.a.createElement("span",{style:tt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),H.a.createElement(O.a.Item,{name:"align"},H.a.createElement(Ke,null,H.a.createElement(Te.a,{value:"default"},H.a.createElement("i",{className:"fa fa-align-justify"})),H.a.createElement(Te.a,{value:"left"},H.a.createElement("i",{className:"fa fa-align-left"})),H.a.createElement(Te.a,{value:"center"},H.a.createElement("i",{className:"fa fa-align-center"})),H.a.createElement(Te.a,{value:"right"},H.a.createElement("i",{className:"fa fa-align-right"}))))),H.a.createElement("div",{className:"flex-container flex-end"},H.a.createElement(pe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),H.a.createElement(pe.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},Qe=C("ErOA"),Be=C("7Cbv"),Ye="link",Ot="upload-image",pt="code-block",mt="add-table",rt="------------",Rt={default:rt,left:":".concat(rt),center:":".concat(rt,":"),right:"".concat(rt,":")},Mt=C("9VGf"),Ct,_e;function jt(){}var wt=0,Le=1e4,Je="\u2581",$=`
**\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 z(Y){return/^\d+$/.test(Y)?"".concat(Y,"px"):Y}var K=navigator.platform.toUpperCase().indexOf("MAC")>=0,b=K?"Cmd":"Ctrl",w=["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"],S=(Ct={},Object(oe.a)(Ct,b+"-B","bold"),Object(oe.a)(Ct,b+"-I","italic"),Ct),T=(_e={},Object(oe.a)(_e,Ye,"\u6DFB\u52A0\u94FE\u63A5"),Object(oe.a)(_e,pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(oe.a)(_e,Ot,"\u6DFB\u52A0\u6587\u4EF6"),Object(oe.a)(_e,mt,"\u6DFB\u52A0\u8868\u683C"),_e),ce=ut.a=function(Y){var Re=Y.defaultValue,ht=Re===void 0?"":Re,kt=Y.onChange,xt=Y.width,Xt=xt===void 0?"100%":xt,Vt=Y.height,yt=Vt===void 0?400:Vt,On=Y.miniToolbar,cn=On===void 0?!1:On,En=Y.isFocus,Cn=En===void 0?!1:En,Gt=Y.watch,pi=Y.insertTemp,Oi=Y.mode,Lt=Oi===void 0?"markdown":Oi,ji=Y.id,Qn=ji===void 0?"markdown-editor-id":ji,ri=Y.showResizeBar,Ki=ri===void 0?!1:ri,sr=Y.noStorage,lr=sr===void 0?!1:sr,mn=Y.showNullButton,St=mn===void 0?!1:mn,Ii=Y.hidetoolBar,dr=Ii===void 0?!1:Ii,wi=Y.fullScreen,qt=wi===void 0?!1:wi,Ui=Y.onBlur,Ji=Y.onCMBeforeChange,ur=Y.onFullScreen,Ge=Y.className,Ft=Ge===void 0?"":Ge,Qi=Y.disablePaste,Er=Qi===void 0?!1:Qi,fr=Y.placeholder,pr=fr===void 0?"":fr,h=Y.values,o=h===void 0?"":h,a=Object(W.useState)(null),u=Object(j.a)(a,2),d=u[0],c=u[1],F=Object(W.useState)(ht),De=Object(j.a)(F,2),nt=De[0],bt=De[1],Ue=Object(W.useState)(Gt),Bt=Object(j.a)(Ue,2),nn=Bt[0],An=Bt[1],Ti=Object(W.useState)(qt),Bi=Object(j.a)(Ti,2),$n=Bi[0],Xi=Bi[1],Hr=Object(W.useState)(""),yi=Object(j.a)(Hr,2),Fi=yi[0],Mi=yi[1],mr=Object(W.useState)(0),Wi=Object(j.a)(mr,2),gr=Wi[0],cr=Wi[1],ao=Object(W.useState)(yt),Vr=Object(j.a)(ao,2),qi=Vr[0],qn=Vr[1],Sr=Object(W.useState)(!1),Pr=Object(j.a)(Sr,2),yo=Pr[0],In=Pr[1],vn=Object(W.useRef)(Object(Be.a)()),Vn=Object(W.useRef)(!1),hn=Object(W.useRef)(),Gn=Object(W.useRef)(),xn=Object(W.useRef)(),er=Object(W.useRef)(),Kn=Object(W.useRef)(),bi=function(){var Tt=Object(Se.a)(we.a.mark(function Ht(){var Dt,en;return we.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(Qe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:vn.current}});case 2:en=kn.sent,en!=null&&(Dt=en.attachments)!==null&&Dt!==void 0&&Dt.length&&(console.log("cm:",d,Gn),en.attachments.map(function(ln){ln.content_type.indexOf("image")>-1?d.replaceSelection("![,](/api/attachments/".concat(ln.id,"?type=").concat(ln.content_type,")")):ln.content_type.indexOf("video")>-1?d.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):ln.content_type.indexOf("pdf")>-1?d.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):d.replaceSelection("[".concat(ln.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,")"))}));case 4:case"end":return kn.stop()}},Ht)}));return function(){return Tt.apply(this,arguments)}}();Object(W.useEffect)(function(){bt(o),d==null||d.setValue(o)},[o]),Object(W.useEffect)(function(){ur==null||ur($n)},[$n]),Object(W.useEffect)(function(){if(Gn.current){var Tt=se.a.fromTextArea(Gn.current,{mode:Lt,lineNumbers:!cn,lineWrapping:!0,value:ht,autoCloseTags:!0,autoCloseBrackets:!0});Cn&&Tt.focus();function Ht(Dt,en){if(Er){en.preventDefault();return}var dn=en.clipboardData;if(dn){var kn=dn.types.toString(),ln=dn.items;if(kn==="Files"||dn.types.indexOf("Files")>-1){if(en.preventDefault(),Lt=="stex")return;try{var ei,Ei=ln[1];((ei=ln[0])===null||ei===void 0?void 0:ei.kind)==="file"&&(Ei=ln[0]);var rn=Ei.getAsFile(),kr=rn.name.split(".").pop();vt(rn,function(yn){if(yn.id){var oi,Yi,Ai;(rn==null||((oi=rn.type)===null||oi===void 0)?void 0:oi.indexOf("image"))>-1?Tt.replaceSelection("![,](/api/attachments/".concat(yn.id,"?type=").concat(yn.content_type,")")):(rn==null||((Yi=rn.type)===null||Yi===void 0)?void 0:Yi.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,'"></video>')):(rn==null||((Ai=rn.type)===null||Ai===void 0)?void 0:Ai.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(rn.type,'&disposition=inline" target="_blank">').concat(rn.name,"</a>")):w.includes(kr)?Tt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,'?type=office&disposition=inline" target="_blank">').concat(rn.name,"</a>")):Tt.replaceSelection("[".concat(rn.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,")"))}else(yn==null?void 0:yn.status)===401&&(document.location.href="/user/login")})}catch(yn){x.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",Ht),Tt.on("dragleave",function(Dt,en){xn.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(Dt,en){xn.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(Dt,en){xn.current.classList.add("mouse-hover-md");var dn;if(dn=en.dataTransfer.files,dn.length>0){en.preventDefault(),en.stopPropagation();for(var kn=function(Ei){var rn=dn[Ei],kr=rn.name.split(".").pop();vt(rn,function(yn){if(yn.id){var oi,Yi,Ai;(rn==null||((oi=rn.type)===null||oi===void 0)?void 0:oi.indexOf("image"))>-1?Tt.replaceSelection("![,](/api/attachments/".concat(yn.id,"?type=").concat(yn.content_type,")")):(rn==null||((Yi=rn.type)===null||Yi===void 0)?void 0:Yi.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,'"></video>')):(rn==null||((Ai=rn.type)===null||Ai===void 0)?void 0:Ai.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(rn.type,'&disposition=inline" target="_blank">').concat(rn.name,"</a>")):w.includes(kr)?Tt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,'?type=office&disposition=inline" target="_blank">').concat(rn.name,"</a>")):Tt.replaceSelection("[".concat(rn.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,")"))}else(yn==null?void 0:yn.status)===401&&(document.location.href="/user/login")})},ln=0;ln<dn.length;ln++)kn(ln)}}),c(Tt),function(){Tt.off("paste",Ht)}}},[]);var Gr=Object(W.useCallback)(function(){if(xn.current)try{}catch(Tt){console.log(Tt,"---- to set md editor body height")}},[qi,xn,$n]);Object(W.useEffect)(function(){function Tt(){var Dt=new J.default(function(en){var dn=Object(me.a)(en),kn;try{for(dn.s();!(kn=dn.n()).done;){var ln=kn.value;(ln.target.offsetHeight>0||ln.target.offsetWidth>0)&&(Gr(),d.setSize("100%","100%"),d.refresh())}}catch(ei){dn.e(ei)}finally{dn.f()}});return Dt.observe(Gn.current.parentElement),Dt}if(d){var Ht=Tt();return function(){Ht.unobserve(Gn.current.parentElement)}}},[d,Gr]),Object(W.useEffect)(function(){if(d){for(var Tt=[],Ht=function(){var ln=en[Dt];dn=Object(j.a)(ln,2);var ei=dn[0],Ei=dn[1],rn=Object(oe.a)({},ei,function(){Kr(Ei)});Tt.push(rn),d.addKeyMap(rn)},Dt=0,en=Object.entries(S);Dt<en.length;Dt++){var dn;Ht()}return hn.current=setInterval(function(){Vn.current&&bi()},4e3),function(){clearInterval(hn.current);var kn=Object(me.a)(Tt),ln;try{for(kn.s();!(ln=kn.n()).done;){var ei=ln.value;d.removeKeyMap(ei)}}catch(Ei){kn.e(Ei)}finally{kn.f()}}}},[d]),Object(W.useEffect)(function(){qt!==$n&&Xi(qt)},[qt]),Object(Mt.a)(function(){if(!lr&&gr>0){var Tt=new Date().getTime(),Ht=window.sessionStorage.getItem(Qn);Tt>=gr+Le&&(!Ht||Ht!==nt)&&(window.sessionStorage.setItem(Qn,nt),In(!0))}},Le),Object(W.useEffect)(function(){An(Gt)},[d,Gt]),Object(W.useEffect)(function(){d&&(Cn&&d.focus())},[d,Cn]),Object(W.useEffect)(function(){if(nn&&d){var Tt=d.getScrollerElement();function Ht(Dt){var en=Dt.target;if(Kn.current){var dn=en.scrollTop/en.scrollHeight;Kn.current.scrollTop=Kn.current.scrollHeight*dn}}return Tt.addEventListener("scroll",Ht),function(){Tt.removeEventListener("scroll",Ht)}}},[d,nn]),Object(W.useEffect)(function(){if(d&&Ji){function Tt(Ht,Dt){Ji(Ht,Dt)}return d.on("beforeChange",Tt),function(){d.off("beforeChange",Tt)}}},[d,Ji]),Object(W.useEffect)(function(){if(d&&Ui){function Tt(){Ui(d.getValue())}return d.on("blur",Tt),function(){d.off("blur",Tt)}}},[d,Ui]),Object(W.useEffect)(function(){if(d){function Tt(Ht){var Dt=Ht.getValue();bt(Dt),cr(new Date().getTime()),Ht.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),kt&&kt(Dt)}return d.on("change",Tt),function(){d.off("change",Tt)}}},[d,kt]),Object(W.useEffect)(function(){d&&(ht==null?(d.setValue(""),bt("")):ht!==d.getValue()&&(d.setValue(ht),bt(ht),d.setCursor(d.lineCount(),0)))},[d,ht]);var Kr=Object(W.useCallback)(function(Tt){var Ht=d.getCursor(),Dt=d.getSelection(),en=Dt.split(`
`);switch(Tt){case"bold":return d.replaceSelection("**"+Dt+"**"),Dt===""&&d.setCursor(Ht.line,Ht.ch+2),d.focus();case"italic":return d.replaceSelection("*"+Dt+"*"),Dt===""&&d.setCursor(Ht.line,Ht.ch+1),d.focus();case"code":return d.replaceSelection("`"+Dt+"`"),Dt===""&&d.setCursor(Ht.line,Ht.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+Dt+"$$`"),Dt===""&&d.setCursor(Ht.line,Ht.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+Dt+"\n```"),d.setCursor(Ht.line+1,Dt.length+1),d.focus();case"line-break":return d.replaceSelection(`<br/>
`),d.focus();case"list-ul":return Dt===""?d.replaceSelection("- "+Dt):d.replaceSelection(en.map(function(dn){return dn===""?"":"- ".concat(dn)}).join(`
`)),d.focus();case"list-ol":return Dt===""?d.replaceSelection("1. "+Dt):d.replaceSelection(en.map(function(dn,kn){return dn===""?"":"".concat(kn+1,". ").concat(dn)}).join(`
`)),d.focus();case"add-null-ch":return Dt===""&&d.setCursor(Ht.line,Ht.ch+1),d.replaceSelection(Je),d.focus();case"inster-template-1":return Dt===""&&d.setCursor(Ht.line,Ht.ch),d.replaceSelection($),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return An(!nn),d.focus();case"trigger-full-screen":return Xi(!$n),d.focus();case Ye:Mi(Ye);return;case pt:Mi(pt);return;case Ot:Mi(Ot);return;case mt:Mi(mt);return;default:throw new Error}},[d,nn,$n]),tr=Object(W.useCallback)(function(Tt){Mi("");switch(Fi){case Ye:var Ht=Tt.title,Dt=Tt.link;return d.replaceSelection("[".concat(Ht,"](").concat(Dt,")")),d.focus();case pt:var en=Tt.language,dn=Tt.content;return d.replaceSelection(["```"+en,dn,"```"].join(`
`)),d.focus();case Ot:var kn=Tt.src,ln=Tt.alt,ei=Tt.name;return kn.indexOf("type=image")>-1?d.replaceSelection("![ ".concat(ln||""," ]( ").concat(kn,' "').concat(ln||"",'" )')):kn.indexOf("type=application/pdf")>-1?d.replaceSelection('<a href="'.concat(kn,'&disposition=inline" target="_blank">').concat(ei,"</a>")):d.replaceSelection('<a href="'.concat(kn,'" target="_blank">').concat(ei,"</a>")),d.focus();case mt:for(var Ei=Tt.row,rn=Tt.col,kr=Tt.align,yn=`
`,oi=0;oi<Ei;oi++){for(var Yi=[],Ai=[],Co=0;Co<rn;Co++)oi===1&&Ai.push(Rt[kr]),Yi.push(" ");oi===1&&(yn+="| ".concat(Ai.join(" | "),` |
`)),yn+="| ".concat(Yi.join(rn===1?"":" | "),` |
`)}return d.replaceSelection(yn+`
`),d.focus();default:throw new Error}},[d,Fi]),vr=Object(W.useMemo)(function(){switch(Fi){case Ye:return H.a.createElement(Ne,{callback:tr,onCancel:mi});case pt:return H.a.createElement(it.b,{callback:tr,onCancel:mi});case Ot:return H.a.createElement(R,{callback:tr,onCancel:mi});case mt:return H.a.createElement(ct,{callback:tr,onCancel:mi});default:return null}},[Fi]);function mi(){Mi("")}Object(W.useEffect)(function(){if(er.current){var Tt=er.current,Ht=!1,Dt=0;function en(ln){Ht=!0,Dt=ln.pageY}function dn(){Ht=!1}function kn(ln){if(Ht){var ei=ln.pageY-Dt;ei<0&&(ei=0),ei>300&&(ei=300);var Ei=yt+ei+"px";qn(Ei)}}return Tt.addEventListener("mousedown",en),document.addEventListener("mousemove",kn),document.addEventListener("mouseup",dn),function(){Tt.removeEventListener("mousedown",en),document.removeEventListener("mousemove",kn),document.removeEventListener("mouseup",dn)}}},[d,er]),Object(W.useEffect)(function(){qn(yt)},[yt]);var so=z(Xt),$i=z(qi),Xr={width:so,height:$i},lo=Object(W.useMemo)(function(){if(gr){var Tt=new Date(gr),Ht=Tt.getHours(),Dt=Tt.getMinutes(),en=Tt.getSeconds();return Ht=Ht<10?"0"+Ht:Ht,Dt=Dt<10?"0"+Dt:Dt,en=en<10?"0"+en:en,"".concat(Ht,":").concat(Dt,":").concat(en)}return 0},[gr]);function Nr(){window.sessionStorage.removeItem(Qn),In(!1),cr(0)}function ga(){In(!1),cr(0),d.setValue(window.sessionStorage.getItem(Qn))}function bo(Tt,Ht){var Dt=d.getValue();Dt=Dt.replace(Tt,Ht),bt(Dt),d==null||d.setValue(Dt)}return H.a.createElement(W.Fragment,null,H.a.createElement("div",{className:"markdown-editor-wrapper",ref:xn},H.a.createElement("div",{className:"markdown-editor-container ".concat(Ft," ").concat(nn?"on-preview":""," ").concat(cn?"mini":""," ").concat($n?"full-screen":""),style:Xr},H.a.createElement(N,{insertTemp:pi,watch:nn,fullScreen:$n,showNullButton:St,onActionCallback:Kr,hidetoolBar:dr,uuid:vn.current,setOpenPhones:function(){Vn.current=!0}}),H.a.createElement("div",{className:"markdown-editor-body"},H.a.createElement("div",{className:"codemirror-container"},H.a.createElement("textarea",{ref:Gn,placeholder:pr})),nn?H.a.createElement("div",{ref:Kn,className:"preview-container"},Lt==="stex"&&H.a.createElement(Fe,{value:nt}),Lt!=="stex"&&H.a.createElement(de.a,{edit:!0,value:nt,replaces:bo})):null))),Ki?H.a.createElement("a",{ref:er,className:"editor-resize"}):null,H.a.createElement(ye.a,null,T[Fi]?H.a.createElement(Ce.a,{centered:!0,title:T[Fi],visible:!0,onCancel:mi,footer:null},vr):null))}},SJMd:function(Ut,ut){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var C,B,Ce,me=!1,Q,x;window.PR_SHOULD_USE_CONTINUATION=!0;var Se,j;(function(){var oe=window,le=["break,continue,do,else,for,if,return,while"],we=[le,"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"],W=[we,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],H=[W,"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"],be=[W,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],se=[W,"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"],J="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",U=[W,"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",q=[le,"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"],ee=[le,"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"],Ee=[le,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],je=[H,se,be,U,P,q,ee,Ee],xe=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,de="str",Fe="kwd",ue="com",ge="typ",Ae="lit",fe="pun",k="pln",ve="tag",ie="dec",N="src",ye="atn",Oe="atv",pe="nocode",Ze="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function O(Te){for(var Ke=0,tt=!1,ct=!1,Qe=0,Be=Te.length;Qe<Be;++Qe){var Ye=Te[Qe];if(Ye.ignoreCase)ct=!0;else if(/[a-z]/i.test(Ye.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){tt=!0,ct=!1;break}}var Ot={b:8,t:9,n:10,v:11,f:12,r:13};function pt(Ct){var _e=Ct.charCodeAt(0);if(_e!==92)return _e;var jt=Ct.charAt(1);return _e=Ot[jt],_e||("0"<=jt&&jt<="7"?parseInt(Ct.substring(1),8):jt==="u"||jt==="x"?parseInt(Ct.substring(2),16):Ct.charCodeAt(1))}function mt(Ct){if(Ct<32)return(Ct<16?"\\x0":"\\x")+Ct.toString(16);var _e=String.fromCharCode(Ct);return _e==="\\"||_e==="-"||_e==="]"||_e==="^"?"\\"+_e:_e}function rt(Ct){var _e=Ct.substring(1,Ct.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")),jt=[],wt=_e[0]==="^",Le=["["];wt&&Le.push("^");for(var Je=wt?1:0,$=_e.length;Je<$;++Je){var z=_e[Je];if(/\\[bdsw]/i.test(z))Le.push(z);else{var K=pt(z),b;Je+2<$&&_e[Je+1]==="-"?(b=pt(_e[Je+2]),Je+=2):b=K,jt.push([K,b]),b<65||K>122||(b<65||K>90||jt.push([Math.max(65,K)|32,Math.min(b,90)|32]),b<97||K>122||jt.push([Math.max(97,K)&~32,Math.min(b,122)&~32]))}}jt.sort(function(ce,Y){return ce[0]-Y[0]||Y[1]-ce[1]});for(var w=[],S=[],Je=0;Je<jt.length;++Je){var T=jt[Je];T[0]<=S[1]+1?S[1]=Math.max(S[1],T[1]):w.push(S=T)}for(var Je=0;Je<w.length;++Je){var T=w[Je];Le.push(mt(T[0])),T[1]>T[0]&&(T[1]+1>T[0]&&Le.push("-"),Le.push(mt(T[1])))}return Le.push("]"),Le.join("")}function Rt(Ct){for(var _e=Ct.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")),jt=_e.length,wt=[],Le=0,Je=0;Le<jt;++Le){var $=_e[Le];if($==="(")++Je;else if($.charAt(0)==="\\"){var z=+$.substring(1);z&&(z<=Je?wt[z]=-1:_e[Le]=mt(z))}}for(var Le=1;Le<wt.length;++Le)wt[Le]===-1&&(wt[Le]=++Ke);for(var Le=0,Je=0;Le<jt;++Le){var $=_e[Le];if($==="(")++Je,wt[Je]||(_e[Le]="(?:");else if($.charAt(0)==="\\"){var z=+$.substring(1);z&&z<=Je&&(_e[Le]="\\"+wt[z])}}for(var Le=0;Le<jt;++Le)_e[Le]==="^"&&_e[Le+1]!=="^"&&(_e[Le]="");if(Ct.ignoreCase&&tt)for(var Le=0;Le<jt;++Le){var $=_e[Le],K=$.charAt(0);$.length>=2&&K==="["?_e[Le]=rt($):K!=="\\"&&(_e[Le]=$.replace(/[a-zA-Z]/g,function(S){var T=S.charCodeAt(0);return"["+String.fromCharCode(T&~32,T|32)+"]"}))}return _e.join("")}for(var Mt=[],Qe=0,Be=Te.length;Qe<Be;++Qe){var Ye=Te[Qe];if(Ye.global||Ye.multiline)throw new Error(""+Ye);Mt.push("(?:"+Rt(Ye)+")")}return new RegExp(Mt.join("|"),ct?"gi":"g")}function v(Te,Ke){var tt=/(?:^|\s)nocode(?:\s|$)/,ct=[],Qe=0,Be=[],Ye=0;function Ot(pt){var mt=pt.nodeType;if(mt==1){if(tt.test(pt.className))return;for(var rt=pt.firstChild;rt;rt=rt.nextSibling)Ot(rt);var Rt=pt.nodeName.toLowerCase();(Rt==="br"||Rt==="li")&&(ct[Ye]=`
`,Be[Ye<<1]=Qe++,Be[Ye++<<1|1]=pt)}else if(mt==3||mt==4){var Mt=pt.nodeValue;Mt.length&&(Ke?Mt=Mt.replace(/\r\n?/g,`
`):Mt=Mt.replace(/[ \t\r\n]+/g," "),ct[Ye]=Mt,Be[Ye<<1]=Qe,Qe+=Mt.length,Be[Ye++<<1|1]=pt)}}return Ot(Te),{sourceCode:ct.join("").replace(/\n$/,""),spans:Be}}function ae(Te,Ke,tt,ct,Qe){if(!tt)return;var Be={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:tt,spans:null,basePos:Ke,decorations:null};ct(Be),Qe.push.apply(Qe,Be.decorations)}var Pe=/\S/;function Ne(Te){for(var Ke=void 0,tt=Te.firstChild;tt;tt=tt.nextSibling){var ct=tt.nodeType;Ke=ct===1?Ke?Te:tt:ct===3&&Pe.test(tt.nodeValue)?Te:Ke}return Ke===Te?void 0:Ke}function it(Te,Ke){var tt={},ct;(function(){for(var Ye=Te.concat(Ke),Ot=[],pt={},mt=0,rt=Ye.length;mt<rt;++mt){var Rt=Ye[mt],Mt=Rt[3];if(Mt)for(var Ct=Mt.length;--Ct>=0;)tt[Mt.charAt(Ct)]=Rt;var _e=Rt[1],jt=""+_e;pt.hasOwnProperty(jt)||(Ot.push(_e),pt[jt]=null)}Ot.push(/[\0-\uffff]/),ct=O(Ot)})();var Qe=Ke.length,Be=function(Ye){for(var Ot=Ye.sourceCode,pt=Ye.basePos,mt=Ye.sourceNode,rt=[pt,k],Rt=0,Mt=Ot.match(ct)||[],Ct={},_e=0,jt=Mt.length;_e<jt;++_e){var wt=Mt[_e],Le=Ct[wt],Je=void 0,$;if(typeof Le=="string")$=!1;else{var z=tt[wt.charAt(0)];if(z)Je=wt.match(z[1]),Le=z[0];else{for(var K=0;K<Qe;++K)if(z=Ke[K],Je=wt.match(z[1]),Je){Le=z[0];break}Je||(Le=k)}$=Le.length>=5&&Le.substring(0,5)==="lang-",$&&!(Je&&typeof Je[1]=="string")&&($=!1,Le=N),$||(Ct[wt]=Le)}var b=Rt;if(Rt+=wt.length,!$)rt.push(pt+b,Le);else{var w=Je[1],S=wt.indexOf(w),T=S+w.length;Je[2]&&(T=wt.length-Je[2].length,S=T-w.length);var ce=Le.substring(5);ae(mt,pt+b,wt.substring(0,S),Be,rt),ae(mt,pt+b+S,w,R(ce,w),rt),ae(mt,pt+b+T,wt.substring(T),Be,rt)}}Ye.decorations=rt};return Be}function ft(Te){var Ke=[],tt=[];Te.tripleQuotedStrings?Ke.push([de,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Ke.push([de,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([de,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&tt.push([de,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ct=Te.hashComments;ct&&(Te.cStyleComments?(ct>1?Ke.push([ue,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([ue,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),tt.push([de,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([ue,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(tt.push([ue,/^\/\/[^\r\n]*/,null]),tt.push([ue,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=Te.regexLiterals;if(Qe){var Be=Qe>1?"":`
\r`,Ye=Be?".":"[\\S\\s]",Ot="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+Ye+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+Ye+")*(?:\\x5D|$))+/";tt.push(["lang-regex",RegExp("^"+Ze+"("+Ot+")")])}var pt=Te.types;pt&&tt.push([ge,pt]);var mt=(""+Te.keywords).replace(/^ | $/g,"");mt.length&&tt.push([Fe,new RegExp("^(?:"+mt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([k,/^\s+/,null,` \r
\xA0`]);var rt="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(rt+="(?!s*/)"),tt.push([Ae,/^@[a-z_$][a-z_$@0-9]*/i,null],[ge,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[k,/^[a-z_$][a-z_$@0-9]*/i,null],[Ae,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[k,/^\\[\s\S]?/,null],[fe,new RegExp(rt),null]),it(Ke,tt)}var He=ft({keywords:je,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ve(Te,Ke,tt){for(var ct=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,Be=Te.ownerDocument,Ye=Be.createElement("li");Te.firstChild;)Ye.appendChild(Te.firstChild);var Ot=[Ye];function pt(_e){var jt=_e.nodeType;if(jt==1&&!ct.test(_e.className))if(_e.nodeName==="br")mt(_e),_e.parentNode&&_e.parentNode.removeChild(_e);else for(var wt=_e.firstChild;wt;wt=wt.nextSibling)pt(wt);else if((jt==3||jt==4)&&tt){var Le=_e.nodeValue,Je=Le.match(Qe);if(Je){var $=Le.substring(0,Je.index);_e.nodeValue=$;var z=Le.substring(Je.index+Je[0].length);if(z){var K=_e.parentNode;K.insertBefore(Be.createTextNode(z),_e.nextSibling)}mt(_e),$||_e.parentNode.removeChild(_e)}}}function mt(_e){for(;!_e.nextSibling;)if(_e=_e.parentNode,!_e)return;function jt(Je,$){var z=$?Je.cloneNode(!1):Je,K=Je.parentNode;if(K){var b=jt(K,1),w=Je.nextSibling;b.appendChild(z);for(var S=w;S;S=w)w=S.nextSibling,b.appendChild(S)}return z}for(var wt=jt(_e.nextSibling,0),Le;(Le=wt.parentNode)&&Le.nodeType===1;)wt=Le;Ot.push(wt)}for(var rt=0;rt<Ot.length;++rt)pt(Ot[rt]);Ke===(Ke|0)&&Ot[0].setAttribute("value",Ke);var Rt=Be.createElement("ol");Rt.className="linenums";for(var Mt=Math.max(0,Ke-1|0)||0,rt=0,Ct=Ot.length;rt<Ct;++rt)Ye=Ot[rt],Ye.className="L"+(rt+Mt)%10,Ye.firstChild||Ye.appendChild(Be.createTextNode("\xA0")),Rt.appendChild(Ye);Te.appendChild(Rt)}function Ie(Te){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var tt=/\n/g,ct=Te.sourceCode,Qe=ct.length,Be=0,Ye=Te.spans,Ot=Ye.length,pt=0,mt=Te.decorations,rt=mt.length,Rt=0;mt[rt]=Qe;var Mt,Ct;for(Ct=Mt=0;Ct<rt;)mt[Ct]!==mt[Ct+2]?(mt[Mt++]=mt[Ct++],mt[Mt++]=mt[Ct++]):Ct+=2;for(rt=Mt,Ct=Mt=0;Ct<rt;){for(var _e=mt[Ct],jt=mt[Ct+1],wt=Ct+2;wt+2<=rt&&mt[wt+1]===jt;)wt+=2;mt[Mt++]=_e,mt[Mt++]=jt,Ct=wt}rt=mt.length=Mt;var Le=Te.sourceNode,Je="";Le&&(Je=Le.style.display,Le.style.display="none");try{for(var $=null;pt<Ot;){var z=Ye[pt],K=Ye[pt+2]||Qe,b=mt[Rt+2]||Qe,wt=Math.min(K,b),w=Ye[pt+1],S;if(w.nodeType!==1&&(S=ct.substring(Be,wt))){Ke&&(S=S.replace(tt,"\r")),w.nodeValue=S;var T=w.ownerDocument,ce=T.createElement("span");ce.className=mt[Rt+1];var Y=w.parentNode;Y.replaceChild(ce,w),ce.appendChild(w),Be<K&&(Ye[pt+1]=w=T.createTextNode(ct.substring(wt,K)),Y.insertBefore(w,ce.nextSibling))}Be=wt,Be>=K&&(pt+=2),Be>=b&&(Rt+=2)}}finally{Le&&(Le.style.display=Je)}}var We={};function re(Te,Ke){for(var tt=Ke.length;--tt>=0;){var ct=Ke[tt];We.hasOwnProperty(ct)?oe.console&&console.warn("cannot override language handler %s",ct):We[ct]=Te}}function R(Te,Ke){return Te&&We.hasOwnProperty(Te)||(Te=/^\s*</.test(Ke)?"default-markup":"default-code"),We[Te]}re(He,["default-code"]),re(it([],[[k,/^[^<?]+/],[ie,/^<!\w[^>]*(?:>|$)/],[ue,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[fe,/^(?:<[%?]|[%?]>)/],["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"]),re(it([[k,/^[\s]+/,null,` \r
`],[Oe,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ve,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ye,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[fe,/^[=<>\/]+/],["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"]),re(it([],[[Oe,/^[\s\S]+/]]),["uq.val"]),re(ft({keywords:H,hashComments:!0,cStyleComments:!0,types:xe}),["c","cc","cpp","cxx","cyc","m"]),re(ft({keywords:"null,true,false"}),["json"]),re(ft({keywords:se,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:xe}),["cs"]),re(ft({keywords:be,cStyleComments:!0}),["java"]),re(ft({keywords:Ee,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),re(ft({keywords:q,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),re(ft({keywords:P,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),re(ft({keywords:ee,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),re(ft({keywords:U,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),re(ft({keywords:J,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),re(it([],[[de,/^[\s\S]+/]]),["regex"]);function qe(Te){var Ke=Te.langExtension;try{var tt=v(Te.sourceNode,Te.pre),ct=tt.sourceCode;Te.sourceCode=ct,Te.spans=tt.spans,Te.basePos=0,R(Ke,ct)(Te),Ie(Te)}catch(Qe){oe.console&&console.log(Qe&&Qe.stack||Qe)}}function vt(Te,Ke,tt){var ct=tt||!1,Qe=Ke||null,Be=document.createElement("div");Be.innerHTML="<pre>"+Te+"</pre>",Be=Be.firstChild,ct&&Ve(Be,ct,!0);var Ye={langExtension:Qe,numberLines:ct,sourceNode:Be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return qe(Ye),Be.innerHTML}function At(Te,Ke){var tt=Ke||document.body,ct=tt.ownerDocument||document;function Qe(z){return tt.getElementsByTagName(z)}for(var Be=[Qe("pre"),Qe("code"),Qe("xmp")],Ye=[],Ot=0;Ot<Be.length;++Ot)for(var pt=0,mt=Be[Ot].length;pt<mt;++pt)Ye.push(Be[Ot][pt]);Be=null;var rt=Date;rt.now||(rt={now:function(){return+new Date}});var Rt=0,Mt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ct=/\bprettyprint\b/,_e=/\bprettyprinted\b/,jt=/pre|xmp/i,wt=/^code$/i,Le=/^(?:pre|code|xmp)$/i,Je={};function $(){for(var z=oe.PR_SHOULD_USE_CONTINUATION?rt.now()+250:Infinity;Rt<Ye.length&&rt.now()<z;Rt++){for(var K=Ye[Rt],b=Je,w=K;w=w.previousSibling;){var S=w.nodeType,T=(S===7||S===8)&&w.nodeValue;if(T?!/^\??prettify\b/.test(T):S!==3||/\S/.test(w.nodeValue))break;if(T){b={},T.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Cn,Gt,pi){b[Gt]=pi});break}}var ce=K.className;if((b!==Je||Ct.test(ce))&&!_e.test(ce)){for(var Y=!1,Re=K.parentNode;Re;Re=Re.parentNode){var ht=Re.tagName;if(Le.test(ht)&&Re.className&&Ct.test(Re.className)){Y=!0;break}}if(!Y){K.className+=" prettyprinted";var kt=b.lang;if(!kt){kt=ce.match(Mt);var xt;!kt&&(xt=Ne(K))&&wt.test(xt.tagName)&&(kt=xt.className.match(Mt)),kt&&(kt=kt[1])}var Xt;if(jt.test(K.tagName))Xt=1;else{var Vt=K.currentStyle,yt=ct.defaultView,On=Vt?Vt.whiteSpace:yt&&yt.getComputedStyle?yt.getComputedStyle(K,null).getPropertyValue("white-space"):0;Xt=On&&On.substring(0,3)==="pre"}var cn=b.linenums;(cn=cn==="true"||+cn)||(cn=ce.match(/\blinenums\b(?::(\d+))?/),cn=cn?cn[1]&&cn[1].length?+cn[1]:!0:!1),cn&&Ve(K,cn,Xt);var En={langExtension:kt,sourceNode:K,numberLines:cn,pre:Xt,sourceCode:null,basePos:null,spans:null,decorations:null};qe(En)}}}Rt<Ye.length?oe.setTimeout($,250):typeof Te=="function"&&Te()}$()}var ot=oe.PR={createSimpleLexer:it,registerLangHandler:re,sourceDecorator:ft,PR_ATTRIB_NAME:ye,PR_ATTRIB_VALUE:Oe,PR_COMMENT:ue,PR_DECLARATION:ie,PR_KEYWORD:Fe,PR_LITERAL:Ae,PR_NOCODE:pe,PR_PLAIN:k,PR_PUNCTUATION:fe,PR_SOURCE:N,PR_STRING:de,PR_TAG:ve,PR_TYPE:ge,prettyPrintOne:me?oe.prettyPrintOne=vt:Se=vt,prettyPrint:j=me?oe.prettyPrint=At:j=At},dt=oe.define;typeof dt=="function"&&dt.amd&&dt("google-code-prettify",[],function(){return ot})})()},UUDw:function(Ut,ut,C){Ut.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return B});var B=function(me){var Q=document.createElement("textarea");return Q.value=me,Q.value}},"VrN/":function(Ut,ut,C){(function(B,Ce){Ut.exports=Ce()})(this,function(){"use strict";var B=navigator.userAgent,Ce=navigator.platform,me=/gecko\/\d/i.test(B),Q=/MSIE \d/.test(B),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(B),Se=/Edge\/(\d+)/.exec(B),j=Q||x||Se,oe=j&&(Q?document.documentMode||6:+(Se||x)[1]),le=!Se&&/WebKit\//.test(B),we=le&&/Qt\/\d+\.\d+/.test(B),W=!Se&&/Chrome\//.test(B),H=/Opera\//.test(B),be=/Apple Computer/.test(navigator.vendor),se=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(B),J=/PhantomJS/.test(B),U=!Se&&/AppleWebKit/.test(B)&&/Mobile\/\w+/.test(B),P=/Android/.test(B),q=U||P||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(B),ee=U||/Mac/.test(Ce),Ee=/\bCrOS\b/.test(B),je=/win/i.test(Ce),xe=H&&B.match(/Version\/(\d*\.\d*)/);xe&&(xe=Number(xe[1])),xe&&xe>=15&&(H=!1,le=!0);var de=ee&&(we||H&&(xe==null||xe<12.11)),Fe=me||j&&oe>=9;function ue(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ge=function(e,t){var i=e.className,n=ue(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 Ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function fe(e,t){return Ae(e).appendChild(t)}function k(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 ve(e,t,i,n){var r=k(e,t,i,n);return r.setAttribute("role","presentation"),r}var ie;document.createRange?ie=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ie=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 N(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 ye(){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 Oe(e,t){var i=e.className;ue(t).test(i)||(e.className+=(i?" ":"")+t)}function pe(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!ue(i[n]).test(t)&&(t+=" "+i[n]);return t}var Ze=function(e){e.select()};U?Ze=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:j&&(Ze=function(e){try{e.select()}catch(t){}});function O(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function v(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 ae(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 f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var Pe=function(){this.id=null,this.f=null,this.time=0,this.handler=O(this.onTimeout,this)};Pe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Pe.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 Ne(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var it=50,ft={toString:function(){return"CodeMirror.Pass"}},He={scroll:!1},Ve={origin:"*mouse"},Ie={origin:"+move"};function We(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 re=[""];function R(e){for(;re.length<=e;)re.push(qe(re)+" ");return re[e]}function qe(e){return e[e.length-1]}function vt(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function At(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ot(){}function dt(e,t){var i;return Object.create?i=Object.create(e):(ot.prototype=e,i=new ot),t&&v(t,i),i}var Te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ke(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Te.test(e))}function tt(e,t){return t?t.source.indexOf("\\w")>-1&&Ke(e)?!0:t.test(e):Ke(e)}function ct(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Qe=/[\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 Be(e){return e.charCodeAt(0)>=768&&Qe.test(e)}function Ye(e,t,i){for(;(i<0?t>0:t<e.length)&&Be(e.charAt(t));)t+=i;return t}function Ot(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 pt(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 mt=null;function rt(e,t,i){var n;mt=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:mt=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:mt=r)}return n!=null?n:mt}var Rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(g){return g<=247?e.charAt(g):1424<=g&&g<=1524?"R":1536<=g&&g<=1785?t.charAt(g-1536):1774<=g&&g<=2220?"r":8192<=g&&g<=8203?"w":g==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function p(g,A,I){this.level=g,this.from=A,this.to=I}return function(g,A){var I=A=="ltr"?"L":"R";if(g.length==0||A=="ltr"&&!n.test(g))return!1;for(var he=g.length,te=[],Me=0;Me<he;++Me)te.push(i(g.charCodeAt(Me)));for(var ze=0,et=I;ze<he;++ze){var st=te[ze];st=="m"?te[ze]=et:et=st}for(var gt=0,lt=I;gt<he;++gt){var Et=te[gt];Et=="1"&&lt=="r"?te[gt]="n":s.test(Et)&&(lt=Et,Et=="r"&&(te[gt]="R"))}for(var zt=1,Nt=te[0];zt<he-1;++zt){var tn=te[zt];tn=="+"&&Nt=="1"&&te[zt+1]=="1"?te[zt]="1":tn==","&&Nt==te[zt+1]&&(Nt=="1"||Nt=="n")&&(te[zt]=Nt),Nt=tn}for(var jn=0;jn<he;++jn){var gi=te[jn];if(gi==",")te[jn]="N";else if(gi=="%"){var Xn=void 0;for(Xn=jn+1;Xn<he&&te[Xn]=="%";++Xn);for(var Zi=jn&&te[jn-1]=="!"||Xn<he&&te[Xn]=="1"?"1":"N",Hi=jn;Hi<Xn;++Hi)te[Hi]=Zi;jn=Xn-1}}for(var ai=0,Vi=I;ai<he;++ai){var xi=te[ai];Vi=="L"&&xi=="1"?te[ai]="L":s.test(xi)&&(Vi=xi)}for(var fi=0;fi<he;++fi)if(r.test(te[fi])){var si=void 0;for(si=fi+1;si<he&&r.test(te[si]);++si);for(var Jn=(fi?te[fi-1]:I)=="L",Gi=(si<he?te[si]:I)=="L",Bo=Jn==Gi?Jn?"L":"R":I,oo=fi;oo<si;++oo)te[oo]=Bo;fi=si-1}for(var _i=[],Dr,vi=0;vi<he;)if(l.test(te[vi])){var ps=vi;for(++vi;vi<he&&l.test(te[vi]);++vi);_i.push(new p(0,ps,vi))}else{var zr=vi,go=_i.length,vo=A=="rtl"?1:0;for(++vi;vi<he&&te[vi]!="L";++vi);for(var Ni=zr;Ni<vi;)if(f.test(te[Ni])){zr<Ni&&(_i.splice(go,0,new p(1,zr,Ni)),go+=vo);var Fo=Ni;for(++Ni;Ni<vi&&f.test(te[Ni]);++Ni);_i.splice(go,0,new p(2,Fo,Ni)),go+=vo,zr=Ni}else++Ni;zr<vi&&_i.splice(go,0,new p(1,zr,vi))}return A=="ltr"&&(_i[0].level==1&&(Dr=g.match(/^\s+/))&&(_i[0].from=Dr[0].length,_i.unshift(new p(0,0,Dr[0].length))),qe(_i).level==1&&(Dr=g.match(/\s+$/))&&(qe(_i).to-=Dr[0].length,_i.push(new p(0,he-Dr[0].length,he)))),A=="rtl"?_i.reverse():_i}}();function Mt(e,t){var i=e.order;return i==null&&(i=e.order=Rt(e.text,t)),i}var Ct=[],_e=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]||Ct).concat(i)}};function jt(e,t){return e._handlers&&e._handlers[t]||Ct}function wt(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=Ne(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Le(e,t){var i=jt(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 Je(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Le(e,i||t.type,e,t),S(t)||t.codemirrorIgnore}function $(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)Ne(i,t[n])==-1&&i.push(t[n])}function z(e,t){return jt(e,t).length>0}function K(e){e.prototype.on=function(t,i){_e(this,t,i)},e.prototype.off=function(t,i){wt(this,t,i)}}function b(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function w(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function S(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function T(e){b(e),w(e)}function ce(e){return e.target||e.srcElement}function Y(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ee&&e.ctrlKey&&t==1&&(t=3),t}var Re=function(){if(j&&oe<9)return!1;var e=k("div");return"draggable"in e||"dragDrop"in e}(),ht;function kt(e){if(ht==null){var t=k("span","\u200B");fe(e,k("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ht=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&oe<8))}var i=ht?k("span","\u200B"):k("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var xt;function Xt(e){if(xt!=null)return xt;var t=fe(e,document.createTextNode("A\u062EA")),i=ie(t,0,1).getBoundingClientRect(),n=ie(t,1,2).getBoundingClientRect();return Ae(e),!i||i.left==i.right?!1:xt=n.right-i.right<3}var Vt=`
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/)},yt=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=k("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),cn=null;function En(e){if(cn!=null)return cn;var t=fe(e,k("span","x")),i=t.getBoundingClientRect(),n=ie(t,0,1).getBoundingClientRect();return cn=Math.abs(i.left-n.left)>1}var Cn={},Gt={};function pi(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Cn[e]=t}function Oi(e,t){Gt[e]=t}function Lt(e){if(typeof e=="string"&&Gt.hasOwnProperty(e))e=Gt[e];else if(e&&typeof e.name=="string"&&Gt.hasOwnProperty(e.name)){var t=Gt[e.name];typeof t=="string"&&(t={name:t}),e=dt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Lt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Lt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ji(e,t){t=Lt(t);var i=Cn[t.name];if(!i)return ji(e,"text/plain");var n=i(e,t);if(Qn.hasOwnProperty(t.name)){var r=Qn[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 Qn={};function ri(e,t){var i=Qn.hasOwnProperty(e)?Qn[e]:Qn[e]={};v(t,i)}function Ki(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 sr(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 lr(e,t,i){return e.startState?e.startState(t,i):!0}var mn=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};mn.prototype.eol=function(){return this.pos>=this.string.length},mn.prototype.sol=function(){return this.pos==this.lineStart},mn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mn.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},mn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},mn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mn.prototype.skipToEnd=function(){this.pos=this.string.length},mn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mn.prototype.backUp=function(e){this.pos-=e},mn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ae(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ae(this.string,this.lineStart,this.tabSize):0)},mn.prototype.indentation=function(){return ae(this.string,null,this.tabSize)-(this.lineStart?ae(this.string,this.lineStart,this.tabSize):0)},mn.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)}},mn.prototype.current=function(){return this.string.slice(this.start,this.pos)},mn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function St(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 Ii(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 wi(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function qt(e){if(e.parent==null)return null;for(var t=e.parent,i=Ne(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 Ui(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 f=e.lines[l],p=f.height;if(t<p)break;t-=p}return i+l}function Ji(e,t){return t>=e.first&&t<e.first+e.size}function ur(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ge(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ge))return new Ge(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 Qi(e,t){return e.sticky==t.sticky&&Ft(e,t)==0}function Er(e){return Ge(e.line,e.ch)}function fr(e,t){return Ft(e,t)<0?t:e}function pr(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 Ge(e.first,0);var i=e.first+e.size-1;return t.line>i?Ge(i,St(e,i).text.length):a(t,St(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Ge(e.line,t):i<0?Ge(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 d=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 d?new c(e,Ki(e.mode,t.state),i,t.lookAhead):new c(e,Ki(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Ki(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new d(t,this.maxLookAhead):t};function F(e,t,i,n){var r=[e.state.modeGen],s={};Bi(e,t.text,e.doc.mode,i,function(g,A){return r.push(g,A)},s,n);for(var l=i.state,f=function(g){i.baseTokens=r;var A=e.state.overlays[g],I=1,he=0;i.state=!0,Bi(e,t.text,A.mode,i,function(te,Me){for(var ze=I;he<te;){var et=r[I];et>te&&r.splice(I,1,te,r[I+1],et),I+=2,he=Math.min(te,et)}if(!Me)return;if(A.opaque)r.splice(ze,I-ze,te,"overlay "+Me),I=ze+2;else for(;ze<I;ze+=2){var st=r[ze+1];r[ze+1]=(st?st+" ":"")+"overlay "+Me}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},p=0;p<e.state.overlays.length;++p)f(p);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function De(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=nt(e,qt(t)),r=t.text.length>e.options.maxHighlightLength&&Ki(e.doc.mode,n.state),s=F(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 nt(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=$n(e,t,i),l=s>n.first&&St(n,s-1).stateAfter,f=l?c.fromSaved(n,l,s):new c(n,lr(n.mode),s);return n.iter(s,t,function(p){bt(e,p.text,f);var g=f.line;p.stateAfter=g==t-1||g%5==0||g>=r.viewFrom&&g<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function bt(e,t,i,n){var r=e.doc.mode,s=new mn(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Ue(r,i.state);!s.eol();)Bt(r,s,i.state),s.start=s.pos}function Ue(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=sr(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Bt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=sr(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 nn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function An(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=St(r,t.line),p=nt(e,t.line,i),g=new mn(f.text,e.options.tabSize,p),A;for(n&&(A=[]);(n||g.pos<t.ch)&&!g.eol();)g.start=g.pos,l=Bt(s,g,p.state),n&&A.push(new nn(g,l,Ki(r.mode,p.state)));return n?A:new nn(g,l,p.state)}function Ti(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 Bi(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var p=0,g=null,A=new mn(t,e.options.tabSize,n),I,he=e.options.addModeClass&&[null];for(t==""&&Ti(Ue(i,n.state),s);!A.eol();){if(A.pos>e.options.maxHighlightLength?(f=!1,l&&bt(e,t,n,A.pos),A.pos=t.length,I=null):I=Ti(Bt(i,A,n.state,he),s),he){var te=he[0].name;te&&(I="m-"+(I?te+" "+I:te))}if(!f||g!=I){for(;p<A.start;)p=Math.min(A.start,p+5e3),r(p,g);g=I}A.start=A.pos}for(;p<A.pos;){var Me=Math.min(A.pos,p+5e3);r(Me,g),p=Me}}function $n(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var p=St(s,f-1),g=p.stateAfter;if(g&&(!i||f+(g instanceof d?g.lookAhead:0)<=s.modeFrontier))return f;var A=ae(p.text,null,e.options.tabSize);(r==null||n>A)&&(r=f-1,n=A)}return r}function Xi(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=St(e,n).stateAfter;if(r&&(!(r instanceof d)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Hr=!1,yi=!1;function Fi(){Hr=!0}function Mi(){yi=!0}function mr(e,t,i){this.marker=e,this.from=t,this.to=i}function Wi(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function gr(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function cr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ao(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var p=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new mr(l,s.from,p?null:s.to))}}return n}function Vr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var p=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new mr(l,p?null:s.from-t,s.to==null?null:s.to-t))}}return n}function qi(e,t){if(t.full)return null;var i=Ji(e,t.from.line)&&St(e,t.from.line).markedSpans,n=Ji(e,t.to.line)&&St(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,f=ao(i,r,l),p=Vr(n,s,l),g=t.text.length==1,A=qe(t.text).length+(g?r:0);if(f)for(var I=0;I<f.length;++I){var he=f[I];if(he.to==null){var te=Wi(p,he.marker);te?g&&(he.to=te.to==null?null:te.to+A):he.to=r}}if(p)for(var Me=0;Me<p.length;++Me){var ze=p[Me];if(ze.to!=null&&(ze.to+=A),ze.from==null){var et=Wi(f,ze.marker);et||(ze.from=A,g&&(f||(f=[])).push(ze))}else ze.from+=A,g&&(f||(f=[])).push(ze)}f&&(f=qn(f)),p&&p!=f&&(p=qn(p));var st=[f];if(!g){var gt=t.text.length-2,lt;if(gt>0&&f)for(var Et=0;Et<f.length;++Et)f[Et].to==null&&(lt||(lt=[])).push(new mr(f[Et].marker,null,null));for(var zt=0;zt<gt;++zt)st.push(lt);st.push(p)}return st}function qn(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 Sr(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(te){if(te.markedSpans)for(var Me=0;Me<te.markedSpans.length;++Me){var ze=te.markedSpans[Me].marker;ze.readOnly&&(!n||Ne(n,ze)==-1)&&(n||(n=[])).push(ze)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),p=0;p<r.length;++p){var g=r[p];if(Ft(g.to,f.from)<0||Ft(g.from,f.to)>0)continue;var A=[p,1],I=Ft(g.from,f.from),he=Ft(g.to,f.to);(I<0||!l.inclusiveLeft&&!I)&&A.push({from:g.from,to:f.from}),(he>0||!l.inclusiveRight&&!he)&&A.push({from:f.to,to:g.to}),r.splice.apply(r,A),p+=A.length-3}return r}function Pr(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 yo(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function In(e){return e.inclusiveLeft?-1:0}function vn(e){return e.inclusiveRight?1:0}function Vn(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)||In(e)-In(t);if(s)return-s;var l=Ft(n.to,r.to)||vn(e)-vn(t);return l||t.id-e.id}function hn(e,t){var i=yi&&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||Vn(n,r.marker)<0)&&(n=r.marker);return n}function Gn(e){return hn(e,!0)}function xn(e){return hn(e,!1)}function er(e,t){var i=yi&&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||Vn(n,s.marker)<0)&&(n=s.marker)}return n}function Kn(e,t,i,n,r){var s=St(e,t),l=yi&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var p=l[f];if(!p.marker.collapsed)continue;var g=p.marker.find(0),A=Ft(g.from,i)||In(p.marker)-In(r),I=Ft(g.to,n)||vn(p.marker)-vn(r);if(A>=0&&I<=0||A<=0&&I>=0)continue;if(A<=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?Ft(g.to,i)>=0:Ft(g.to,i)>0)||A>=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?Ft(g.from,n)<=0:Ft(g.from,n)<0))return!0}}function bi(e){for(var t;t=Gn(e);)e=t.find(-1,!0).line;return e}function Gr(e){for(var t;t=xn(e);)e=t.find(1,!0).line;return e}function Kr(e){for(var t,i;t=xn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function tr(e,t){var i=St(e,t),n=bi(i);return i==n?t:qt(n)}function vr(e,t){if(t>e.lastLine())return t;var i=St(e,t),n;if(!mi(e,i))return t;for(;n=xn(i);)i=n.find(1,!0).line;return qt(i)+1}function mi(e,t){var i=yi&&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&&so(e,t,n))return!0}}function so(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return so(e,n.line,Wi(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)&&so(e,t,r))return!0}function $i(e){e=bi(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 f=s.children[l];if(f==i)break;t+=f.height}return t}function Xr(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Gn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=xn(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 lo(e){var t=e.display,i=e.doc;t.maxLine=St(i,i.first),t.maxLineLength=Xr(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Xr(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Nr=function(e,t,i){this.text=e,yo(this,t),this.height=i?i(this):1};Nr.prototype.lineNo=function(){return qt(this)},K(Nr);function ga(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Pr(e),yo(e,i);var r=n?n(e):1;r!=e.height&&wi(e,r)}function bo(e){e.parent=null,Pr(e)}var Tt={},Ht={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Ht:Tt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function en(e,t){var i=ve("span",null,null,le?"padding-right: .1px":null),n={pre:ve("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=kn,Xt(e.display.measure)&&(l=Mt(s,e.doc.direction))&&(n.addToken=ei(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&qt(s);rn(s,n,De(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=pe(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=pe(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(kt(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(le){var p=n.content.lastChild;(/\bcm-tab\b/.test(p.className)||p.querySelector&&p.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Le(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=pe(n.pre.className,n.textClass||"")),n}function dn(e){var t=k("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kn(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?ln(t,e.trailingSpace):t,p=e.cm.state.specialChars,g=!1,A;if(!p.test(t))e.col+=t.length,A=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,A),j&&oe<9&&(g=!0),e.pos+=t.length;else{A=document.createDocumentFragment();for(var I=0;;){p.lastIndex=I;var he=p.exec(t),te=he?he.index-I:t.length-I;if(te){var Me=document.createTextNode(f.slice(I,I+te));j&&oe<9?A.appendChild(k("span",[Me])):A.appendChild(Me),e.map.push(e.pos,e.pos+te,Me),e.col+=te,e.pos+=te}if(!he)break;I+=te+1;var ze=void 0;if(he[0]==" "){var et=e.cm.options.tabSize,st=et-e.col%et;ze=A.appendChild(k("span",R(st),"cm-tab")),ze.setAttribute("role","presentation"),ze.setAttribute("cm-text"," "),e.col+=st}else he[0]=="\r"||he[0]==`
`?(ze=A.appendChild(k("span",he[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ze.setAttribute("cm-text",he[0]),e.col+=1):(ze=e.cm.options.specialCharPlaceholder(he[0]),ze.setAttribute("cm-text",he[0]),j&&oe<9?A.appendChild(k("span",[ze])):A.appendChild(ze),e.col+=1);e.map.push(e.pos,e.pos+1,ze),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||g||s||l){var gt=i||"";n&&(gt+=n),r&&(gt+=r);var lt=k("span",[A],gt,s);if(l)for(var Et in l)l.hasOwnProperty(Et)&&Et!="style"&&Et!="class"&&lt.setAttribute(Et,l[Et]);return e.content.appendChild(lt)}e.content.appendChild(A)}function ln(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 ei(e,t){return function(i,n,r,s,l,f,p){r=r?r+" cm-force-border":"cm-force-border";for(var g=i.pos,A=g+n.length;;){for(var I=void 0,he=0;he<t.length&&!(I=t[he],I.to>g&&I.from<=g);he++);if(I.to>=A)return e(i,n,r,s,l,f,p);e(i,n.slice(0,I.to-g),r,s,null,f,p),s=null,n=n.slice(I.to-g),g=I.to}}}function Ei(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 rn(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]),Dt(i[l+1],t.cm.options));return}for(var f=r.length,p=0,g=1,A="",I,he,te=0,Me,ze,et,st,gt;;){if(te==p){Me=ze=et=he="",gt=null,st=null,te=Infinity;for(var lt=[],Et=void 0,zt=0;zt<n.length;++zt){var Nt=n[zt],tn=Nt.marker;if(tn.type=="bookmark"&&Nt.from==p&&tn.widgetNode)lt.push(tn);else if(Nt.from<=p&&(Nt.to==null||Nt.to>p||tn.collapsed&&Nt.to==p&&Nt.from==p)){if(Nt.to!=null&&Nt.to!=p&&te>Nt.to&&(te=Nt.to,ze=""),tn.className&&(Me+=" "+tn.className),tn.css&&(he=(he?he+";":"")+tn.css),tn.startStyle&&Nt.from==p&&(et+=" "+tn.startStyle),tn.endStyle&&Nt.to==te&&(Et||(Et=[])).push(tn.endStyle,Nt.to),tn.title&&((gt||(gt={})).title=tn.title),tn.attributes)for(var jn in tn.attributes)(gt||(gt={}))[jn]=tn.attributes[jn];tn.collapsed&&(!st||Vn(st.marker,tn)<0)&&(st=Nt)}else Nt.from>p&&te>Nt.from&&(te=Nt.from)}if(Et)for(var gi=0;gi<Et.length;gi+=2)Et[gi+1]==te&&(ze+=" "+Et[gi]);if(!st||st.from==p)for(var Xn=0;Xn<lt.length;++Xn)Ei(t,0,lt[Xn]);if(st&&(st.from||0)==p){if(Ei(t,(st.to==null?f+1:st.to)-p,st.marker,st.from==null),st.to==null)return;st.to==p&&(st=!1)}}if(p>=f)break;for(var Zi=Math.min(f,te);;){if(A){var Hi=p+A.length;if(!st){var ai=Hi>Zi?A.slice(0,Zi-p):A;t.addToken(t,ai,I?I+Me:Me,et,p+ai.length==te?ze:"",he,gt)}if(Hi>=Zi){A=A.slice(Zi-p),p=Zi;break}p=Hi,et=""}A=r.slice(s,s=i[g++]),I=Dt(i[g++],t.cm.options)}}}function kr(e,t,i){this.line=t,this.rest=Kr(t),this.size=this.rest?qt(qe(this.rest))-i+1:1,this.node=this.text=null,this.hidden=mi(e,t)}function yn(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new kr(e.doc,St(e.doc,s),s);r=s+l.size,n.push(l)}return n}var oi=null;function Yi(e){oi?oi.ops.push(e):e.ownsGroup=oi={ops:[e],delayedCallbacks:[]}}function Ai(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 Co(e,t){var i=e.ownsGroup;if(!i)return;try{Ai(i)}finally{oi=null,t(i)}}var $r=null;function Yn(e,t){var i=jt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;oi?r=oi.delayedCallbacks:$r?r=$r:(r=$r=[],setTimeout(va,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function va(){var e=$r;$r=null;for(var t=0;t<e.length;++t)e[t]()}function ya(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"?Ho(e,t,i,n):s=="class"?zo(e,t):s=="widget"&&Ga(e,t,n)}t.changes=null}function uo(e){return e.node==e.text&&(e.node=k("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),j&&oe<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(k("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):en(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,zo(e,t)):i&&(t.text.className=i)}function zo(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 Ho(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=k("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),f=t.gutter=k("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(k("div",ur(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var p=0;p<e.display.gutterSpecs.length;++p){var g=e.display.gutterSpecs[p].className,A=s.hasOwnProperty(g)&&s[g];A&&f.appendChild(k("div",[A],"CodeMirror-gutter-elt","left: "+n.gutterLeft[g]+"px; width: "+n.gutterWidth[g]+"px"))}}}function Ga(e,t,i){t.alignable&&(t.alignable=null);for(var n=ue("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);Vo(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),zo(e,t),Ho(e,t,i,n),Vo(e,t,n),t.node}function Vo(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,f=t.widgets;l<f.length;++l){var p=f[l],g=k("div",[p.node],"CodeMirror-linewidget"+(p.className?" "+p.className:""));p.handleMouseEvents||g.setAttribute("cm-ignore-events","true"),Ka(p,g,i,n),e.display.input.setUneditable(g),r&&p.above?s.insertBefore(g,i.gutter||i.text):s.appendChild(g),Yn(p,"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 Yr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!N(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;"),fe(t.display.measure,k("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function yr(e,t){for(var i=ce(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 Go(e){return e.lineSpace.offsetTop}function _(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function V(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=fe(e.measure,k("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 X(e){return it-e.display.nativeBarWidth}function M(e){return e.display.scroller.clientWidth-X(e)-e.display.barWidth}function m(e){return e.display.scroller.clientHeight-X(e)-e.display.barHeight}function E(e,t,i){var n=e.options.lineWrapping,r=n&&M(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(),f=0;f<l.length-1;f++){var p=l[f],g=l[f+1];Math.abs(p.bottom-g.bottom)>2&&s.push((p.bottom+g.top)/2-i.top)}}s.push(i.bottom-i.top)}}function y(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(qt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function L(e,t){t=bi(t);var i=qt(t),n=e.display.externalMeasured=new kr(e.doc,t,i);n.lineN=i;var r=n.built=en(e,n);return n.text=r.pre,fe(e.display.lineMeasure,r.pre),n}function D(e,t,i,n){return ne(e,G(e,t),i,n)}function Z(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Nn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function G(e,t){var i=qt(t),n=Z(e,i);n&&!n.text?n=null:n&&n.changes&&(ya(e,n,i,Wn(e)),e.curOp.forceUpdate=!0),n||(n=L(e,t));var r=y(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ne(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(e,t.view,t.rect),t.hasHeights=!0),l=at(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 ke={left:0,right:0,top:0,bottom:0};function $e(e,t,i){for(var n,r,s,l,f,p,g=0;g<e.length;g+=3)if(f=e[g],p=e[g+1],t<f?(r=0,s=1,l="left"):t<p?(r=t-f,s=r+1):(g==e.length-3||t==p&&e[g+3]>t)&&(s=p-f,r=s-1,t>=p&&(l="right")),r!=null){if(n=e[g+2],f==p&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;g&&e[g-2]==e[g-3]&&e[g-1].insertLeft;)n=e[(g-=3)+2],l="left";if(i=="right"&&r==p-f)for(;g<e.length-3&&e[g+3]==e[g+4]&&!e[g+5].insertLeft;)n=e[(g+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:p}}function Xe(e,t){var i=ke;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 at(e,t,i,n){var r=$e(t.map,i,n),s=r.node,l=r.start,f=r.end,p=r.collapse,g;if(s.nodeType==3){for(var A=0;A<4;A++){for(;l&&Be(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Be(t.line.text.charAt(r.coverStart+f));)++f;if(j&&oe<9&&l==0&&f==r.coverEnd-r.coverStart?g=s.parentNode.getBoundingClientRect():g=Xe(ie(s,l,f).getClientRects(),n),g.left||g.right||l==0)break;f=l,l=l-1,p="right"}j&&oe<11&&(g=Wt(e.display.measure,g))}else{l>0&&(p=n="right");var I;e.options.lineWrapping&&(I=s.getClientRects()).length>1?g=I[n=="right"?I.length-1:0]:g=s.getBoundingClientRect()}if(j&&oe<9&&!l&&(!g||!g.left&&!g.right)){var he=s.parentNode.getClientRects()[0];he?g={left:he.left,right:he.left+li(e.display),top:he.top,bottom:he.bottom}:g=ke}for(var te=g.top-t.rect.top,Me=g.bottom-t.rect.top,ze=(te+Me)/2,et=t.view.measure.heights,st=0;st<et.length-1&&!(ze<et[st]);st++);var gt=st?et[st-1]:0,lt=et[st],Et={left:(p=="right"?g.right:g.left)-t.rect.left,right:(p=="left"?g.left:g.right)-t.rect.left,top:gt,bottom:lt};return!g.left&&!g.right&&(Et.bogus=!0),e.options.singleCursorHeightPerLine||(Et.rtop=te,Et.rbottom=Me),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 Jt(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,Ae(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Jt(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 W&&P?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Zt(){return W&&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+=Yr(e.widgets[i]));return t}function fn(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=$i(t);if(n=="local"?l+=Go(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:Zt());var p=f.left+(n=="window"?0:Qt());i.left+=p,i.right+=p}return i.top+=l,i.bottom+=l,i}function on(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=Qt(),r-=Zt();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 Un(e,t,i,n,r){return n||(n=St(e.doc,t.line)),fn(e,n,D(e,n,t.ch,r),i)}function an(e,t,i,n,r,s){n=n||St(e.doc,t.line),r||(r=G(e,n));function l(Me,ze){var et=ne(e,r,Me,ze?"right":"left",s);return ze?et.left=et.right:et.right=et.left,fn(e,n,et,i)}var f=Mt(n,e.doc.direction),p=t.ch,g=t.sticky;if(p>=n.text.length?(p=n.text.length,g="before"):p<=0&&(p=0,g="after"),!f)return l(g=="before"?p-1:p,g=="before");function A(Me,ze,et){var st=f[ze],gt=st.level==1;return l(et?Me-1:Me,gt!=et)}var I=rt(f,p,g),he=mt,te=A(p,I,g=="before");return he!=null&&(te.other=A(p,he,g!="before")),te}function It(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=li(e.display)*t.ch);var n=St(e.doc,t.line),r=$i(n)+Go(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function Pt(e,t,i,n,r){var s=Ge(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 Pt(n.first,0,null,-1,-1);var r=Ui(n,i),s=n.first+n.size-1;if(r>s)return Pt(n.first+n.size-1,St(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=St(n,r);;){var f=Bn(e,l,r,t,i),p=er(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!p)return f;var g=p.find(1);if(g.line==r)return g;l=St(n,r=g.line)}}function pn(e,t,i,n){n-=Yt(t);var r=t.text.length,s=Ot(function(l){return ne(e,i,l-1).bottom<=n},r,0);return r=Ot(function(l){return ne(e,i,l).top>n},s,r),{begin:s,end:r}}function _t(e,t,i,n){i||(i=G(e,t));var r=fn(e,t,ne(e,i,n),"line").top;return pn(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 Bn(e,t,i,n,r){r-=$i(t);var s=G(e,t),l=Yt(t),f=0,p=t.text.length,g=!0,A=Mt(t,e.doc.direction);if(A){var I=(e.options.lineWrapping?Ln:bn)(e,t,i,s,A,n,r);g=I.level!=1,f=g?I.from:I.to-1,p=g?I.to:I.from-1}var he=null,te=null,Me=Ot(function(zt){var Nt=ne(e,s,zt);return Nt.top+=l,Nt.bottom+=l,gn(Nt,n,r,!1)?(Nt.top<=r&&Nt.left<=n&&(he=zt,te=Nt),!0):!1},f,p),ze,et,st=!1;if(te){var gt=n-te.left<te.right-n,lt=gt==g;Me=he+(lt?0:1),et=lt?"after":"before",ze=gt?te.left:te.right}else{!g&&(Me==p||Me==f)&&Me++,et=Me==0?"after":Me==t.text.length?"before":ne(e,s,Me-(g?1:0)).bottom+l<=r==g?"after":"before";var Et=an(e,Ge(i,Me,et),"line",t,s);ze=Et.left,st=r<Et.top?-1:r>=Et.bottom?1:0}return Me=Ye(t.text,Me,1),Pt(i,Me,et,st,n-ze)}function bn(e,t,i,n,r,s,l){var f=Ot(function(I){var he=r[I],te=he.level!=1;return gn(an(e,Ge(i,te?he.to:he.from,te?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),p=r[f];if(f>0){var g=p.level!=1,A=an(e,Ge(i,g?p.from:p.to,g?"after":"before"),"line",t,n);gn(A,s,l,!0)&&A.top>l&&(p=r[f-1])}return p}function Ln(e,t,i,n,r,s,l){var f=pn(e,t,n,l),p=f.begin,g=f.end;/\s/.test(t.text.charAt(g-1))&&g--;for(var A=null,I=null,he=0;he<r.length;he++){var te=r[he];if(te.from>=g||te.to<=p)continue;var Me=te.level!=1,ze=ne(e,n,Me?Math.min(g,te.to)-1:Math.max(p,te.from)).right,et=ze<s?s-ze+1e9:ze-s;(!A||I>et)&&(A=te,I=et)}return A||(A=r[r.length-1]),A.from<p&&(A={from:p,to:A.to,level:A.level}),A.to>g&&(A={from:A.from,to:g,level:A.level}),A}var Tn;function Zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Tn==null){Tn=k("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Tn.appendChild(document.createTextNode("x")),Tn.appendChild(k("br"));Tn.appendChild(document.createTextNode("x"))}fe(e.measure,Tn);var i=Tn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Ae(e.measure),i||1}function li(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k("span","xxxxxxxxxx"),i=k("pre",[t],"CodeMirror-line-like");fe(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Wn(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=s.clientWidth}return{fixedPos:Si(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Si(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function nr(e){var t=Zn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/li(e.display)-3);return function(r){if(mi(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 Li(e){var t=e.doc,i=nr(e);t.iter(function(n){var r=i(n);r!=n.height&&wi(n,r)})}function ui(e,t,i,n){var r=e.display;if(!i&&ce(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=r.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(I){return null}var p=sn(e,s,l),g;if(n&&p.xRel>0&&(g=St(e.doc,p.line).text).length==p.ch){var A=ae(g,g.length,e.options.tabSize)-g.length;p=Ge(p.line,Math.max(0,Math.round((s-V(e.display).left)/li(e.display))-A))}return p}function Nn(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 Rn(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)yi&&tr(e.doc,t)<r.viewTo&&Fn(e);else if(i<=r.viewFrom)yi&&vr(e.doc,i+n)>r.viewFrom?Fn(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Fn(e);else if(t<=r.viewFrom){var s=ir(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Fn(e)}else if(i>=r.viewTo){var l=ir(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Fn(e)}else{var f=ir(e,t,t,-1),p=ir(e,i,i+n,1);f&&p?(r.view=r.view.slice(0,f.index).concat(yn(e,f.lineN,p.lineN)).concat(r.view.slice(p.index)),r.viewTo+=n):Fn(e)}var g=r.externalMeasured;g&&(i<g.lineN?g.lineN+=n:t<g.lineN+g.size&&(r.externalMeasured=null))}function zn(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[Nn(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Ne(l,i)==-1&&l.push(i)}function Fn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ir(e,t,i,n){var r=Nn(e,t),s,l=e.display.view;if(!yi||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,p=0;p<r;p++)f+=l[p].size;if(f!=t){if(n>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,i+=s}for(;tr(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 _r(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=yn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=yn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Nn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(yn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Nn(e,i)))),n.viewTo=i}function Or(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 Mn(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 f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var p=f.empty();(p||e.options.showCursorWhenSelecting)&&Tr(e,f.head,r),p||_n(e,f,s)}return n}function Tr(e,t,i){var n=an(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(k("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(k("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 Pn(e,t){return e.top-t.top||e.left-t.left}function _n(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=V(e.display),f=l.left,p=Math.max(n.sizerWidth,M(e)-n.sizer.offsetLeft)-l.right,g=r.direction=="ltr";function A(lt,Et,zt,Nt){Et<0&&(Et=0),Et=Math.round(Et),Nt=Math.round(Nt),s.appendChild(k("div",null,"CodeMirror-selected","position: absolute; left: "+lt+`px;
top: `+Et+"px; width: "+(zt==null?p-lt:zt)+`px;
height: `+(Nt-Et)+"px"))}function I(lt,Et,zt){var Nt=St(r,lt),tn=Nt.text.length,jn,gi;function Xn(ai,Vi){return Un(e,Ge(lt,ai),"div",Nt,Vi)}function Zi(ai,Vi,xi){var fi=_t(e,Nt,null,ai),si=Vi=="ltr"==(xi=="after")?"left":"right",Jn=xi=="after"?fi.begin:fi.end-(/\s/.test(Nt.text.charAt(fi.end-1))?2:1);return Xn(Jn,si)[si]}var Hi=Mt(Nt,r.direction);return pt(Hi,Et||0,zt==null?tn:zt,function(ai,Vi,xi,fi){var si=xi=="ltr",Jn=Xn(ai,si?"left":"right"),Gi=Xn(Vi-1,si?"right":"left"),Bo=Et==null&&ai==0,oo=zt==null&&Vi==tn,_i=fi==0,Dr=!Hi||fi==Hi.length-1;if(Gi.top-Jn.top<=3){var vi=(g?Bo:oo)&&_i,ps=(g?oo:Bo)&&Dr,zr=vi?f:(si?Jn:Gi).left,go=ps?p:(si?Gi:Jn).right;A(zr,Jn.top,go-zr,Jn.bottom)}else{var vo,Ni,Fo,ms;si?(vo=g&&Bo&&_i?f:Jn.left,Ni=g?p:Zi(ai,xi,"before"),Fo=g?f:Zi(Vi,xi,"after"),ms=g&&oo&&Dr?p:Gi.right):(vo=g?Zi(ai,xi,"before"):f,Ni=!g&&Bo&&_i?p:Jn.right,Fo=!g&&oo&&Dr?f:Gi.left,ms=g?Zi(Vi,xi,"after"):p),A(vo,Jn.top,Ni-vo,Jn.bottom),Jn.bottom<Gi.top&&A(f,Jn.bottom,null,Gi.top),A(Fo,Gi.top,ms-Fo,Gi.bottom)}(!jn||Pn(Jn,jn)<0)&&(jn=Jn),Pn(Gi,jn)<0&&(jn=Gi),(!gi||Pn(Jn,gi)<0)&&(gi=Jn),Pn(Gi,gi)<0&&(gi=Gi)}),{start:jn,end:gi}}var he=t.from(),te=t.to();if(he.line==te.line)I(he.line,he.ch,te.ch);else{var Me=St(r,he.line),ze=St(r,te.line),et=bi(Me)==bi(ze),st=I(he.line,he.ch,et?Me.text.length+1:null).end,gt=I(te.line,et?0:null,te.ch).start;et&&(st.top<gt.top-2?(A(st.right,st.top,null,st.bottom),A(f,gt.top,gt.left,gt.bottom)):A(st.right,st.top,gt.left-st.right,st.bottom)),st.bottom<gt.top&&A(f,st.bottom,null,gt.top)}i.appendChild(s)}function ci(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||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(),Mr(e))}function Ko(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zr(e))},100)}function Mr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Le(e,"focus",e,t),e.state.focused=!0,Oe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),le&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ci(e)}function Zr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Le(e,"blur",e,t),e.state.focused=!1,ge(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,f=0;if(r.hidden)continue;if(j&&oe<8){var p=r.node.offsetTop+r.node.offsetHeight;l=p-i,i=p}else{var g=r.node.getBoundingClientRect();l=g.bottom-g.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-g.left-1)}var A=r.line.height-l;if((A>.005||A<-.005)&&(wi(r.line,l),Xo(r.line),r.rest))for(var I=0;I<r.rest.length;I++)Xo(r.rest[I]);if(f>e.display.sizerWidth){var he=Math.ceil(f/li(e.display));he>e.display.maxLineLength&&(e.display.maxLineLength=he,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Xo(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-Go(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Ui(t,n),l=Ui(t,r);if(i&&i.ensure){var f=i.ensure.from.line,p=i.ensure.to.line;f<s?(s=f,l=Ui(t,$i(St(t,f))+e.wrapper.clientHeight)):Math.min(p,t.lastLine())>=l&&(s=Ui(t,$i(St(t,p))-e.wrapper.clientHeight),l=p)}return{from:s,to:Math.max(l,s+1)}}function Xa(e,t){if(Je(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&&!J){var s=k("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Go(e.display))+`px;
height: `+(t.bottom-t.top+X(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?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=an(e,t),p=!i||i==t?f:an(e,i);r={left:Math.min(f.left,p.left),top:Math.min(f.top,p.top)-n,right:Math.max(f.left,p.left),bottom:Math.max(f.bottom,p.bottom)+n};var g=$o(e,r),A=e.doc.scrollTop,I=e.doc.scrollLeft;if(g.scrollTop!=null&&(qr(e,g.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),g.scrollLeft!=null&&(rr(e,g.scrollLeft),Math.abs(e.doc.scrollLeft-I)>1&&(l=!0)),!l)break}return r}function Ea(e,t){var i=$o(e,t);i.scrollTop!=null&&qr(e,i.scrollTop),i.scrollLeft!=null&&rr(e,i.scrollLeft)}function $o(e,t){var i=e.display,n=Zn(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 f=e.doc.height+_(i),p=t.top<n,g=t.bottom>f-n;if(t.top<r)l.scrollTop=p?0:t.top;else if(t.bottom>r+s){var A=Math.min(t.top,(g?f:t.bottom)-s);A!=r&&(l.scrollTop=A)}var I=e.options.fixedGutter?0:i.gutters.offsetWidth,he=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-I,te=M(e)-i.gutters.offsetWidth,Me=t.right-t.left>te;return Me&&(t.right=t.left+te),t.left<10?l.scrollLeft=0:t.left<he?l.scrollLeft=Math.max(0,t.left+I-(Me?0:10)):t.right>te+he-3&&(l.scrollLeft=t.right+(Me?0:10)-te),l}function Yo(e,t){if(t==null)return;Eo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Jr(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=It(e,t.from),n=It(e,t.to);co(e,i,n,t.margin)}}function co(e,t,i,n){var r=$o(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 qr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;me||po(e,{top:t}),eo(e,t,!0),me&&po(e),fo(e,100)}function eo(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 rr(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,un(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function jr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+_(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+X(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Ar=function(e,t,i){this.cm=i;var n=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),_e(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),_e(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,j&&oe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ar.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}},Ar.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ar.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ar.prototype.zeroWidthHack=function(){var e=ee&&!se?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Pe,this.disableVert=new Pe},Ar.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)},Ar.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 Ir(e,t){t||(t=jr(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,jr(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 Zo={native:Ar,null:ho};function ko(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ge(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Zo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),_e(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"?rr(e,t):qr(e,t)},e),e.display.scrollbars.addClass&&Oe(e.display.wrapper,e.display.scrollbars.addClass)}var Jo=0;function Lr(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:++Jo},Yi(e.curOp)}function Ur(e){var t=e.curOp;t&&Co(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++)Za(t[i]);for(var n=0;n<t.length;n++)Ja(t[n]);for(var r=0;r<t.length;r++)Qa(t[r]);for(var s=0;s<t.length;s++)Qo(t[s]);for(var l=0;l<t.length;l++)qa(t[l])}function Za(e){var t=e.cm,i=t.display;ka(t),e.updateMaxLine&&lo(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 or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ja(e){e.updatedDisplay=e.mustUpdate&&Br(e.cm,e.update)}function Qa(e){var t=e.cm,i=t.display;e.updatedDisplay&&xo(t),e.barMeasure=jr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=D(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+X(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-M(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Qo(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==ye();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ir(t,e.barMeasure),e.updatedDisplay&&Sn(t,e.barMeasure),e.selectionChanged&&ci(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&&eo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&rr(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 f=0;f<s.length;++f)s[f].lines.length||Le(s[f],"hide");if(l)for(var p=0;p<l.length;++p)l[p].lines.length&&Le(l[p],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Le(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ri(e,t){if(e.curOp)return t();Lr(e);try{return t()}finally{Ur(e)}}function ti(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Lr(e);try{return t.apply(e,arguments)}finally{Ur(e)}}}function Ci(e){return function(){if(this.curOp)return e.apply(this,arguments);Lr(this);try{return e.apply(this,arguments)}finally{Ur(this)}}}function ni(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Lr(t);try{return e.apply(this,arguments)}finally{Ur(t)}}}function fo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,O(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=nt(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,f=s.text.length>e.options.maxHighlightLength?Ki(t.mode,n.state):null,p=F(e,s,n,!0);f&&(n.state=f),s.styles=p.styles;var g=s.styleClasses,A=p.classes;A?s.styleClasses=A:g&&(s.styleClasses=null);for(var I=!l||l.length!=s.styles.length||g!=A&&(!g||!A||g.bgClass!=A.bgClass||g.textClass!=A.textClass),he=0;!I&&he<l.length;++he)I=l[he]!=s.styles[he];I&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&bt(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&&Ri(e,function(){for(var s=0;s<r.length;s++)zn(e,r[s],"text")})}var or=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=M(e),this.force=i,this.dims=Wn(e),this.events=[]};or.prototype.signal=function(e,t){z(e,t)&&this.events.push(arguments)},or.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Le.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=X(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=X(e)+"px",t.scrollbarsClipped=!0)}function _a(e){if(e.hasFocus())return null;var t=ye();if(!t||!N(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&N(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==ye())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&N(document.body,e.anchorNode)&&N(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 Br(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Fn(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&&Or(e)==0)return!1;hi(e)&&(Fn(e),t.dims=Wn(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)),yi&&(s=tr(e.doc,s),l=vr(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;_r(e,s,l),i.viewOffset=$i(St(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var p=Or(e);if(!f&&p==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var g=_a(e);return p>4&&(i.lineDiv.style.display="none"),Ta(e,i.updateLineNumbers,t.dims),p>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Oa(g),Ae(i.cursorDiv),Ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(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==M(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+_(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(!Br(e,t))break;xo(e);var r=jr(e);Mn(e),Ir(e,r),Sn(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 or(e,t);if(Br(e,i)){xo(e),_o(e,i);var n=jr(e);Mn(e),Ir(e,n),Sn(e,n),i.finish()}}function Ta(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Me){var ze=Me.nextSibling;return le&&ee&&e.display.currentWheelTarget==Me?Me.style.display="none":Me.parentNode.removeChild(Me),ze}for(var p=n.view,g=n.viewFrom,A=0;A<p.length;A++){var I=p[A];if(!I.hidden)if(!I.node||I.node.parentNode!=s){var he=Ca(e,I,g,i);s.insertBefore(he,l)}else{for(;l!=I.node;)l=f(l);var te=r&&t!=null&&t<=g&&I.lineNumber;I.changes&&(Ne(I.changes,"gutter")>-1&&(te=!1),ya(e,I,g,i)),te&&(Ae(I.lineNumber),I.lineNumber.appendChild(document.createTextNode(ur(e.options,g)))),l=I.node.nextSibling}g+=I.size}for(;l;)l=f(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Sn(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+X(e)+"px"}function un(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Si(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 f=i[l].alignable;if(f)for(var p=0;p<f.length;p++)f[p].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function hi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ur(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(k("div",[k("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 Di(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 to(e){var t=e.gutters,i=e.gutterSpecs;Ae(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,f=t.appendChild(k("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oo(e)}function br(e){to(e.display),Rn(e),un(e)}function mo(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=k("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=k("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ve("div",null,"CodeMirror-code"),r.selectionDiv=k("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=k("div",null,"CodeMirror-cursors"),r.measure=k("div",null,"CodeMirror-measure"),r.lineMeasure=k("div",null,"CodeMirror-measure"),r.lineSpace=ve("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ve("div",[r.lineSpace],"CodeMirror-lines");r.mover=k("div",[s],null,"position: relative"),r.sizer=k("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=k("div",null,null,"position: absolute; height: "+it+"px; width: 1px;"),r.gutters=k("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=k("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=k("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),j&&oe<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!le&&!(me&&q)&&(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=Di(n.gutters,n.lineNumbers),to(r),i.init(r)}var Rr=0,di=null;j?di=-.53:me?di=15:W?di=-.7:be&&(di=-1/3);function To(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 qo(e){var t=To(e);return t.x*=di,t.y*=di,t}function ea(e,t){var i=To(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,p=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&p))return;if(r&&ee&&le){e:for(var g=t.target,A=s.view;g!=l;g=g.parentNode)for(var I=0;I<A.length;I++)if(A[I].node==g){e.display.currentWheelTarget=g;break e}}if(n&&!me&&!H&&di!=null){r&&p&&qr(e,Math.max(0,l.scrollTop+r*di)),rr(e,Math.max(0,l.scrollLeft+n*di)),(!r||r&&p)&&b(t),s.wheelStartX=null;return}if(r&&di!=null){var he=r*di,te=e.doc.scrollTop,Me=te+s.wrapper.clientHeight;he<0?te=Math.max(0,te+he-50):Me=Math.min(e.doc.height,Me+he+50),po(e,{top:te,bottom:Me})}Rr<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 ze=l.scrollLeft-s.wheelStartX,et=l.scrollTop-s.wheelStartY,st=et&&s.wheelDY&&et/s.wheelDY||ze&&s.wheelDX&&ze/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!st)return;di=(di*Rr+st)/(Rr+1),++Rr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Pi=function(e,t){this.ranges=e,this.primIndex=t};Pi.prototype.primary=function(){return this.ranges[this.primIndex]},Pi.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(!Qi(i.anchor,n.anchor)||!Qi(i.head,n.head))return!1}return!0},Pi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(Er(this.ranges[t].anchor),Er(this.ranges[t].head));return new Pi(e,this.primIndex)},Pi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Pi.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 pr(this.anchor,this.head)},wn.prototype.to=function(){return fr(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ar(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(he,te){return Ft(he.from(),te.from())}),i=Ne(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],p=Ft(f.to(),l.from());if(n&&!l.empty()?p>0:p>=0){var g=pr(f.from(),l.from()),A=fr(f.to(),l.to()),I=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new wn(I?A:g,I?g:A))}}return new Pi(t,i)}function Cr(e,t){return new Pi([new wn(e,t||e)],0)}function xr(e){return e.text?Ge(e.from.line+e.text.length-1,qe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ta(e,t){if(Ft(e,t.from)<0)return e;if(Ft(e,t.to)<=0)return xr(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+=xr(t).ch-t.to.ch),Ge(i,n)}function Mo(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new wn(ta(r.anchor,t),ta(r.head,t)))}return ar(e.cm,i,e.sel.primIndex)}function Ma(e,t,i){return e.line==t.line?Ge(i.line,e.ch-t.ch+i.ch):Ge(i.line+(e.line-t.line),e.ch)}function Aa(e,t,i){for(var n=[],r=Ge(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],p=Ma(f.from,r,s),g=Ma(xr(f),r,s);if(r=f.to,s=g,i=="around"){var A=e.sel.ranges[l],I=Ft(A.head,A.anchor)<0;n[l]=new wn(I?g:p,I?p:g)}else n[l]=new wn(p,p)}return new Pi(n,e.sel.primIndex)}function Fr(e){e.doc.mode=ji(e.options,e.doc.modeOption),na(e)}function na(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&&Rn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&qe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,n){function r(gt){return i?i[gt]:null}function s(gt,lt,Et){ga(gt,lt,Et,n),Yn(gt,"change",gt,t)}function l(gt,lt){for(var Et=[],zt=gt;zt<lt;++zt)Et.push(new Nr(g[zt],r(zt),n));return Et}var f=t.from,p=t.to,g=t.text,A=St(e,f.line),I=St(e,p.line),he=qe(g),te=r(g.length-1),Me=p.line-f.line;if(t.full)e.insert(0,l(0,g.length)),e.remove(g.length,e.size-g.length);else if(gs(e,t)){var ze=l(0,g.length-1);s(I,I.text,te),Me&&e.remove(f.line,Me),ze.length&&e.insert(f.line,ze)}else if(A==I)if(g.length==1)s(A,A.text.slice(0,f.ch)+he+A.text.slice(p.ch),te);else{var et=l(1,g.length-1);et.push(new Nr(he+A.text.slice(p.ch),te,n)),s(A,A.text.slice(0,f.ch)+g[0],r(0)),e.insert(f.line+1,et)}else if(g.length==1)s(A,A.text.slice(0,f.ch)+g[0]+I.text.slice(p.ch),r(0)),e.remove(f.line+1,Me);else{s(A,A.text.slice(0,f.ch)+g[0],r(0)),s(I,he+I.text.slice(p.ch),te);var st=l(1,g.length-1);Me>1&&e.remove(f.line+1,Me-1),e.insert(f.line+1,st)}Yn(e,"change",e,t)}function no(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var p=r.linked[f];if(p.doc==s)continue;var g=l&&p.sharedHist;if(i&&!g)continue;t(p.doc,g),n(p.doc,r,g)}}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,Li(e),Fr(e),ys(e),e.options.lineWrapping||lo(e),e.options.mode=t.modeOption,Rn(e)}function ys(e){(e.doc.direction=="rtl"?Oe:ge)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ri(e,function(){ys(e),Rn(e)})}function La(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:Er(t.from),to:xr(t),text:Ii(e,t.from,t.to)};return xs(e,i,t.from.line,t.to.line+1),no(e,function(n){return xs(n,i,t.from.line,t.to.line+1)},!0),i}function bs(e){for(;e.length;){var t=qe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),qe(e.done);if(e.done.length&&!qe(e.done).ranges)return qe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),qe(e.done)}function Cs(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,f;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)))f=qe(l.changes),Ft(t.from,t.to)==0&&Ft(t.from,f.to)==0?f.to=xr(t):l.changes.push(ns(e,t));else{var p=qe(r.done);for((!p||!p.ranges)&&Ra(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,f||Le(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,qe(r.done),t))?r.done[r.done.length-1]=t:Ra(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&bs(r.undone)}function Ra(e,t){var i=qe(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=qi(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 f=0;f<l.length;++f){for(var p=l[f],g=0;g<s.length;++g)if(s[g].marker==p.marker)continue e;s.push(p)}}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?Pi.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var p=0;p<l.length;++p){var g=l[p],A=void 0;if(f.push({from:g.from,to:g.to,text:g.text}),t)for(var I in g)(A=I.match(/^spans_(\d+)$/))&&(Ne(t,Number(A[1]))>-1&&(qe(f)[I]=g[I],delete g[I]))}}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)),ki(e,new Pi([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=ar(e.cm,n,e.sel.primIndex);ki(e,l,i)}function rs(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,ki(e,ar(e.cm,r,e.sel.primIndex),n)}function Ss(e,t,i,n){ki(e,Cr(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 Le(e,"beforeSelectionChange",e,n),e.cm&&Le(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ar(e.cm,n.ranges,n.ranges.length-1):t}function ks(e,t,i){var n=e.history.done,r=qe(n);r&&r.ranges?(n[n.length-1]=t,Pa(e,t,i)):ki(e,t,i)}function ki(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,Ts(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Jr(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,$(e.cm)),Yn(e,"cursorActivity",e)}function Os(e){_s(e,Ts(e,e.sel,null,!1))}function Ts(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],p=Na(e,l.anchor,f&&f.anchor,i,n),g=Na(e,l.head,f&&f.head,i,n);(r||p!=l.anchor||g!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new wn(p,g))}return r?ar(e.cm,r,t.primIndex):t}function Lo(e,t,i,n,r){var s=St(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],p=f.marker,g="selectLeft"in p?!p.selectLeft:p.inclusiveLeft,A="selectRight"in p?!p.selectRight:p.inclusiveRight;if((f.from==null||(g?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(A?f.to>=t.ch:f.to>t.ch))){if(r&&(Le(p,"beforeCursorEnter"),p.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!p.atomic)continue;if(i){var I=p.find(n<0?1:-1),he=void 0;if((n<0?A:g)&&(I=Ms(e,I,-n,I&&I.line==t.line?s:null)),I&&I.line==t.line&&(he=Ft(I,i))&&(n<0?he<0:he>0))return Lo(e,I,t,n,r)}var te=p.find(n<0?-1:1);return(n<0?g:A)&&(te=Ms(e,te,n,te.line==t.line?s:null)),te?Lo(e,te,t,n,r):null}}return t}function Na(e,t,i,n,r){var s=n||1,l=Lo(e,t,i,s,r)||!r&&Lo(e,t,i,s,!0)||Lo(e,t,i,-s,r)||!r&&Lo(e,t,i,-s,!0);return l||(e.cantEdit=!0,Ge(e.first,0))}function Ms(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Ge(t.line-1)):null:i>0&&t.ch==(n||St(e,t.line)).text.length?t.line<e.first+e.size-1?Ge(t.line+1,0):null:new Ge(t.line,t.ch+i)}function As(e){e.setSelection(Ge(e.firstLine(),0),Ge(e.lastLine()),He)}function Ls(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,f){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),f!==void 0&&(n.origin=f)}),Le(e,"beforeChange",e,n),e.cm&&Le(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 Ro(e,t,i){if(e.cm){if(!e.cm.curOp)return ti(e.cm,Ro)(e,t,i);if(e.cm.state.suppressEdits)return}if((z(e,"beforeChange")||e.cm&&z(e.cm,"beforeChange"))&&(t=Ls(e,t,!0),!t))return;var n=Hr&&!i&&Sr(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Rs(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Rs(e,t)}function Rs(e,t){if(t.text.length==1&&t.text[0]==""&&Ft(t.from,t.to)==0)return;var i=Mo(e,t);Cs(e,t,i,e.cm?e.cm.curOp.id:NaN),ia(e,t,i,qi(e,t));var n=[];no(e,function(r,s){!s&&Ne(n,r.history)==-1&&(js(r.history,t),n.push(r.history)),ia(r,t,null,qi(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,f=t=="undo"?r.done:r.undone,p=t=="undo"?r.undone:r.done,g=0;g<f.length&&!(s=f[g],i?s.ranges&&!s.equals(e.sel):!s.ranges);g++);if(g==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Ra(s,p),i&&!s.equals(e.sel)){ki(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var A=[];Ra(l,p),p.push({changes:A,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var I=z(e,"beforeChange")||e.cm&&z(e.cm,"beforeChange"),he=function(ze){var et=s.changes[ze];if(et.origin=t,I&&!Ls(e,et,!1))return f.length=0,{};A.push(ns(e,et));var st=ze?Mo(e,et):qe(f);ia(e,et,st,ws(e,et)),!ze&&e.cm&&e.cm.scrollIntoView({from:et.from,to:xr(et)});var gt=[];no(e,function(lt,Et){!Et&&Ne(gt,lt.history)==-1&&(js(lt.history,et),gt.push(lt.history)),ia(lt,et,null,ws(lt,et))})},te=s.changes.length-1;te>=0;--te){var Me=he(te);if(Me)return Me.v}}function Ds(e,t){if(t==0)return;if(e.first+=t,e.sel=new Pi(vt(e.sel.ranges,function(r){return new wn(Ge(r.anchor.line+t,r.anchor.ch),Ge(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Rn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)zn(e.cm,n,"gutter")}}function ia(e,t,i,n){if(e.cm&&!e.cm.curOp)return ti(e.cm,ia)(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:Ge(e.first,0),to:Ge(t.to.line+r,t.to.ch),text:[qe(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Ge(s,St(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ii(e,t.from,t.to),i||(i=Mo(e,t)),e.cm?Cl(e.cm,t,n):ts(e,t,n),Pa(e,i,He),e.cantEdit&&Na(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function Cl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,p=s.line;e.options.lineWrapping||(p=qt(bi(St(n,s.line))),n.iter(p,l.line+1,function(te){if(te==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&$(e),ts(n,t,i,nr(e)),e.options.lineWrapping||(n.iter(p,s.line+t.text.length,function(te){var Me=Xr(te);Me>r.maxLineLength&&(r.maxLine=te,r.maxLineLength=Me,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Xi(n,s.line),fo(e,400);var g=t.text.length-(l.line-s.line)-1;t.full?Rn(e):s.line==l.line&&t.text.length==1&&!gs(e.doc,t)?zn(e,s.line,"text"):Rn(e,s.line,l.line+1,g);var A=z(e,"changes"),I=z(e,"change");if(I||A){var he={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};I&&Yn(e,"change",e,he),A&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(he)}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)),Ro(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 f=0;f<s.ranges.length;f++)Ps(s.ranges[f].anchor,t,i,n),Ps(s.ranges[f].head,t,i,n);continue}for(var p=0;p<s.changes.length;++p){var g=s.changes[p];if(i<g.from.line)g.from=Ge(g.from.line+n,g.from.ch),g.to=Ge(g.to.line+n,g.to.ch);else if(t<=g.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 ra(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=St(e,h(e,t)):r=qt(t),r==null?null:(n(s,r)&&e.cm&&zn(e.cm,r,i),s)}function oa(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}oa.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,bo(r),Yn(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 aa(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}aa.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 oa))){var f=[];this.collapse(f),this.children=[new oa(f)],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,f=l;f<r.lines.length;){var p=new oa(r.lines.slice(f,f+=25));r.height-=p.height,this.children.splice(++n,0,p),p.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 aa(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=Ne(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new aa(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 sa=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};sa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=qt(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=Yr(this);wi(i,Math.max(0,i.height-s)),e&&(Ri(e,function(){Is(e,i,-s),zn(e,n,"widget")}),Yn(e,"lineWidgetCleared",e,this,n))},sa.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=Yr(this)-t;if(!r)return;mi(this.doc,n)||wi(n,n.height+r),i&&Ri(i,function(){i.curOp.forceUpdate=!0,Is(i,n,r),Yn(i,"lineWidgetChanged",i,e,qt(n))})},K(sa);function Is(e,t,i){$i(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Yo(e,i)}function xl(e,t,i,n){var r=new sa(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),ra(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(r.insertAt==null?f.push(r):f.splice(Math.min(f.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!mi(e,l)){var p=$i(l)<e.scrollTop;wi(l,l.height+Yr(r)),p&&Yo(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Yn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:qt(t)),r}var Us=0,io=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};io.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Lr(e),z(this,"clear")){var i=this.find();i&&Yn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=Wi(l.markedSpans,this);e&&!this.collapsed?zn(e,qt(l),"text"):e&&(f.to!=null&&(r=qt(l)),f.from!=null&&(n=qt(l))),l.markedSpans=gr(l.markedSpans,f),f.from==null&&this.collapsed&&!mi(this.doc,l)&&e&&wi(l,Zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var p=0;p<this.lines.length;++p){var g=bi(this.lines[p]),A=Xr(g);A>e.display.maxLineLength&&(e.display.maxLine=g,e.display.maxLineLength=A,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Rn(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&&Yn(e,"markerCleared",e,this,n,r),t&&Ur(e),this.parent&&this.parent.clear()},io.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=Wi(s.markedSpans,this);if(l.from!=null&&(i=Ge(t?s:qt(s),l.from),e==-1))return i;if(l.to!=null&&(n=Ge(t?s:qt(s),l.to),e==1))return n}return i&&{from:i,to:n}},io.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Ri(n,function(){var r=t.line,s=qt(t.line),l=Z(n,s);if(l&&(Jt(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!mi(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var p=Yr(i)-f;p&&wi(r,r.height+p)}Yn(n,"markerChanged",n,e)})},io.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},io.prototype.detachLine=function(e){if(this.lines.splice(Ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},K(io);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 ti(e.cm,Po)(e,t,i,n,r);var s=new io(e,r),l=Ft(t,i);if(n&&v(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ve("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Kn(e,t.line,t,i,s)||t.line!=i.line&&Kn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Mi()}s.addToHistory&&Cs(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,p=e.cm,g;if(e.iter(f,i.line+1,function(I){p&&s.collapsed&&!p.options.lineWrapping&&bi(I)==p.display.maxLine&&(g=!0),s.collapsed&&f!=t.line&&wi(I,0),cr(I,new mr(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(I){mi(e,I)&&wi(I,0)}),s.clearOnEnter&&_e(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Fi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Us,s.atomic=!0),p){if(g&&(p.curOp.updateMaxLine=!0),s.collapsed)Rn(p,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var A=t.line;A<=i.line;A++)zn(p,A,"text");s.atomic&&Os(p.doc),Yn(p,"markerAdded",p,s)}return s}var la=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};la.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Yn(this,"clear")},la.prototype.find=function(e,t){return this.primary.find(e,t)},K(la);function wl(e,t,i,n,r){n=v(n),n.shared=!1;var s=[Po(e,t,i,n,r)],l=s[0],f=n.widgetNode;return no(e,function(p){f&&(n.widgetNode=f.cloneNode(!0)),s.push(Po(p,o(p,t),o(p,i),n,r));for(var g=0;g<p.linked.length;++g)if(p.linked[g].isParent)return;l=qe(s)}),new la(s,l)}function Bs(e){return e.findMarks(Ge(e.first,0),e.clipPos(Ge(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 f=Po(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];no(r.primary.doc,function(p){return s.push(p)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];Ne(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,zi=function(e,t,i,n,r){if(!(this instanceof zi))return new zi(e,t,i,n,r);i==null&&(i=0),aa.call(this,[new oa([new Nr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Ge(i,0);this.sel=Cr(s),this.history=new La(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}),ki(this,Cr(s),He)};zi.prototype=dt(aa.prototype,{constructor:zi,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:ni(function(e){var t=Ge(this.first,0),i=this.first+this.size-1;Ro(this,{from:t,to:Ge(i,St(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Qr(this.cm,0,0),ki(this,Cr(t),He)}),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=Ii(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(Ji(this,e))return St(this,e)},getLineNumber:function(e){return qt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=St(this,e)),bi(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:ni(function(e,t,i){Ss(this,o(this,typeof e=="number"?Ge(e,t||0):e),null,i)}),setSelection:ni(function(e,t,i){Ss(this,o(this,e),o(this,t||e),i)}),extendSelection:ni(function(e,t,i){Da(this,o(this,e),t&&o(this,t),i)}),extendSelections:ni(function(e,t){Es(this,u(this,e),t)}),extendSelectionsBy:ni(function(e,t){var i=vt(this.sel.ranges,e);Es(this,u(this,i),t)}),setSelections:ni(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)),ki(this,ar(this.cm,n,t),i)}),addSelection:ni(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new wn(o(this,e),o(this,t||e))),ki(this,ar(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=Ii(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=Ii(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:ni(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 f=t&&t!="end"&&Aa(this,n,t),p=n.length-1;p>=0;p--)Ro(this,n[p]);f?ks(this,f):this.cm&&Jr(this.cm)}),undo:ni(function(){ja(this,"undo")}),redo:ni(function(){ja(this,"redo")}),undoSelection:ni(function(){ja(this,"undo",!0)}),redoSelection:ni(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 La(this.history.maxGeneration),no(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 La(this.history.maxGeneration);t.done=Ao(e.done.slice(0),null,!0),t.undone=Ao(e.undone.slice(0),null,!0)},setGutterMarker:ni(function(e,t,i){return ra(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&ct(r)&&(n.gutterMarkers=null),!0})}),clearGutter:ni(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&ra(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ct(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ji(this,e))return null;if(t=e,e=St(this,e),!e)return null}else if(t=qt(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:ni(function(e,t,i){return ra(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(ue(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:ni(function(e,t,i){return ra(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(ue(i));if(!l)return!1;var f=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:ni(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=St(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 f=0;f<l.length;f++){var p=l[f];!(p.to!=null&&r==e.line&&e.ch>=p.to||p.from==null&&r!=e.line||p.from!=null&&r==t.line&&p.from>=t.ch)&&(!i||i(p.marker))&&n.push(p.marker.parent||p.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,Ge(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 zi(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 zi(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 Hn&&(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];no(e,function(r){return n.push(r.id)},!0),e.history=new La(null),e.history.done=Ao(this.history.done,n),e.history.undone=Ao(this.history.undone,n)}},iterLinkedDocs:function(e){no(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Vt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:ni(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)})}),zi.prototype.eachLine=zi.prototype.iter;var Fs=0;function _l(e){var t=this;if(Ws(t),Je(t,e)||yr(t.display,e))return;b(e),j&&(Fs=+new Date);var i=ui(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,f=function(){++l==r&&ti(t,function(){i=o(t.doc,i);var te={from:i,to:i,text:t.doc.splitLines(s.filter(function(Me){return Me!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ro(t.doc,te),ks(t.doc,Cr(o(t.doc,i),o(t.doc,xr(te))))})()},p=function(te,Me){if(t.options.allowDropFileTypes&&Ne(t.options.allowDropFileTypes,te.type)==-1){f();return}var ze=new FileReader;ze.onerror=function(){return f()},ze.onload=function(){var et=ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(et)){f();return}s[Me]=et,f()},ze.readAsText(te)},g=0;g<n.length;g++)p(n[g],g);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 A=e.dataTransfer.getData("Text");if(A){var I;if(t.state.draggingText&&!t.state.draggingText.copy&&(I=t.listSelections()),Pa(t.doc,Cr(i,i)),I)for(var he=0;he<I.length;++he)Do(t.doc,"",I[he].anchor,I[he].head,"drag");t.replaceSelection(A,"around","paste"),t.display.input.focus()}}catch(te){}}}function Ol(e,t){if(j&&(!e.state.draggingText||+new Date-Fs<100)){T(t);return}if(Je(e,t)||yr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!be){var i=k("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",H&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),H&&i.parentNode.removeChild(i)}}function Tl(e,t){var i=ui(e,t);if(!i)return;var n=document.createDocumentFragment();Tr(e,i,n),e.display.dragCursor||(e.display.dragCursor=k("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),fe(e.display.dragCursor,n)}function Ws(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 Hs=!1;function Ml(){if(Hs)return;Al(),Hs=!0}function Al(){var e;_e(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,zs(Ll)},100))}),_e(window,"blur",function(){return zs(Zr)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ro={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"},ua=0;ua<10;ua++)ro[ua+48]=ro[ua+96]=String(ua);for(var Ia=65;Ia<=90;Ia++)ro[Ia]=String.fromCharCode(Ia);for(var ca=1;ca<=12;ca++)ro[ca+111]=ro[ca+63235]="F"+ca;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=ee?Wr.macDefault:Wr.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}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=vt(i.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var p=t[f];if(!p)t[f]=l;else if(p!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var g in t)e[g]=t[g];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:ro[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),(de?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(de?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ks(e,t){if(H&&e.keyCode==34&&e.char)return!1;var i=ro[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,qe(n).to)<=0;){var l=n.pop();if(Ft(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Ri(e,function(){for(var f=n.length-1;f>=0;f--)Do(e.doc,"",n[f].from,n[f].to,"+delete");Jr(e)})}function os(e,t,i){var n=Ye(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 Ge(t.line,n,i<0?"after":"before")}function ss(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=Mt(i,t.doc.direction);if(s){var l=r<0?qe(s):s[0],f=r<0==(l.level==1),p=f?"after":"before",g;if(l.level>0||t.doc.direction=="rtl"){var A=G(t,i);g=r<0?i.text.length-1:0;var I=ne(t,A,g).top;g=Ot(function(he){return ne(t,A,he).top==I},r<0==(l.level==1)?l.from:l.to-1,g),p=="before"&&(g=os(i,g,1))}else g=r<0?l.to:l.from;return new Ge(n,g,p)}}return new Ge(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=Mt(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=rt(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 f=function(st,gt){return os(t,st instanceof Ge?st.ch:st,gt)},p,g=function(st){return e.options.lineWrapping?(p=p||G(e,t),_t(e,t,p,st)):{begin:0,end:t.text.length}},A=g(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var I=l.level==1==n<0,he=f(i,I?1:-1);if(he!=null&&(I?he<=l.to&&he<=A.end:he>=l.from&&he>=A.begin)){var te=I?"before":"after";return new Ge(i.line,he,te)}}var Me=function(st,gt,lt){for(var Et=function(jn,gi){return gi?new Ge(i.line,f(jn,1),"before"):new Ge(i.line,jn,"after")};st>=0&&st<r.length;st+=gt){var zt=r[st],Nt=gt>0==(zt.level!=1),tn=Nt?lt.begin:f(lt.end,-1);if(zt.from<=tn&&tn<zt.to)return Et(tn,Nt);if(tn=Nt?zt.from:f(zt.to,-1),lt.begin<=tn&&tn<lt.end)return Et(tn,Nt)}},ze=Me(s+n,n,A);if(ze)return ze;var et=n>0?A.end:f(A.begin,-1);return et!=null&&!(n>0&&et==t.text.length)&&(ze=Me(n>0?0:r.length-1,n,g(et)),ze)?ze:null}var ha={selectAll:As,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),He)},killLine:function(e){return jo(e,function(t){if(t.empty()){var i=St(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ge(t.head.line+1,0)}:{from:t.head,to:Ge(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return jo(e,function(t){return{from:Ge(t.from().line,0),to:o(e.doc,Ge(t.to().line+1,0))}})},delLineLeft:function(e){return jo(e,function(t){return{from:Ge(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(Ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ge(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")},Ie)},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")},Ie)},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},Ie)},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=ae(e.getLine(s.line),s.ch,n);t.push(R(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ri(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=St(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Ge(r.line,r.ch-1)),r.ch>0)r=new Ge(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Ge(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=St(e.doc,r.line-1).text;l&&(r=new Ge(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ge(r.line-1,l.length-1),r,"+transpose"))}}i.push(new wn(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Ri(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);Jr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=St(e.doc,t),n=bi(i);return n!=i&&(t=qt(n)),ss(!0,e,n,t,1)}function Nl(e,t){var i=St(e.doc,t),n=Gr(i);return n!=i&&(t=qt(n)),ss(!0,e,i,t,-1)}function $s(e,t){var i=Xs(e,t.line),n=St(e.doc,i.line),r=Mt(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 Ge(i.line,l?0:s,i.sticky)}return i}function Ba(e,t,i){if(typeof t=="string"&&(t=ha[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)!=ft}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 Pe;function da(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"&&Yn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(b(i),ci(e)),!!r}function Zs(e,t){var i=Ks(t,!0);return i?t.shiftKey&&!e.state.keySeq?da(e,"Shift-"+i,t,function(n){return Ba(e,n,!0)})||da(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Ba(e,n)}):da(e,i,t,function(n){return Ba(e,n)}):!1}function Ul(e,t,i){return da(e,"'"+i+"'",t,function(n){return Ba(e,n,!0)})}var ls=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=ye(),Je(t,e))return;j&&oe<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Zs(t,e);H&&(ls=n?i:null,!n&&i==88&&!On&&(ee?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),me&&!ee&&!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;Oe(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(ge(t,"CodeMirror-crosshair"),wt(document,"keyup",i),wt(document,"mouseover",i))}_e(document,"keyup",i),_e(document,"mouseover",i)}function Qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Je(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(yr(t.display,e)||Je(t,e)||e.ctrlKey&&!e.altKey||ee&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(H&&i==ls){ls=null,b(e);return}if(H&&(!e.which||e.which<10)&&Zs(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 fa,pa;function Wl(e,t){var i=+new Date;return pa&&pa.compare(i,e,t)?(fa=pa=null,"triple"):fa&&fa.compare(i,e,t)?(pa=new us(i,e,t),fa=null,"double"):(fa=new us(i,e,t),pa=null,"single")}function el(e){var t=this,i=t.display;if(Je(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,yr(i,e)){le||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(cs(t,e))return;var n=ui(t,e),r=Y(e),s=n?Wl(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):ce(e)==i.scroller&&b(e):r==2?(n&&Da(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Fe?t.display.input.onContextMenu(e):Ko(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,da(e,Gs(s,r),r,function(l){if(typeof l=="string"&&(l=ha[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=ft}finally{e.state.suppressEdits=!1}return f})}function Hl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Ee?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=ee?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ee?i.altKey:i.ctrlKey)),r}function Vl(e,t,i,n){j?setTimeout(O(wa,e),0):e.curOp.focus=ye();var r=Hl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Re&&!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=ti(e,function(g){le&&(r.scroller.draggable=!1),e.state.draggingText=!1,wt(r.wrapper.ownerDocument,"mouseup",l),wt(r.wrapper.ownerDocument,"mousemove",f),wt(r.scroller,"dragstart",p),wt(r.scroller,"drop",l),s||(b(g),n.addNew||Da(e.doc,i,null,null,n.extend),le&&!be||j&&oe==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(g){s=s||Math.abs(t.clientX-g.clientX)+Math.abs(t.clientY-g.clientY)>=10},p=function(){return s=!0};le&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),_e(r.wrapper.ownerDocument,"mouseup",l),_e(r.wrapper.ownerDocument,"mousemove",f),_e(r.scroller,"dragstart",p),_e(r.scroller,"drop",l),Ko(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(Ge(t.line,0),o(e.doc,Ge(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;b(t);var l,f,p=s.sel,g=p.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=g[f]:l=new wn(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new wn(i,i)),i=ui(e,t,!0,!0),f=-1;else{var A=tl(e,i,n.unit);n.extend?l=is(l,A.anchor,A.head,n.extend):l=A}n.addNew?f==-1?(f=g.length,ki(s,ar(e,g.concat([l]),f),{scroll:!1,origin:"*mouse"})):g.length>1&&g[f].empty()&&n.unit=="char"&&!n.extend?(ki(s,ar(e,g.slice(0,f).concat(g.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=s.sel):rs(s,f,l,Ve):(f=0,ki(s,new Pi([l],0),Ve),p=s.sel);var I=i;function he(lt){if(Ft(I,lt)==0)return;if(I=lt,n.unit=="rectangle"){for(var Et=[],zt=e.options.tabSize,Nt=ae(St(s,i.line).text,i.ch,zt),tn=ae(St(s,lt.line).text,lt.ch,zt),jn=Math.min(Nt,tn),gi=Math.max(Nt,tn),Xn=Math.min(i.line,lt.line),Zi=Math.min(e.lastLine(),Math.max(i.line,lt.line));Xn<=Zi;Xn++){var Hi=St(s,Xn).text,ai=We(Hi,jn,zt);jn==gi?Et.push(new wn(Ge(Xn,ai),Ge(Xn,ai))):Hi.length>ai&&Et.push(new wn(Ge(Xn,ai),Ge(Xn,We(Hi,gi,zt))))}Et.length||Et.push(new wn(i,i)),ki(s,ar(e,p.ranges.slice(0,f).concat(Et),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(lt)}else{var Vi=l,xi=tl(e,lt,n.unit),fi=Vi.anchor,si;Ft(xi.anchor,fi)>0?(si=xi.head,fi=pr(Vi.from(),xi.anchor)):(si=xi.anchor,fi=fr(Vi.to(),xi.head));var Jn=p.ranges.slice(0);Jn[f]=Xl(e,new wn(o(s,fi),si)),ki(s,ar(e,Jn,f),Ve)}}var te=r.wrapper.getBoundingClientRect(),Me=0;function ze(lt){var Et=++Me,zt=ui(e,lt,!0,n.unit=="rectangle");if(!zt)return;if(Ft(zt,I)!=0){e.curOp.focus=ye(),he(zt);var Nt=wo(r,s);(zt.line>=Nt.to||zt.line<Nt.from)&&setTimeout(ti(e,function(){Me==Et&&ze(lt)}),150)}else{var tn=lt.clientY<te.top?-20:lt.clientY>te.bottom?20:0;tn&&setTimeout(ti(e,function(){if(Me!=Et)return;r.scroller.scrollTop+=tn,ze(lt)}),50)}}function et(lt){e.state.selectingText=!1,Me=Infinity,lt&&(b(lt),r.input.focus()),wt(r.wrapper.ownerDocument,"mousemove",st),wt(r.wrapper.ownerDocument,"mouseup",gt),s.history.lastSelOrigin=null}var st=ti(e,function(lt){lt.buttons===0||!Y(lt)?et(lt):ze(lt)}),gt=ti(e,et);e.state.selectingText=gt,_e(r.wrapper.ownerDocument,"mousemove",st),_e(r.wrapper.ownerDocument,"mouseup",gt)}function Xl(e,t){var i=t.anchor,n=t.head,r=St(e.doc,i.line);if(Ft(i,n)==0&&i.sticky==n.sticky)return t;var s=Mt(r);if(!s)return t;var l=rt(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var p=l+(f.from==i.ch==(f.level!=1)?0:1);if(p==0||p==s.length)return t;var g;if(n.line!=i.line)g=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var A=rt(s,n.ch,n.sticky),I=A-l||(n.ch-i.ch)*(f.level==1?-1:1);A==p-1||A==p?g=I<0:g=I>0}var he=s[p+(g?-1:0)],te=g==(he.level==1),Me=te?he.from:he.to,ze=te?"after":"before";return i.ch==Me&&i.sticky==ze?t:new wn(new Ge(i.line,Me,ze),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(he){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&b(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!z(e,i))return S(t);s-=f.top-l.viewOffset;for(var p=0;p<e.display.gutterSpecs.length;++p){var g=l.gutters.childNodes[p];if(g&&g.getBoundingClientRect().right>=r){var A=Ui(e.doc,s),I=e.display.gutterSpecs[p];return Le(e,i,e,A,I.className,t),S(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(yr(e.display,t)||$l(e,t))return;if(Je(e,t,"contextmenu"))return;Fe||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(f,p,g){g!=Io&&s(f,p,g)}: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,Fr(n)},!0),i("indentUnit",2,Fr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){na(n),$t(n),Rn(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(p){for(var g=0;;){var A=p.text.indexOf(r,g);if(A==-1)break;g=A+r.length,s.push(Ge(l,A))}l++});for(var f=s.length-1;f>=0;f--)Do(n.doc,r,s[f],Ge(s[f].line,s[f].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",dn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",q?"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",!je),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){rl(n),br(n)},!0),i("keyMap","default",function(n,r,s){var l=Ua(r),f=s!=Io&&Ua(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Jl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Di(r,n.options.lineNumbers),br(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Si(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Ir(n)},!0),i("scrollbarStyle","native",function(n){ko(n),Ir(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=Di(n.options.gutters,r),br(n)},!0),i("firstLineNumber",1,br,!0),i("lineNumberFormatter",function(n){return n},br,!0),i("showCursorWhenSelecting",!1,Mn,!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,Zl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Mn,!0),i("singleCursorHeightPerLine",!0,Mn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,na,!0),i("addModeClass",!1,na,!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,na,!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 Zl(e,t,i){var n=i&&i!=Io;if(!t!=!n){var r=e.display.dragFunctions,s=t?_e:wt;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 Jl(e){e.options.lineWrapping?(Oe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ge(e.display.wrapper,"CodeMirror-wrap"),lo(e)),Li(e),Rn(e),$t(e),setTimeout(function(){return Ir(e)},100)}function Hn(e,t){var i=this;if(!(this instanceof Hn))return new Hn(e,t);this.options=t=t?v(t):{},v(ol,t,!1);var n=t.value;typeof n=="string"?n=new zi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Hn.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 Pe,keySeq:null,specialChars:null},t.autofocus&&!q&&s.input.focus(),j&&oe<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ml(),Lr(this),this.curOp.forceUpdate=!0,vs(this,n),t.autofocus&&!q||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Mr(i)},20):Zr(this);for(var l in Fa)Fa.hasOwnProperty(l)&&Fa[l](this,t[l],Io);hi(this),t.finishInit&&t.finishInit(this);for(var f=0;f<hs.length;++f)hs[f](this);Ur(this),le&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Hn.defaults=ol,Hn.optionHandlers=Fa;function Ql(e){var t=e.display;_e(t.scroller,"mousedown",ti(e,el)),j&&oe<11?_e(t.scroller,"dblclick",ti(e,function(p){if(Je(e,p))return;var g=ui(e,p);if(!g||cs(e,p)||yr(e.display,p))return;b(p);var A=e.findWordAt(g);Da(e.doc,A.anchor,A.head)})):_e(t.scroller,"dblclick",function(p){return Je(e,p)||b(p)}),_e(t.scroller,"contextmenu",function(p){return il(e,p)}),_e(t.input.getField(),"contextmenu",function(p){t.scroller.contains(p.target)||il(e,p)});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(p){if(p.touches.length!=1)return!1;var g=p.touches[0];return g.radiusX<=1&&g.radiusY<=1}function l(p,g){if(g.left==null)return!0;var A=g.left-p.left,I=g.top-p.top;return A*A+I*I>20*20}_e(t.scroller,"touchstart",function(p){if(!Je(e,p)&&!s(p)&&!cs(e,p)){t.input.ensurePolled(),clearTimeout(i);var g=+new Date;t.activeTouch={start:g,moved:!1,prev:g-n.end<=300?n:null},p.touches.length==1&&(t.activeTouch.left=p.touches[0].pageX,t.activeTouch.top=p.touches[0].pageY)}}),_e(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),_e(t.scroller,"touchend",function(p){var g=t.activeTouch;if(g&&!yr(t,p)&&g.left!=null&&!g.moved&&new Date-g.start<300){var A=e.coordsChar(t.activeTouch,"page"),I;!g.prev||l(g,g.prev)?I=new wn(A,A):!g.prev.prev||l(g,g.prev.prev)?I=e.findWordAt(A):I=new wn(Ge(A.line,0),o(e.doc,Ge(A.line+1,0))),e.setSelection(I.anchor,I.head),e.focus(),b(p)}r()}),_e(t.scroller,"touchcancel",r),_e(t.scroller,"scroll",function(){t.scroller.clientHeight&&(qr(e,t.scroller.scrollTop),rr(e,t.scroller.scrollLeft,!0),Le(e,"scroll",e))}),_e(t.scroller,"mousewheel",function(p){return ea(e,p)}),_e(t.scroller,"DOMMouseScroll",function(p){return ea(e,p)}),_e(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(p){Je(e,p)||T(p)},over:function(p){Je(e,p)||(Tl(e,p),T(p))},start:function(p){return Ol(e,p)},drop:ti(e,_l),leave:function(p){Je(e,p)||Ws(e)}};var f=t.input.getField();_e(f,"keyup",function(p){return Qs.call(e,p)}),_e(f,"keydown",ti(e,Js)),_e(f,"keypress",ti(e,qs)),_e(f,"focus",function(p){return Mr(e,p)}),_e(f,"blur",function(p){return Zr(e,p)})}var hs=[];Hn.defineInitHook=function(e){return hs.push(e)};function ma(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=nt(e,t).state:i="prev");var l=e.options.tabSize,f=St(r,t),p=ae(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var g=f.text.match(/^\s*/)[0],A;if(!n&&!/\S/.test(f.text))A=0,i="not";else if(i=="smart"&&(A=r.mode.indent(s,f.text.slice(g.length),f.text),A==ft||A>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?A=ae(St(r,t-1).text,null,l):A=0:i=="add"?A=p+e.options.indentUnit:i=="subtract"?A=p-e.options.indentUnit:typeof i=="number"&&(A=p+i),A=Math.max(0,A);var I="",he=0;if(e.options.indentWithTabs)for(var te=Math.floor(A/l);te;--te)he+=l,I+=" ";if(he<A&&(I+=R(A-he)),I!=g)return Do(r,I,Ge(t,0),Ge(t,g.length),"+input"),f.stateAfter=null,!0;for(var Me=0;Me<r.sel.ranges.length;Me++){var ze=r.sel.ranges[Me];if(ze.head.line==t&&ze.head.ch<g.length){var et=Ge(t,g.length);rs(r,Me,new wn(et,et));break}}}var wr=null;function Wa(e){wr=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,f=r=="paste"||e.state.pasteIncoming>l,p=Vt(t),g=null;if(f&&n.ranges.length>1)if(wr&&wr.text.join(`
`)==t){if(n.ranges.length%wr.text.length==0){g=[];for(var A=0;A<wr.text.length;A++)g.push(s.splitLines(wr.text[A]))}}else p.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(g=vt(p,function(st){return[st]}));for(var I=e.curOp.updateInput,he=n.ranges.length-1;he>=0;he--){var te=n.ranges[he],Me=te.from(),ze=te.to();te.empty()&&(i&&i>0?Me=Ge(Me.line,Me.ch-i):e.state.overwrite&&!f?ze=Ge(ze.line,Math.min(St(s,ze.line).text.length,ze.ch+qe(p).length)):f&&wr&&wr.lineWise&&wr.text.join(`
`)==p.join(`
`)&&(Me=ze=Ge(Me.line,0)));var et={from:Me,to:ze,text:g?g[he%g.length]:p,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};Ro(e.doc,et),Yn(e,"inputRead",e,et)}t&&!f&&sl(e,t),Jr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=I),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&&Ri(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 f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=ma(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(St(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=ma(e,r.head.line,"smart")));l&&Yn(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:Ge(r,0),head:Ge(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=k("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=k("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return le?e.style.width="1000px":e.setAttribute("wrap","off"),U&&(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)&&ti(this,t[n])(this,r,l),Le(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:Ci(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");At(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Rn(this)}),removeOverlay:Ci(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++,Rn(this);return}}}),indentLine:Ci(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Ji(this.doc,n)&&ma(this,n,r,s)}),indentSelection:Ci(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var f=r[l];if(f.empty())f.head.line>s&&(ma(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&Jr(this));else{var p=f.from(),g=f.to(),A=Math.max(s,p.line);s=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var I=A;I<s;++I)ma(this,I,n);var he=this.doc.sel.ranges;p.ch==0&&r.length==he.length&&he[l].from().ch>0&&rs(this.doc,l,new wn(p,he[l].to()),He)}}}),getTokenAt:function(n,r){return An(this,n,r)},getLineTokens:function(n,r){return An(this,Ge(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=De(this,St(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,p;if(f==0)p=r[2];else for(;;){var g=s+l>>1;if((g?r[g*2-1]:0)>=f)l=g;else if(r[g*2+1]<f)s=g+1;else{p=r[g*2+2];break}}var A=p?p.indexOf("overlay "):-1;return A<0?p:A==0?null:p.slice(0,A-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],f=this.getModeAt(n);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var p=0;p<f[r].length;p++){var g=l[f[r][p]];g&&s.push(g)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var A=0;A<l._global.length;A++){var I=l._global[A];I.pred(f,this)&&Ne(s,I.val)==-1&&s.push(I.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),nt(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(),an(this,s,r||"page")},charCoords:function(n,r){return Un(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=on(this,n,r||"page"),sn(this,n.left,n.top)},lineAtHeight:function(n,r){return n=on(this,{top:n,left:0},r||"page").top,Ui(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var p=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>p&&(n=p,l=!0),f=St(this.doc,n)}else f=n;return fn(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-$i(f):0)},defaultTextHeight:function(){return Zn(this.display)},defaultCharWidth:function(){return li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var p=this.display;n=an(this,o(this.doc,n));var g=n.bottom,A=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),p.sizer.appendChild(r),l=="over")g=n.top;else if(l=="above"||l=="near"){var I=Math.max(p.wrapper.clientHeight,this.doc.height),he=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>I)&&n.top>r.offsetHeight?g=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=I&&(g=n.bottom),A+r.offsetWidth>he&&(A=he-r.offsetWidth)}r.style.top=g+"px",r.style.left=r.style.right="",f=="right"?(A=p.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?A=0:f=="middle"&&(A=(p.sizer.clientWidth-r.offsetWidth)/2),r.style.left=A+"px"),s&&Ea(this,{left:A,top:g,right:A+r.offsetWidth,bottom:g+r.offsetHeight})},triggerOnKeyDown:Ci(Js),triggerOnKeyPress:Ci(qs),triggerOnKeyUp:Qs,triggerOnMouseDown:Ci(el),execCommand:function(n){if(ha.hasOwnProperty(n))return ha[n].call(null,this)},triggerElectric:Ci(function(n){sl(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var p=o(this.doc,n),g=0;g<r&&!(p=fs(this.doc,p,f,s,l),p.hitSide);++g);return p},moveH:Ci(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()},Ie)}),deleteH:Ci(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):jo(this,function(f){var p=fs(l,f.head,n,r,!1);return n<0?{from:p,to:f.head}:{from:f.head,to:p}})}),findPosV:function(n,r,s,l){var f=1,p=l;r<0&&(f=-1,r=-r);for(var g=o(this.doc,n),A=0;A<r;++A){var I=an(this,g,"div");if(p==null?p=I.left:I.left=p,g=hl(this,I,f,s),g.hitSide)break}return g},moveV:Ci(function(n,r){var s=this,l=this.doc,f=[],p=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(A){if(p)return n<0?A.from():A.to();var I=an(s,A.head,"div");A.goalColumn!=null&&(I.left=A.goalColumn),f.push(I.left);var he=hl(s,I,n,r);return r=="page"&&A==l.sel.primary()&&Yo(s,Un(s,he,"div").top-I.top),he},Ie),f.length)for(var g=0;g<l.sel.ranges.length;g++)l.sel.ranges[g].goalColumn=f[g]}),findWordAt:function(n){var r=this.doc,s=St(r,n.line).text,l=n.ch,f=n.ch;if(s){var p=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var g=s.charAt(l),A=tt(g,p)?function(I){return tt(I,p)}:/\s/.test(g)?function(I){return/\s/.test(I)}:function(I){return!/\s/.test(I)&&!tt(I)};l>0&&A(s.charAt(l-1));)--l;for(;f<s.length&&A(s.charAt(f));)++f}return new wn(Ge(n.line,l),Ge(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?Oe(this.display.cursorDiv,"CodeMirror-overwrite"):ge(this.display.cursorDiv,"CodeMirror-overwrite"),Le(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ye()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ci(function(n,r){Qr(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-X(this)-this.display.barHeight,width:n.scrollWidth-X(this)-this.display.barWidth,clientHeight:m(this),clientWidth:M(this)}},scrollIntoView:Ci(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:Ge(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:Ci(function(n,r){var s=this,l=function(p){return typeof p=="number"||/^\d+$/.test(String(p))?p+"px":p};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&Kt(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(p){if(p.widgets){for(var g=0;g<p.widgets.length;g++)if(p.widgets[g].noHScroll){zn(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Le(this,"refresh",this)}),operation:function(n){return Ri(this,n)},startOperation:function(){return Lr(this)},endOperation:function(){return Ur(this)},refresh:Ci(function(){var n=this.display.cachedTextHeight;Rn(this),this.curOp.forceUpdate=!0,$t(this),Qr(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Zn(this.display))>.5||this.options.lineWrapping)&&Li(this),Le(this,"refresh",this)}),swapDoc:Ci(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,Yn(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}},K(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,f=St(e,t.line),p=r&&e.direction=="rtl"?-i:i;function g(){var gt=t.line+p;return gt<e.first||gt>=e.first+e.size?!1:(t=new Ge(gt,t.ch,t.sticky),f=St(e,gt))}function A(gt){var lt;if(n=="codepoint"){var Et=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Et)?lt=null:lt=new Ge(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(Et>=55296&&Et<56320?2:1))),-i)}else r?lt=Pl(e.cm,f,t,i):lt=as(f,t,i);if(lt==null)if(!gt&&g())t=ss(r,e.cm,f,t.line,p);else return!1;else t=lt;return!0}if(n=="char"||n=="codepoint")A();else if(n=="column")A(!0);else if(n=="word"||n=="group")for(var I=null,he=n=="group",te=e.cm&&e.cm.getHelper(t,"wordChars"),Me=!0;!(i<0&&!A(!Me));Me=!1){var ze=f.text.charAt(t.ch)||`
`,et=tt(ze,te)?"w":he&&ze==`
`?"n":!he||/\s/.test(ze)?null:"p";if(he&&!Me&&!et&&(et="s"),I&&I!=et){i<0&&(i=1,A(),t.sticky="after");break}if(et&&(I=et),i>0&&!A(!Me))break}var st=Na(e,t,s,l,!0);return Qi(s,st)&&(st.hitSide=!0),st}function hl(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),p=Math.max(f-.5*Zn(e.display),3);l=(i>0?t.bottom:t.top)+i*p}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var g;!(g=sn(e,s,l),!g.outside);){if(i<0?l<=0:l>=r.height){g.hitSide=!0;break}l+=i*5}return g}var Dn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Pe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Dn.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(f){for(var p=f.target;p;p=p.parentNode){if(p==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(p.className))break}return!1}_e(r,"paste",function(f){if(!s(f)||Je(n,f)||al(f,n))return;oe<=11&&setTimeout(ti(n,function(){return t.updateFromDOM()}),20)}),_e(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),_e(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),_e(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),_e(r,"touchstart",function(){return i.forceCompositionEnd()}),_e(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Je(n,f))return;if(n.somethingSelected())Wa({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var p=ll(n);Wa({lineWise:!0,text:p.text}),f.type=="cut"&&n.operation(function(){n.setSelections(p.ranges,0,He),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var g=wr.text.join(`
`);if(f.clipboardData.setData("Text",g),f.clipboardData.getData("Text")==g){f.preventDefault();return}}var A=cl(),I=A.firstChild;n.display.lineSpace.insertBefore(A,n.display.lineSpace.firstChild),I.value=wr.text.join(`
`);var he=document.activeElement;Ze(I),setTimeout(function(){n.display.lineSpace.removeChild(A),he.focus(),he==r&&i.showPrimarySelection()},50)}_e(r,"copy",l),_e(r,"cut",l)},Dn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Dn.prototype.prepareSelection=function(){var e=hr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Dn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Dn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Dn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,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(pr(s,l),n)==0&&Ft(fr(s,l),r)==0)return;var f=t.display.view,p=n.line>=t.display.viewFrom&&dl(t,n)||{node:f[0].measure.map[2],offset:0},g=r.line<t.display.viewTo&&dl(t,r);if(!g){var A=f[f.length-1].measure,I=A.maps?A.maps[A.maps.length-1]:A.map;g={node:I[I.length-1],offset:I[I.length-2]-I[I.length-3]}}if(!p||!g){e.removeAllRanges();return}var he=e.rangeCount&&e.getRangeAt(0),te;try{te=ie(p.node,p.offset,g.offset,g.node)}catch(Me){}te&&(!me&&t.state.focused?(e.collapse(p.node,p.offset),te.collapsed||(e.removeAllRanges(),e.addRange(te))):(e.removeAllRanges(),e.addRange(te)),he&&e.anchorNode==null?e.addRange(he):me&&this.startGracePeriod()),this.rememberSelection()},Dn.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Dn.prototype.showMultipleSelections=function(e){fe(this.cm.display.cursorDiv,e.cursors),fe(this.cm.display.selectionDiv,e.selection)},Dn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Dn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},Dn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Dn.prototype.blur=function(){this.div.blur()},Dn.prototype.getField=function(){return this.div},Dn.prototype.supportsTouch=function(){return!0},Dn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ri(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Dn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Dn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(P&&W&&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&&Ri(t,function(){ki(t.doc,Cr(i,n),He),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Dn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Ge(n.line-1,St(e.doc,n.line-1).length)),r.ch==St(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Ge(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Nn(e,n.line))==0?(l=qt(t.view[0].line),f=t.view[0].node):(l=qt(t.view[s].line),f=t.view[s-1].node.nextSibling);var p=Nn(e,r.line),g,A;if(p==t.view.length-1?(g=t.viewTo-1,A=t.lineDiv.lastChild):(g=qt(t.view[p+1].line)-1,A=t.view[p+1].node.previousSibling),!f)return!1;for(var I=e.doc.splitLines(tu(e,f,A,l,g)),he=Ii(e.doc,Ge(l,0),Ge(g,St(e.doc,g).text.length));I.length>1&&he.length>1;)if(qe(I)==qe(he))I.pop(),he.pop(),g--;else if(I[0]==he[0])I.shift(),he.shift(),l++;else break;for(var te=0,Me=0,ze=I[0],et=he[0],st=Math.min(ze.length,et.length);te<st&&ze.charCodeAt(te)==et.charCodeAt(te);)++te;for(var gt=qe(I),lt=qe(he),Et=Math.min(gt.length-(I.length==1?te:0),lt.length-(he.length==1?te:0));Me<Et&&gt.charCodeAt(gt.length-Me-1)==lt.charCodeAt(lt.length-Me-1);)++Me;if(I.length==1&&he.length==1&&l==n.line)for(;te&&te>n.ch&&gt.charCodeAt(gt.length-Me-1)==lt.charCodeAt(lt.length-Me-1);)te--,Me++;I[I.length-1]=gt.slice(0,gt.length-Me).replace(/^\u200b+/,""),I[0]=I[0].slice(te).replace(/\u200b+$/,"");var zt=Ge(l,te),Nt=Ge(g,he.length?qe(he).length-Me:0);if(I.length>1||I[0]||Ft(zt,Nt))return Do(e.doc,I,zt,Nt,"+input"),!0},Dn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Dn.prototype.reset=function(){this.forceCompositionEnd()},Dn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Dn.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Dn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ri(this.cm,function(){return Rn(e.cm)})},Dn.prototype.setUneditable=function(e){e.contentEditable="false"},Dn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ti(this.cm,ds)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Dn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Dn.prototype.onContextMenu=function(){},Dn.prototype.resetPosition=function(){},Dn.prototype.needsContentAttribute=!0;function dl(e,t){var i=Z(e,t.line);if(!i||i.hidden)return null;var n=St(e.doc,t.line),r=y(i,n,t.line),s=Mt(n,e.doc.direction),l="left";if(s){var f=rt(s,t.ch);l=f%2?"right":"left"}var p=$e(r.map,t.ch,l);return p.offset=p.collapse=="right"?p.end:p.start,p}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,f=e.doc.lineSeparator(),p=!1;function g(te){return function(Me){return Me.id==te}}function A(){l&&(s+=f,p&&(s+=f),l=p=!1)}function I(te){te&&(A(),s+=te)}function he(te){if(te.nodeType==1){var Me=te.getAttribute("cm-text");if(Me){I(Me);return}var ze=te.getAttribute("cm-marker"),et;if(ze){var st=e.findMarks(Ge(n,0),Ge(r+1,0),g(+ze));st.length&&(et=st[0].find(0))&&I(Ii(e.doc,et.from,et.to).join(f));return}if(te.getAttribute("contenteditable")=="false")return;var gt=/^(pre|div|p|li|table|br)$/i.test(te.nodeName);if(!/^br$/i.test(te.nodeName)&&te.textContent.length==0)return;gt&&A();for(var lt=0;lt<te.childNodes.length;lt++)he(te.childNodes[lt]);/^(pre|p)$/i.test(te.nodeName)&&(p=!0),gt&&(l=!0)}else te.nodeType==3&&I(te.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(he(t),t==i);)t=t.nextSibling,p=!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(Ge(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||!N(n,t))return Uo(Ge(qt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?qe(e.rest):e.line;return Uo(Ge(qt(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var p=e.measure,g=p.maps;function A(et,st,gt){for(var lt=-1;lt<(g?g.length:0);lt++)for(var Et=lt<0?p.map:g[lt],zt=0;zt<Et.length;zt+=3){var Nt=Et[zt+2];if(Nt==et||Nt==st){var tn=qt(lt<0?e.line:e.rest[lt]),jn=Et[zt]+gt;return(gt<0||Nt!=et)&&(jn=Et[zt+(gt?1:0)]),Ge(tn,jn)}}}var I=A(l,f,i);if(I)return Uo(I,r);for(var he=f.nextSibling,te=l?l.nodeValue.length-i:0;he;he=he.nextSibling){if(I=A(he,he.firstChild,0),I)return Uo(Ge(I.line,I.ch-te),r);te+=he.textContent.length}for(var Me=f.previousSibling,ze=i;Me;Me=Me.previousSibling){if(I=A(Me,Me.firstChild,-1),I)return Uo(Ge(I.line,I.ch+ze),r);ze+=Me.textContent.length}}var ii=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Pe,this.hasSelection=!1,this.composing=null};ii.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),U&&(r.style.width="0px"),_e(r,"input",function(){j&&oe>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),_e(r,"paste",function(l){if(Je(n,l)||al(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Je(n,l))return;if(n.somethingSelected())Wa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=ll(n);Wa({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,He):(i.prevInput="",r.value=f.text.join(`
`),Ze(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}_e(r,"cut",s),_e(r,"copy",s),_e(e.scroller,"paste",function(l){if(yr(e,l)||Je(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),_e(e.lineSpace,"selectstart",function(l){yr(e,l)||b(l)}),_e(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"})}}),_e(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ii.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},ii.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ii.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=hr(e);if(e.options.moveInputWithCursor){var r=an(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},ii.prototype.showSelection=function(e){var t=this.cm,i=t.display;fe(i.cursorDiv,e.cursors),fe(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ii.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&&Ze(this.textarea),j&&oe>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",j&&oe>=9&&(this.hasSelection=null))},ii.prototype.getField=function(){return this.textarea},ii.prototype.supportsTouch=function(){return!1},ii.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!q||ye()!=this.textarea))try{this.textarea.focus()}catch(e){}},ii.prototype.blur=function(){this.textarea.blur()},ii.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ii.prototype.receivedFocus=function(){this.slowPoll()},ii.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()})},ii.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)},ii.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||yt(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(j&&oe>=9&&this.hasSelection===r||ee&&/[\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,f=Math.min(n.length,r.length);l<f&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return Ri(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},ii.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ii.prototype.onKeyPress=function(){j&&oe>=9&&(this.hasSelection=null),this.fastPoll()},ii.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=ui(i,e),l=n.scroller.scrollTop;if(!s||H)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&ti(i,ki)(i.doc,Cr(s),He);var p=r.style.cssText,g=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px;
z-index: 1000; background: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var I;le&&(I=window.scrollY),n.input.focus(),le&&window.scrollTo(null,I),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=te,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function he(){if(r.selectionStart!=null){var ze=i.somethingSelected(),et="\u200B"+(ze?r.value:"");r.value="\u21DA",r.value=et,t.prevInput=ze?"":"\u200B",r.selectionStart=1,r.selectionEnd=et.length,n.selForContextMenu=i.doc.sel}}function te(){if(t.contextMenuPending!=te)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=g,r.style.cssText=p,j&&oe<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!j||j&&oe<9)&&he();var ze=0,et=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?ti(i,As)(i):ze++<10?n.detectingSelectAll=setTimeout(et,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(et,200)}}if(j&&oe>=9&&he(),Fe){T(e);var Me=function(){wt(window,"mouseup",Me),setTimeout(te,20)};_e(window,"mouseup",Me)}else setTimeout(te,50)},ii.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ii.prototype.setUneditable=function(){},ii.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?v(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=ye();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(_e(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(p){}}t.finishInit=function(p){p.save=n,p.getTextArea=function(){return e},p.toTextArea=function(){p.toTextArea=isNaN,n(),e.parentNode.removeChild(p.getWrapperElement()),e.style.display="",e.form&&(wt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=Hn(function(p){return e.parentNode.insertBefore(p,e.nextSibling)},t);return f}function ru(e){e.off=wt,e.on=_e,e.wheelEventPixels=qo,e.Doc=zi,e.splitLines=Vt,e.countColumn=ae,e.findColumn=We,e.isWordChar=Ke,e.Pass=ft,e.signal=Le,e.Line=Nr,e.changeEnd=xr,e.scrollbarModel=Zo,e.Pos=Ge,e.cmpPos=Ft,e.modes=Cn,e.mimeModes=Gt,e.resolveMode=Lt,e.getMode=ji,e.modeExtensions=Qn,e.extendMode=ri,e.copyState=Ki,e.startState=lr,e.innerMode=sr,e.commands=ha,e.keyMap=Wr,e.keyName=Ks,e.isModifierKey=Vs,e.lookupKey=No,e.normalizeKeyMap=Dl,e.StringStream=mn,e.SharedTextMarker=la,e.TextMarker=io,e.LineWidget=sa,e.e_preventDefault=b,e.e_stopPropagation=w,e.e_stop=T,e.addClass=Oe,e.contains=N,e.rmClass=ge,e.keyNames=ro}Yl(Hn),ql(Hn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Ha in zi.prototype)zi.prototype.hasOwnProperty(Ha)&&Ne(ou,Ha)<0&&(Hn.prototype[Ha]=function(e){return function(){return e.apply(this.doc,arguments)}}(zi.prototype[Ha]));return K(zi),Hn.inputStyles={textarea:ii,contenteditable:Dn},Hn.defineMode=function(e){!Hn.defaults.mode&&e!="null"&&(Hn.defaults.mode=e),pi.apply(this,arguments)},Hn.defineMIME=Oi,Hn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Hn.defineMIME("text/plain","null"),Hn.defineExtension=function(e,t){Hn.prototype[e]=t},Hn.defineDocExtension=function(e,t){zi.prototype[e]=t},Hn.fromTextArea=iu,ru(Hn),Hn.version="5.58.2",Hn})},Y1PL:function(Ut,ut,C){"use strict";C.r(ut),C.d(ut,"ResizableTextArea",function(){return Ne});var B=C("wx14"),Ce=C("1OyB"),me=C("vuIU"),Q=C("Ji7U"),x=C("LK+K"),Se=C("q1tI"),j=C("VTBJ"),oe=C("rePB"),le=C("Zm9Q"),we=C("Kwbf"),W=C("c+Xe"),H=C("m+aA"),be=C("bdgK"),se=new Map;function J(He){He.forEach(function(Ve){var Ie,We=Ve.target;(Ie=se.get(We))===null||Ie===void 0||Ie.forEach(function(re){return re(We)})})}var U=new be.default(J),P=null,q=null;function ee(He,Ve){se.has(He)||(se.set(He,new Set),U.observe(He)),se.get(He).add(Ve)}function Ee(He,Ve){se.has(He)&&(se.get(He).delete(Ve),se.get(He).size||(U.unobserve(He),se.delete(He)))}var je=function(He){Object(Q.a)(Ie,He);var Ve=Object(x.a)(Ie);function Ie(){return Object(Ce.a)(this,Ie),Ve.apply(this,arguments)}return Object(me.a)(Ie,[{key:"render",value:function(){return this.props.children}}]),Ie}(Se.Component),xe=Se.createContext(null);function de(He){var Ve=He.children,Ie=He.onBatchResize,We=Se.useRef(0),re=Se.useRef([]),R=Se.useContext(xe),qe=Se.useCallback(function(vt,At,ot){We.current+=1;var dt=We.current;re.current.push({size:vt,element:At,data:ot}),Promise.resolve().then(function(){dt===We.current&&(Ie==null||Ie(re.current),re.current=[])}),R==null||R(vt,At,ot)},[Ie,R]);return Se.createElement(xe.Provider,{value:qe},Ve)}function Fe(He){var Ve=He.children,Ie=He.disabled,We=Se.useRef(null),re=Se.useRef(null),R=Se.useContext(xe),qe=Se.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),vt=Se.isValidElement(Ve)&&Object(W.c)(Ve),At=vt?Ve.ref:null,ot=Se.useMemo(function(){return Object(W.a)(At,We)},[At,We]),dt=Se.useRef(He);dt.current=He;var Te=Se.useCallback(function(Ke){var tt=dt.current,ct=tt.onResize,Qe=tt.data,Be=Ke.getBoundingClientRect(),Ye=Be.width,Ot=Be.height,pt=Ke.offsetWidth,mt=Ke.offsetHeight,rt=Math.floor(Ye),Rt=Math.floor(Ot);if(qe.current.width!==rt||qe.current.height!==Rt||qe.current.offsetWidth!==pt||qe.current.offsetHeight!==mt){var Mt={width:rt,height:Rt,offsetWidth:pt,offsetHeight:mt};qe.current=Mt;var Ct=pt===Math.round(Ye)?Ye:pt,_e=mt===Math.round(Ot)?Ot:mt,jt=Object(j.a)(Object(j.a)({},Mt),{},{offsetWidth:Ct,offsetHeight:_e});R==null||R(jt,Ke,Qe),ct&&Promise.resolve().then(function(){ct(jt,Ke)})}},[]);return Se.useEffect(function(){var Ke=Object(H.a)(We.current)||Object(H.a)(re.current);return Ke&&!Ie&&ee(Ke,Te),function(){return Ee(Ke,Te)}},[We.current,Ie]),Se.createElement(je,{ref:re},vt?Se.cloneElement(Ve,{ref:ot}):Ve)}var ue="rc-observer-key";function ge(He){var Ve=He.children,Ie=Object(le.a)(Ve);return Ie.map(function(We,re){var R=(We==null?void 0:We.key)||"".concat(ue,"-").concat(re);return Se.createElement(Fe,Object(B.a)({},He,{key:R}),We)})}ge.Collection=de;var Ae=ge,fe=C("bT9E"),k=C("TSYQ"),ve=C.n(k),ie=`
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
`,N=["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"],ye={},Oe;function pe(He){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ie=He.getAttribute("id")||He.getAttribute("data-reactid")||He.getAttribute("name");if(Ve&&ye[Ie])return ye[Ie];var We=window.getComputedStyle(He),re=We.getPropertyValue("box-sizing")||We.getPropertyValue("-moz-box-sizing")||We.getPropertyValue("-webkit-box-sizing"),R=parseFloat(We.getPropertyValue("padding-bottom"))+parseFloat(We.getPropertyValue("padding-top")),qe=parseFloat(We.getPropertyValue("border-bottom-width"))+parseFloat(We.getPropertyValue("border-top-width")),vt=N.map(function(ot){return"".concat(ot,":").concat(We.getPropertyValue(ot))}).join(";"),At={sizingStyle:vt,paddingSize:R,borderSize:qe,boxSizing:re};return Ve&&Ie&&(ye[Ie]=At),At}function Ze(He){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,We=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Oe||(Oe=document.createElement("textarea"),Oe.setAttribute("tab-index","-1"),Oe.setAttribute("aria-hidden","true"),document.body.appendChild(Oe)),He.getAttribute("wrap")?Oe.setAttribute("wrap",He.getAttribute("wrap")):Oe.removeAttribute("wrap");var re=pe(He,Ve),R=re.paddingSize,qe=re.borderSize,vt=re.boxSizing,At=re.sizingStyle;Oe.setAttribute("style","".concat(At,";").concat(ie)),Oe.value=He.value||He.placeholder||"";var ot=Number.MIN_SAFE_INTEGER,dt=Number.MAX_SAFE_INTEGER,Te=Oe.scrollHeight,Ke;if(vt==="border-box"?Te+=qe:vt==="content-box"&&(Te-=R),Ie!==null||We!==null){Oe.value=" ";var tt=Oe.scrollHeight-R;Ie!==null&&(ot=tt*Ie,vt==="border-box"&&(ot=ot+R+qe),Te=Math.max(ot,Te)),We!==null&&(dt=tt*We,vt==="border-box"&&(dt=dt+R+qe),Ke=Te>dt?"":"hidden",Te=Math.min(dt,Te))}return{height:Te,minHeight:ot,maxHeight:dt,overflowY:Ke,resize:"none"}}var O=C("Gytx"),v=C.n(O),ae;(function(He){He[He.NONE=0]="NONE",He[He.RESIZING=1]="RESIZING",He[He.RESIZED=2]="RESIZED"})(ae||(ae={}));var Pe=function(He){Object(Q.a)(Ie,He);var Ve=Object(x.a)(Ie);function Ie(We){var re;return Object(Ce.a)(this,Ie),re=Ve.call(this,We),re.nextFrameActionId=void 0,re.resizeFrameId=void 0,re.textArea=void 0,re.saveTextArea=function(R){re.textArea=R},re.handleResize=function(R){var qe=re.state.resizeStatus,vt=re.props,At=vt.autoSize,ot=vt.onResize;if(qe!==ae.NONE)return;typeof ot=="function"&&ot(R),At&&re.resizeOnNextFrame()},re.resizeOnNextFrame=function(){cancelAnimationFrame(re.nextFrameActionId),re.nextFrameActionId=requestAnimationFrame(re.resizeTextarea)},re.resizeTextarea=function(){var R=re.props.autoSize;if(!R||!re.textArea)return;var qe=R.minRows,vt=R.maxRows,At=Ze(re.textArea,!1,qe,vt);re.setState({textareaStyles:At,resizeStatus:ae.RESIZING},function(){cancelAnimationFrame(re.resizeFrameId),re.resizeFrameId=requestAnimationFrame(function(){re.setState({resizeStatus:ae.RESIZED},function(){re.resizeFrameId=requestAnimationFrame(function(){re.setState({resizeStatus:ae.NONE}),re.fixFirefoxAutoScroll()})})})})},re.renderTextArea=function(){var R=re.props,qe=R.prefixCls,vt=qe===void 0?"rc-textarea":qe,At=R.autoSize,ot=R.onResize,dt=R.className,Te=R.disabled,Ke=re.state,tt=Ke.textareaStyles,ct=Ke.resizeStatus,Qe=Object(fe.a)(re.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Be=ve()(vt,dt,Object(oe.a)({},"".concat(vt,"-disabled"),Te));"value"in Qe&&(Qe.value=Qe.value||"");var Ye=Object(j.a)(Object(j.a)(Object(j.a)({},re.props.style),tt),ct===ae.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return Se.createElement(Ae,{onResize:re.handleResize,disabled:!(At||ot)},Se.createElement("textarea",Object(B.a)({},Qe,{className:Be,style:Ye,ref:re.saveTextArea})))},re.state={textareaStyles:{},resizeStatus:ae.NONE},re}return Object(me.a)(Ie,[{key:"componentDidUpdate",value:function(re){(re.value!==this.props.value||!v()(re.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 re=this.textArea.selectionStart,R=this.textArea.selectionEnd;this.textArea.setSelectionRange(re,R)}}catch(qe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ie}(Se.Component),Ne=Pe,it=function(He){Object(Q.a)(Ie,He);var Ve=Object(x.a)(Ie);function Ie(We){var re;Object(Ce.a)(this,Ie),re=Ve.call(this,We),re.resizableTextArea=void 0,re.focus=function(){re.resizableTextArea.textArea.focus()},re.saveTextArea=function(qe){re.resizableTextArea=qe},re.handleChange=function(qe){var vt=re.props.onChange;re.setValue(qe.target.value,function(){re.resizableTextArea.resizeTextarea()}),vt&&vt(qe)},re.handleKeyDown=function(qe){var vt=re.props,At=vt.onPressEnter,ot=vt.onKeyDown;qe.keyCode===13&&At&&At(qe),ot&&ot(qe)};var R=typeof We.value=="undefined"||We.value===null?We.defaultValue:We.value;return re.state={value:R},re}return Object(me.a)(Ie,[{key:"setValue",value:function(re,R){"value"in this.props||this.setState({value:re},R)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return Se.createElement(Ne,Object(B.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(re){return"value"in re?{value:re.value}:null}}]),Ie}(Se.Component),ft=ut.default=it},ZW9T:function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return je});var B=C("k1fw"),Ce=C("miYZ"),me=C("tsqr"),Q=C("rAM+"),x=C("tJVT"),Se=C("PpiC"),j=C("q1tI"),oe=C.n(j),le=C("bdgK");function we(xe,de,Fe,ue,ge){var Ae=de.getWordUntilPosition(Fe),fe={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},k=ue.map(function(ve){return{label:ve,kind:xe.languages.CompletionItemKind.Keyword,insertText:ve,insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}});return ge.map(function(ve){k.push(Object(B.a)(Object(B.a)({},ve),{},{range:fe}))}),k}var W=function(xe){var de={label:"ifelse",kind:xe.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet},Fe=["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"];xe.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(fe,k){var ve=we(xe,fe,k,Fe,[de]);return{suggestions:ve}}});var ue=["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"];xe.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(fe,k){var ve=[{label:"print",kind:xe.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ie=we(xe,fe,k,ue,ve);return{suggestions:ie}}});var ge=["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"];xe.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(fe,k){var ve=[de,{label:"main",kind:xe.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:xe.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ie=we(xe,fe,k,ge,ve);return{suggestions:ie}}})},H="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",be=C("LvDl");function se(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}function J(){}var U=!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 q(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],de=xe;if(Array.isArray(xe)){for(var Fe=0;Fe<xe.length;Fe++){var ue=P[xe[Fe]];if(ue)return ue}return de[0]}return P[de]||de}var ee=null,Ee=ut.b=function(xe){var de=xe.width,Fe=de===void 0?"100%":de,ue=xe.height,ge=ue===void 0?"100%":ue,Ae=xe.value,fe=xe.language,k=fe===void 0?"javascript":fe,ve=xe.style,ie=ve===void 0?{}:ve,N=xe.options,ye=N===void 0?{}:N,Oe=xe.overrideServices,pe=Oe===void 0?{}:Oe,Ze=xe.theme,O=Ze===void 0?"vs-dark":Ze,v=xe.onEditBlur,ae=xe.onSave,Pe=xe.autoHeight,Ne=Pe===void 0?!1:Pe,it=xe.forbidCopy,ft=it===void 0?!1:it,He=xe.onChange,Ve=He===void 0?J:He,Ie=xe.editorDidMount,We=Ie===void 0?J:Ie,re=xe.onFocus,R=re===void 0?J:re,qe=xe.filename,vt=qe===void 0?"educoder.txt":qe,At=Object(Se.a)(xe,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ot=Object(j.useRef)(),dt=Object(j.useRef)({}),Te=Object(j.useRef)(),Ke=Object(j.useRef)(!1),tt=Object(j.useRef)(),ct=Object(j.useState)(!1),Qe=Object(x.a)(ct,2),Be=Qe[0],Ye=Qe[1];function Ot(){var S;return ot.current&&(S=new le.default(function(T){var ce=Object(Q.a)(T),Y;try{for(ce.s();!(Y=ce.n()).done;){var Re=Y.value;(Re.target.offsetHeight>0||Re.target.offsetWidth>0)&&dt.current.instance.layout()}}catch(ht){ce.e(ht)}finally{ce.f()}}),S.observe(ot.current)),S}function pt(){me.b.warn(decodeURIComponent(H))}var mt=function(){var T=dt.current.instance;if(Ae!=null&&T&&Be){var ce=T.getModel();ce&&Ae!==ce.getValue()&&(U=!0,ce.setValue(Ae),T.layout(),U=!1)}};Object(j.useEffect)(function(){Te.current&&clearTimeout(Te.current),Te.current=setTimeout(function(){mt()},500)},[Ae,Be,dt.current]);function rt(){var S=dt.current.instance;if(S){var T=S.getSelection(),ce=dt.current.pastePos||{},Y=new ee.Range(ce.startLineNumber||T.endLineNumber,ce.startColumn||T.endColumn,ce.endLineNumber||T.endLineNumber,ce.endColumn||T.endColumn);setTimeout(function(){S.executeEdits("",[{range:Y,text:""}])},300)}}function Rt(S){(window.navigator.platform.match("Mac")?S.metaKey:S.ctrlKey)&&S.keyCode==83&&(S.preventDefault(),ae())}var Mt=function(){if(Ne&&dt.current.instance){var T=dt.current.instance.getContentHeight();b(T<ge?ge:T)}else b(ge)};function Ct(S){var T=document.createEvent("MouseEvents");T.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),S.dispatchEvent(T)}function _e(S,T){var ce=window.URL||window.webkitURL||window,Y=new Blob([T]),Re=document.createElementNS("http://www.w3.org/1999/xhtml","a");Re.href=ce.createObjectURL(Y),Re.download=S,Ct(Re)}Object(j.useEffect)(function(){Mt()},[Mt]),Object(j.useEffect)(function(){ot.current&&!Be&&C.e(27).then(C.t.bind(null,"M/lh",7)).then(function(S){try{ee=S,dt.current.instance=ee.editor.create(ot.current,{value:Ae,language:q(k),theme:O,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},pe);var T=dt.current.instance;if(We(T,ee),setTimeout(function(){Mt(),dt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){_e(vt||"educoder.txt",T.getValue())}})},500),dt.current.subscription=T.onDidChangeModelContent(function(Y){Ke.current?clearTimeout(tt.current):(Mt(),Ve(T.getValue(),Y)),tt.current=setTimeout(function(){Ke.current=!1},500)}),window.Monaco||W(ee),ft&&(T.addCommand(ee.KeyMod.CtrlCmd|ee.KeyMod.Shift|ee.KeyCode.KEY_V,function(){return pt(),null}),T.addCommand(ee.KeyMod.CtrlCmd|ee.KeyCode.KEY_C,function(){return pt(),null})),window.Monaco=ee,v&&T.onDidBlurEditorWidget(function(){v(T.getValue())}),R&&T.onDidFocusEditorText(function(){R(T.getValue())}),ft){T.addCommand(ee.KeyMod.CtrlCmd|ee.KeyCode.KEY_V,function(){return pt(),null}),T.onDidPaste(function(Y){dt.current.pastePos=Y});try{window.addEventListener("paste",rt)}catch(Y){}}var ce=Ot();return Ye(!0),function(){var Y=dt.current.instance;Y.dispose();var Re=Y.getModel();Re&&Re.dispose(),dt.current.subscription&&dt.current.subscription.dispose(),ft&&window.removeEventListener("paste",rt),ce.unobserve(ot.current)}}catch(Y){}})},[]),Object(j.useEffect)(function(){var S=dt.current.instance;if(S&&Be)return document.addEventListener("keydown",Rt,!1),function(){document.removeEventListener("keydown",Rt)}},[ae,Be]),Object(j.useEffect)(function(){var S=dt.current.instance;if(S&&Be){var T=q(k);ee.editor.setModelLanguage(S.getModel(),T),console.log("language:",k,S.getModel(),T)}},[k,Be]),Object(j.useEffect)(function(){var S=dt.current.instance;S&&Be&&ee.editor.setTheme(O)},[O,Be]),Object(j.useEffect)(function(){var S=dt.current.instance;S&&Be&&(S.updateOptions(Object(B.a)({},ye)),setTimeout(function(){S.getModel().updateOptions(Object(B.a)({},ye))},200))},[JSON.stringify(ye),Be]),Object(j.useEffect)(function(){var S=dt.current.instance;S&&Be&&S.layout()},[Fe,ge,Be]);var jt=Object(j.useState)(se(Fe)),wt=Object(x.a)(jt,2),Le=wt[0],Je=wt[1],$=Object(j.useState)(se(ge)),z=Object(x.a)($,2),K=z[0],b=z[1],w=Object(B.a)(Object(B.a)({},ie),{},{width:Le,height:K});return oe.a.createElement("div",{className:"my-monaco-editor",ref:ot,style:w})};function je(xe){var de=xe.width,Fe=de===void 0?"100%":de,ue=xe.height,ge=ue===void 0?"100%":ue,Ae=xe.original,fe=xe.modified,k=xe.language,ve=xe.options,ie=ve===void 0?{}:ve,N=Object(j.useRef)(),ye=Object(j.useState)(null),Oe=Object(x.a)(ye,2),pe=Oe[0],Ze=Oe[1];function O(Ne){var it;return N.current&&(it=new le.default(function(ft){var He=Object(Q.a)(ft),Ve;try{for(He.s();!(Ve=He.n()).done;){var Ie=Ve.value;(Ie.target.offsetHeight>0||Ie.target.offsetWidth>0)&&Ne.layout()}}catch(We){He.e(We)}finally{He.f()}}),it.observe(N.current)),it}Object(j.useEffect)(function(){N.current&&C.e(27).then(C.t.bind(null,"M/lh",7)).then(function(Ne){ee=Ne;var it=ee.editor.createDiffEditor(N.current,Object(B.a)(Object(B.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},ie),{},{wordWrap:!0}));Ze(it);var ft=O(it);return function(){it.dispose();var He=it.getModel();He&&He.dispose(),ft.unobserve(N.current)}})},[]),Object(j.useEffect)(function(){pe&&pe.setModel({original:ee.editor.createModel(Ae,k),modified:ee.editor.createModel(fe,k)})},[Ae,fe,k,pe]);var v=se(Fe),ae=se(ge),Pe={width:v,height:ae};return oe.a.createElement("div",{className:"my-diff-editor",ref:N,style:Pe})}},ZpRC:function(Ut,ut,C){"use strict";function B(W){return typeof W=="object"&&W!=null&&W.nodeType===1}function Ce(W,H){return(!H||W!=="hidden")&&W!=="visible"&&W!=="clip"}function me(W,H){if(W.clientHeight<W.scrollHeight||W.clientWidth<W.scrollWidth){var be=getComputedStyle(W,null);return Ce(be.overflowY,H)||Ce(be.overflowX,H)||function(se){var J=function(U){if(!U.ownerDocument||!U.ownerDocument.defaultView)return null;try{return U.ownerDocument.defaultView.frameElement}catch(P){return null}}(se);return!!J&&(J.clientHeight<se.scrollHeight||J.clientWidth<se.scrollWidth)}(W)}return!1}function Q(W,H,be,se,J,U,P,q){return U<W&&P>H||U>W&&P<H?0:U<=W&&q<=be||P>=H&&q>=be?U-W-se:P>H&&q<be||U<W&&q>be?P-H+J:0}var x=function(W,H){var be=window,se=H.scrollMode,J=H.block,U=H.inline,P=H.boundary,q=H.skipOverflowHiddenElements,ee=typeof P=="function"?P:function(tt){return tt!==P};if(!B(W))throw new TypeError("Invalid target");for(var Ee=document.scrollingElement||document.documentElement,je=[],xe=W;B(xe)&&ee(xe);){if((xe=xe.parentElement)===Ee){je.push(xe);break}xe!=null&&xe===document.body&&me(xe)&&!me(document.documentElement)||xe!=null&&me(xe,q)&&je.push(xe)}for(var de=be.visualViewport?be.visualViewport.width:innerWidth,Fe=be.visualViewport?be.visualViewport.height:innerHeight,ue=window.scrollX||pageXOffset,ge=window.scrollY||pageYOffset,Ae=W.getBoundingClientRect(),fe=Ae.height,k=Ae.width,ve=Ae.top,ie=Ae.right,N=Ae.bottom,ye=Ae.left,Oe=J==="start"||J==="nearest"?ve:J==="end"?N:ve+fe/2,pe=U==="center"?ye+k/2:U==="end"?ie:ye,Ze=[],O=0;O<je.length;O++){var v=je[O],ae=v.getBoundingClientRect(),Pe=ae.height,Ne=ae.width,it=ae.top,ft=ae.right,He=ae.bottom,Ve=ae.left;if(se==="if-needed"&&ve>=0&&ye>=0&&N<=Fe&&ie<=de&&ve>=it&&N<=He&&ye>=Ve&&ie<=ft)return Ze;var Ie=getComputedStyle(v),We=parseInt(Ie.borderLeftWidth,10),re=parseInt(Ie.borderTopWidth,10),R=parseInt(Ie.borderRightWidth,10),qe=parseInt(Ie.borderBottomWidth,10),vt=0,At=0,ot="offsetWidth"in v?v.offsetWidth-v.clientWidth-We-R:0,dt="offsetHeight"in v?v.offsetHeight-v.clientHeight-re-qe:0;if(Ee===v)vt=J==="start"?Oe:J==="end"?Oe-Fe:J==="nearest"?Q(ge,ge+Fe,Fe,re,qe,ge+Oe,ge+Oe+fe,fe):Oe-Fe/2,At=U==="start"?pe:U==="center"?pe-de/2:U==="end"?pe-de:Q(ue,ue+de,de,We,R,ue+pe,ue+pe+k,k),vt=Math.max(0,vt+ge),At=Math.max(0,At+ue);else{vt=J==="start"?Oe-it-re:J==="end"?Oe-He+qe+dt:J==="nearest"?Q(it,He,Pe,re,qe+dt,Oe,Oe+fe,fe):Oe-(it+Pe/2)+dt/2,At=U==="start"?pe-Ve-We:U==="center"?pe-(Ve+Ne/2)+ot/2:U==="end"?pe-ft+R+ot:Q(Ve,ft,Ne,We,R+ot,pe,pe+k,k);var Te=v.scrollLeft,Ke=v.scrollTop;Oe+=Ke-(vt=Math.max(0,Math.min(Ke+vt,v.scrollHeight-Pe+dt))),pe+=Te-(At=Math.max(0,Math.min(Te+At,v.scrollWidth-Ne+ot)))}Ze.push({el:v,top:vt,left:At})}return Ze};function Se(W){return W===Object(W)&&Object.keys(W).length!==0}function j(W,H){H===void 0&&(H="auto");var be="scrollBehavior"in document.body.style;W.forEach(function(se){var J=se.el,U=se.top,P=se.left;J.scroll&&be?J.scroll({top:U,left:P,behavior:H}):(J.scrollTop=U,J.scrollLeft=P)})}function oe(W){return W===!1?{block:"end",inline:"nearest"}:Se(W)?W:{block:"start",inline:"nearest"}}function le(W,H){var be=!W.ownerDocument.documentElement.contains(W);if(Se(H)&&typeof H.behavior=="function")return H.behavior(be?[]:x(W,H));if(be)return;var se=oe(H);return j(x(W,se),se.behavior)}var we=ut.a=le},bT9E:function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return Ce});var B=C("VTBJ");function Ce(me,Q){var x=Object(B.a)({},me);return Array.isArray(Q)&&Q.forEach(function(Se){delete x[Se]}),x}},c5Ni:function(Ut,ut,C){},dejd:function(Ut,ut,C){},dmUQ:function(Ut,ut,C){"use strict";var B=C("Ff2n"),Ce=C("rePB"),me=C("1OyB"),Q=C("vuIU"),x=C("Ji7U"),Se=C("md7G"),j=C("foSv"),oe=C("q1tI"),le=C.n(oe),we=C("TSYQ"),W=C.n(we),H=C("4IlW");function be(fe,k){var ve=Object.keys(fe);if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(fe);k&&(ie=ie.filter(function(N){return Object.getOwnPropertyDescriptor(fe,N).enumerable})),ve.push.apply(ve,ie)}return ve}function se(fe){for(var k=1;k<arguments.length;k++){var ve=arguments[k]!=null?arguments[k]:{};k%2?be(Object(ve),!0).forEach(function(ie){Object(Ce.a)(fe,ie,ve[ie])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(ve)):be(Object(ve)).forEach(function(ie){Object.defineProperty(fe,ie,Object.getOwnPropertyDescriptor(ve,ie))})}return fe}function J(fe){var k=U();return function(){var ie=Object(j.a)(fe),N;if(k){var ye=Object(j.a)(this).constructor;N=Reflect.construct(ie,arguments,ye)}else N=ie.apply(this,arguments);return Object(Se.a)(this,N)}}function U(){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(fe){return!1}}function P(){}function q(fe){fe.preventDefault()}var ee=function(k){return k.replace(/[^\w.-]+/g,"")},Ee=200,je=600,xe=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,de=function(k){return k!=null},Fe=function(k,ve){return ve===k||typeof ve=="number"&&typeof k=="number"&&isNaN(ve)&&isNaN(k)},ue=function(fe){Object(x.a)(ve,fe);var k=J(ve);function ve(ie){var N;Object(me.a)(this,ve),N=k.call(this,ie),N.onKeyDown=function(pe){var Ze=N.props,O=Ze.onKeyDown,v=Ze.onPressEnter;if(pe.keyCode===H.a.UP){var ae=N.getRatio(pe);N.up(pe,ae,null),N.stop()}else if(pe.keyCode===H.a.DOWN){var Pe=N.getRatio(pe);N.down(pe,Pe,null),N.stop()}else pe.keyCode===H.a.ENTER&&v&&v(pe);if(N.recordCursorPosition(),N.lastKeyCode=pe.keyCode,O){for(var Ne=arguments.length,it=new Array(Ne>1?Ne-1:0),ft=1;ft<Ne;ft++)it[ft-1]=arguments[ft];O.apply(void 0,[pe].concat(it))}},N.onKeyUp=function(pe){var Ze=N.props.onKeyUp;if(N.stop(),N.recordCursorPosition(),Ze){for(var O=arguments.length,v=new Array(O>1?O-1:0),ae=1;ae<O;ae++)v[ae-1]=arguments[ae];Ze.apply(void 0,[pe].concat(v))}},N.onChange=function(pe){var Ze=N.props.onChange;N.state.focused&&(N.inputting=!0),N.rawInput=N.props.parser(N.getValueFromEvent(pe)),N.setState({inputValue:N.rawInput}),Ze(N.toNumber(N.rawInput))},N.onMouseUp=function(){var pe=N.props.onMouseUp;N.recordCursorPosition(),pe&&pe.apply(void 0,arguments)},N.onFocus=function(){var pe;N.setState({focused:!0}),(pe=N.props).onFocus.apply(pe,arguments)},N.onBlur=function(){var pe=N.props.onBlur;N.inputting=!1,N.setState({focused:!1});var Ze=N.getCurrentValidValue(N.state.inputValue),O=N.setValue(Ze,P);if(pe){var v=N.input.value,ae=N.getInputDisplayValue({focus:!1,value:O});N.input.value=ae&&Number(ae),pe.apply(void 0,arguments),N.input.value=v}},N.getRatio=function(pe){var Ze=1;return pe.metaKey||pe.ctrlKey?Ze=.1:pe.shiftKey&&(Ze=10),Ze},N.getFullNum=function(pe){return isNaN(pe)?pe:/e/i.test(String(pe))?Number(pe).toFixed(18).replace(/\.?0+$/,""):pe},N.getPrecision=function(pe){if(de(N.props.precision))return N.props.precision;var Ze=String(pe);if(Ze.indexOf("e-")>=0)return parseInt(Ze.slice(Ze.indexOf("e-")+2),10);var O=0;return Ze.indexOf(".")>=0&&(O=Ze.length-Ze.indexOf(".")-1),O},N.getInputDisplayValue=function(pe){var Ze=pe||N.state,O=Ze.focused,v=Ze.inputValue,ae=Ze.value,Pe;O?Pe=v:Pe=N.toPrecisionAsStep(ae),Pe==null&&(Pe="");var Ne=N.formatWrapper(Pe);return de(N.props.decimalSeparator)&&(Ne=Ne.toString().replace(".",N.props.decimalSeparator)),Ne},N.recordCursorPosition=function(){try{N.cursorStart=N.input.selectionStart,N.cursorEnd=N.input.selectionEnd,N.currentValue=N.input.value,N.cursorBefore=N.input.value.substring(0,N.cursorStart),N.cursorAfter=N.input.value.substring(N.cursorEnd)}catch(pe){}},N.restoreByAfter=function(pe){if(pe===void 0)return!1;var Ze=N.input.value,O=Ze.lastIndexOf(pe);if(O===-1)return!1;var v=N.cursorBefore.length;return N.lastKeyCode===H.a.DELETE&&N.cursorBefore.charAt(v-1)===pe[0]?(N.fixCaret(v,v),!0):O+pe.length===Ze.length?(N.fixCaret(O,O),!0):!1},N.partRestoreByAfter=function(pe){return pe===void 0?!1:Array.prototype.some.call(pe,function(Ze,O){var v=pe.substring(O);return N.restoreByAfter(v)})},N.isNotCompleteNumber=function(pe){return isNaN(pe)||pe===""||pe===null||pe&&pe.toString().indexOf(".")===pe.toString().length-1},N.stop=function(){N.autoStepTimer&&clearTimeout(N.autoStepTimer)},N.down=function(pe,Ze,O){N.pressingUpOrDown=!0,N.step("down",pe,Ze,O)},N.up=function(pe,Ze,O){N.pressingUpOrDown=!0,N.step("up",pe,Ze,O)},N.saveInput=function(pe){N.input=pe};var ye=ie.value;ye===void 0&&(ye=ie.defaultValue),N.state={focused:ie.autoFocus};var Oe=N.getValidValue(N.toNumber(ye));return N.state=se(se({},N.state),{},{inputValue:N.toPrecisionAsStep(Oe),value:Oe}),N}return Object(Q.a)(ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(N){var ye=this.props,Oe=ye.value,pe=ye.onChange,Ze=ye.max,O=ye.min,v=this.state.focused;if(N){if(!Fe(N.value,Oe)||!Fe(N.max,Ze)||!Fe(N.min,O)){var ae=v?Oe:this.getValidValue(Oe),Pe;this.pressingUpOrDown?Pe=ae:this.inputting?Pe=this.rawInput:Pe=this.toPrecisionAsStep(ae),this.setState({value:ae,inputValue:Pe})}var Ne="value"in this.props?Oe:this.state.value;"max"in this.props&&N.max!==Ze&&typeof Ne=="number"&&Ne>Ze&&pe&&pe(Ze),"min"in this.props&&N.min!==O&&typeof Ne=="number"&&Ne<O&&pe&&pe(O)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var it=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===H.a.BACKSPACE?it=this.cursorStart-1:this.lastKeyCode===H.a.DELETE&&(it=this.cursorStart):it=this.input.value.length,this.fixCaret(it,it)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case H.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case H.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ft){}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(N){var ye=N;return ye===""?ye="":this.isNotCompleteNumber(parseFloat(ye))?ye=this.state.value:ye=this.getValidValue(ye),this.toNumber(ye)}},{key:"getValueFromEvent",value:function(N){var ye=N.target.value.trim().replace(/。/g,".");return de(this.props.decimalSeparator)&&(ye=ye.replace(this.props.decimalSeparator,".")),ye}},{key:"getValidValue",value:function(N){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,pe=parseFloat(N);return isNaN(pe)?N:(pe<ye&&(pe=ye),pe>Oe&&(pe=Oe),pe)}},{key:"setValue",value:function(N,ye){var Oe=this.props.precision,pe=this.isNotCompleteNumber(parseFloat(N))?null:parseFloat(N),Ze=this.state.value,O=Ze===void 0?null:Ze,v=this.state.inputValue,ae=v===void 0?null:v,Pe=typeof pe=="number"?pe.toFixed(Oe):"".concat(pe),Ne=pe!==O||Pe!=="".concat(ae);return"value"in this.props?(ae=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ae},ye)):this.setState({value:pe,inputValue:this.toPrecisionAsStep(N)},ye),Ne&&this.props.onChange(pe),pe}},{key:"getMaxPrecision",value:function(N){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=this.props,pe=Oe.precision,Ze=Oe.step;if(de(pe))return pe;var O=this.getPrecision(ye),v=this.getPrecision(Ze),ae=this.getPrecision(N);return N?Math.max(ae,O+v):O+v}},{key:"getPrecisionFactor",value:function(N){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=this.getMaxPrecision(N,ye);return Math.pow(10,Oe)}},{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(N){return this.props.formatter?this.props.formatter(N):N}},{key:"toPrecisionAsStep",value:function(N){if(this.isNotCompleteNumber(N)||N==="")return N;var ye=Math.abs(this.getMaxPrecision(N));return isNaN(ye)?N.toString():Number(N).toFixed(ye)}},{key:"toNumber",value:function(N){var ye=this.props.precision,Oe=this.state.focused,pe=N&&N.length>16&&Oe;return this.isNotCompleteNumber(N)||pe?N:de(ye)?Math.round(N*Math.pow(10,ye))/Math.pow(10,ye):Number(N)}},{key:"upStep",value:function(N,ye){var Oe=this.props.step,pe=this.getPrecisionFactor(N,ye),Ze=Math.abs(this.getMaxPrecision(N,ye)),O=((pe*N+pe*Oe*ye)/pe).toFixed(Ze);return this.toNumber(O)}},{key:"downStep",value:function(N,ye){var Oe=this.props.step,pe=this.getPrecisionFactor(N,ye),Ze=Math.abs(this.getMaxPrecision(N,ye)),O=((pe*N-pe*Oe*ye)/pe).toFixed(Ze);return this.toNumber(O)}},{key:"step",value:function(N,ye){var Oe=this,pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Ze=arguments.length>3?arguments[3]:void 0;this.stop(),ye&&(ye.persist(),ye.preventDefault());var O=this.props;if(O.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var ae=this["".concat(N,"Step")](v,pe),Pe=ae>O.max||ae<O.min;if(ae>O.max?ae=O.max:ae<O.min&&(ae=O.min),this.setValue(ae,null),this.setState({focused:!0},function(){Oe.pressingUpOrDown=!1}),Pe)return;this.autoStepTimer=setTimeout(function(){Oe[N](ye,pe,!0)},Ze?Ee:je)}},{key:"fixCaret",value:function(N,ye){if(N===void 0||ye===void 0||!this.input||!this.input.value)return;try{var Oe=this.input.selectionStart,pe=this.input.selectionEnd;(N!==Oe||ye!==pe)&&this.input.setSelectionRange(N,ye)}catch(Ze){}}},{key:"render",value:function(){var N,ye=this.props,Oe=ye.prefixCls,pe=ye.disabled,Ze=ye.readOnly,O=ye.useTouch,v=ye.autoComplete,ae=ye.upHandler,Pe=ye.downHandler,Ne=ye.className,it=ye.max,ft=ye.min,He=ye.style,Ve=ye.title,Ie=ye.onMouseEnter,We=ye.onMouseLeave,re=ye.onMouseOver,R=ye.onMouseOut,qe=ye.required,vt=ye.onClick,At=ye.tabIndex,ot=ye.type,dt=ye.placeholder,Te=ye.id,Ke=ye.inputMode,tt=ye.pattern,ct=ye.step,Qe=ye.maxLength,Be=ye.autoFocus,Ye=ye.name,Ot=ye.onPaste,pt=ye.onInput,mt=Object(B.a)(ye,["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"]),rt=this.state,Rt=rt.value,Mt=rt.focused,Ct=W()(Oe,(N={},Object(Ce.a)(N,Ne,!!Ne),Object(Ce.a)(N,"".concat(Oe,"-disabled"),pe),Object(Ce.a)(N,"".concat(Oe,"-focused"),Mt),N)),_e={};Object.keys(mt).forEach(function(T){(T.substr(0,5)==="data-"||T.substr(0,5)==="aria-"||T==="role")&&(_e[T]=mt[T])});var jt=!Ze&&!pe,wt=this.getInputDisplayValue(null),Le=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)>=it),Je=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)<=ft),$=Le||pe||Ze,z=Je||pe||Ze,K=W()("".concat(Oe,"-handler"),"".concat(Oe,"-handler-up"),Object(Ce.a)({},"".concat(Oe,"-handler-up-disabled"),$)),b=W()("".concat(Oe,"-handler"),"".concat(Oe,"-handler-down"),Object(Ce.a)({},"".concat(Oe,"-handler-down-disabled"),z)),w=O?{onTouchStart:$?P:this.up,onTouchEnd:this.stop}:{onMouseDown:$?P:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},S=O?{onTouchStart:z?P:this.down,onTouchEnd:this.stop}:{onMouseDown:z?P:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return le.a.createElement("div",{className:Ct,style:He,title:Ve,onMouseEnter:Ie,onMouseLeave:We,onMouseOver:re,onMouseOut:R,onFocus:function(){return null},onBlur:function(){return null}},le.a.createElement("div",{className:"".concat(Oe,"-handler-wrap")},le.a.createElement("span",Object.assign({unselectable:"on"},w,{role:"button","aria-label":"Increase Value","aria-disabled":$,className:K}),ae||le.a.createElement("span",{unselectable:"on",className:"".concat(Oe,"-handler-up-inner"),onClick:q})),le.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Decrease Value","aria-disabled":z,className:b}),Pe||le.a.createElement("span",{unselectable:"on",className:"".concat(Oe,"-handler-down-inner"),onClick:q}))),le.a.createElement("div",{className:"".concat(Oe,"-input-wrap")},le.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ft,"aria-valuemax":it,"aria-valuenow":Rt,required:qe,type:ot,placeholder:dt,onPaste:Ot,onClick:vt,onMouseUp:this.onMouseUp,className:"".concat(Oe,"-input"),tabIndex:At,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:jt?this.onKeyDown:P,onKeyUp:jt?this.onKeyUp:P,autoFocus:Be,maxLength:Qe,readOnly:Ze,disabled:pe,max:it,min:ft,step:ct,name:Ye,title:Ve,id:Te,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(wt),pattern:tt,inputMode:Ke,onInput:pt},_e))))}}]),ve}(le.a.Component);ue.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:xe,min:-xe,step:1,style:{},onChange:P,onKeyDown:P,onPressEnter:P,onFocus:P,onBlur:P,parser:ee,required:!1,autoComplete:"off"};var ge=ue,Ae=ut.a=ge},k3GJ:function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return Ca});var B=C("rePB"),Ce=C("ODXe"),me=C("Ff2n"),Q=C("VTBJ"),x=C("q1tI"),Se=C("TSYQ"),j=C.n(Se),oe=C("Zm9Q"),le=C("6cGi"),we=C("KQm4"),W=C("xEkU"),H=C.n(W),be=C("t23M");function se(_){var V=Object(x.useRef)(),X=Object(x.useRef)(!1);function M(){for(var m=arguments.length,E=new Array(m),y=0;y<m;y++)E[y]=arguments[y];X.current||(H.a.cancel(V.current),V.current=H()(function(){_.apply(void 0,E)}))}return Object(x.useEffect)(function(){return function(){X.current=!0,H.a.cancel(V.current)}},[]),M}function J(_){var V=Object(x.useRef)([]),X=Object(x.useState)({}),M=Object(Ce.a)(X,2),m=M[1],E=Object(x.useRef)(typeof _=="function"?_():_),y=se(function(){var D=E.current;V.current.forEach(function(Z){D=Z(D)}),V.current=[],E.current=D,m({})});function L(D){V.current.push(D),y()}return[E.current,L]}var U=C("4IlW");function P(_,V){var X,M=_.prefixCls,m=_.id,E=_.active,y=_.rtl,L=_.tab,D=L.key,Z=L.tab,G=L.disabled,ne=L.closeIcon,ke=_.tabBarGutter,$e=_.tabPosition,Xe=_.closable,at=_.renderWrapper,Wt=_.removeAriaLabel,Jt=_.editable,Kt=_.onClick,$t=_.onRemove,Qt=_.onFocus,Zt="".concat(M,"-tab");x.useEffect(function(){return $t},[]);var Yt={};$e==="top"||$e==="bottom"?Yt[y?"marginLeft":"marginRight"]=ke:Yt.marginBottom=ke;var fn=Jt&&Xe!==!1&&!G;function on(It){if(G)return;Kt(It)}function Un(It){It.preventDefault(),It.stopPropagation(),Jt.onEdit("remove",{key:D,event:It})}var an=x.createElement("div",{key:D,ref:V,className:j()(Zt,(X={},Object(B.a)(X,"".concat(Zt,"-with-remove"),fn),Object(B.a)(X,"".concat(Zt,"-active"),E),Object(B.a)(X,"".concat(Zt,"-disabled"),G),X)),style:Yt,onClick:on},x.createElement("div",{role:"tab","aria-selected":E,id:m&&"".concat(m,"-tab-").concat(D),className:"".concat(Zt,"-btn"),"aria-controls":m&&"".concat(m,"-panel-").concat(D),"aria-disabled":G,tabIndex:G?null:0,onClick:function(Pt){Pt.stopPropagation(),on(Pt)},onKeyDown:function(Pt){[U.a.SPACE,U.a.ENTER].includes(Pt.which)&&(Pt.preventDefault(),on(Pt))},onFocus:Qt},Z),fn&&x.createElement("button",{type:"button","aria-label":Wt||"remove",tabIndex:0,className:"".concat(Zt,"-remove"),onClick:function(Pt){Pt.stopPropagation(),Un(Pt)}},ne||Jt.removeIcon||"\xD7"));return at&&(an=at(an)),an}var q=x.forwardRef(P),ee={width:0,height:0,left:0,top:0};function Ee(_,V,X){return Object(x.useMemo)(function(){for(var M,m=new Map,E=V.get((M=_[0])===null||M===void 0?void 0:M.key)||ee,y=E.left+E.width,L=0;L<_.length;L+=1){var D=_[L].key,Z=V.get(D);if(!Z){var G;Z=V.get((G=_[L-1])===null||G===void 0?void 0:G.key)||ee}var ne=m.get(D)||Object(Q.a)({},Z);ne.right=y-ne.left-ne.width,m.set(D,ne)}return m},[_.map(function(M){return M.key}).join("_"),V,X])}var je={width:0,height:0,left:0,top:0,right:0};function xe(_,V,X,M,m){var E=m.tabs,y=m.tabPosition,L=m.rtl,D,Z,G;["top","bottom"].includes(y)?(D="width",Z=L?"right":"left",G=Math.abs(V.left)):(D="height",Z="top",G=-V.top);var ne=V[D],ke=X[D],$e=M[D],Xe=ne;return ke+$e>ne&&(Xe=ne-$e),Object(x.useMemo)(function(){if(!E.length)return[0,0];for(var at=E.length,Wt=at,Jt=0;Jt<at;Jt+=1){var Kt=_.get(E[Jt].key)||je;if(Kt[Z]+Kt[D]>G+Xe){Wt=Jt-1;break}}for(var $t=0,Qt=at-1;Qt>=0;Qt-=1){var Zt=_.get(E[Qt].key)||je;if(Zt[Z]<G){$t=Qt+1;break}}return[$t,Wt]},[_,G,Xe,y,E.map(function(at){return at.key}).join("_"),L])}var de=C("wx14"),Fe=C("1OyB"),ue=C("vuIU"),ge=C("JX7q"),Ae=C("Ji7U"),fe=C("LK+K"),k=C("I8Z2"),ve=C("bT9E"),ie=C("2GS6"),N=C("Gytx"),ye=C.n(N),Oe=C("U8pU"),pe=/iPhone/i,Ze=/iPod/i,O=/iPad/i,v=/\bAndroid(?:.+)Mobile\b/i,ae=/Android/i,Pe=/\bAndroid(?:.+)SD4930UR\b/i,Ne=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,it=/Windows Phone/i,ft=/\bWindows(?:.+)ARM\b/i,He=/BlackBerry/i,Ve=/BB10/i,Ie=/Opera Mini/i,We=/\b(CriOS|Chrome)(?:.+)Mobile/i,re=/Mobile(?:.+)Firefox\b/i;function R(_,V){return _.test(V)}function qe(_){var V=_||(typeof navigator!="undefined"?navigator.userAgent:""),X=(V||"").split("[FBAN");if(typeof X[1]!="undefined"){var M=X,m=Object(Ce.a)(M,1);V=m[0]}if(X=V.split("Twitter"),typeof X[1]!="undefined"){var E=X,y=Object(Ce.a)(E,1);V=y[0]}var L={apple:{phone:R(pe,V)&&!R(it,V),ipod:R(Ze,V),tablet:!R(pe,V)&&R(O,V)&&!R(it,V),device:(R(pe,V)||R(Ze,V)||R(O,V))&&!R(it,V)},amazon:{phone:R(Pe,V),tablet:!R(Pe,V)&&R(Ne,V),device:R(Pe,V)||R(Ne,V)},android:{phone:!R(it,V)&&R(Pe,V)||!R(it,V)&&R(v,V),tablet:!R(it,V)&&!R(Pe,V)&&!R(v,V)&&(R(Ne,V)||R(ae,V)),device:!R(it,V)&&(R(Pe,V)||R(Ne,V)||R(v,V)||R(ae,V))||R(/\bokhttp\b/i,V)},windows:{phone:R(it,V),tablet:R(ft,V),device:R(it,V)||R(ft,V)},other:{blackberry:R(He,V),blackberry10:R(Ve,V),opera:R(Ie,V),firefox:R(re,V),chrome:R(We,V),device:R(He,V)||R(Ve,V)||R(Ie,V)||R(re,V)||R(We,V)},any:null,phone:null,tablet:null};return L.any=L.apple.device||L.android.device||L.windows.device||L.other.device,L.phone=L.apple.phone||L.android.phone||L.windows.phone,L.tablet=L.apple.tablet||L.android.tablet||L.windows.tablet,L}var vt=Object(Q.a)(Object(Q.a)({},qe()),{},{isMobile:qe}),At=vt;function ot(){}function dt(_,V,X){var M=V||"";return _.key||"".concat(M,"item_").concat(X)}function Te(_){return"".concat(_,"-menu-")}function Ke(_,V){var X=-1;x.Children.forEach(_,function(M){X+=1,M&&M.type&&M.type.isMenuItemGroup?x.Children.forEach(M.props.children,function(m){X+=1,V(m,X)}):V(M,X)})}function tt(_,V,X){if(!_||X.find)return;x.Children.forEach(_,function(M){if(M){var m=M.type;if(!m||!(m.isSubMenu||m.isMenuItem||m.isMenuItemGroup))return;V.indexOf(M.key)!==-1?X.find=!0:M.props.children&&tt(M.props.children,V,X)}})}var ct=["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"],Qe=function(V){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=V&&typeof V.getBoundingClientRect=="function"&&V.getBoundingClientRect().width;if(M){if(X){var m=getComputedStyle(V),E=m.marginLeft,y=m.marginRight;M+=+E.replace("px","")+ +y.replace("px","")}M=+M.toFixed(6)}return M||0},Be=function(V,X,M){V&&Object(Oe.a)(V.style)==="object"&&(V.style[X]=M)},Ye=function(){return At.any},Ot=C("bdgK"),pt=C("i8i4"),mt=C.n(pt),rt=C("wgJM"),Rt=C("l4aY"),Mt=C("m+aA"),Ct=C("c+Xe"),_e=C("zT1h"),jt=C("QC+M");function wt(_,V,X){return X?_[0]===V[0]:_[0]===V[0]&&_[1]===V[1]}function Le(_,V,X){var M=_[V]||{};return Object(Q.a)(Object(Q.a)({},M),X)}function Je(_,V,X,M){for(var m=X.points,E=Object.keys(_),y=0;y<E.length;y+=1){var L=E[y];if(wt(_[L].points,m,M))return"".concat(V,"-placement-").concat(L)}return""}var $=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var _=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(_)||/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(_==null?void 0:_.substr(0,4)))},z=C("MNnm");function K(_,V){var X={};return X[_.toLowerCase()]=V.toLowerCase(),X["Webkit".concat(_)]="webkit".concat(V),X["Moz".concat(_)]="moz".concat(V),X["ms".concat(_)]="MS".concat(V),X["O".concat(_)]="o".concat(V.toLowerCase()),X}function b(_,V){var X={animationend:K("Animation","AnimationEnd"),transitionend:K("Transition","TransitionEnd")};return _&&("AnimationEvent"in V||delete X.animationend.animation,"TransitionEvent"in V||delete X.transitionend.transition),X}var w=b(Object(z.a)(),typeof window!="undefined"?window:{}),S={};if(Object(z.a)()){var T=document.createElement("div");S=T.style}var ce={};function Y(_){if(ce[_])return ce[_];var V=w[_];if(V)for(var X=Object.keys(V),M=X.length,m=0;m<M;m+=1){var E=X[m];if(Object.prototype.hasOwnProperty.call(V,E)&&E in S)return ce[_]=V[E],ce[_]}return""}var Re=Y("animationend"),ht=Y("transitionend"),kt=!!(Re&&ht),xt=Re||"animationend",Xt=ht||"transitionend";function Vt(_,V){if(!_)return null;if(Object(Oe.a)(_)==="object"){var X=V.replace(/-\w/g,function(M){return M[1].toUpperCase()});return _[X]}return"".concat(_,"-").concat(V)}var yt="none",On="appear",cn="enter",En="leave",Cn="none",Gt="prepare",pi="start",Oi="active",Lt="end";function ji(_){var V=Object(x.useRef)(!1),X=Object(x.useState)(_),M=Object(Ce.a)(X,2),m=M[0],E=M[1];function y(L){V.current||E(L)}return Object(x.useEffect)(function(){return function(){V.current=!0}},[]),[m,y]}var Qn=Object(z.a)()?x.useLayoutEffect:x.useEffect,ri=Qn,Ki=function(){var _=x.useRef(null);function V(){rt.a.cancel(_.current)}function X(M){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;V();var E=Object(rt.a)(function(){m<=1?M({isCanceled:function(){return E!==_.current}}):X(M,m-1)});_.current=E}return x.useEffect(function(){return function(){V()}},[]),[X,V]},sr=[Gt,pi,Oi,Lt],lr=!1,mn=!0;function St(_){return _===Oi||_===Lt}var Ii=function(_,V){var X=x.useState(Cn),M=Object(Ce.a)(X,2),m=M[0],E=M[1],y=Ki(),L=Object(Ce.a)(y,2),D=L[0],Z=L[1];function G(){E(Gt)}return ri(function(){if(m!==Cn&&m!==Lt){var ne=sr.indexOf(m),ke=sr[ne+1],$e=V(m);$e===lr?E(ke):D(function(Xe){function at(){if(Xe.isCanceled())return;E(ke)}$e===!0?at():Promise.resolve($e).then(at)})}},[_,m]),x.useEffect(function(){return function(){Z()}},[]),[G,m]},dr=function(_){var V=Object(x.useRef)(),X=Object(x.useRef)(_);X.current=_;var M=x.useCallback(function(y){X.current(y)},[]);function m(y){y&&(y.removeEventListener(Xt,M),y.removeEventListener(xt,M))}function E(y){V.current&&V.current!==y&&m(V.current),y&&y!==V.current&&(y.addEventListener(Xt,M),y.addEventListener(xt,M),V.current=y)}return x.useEffect(function(){return function(){m(V.current)}},[]),[E,m]};function wi(_,V,X,M){var m=M.motionEnter,E=m===void 0?!0:m,y=M.motionAppear,L=y===void 0?!0:y,D=M.motionLeave,Z=D===void 0?!0:D,G=M.motionDeadline,ne=M.motionLeaveImmediately,ke=M.onAppearPrepare,$e=M.onEnterPrepare,Xe=M.onLeavePrepare,at=M.onAppearStart,Wt=M.onEnterStart,Jt=M.onLeaveStart,Kt=M.onAppearActive,$t=M.onEnterActive,Qt=M.onLeaveActive,Zt=M.onAppearEnd,Yt=M.onEnterEnd,fn=M.onLeaveEnd,on=M.onVisibleChanged,Un=ji(),an=Object(Ce.a)(Un,2),It=an[0],Pt=an[1],sn=ji(yt),pn=Object(Ce.a)(sn,2),_t=pn[0],gn=pn[1],Bn=ji(null),bn=Object(Ce.a)(Bn,2),Ln=bn[0],Tn=bn[1],Zn=Object(x.useRef)(!1),li=Object(x.useRef)(null),Wn=Object(x.useRef)(!1),Si=Object(x.useRef)(null);function nr(){var Pn=X();return Pn||Si.current}var Li=Object(x.useRef)(!1);function ui(Pn){var _n=nr();if(Pn&&!Pn.deadline&&Pn.target!==_n)return;var ci;_t===On&&Li.current?ci=Zt==null?void 0:Zt(_n,Pn):_t===cn&&Li.current?ci=Yt==null?void 0:Yt(_n,Pn):_t===En&&Li.current&&(ci=fn==null?void 0:fn(_n,Pn)),ci!==!1&&!Wn.current&&(gn(yt),Tn(null))}var Nn=dr(ui),Rn=Object(Ce.a)(Nn,1),zn=Rn[0],Fn=x.useMemo(function(){var Pn,_n,ci;switch(_t){case"appear":return Pn={},Object(B.a)(Pn,Gt,ke),Object(B.a)(Pn,pi,at),Object(B.a)(Pn,Oi,Kt),Pn;case"enter":return _n={},Object(B.a)(_n,Gt,$e),Object(B.a)(_n,pi,Wt),Object(B.a)(_n,Oi,$t),_n;case"leave":return ci={},Object(B.a)(ci,Gt,Xe),Object(B.a)(ci,pi,Jt),Object(B.a)(ci,Oi,Qt),ci;default:return{}}},[_t]),ir=Ii(_t,function(Pn){if(Pn===Gt){var _n=Fn[Gt];return _n?_n(nr()):lr}if(Mn in Fn){var ci;Tn(((ci=Fn[Mn])===null||ci===void 0?void 0:ci.call(Fn,nr(),null))||null)}return Mn===Oi&&(zn(nr()),G>0&&(clearTimeout(li.current),li.current=setTimeout(function(){ui({deadline:!0})},G))),mn}),_r=Object(Ce.a)(ir,2),Or=_r[0],Mn=_r[1],hr=St(Mn);Li.current=hr,ri(function(){Pt(V);var Pn=Zn.current;if(Zn.current=!0,!_)return;var _n;!Pn&&V&&L&&(_n=On),Pn&&V&&E&&(_n=cn),(Pn&&!V&&Z||!Pn&&ne&&!V&&Z)&&(_n=En),_n&&(gn(_n),Or())},[V]),Object(x.useEffect)(function(){(_t===On&&!L||_t===cn&&!E||_t===En&&!Z)&&gn(yt)},[L,E,Z]),Object(x.useEffect)(function(){return function(){clearTimeout(li.current),Wn.current=!0}},[]),Object(x.useEffect)(function(){It!==void 0&&_t===yt&&(on==null||on(It))},[It,_t]);var Tr=Ln;return Fn[Gt]&&Mn===pi&&(Tr=Object(Q.a)({transition:"none"},Tr)),[_t,Mn,Tr,It!=null?It:V]}var qt=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(){return Object(Fe.a)(this,X),V.apply(this,arguments)}return Object(ue.a)(X,[{key:"render",value:function(){return this.props.children}}]),X}(x.Component),Ui=qt;function Ji(_){var V=_;Object(Oe.a)(_)==="object"&&(V=_.transitionSupport);function X(m){return!!(m.motionName&&V)}var M=x.forwardRef(function(m,E){var y=m.visible,L=y===void 0?!0:y,D=m.removeOnLeave,Z=D===void 0?!0:D,G=m.forceRender,ne=m.children,ke=m.motionName,$e=m.leavedClassName,Xe=m.eventProps,at=X(m),Wt=Object(x.useRef)(),Jt=Object(x.useRef)();function Kt(){try{return Object(Mt.a)(Wt.current||Jt.current)}catch(gn){return null}}var $t=wi(at,L,Kt,m),Qt=Object(Ce.a)($t,4),Zt=Qt[0],Yt=Qt[1],fn=Qt[2],on=Qt[3],Un=x.useRef(on);on&&(Un.current=!0);var an=Object(x.useRef)(E);an.current=E;var It=x.useCallback(function(gn){Wt.current=gn,Object(Ct.b)(an.current,gn)},[]),Pt,sn=Object(Q.a)(Object(Q.a)({},Xe),{},{visible:L});if(!ne)Pt=null;else if(Zt===yt||!X(m))on?Pt=ne(Object(Q.a)({},sn),It):!Z&&Un.current?Pt=ne(Object(Q.a)(Object(Q.a)({},sn),{},{className:$e}),It):G?Pt=ne(Object(Q.a)(Object(Q.a)({},sn),{},{style:{display:"none"}}),It):Pt=null;else{var pn,_t;Yt===Gt?_t="prepare":St(Yt)?_t="active":Yt===pi&&(_t="start"),Pt=ne(Object(Q.a)(Object(Q.a)({},sn),{},{className:j()(Vt(ke,Zt),(pn={},Object(B.a)(pn,Vt(ke,"".concat(Zt,"-").concat(_t)),_t),Object(B.a)(pn,ke,typeof ke=="string"),pn)),style:fn}),It)}return x.createElement(Ui,{ref:Jt},Pt)});return M.displayName="CSSMotion",M}var ur=Ji(kt),Ge="add",Ft="keep",Qi="remove",Er="removed";function fr(_){var V;return _&&Object(Oe.a)(_)==="object"&&"key"in _?V=_:V={key:_},Object(Q.a)(Object(Q.a)({},V),{},{key:String(V.key)})}function pr(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return _.map(fr)}function h(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],X=[],M=0,m=V.length,E=pr(_),y=pr(V);E.forEach(function(Z){for(var G=!1,ne=M;ne<m;ne+=1){var ke=y[ne];if(ke.key===Z.key){M<ne&&(X=X.concat(y.slice(M,ne).map(function($e){return Object(Q.a)(Object(Q.a)({},$e),{},{status:Ge})})),M=ne),X.push(Object(Q.a)(Object(Q.a)({},ke),{},{status:Ft})),M+=1,G=!0;break}}G||X.push(Object(Q.a)(Object(Q.a)({},Z),{},{status:Qi}))}),M<m&&(X=X.concat(y.slice(M).map(function(Z){return Object(Q.a)(Object(Q.a)({},Z),{},{status:Ge})})));var L={};X.forEach(function(Z){var G=Z.key;L[G]=(L[G]||0)+1});var D=Object.keys(L).filter(function(Z){return L[Z]>1});return D.forEach(function(Z){X=X.filter(function(G){var ne=G.key,ke=G.status;return ne!==Z||ke!==Qi}),X.forEach(function(G){G.key===Z&&(G.status=Ft)})}),X}var o=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function a(_){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur,X=function(M){Object(Ae.a)(E,M);var m=Object(fe.a)(E);function E(){var y;return Object(Fe.a)(this,E),y=m.apply(this,arguments),y.state={keyEntities:[]},y.removeKey=function(L){y.setState(function(D){var Z=D.keyEntities;return{keyEntities:Z.map(function(G){return G.key!==L?G:Object(Q.a)(Object(Q.a)({},G),{},{status:Er})})}})},y}return Object(ue.a)(E,[{key:"render",value:function(){var L=this,D=this.state.keyEntities,Z=this.props,G=Z.component,ne=Z.children,ke=Z.onVisibleChanged,$e=Object(me.a)(Z,["component","children","onVisibleChanged"]),Xe=G||x.Fragment,at={};return o.forEach(function(Wt){at[Wt]=$e[Wt],delete $e[Wt]}),delete $e.keys,x.createElement(Xe,$e,D.map(function(Wt){var Jt=Wt.status,Kt=Object(me.a)(Wt,["status"]),$t=Jt===Ge||Jt===Ft;return x.createElement(V,Object(de.a)({},at,{key:Kt.key,visible:$t,eventProps:Kt,onVisibleChanged:function(Zt){ke==null||ke(Zt,{key:Kt.key}),Zt||L.removeKey(Kt.key)}}),ne)}))}}],[{key:"getDerivedStateFromProps",value:function(L,D){var Z=L.keys,G=D.keyEntities,ne=pr(Z),ke=h(G,ne);return{keyEntities:ke.filter(function($e){var Xe=G.find(function(at){var Wt=at.key;return $e.key===Wt});return!(Xe&&Xe.status===Er&&$e.status===Qi)})}}}]),E}(x.Component);return X.defaultProps={component:"div"},X}var u=a(kt),d=ur;function c(_){var V=_.prefixCls,X=_.motion,M=_.animation,m=_.transitionName;return X||(M?{motionName:"".concat(V,"-").concat(M)}:m?{motionName:m}:null)}function F(_){var V=_.prefixCls,X=_.visible,M=_.zIndex,m=_.mask,E=_.maskMotion,y=_.maskAnimation,L=_.maskTransitionName;if(!m)return null;var D={};return(E||L||y)&&(D=Object(Q.a)({motionAppear:!0},c({motion:E,prefixCls:V,transitionName:L,animation:y}))),x.createElement(d,Object(de.a)({},D,{visible:X,removeOnLeave:!0}),function(Z){var G=Z.className;return x.createElement("div",{style:{zIndex:M},className:j()("".concat(V,"-mask"),G)})})}var De=C("9mu1"),nt=C("o0o1"),bt=C.n(nt),Ue=C("HaE+"),Bt=["measure","align",null,"motion"],nn=function(_,V){var X=Object(x.useState)(null),M=Object(Ce.a)(X,2),m=M[0],E=M[1],y=Object(x.useRef)(),L=Object(x.useRef)(!1);function D(ne){L.current||E(ne)}function Z(){rt.a.cancel(y.current)}function G(ne){Z(),y.current=Object(rt.a)(function(){D(function(ke){switch(m){case"align":return"motion";case"motion":return"stable";default:}return ke}),ne==null||ne()})}return Object(x.useEffect)(function(){D("measure")},[_]),Object(x.useEffect)(function(){switch(m){case"measure":V();break;default:}m&&(y.current=Object(rt.a)(Object(Ue.a)(bt.a.mark(function ne(){var ke,$e;return bt.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:ke=Bt.indexOf(m),$e=Bt[ke+1],$e&&ke!==-1&&D($e);case 3:case"end":return at.stop()}},ne)}))))},[m]),Object(x.useEffect)(function(){return function(){L.current=!0,Z()}},[]),[m,G]},An=function(_){var V=x.useState({width:0,height:0}),X=Object(Ce.a)(V,2),M=X[0],m=X[1];function E(L){m({width:L.offsetWidth,height:L.offsetHeight})}var y=x.useMemo(function(){var L={};if(_){var D=M.width,Z=M.height;_.indexOf("height")!==-1&&Z?L.height=Z:_.indexOf("minHeight")!==-1&&Z&&(L.minHeight=Z),_.indexOf("width")!==-1&&D?L.width=D:_.indexOf("minWidth")!==-1&&D&&(L.minWidth=D)}return L},[_,M]);return[y,E]},Ti=x.forwardRef(function(_,V){var X=_.visible,M=_.prefixCls,m=_.className,E=_.style,y=_.children,L=_.zIndex,D=_.stretch,Z=_.destroyPopupOnHide,G=_.forceRender,ne=_.align,ke=_.point,$e=_.getRootDomNode,Xe=_.getClassNameFromAlign,at=_.onAlign,Wt=_.onMouseEnter,Jt=_.onMouseLeave,Kt=_.onMouseDown,$t=_.onTouchStart,Qt=Object(x.useRef)(),Zt=Object(x.useRef)(),Yt=Object(x.useState)(),fn=Object(Ce.a)(Yt,2),on=fn[0],Un=fn[1],an=An(D),It=Object(Ce.a)(an,2),Pt=It[0],sn=It[1];function pn(){D&&sn($e())}var _t=nn(X,pn),gn=Object(Ce.a)(_t,2),Bn=gn[0],bn=gn[1],Ln=Object(x.useRef)();function Tn(){return ke||$e}function Zn(){var Nn;(Nn=Qt.current)===null||Nn===void 0||Nn.forceAlign()}function li(Nn,Rn){var zn=Xe(Rn);on!==zn&&Un(zn),Bn==="align"&&(on!==zn?Promise.resolve().then(function(){Zn()}):bn(function(){var Fn;(Fn=Ln.current)===null||Fn===void 0||Fn.call(Ln)}),at==null||at(Nn,Rn))}var Wn=Object(Q.a)({},c(_));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Nn){var Rn=Wn[Nn];Wn[Nn]=function(zn,Fn){return bn(),Rn==null?void 0:Rn(zn,Fn)}});function Si(){return new Promise(function(Nn){Ln.current=Nn})}x.useEffect(function(){!Wn.motionName&&Bn==="motion"&&bn()},[Wn.motionName,Bn]),x.useImperativeHandle(V,function(){return{forceAlign:Zn,getElement:function(){return Zt.current}}});var nr=Object(Q.a)(Object(Q.a)({},Pt),{},{zIndex:L,opacity:Bn==="motion"||Bn==="stable"||!X?void 0:0,pointerEvents:Bn==="stable"?void 0:"none"},E),Li=!0;(ne==null?void 0:ne.points)&&(Bn==="align"||Bn==="stable")&&(Li=!1);var ui=y;return x.Children.count(y)>1&&(ui=x.createElement("div",{className:"".concat(M,"-content")},y)),x.createElement(d,Object(de.a)({visible:X,ref:Zt,leavedClassName:"".concat(M,"-hidden")},Wn,{onAppearPrepare:Si,onEnterPrepare:Si,removeOnLeave:Z,forceRender:G}),function(Nn,Rn){var zn=Nn.className,Fn=Nn.style,ir=j()(M,m,on,zn);return x.createElement(De.a,{target:Tn(),key:"popup",ref:Qt,monitorWindowResize:!0,disabled:Li,align:ne,onAlign:li},x.createElement("div",{ref:Rn,className:ir,onMouseEnter:Wt,onMouseLeave:Jt,onMouseDownCapture:Kt,onTouchStartCapture:$t,style:Object(Q.a)(Object(Q.a)({},Fn),nr)},ui))})});Ti.displayName="PopupInner";var Bi=Ti,$n=x.forwardRef(function(_,V){var X=_.prefixCls,M=_.visible,m=_.zIndex,E=_.children,y=_.mobile;y=y===void 0?{}:y;var L=y.popupClassName,D=y.popupStyle,Z=y.popupMotion,G=Z===void 0?{}:Z,ne=y.popupRender,ke=x.useRef();x.useImperativeHandle(V,function(){return{forceAlign:function(){},getElement:function(){return ke.current}}});var $e=Object(Q.a)({zIndex:m},D),Xe=E;return x.Children.count(E)>1&&(Xe=x.createElement("div",{className:"".concat(X,"-content")},E)),ne&&(Xe=ne(Xe)),x.createElement(d,Object(de.a)({visible:M,ref:ke,removeOnLeave:!0},G),function(at,Wt){var Jt=at.className,Kt=at.style,$t=j()(X,L,Jt);return x.createElement("div",{ref:Wt,className:$t,style:Object(Q.a)(Object(Q.a)({},Kt),$e)},Xe)})});$n.displayName="MobilePopupInner";var Xi=$n,Hr=["visible","mobile"],yi=x.forwardRef(function(_,V){var X=_.visible,M=_.mobile,m=Object(me.a)(_,Hr),E=Object(x.useState)(X),y=Object(Ce.a)(E,2),L=y[0],D=y[1],Z=Object(x.useState)(!1),G=Object(Ce.a)(Z,2),ne=G[0],ke=G[1],$e=Object(Q.a)(Object(Q.a)({},m),{},{visible:L});Object(x.useEffect)(function(){D(X),X&&M&&ke($())},[X,M]);var Xe=ne?x.createElement(Xi,Object(de.a)({},$e,{mobile:M,ref:V})):x.createElement(Bi,Object(de.a)({},$e,{ref:V}));return x.createElement("div",null,x.createElement(F,$e),Xe)});yi.displayName="Popup";var Fi=yi,Mi=x.createContext(null),mr=Mi;function Wi(){}function gr(){return""}function cr(_){return _?_.ownerDocument:window.document}var ao=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Vr(_){var V=function(X){Object(Ae.a)(m,X);var M=Object(fe.a)(m);function m(E){var y;Object(Fe.a)(this,m),y=M.call(this,E),y.popupRef=x.createRef(),y.triggerRef=x.createRef(),y.attachId=void 0,y.clickOutsideHandler=void 0,y.touchOutsideHandler=void 0,y.contextMenuOutsideHandler1=void 0,y.contextMenuOutsideHandler2=void 0,y.mouseDownTimeout=void 0,y.focusTime=void 0,y.preClickTime=void 0,y.preTouchTime=void 0,y.delayTimer=void 0,y.hasPopupMouseDown=void 0,y.onMouseEnter=function(D){var Z=y.props.mouseEnterDelay;y.fireEvents("onMouseEnter",D),y.delaySetPopupVisible(!0,Z,Z?null:D)},y.onMouseMove=function(D){y.fireEvents("onMouseMove",D),y.setPoint(D)},y.onMouseLeave=function(D){y.fireEvents("onMouseLeave",D),y.delaySetPopupVisible(!1,y.props.mouseLeaveDelay)},y.onPopupMouseEnter=function(){y.clearDelayTimer()},y.onPopupMouseLeave=function(D){var Z;if(D.relatedTarget&&!D.relatedTarget.setTimeout&&Object(Rt.a)((Z=y.popupRef.current)===null||Z===void 0?void 0:Z.getElement(),D.relatedTarget))return;y.delaySetPopupVisible(!1,y.props.mouseLeaveDelay)},y.onFocus=function(D){y.fireEvents("onFocus",D),y.clearDelayTimer(),y.isFocusToShow()&&(y.focusTime=Date.now(),y.delaySetPopupVisible(!0,y.props.focusDelay))},y.onMouseDown=function(D){y.fireEvents("onMouseDown",D),y.preClickTime=Date.now()},y.onTouchStart=function(D){y.fireEvents("onTouchStart",D),y.preTouchTime=Date.now()},y.onBlur=function(D){y.fireEvents("onBlur",D),y.clearDelayTimer(),y.isBlurToHide()&&y.delaySetPopupVisible(!1,y.props.blurDelay)},y.onContextMenu=function(D){D.preventDefault(),y.fireEvents("onContextMenu",D),y.setPopupVisible(!0,D)},y.onContextMenuClose=function(){y.isContextMenuToShow()&&y.close()},y.onClick=function(D){if(y.fireEvents("onClick",D),y.focusTime){var Z;if(y.preClickTime&&y.preTouchTime?Z=Math.min(y.preClickTime,y.preTouchTime):y.preClickTime?Z=y.preClickTime:y.preTouchTime&&(Z=y.preTouchTime),Math.abs(Z-y.focusTime)<20)return;y.focusTime=0}y.preClickTime=0,y.preTouchTime=0,y.isClickToShow()&&(y.isClickToHide()||y.isBlurToHide())&&D&&D.preventDefault&&D.preventDefault();var G=!y.state.popupVisible;(y.isClickToHide()&&!G||G&&y.isClickToShow())&&y.setPopupVisible(!y.state.popupVisible,D)},y.onPopupMouseDown=function(){if(y.hasPopupMouseDown=!0,clearTimeout(y.mouseDownTimeout),y.mouseDownTimeout=window.setTimeout(function(){y.hasPopupMouseDown=!1},0),y.context){var D;(D=y.context).onPopupMouseDown.apply(D,arguments)}},y.onDocumentClick=function(D){if(y.props.mask&&!y.props.maskClosable)return;var Z=D.target,G=y.getRootDomNode(),ne=y.getPopupDomNode();(!Object(Rt.a)(G,Z)||y.isContextMenuOnly())&&!Object(Rt.a)(ne,Z)&&!y.hasPopupMouseDown&&y.close()},y.getRootDomNode=function(){var D=y.props.getTriggerDOMNode;if(D)return D(y.triggerRef.current);try{var Z=Object(Mt.a)(y.triggerRef.current);if(Z)return Z}catch(G){}return mt.a.findDOMNode(Object(ge.a)(y))},y.getPopupClassNameFromAlign=function(D){var Z=[],G=y.props,ne=G.popupPlacement,ke=G.builtinPlacements,$e=G.prefixCls,Xe=G.alignPoint,at=G.getPopupClassNameFromAlign;return ne&&ke&&Z.push(Je(ke,$e,D,Xe)),at&&Z.push(at(D)),Z.join(" ")},y.getComponent=function(){var D=y.props,Z=D.prefixCls,G=D.destroyPopupOnHide,ne=D.popupClassName,ke=D.onPopupAlign,$e=D.popupMotion,Xe=D.popupAnimation,at=D.popupTransitionName,Wt=D.popupStyle,Jt=D.mask,Kt=D.maskAnimation,$t=D.maskTransitionName,Qt=D.maskMotion,Zt=D.zIndex,Yt=D.popup,fn=D.stretch,on=D.alignPoint,Un=D.mobile,an=D.forceRender,It=y.state,Pt=It.popupVisible,sn=It.point,pn=y.getPopupAlign(),_t={};return y.isMouseEnterToShow()&&(_t.onMouseEnter=y.onPopupMouseEnter),y.isMouseLeaveToHide()&&(_t.onMouseLeave=y.onPopupMouseLeave),_t.onMouseDown=y.onPopupMouseDown,_t.onTouchStart=y.onPopupMouseDown,x.createElement(Fi,Object(de.a)({prefixCls:Z,destroyPopupOnHide:G,visible:Pt,point:on&&sn,className:ne,align:pn,onAlign:ke,animation:Xe,getClassNameFromAlign:y.getPopupClassNameFromAlign},_t,{stretch:fn,getRootDomNode:y.getRootDomNode,style:Wt,mask:Jt,zIndex:Zt,transitionName:at,maskAnimation:Kt,maskTransitionName:$t,maskMotion:Qt,ref:y.popupRef,motion:$e,mobile:Un,forceRender:an}),typeof Yt=="function"?Yt():Yt)},y.attachParent=function(D){rt.a.cancel(y.attachId);var Z=y.props,G=Z.getPopupContainer,ne=Z.getDocument,ke=y.getRootDomNode(),$e;G?(ke||G.length===0)&&($e=G(ke)):$e=ne(y.getRootDomNode()).body,$e?$e.appendChild(D):y.attachId=Object(rt.a)(function(){y.attachParent(D)})},y.getContainer=function(){var D=y.props.getDocument,Z=D(y.getRootDomNode()).createElement("div");return Z.style.position="absolute",Z.style.top="0",Z.style.left="0",Z.style.width="100%",y.attachParent(Z),Z},y.setPoint=function(D){var Z=y.props.alignPoint;if(!Z||!D)return;y.setState({point:{pageX:D.pageX,pageY:D.pageY}})},y.handlePortalUpdate=function(){y.state.prevPopupVisible!==y.state.popupVisible&&y.props.afterPopupVisibleChange(y.state.popupVisible)},y.triggerContextValue={onPopupMouseDown:y.onPopupMouseDown};var L;return"popupVisible"in E?L=!!E.popupVisible:L=!!E.defaultPopupVisible,y.state={prevPopupVisible:L,popupVisible:L},ao.forEach(function(D){y["fire".concat(D)]=function(Z){y.fireEvents(D,Z)}}),y}return Object(ue.a)(m,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var y=this.props,L=this.state;if(L.popupVisible){var D;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(D=y.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(_e.a)(D,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(D=D||y.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(_e.a)(D,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(D=D||y.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(_e.a)(D,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(_e.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),rt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var y;return((y=this.popupRef.current)===null||y===void 0?void 0:y.getElement())||null}},{key:"getPopupAlign",value:function(){var y=this.props,L=y.popupPlacement,D=y.popupAlign,Z=y.builtinPlacements;return L&&Z?Le(Z,L,D):D}},{key:"setPopupVisible",value:function(y,L){var D=this.props.alignPoint,Z=this.state.popupVisible;this.clearDelayTimer(),Z!==y&&("popupVisible"in this.props||this.setState({popupVisible:y,prevPopupVisible:Z}),this.props.onPopupVisibleChange(y)),D&&L&&y&&this.setPoint(L)}},{key:"delaySetPopupVisible",value:function(y,L,D){var Z=this,G=L*1e3;if(this.clearDelayTimer(),G){var ne=D?{pageX:D.pageX,pageY:D.pageY}:null;this.delayTimer=window.setTimeout(function(){Z.setPopupVisible(y,ne),Z.clearDelayTimer()},G)}else this.setPopupVisible(y,D)}},{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(y){var L=this.props.children.props,D=this.props;return L[y]&&D[y]?this["fire".concat(y)]:L[y]||D[y]}},{key:"isClickToShow",value:function(){var y=this.props,L=y.action,D=y.showAction;return L.indexOf("click")!==-1||D.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var y=this.props.action;return y==="contextMenu"||y.length===1&&y[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var y=this.props,L=y.action,D=y.showAction;return L.indexOf("contextMenu")!==-1||D.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var y=this.props,L=y.action,D=y.hideAction;return L.indexOf("click")!==-1||D.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var y=this.props,L=y.action,D=y.showAction;return L.indexOf("hover")!==-1||D.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var y=this.props,L=y.action,D=y.hideAction;return L.indexOf("hover")!==-1||D.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var y=this.props,L=y.action,D=y.showAction;return L.indexOf("focus")!==-1||D.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var y=this.props,L=y.action,D=y.hideAction;return L.indexOf("focus")!==-1||D.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var y;(y=this.popupRef.current)===null||y===void 0||y.forceAlign()}}},{key:"fireEvents",value:function(y,L){var D=this.props.children.props[y];D&&D(L);var Z=this.props[y];Z&&Z(L)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var y=this.state.popupVisible,L=this.props,D=L.children,Z=L.forceRender,G=L.alignPoint,ne=L.className,ke=L.autoDestroy,$e=x.Children.only(D),Xe={key:"trigger"};this.isContextMenuToShow()?Xe.onContextMenu=this.onContextMenu:Xe.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Xe.onClick=this.onClick,Xe.onMouseDown=this.onMouseDown,Xe.onTouchStart=this.onTouchStart):(Xe.onClick=this.createTwoChains("onClick"),Xe.onMouseDown=this.createTwoChains("onMouseDown"),Xe.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Xe.onMouseEnter=this.onMouseEnter,G&&(Xe.onMouseMove=this.onMouseMove)):Xe.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Xe.onMouseLeave=this.onMouseLeave:Xe.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Xe.onFocus=this.onFocus,Xe.onBlur=this.onBlur):(Xe.onFocus=this.createTwoChains("onFocus"),Xe.onBlur=this.createTwoChains("onBlur"));var at=j()($e&&$e.props&&$e.props.className,ne);at&&(Xe.className=at);var Wt=Object(Q.a)({},Xe);Object(Ct.c)($e)&&(Wt.ref=Object(Ct.a)(this.triggerRef,$e.ref));var Jt=x.cloneElement($e,Wt),Kt;return(y||this.popupRef.current||Z)&&(Kt=x.createElement(_,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!y&&ke&&(Kt=null),x.createElement(mr.Provider,{value:this.triggerContextValue},Jt,Kt)}}],[{key:"getDerivedStateFromProps",value:function(y,L){var D=y.popupVisible,Z={};return D!==void 0&&L.popupVisible!==D&&(Z.popupVisible=D,Z.prevPopupVisible=L.popupVisible),Z}}]),m}(x.Component);return V.contextType=mr,V.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:gr,getDocument:cr,onPopupVisibleChange:Wi,afterPopupVisibleChange:Wi,onPopupAlign:Wi,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},V}var qi=Vr(jt.a),qn={adjustX:1,adjustY:1},Sr={topLeft:{points:["bl","tl"],overflow:qn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:qn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:qn,offset:[4,0]}},Pr={topLeft:{points:["bl","tl"],overflow:qn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:qn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:qn,offset:[4,0]}},yo=Sr,In=0,vn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Vn=function(V,X,M){var m=Te(X),E=V.getState();V.setState({defaultActiveFirst:Object(Q.a)(Object(Q.a)({},E.defaultActiveFirst),{},Object(B.a)({},m,M))})},hn=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(M){var m;Object(Fe.a)(this,X),m=V.call(this,M),m.onDestroy=function(G){m.props.onDestroy(G)},m.onKeyDown=function(G){var ne=G.keyCode,ke=m.menuInstance,$e=m.props.store,Xe=m.getVisible();if(ne===U.a.ENTER)return m.onTitleClick(G),Vn($e,m.props.eventKey,!0),!0;if(ne===U.a.RIGHT)return Xe?ke.onKeyDown(G):(m.triggerOpenChange(!0),Vn($e,m.props.eventKey,!0)),!0;if(ne===U.a.LEFT){var at;if(Xe)at=ke.onKeyDown(G);else return;return at||(m.triggerOpenChange(!1),at=!0),at}return Xe&&(ne===U.a.UP||ne===U.a.DOWN)?ke.onKeyDown(G):void 0},m.onOpenChange=function(G){m.props.onOpenChange(G)},m.onPopupVisibleChange=function(G){m.triggerOpenChange(G,G?"mouseenter":"mouseleave")},m.onMouseEnter=function(G){var ne=m.props,ke=ne.eventKey,$e=ne.onMouseEnter,Xe=ne.store;Vn(Xe,m.props.eventKey,!1),$e({key:ke,domEvent:G})},m.onMouseLeave=function(G){var ne=m.props,ke=ne.parentMenu,$e=ne.eventKey,Xe=ne.onMouseLeave;ke.subMenuInstance=Object(ge.a)(m),Xe({key:$e,domEvent:G})},m.onTitleMouseEnter=function(G){var ne=m.props,ke=ne.eventKey,$e=ne.onItemHover,Xe=ne.onTitleMouseEnter;$e({key:ke,hover:!0}),Xe({key:ke,domEvent:G})},m.onTitleMouseLeave=function(G){var ne=m.props,ke=ne.parentMenu,$e=ne.eventKey,Xe=ne.onItemHover,at=ne.onTitleMouseLeave;ke.subMenuInstance=Object(ge.a)(m),Xe({key:$e,hover:!1}),at({key:$e,domEvent:G})},m.onTitleClick=function(G){var ne=Object(ge.a)(m),ke=ne.props;if(ke.onTitleClick({key:ke.eventKey,domEvent:G}),ke.triggerSubMenuAction==="hover")return;m.triggerOpenChange(!m.getVisible(),"click"),Vn(ke.store,m.props.eventKey,!1)},m.onSubMenuClick=function(G){typeof m.props.onClick=="function"&&m.props.onClick(m.addKeyPath(G))},m.onSelect=function(G){m.props.onSelect(G)},m.onDeselect=function(G){m.props.onDeselect(G)},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(G){m.menuInstance=G},m.addKeyPath=function(G){return Object(Q.a)(Object(Q.a)({},G),{},{keyPath:(G.keyPath||[]).concat(m.props.eventKey)})},m.triggerOpenChange=function(G,ne){var ke=m.props.eventKey,$e=function(){m.onOpenChange({key:ke,item:Object(ge.a)(m),trigger:ne,open:G})};ne==="mouseenter"?m.mouseenterTimeout=setTimeout(function(){$e()},0):$e()},m.isChildrenSelected=function(){var G={find:!1};return tt(m.props.children,m.props.selectedKeys,G),G.find},m.isInlineMode=function(){return m.getMode()==="inline"},m.adjustWidth=function(){if(!m.subMenuTitle||!m.menuInstance)return;var G=pt.findDOMNode(m.menuInstance);if(G.offsetWidth>=m.subMenuTitle.offsetWidth)return;G.style.minWidth="".concat(m.subMenuTitle.offsetWidth,"px")},m.saveSubMenuTitle=function(G){m.subMenuTitle=G},m.getBaseProps=function(){var G=Object(ge.a)(m),ne=G.props,ke=m.getMode();return{mode:ke==="horizontal"?"vertical":ke,visible:m.getVisible(),level:ne.level+1,inlineIndent:ne.inlineIndent,focusable:!1,onClick:m.onSubMenuClick,onSelect:m.onSelect,onDeselect:m.onDeselect,onDestroy:m.onDestroy,selectedKeys:ne.selectedKeys,eventKey:"".concat(ne.eventKey,"-menu-"),openKeys:ne.openKeys,motion:ne.motion,onOpenChange:m.onOpenChange,subMenuOpenDelay:ne.subMenuOpenDelay,parentMenu:Object(ge.a)(m),subMenuCloseDelay:ne.subMenuCloseDelay,forceSubMenuRender:ne.forceSubMenuRender,triggerSubMenuAction:ne.triggerSubMenuAction,builtinPlacements:ne.builtinPlacements,defaultActiveFirst:ne.store.getState().defaultActiveFirst[Te(ne.eventKey)],multiple:ne.multiple,prefixCls:ne.rootPrefixCls,id:m.internalMenuId,manualRef:m.saveMenuInstance,itemIcon:ne.itemIcon,expandIcon:ne.expandIcon,direction:ne.direction}},m.getMotion=function(G,ne){var ke=Object(ge.a)(m),$e=ke.haveRendered,Xe=m.props,at=Xe.motion,Wt=Xe.rootPrefixCls,Jt=Object(Q.a)(Object(Q.a)({},at),{},{leavedClassName:"".concat(Wt,"-hidden"),removeOnLeave:!1,motionAppear:$e||!ne||G!=="inline"});return Jt};var E=M.store,y=M.eventKey,L=E.getState(),D=L.defaultActiveFirst;m.isRootMenu=!1;var Z=!1;return D&&(Z=D[y]),Vn(E,y,Z),m.state={mode:M.mode,isOpen:M.isOpen},m}return Object(ue.a)(X,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var m=this,E=this.props,y=E.mode,L=E.parentMenu,D=E.manualRef,Z=E.isOpen,G=function(){m.setState({mode:y,isOpen:Z})},ne=Z!==this.state.isOpen,ke=y!==this.state.mode;if((ke||ne)&&(rt.a.cancel(this.updateStateRaf),ke?this.updateStateRaf=Object(rt.a)(G):G()),D&&D(this),y!=="horizontal"||!(L==null?void 0:L.isRootMenu)||!Z)return;this.minWidthTimeout=setTimeout(function(){return m.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var m=this.props,E=m.onDestroy,y=m.eventKey;E&&E(y),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),rt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(m,E){var y=this.getBaseProps();return x.createElement(lo,Object(de.a)({},y,{id:this.internalMenuId,className:m,style:E}),this.props.children)}},{key:"renderChildren",value:function(){var m=this,E=this.getBaseProps(),y=E.mode,L=E.visible,D=E.forceSubMenuRender,Z=E.direction,G=this.getMotion(y,L);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||L||D,!this.haveOpened)return x.createElement("div",null);var ne=j()("".concat(E.prefixCls,"-sub"),Object(B.a)({},"".concat(E.prefixCls,"-rtl"),Z==="rtl"));return this.isInlineMode()?x.createElement(d,Object(de.a)({visible:E.visible,forceRender:D},G),function(ke){var $e=ke.className,Xe=ke.style,at=j()(ne,$e);return m.renderPopupMenu(at,Xe)}):this.renderPopupMenu(ne)}},{key:"render",value:function(){var m,E,y,L=Object(Q.a)({},this.props),D=this.getVisible(),Z=this.getPrefixCls(),G=this.isInlineMode(),ne=this.getMode(),ke=j()(Z,"".concat(Z,"-").concat(ne),(m={},Object(B.a)(m,L.className,!!L.className),Object(B.a)(m,this.getOpenClassName(),D),Object(B.a)(m,this.getActiveClassName(),L.active||D&&!G),Object(B.a)(m,this.getDisabledClassName(),L.disabled),Object(B.a)(m,this.getSelectedClassName(),this.isChildrenSelected()),m));this.internalMenuId||(L.eventKey?this.internalMenuId="".concat(L.eventKey,"$Menu"):(In+=1,this.internalMenuId="$__$".concat(In,"$Menu")));var $e={},Xe={},at={};L.disabled||($e={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Xe={onClick:this.onTitleClick},at={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Wt={},Jt=L.direction,Kt=Jt==="rtl";G&&(Kt?Wt.paddingRight=L.inlineIndent*L.level:Wt.paddingLeft=L.inlineIndent*L.level);var $t={};this.getVisible()&&($t={"aria-owns":this.internalMenuId});var Qt=null;ne!=="horizontal"&&(Qt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Qt=x.createElement(this.props.expandIcon,Object(Q.a)({},this.props))));var Zt=x.createElement("div",Object(de.a)({ref:this.saveSubMenuTitle,style:Wt,className:"".concat(Z,"-title"),role:"button"},at,Xe,{"aria-expanded":D},$t,{"aria-haspopup":"true",title:typeof L.title=="string"?L.title:void 0}),L.title,Qt||x.createElement("i",{className:"".concat(Z,"-arrow")})),Yt=this.renderChildren(),fn=((E=L.parentMenu)===null||E===void 0?void 0:E.isRootMenu)?L.parentMenu.props.getPopupContainer:function(Tn){return Tn.parentNode},on=vn[ne],Un=L.popupOffset?{offset:L.popupOffset}:{},an=j()((y={},Object(B.a)(y,L.popupClassName,L.popupClassName&&!G),Object(B.a)(y,"".concat(Z,"-rtl"),Kt),y)),It=L.disabled,Pt=L.triggerSubMenuAction,sn=L.subMenuOpenDelay,pn=L.forceSubMenuRender,_t=L.subMenuCloseDelay,gn=L.builtinPlacements;ct.forEach(function(Tn){return delete L[Tn]}),delete L.onClick;var Bn=Kt?Object(Q.a)(Object(Q.a)({},Pr),gn):Object(Q.a)(Object(Q.a)({},Sr),gn);delete L.direction;var bn=this.getBaseProps(),Ln=G?null:this.getMotion(bn.mode,bn.visible);return x.createElement("li",Object(de.a)({},L,$e,{className:ke,role:"menuitem"}),x.createElement(qi,{prefixCls:Z,popupClassName:j()("".concat(Z,"-popup"),an),getPopupContainer:fn,builtinPlacements:Bn,popupPlacement:on,popupVisible:G?!1:D,popupAlign:Un,popup:G?null:Yt,action:It||G?[]:[Pt],mouseEnterDelay:sn,mouseLeaveDelay:_t,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:pn,popupMotion:Ln},Zt),G?Yt:null)}}]),X}(x.Component);hn.defaultProps={onMouseEnter:ot,onMouseLeave:ot,onTitleMouseEnter:ot,onTitleMouseLeave:ot,onTitleClick:ot,manualRef:ot,mode:"vertical",title:""};var Gn=Object(k.b)(function(_,V){var X=_.openKeys,M=_.activeKey,m=_.selectedKeys,E=V.eventKey,y=V.subMenuKey;return{isOpen:X.indexOf(E)>-1,active:M[y]===E,selectedKeys:m}})(hn);Gn.isSubMenu=!0;var xn=Gn,er="menuitem-overflowed",Kn=.5,bi=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(){var M;return Object(Fe.a)(this,X),M=V.apply(this,arguments),M.resizeObserver=null,M.mutationObserver=null,M.originalTotalWidth=0,M.overflowedItems=[],M.menuItemSizes=[],M.cancelFrameId=null,M.state={lastVisibleIndex:void 0},M.childRef=x.createRef(),M.getMenuItemNodes=function(){var m=M.props.prefixCls,E=M.childRef.current;return E?[].slice.call(E.children).filter(function(y){return y.className.split(" ").indexOf("".concat(m,"-overflowed-submenu"))<0}):[]},M.getOverflowedSubMenuItem=function(m,E,y){var L=M.props,D=L.overflowedIndicator,Z=L.level,G=L.mode,ne=L.prefixCls,ke=L.theme;if(Z!==1||G!=="horizontal")return null;var $e=M.props.children[0],Xe=$e.props,at=Xe.children,Wt=Xe.title,Jt=Xe.style,Kt=Object(me.a)(Xe,["children","title","style"]),$t=Object(Q.a)({},Jt),Qt="".concat(m,"-overflowed-indicator"),Zt="".concat(m,"-overflowed-indicator");E.length===0&&y!==!0?$t=Object(Q.a)(Object(Q.a)({},$t),{},{display:"none"}):y&&($t=Object(Q.a)(Object(Q.a)({},$t),{},{visibility:"hidden",position:"absolute"}),Qt="".concat(Qt,"-placeholder"),Zt="".concat(Zt,"-placeholder"));var Yt=ke?"".concat(ne,"-").concat(ke):"",fn={};return ct.forEach(function(on){Kt[on]!==void 0&&(fn[on]=Kt[on])}),x.createElement(xn,Object(de.a)({title:D,className:"".concat(ne,"-overflowed-submenu"),popupClassName:Yt},fn,{key:Qt,eventKey:Zt,disabled:!1,style:$t}),E)},M.setChildrenWidthAndResize=function(){if(M.props.mode!=="horizontal")return;var m=M.childRef.current;if(!m)return;var E=m.children;if(!E||E.length===0)return;var y=m.children[E.length-1];Be(y,"display","inline-block");var L=M.getMenuItemNodes(),D=L.filter(function(Z){return Z.className.split(" ").indexOf(er)>=0});D.forEach(function(Z){Be(Z,"display","inline-block")}),M.menuItemSizes=L.map(function(Z){return Qe(Z,!0)}),D.forEach(function(Z){Be(Z,"display","none")}),M.overflowedIndicatorWidth=Qe(m.children[m.children.length-1],!0),M.originalTotalWidth=M.menuItemSizes.reduce(function(Z,G){return Z+G},0),M.handleResize(),Be(y,"display","none")},M.handleResize=function(){if(M.props.mode!=="horizontal")return;var m=M.childRef.current;if(!m)return;var E=Qe(m);M.overflowedItems=[];var y=0,L;M.originalTotalWidth>E+Kn&&(L=-1,M.menuItemSizes.forEach(function(D){y+=D,y+M.overflowedIndicatorWidth<=E&&(L+=1)})),M.setState({lastVisibleIndex:L})},M}return Object(ue.a)(X,[{key:"componentDidMount",value:function(){var m=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var E=this.childRef.current;if(!E)return;this.resizeObserver=new Ot.default(function(y){y.forEach(function(){var L=m.cancelFrameId;cancelAnimationFrame(L),m.cancelFrameId=requestAnimationFrame(m.setChildrenWidthAndResize)})}),[].slice.call(E.children).concat(E).forEach(function(y){m.resizeObserver.observe(y)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){m.resizeObserver.disconnect(),[].slice.call(E.children).concat(E).forEach(function(y){m.resizeObserver.observe(y)}),m.setChildrenWidthAndResize()}),this.mutationObserver.observe(E,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(m){var E=this,y=this.state.lastVisibleIndex;return(m||[]).reduce(function(L,D,Z){var G=D;if(E.props.mode==="horizontal"){var ne=E.getOverflowedSubMenuItem(D.props.eventKey,[]);y!==void 0&&E.props.className.indexOf("".concat(E.props.prefixCls,"-root"))!==-1&&(Z>y&&(G=x.cloneElement(D,{style:{display:"none"},eventKey:"".concat(D.props.eventKey,"-hidden"),className:"".concat(er)})),Z===y+1&&(E.overflowedItems=m.slice(y+1).map(function($e){return x.cloneElement($e,{key:$e.props.eventKey,mode:"vertical-left"})}),ne=E.getOverflowedSubMenuItem(D.props.eventKey,E.overflowedItems)));var ke=[].concat(Object(we.a)(L),[ne,G]);return Z===m.length-1&&ke.push(E.getOverflowedSubMenuItem(D.props.eventKey,[],!0)),ke}return[].concat(Object(we.a)(L),[G])},[])}},{key:"render",value:function(){var m=this.props,E=m.visible,y=m.prefixCls,L=m.overflowedIndicator,D=m.mode,Z=m.level,G=m.tag,ne=m.children,ke=m.theme,$e=Object(me.a)(m,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Xe=G;return x.createElement(Xe,Object(de.a)({ref:this.childRef},$e),this.renderChildren(ne))}}]),X}(x.Component);bi.defaultProps={tag:"div",className:""};var Gr=bi;function Kr(_){return _.length?_.every(function(V){return!!V.props.disabled}):!0}function tr(_,V,X){var M=_.getState();_.setState({activeKey:Object(Q.a)(Object(Q.a)({},M.activeKey),{},Object(B.a)({},V,X))})}function vr(_){return _.eventKey||"0-menu-"}function mi(_,V){var X=V,M=_.children,m=_.eventKey;if(X){var E;if(Ke(M,function(y,L){y&&y.props&&!y.props.disabled&&X===dt(y,m,L)&&(E=!0)}),E)return X}return X=null,_.defaultActiveFirst&&Ke(M,function(y,L){!X&&y&&!y.props.disabled&&(X=dt(y,m,L))}),X}function so(_){if(!_)return;var V=this.instanceArray.indexOf(_);V!==-1?this.instanceArray[V]=_:this.instanceArray.push(_)}var $i=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(M){var m;return Object(Fe.a)(this,X),m=V.call(this,M),m.onKeyDown=function(E,y){var L=E.keyCode,D;if(m.getFlatInstanceArray().forEach(function(G){G&&G.props.active&&G.onKeyDown&&(D=G.onKeyDown(E))}),D)return 1;var Z=null;return(L===U.a.UP||L===U.a.DOWN)&&(Z=m.step(L===U.a.UP?-1:1)),Z?(E.preventDefault(),tr(m.props.store,vr(m.props),Z.props.eventKey),typeof y=="function"&&y(Z),1):void 0},m.onItemHover=function(E){var y=E.key,L=E.hover;tr(m.props.store,vr(m.props),L?y:null)},m.onDeselect=function(E){m.props.onDeselect(E)},m.onSelect=function(E){m.props.onSelect(E)},m.onClick=function(E){m.props.onClick(E)},m.onOpenChange=function(E){m.props.onOpenChange(E)},m.onDestroy=function(E){m.props.onDestroy(E)},m.getFlatInstanceArray=function(){return m.instanceArray},m.step=function(E){var y=m.getFlatInstanceArray(),L=m.props.store.getState().activeKey[vr(m.props)],D=y.length;if(!D)return null;E<0&&(y=y.concat().reverse());var Z=-1;if(y.every(function($e,Xe){return $e&&$e.props.eventKey===L?(Z=Xe,!1):!0}),!m.props.defaultActiveFirst&&Z!==-1&&Kr(y.slice(Z,D-1)))return;var G=(Z+1)%D,ne=G;do{var ke=y[ne];if(!ke||ke.props.disabled)ne=(ne+1)%D;else return ke}while(ne!==G);return null},m.renderCommonMenuItem=function(E,y,L){var D=m.props.store.getState(),Z=Object(ge.a)(m),G=Z.props,ne=dt(E,G.eventKey,y),ke=E.props;if(!ke||typeof E.type=="string")return E;var $e=ne===D.activeKey,Xe=Object(Q.a)(Object(Q.a)({mode:ke.mode||G.mode,level:G.level,inlineIndent:G.inlineIndent,renderMenuItem:m.renderMenuItem,rootPrefixCls:G.prefixCls,index:y,parentMenu:G.parentMenu,manualRef:ke.disabled?void 0:Object(ie.a)(E.ref,so.bind(Object(ge.a)(m))),eventKey:ne,active:!ke.disabled&&$e,multiple:G.multiple,onClick:function(Wt){(ke.onClick||ot)(Wt),m.onClick(Wt)},onItemHover:m.onItemHover,motion:G.motion,subMenuOpenDelay:G.subMenuOpenDelay,subMenuCloseDelay:G.subMenuCloseDelay,forceSubMenuRender:G.forceSubMenuRender,onOpenChange:m.onOpenChange,onDeselect:m.onDeselect,onSelect:m.onSelect,builtinPlacements:G.builtinPlacements,itemIcon:ke.itemIcon||m.props.itemIcon,expandIcon:ke.expandIcon||m.props.expandIcon},L),{},{direction:G.direction});return(G.mode==="inline"||Ye())&&(Xe.triggerSubMenuAction="click"),x.cloneElement(E,Object(Q.a)(Object(Q.a)({},Xe),{},{key:ne||y}))},m.renderMenuItem=function(E,y,L){if(!E)return null;var D=m.props.store.getState(),Z={openKeys:D.openKeys,selectedKeys:D.selectedKeys,triggerSubMenuAction:m.props.triggerSubMenuAction,subMenuKey:L};return m.renderCommonMenuItem(E,y,Z)},M.store.setState({activeKey:Object(Q.a)(Object(Q.a)({},M.store.getState().activeKey),{},Object(B.a)({},M.eventKey,mi(M,M.activeKey)))}),m.instanceArray=[],m}return Object(ue.a)(X,[{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||!ye()(this.props.style,m.style)}},{key:"componentDidUpdate",value:function(m){var E=this.props,y="activeKey"in E?E.activeKey:E.store.getState().activeKey[vr(E)],L=mi(E,y);if(L!==y)tr(E.store,vr(E),L);else if("activeKey"in m){var D=mi(m,m.activeKey);L!==D&&tr(E.store,vr(E),L)}}},{key:"render",value:function(){var m=this,E=Object(de.a)({},this.props);this.instanceArray=[];var y=j()(E.prefixCls,E.className,"".concat(E.prefixCls,"-").concat(E.mode)),L={className:y,role:E.role||"menu"};E.id&&(L.id=E.id),E.focusable&&(L.tabIndex=0,L.onKeyDown=this.onKeyDown);var D=E.prefixCls,Z=E.eventKey,G=E.visible,ne=E.level,ke=E.mode,$e=E.overflowedIndicator,Xe=E.theme;return ct.forEach(function(at){return delete E[at]}),delete E.onClick,x.createElement(Gr,Object(de.a)({},E,{prefixCls:D,mode:ke,tag:"ul",level:ne,theme:Xe,visible:G,overflowedIndicator:$e},L),Object(oe.a)(E.children).map(function(at,Wt){return m.renderMenuItem(at,Wt,Z||"0-menu-")}))}}]),X}(x.Component);$i.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ot};var Xr=Object(k.b)()($i),lo=Xr,Nr=C("Kwbf");function ga(_,V,X){var M=_.prefixCls,m=_.motion,E=_.defaultMotions,y=E===void 0?{}:E,L=_.openAnimation,D=_.openTransitionName,Z=V.switchingModeFromInline;if(m)return m;if(Object(Oe.a)(L)==="object"&&L)Object(Nr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof L=="string")return{motionName:"".concat(M,"-open-").concat(L)};if(D)return{motionName:D};var G=y[X];return G||(Z?null:y.other)}var bo=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(M){var m;Object(Fe.a)(this,X),m=V.call(this,M),m.onSelect=function(L){var D=Object(ge.a)(m),Z=D.props;if(Z.selectable){var G=m.store.getState(),ne=G.selectedKeys,ke=L.key;Z.multiple?ne=ne.concat([ke]):ne=[ke],"selectedKeys"in Z||m.store.setState({selectedKeys:ne}),Z.onSelect(Object(Q.a)(Object(Q.a)({},L),{},{selectedKeys:ne}))}},m.onClick=function(L){var D=m.getRealMenuMode(),Z=Object(ge.a)(m),G=Z.store,ne=Z.props.onOpenChange;D!=="inline"&&!("openKeys"in m.props)&&(G.setState({openKeys:[]}),ne([])),m.props.onClick(L)},m.onKeyDown=function(L,D){m.innerMenu.getWrappedInstance().onKeyDown(L,D)},m.onOpenChange=function(L){var D=Object(ge.a)(m),Z=D.props,G=m.store.getState().openKeys.concat(),ne=!1,ke=function(Xe){var at=!1;if(Xe.open)at=G.indexOf(Xe.key)===-1,at&&G.push(Xe.key);else{var Wt=G.indexOf(Xe.key);at=Wt!==-1,at&&G.splice(Wt,1)}ne=ne||at};Array.isArray(L)?L.forEach(ke):ke(L),ne&&("openKeys"in m.props||m.store.setState({openKeys:G}),Z.onOpenChange(G))},m.onDeselect=function(L){var D=Object(ge.a)(m),Z=D.props;if(Z.selectable){var G=m.store.getState().selectedKeys.concat(),ne=L.key,ke=G.indexOf(ne);ke!==-1&&G.splice(ke,1),"selectedKeys"in Z||m.store.setState({selectedKeys:G}),Z.onDeselect(Object(Q.a)(Object(Q.a)({},L),{},{selectedKeys:G}))}},m.onMouseEnter=function(L){m.restoreModeVerticalFromInline();var D=m.props.onMouseEnter;D&&D(L)},m.onTransitionEnd=function(L){var D=L.propertyName==="width"&&L.target===L.currentTarget,Z=L.target.className,G=Object.prototype.toString.call(Z)==="[object SVGAnimatedString]"?Z.animVal:Z,ne=L.propertyName==="font-size"&&G.indexOf("anticon")>=0;(D||ne)&&m.restoreModeVerticalFromInline()},m.setInnerMenu=function(L){m.innerMenu=L},m.isRootMenu=!0;var E=M.defaultSelectedKeys,y=M.defaultOpenKeys;return"selectedKeys"in M&&(E=M.selectedKeys||[]),"openKeys"in M&&(y=M.openKeys||[]),m.store=Object(k.c)({selectedKeys:E,openKeys:y,activeKey:{"0-menu-":mi(M,M.activeKey)}}),m.state={switchingModeFromInline:!1,prevProps:M,inlineOpenKeys:[],store:m.store},m}return Object(ue.a)(X,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(m){var E=this.props,y=E.siderCollapsed,L=E.inlineCollapsed,D=E.onOpenChange;(!m.inlineCollapsed&&L||!m.siderCollapsed&&y)&&D([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var m=this.props.collapsedWidth,E=this.store,y=this.prevOpenKeys,L=this.getInlineCollapsed()&&(m===0||m==="0"||m==="0px");L?(this.prevOpenKeys=E.getState().openKeys.concat(),this.store.setState({openKeys:[]})):y&&(this.store.setState({openKeys:y}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var m=this.props.mode,E=this.state.switchingModeFromInline,y=this.getInlineCollapsed();return E&&y?"inline":y?"vertical":m}},{key:"getInlineCollapsed",value:function(){var m=this.props,E=m.inlineCollapsed,y=m.siderCollapsed;return y!==void 0?y:E}},{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(Q.a)({},Object(ve.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),E=this.getRealMenuMode();return m.className+=" ".concat(m.prefixCls,"-root"),m.direction==="rtl"&&(m.className+=" ".concat(m.prefixCls,"-rtl")),m=Object(Q.a)(Object(Q.a)({},m),{},{mode:E,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ga(this.props,this.state,E)}),delete m.openAnimation,delete m.openTransitionName,x.createElement(k.a,{store:this.store},x.createElement(lo,Object(de.a)({},m,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(m,E){var y=E.prevProps,L=E.store,D=L.getState(),Z={},G={prevProps:m};return y.mode==="inline"&&m.mode!=="inline"&&(G.switchingModeFromInline=!0),"openKeys"in m?Z.openKeys=m.openKeys||[]:((m.inlineCollapsed&&!y.inlineCollapsed||m.siderCollapsed&&!y.siderCollapsed)&&(G.switchingModeFromInline=!0,G.inlineOpenKeys=D.openKeys,Z.openKeys=[]),(!m.inlineCollapsed&&y.inlineCollapsed||!m.siderCollapsed&&y.siderCollapsed)&&(Z.openKeys=E.inlineOpenKeys,G.inlineOpenKeys=[])),Object.keys(Z).length&&L.setState(Z),G}}]),X}(x.Component);bo.defaultProps={selectable:!0,onClick:ot,onSelect:ot,onOpenChange:ot,onDeselect:ot,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:x.createElement("span",null,"\xB7\xB7\xB7")};var Tt=bo,Ht=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(){var M;return Object(Fe.a)(this,X),M=V.apply(this,arguments),M.onKeyDown=function(m){var E=m.keyCode;return E===U.a.ENTER?(M.onClick(m),!0):void 0},M.onMouseLeave=function(m){var E=M.props,y=E.eventKey,L=E.onItemHover,D=E.onMouseLeave;L({key:y,hover:!1}),D({key:y,domEvent:m})},M.onMouseEnter=function(m){var E=M.props,y=E.eventKey,L=E.onItemHover,D=E.onMouseEnter;L({key:y,hover:!0}),D({key:y,domEvent:m})},M.onClick=function(m){var E=M.props,y=E.eventKey,L=E.multiple,D=E.onClick,Z=E.onSelect,G=E.onDeselect,ne=E.isSelected,ke={key:y,keyPath:[y],item:Object(ge.a)(M),domEvent:m};D(ke),L?ne?G(ke):Z(ke):ne||Z(ke)},M.saveNode=function(m){M.node=m},M}return Object(ue.a)(X,[{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,E=Object(Q.a)({},this.props),y=j()(this.getPrefixCls(),E.className,(m={},Object(B.a)(m,this.getActiveClassName(),!E.disabled&&E.active),Object(B.a)(m,this.getSelectedClassName(),E.isSelected),Object(B.a)(m,this.getDisabledClassName(),E.disabled),m)),L=Object(Q.a)(Object(Q.a)({},E.attribute),{},{title:typeof E.title=="string"?E.title:void 0,className:y,role:E.role||"menuitem","aria-disabled":E.disabled});E.role==="option"?L=Object(Q.a)(Object(Q.a)({},L),{},{role:"option","aria-selected":E.isSelected}):(E.role===null||E.role==="none")&&(L.role="none");var D={onClick:E.disabled?null:this.onClick,onMouseLeave:E.disabled?null:this.onMouseLeave,onMouseEnter:E.disabled?null:this.onMouseEnter},Z=Object(Q.a)({},E.style);E.mode==="inline"&&(E.direction==="rtl"?Z.paddingRight=E.inlineIndent*E.level:Z.paddingLeft=E.inlineIndent*E.level),ct.forEach(function(ne){return delete E[ne]}),delete E.direction;var G=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(G=x.createElement(this.props.itemIcon,this.props)),x.createElement("li",Object(de.a)({},Object(ve.a)(E,["onClick","onMouseEnter","onMouseLeave","onSelect"]),L,D,{style:Z,ref:this.saveNode}),E.children,G)}}]),X}(x.Component);Ht.isMenuItem=!0,Ht.defaultProps={onSelect:ot,onMouseEnter:ot,onMouseLeave:ot,manualRef:ot};var Dt=Object(k.b)(function(_,V){var X=_.activeKey,M=_.selectedKeys,m=V.eventKey,E=V.subMenuKey;return{active:X[E]===m,isSelected:Array.isArray(M)?M.indexOf(m)!==-1:M===m}})(Ht),en=Dt,dn=function(_){Object(Ae.a)(X,_);var V=Object(fe.a)(X);function X(){var M;return Object(Fe.a)(this,X),M=V.apply(this,arguments),M.renderInnerMenuItem=function(m){var E=M.props,y=E.renderMenuItem,L=E.index;return y(m,L,M.props.subMenuKey)},M}return Object(ue.a)(X,[{key:"render",value:function(){var m=Object(de.a)({},this.props),E=m.className,y=E===void 0?"":E,L=m.rootPrefixCls,D="".concat(L,"-item-group-title"),Z="".concat(L,"-item-group-list"),G=m.title,ne=m.children;return ct.forEach(function(ke){return delete m[ke]}),delete m.direction,x.createElement("li",Object(de.a)({},m,{onClick:function($e){return $e.stopPropagation()},className:"".concat(y," ").concat(L,"-item-group")}),x.createElement("div",{className:D,title:typeof G=="string"?G:void 0},G),x.createElement("ul",{className:Z},x.Children.map(ne,this.renderInnerMenuItem)))}}]),X}(x.Component);dn.isMenuItemGroup=!0,dn.defaultProps={disabled:!0};var kn=dn,ln=function(V){var X=V.className,M=V.rootPrefixCls,m=V.style;return x.createElement("li",{className:"".concat(X," ").concat(M,"-item-divider"),style:m})};ln.defaultProps={disabled:!0,className:"",style:{}};var ei=ln,Ei=Tt,rn=C("eDIo");function kr(_,V){var X=_.prefixCls,M=_.editable,m=_.locale,E=_.style;return!M||M.showAdd===!1?null:x.createElement("button",{ref:V,type:"button",className:"".concat(X,"-nav-add"),style:E,"aria-label":(m==null?void 0:m.addAriaLabel)||"Add tab",onClick:function(L){M.onEdit("add",{event:L})}},M.addIcon||"+")}var yn=x.forwardRef(kr);function oi(_,V){var X=_.prefixCls,M=_.id,m=_.tabs,E=_.locale,y=_.mobile,L=_.moreIcon,D=L===void 0?"More":L,Z=_.moreTransitionName,G=_.style,ne=_.className,ke=_.editable,$e=_.tabBarGutter,Xe=_.rtl,at=_.onTabClick,Wt=Object(x.useState)(!1),Jt=Object(Ce.a)(Wt,2),Kt=Jt[0],$t=Jt[1],Qt=Object(x.useState)(null),Zt=Object(Ce.a)(Qt,2),Yt=Zt[0],fn=Zt[1],on="".concat(M,"-more-popup"),Un="".concat(X,"-dropdown"),an=Yt!==null?"".concat(on,"-").concat(Yt):null,It=E==null?void 0:E.dropdownAriaLabel,Pt=x.createElement(Ei,{onClick:function(Ln){var Tn=Ln.key,Zn=Ln.domEvent;at(Tn,Zn),$t(!1)},id:on,tabIndex:-1,role:"listbox","aria-activedescendant":an,selectedKeys:[Yt],"aria-label":It!==void 0?It:"expanded dropdown"},m.map(function(bn){return x.createElement(en,{key:bn.key,id:"".concat(on,"-").concat(bn.key),role:"option","aria-controls":M&&"".concat(M,"-panel-").concat(bn.key),disabled:bn.disabled},bn.tab)}));function sn(bn){for(var Ln=m.filter(function(Si){return!Si.disabled}),Tn=Ln.findIndex(function(Si){return Si.key===Yt})||0,Zn=Ln.length,li=0;li<Zn;li+=1){Tn=(Tn+bn+Zn)%Zn;var Wn=Ln[Tn];if(!Wn.disabled){fn(Wn.key);return}}}function pn(bn){var Ln=bn.which;if(!Kt){[U.a.DOWN,U.a.SPACE,U.a.ENTER].includes(Ln)&&($t(!0),bn.preventDefault());return}switch(Ln){case U.a.UP:sn(-1),bn.preventDefault();break;case U.a.DOWN:sn(1),bn.preventDefault();break;case U.a.ESC:$t(!1);break;case U.a.SPACE:case U.a.ENTER:Yt!==null&&at(Yt,bn);break}}Object(x.useEffect)(function(){var bn=document.getElementById(an);bn&&bn.scrollIntoView&&bn.scrollIntoView(!1)},[Yt]),Object(x.useEffect)(function(){Kt||fn(null)},[Kt]);var _t=Object(B.a)({},Xe?"marginLeft":"marginRight",$e);m.length||(_t.visibility="hidden",_t.order=1);var gn=j()(Object(B.a)({},"".concat(Un,"-rtl"),Xe)),Bn=y?null:x.createElement(rn.a,{prefixCls:Un,overlay:Pt,trigger:["hover"],visible:Kt,transitionName:Z,onVisibleChange:$t,overlayClassName:gn,mouseEnterDelay:.1,mouseLeaveDelay:.1},x.createElement("button",{type:"button",className:"".concat(X,"-nav-more"),style:_t,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":on,id:"".concat(M,"-more"),"aria-expanded":Kt,onKeyDown:pn},D));return x.createElement("div",{className:j()("".concat(X,"-nav-operations"),ne),style:G,ref:V},Bn,x.createElement(yn,{prefixCls:X,locale:E,editable:ke}))}var Yi=x.forwardRef(oi),Ai=Object(x.createContext)(null),Co=.1,$r=.01,Yn=20,va=Math.pow(.995,Yn);function ya(){var _=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(_)||/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(_.substr(0,4)))}function uo(_,V){var X=Object(x.useState)(),M=Object(Ce.a)(X,2),m=M[0],E=M[1],y=Object(x.useState)(0),L=Object(Ce.a)(y,2),D=L[0],Z=L[1],G=Object(x.useState)(0),ne=Object(Ce.a)(G,2),ke=ne[0],$e=ne[1],Xe=Object(x.useState)(),at=Object(Ce.a)(Xe,2),Wt=at[0],Jt=at[1],Kt=Object(x.useRef)();function $t(It){var Pt=It.touches[0],sn=Pt.screenX,pn=Pt.screenY;E({x:sn,y:pn}),window.clearInterval(Kt.current)}function Qt(It){if(!m)return;It.preventDefault();var Pt=It.touches[0],sn=Pt.screenX,pn=Pt.screenY;E({x:sn,y:pn});var _t=sn-m.x,gn=pn-m.y;V(_t,gn);var Bn=Date.now();Z(Bn),$e(Bn-D),Jt({x:_t,y:gn})}function Zt(){if(!m)return;if(E(null),Jt(null),Wt){var It=Wt.x/ke,Pt=Wt.y/ke,sn=Math.abs(It),pn=Math.abs(Pt);if(Math.max(sn,pn)<Co)return;var _t=It,gn=Pt;Kt.current=window.setInterval(function(){if(Math.abs(_t)<$r&&Math.abs(gn)<$r){window.clearInterval(Kt.current);return}_t*=va,gn*=va,V(_t*Yn,gn*Yn)},Yn)}}var Yt=Object(x.useRef)(0),fn=Object(x.useRef)(!1),on=Object(x.useRef)();function Un(It){var Pt=It.deltaX,sn=It.deltaY,pn=0,_t=Math.abs(Pt),gn=Math.abs(sn);_t===gn?pn=on.current==="x"?Pt:sn:_t>gn?(pn=Pt,on.current="x"):(pn=sn,on.current="y");var Bn=Date.now();Bn-Yt.current>100&&(fn.current=!1),(V(-pn,-pn)||fn.current)&&(It.preventDefault(),fn.current=!0),Yt.current=Bn}var an=Object(x.useRef)(null);an.current={onTouchStart:$t,onTouchMove:Qt,onTouchEnd:Zt,onWheel:Un},x.useEffect(function(){function It(_t){an.current.onTouchStart(_t)}function Pt(_t){an.current.onTouchMove(_t)}function sn(_t){an.current.onTouchEnd(_t)}function pn(_t){an.current.onWheel(_t)}return document.addEventListener("touchmove",Pt,{passive:!1}),document.addEventListener("touchend",sn,{passive:!1}),_.current.addEventListener("touchstart",It,{passive:!1}),_.current.addEventListener("wheel",pn),function(){document.removeEventListener("touchmove",Pt),document.removeEventListener("touchend",sn)}},[])}function Va(){var _=Object(x.useRef)(new Map);function V(M){return _.current.has(M)||_.current.set(M,x.createRef()),_.current.get(M)}function X(M){_.current.delete(M)}return[V,X]}function Wo(_,V){var X=x.useRef(_),M=x.useState({}),m=Object(Ce.a)(M,2),E=m[1];function y(L){var D=typeof L=="function"?L(X.current):L;D!==X.current&&V(D,X.current),X.current=D,E({})}return[X.current,y]}var ba=function(V){var X=V.position,M=V.prefixCls,m=V.extra;if(!m)return null;var E,y=m;return X==="right"&&(E=y.right||!y.left&&y||null),X==="left"&&(E=y.left||null),E?x.createElement("div",{className:"".concat(M,"-extra-content")},E):null};function zo(_,V){var X,M=x.useContext(Ai),m=M.prefixCls,E=M.tabs,y=_.className,L=_.style,D=_.id,Z=_.animated,G=_.activeKey,ne=_.rtl,ke=_.extra,$e=_.editable,Xe=_.locale,at=_.tabPosition,Wt=_.tabBarGutter,Jt=_.children,Kt=_.onTabClick,$t=_.onTabScroll,Qt=Object(x.useRef)(),Zt=Object(x.useRef)(),Yt=Object(x.useRef)(),fn=Object(x.useRef)(),on=Va(),Un=Object(Ce.a)(on,2),an=Un[0],It=Un[1],Pt=at==="top"||at==="bottom",sn=Wo(0,function(Sn,un){Pt&&$t&&$t({direction:Sn>un?"left":"right"})}),pn=Object(Ce.a)(sn,2),_t=pn[0],gn=pn[1],Bn=Wo(0,function(Sn,un){!Pt&&$t&&$t({direction:Sn>un?"top":"bottom"})}),bn=Object(Ce.a)(Bn,2),Ln=bn[0],Tn=bn[1],Zn=Object(x.useState)(0),li=Object(Ce.a)(Zn,2),Wn=li[0],Si=li[1],nr=Object(x.useState)(0),Li=Object(Ce.a)(nr,2),ui=Li[0],Nn=Li[1],Rn=Object(x.useState)(0),zn=Object(Ce.a)(Rn,2),Fn=zn[0],ir=zn[1],_r=Object(x.useState)(0),Or=Object(Ce.a)(_r,2),Mn=Or[0],hr=Or[1],Tr=Object(x.useState)(null),Pn=Object(Ce.a)(Tr,2),_n=Pn[0],ci=Pn[1],wa=Object(x.useState)(null),Ko=Object(Ce.a)(wa,2),Mr=Ko[0],Zr=Ko[1],xo=Object(x.useState)(0),Xo=Object(Ce.a)(xo,2),wo=Xo[0],Xa=Xo[1],$a=Object(x.useState)(0),Ea=Object(Ce.a)($a,2),$o=Ea[0],Yo=Ea[1],Jr=J(new Map),Qr=Object(Ce.a)(Jr,2),Ya=Qr[0],Eo=Qr[1],co=Ee(E,Ya,Wn),qr="".concat(m,"-nav-operations-hidden"),eo=0,rr=0;Pt?ne?(eo=0,rr=Math.max(0,Wn-_n)):(eo=Math.min(0,_n-Wn),rr=0):(eo=Math.min(0,Mr-ui),rr=0);function jr(Sn){return Sn<eo?[eo,!1]:Sn>rr?[rr,!1]:[Sn,!0]}var Ar=Object(x.useRef)(),ho=Object(x.useState)(),Ir=Object(Ce.a)(ho,2),So=Ir[0],Zo=Ir[1];function ko(){Zo(Date.now())}function Jo(){window.clearTimeout(Ar.current)}uo(Qt,function(Sn,un){var hi=!1;function Di(to,br){to(function(mo){var Rr=jr(mo+br),di=Object(Ce.a)(Rr,2),To=di[0],qo=di[1];return hi=qo,To})}if(Pt){if(_n>=Wn)return hi;Di(gn,Sn)}else{if(Mr>=ui)return hi;Di(Tn,un)}return Jo(),ko(),hi}),Object(x.useEffect)(function(){return Jo(),So&&(Ar.current=window.setTimeout(function(){Zo(0)},100)),Jo},[So]);function Lr(){var Sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G,un=co.get(Sn);if(!un)return;if(Pt){var hi=_t;ne?un.right<_t?hi=un.right:un.right+un.width>_t+_n&&(hi=un.right+un.width-_n):un.left<-_t?hi=-un.left:un.left+un.width>-_t+_n&&(hi=-(un.left+un.width-_n)),Tn(0),gn(jr(hi)[0])}else{var Di=Ln;un.top<-Ln?Di=-un.top:un.top+un.height>-Ln+Mr&&(Di=-(un.top+un.height-Mr)),gn(0),Tn(jr(Di)[0])}}var Ur=xe(co,{width:_n,height:Mr,left:_t,top:Ln},{width:Fn,height:Mn},{width:wo,height:$o},Object(Q.a)(Object(Q.a)({},_),{},{tabs:E})),Sa=Object(Ce.a)(Ur,2),Za=Sa[0],Ja=Sa[1],Qa=E.map(function(Sn){var un=Sn.key;return x.createElement(q,{id:D,prefixCls:m,key:un,rtl:ne,tab:Sn,closable:Sn.closable,editable:$e,active:un===G,tabPosition:at,tabBarGutter:Wt,renderWrapper:Jt,removeAriaLabel:Xe==null?void 0:Xe.removeAriaLabel,ref:an(un),onClick:function(Di){Kt(un,Di)},onRemove:function(){It(un)},onFocus:function(){Lr(un),ko(),ne||(Qt.current.scrollLeft=0),Qt.current.scrollTop=0}})}),Qo=se(function(){var Sn,un,hi,Di,to,br,mo,Rr,di,To=((Sn=Qt.current)===null||Sn===void 0?void 0:Sn.offsetWidth)||0,qo=((un=Qt.current)===null||un===void 0?void 0:un.offsetHeight)||0,ea=((hi=fn.current)===null||hi===void 0?void 0:hi.offsetWidth)||0,Pi=((Di=fn.current)===null||Di===void 0?void 0:Di.offsetHeight)||0,wn=((to=Yt.current)===null||to===void 0?void 0:to.offsetWidth)||0,ar=((br=Yt.current)===null||br===void 0?void 0:br.offsetHeight)||0;ci(To),Zr(qo),Xa(ea),Yo(Pi);var Cr=(((mo=Zt.current)===null||mo===void 0?void 0:mo.offsetWidth)||0)-ea,xr=(((Rr=Zt.current)===null||Rr===void 0?void 0:Rr.offsetHeight)||0)-Pi;Si(Cr),Nn(xr);var ta=(di=Yt.current)===null||di===void 0?void 0:di.className.includes(qr);ir(Cr-(ta?0:wn)),hr(xr-(ta?0:ar)),Eo(function(){var Mo=new Map;return E.forEach(function(Ma){var Aa=Ma.key,Fr=an(Aa).current;Fr&&Mo.set(Aa,{width:Fr.offsetWidth,height:Fr.offsetHeight,left:Fr.offsetLeft,top:Fr.offsetTop})}),Mo})}),qa=E.slice(0,Za),Ri=E.slice(Ja+1),ti=[].concat(Object(we.a)(qa),Object(we.a)(Ri)),Ci=Object(x.useState)(),ni=Object(Ce.a)(Ci,2),fo=ni[0],es=ni[1],or=co.get(G),ka=Object(x.useRef)();function _a(){H.a.cancel(ka.current)}Object(x.useEffect)(function(){var Sn={};return or&&(Pt?(ne?Sn.right=or.right:Sn.left=or.left,Sn.width=or.width):(Sn.top=or.top,Sn.height=or.height)),_a(),ka.current=H()(function(){es(Sn)}),_a},[or,Pt,ne]),Object(x.useEffect)(function(){Lr()},[G,or,co,Pt]),Object(x.useEffect)(function(){Qo()},[ne,Wt,G,E.map(function(Sn){return Sn.key}).join("_")]);var Oa=!!ti.length,Br="".concat(m,"-nav-wrap"),_o,po,Ta,Oo;return Pt?ne?(po=_t>0,_o=_t+_n<Wn):(_o=_t<0,po=-_t+_n<Wn):(Ta=Ln<0,Oo=-Ln+Mr<ui),x.createElement("div",{ref:V,role:"tablist",className:j()("".concat(m,"-nav"),y),style:L,onKeyDown:function(){ko()}},x.createElement(ba,{position:"left",extra:ke,prefixCls:m}),x.createElement(be.a,{onResize:Qo},x.createElement("div",{className:j()(Br,(X={},Object(B.a)(X,"".concat(Br,"-ping-left"),_o),Object(B.a)(X,"".concat(Br,"-ping-right"),po),Object(B.a)(X,"".concat(Br,"-ping-top"),Ta),Object(B.a)(X,"".concat(Br,"-ping-bottom"),Oo),X)),ref:Qt},x.createElement(be.a,{onResize:Qo},x.createElement("div",{ref:Zt,className:"".concat(m,"-nav-list"),style:{transform:"translate(".concat(_t,"px, ").concat(Ln,"px)"),transition:So?"none":void 0}},Qa,x.createElement(yn,{ref:fn,prefixCls:m,locale:Xe,editable:$e,style:{visibility:Oa?"hidden":null}}),x.createElement("div",{className:j()("".concat(m,"-ink-bar"),Object(B.a)({},"".concat(m,"-ink-bar-animated"),Z.inkBar)),style:fo}))))),x.createElement(Yi,Object.assign({},_,{ref:Yt,prefixCls:m,tabs:ti,className:!Oa&&qr})),x.createElement(ba,{position:"right",extra:ke,prefixCls:m}))}var Ho=x.forwardRef(zo);function Ga(_){var V=_.id,X=_.activeKey,M=_.animated,m=_.tabPosition,E=_.rtl,y=_.destroyInactiveTabPane,L=x.useContext(Ai),D=L.prefixCls,Z=L.tabs,G=M.tabPane,ne=Z.findIndex(function(ke){return ke.key===X});return x.createElement("div",{className:j()("".concat(D,"-content-holder"))},x.createElement("div",{className:j()("".concat(D,"-content"),"".concat(D,"-content-").concat(m),Object(B.a)({},"".concat(D,"-content-animated"),G)),style:ne&&G?Object(B.a)({},E?"marginRight":"marginLeft","-".concat(ne,"00%")):null},Z.map(function(ke){return x.cloneElement(ke.node,{key:ke.key,prefixCls:D,tabKey:ke.key,id:V,animated:G,active:ke.key===X,destroyInactiveTabPane:y})})))}function Ca(_){var V=_.prefixCls,X=_.forceRender,M=_.className,m=_.style,E=_.id,y=_.active,L=_.animated,D=_.destroyInactiveTabPane,Z=_.tabKey,G=_.children,ne=x.useState(X),ke=Object(Ce.a)(ne,2),$e=ke[0],Xe=ke[1];x.useEffect(function(){y?Xe(!0):D&&Xe(!1)},[y,D]);var at={};return y||(L?(at.visibility="hidden",at.height=0,at.overflowY="hidden"):at.display="none"),x.createElement("div",{id:E&&"".concat(E,"-panel-").concat(Z),role:"tabpanel",tabIndex:y?0:-1,"aria-labelledby":E&&"".concat(E,"-tab-").concat(Z),"aria-hidden":!y,style:Object(Q.a)(Object(Q.a)({},at),m),className:j()("".concat(V,"-tabpane"),y&&"".concat(V,"-tabpane-active"),M)},(y||$e||X)&&G)}var Vo=0;function xa(_){return Object(oe.a)(_).map(function(V){if(x.isValidElement(V)){var X=V.key!==void 0?String(V.key):void 0;return Object(Q.a)(Object(Q.a)({key:X},V.props),{},{node:V})}return null}).filter(function(V){return V})}function Ka(_,V){var X,M=_.id,m=_.prefixCls,E=m===void 0?"rc-tabs":m,y=_.className,L=_.children,D=_.direction,Z=_.activeKey,G=_.defaultActiveKey,ne=_.editable,ke=_.animated,$e=_.tabPosition,Xe=$e===void 0?"top":$e,at=_.tabBarGutter,Wt=_.tabBarStyle,Jt=_.tabBarExtraContent,Kt=_.locale,$t=_.moreIcon,Qt=_.moreTransitionName,Zt=_.destroyInactiveTabPane,Yt=_.renderTabBar,fn=_.onChange,on=_.onTabClick,Un=_.onTabScroll,an=Object(me.a)(_,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),It=xa(L),Pt=D==="rtl",sn;ke===!1?sn={inkBar:!1,tabPane:!1}:sn=Object(Q.a)({inkBar:!0,tabPane:!1},ke!==!0?ke:null);var pn=Object(x.useState)(!1),_t=Object(Ce.a)(pn,2),gn=_t[0],Bn=_t[1];Object(x.useEffect)(function(){Bn(ya())},[]);var bn=Object(le.a)(function(){var Mn;return(Mn=It[0])===null||Mn===void 0?void 0:Mn.key},{value:Z,defaultValue:G}),Ln=Object(Ce.a)(bn,2),Tn=Ln[0],Zn=Ln[1],li=Object(x.useState)(function(){return It.findIndex(function(Mn){return Mn.key===Tn})}),Wn=Object(Ce.a)(li,2),Si=Wn[0],nr=Wn[1];Object(x.useEffect)(function(){var Mn=It.findIndex(function(Tr){return Tr.key===Tn});if(Mn===-1){var hr;Mn=Math.max(0,Math.min(Si,It.length-1)),Zn((hr=It[Mn])===null||hr===void 0?void 0:hr.key)}nr(Mn)},[It.map(function(Mn){return Mn.key}).join("_"),Tn,Si]);var Li=Object(le.a)(null,{value:M}),ui=Object(Ce.a)(Li,2),Nn=ui[0],Rn=ui[1],zn=Xe;gn&&!["left","right"].includes(Xe)&&(zn="top"),Object(x.useEffect)(function(){M||(Rn("rc-tabs-".concat(Vo)),Vo+=1)},[]);function Fn(Mn,hr){on==null||on(Mn,hr),Zn(Mn),fn==null||fn(Mn)}var ir={id:Nn,activeKey:Tn,animated:sn,tabPosition:zn,rtl:Pt,mobile:gn},_r,Or=Object(Q.a)(Object(Q.a)({},ir),{},{editable:ne,locale:Kt,moreIcon:$t,moreTransitionName:Qt,tabBarGutter:at,onTabClick:Fn,onTabScroll:Un,extra:Jt,style:Wt,panes:L});return Yt?_r=Yt(Or,Ho):_r=x.createElement(Ho,Object.assign({},Or)),x.createElement(Ai.Provider,{value:{tabs:It,prefixCls:E}},x.createElement("div",Object.assign({ref:V,id:M,className:j()(E,"".concat(E,"-").concat(zn),(X={},Object(B.a)(X,"".concat(E,"-mobile"),gn),Object(B.a)(X,"".concat(E,"-editable"),ne),Object(B.a)(X,"".concat(E,"-rtl"),Pt),X),y)},an),_r,x.createElement(Ga,Object.assign({destroyInactiveTabPane:Zt},ir,{animated:sn}))))}var Yr=x.forwardRef(Ka);Yr.TabPane=Ca;var yr=Yr,Go=ut.b=yr},kSUc:function(Ut,ut,C){},lZu9:function(Ut,ut,C){(function(B){B(C("VrN/"),C("1eCo"),C("8EBN"))})(function(B){"use strict";B.defineMode("markdown",function(Ce,me){var Q=B.getMode(Ce,"text/html"),x=Q.name=="null";function Se(O){if(B.findModeByName){var v=B.findModeByName(O);v&&(O=v.mime||v.mimes[0])}var ae=B.getMode(Ce,O);return ae.name=="null"?null:ae}me.highlightFormatting===void 0&&(me.highlightFormatting=!1),me.maxBlockquoteDepth===void 0&&(me.maxBlockquoteDepth=0),me.taskLists===void 0&&(me.taskLists=!1),me.strikethrough===void 0&&(me.strikethrough=!1),me.emoji===void 0&&(me.emoji=!1),me.fencedCodeBlockHighlighting===void 0&&(me.fencedCodeBlockHighlighting=!0),me.fencedCodeBlockDefaultMode===void 0&&(me.fencedCodeBlockDefaultMode="text/plain"),me.xml===void 0&&(me.xml=!0),me.tokenTypeOverrides===void 0&&(me.tokenTypeOverrides={});var j={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 oe in j)j.hasOwnProperty(oe)&&me.tokenTypeOverrides[oe]&&(j[oe]=me.tokenTypeOverrides[oe]);var le=/^([*\-_])(?:\s*\1){2,}\s*$/,we=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,W=/^\[(x| )\](?=\s)/i,H=me.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,be=/^ {0,3}(?:\={1,}|-{2,})\s*$/,se=/^[^#!\[\]*_\\<>` "'(~:]+/,J=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,U=/^\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]/,q=" ";function ee(O,v,ae){return v.f=v.inline=ae,ae(O,v)}function Ee(O,v,ae){return v.f=v.block=ae,ae(O,v)}function je(O){return!O||!/\S/.test(O.string)}function xe(O){if(O.linkTitle=!1,O.linkHref=!1,O.linkText=!1,O.em=!1,O.strong=!1,O.strikethrough=!1,O.quote=0,O.indentedCode=!1,O.f==Fe){var v=x;if(!v){var ae=B.innerMode(Q,O.htmlState);v=ae.mode.name=="xml"&&ae.state.tagStart===null&&!ae.state.context&&ae.state.tokenize.isInText}v&&(O.f=fe,O.block=de,O.htmlState=null)}return O.trailingSpace=0,O.trailingSpaceNewLine=!1,O.prevLine=O.thisLine,O.thisLine={stream:null},null}function de(O,v){var ae=O.column()===v.indentation,Pe=je(v.prevLine.stream),Ne=v.indentedCode,it=v.prevLine.hr,ft=v.list!==!1,He=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var Ve=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,ft)){for(v.list=null;Ve<v.listStack[v.listStack.length-1];)v.listStack.pop(),v.listStack.length?v.indentation=v.listStack[v.listStack.length-1]:v.list=!1;v.list!==!1&&(v.indentationDiff=Ve-v.listStack[v.listStack.length-1])}var Ie=!Pe&&!it&&!v.prevLine.header&&(!ft||!Ne)&&!v.prevLine.fencedCodeEnd,We=(v.list===!1||it||Pe)&&v.indentation<=He&&O.match(le),re=null;if(v.indentationDiff>=4&&(Ne||v.prevLine.fencedCodeEnd||v.prevLine.header||Pe))return O.skipToEnd(),v.indentedCode=!0,j.code;if(O.eatSpace())return null;if(ae&&v.indentation<=He&&(re=O.match(H))&&re[1].length<=6)return v.quote=0,v.header=re[1].length,v.thisLine.header=!0,me.highlightFormatting&&(v.formatting="header"),v.f=v.inline,ge(v);if(v.indentation<=He&&O.eat(">"))return v.quote=ae?1:v.quote+1,me.highlightFormatting&&(v.formatting="quote"),O.eatSpace(),ge(v);if(!We&&!v.setext&&ae&&v.indentation<=He&&(re=O.match(we))){var R=re[1]?"ol":"ul";return v.indentation=Ve+O.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,me.taskLists&&O.match(W,!1)&&(v.taskList=!0),v.f=v.inline,me.highlightFormatting&&(v.formatting=["list","list-"+R]),ge(v)}else{if(ae&&v.indentation<=He&&(re=O.match(J,!0)))return v.quote=0,v.fencedEndRE=new RegExp(re[1]+"+ *$"),v.localMode=me.fencedCodeBlockHighlighting&&Se(re[2]||me.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=B.startState(v.localMode)),v.f=v.block=ue,me.highlightFormatting&&(v.formatting="code-block"),v.code=-1,ge(v);if(v.setext||(!Ie||!ft)&&!v.quote&&v.list===!1&&!v.code&&!We&&!U.test(O.string)&&(re=O.lookAhead(1))&&(re=re.match(be)))return v.setext?(v.header=v.setext,v.setext=0,O.skipToEnd(),me.highlightFormatting&&(v.formatting="header")):(v.header=re[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,ge(v);if(We)return O.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,j.hr;if(O.peek()==="[")return ee(O,v,ye)}return ee(O,v,v.inline)}function Fe(O,v){var ae=Q.token(O,v.htmlState);if(!x){var Pe=B.innerMode(Q,v.htmlState);(Pe.mode.name=="xml"&&Pe.state.tagStart===null&&!Pe.state.context&&Pe.state.tokenize.isInText||v.md_inside&&O.current().indexOf(">")>-1)&&(v.f=fe,v.block=de,v.htmlState=null)}return ae}function ue(O,v){var ae=v.listStack[v.listStack.length-1]||0,Pe=v.indentation<ae,Ne=ae+3;if(v.fencedEndRE&&v.indentation<=Ne&&(Pe||O.match(v.fencedEndRE))){me.highlightFormatting&&(v.formatting="code-block");var it;return Pe||(it=ge(v)),v.localMode=v.localState=null,v.block=de,v.f=fe,v.fencedEndRE=null,v.code=0,v.thisLine.fencedCodeEnd=!0,Pe?Ee(O,v,v.block):it}else return v.localMode?v.localMode.token(O,v.localState):(O.skipToEnd(),j.code)}function ge(O){var v=[];if(O.formatting){v.push(j.formatting),typeof O.formatting=="string"&&(O.formatting=[O.formatting]);for(var ae=0;ae<O.formatting.length;ae++)v.push(j.formatting+"-"+O.formatting[ae]),O.formatting[ae]==="header"&&v.push(j.formatting+"-"+O.formatting[ae]+"-"+O.header),O.formatting[ae]==="quote"&&(!me.maxBlockquoteDepth||me.maxBlockquoteDepth>=O.quote?v.push(j.formatting+"-"+O.formatting[ae]+"-"+O.quote):v.push("error"))}if(O.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(O.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(O.linkHref?v.push(j.linkHref,"url"):(O.strong&&v.push(j.strong),O.em&&v.push(j.em),O.strikethrough&&v.push(j.strikethrough),O.emoji&&v.push(j.emoji),O.linkText&&v.push(j.linkText),O.code&&v.push(j.code),O.image&&v.push(j.image),O.imageAltText&&v.push(j.imageAltText,"link"),O.imageMarker&&v.push(j.imageMarker)),O.header&&v.push(j.header,j.header+"-"+O.header),O.quote&&(v.push(j.quote),!me.maxBlockquoteDepth||me.maxBlockquoteDepth>=O.quote?v.push(j.quote+"-"+O.quote):v.push(j.quote+"-"+me.maxBlockquoteDepth)),O.list!==!1){var Pe=(O.listStack.length-1)%3;Pe?Pe===1?v.push(j.list2):v.push(j.list3):v.push(j.list1)}return O.trailingSpaceNewLine?v.push("trailing-space-new-line"):O.trailingSpace&&v.push("trailing-space-"+(O.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function Ae(O,v){return O.match(se,!0)?ge(v):void 0}function fe(O,v){var ae=v.text(O,v);if(typeof ae!="undefined")return ae;if(v.list)return v.list=null,ge(v);if(v.taskList){var Pe=O.match(W,!0)[1]===" ";return Pe?v.taskOpen=!0:v.taskClosed=!0,me.highlightFormatting&&(v.formatting="task"),v.taskList=!1,ge(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&O.match(/^#+$/,!0))return me.highlightFormatting&&(v.formatting="header"),ge(v);var Ne=O.next();if(v.linkTitle){v.linkTitle=!1;var it=Ne;Ne==="("&&(it=")"),it=(it+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ft="^\\s*(?:[^"+it+"\\\\]+|\\\\\\\\|\\\\.)"+it;if(O.match(new RegExp(ft),!0))return j.linkHref}if(Ne==="`"){var He=v.formatting;me.highlightFormatting&&(v.formatting="code"),O.eatWhile("`");var Ve=O.current().length;if(v.code==0&&(!v.quote||Ve==1))return v.code=Ve,ge(v);if(Ve==v.code){var Ie=ge(v);return v.code=0,Ie}else return v.formatting=He,ge(v)}else if(v.code)return ge(v);if(Ne==="\\"&&(O.next(),me.highlightFormatting)){var We=ge(v),re=j.formatting+"-escape";return We?We+" "+re:re}if(Ne==="!"&&O.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,me.highlightFormatting&&(v.formatting="image"),ge(v);if(Ne==="["&&v.imageMarker&&O.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,me.highlightFormatting&&(v.formatting="image"),ge(v);if(Ne==="]"&&v.imageAltText){me.highlightFormatting&&(v.formatting="image");var We=ge(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=ve,We}if(Ne==="["&&!v.image)return v.linkText&&O.match(/^.*?\]/)||(v.linkText=!0,me.highlightFormatting&&(v.formatting="link")),ge(v);if(Ne==="]"&&v.linkText){me.highlightFormatting&&(v.formatting="link");var We=ge(v);return v.linkText=!1,v.inline=v.f=O.match(/\(.*?\)| ?\[.*?\]/,!1)?ve:fe,We}if(Ne==="<"&&O.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=k,me.highlightFormatting&&(v.formatting="link");var We=ge(v);return We?We+=" ":We="",We+j.linkInline}if(Ne==="<"&&O.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=k,me.highlightFormatting&&(v.formatting="link");var We=ge(v);return We?We+=" ":We="",We+j.linkEmail}if(me.xml&&Ne==="<"&&O.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var R=O.string.indexOf(">",O.pos);if(R!=-1){var qe=O.string.substring(O.start,R);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(qe)&&(v.md_inside=!0)}return O.backUp(1),v.htmlState=B.startState(Q),Ee(O,v,Fe)}if(me.xml&&Ne==="<"&&O.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(Ne==="*"||Ne==="_"){for(var vt=1,At=O.pos==1?" ":O.string.charAt(O.pos-2);vt<3&&O.eat(Ne);)vt++;var ot=O.peek()||" ",dt=!/\s/.test(ot)&&(!P.test(ot)||/\s/.test(At)||P.test(At)),Te=!/\s/.test(At)&&(!P.test(At)||/\s/.test(ot)||P.test(ot)),Ke=null,tt=null;if(vt%2&&(!v.em&&dt&&(Ne==="*"||!Te||P.test(At))?Ke=!0:v.em==Ne&&Te&&(Ne==="*"||!dt||P.test(ot))&&(Ke=!1)),vt>1&&(!v.strong&&dt&&(Ne==="*"||!Te||P.test(At))?tt=!0:v.strong==Ne&&Te&&(Ne==="*"||!dt||P.test(ot))&&(tt=!1)),tt!=null||Ke!=null){me.highlightFormatting&&(v.formatting=Ke==null?"strong":tt==null?"em":"strong em"),Ke===!0&&(v.em=Ne),tt===!0&&(v.strong=Ne);var Ie=ge(v);return Ke===!1&&(v.em=!1),tt===!1&&(v.strong=!1),Ie}}else if(Ne===" "&&(O.eat("*")||O.eat("_"))){if(O.peek()===" ")return ge(v);O.backUp(1)}if(me.strikethrough){if(Ne==="~"&&O.eatWhile(Ne)){if(v.strikethrough){me.highlightFormatting&&(v.formatting="strikethrough");var Ie=ge(v);return v.strikethrough=!1,Ie}else if(O.match(/^[^\s]/,!1))return v.strikethrough=!0,me.highlightFormatting&&(v.formatting="strikethrough"),ge(v)}else if(Ne===" "&&O.match(/^~~/,!0)){if(O.peek()===" ")return ge(v);O.backUp(2)}}if(me.emoji&&Ne===":"&&O.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,me.highlightFormatting&&(v.formatting="emoji");var ct=ge(v);return v.emoji=!1,ct}return Ne===" "&&(O.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),ge(v)}function k(O,v){var ae=O.next();if(ae===">"){v.f=v.inline=fe,me.highlightFormatting&&(v.formatting="link");var Pe=ge(v);return Pe?Pe+=" ":Pe="",Pe+j.linkInline}return O.match(/^[^>]+/,!0),j.linkInline}function ve(O,v){if(O.eatSpace())return null;var ae=O.next();return ae==="("||ae==="["?(v.f=v.inline=N(ae==="("?")":"]"),me.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,ge(v)):"error"}var ie={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(O){return function(v,ae){var Pe=v.next();if(Pe===O){ae.f=ae.inline=fe,me.highlightFormatting&&(ae.formatting="link-string");var Ne=ge(ae);return ae.linkHref=!1,Ne}return v.match(ie[O]),ae.linkHref=!0,ge(ae)}}function ye(O,v){return O.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=Oe,O.next(),me.highlightFormatting&&(v.formatting="link"),v.linkText=!0,ge(v)):ee(O,v,fe)}function Oe(O,v){if(O.match(/^\]:/,!0)){v.f=v.inline=pe,me.highlightFormatting&&(v.formatting="link");var ae=ge(v);return v.linkText=!1,ae}return O.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function pe(O,v){return O.eatSpace()?null:(O.match(/^[^\s]+/,!0),O.peek()===void 0?v.linkTitle=!0:O.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=fe,j.linkHref+" url")}var Ze={startState:function(){return{f:de,prevLine:{stream:null},thisLine:{stream:null},block:de,htmlState:null,indentation:0,inline:fe,text:Ae,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(O){return{f:O.f,prevLine:O.prevLine,thisLine:O.thisLine,block:O.block,htmlState:O.htmlState&&B.copyState(Q,O.htmlState),indentation:O.indentation,localMode:O.localMode,localState:O.localMode?B.copyState(O.localMode,O.localState):null,inline:O.inline,text:O.text,formatting:!1,linkText:O.linkText,linkTitle:O.linkTitle,linkHref:O.linkHref,code:O.code,em:O.em,strong:O.strong,strikethrough:O.strikethrough,emoji:O.emoji,header:O.header,setext:O.setext,hr:O.hr,taskList:O.taskList,list:O.list,listStack:O.listStack.slice(0),quote:O.quote,indentedCode:O.indentedCode,trailingSpace:O.trailingSpace,trailingSpaceNewLine:O.trailingSpaceNewLine,md_inside:O.md_inside,fencedEndRE:O.fencedEndRE}},token:function(O,v){if(v.formatting=!1,O!=v.thisLine.stream){if(v.header=0,v.hr=!1,O.match(/^\s*$/,!0))return xe(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:O},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=Fe)){var ae=O.match(/^\s*/,!0)[0].replace(/\t/g,q).length;if(v.indentation=ae,v.indentationDiff=null,ae>0)return null}}return v.f(O,v)},innerMode:function(O){return O.block==Fe?{state:O.htmlState,mode:Q}:O.localState?{state:O.localState,mode:O.localMode}:{state:O,mode:Ze}},indent:function(O,v,ae){return O.block==Fe&&Q.indent?Q.indent(O.htmlState,v,ae):O.localState&&O.localMode.indent?O.localMode.indent(O.localState,v,ae):B.Pass},blankLine:xe,getType:ge,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ze},"xml"),B.defineMIME("text/markdown","markdown"),B.defineMIME("text/x-markdown","markdown")})},nuEh:function(Ut,ut,C){"use strict";var B=C("T2oS"),Ce=C("W9HT"),me=C("q1tI"),Q=C.n(me),x=C("F8wB"),Se=C.n(x),j=function(le){var we=le.loading;return we?Q.a.createElement("div",{className:Se.a.loading},Q.a.createElement(Ce.a,null)):Q.a.createElement(Q.a.Fragment,null)};ut.a=j},osHv:function(Ut,ut,C){(function(B){B(C("VrN/"))})(function(B){"use strict";var Ce=B.Pos;function me(P,q){return P.line-q.line||P.ch-q.ch}var Q="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",x=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Se=new RegExp("<(/?)(["+Q+"]["+x+"]*)","g");function j(P,q,ee,Ee){this.line=q,this.ch=ee,this.cm=P,this.text=P.getLine(q),this.min=Ee?Math.max(Ee.from,P.firstLine()):P.firstLine(),this.max=Ee?Math.min(Ee.to-1,P.lastLine()):P.lastLine()}function oe(P,q){var ee=P.cm.getTokenTypeAt(Ce(P.line,q));return ee&&/\btag\b/.test(ee)}function le(P){return P.line>=P.max?void 0:(P.ch=0,P.text=P.cm.getLine(++P.line),!0)}function we(P){return P.line<=P.min?void 0:(P.text=P.cm.getLine(--P.line),P.ch=P.text.length,!0)}function W(P){for(;;){var q=P.text.indexOf(">",P.ch);if(q==-1){if(le(P))continue;return}if(!oe(P,q+1)){P.ch=q+1;continue}var ee=P.text.lastIndexOf("/",q),Ee=ee>-1&&!/\S/.test(P.text.slice(ee+1,q));return P.ch=q+1,Ee?"selfClose":"regular"}}function H(P){for(;;){var q=P.ch?P.text.lastIndexOf("<",P.ch-1):-1;if(q==-1){if(we(P))continue;return}if(!oe(P,q+1)){P.ch=q;continue}Se.lastIndex=q,P.ch=q;var ee=Se.exec(P.text);if(ee&&ee.index==q)return ee}}function be(P){for(;;){Se.lastIndex=P.ch;var q=Se.exec(P.text);if(!q){if(le(P))continue;return}if(!oe(P,q.index+1)){P.ch=q.index+1;continue}return P.ch=q.index+q[0].length,q}}function se(P){for(;;){var q=P.ch?P.text.lastIndexOf(">",P.ch-1):-1;if(q==-1){if(we(P))continue;return}if(!oe(P,q+1)){P.ch=q;continue}var ee=P.text.lastIndexOf("/",q),Ee=ee>-1&&!/\S/.test(P.text.slice(ee+1,q));return P.ch=q+1,Ee?"selfClose":"regular"}}function J(P,q){for(var ee=[];;){var Ee=be(P),je,xe=P.line,de=P.ch-(Ee?Ee[0].length:0);if(!Ee||!(je=W(P)))return;if(je=="selfClose")continue;if(Ee[1]){for(var Fe=ee.length-1;Fe>=0;--Fe)if(ee[Fe]==Ee[2]){ee.length=Fe;break}if(Fe<0&&(!q||q==Ee[2]))return{tag:Ee[2],from:Ce(xe,de),to:Ce(P.line,P.ch)}}else ee.push(Ee[2])}}function U(P,q){for(var ee=[];;){var Ee=se(P);if(!Ee)return;if(Ee=="selfClose"){H(P);continue}var je=P.line,xe=P.ch,de=H(P);if(!de)return;if(de[1])ee.push(de[2]);else{for(var Fe=ee.length-1;Fe>=0;--Fe)if(ee[Fe]==de[2]){ee.length=Fe;break}if(Fe<0&&(!q||q==de[2]))return{tag:de[2],from:Ce(P.line,P.ch),to:Ce(je,xe)}}}}B.registerHelper("fold","xml",function(P,q){for(var ee=new j(P,q.line,0);;){var Ee=be(ee);if(!Ee||ee.line!=q.line)return;var je=W(ee);if(!je)return;if(!Ee[1]&&je!="selfClose"){var xe=Ce(ee.line,ee.ch),de=J(ee,Ee[2]);return de&&me(de.from,xe)>0?{from:xe,to:de.from}:null}}}),B.findMatchingTag=function(P,q,ee){var Ee=new j(P,q.line,q.ch,ee);if(Ee.text.indexOf(">")==-1&&Ee.text.indexOf("<")==-1)return;var je=W(Ee),xe=je&&Ce(Ee.line,Ee.ch),de=je&&H(Ee);if(!je||!de||me(Ee,q)>0)return;var Fe={from:Ce(Ee.line,Ee.ch),to:xe,tag:de[2]};return je=="selfClose"?{open:Fe,close:null,at:"open"}:de[1]?{open:U(Ee,de[2]),close:Fe,at:"close"}:(Ee=new j(P,xe.line,xe.ch,ee),{open:Fe,close:J(Ee,de[2]),at:"open"})},B.findEnclosingTag=function(P,q,ee,Ee){for(var je=new j(P,q.line,q.ch,ee);;){var xe=U(je,Ee);if(!xe)break;var de=new j(P,q.line,q.ch,ee),Fe=J(de,xe.tag);if(Fe)return{open:xe,close:Fe}}},B.scanForClosingTag=function(P,q,ee,Ee){var je=new j(P,q.line,q.ch,Ee?{from:0,to:Ee}:null);return J(je,ee)}})},p5ED:function(Ut,ut,C){"use strict";var B=C("+L6B"),Ce=C("2/Rp"),me=C("5Dmo"),Q=C("3S7+"),x=C("k1fw"),Se=C("9og8"),j=C("tJVT"),oe=C("WmNS"),le=C.n(oe),we=C("q1tI"),W=C.n(we),H=C("vHTk"),be=C.n(H),se=C("yEEn"),J=C("ZW9T"),U=C("1vsH"),P=C("V0Rq"),q=C("m3rI"),ee=function(je){var xe=je.name,de=je.data,Fe=je.theme,ue=je.type,ge=je.filename,Ae=je.monacoEditor,fe=je.className,k=je.style,ve=je.close,ie=je.onClose,N=je.hasMask,ye=je.otherData,Oe=ye===void 0?{}:ye,pe=Object(we.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ze=Object(j.a)(pe,2),O=Ze[0],v=Ze[1],ae=Object(we.useState)(""),Pe=Object(j.a)(ae,2),Ne=Pe[0],it=Pe[1],ft=Object(we.useState)(),He=Object(j.a)(ft,2),Ve=He[0],Ie=He[1],We=window.ENV==="build"?"/react/build/office.html":"/office.html",re,R=1024*1024,qe=10*R,vt=Object(we.useRef)();ue==="office"&&(re=Object(U.R)(de).filesize,re>qe&&(ue="other")),ge&&(Ae.filename=ge),Object(we.useEffect)(function(){var Te,Ke,tt=(Te=document.cookie)===null||Te===void 0||((Ke=Te.replace(/\s/g,""))===null||Ke===void 0)?void 0:Ke.split(";");tt==null||tt.map(function(ct){var Qe=ct.split("=");Qe[0]==="_educoder_session"&&it(Qe[1])})},[]),Object(we.useEffect)(function(){ue==="office"&&At()},[ue]);var At=function(){var Te=Object(Se.a)(le.a.mark(function Ke(){var tt,ct,Qe;return le.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return console.log("data:",de),tt=de,de.startsWith("http")||(tt=location.origin+tt),ct=new URL(tt).pathname.split("/").pop(),Ye.next=6,Object(P.U)({attachment_id:ct});case 6:Qe=Ye.sent,Ie(Qe);case 8:case"end":return Ye.stop()}},Ke)}));return function(){return Te.apply(this,arguments)}}(),ot=function(){if(de.startsWith("http")||de.startsWith("blob:")){dt();return}Object(U.x)(ge||"educoder",de,ge)},dt=function(){Object(U.v)(ge||"educoder",decodeURIComponent(de))};return W.a.createElement("div",{style:Object(x.a)({},k||{}),className:"".concat(N&&be.a.bgBlack," ").concat(ue?be.a.wrp:"hide")},ve&&W.a.createElement("div",{className:be.a.close,ref:vt},W.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return vt.current}},W.a.createElement("span",{onClick:dt},W.a.createElement("i",{className:"icon-quxiaozhiding"}))),W.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return vt.current}},W.a.createElement("span",{className:"",onClick:function(){ie(),Ie(null)}},W.a.createElement("i",{className:"icon-guanbi1"})))),W.a.createElement("div",{className:"".concat(be.a[fe]," ").concat(fe," ").concat(be.a.monaco," ").concat(ue==="txt"?"show":"hide")},ue==="txt"&&W.a.createElement(J.b,Ae)),ue==="audio"&&W.a.createElement("audio",{src:"".concat((de==null?void 0:de.indexOf("http://"))>-1||(de==null?void 0:de.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(de),autoPlay:!0}),ue==="video"&&W.a.createElement(W.a.Fragment,null,(de==null?void 0:de.indexOf("http"))>-1?W.a.createElement("video",{controls:!0,src:"".concat(de),autoPlay:!0}):W.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(de),autoPlay:!0})),ue==="office"&&Ve&&W.a.createElement("iframe",{src:"".concat(We,"?key=").concat(Ve.key,"&url=").concat(q.a.API_SERVER+Ve.url,"&callbackUrl=").concat(q.a.API_SERVER+Ve.callbackUrl,"&fileType=").concat(Ve.fileType,"&title=").concat(Ve.title,"&model=view")}),(ue==="xlsx"||ue==="doc"||ue==="pptx"||ue==="docx")&&W.a.createElement("iframe",{src:"".concat(We,"?key=").concat(Oe.key,"&url=").concat(q.a.API_SERVER+Oe.url,"&callbackUrl=").concat(q.a.API_SERVER+Oe.callbackUrl,"&fileType=").concat(Oe.fileType,"&title=").concat(Oe.title,"&model=").concat(Oe.model)}),ue==="html"&&W.a.createElement("iframe",{src:de+"&disposition=inline"}),ue==="pdf"&&W.a.createElement("embed",{className:be.a.embed,src:de,type:"application/pdf"}),ue==="image"&&W.a.createElement("img",{src:"".concat((de==null?void 0:de.indexOf("http://"))>-1||(de==null?void 0:de.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(de)}),ue==="other"&&W.a.createElement("div",null,W.a.createElement(Ce.a,{type:"primary",size:"large",onClick:ot},W.a.createElement(se.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),ue==="download"&&W.a.createElement(Ce.a,{type:"primary",size:"large",onClick:ot},W.a.createElement(se.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};ut.a=ee},"p77/":function(Ut,ut,C){},"rAM+":function(Ut,ut,C){"use strict";C.d(ut,"a",function(){return Ce});var B=C("Qw5x");function Ce(me,Q){var x;if(typeof Symbol=="undefined"||me[Symbol.iterator]==null){if(Array.isArray(me)||(x=Object(B.a)(me))||Q&&me&&typeof me.length=="number"){x&&(me=x);var Se=0,j=function(){};return{s:j,n:function(){return Se>=me.length?{done:!0}:{done:!1,value:me[Se++]}},e:function(H){throw H},f:j}}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 oe=!0,le=!1,we;return{s:function(){x=me[Symbol.iterator]()},n:function(){var H=x.next();return oe=H.done,H},e:function(H){le=!0,we=H},f:function(){try{!oe&&x.return!=null&&x.return()}finally{if(le)throw we}}}}},rUJ1:function(Ut,ut){const C=/[&<>"']/,B=/[&<>"']/g,Ce=/[<>"']|&(?!#?\w+;)/,me=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},x=ue=>Q[ue];function Se(ue,ge){if(ge){if(C.test(ue))return ue.replace(B,x)}else if(Ce.test(ue))return ue.replace(me,x);return ue}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function oe(ue){return ue.replace(j,(ge,Ae)=>(Ae=Ae.toLowerCase(),Ae==="colon"?":":Ae.charAt(0)==="#"?Ae.charAt(1)==="x"?String.fromCharCode(parseInt(Ae.substring(2),16)):String.fromCharCode(+Ae.substring(1)):""))}const le=/(^|[^\[])\^/g;function we(ue,ge){ue=ue.source||ue,ge=ge||"";const Ae={replace:(fe,k)=>(k=k.source||k,k=k.replace(le,"$1"),ue=ue.replace(fe,k),Ae),getRegex:()=>new RegExp(ue,ge)};return Ae}const W=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function be(ue,ge,Ae){if(ue){let fe;try{fe=decodeURIComponent(oe(Ae)).replace(W,"").toLowerCase()}catch(k){return null}if(fe.indexOf("javascript:")===0||fe.indexOf("vbscript:")===0||fe.indexOf("data:")===0)return null}ge&&!H.test(Ae)&&(Ae=q(ge,Ae));try{Ae=encodeURI(Ae).replace(/%25/g,"%")}catch(fe){return null}return Ae}const se={},J=/^[^:]+:\/*[^/]*$/,U=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function q(ue,ge){se[" "+ue]||(J.test(ue)?se[" "+ue]=ue+"/":se[" "+ue]=xe(ue,"/",!0)),ue=se[" "+ue];const Ae=ue.indexOf(":")===-1;return ge.substring(0,2)==="//"?Ae?ge:ue.replace(U,"$1")+ge:ge.charAt(0)==="/"?Ae?ge:ue.replace(P,"$1")+ge:ue+ge}const ee={exec:function(){}};function Ee(ue){let ge=1,Ae,fe;for(;ge<arguments.length;ge++){Ae=arguments[ge];for(fe in Ae)Object.prototype.hasOwnProperty.call(Ae,fe)&&(ue[fe]=Ae[fe])}return ue}function je(ue,ge){const Ae=ue.replace(/\|/g,(ve,ie,N)=>{let ye=!1,Oe=ie;for(;--Oe>=0&&N[Oe]==="\\";)ye=!ye;return ye?"|":" |"}),fe=Ae.split(/ \|/);let k=0;if(fe.length>ge)fe.splice(ge);else for(;fe.length<ge;)fe.push("");for(;k<fe.length;k++)fe[k]=fe[k].trim().replace(/\\\|/g,"|");return fe}function xe(ue,ge,Ae){const fe=ue.length;if(fe===0)return"";let k=0;for(;k<fe;){const ve=ue.charAt(fe-k-1);if(ve===ge&&!Ae)k++;else if(ve!==ge&&Ae)k++;else break}return ue.substr(0,fe-k)}function de(ue,ge){if(ue.indexOf(ge[1])===-1)return-1;const Ae=ue.length;let fe=0,k=0;for(;k<Ae;k++)if(ue[k]==="\\")k++;else if(ue[k]===ge[0])fe++;else if(ue[k]===ge[1]&&(fe--,fe<0))return k;return-1}function Fe(ue){ue&&ue.sanitize&&!ue.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")}Ut.exports={escape:Se,unescape:oe,edit:we,cleanUrl:be,resolveUrl:q,noopTest:ee,merge:Ee,splitCells:je,rtrim:xe,findClosingBracket:de,checkSanitizeDeprecation:Fe}},t23M:function(Ut,ut,C){"use strict";var B=C("VTBJ"),Ce=C("1OyB"),me=C("vuIU"),Q=C("Ji7U"),x=C("LK+K"),Se=C("q1tI"),j=C.n(Se),oe=C("m+aA"),le=C("Zm9Q"),we=C("Kwbf"),W=C("c+Xe"),H=C("bdgK"),be="rc-observer-key",se=function(J){Object(Q.a)(P,J);var U=Object(x.a)(P);function P(){var q;return Object(Ce.a)(this,P),q=U.apply(this,arguments),q.resizeObserver=null,q.childNode=null,q.currentElement=null,q.state={width:0,height:0,offsetHeight:0,offsetWidth:0},q.onResize=function(ee){var Ee=q.props.onResize,je=ee[0].target,xe=je.getBoundingClientRect(),de=xe.width,Fe=xe.height,ue=je.offsetWidth,ge=je.offsetHeight,Ae=Math.floor(de),fe=Math.floor(Fe);if(q.state.width!==Ae||q.state.height!==fe||q.state.offsetWidth!==ue||q.state.offsetHeight!==ge){var k={width:Ae,height:fe,offsetWidth:ue,offsetHeight:ge};q.setState(k),Ee&&Promise.resolve().then(function(){Ee(Object(B.a)(Object(B.a)({},k),{},{offsetWidth:ue,offsetHeight:ge}))})}},q.setChildNode=function(ee){q.childNode=ee},q}return Object(me.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 ee=this.props.disabled;if(ee){this.destroyObserver();return}var Ee=Object(oe.a)(this.childNode||this),je=Ee!==this.currentElement;je&&(this.destroyObserver(),this.currentElement=Ee),!this.resizeObserver&&Ee&&(this.resizeObserver=new H.default(this.onResize),this.resizeObserver.observe(Ee))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var ee=this.props.children,Ee=Object(le.a)(ee);if(Ee.length>1)Object(we.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(Ee.length===0)return Object(we.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var je=Ee[0];if(Se.isValidElement(je)&&Object(W.c)(je)){var xe=je.ref;Ee[0]=Se.cloneElement(je,{ref:Object(W.a)(xe,this.setChildNode)})}return Ee.length===1?Ee[0]:Ee.map(function(de,Fe){return!Se.isValidElement(de)||"key"in de&&de.key!==null?de:Se.cloneElement(de,{key:"".concat(be,"-").concat(Fe)})})}}]),P}(Se.Component);se.displayName="ResizeObserver",ut.a=se},vHTk:function(Ut,ut,C){Ut.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);