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.
349 lines
648 KiB
349 lines
648 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[220,7],{"+NIl":function(ct,ie,g){(function(K){K(g("VrN/"))})(function(K){"use strict";K.defineMode("stex",function(ge,Q){"use strict";function fe(w,S){w.cmdState.push(S)}function he(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function ee(w){var S=w.cmdState.pop();S&&S.closeBracket()}function B(w){for(var S=w.cmdState,M=S.length-1;M>=0;M--){var m=S[M];if(m.name=="DEFAULT")continue;return m}return{styleIdentifier:function(){return null}}}function Y(w,S,M){return function(){this.name=w,this.bracketNo=0,this.style=S,this.styles=M,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var D={};D.importmodule=Y("importmodule","tag",["string","builtin"]),D.documentclass=Y("documentclass","tag",["","atom"]),D.usepackage=Y("usepackage","tag",["atom"]),D.begin=Y("begin","tag",["atom"]),D.end=Y("end","tag",["atom"]),D.label=Y("label","tag",["atom"]),D.ref=Y("ref","tag",["atom"]),D.eqref=Y("eqref","tag",["atom"]),D.cite=Y("cite","tag",["atom"]),D.bibitem=Y("bibitem","tag",["atom"]),D.Bibitem=Y("Bibitem","tag",["atom"]),D.RBibitem=Y("RBibitem","tag",["atom"]),D.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(w,S){w.f=S}function y(w,S){var M;if(w.match(/^\\[a-zA-Z@]+/)){var m=w.current().slice(1);return M=D.hasOwnProperty(m)?D[m]:D.DEFAULT,M=new M,fe(S,M),I(S,L),M.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return I(S,function(T,O){return x(T,O,"\\]")}),"keyword";if(w.match("\\("))return I(S,function(T,O){return x(T,O,"\\)")}),"keyword";if(w.match("$$"))return I(S,function(T,O){return x(T,O,"$$")}),"keyword";if(w.match("$"))return I(S,function(T,O){return x(T,O,"$")}),"keyword";var v=w.next();if(v=="%")return w.skipToEnd(),"comment";if(v=="}"||v=="]"){if(M=he(S),M)M.closeBracket(v),I(S,L);else return"error";return"bracket"}else return v=="{"||v=="["?(M=D.DEFAULT,M=new M,fe(S,M),"bracket"):/\d/.test(v)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),M=B(S),M.name=="begin"&&(M.argument=w.current()),M.styleIdentifier())}function x(w,S,M){if(w.eatSpace())return null;if(M&&w.match(M))return I(S,y),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var m=w.next();return m=="{"||m=="}"||m=="["||m=="]"||m=="("||m==")"?"bracket":m=="%"?(w.skipToEnd(),"comment"):"error"}function L(w,S){var M=w.peek(),m;return M=="{"||M=="["?(m=he(S),m.openBracket(M),w.eat(M),I(S,y),"bracket"):/[ \t\r]/.test(M)?(w.eat(M),null):(I(S,y),ee(S),y(w,S))}return{startState:function(){var w=Q.inMathMode?function(S,M){return x(S,M)}:y;return{cmdState:[],f:w}},copyState:function(w){return{cmdState:w.cmdState.slice(),f:w.f}},token:function(w,S){return S.f(w,S)},blankLine:function(w){w.f=y,w.cmdState.length=0},lineComment:"%"}}),K.defineMIME("text/x-stex","stex"),K.defineMIME("text/x-latex","stex")})},"+ua5":function(ct,ie,g){},"/cxE":function(ct,ie,g){"use strict";g.d(ie,"e",function(){return Q}),g.d(ie,"f",function(){return fe}),g.d(ie,"g",function(){return he}),g.d(ie,"d",function(){return B}),g.d(ie,"a",function(){return Y}),g.d(ie,"b",function(){return D}),g.d(ie,"c",function(){return I});var K=function(){function y(){this.listeners=[],this.unexpectedErrorHandler=function(x){setTimeout(function(){throw x.stack?new Error(x.message+`
|
|
|
|
`+x.stack):x},0)}}return y.prototype.emit=function(x){this.listeners.forEach(function(L){L(x)})},y.prototype.onUnexpectedError=function(x){this.unexpectedErrorHandler(x),this.emit(x)},y.prototype.onUnexpectedExternalError=function(x){this.unexpectedErrorHandler(x)},y}(),ge=new K;function Q(y){B(y)||ge.onUnexpectedError(y);return}function fe(y){B(y)||ge.onUnexpectedExternalError(y);return}function he(y){if(y instanceof Error){var x=y.name,L=y.message,w=y.stacktrace||y.stack;return{$isError:!0,name:x,message:L,stack:w}}return y}var ee="Canceled";function B(y){return y instanceof Error&&y.name===ee&&y.message===ee}function Y(){var y=new Error(ee);return y.name=y.message,y}function D(y){return y?new Error("Illegal argument: "+y):new Error("Illegal argument")}function I(y){return y?new Error("Illegal state: "+y):new Error("Illegal state")}},"19Vz":function(ct,ie,g){(function(K){K(g("VrN/"))})(function(K){K.defineOption("placeholder","",function(Y,D,I){var y=I&&I!=K.Init;if(D&&!y)Y.on("blur",he),Y.on("change",ee),Y.on("swapDoc",ee),K.on(Y.getInputField(),"compositionupdate",Y.state.placeholderCompose=function(){fe(Y)}),ee(Y);else if(!D&&y){Y.off("blur",he),Y.off("change",ee),Y.off("swapDoc",ee),K.off(Y.getInputField(),"compositionupdate",Y.state.placeholderCompose),ge(Y);var x=Y.getWrapperElement();x.className=x.className.replace(" CodeMirror-empty","")}D&&!Y.hasFocus()&&he(Y)});function ge(Y){Y.state.placeholder&&(Y.state.placeholder.parentNode.removeChild(Y.state.placeholder),Y.state.placeholder=null)}function Q(Y){ge(Y);var D=Y.state.placeholder=document.createElement("pre");D.style.cssText="height: 0; overflow: visible",D.style.direction=Y.getOption("direction"),D.className="CodeMirror-placeholder CodeMirror-line-like";var I=Y.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),D.appendChild(I),Y.display.lineSpace.insertBefore(D,Y.display.lineSpace.firstChild)}function fe(Y){setTimeout(function(){var D=!1,I=Y.getInputField();I.nodeName=="TEXTAREA"?D=!I.value:Y.lineCount()==1&&(D=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),D?Q(Y):ge(Y)},20)}function he(Y){B(Y)&&Q(Y)}function ee(Y){var D=Y.getWrapperElement(),I=B(Y);D.className=D.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?Q(Y):ge(Y)}function B(Y){return Y.lineCount()===1&&Y.getLine(0)===""}})},"1eCo":function(ct,ie,g){(function(K){K(g("VrN/"))})(function(K){"use strict";var ge={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},Q={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};K.defineMode("xml",function(fe,he){var ee=fe.indentUnit,B={},Y=he.htmlMode?ge:Q;for(var D in Y)B[D]=Y[D];for(var D in he)B[D]=he[D];var I,y;function x(A,me){function Z(ce){return me.tokenize=ce,ce(A,me)}var N=A.next();if(N=="<")return A.eat("!")?A.eat("[")?A.match("CDATA[")?Z(S("atom","]]>")):null:A.match("--")?Z(S("comment","-->")):A.match("DOCTYPE",!0,!0)?(A.eatWhile(/[\w\._\-]/),Z(M(1))):null:A.eat("?")?(A.eatWhile(/[\w\._\-]/),me.tokenize=S("meta","?>"),"meta"):(I=A.eat("/")?"closeTag":"openTag",me.tokenize=L,"tag bracket");if(N=="&"){var J;return A.eat("#")?A.eat("x")?J=A.eatWhile(/[a-fA-F\d]/)&&A.eat(";"):J=A.eatWhile(/[\d]/)&&A.eat(";"):J=A.eatWhile(/[\w\.\-:]/)&&A.eat(";"),J?"atom":"error"}else return A.eatWhile(/[^&<]/),null}x.isInText=!0;function L(A,me){var Z=A.next();if(Z==">"||Z=="/"&&A.eat(">"))return me.tokenize=x,I=Z==">"?"endTag":"selfcloseTag","tag bracket";if(Z=="=")return I="equals",null;if(Z=="<"){me.tokenize=x,me.state=O,me.tagName=me.tagStart=null;var N=me.tokenize(A,me);return N?N+" tag error":"tag error"}else return/[\'\"]/.test(Z)?(me.tokenize=w(Z),me.stringStartCol=A.column(),me.tokenize(A,me)):(A.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(A){var me=function(Z,N){for(;!Z.eol();)if(Z.next()==A){N.tokenize=L;break}return"string"};return me.isInAttribute=!0,me}function S(A,me){return function(Z,N){for(;!Z.eol();){if(Z.match(me)){N.tokenize=x;break}Z.next()}return A}}function M(A){return function(me,Z){for(var N;(N=me.next())!=null;){if(N=="<")return Z.tokenize=M(A+1),Z.tokenize(me,Z);if(N==">")if(A==1){Z.tokenize=x;break}else return Z.tokenize=M(A-1),Z.tokenize(me,Z)}return"meta"}}function m(A,me,Z){this.prev=A.context,this.tagName=me,this.indent=A.indented,this.startOfLine=Z,(B.doNotIndent.hasOwnProperty(me)||A.context&&A.context.noIndent)&&(this.noIndent=!0)}function v(A){A.context&&(A.context=A.context.prev)}function T(A,me){for(var Z;;){if(!A.context)return;if(Z=A.context.tagName,!B.contextGrabbers.hasOwnProperty(Z)||!B.contextGrabbers[Z].hasOwnProperty(me))return;v(A)}}function O(A,me,Z){return A=="openTag"?(Z.tagStart=me.column(),se):A=="closeTag"?te:O}function se(A,me,Z){return A=="word"?(Z.tagName=me.current(),y="tag",ne):B.allowMissingTagName&&A=="endTag"?(y="tag bracket",ne(A,me,Z)):(y="error",se)}function te(A,me,Z){if(A=="word"){var N=me.current();return Z.context&&Z.context.tagName!=N&&B.implicitlyClosed.hasOwnProperty(Z.context.tagName)&&v(Z),Z.context&&Z.context.tagName==N||B.matchClosing===!1?(y="tag",ue):(y="tag error",ke)}else return B.allowMissingTagName&&A=="endTag"?(y="tag bracket",ue(A,me,Z)):(y="error",ke)}function ue(A,me,Z){return A!="endTag"?(y="error",ue):(v(Z),O)}function ke(A,me,Z){return y="error",ue(A,me,Z)}function ne(A,me,Z){if(A=="word")return y="attribute",xe;if(A=="endTag"||A=="selfcloseTag"){var N=Z.tagName,J=Z.tagStart;return Z.tagName=Z.tagStart=null,A=="selfcloseTag"||B.autoSelfClosers.hasOwnProperty(N)?T(Z,N):(T(Z,N),Z.context=new m(Z,N,J==Z.indented)),O}return y="error",ne}function xe(A,me,Z){return A=="equals"?Fe:(B.allowMissing||(y="error"),ne(A,me,Z))}function Fe(A,me,Z){return A=="string"?re:A=="word"&&B.allowUnquoted?(y="string",ne):(y="error",ne(A,me,Z))}function re(A,me,Z){return A=="string"?re:ne(A,me,Z)}return{startState:function(A){var me={tokenize:x,state:O,indented:A||0,tagName:null,tagStart:null,context:null};return A!=null&&(me.baseIndent=A),me},token:function(A,me){if(!me.tagName&&A.sol()&&(me.indented=A.indentation()),A.eatSpace())return null;I=null;var Z=me.tokenize(A,me);return(Z||I)&&Z!="comment"&&(y=null,me.state=me.state(I||Z,A,me),y&&(Z=y=="error"?Z+" error":y)),Z},indent:function(A,me,Z){var N=A.context;if(A.tokenize.isInAttribute)return A.tagStart==A.indented?A.stringStartCol+1:A.indented+ee;if(N&&N.noIndent)return K.Pass;if(A.tokenize!=L&&A.tokenize!=x)return Z?Z.match(/^(\s*)/)[0].length:0;if(A.tagName)return B.multilineTagIndentPastTag!==!1?A.tagStart+A.tagName.length+2:A.tagStart+ee*(B.multilineTagIndentFactor||1);if(B.alignCDATA&&/<!\[CDATA\[/.test(me))return 0;var J=me&&/^<(\/)?([\w_:\.-]*)/.exec(me);if(J&&J[1])for(;N;)if(N.tagName==J[2]){N=N.prev;break}else if(B.implicitlyClosed.hasOwnProperty(N.tagName))N=N.prev;else break;else if(J)for(;N;){var ce=B.contextGrabbers[N.tagName];if(ce&&ce.hasOwnProperty(J[2]))N=N.prev;else break}for(;N&&N.prev&&!N.startOfLine;)N=N.prev;return N?N.indent+ee:A.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:B.htmlMode?"html":"xml",helperType:B.htmlMode?"html":"xml",skipAttribute:function(A){A.state==Fe&&(A.state=ne)},xmlCurrentTag:function(A){return A.tagName?{name:A.tagName,close:A.type=="closeTag"}:null},xmlCurrentContext:function(A){for(var me=[],Z=A.context;Z;Z=Z.prev)Z.tagName&&me.push(Z.tagName);return me.reverse()}}}),K.defineMIME("text/xml","xml"),K.defineMIME("application/xml","xml"),K.mimeModes.hasOwnProperty("text/html")||K.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return Q});var K=g("JYp7"),ge=function(){function fe(he){this.element=he,this.next=fe.Undefined,this.prev=fe.Undefined}return fe.Undefined=new fe(void 0),fe}(),Q=function(){function fe(){this._first=ge.Undefined,this._last=ge.Undefined,this._size=0}return Object.defineProperty(fe.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),fe.prototype.isEmpty=function(){return this._first===ge.Undefined},fe.prototype.clear=function(){this._first=ge.Undefined,this._last=ge.Undefined,this._size=0},fe.prototype.unshift=function(he){return this._insert(he,!1)},fe.prototype.push=function(he){return this._insert(he,!0)},fe.prototype._insert=function(he,ee){var B=this,Y=new ge(he);if(this._first===ge.Undefined)this._first=Y,this._last=Y;else if(ee){var D=this._last;this._last=Y,Y.prev=D,D.next=Y}else{var I=this._first;this._first=Y,Y.next=I,I.prev=Y}this._size+=1;var y=!1;return function(){y||(y=!0,B._remove(Y))}},fe.prototype.shift=function(){if(this._first===ge.Undefined)return;var he=this._first.element;return this._remove(this._first),he},fe.prototype.pop=function(){if(this._last===ge.Undefined)return;var he=this._last.element;return this._remove(this._last),he},fe.prototype._remove=function(he){if(he.prev!==ge.Undefined&&he.next!==ge.Undefined){var ee=he.prev;ee.next=he.next,he.next.prev=ee}else he.prev===ge.Undefined&&he.next===ge.Undefined?(this._first=ge.Undefined,this._last=ge.Undefined):he.next===ge.Undefined?(this._last=this._last.prev,this._last.next=ge.Undefined):he.prev===ge.Undefined&&(this._first=this._first.next,this._first.prev=ge.Undefined);this._size-=1},fe.prototype.iterator=function(){var he,ee=this._first;return{next:function(){return ee===ge.Undefined?K.c:(he?he.value=ee.element:he={done:!1,value:ee.element},ee=ee.next,he)}}},fe.prototype.toArray=function(){for(var he=[],ee=this._first;ee!==ge.Undefined;ee=ee.next)he.push(ee.element);return he},fe}()},"389U":function(ct,ie,g){"use strict";g.r(ie);var K=g("+L6B"),ge=g("2/Rp"),Q=g("oBTY"),fe=g("giR+"),he=g("fyUT"),ee=g("5Dmo"),B=g("3S7+"),Y=g("sRBo"),D=g("kaz8"),I=g("2qtc"),y=g("kLXV"),x=g("miYZ"),L=g("tsqr"),w=g("k1fw"),S=g("9og8"),M=g("tJVT"),m=g("PpiC"),v=g("5NDa"),T=g("5rEg"),O=g("OaEy"),se=g("2fM7"),te=g("WmNS"),ue=g.n(te),ke=g("q1tI"),ne=g.n(ke),xe=g("9kvl"),Fe=g("Ot1p"),re=g("HBuW"),A=g("LvDl"),me=g.n(A),Z=g("bNIU"),N=g.n(Z),J=g("9ZNV"),ce=g("fnXi"),$=g("nuEh"),ye=g("UqFu"),_=se.a.Option,b=T.a.TextArea,q=function(Se){var tt=Se.shixunsDetail,Qe=Se.dispatch,je=Se.match,Ue=Se.practiceSetting,Oe=Object(m.a)(Se,["shixunsDetail","dispatch","match","practiceSetting"]),Pe=Object(ke.useState)({}),ae=Object(M.a)(Pe,2),z=ae[0],We=ae[1],nt=Object(ke.useState)([]),it=Object(M.a)(nt,2),Ye=it[0],F=it[1],U=Object(ke.useState)(!1),de=Object(M.a)(U,2),we=de[0],Me=de[1],De=Object(ke.useRef)(null),Be=Object(ke.useRef)({editData:null,answerList:null}),He=Object(ke.useState)(!0),dt=Object(M.a)(He,2),Ze=dt[0],Je=dt[1];Object(ke.useEffect)(function(){Ve()},[]),Object(ke.useEffect)(function(){be()},[z,Ye]);var Ve=function(){var Ce=Object(S.a)(ue.a.mark(function Le(){return ue.a.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return Je(!0),j.next=3,yt();case 3:return j.next=5,mt();case 5:Je(!1);case 6:case"end":return j.stop()}},Le)}));return function(){return Ce.apply(this,arguments)}}(),yt=function(){var Ce=Object(S.a)(ue.a.mark(function Le(){var X;return ue.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(re.G)({id:je.params.id,challengeId:je.params.challengesId,tab:2});case 2:X=V.sent,Be.current.editData=X,X&&We(X);case 5:case"end":return V.stop()}},Le)}));return function(){return Ce.apply(this,arguments)}}(),mt=function(){var Ce=Object(S.a)(ue.a.mark(function Le(){var X,j;return ue.a.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,Object(re.H)({id:je.params.id,challengeId:je.params.challengesId});case 2:X=E.sent,j=X.map(function(k){return Object(w.a)(Object(w.a)({},k),{},{contents:Object(ye.a)(k.contents)})}),Be.current.answerList=j,X&&F(j);case 6:case"end":return E.stop()}},Le)}));return function(){return Ce.apply(this,arguments)}}(),lt=function(){var Ce=Object(S.a)(ue.a.mark(function Le(){var X,j,V;return ue.a.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(Me(!0),X=Ye.map(function(R){return R.score}),j=X.reduce(function(R,W){return R+W},0),!(j>100&&Ye!==null&&Ye!==void 0&&Ye.length)){k.next=7;break}return Me(!1),L.b.info("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E100"),k.abrupt("return");case 7:if(Ye.every(function(R){return R.name})){k.next=11;break}return Me(!1),L.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u540D\u79F0"),k.abrupt("return");case 11:if(Ye.every(function(R){return R.contents})){k.next=15;break}return Me(!1),L.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u5185\u5BB9"),k.abrupt("return");case 15:return k.next=17,Object(re.Kb)({id:je.params.id,challengeId:je.params.challengesId,challenge_answer:Ye,hide_answer:z==null?void 0:z.hide_answer,disable_copy:z==null?void 0:z.disable_copy});case 17:V=k.sent,Me(!1),Qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),V!=null&&V.message&&L.b.info(V.message),V.status===1&&xe.d.push("/shixuns/".concat(je.params.id,"/edit/").concat(je.params.challengesId,"/tab=4"));case 22:case"end":return k.stop()}},Le)}));return function(){return Ce.apply(this,arguments)}}(),be=function(){clearTimeout(De.current),De.current=setTimeout($e,500)},$e=function(){!Object(A.isEqual)(Be.current.editData,z)||!Object(A.isEqual)(Be.current.answerList,Ye)?Qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):Qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},at=function(){var Le,X=function(){xe.d.push("/shixuns/".concat(je.params.id,"/challenges")),Qe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Ue!=null&&(Le=Ue.sideBar)!==null&&Le!==void 0&&Le.confirmLeave?y.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(){X()}}):X()};return ne.a.createElement("section",{className:N.a.bg},ne.a.createElement("div",{className:N.a.formWrap},ne.a.createElement(ce.a,{activeIndex:2}),ne.a.createElement("div",{className:N.a.check},ne.a.createElement("div",null,ne.a.createElement(D.a,{checked:z==null?void 0:z.hide_answer,onChange:function(Le){return We(Object(w.a)(Object(w.a)({},z),{},{hide_answer:Le.target.checked}))}},"\u9690\u85CF\u53C2\u8003\u7B54\u6848\u6A21\u5757")),ne.a.createElement("div",null,ne.a.createElement(D.a,{checked:z==null?void 0:z.disable_copy,onChange:function(Le){return We(Object(w.a)(Object(w.a)({},z),{},{disable_copy:Le.target.checked}))}},"\u7981\u6B62\u590D\u5236\u53C2\u8003\u7B54\u6848"))),ne.a.createElement("div",{className:N.a.fieldWrap},ne.a.createElement("p",null,"\u53EF\u4EE5\u5C06\u53C2\u8003\u7B54\u6848\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),ne.a.createElement("p",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),ne.a.createElement("p",null,"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002"),Ye==null?void 0:Ye.map(function(Ce,Le){return ne.a.createElement("div",{key:Le,className:"mt30 pb5"},ne.a.createElement("div",{className:N.a.flexRow},ne.a.createElement("b",{className:"font16"},"\u7EA7\u522B\uFF1A",Le+1),ne.a.createElement("div",{className:"tr flex1"},ne.a.createElement(B.a,{placement:"bottom",title:"\u5220\u9664"},ne.a.createElement("span",{className:"font14 c-red current",onClick:function(){var j=Ye.filter(function(k,R){return R!==Le}),V=Math.floor(100/j.length),E=V+100%j.length;j=j.map(function(k,R){return R===j.length-1?Object(w.a)(Object(w.a)({},k),{},{score:E}):Object(w.a)(Object(w.a)({},k),{},{score:V})}),F(j)}},"\u5220\xA0\u9664")))),ne.a.createElement("div",{className:N.a.contentWrap},ne.a.createElement("div",{className:N.a.flexRow},ne.a.createElement("div",null,ne.a.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),ne.a.createElement(T.a,{bordered:!1,value:Ce.name,onChange:function(j){var V=Ye.map(function(E,k){return k===Le?Object(w.a)(Object(w.a)({},E),{},{name:j.target.value}):E});F(V)}})),ne.a.createElement("div",{className:"ml10"},ne.a.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),ne.a.createElement(he.a,{min:0,max:100,value:Ce.score,onChange:function(j){var V=Ye.map(function(E,k){return k===Le?Object(w.a)(Object(w.a)({},E),{},{score:j}):E});F(V)}})))),ne.a.createElement("div",{className:"mt10 mb10"},ne.a.createElement("div",{className:"font16 mb20"},"\u5185\u5BB9\uFF1A"),ne.a.createElement(Fe.a,{placeholder:"\u5EFA\u8BAE\u63D0\u4F9B\u5305\u62EC\u6587\u4EF6\u6240\u6709\u4EE3\u7801\u7684\u5B8C\u6574\u7B54\u6848",defaultValue:Ce.contents,onChange:function(j){var V=Ye.map(function(E,k){return k===Le?Object(w.a)(Object(w.a)({},E),{},{contents:j}):E});F(V)}})))}),ne.a.createElement("div",null,ne.a.createElement(ge.a,{type:"primary",size:"large",ghost:!0,style:{width:200},className:"mt10",onClick:function(){var Le=[].concat(Object(Q.a)(Ye),[{name:"\u89E3\u9898\u601D\u8DEF".concat(Ye.length+1),contents:"",score:0,id:null,level:null}]),X=Math.floor(100/Le.length),j=X+100%Le.length;Le=Le.map(function(V,E){return E===Le.length-1?Object(w.a)(Object(w.a)({},V),{},{score:j}):Object(w.a)(Object(w.a)({},V),{},{score:X})}),F(Le)}},"\u65B0\u589E\u53C2\u8003\u7B54\u6848")))),ne.a.createElement(J.a,{onOk:lt,className:"customFixedButton",onCancel:at,loading:we}),ne.a.createElement($.a,{loading:Ze}))};ie.default=Object(xe.a)(function(Ee){var Se=Ee.shixunsDetail,tt=Ee.newCourse,Qe=Ee.globalSetting,je=Ee.practiceSetting;return{shixunsDetail:Se,newCourse:tt,globalSetting:Qe,practiceSetting:je}})(q)},"746U":function(ct,ie,g){"use strict";g.d(ie,"d",function(){return ge}),g.d(ie,"j",function(){return Q}),g.d(ie,"i",function(){return fe}),g.d(ie,"h",function(){return he}),g.d(ie,"e",function(){return ee}),g.d(ie,"k",function(){return B}),g.d(ie,"l",function(){return Y}),g.d(ie,"a",function(){return D}),g.d(ie,"f",function(){return y}),g.d(ie,"g",function(){return x}),g.d(ie,"m",function(){return L}),g.d(ie,"c",function(){return M}),g.d(ie,"b",function(){return m}),g.d(ie,"n",function(){return v}),g.d(ie,"o",function(){return T});var K={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function ge(O){return Array.isArray?Array.isArray(O):!!(O&&typeof O.length===K.number&&O.constructor===Array)}function Q(O){return typeof O===K.string||O instanceof String}function fe(O){return typeof O===K.object&&O!==null&&!Array.isArray(O)&&!(O instanceof RegExp)&&!(O instanceof Date)}function he(O){return(typeof O===K.number||O instanceof Number)&&!isNaN(O)}function ee(O){return O===!0||O===!1}function B(O){return typeof O===K.undefined}function Y(O){return B(O)||O===null}function D(O,se){if(!O)throw new Error(se?"Unexpected type, expected '"+se+"'":"Unexpected type")}var I=Object.prototype.hasOwnProperty;function y(O){if(!fe(O))return!1;for(var se in O)if(I.call(O,se))return!1;return!0}function x(O){return typeof O===K.function}function L(O,se){for(var te=Math.min(O.length,se.length),ue=0;ue<te;ue++)w(O[ue],se[ue])}function w(O,se){if(Q(se)){if(typeof O!==se)throw new Error("argument does not match constraint: typeof "+se)}else if(x(se)){try{if(O instanceof se)return}catch(te){}if(!Y(O)&&O.constructor===se)return;if(se.length===1&&se.call(void 0,O)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function S(O){for(var se=[],te=Object.getPrototypeOf(O);Object.prototype!==te;)se=se.concat(Object.getOwnPropertyNames(te)),te=Object.getPrototypeOf(te);return se}function M(O){for(var se=[],te=0,ue=S(O);te<ue.length;te++){var ke=ue[te];typeof O[ke]=="function"&&se.push(ke)}return se}function m(O,se){for(var te=function(Fe){return function(){var re=Array.prototype.slice.call(arguments,0);return se(Fe,re)}},ue={},ke=0,ne=O;ke<ne.length;ke++){var xe=ne[ke];ue[xe]=te(xe)}return ue}function v(O){return O===null?void 0:O}function T(O){return typeof O=="undefined"?null:O}},"7Cbv":function(ct,ie,g){"use strict";var K=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ge=new Uint8Array(16);function Q(){if(!K)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K(ge)}var fe=/^(?:[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 he(L){return typeof L=="string"&&fe.test(L)}for(var ee=he,B=[],Y=0;Y<256;++Y)B.push((Y+256).toString(16).substr(1));function D(L){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=(B[L[w+0]]+B[L[w+1]]+B[L[w+2]]+B[L[w+3]]+"-"+B[L[w+4]]+B[L[w+5]]+"-"+B[L[w+6]]+B[L[w+7]]+"-"+B[L[w+8]]+B[L[w+9]]+"-"+B[L[w+10]]+B[L[w+11]]+B[L[w+12]]+B[L[w+13]]+B[L[w+14]]+B[L[w+15]]).toLowerCase();if(!ee(S))throw TypeError("Stringified UUID is invalid");return S}var I=D;function y(L,w,S){L=L||{};var M=L.random||(L.rng||Q)();if(M[6]=M[6]&15|64,M[8]=M[8]&63|128,w){S=S||0;for(var m=0;m<16;++m)w[S+m]=M[m];return w}return I(M)}var x=ie.a=y},"7ahc":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return se});var K=g("k1fw"),ge=g("0Owb"),Q=g("+L6B"),fe=g("2/Rp"),he=g("y8nQ"),ee=g("Vl3Y"),B=g("tJVT"),Y=g("OaEy"),D=g("2fM7"),I=g("q1tI"),y=g.n(I),x=g("VrN/"),L=g.n(x),w=g("p77/"),S=g.n(w),M=g("c5Ni"),m=g.n(M),v=D.a.Option,T={labelCol:{span:4},wrapperCol:{span:20}},O={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"]};ie.b=function(te){var ue=te.callback,ke=te.onCancel,ne=Object(I.useState)("python"),xe=Object(B.a)(ne,2),Fe=xe[0],re=xe[1];function A(Z){re(O[Z][1])}function me(Z){ue(Z)}return y.a.createElement(ee.a,Object(ge.a)({},T,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:me}),y.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(D.a,{onChange:A},Object.keys(O).map(function(Z){return y.a.createElement(v,{key:Z,value:Z},O[Z][0])}))),y.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(se,{mode:Fe})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(fe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(fe.a,{type:"ghost",onClick:ke},"\u53D6\u6D88")))};function se(te){var ue=te.value,ke=te.onChange,ne=te.mode,xe=te.options,Fe=xe===void 0?{}:xe,re=Object(I.useRef)(),A=Object(I.useState)(),me=Object(B.a)(A,2),Z=me[0],N=me[1];return Object(I.useEffect)(function(){if(Z){function J(ce){var $=ce.getValue();ke&&ke($)}return Z.on("change",J),function(){Z.off("change",J)}}},[Z,ke]),Object(I.useEffect)(function(){Z&&Z.setOption("mode",ne)},[Z,ne]),Object(I.useEffect)(function(){Z&&((ue!==Z.getValue()||ue==="")&&setTimeout(function(){Z.setValue(ue||" ")},300))},[Z,ue]),Object(I.useEffect)(function(){if(re.current&&!Z){var J=L.a.fromTextArea(re.current,Object(K.a)({mode:ne,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Fe));N(J)}},[re.current,Z]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:re}))}},"7ixt":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return Q});var K={adjustX:1,adjustY:1},ge=[0,0],Q={left:{points:["cr","cl"],overflow:K,offset:[-4,0],targetOffset:ge},right:{points:["cl","cr"],overflow:K,offset:[4,0],targetOffset:ge},top:{points:["bc","tc"],overflow:K,offset:[0,-4],targetOffset:ge},bottom:{points:["tc","bc"],overflow:K,offset:[0,4],targetOffset:ge},topLeft:{points:["bl","tl"],overflow:K,offset:[0,-4],targetOffset:ge},leftTop:{points:["tr","tl"],overflow:K,offset:[-4,0],targetOffset:ge},topRight:{points:["br","tr"],overflow:K,offset:[0,-4],targetOffset:ge},rightTop:{points:["tl","tr"],overflow:K,offset:[4,0],targetOffset:ge},bottomRight:{points:["tr","br"],overflow:K,offset:[0,4],targetOffset:ge},rightBottom:{points:["bl","br"],overflow:K,offset:[4,0],targetOffset:ge},bottomLeft:{points:["tl","bl"],overflow:K,offset:[0,4],targetOffset:ge},leftBottom:{points:["br","bl"],overflow:K,offset:[-4,0],targetOffset:ge}},fe=Q},"8EBN":function(ct,ie,g){(function(K){K(g("VrN/"))})(function(K){"use strict";K.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ge=0;ge<K.modeInfo.length;ge++){var Q=K.modeInfo[ge];Q.mimes&&(Q.mime=Q.mimes[0])}K.findModeByMIME=function(fe){fe=fe.toLowerCase();for(var he=0;he<K.modeInfo.length;he++){var ee=K.modeInfo[he];if(ee.mime==fe)return ee;if(ee.mimes){for(var B=0;B<ee.mimes.length;B++)if(ee.mimes[B]==fe)return ee}}if(/\+xml$/.test(fe))return K.findModeByMIME("application/xml");if(/\+json$/.test(fe))return K.findModeByMIME("application/json")},K.findModeByExtension=function(fe){fe=fe.toLowerCase();for(var he=0;he<K.modeInfo.length;he++){var ee=K.modeInfo[he];if(ee.ext){for(var B=0;B<ee.ext.length;B++)if(ee.ext[B]==fe)return ee}}},K.findModeByFileName=function(fe){for(var he=0;he<K.modeInfo.length;he++){var ee=K.modeInfo[he];if(ee.file&&ee.file.test(fe))return ee}var B=fe.lastIndexOf("."),Y=B>-1&&fe.substring(B+1,fe.length);if(Y)return K.findModeByExtension(Y)},K.findModeByName=function(fe){fe=fe.toLowerCase();for(var he=0;he<K.modeInfo.length;he++){var ee=K.modeInfo[he];if(ee.name.toLowerCase()==fe)return ee;if(ee.alias){for(var B=0;B<ee.alias.length;B++)if(ee.alias[B].toLowerCase()==fe)return ee}}}})},"8HAY":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return ee}),g.d(ie,"b",function(){return B});var K=g("pmY6"),ge=g("MI8n"),Q=function(){var Y=function(D,I){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,x){y.__proto__=x}||function(y,x){for(var L in x)x.hasOwnProperty(L)&&(y[L]=x[L])},Y(D,I)};return function(D,I){Y(D,I);function y(){this.constructor=D}D.prototype=I===null?Object.create(I):(y.prototype=I.prototype,new y)}}(),fe=function(Y,D,I,y){function x(L){return L instanceof I?L:new I(function(w){w(L)})}return new(I||(I=Promise))(function(L,w){function S(v){try{m(y.next(v))}catch(T){w(T)}}function M(v){try{m(y.throw(v))}catch(T){w(T)}}function m(v){v.done?L(v.value):x(v.value).then(S,M)}m((y=y.apply(Y,D||[])).next())})},he=function(Y,D){var I={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},y,x,L,w;return w={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function S(m){return function(v){return M([m,v])}}function M(m){if(y)throw new TypeError("Generator is already executing.");for(;I;)try{if(y=1,x&&(L=m[0]&2?x.return:m[0]?x.throw||((L=x.return)&&L.call(x),0):x.next)&&!(L=L.call(x,m[1])).done)return L;(x=0,L)&&(m=[m[0]&2,L.value]);switch(m[0]){case 0:case 1:L=m;break;case 4:return I.label++,{value:m[1],done:!1};case 5:I.label++,x=m[1],m=[0];continue;case 7:m=I.ops.pop(),I.trys.pop();continue;default:if(!(L=I.trys,L=L.length>0&&L[L.length-1])&&(m[0]===6||m[0]===2)){I=0;continue}if(m[0]===3&&(!L||m[1]>L[0]&&m[1]<L[3])){I.label=m[1];break}if(m[0]===6&&I.label<L[1]){I.label=L[1],L=m;break}if(L&&I.label<L[2]){I.label=L[2],I.ops.push(m);break}L[2]&&I.ops.pop(),I.trys.pop();continue}m=D.call(Y,I)}catch(v){m=[6,v],x=0}finally{y=L=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},ee=function(Y){Q(D,Y);function D(I,y,x,L,w){y===void 0&&(y=""),x===void 0&&(x=""),L===void 0&&(L=!0);var S=Y.call(this)||this;return S._onDidChange=S._register(new ge.a),S.onDidChange=S._onDidChange.event,S._enabled=!0,S._checked=!1,S._id=I,S._label=y,S._cssClass=x,S._enabled=L,S._actionCallback=w,S}return Object.defineProperty(D.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(D.prototype,"label",{get:function(){return this._label},set:function(I){this._setLabel(I)},enumerable:!0,configurable:!0}),D.prototype._setLabel=function(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))},Object.defineProperty(D.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(I){this._setTooltip(I)},enumerable:!0,configurable:!0}),D.prototype._setTooltip=function(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))},Object.defineProperty(D.prototype,"class",{get:function(){return this._cssClass},set:function(I){this._setClass(I)},enumerable:!0,configurable:!0}),D.prototype._setClass=function(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))},Object.defineProperty(D.prototype,"enabled",{get:function(){return this._enabled},set:function(I){this._setEnabled(I)},enumerable:!0,configurable:!0}),D.prototype._setEnabled=function(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))},Object.defineProperty(D.prototype,"checked",{get:function(){return this._checked},set:function(I){this._setChecked(I)},enumerable:!0,configurable:!0}),D.prototype._setChecked=function(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))},D.prototype.run=function(I,y){return this._actionCallback?this._actionCallback(I):Promise.resolve(!0)},D}(K.a),B=function(Y){Q(D,Y);function D(){var I=Y!==null&&Y.apply(this,arguments)||this;return I._onDidBeforeRun=I._register(new ge.a),I.onDidBeforeRun=I._onDidBeforeRun.event,I._onDidRun=I._register(new ge.a),I.onDidRun=I._onDidRun.event,I}return D.prototype.run=function(I,y){return fe(this,void 0,void 0,function(){var x,L;return he(this,function(w){switch(w.label){case 0:if(!I.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:I}),w.label=1;case 1:return w.trys.push([1,3,,4]),[4,this.runAction(I,y)];case 2:return x=w.sent(),this._onDidRun.fire({action:I,result:x}),[3,4];case 3:return L=w.sent(),this._onDidRun.fire({action:I,error:L}),[3,4];case 4:return[2]}})})},D.prototype.runAction=function(I,y){var x=y?I.run(y):I.run();return Promise.resolve(x)},D}(K.a)},"8hTe":function(ct,ie,g){ct.exports={button:"button___1wy9m"}},"93VE":function(ct,ie,g){},"9Bee":function(ct,ie,g){"use strict";var K=g("DYRE"),ge=g("zeV3"),Q=g("+L6B"),fe=g("2/Rp"),he=g("k1fw"),ee=g("9og8"),B=g("tJVT"),Y=g("WmNS"),D=g.n(Y),I=g("q1tI"),y=g.n(I),x=g("vg9a"),L=g("DlQD"),w=g.n(L),S=g("rUJ1");function M(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 G=Object(B.a)(c,1),Ae=G[0];return Ae.length>=u.length?d.slice(u.length):d}).join(`
|
|
`)}var m=[],v=["<ul>"],T=new w.a.Renderer,O=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function se(){m.length=0,v=["<ul>"]}var te={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ue(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=ue(h,o,d.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(G){u.push(G)}),u.push("</ul>")),u.push("</li>"),o=ue(h,o,a,u),o}function ke(){return ue(m,0,0,v),v.push("</ul>"),v.join("")}var ne={heading:function(o){var a=O.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=M(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var G=re(),Ae=d;d=G,A[G]={type:"block",expression:Ae}}return{type:"code",raw:u,lang:c,text:d}}}},xe=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Fe=0,re=function(){return"__special_katext_id_".concat(Fe++,"__")},A={};function me(){return A}function Z(){Fe=0,A={}}function N(h){return h=h.replace(xe,function(o,a){var u=re();return A[u]={type:"inline",expression:a},u}),h}var J=T.listitem;T.listitem=function(h){return J(N(h))};var ce=T.paragraph;T.paragraph=function(h){return ce(N(h))};var $=T.tablecell;T.tablecell=function(h,o){return $(N(h),o)},T.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(S.escape)(h,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(S.escape)(h,!0))+"</code></pre>"},T.heading=function(h,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:u,level:o,text:h}),"<h"+o+' id="'+u+'">'+h+"</h"+o+">"},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:ne,renderer:T});var ye=w.a,_=g("SJMd"),b=g("ulZh"),q=g.n(b),Ee=g("m3rI"),Se=g("Oy/b"),tt=g("p5ED"),Qe=g("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 je=function(h,o){return(je=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 Ue(h,o){function a(){this.constructor=h}je(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Oe(h,o,a,u){return new(a||(a=Promise))(function(d,c){function G(ut){try{Ge(u.next(ut))}catch(Re){c(Re)}}function Ae(ut){try{Ge(u.throw(ut))}catch(Re){c(Re)}}function Ge(ut){var Re;ut.done?d(ut.value):(Re=ut.value,Re instanceof a?Re:new a(function(kt){kt(Re)})).then(G,Ae)}Ge((u=u.apply(h,o||[])).next())})}function Pe(h,o){var a,u,d,c,G={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return c={next:Ae(0),throw:Ae(1),return:Ae(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ae(Ge){return function(ut){return function(Re){if(a)throw new TypeError("Generator is already executing.");for(;G;)try{if(a=1,u&&(d=2&Re[0]?u.return:Re[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Re[1])).done)return d;switch(u=0,d&&(Re=[2&Re[0],d.value]),Re[0]){case 0:case 1:d=Re;break;case 4:return G.label++,{value:Re[1],done:!1};case 5:G.label++,u=Re[1],Re=[0];continue;case 7:Re=G.ops.pop(),G.trys.pop();continue;default:if(!(d=G.trys,(d=d.length>0&&d[d.length-1])||Re[0]!==6&&Re[0]!==2)){G=0;continue}if(Re[0]===3&&(!d||Re[1]>d[0]&&Re[1]<d[3])){G.label=Re[1];break}if(Re[0]===6&&G.label<d[1]){G.label=d[1],d=Re;break}if(d&&G.label<d[2]){G.label=d[2],G.ops.push(Re);break}d[2]&&G.ops.pop(),G.trys.pop();continue}Re=o.call(h,G)}catch(kt){Re=[6,kt],u=0}finally{a=d=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([Ge,ut])}}}function ae(){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],G=0,Ae=c.length;G<Ae;G++,d++)u[d]=c[G];return u}var z=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],G=c[0],Ae=c[1];o.setAttribute(G,Ae)}},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 G=document.createElementNS("http://www.w3.org/2000/svg","line");return G.setAttribute("x1",o.toString()),G.setAttribute("y1",a.toString()),G.setAttribute("x2",u.toString()),G.setAttribute("y2",d.toString()),c&&h.setAttributes(G,c),G},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,G,Ae){var Ge=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(Ge,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",c.toString()],["refY",G.toString()]]),Ge.appendChild(Ae),Ge},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}(),We=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}(),nt=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 G=u!==void 0?u:document.createElement("canvas");o===null&&(d.markersOnly=!0,d.naturalSize=!1);var Ae=document.createElementNS("http://www.w3.org/2000/svg","svg");Ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ae.setAttribute("width",a.width.baseVal.valueAsString),Ae.setAttribute("height",a.height.baseVal.valueAsString),Ae.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ae.innerHTML=a.innerHTML,d.naturalSize===!0?(Ae.width.baseVal.value=o.naturalWidth,Ae.height.baseVal.value=o.naturalHeight):d.width!==void 0&&d.height!==void 0&&(Ae.width.baseVal.value=d.width,Ae.height.baseVal.value=d.height),G.width=Ae.width.baseVal.value,G.height=Ae.height.baseVal.value;var Ge=Ae.outerHTML,ut=G.getContext("2d");d.markersOnly!==!0&&ut.drawImage(o,0,0,G.width,G.height);var Re=window.URL,kt=new Image(G.width,G.height);kt.setAttribute("crossOrigin","anonymous");var Nt=new Blob([Ge],{type:"image/svg+xml"}),en=Re.createObjectURL(Nt);kt.onload=function(){ut.drawImage(kt,0,0),Re.revokeObjectURL(en);var Kn=G.toDataURL(d.imageType,d.imageQuality);c(Kn)},kt.src=en})},h}(),it=function(){},Ye=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 F("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new F("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new F("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new U("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new U("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}(),F=function(h,o){this.selector=h,this.style=o},U=function(h,o){this.localName=h,this.style=o},de=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 G=document.createElement("div");G.className=""+a.toolbarButtonStyleClass.name,G.setAttribute("data-type-name",c.typeName),G.innerHTML=c.icon,G.addEventListener("click",function(){a.markerToolbarButtonClicked(G,c)}),a.buttons.push(G),a.markerButtons.push(G)}),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 U("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 U("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new U("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new U("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 U("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new U("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 U("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new U("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new F("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new F("."+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}(),we=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 U("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 U("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new U("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new U("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new U("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 U("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new U("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 U("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new U("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new F("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new F("."+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 G;c.uiStyleSettings=d.uiStyleSettings;var Ae=document.createElement("div");Ae.className=d.toolboxButtonStyleClass.name+" "+((G=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&G!==void 0?G:d.toolboxButtonStyleColorsClass.name),Ae.innerHTML=c.icon,Ae.title=c.title,Ae.addEventListener("click",function(){d.panelButtonClick(c)}),d.panelButtons.push(Ae),d.buttonRow.appendChild(Ae)}),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,G){var Ae,Ge;c.className=a.toolboxButtonStyleClass.name+" "+(G===u?""+((Ae=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:a.toolboxActiveButtonStyleColorsClass.name):""+((Ge=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:a.toolboxButtonStyleColorsClass.name))})},h}(),Me=function(h,o){this.title=h,this.icon=o},De=function(h){function o(a,u,d,c){var G=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 G.colors=[],G.addTransparent=!1,G.colorBoxes=[],G.colors=u,G.currentColor=d,G.setCurrentColor=G.setCurrentColor.bind(G),G.getColorBox=G.getColorBox.bind(G),G}return Ue(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,G=document.createElement("div");G.style.display="inline-block",G.style.boxSizing="content-box",G.style.width=c-2+"px",G.style.height=c-2+"px",G.style.padding="1px",G.style.marginRight="2px",G.style.marginBottom="2px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderRadius=(c+2)/2+"px",G.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){u.setCurrentColor(a,G)});var Ae=document.createElement("div");return Ae.style.display="inline-block",Ae.style.width=c-2+"px",Ae.style.height=c-2+"px",Ae.style.backgroundColor=a,Ae.style.borderRadius=c/2+"px",a==="transparent"&&(Ae.style.fill=this.uiStyleSettings.toolboxAccentColor,Ae.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>`),G.appendChild(Ae),G},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}(Me),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}(),He=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}(),dt=function(){function h(){this.GRIP_SIZE=10,this.visual=z.createGroup(),this.visual.appendChild(z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(z.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}(),Ze=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}(),Je=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(z.createTransform()),c.setupControlBox(),c}return Ue(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=z.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 G=this.container.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(G,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,G=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,G=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:G=this.manipulationStartHeight+a.y-this.manipulationStartY}d>=0?(this.left=u,this.width=d):(this.left=u+d,this.width=-d),G>=0?(this.top=c,this.height=G):(this.top=c+G,this.height=-G),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=z.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=z.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=z.createGroup();var a=z.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=z.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=z.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 He,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 dt;return a.visual.transform.baseVal.appendItem(z.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,G=(this.height+this.CB_DISTANCE)/2-a/2,Ae=this.height+this.CB_DISTANCE-a/2,Ge=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,Ge,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,G),this.positionGrip(this.controlGrips.centerRight.visual,Ge,G),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ae),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ae),this.positionGrip(this.controlGrips.bottomRight.visual,Ge,Ae),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:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.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(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.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),Ve=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 Ue(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.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),z.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&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.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}(Je),yt=function(h){function o(a,u,d,c){var G=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return G.widths=[],G.widthBoxes=[],G.widths=u,G.currentWidth=d,G.setCurrentWidth=G.setCurrentWidth.bind(G),G}return Ue(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 G=document.createElement("div");G.innerText=d.toString(),G.style.marginRight="5px",c.appendChild(G);var Ae=document.createElement("div");Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.display="flex",Ae.style.alignItems="center";var Ge=document.createElement("hr");Ge.style.minWidth="20px",Ge.style.border="0px",Ge.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,Ge.style.flexGrow="2",Ae.appendChild(Ge),c.appendChild(Ae),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}(Me),mt=function(h){function o(a,u,d,c){var G=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 G.styles=[],G.styleBoxes=[],G.styles=u,G.currentStyle=d,G.setCurrentStyle=G.setCurrentStyle.bind(G),G}return Ue(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 G=document.createElement("div");G.style.minHeight="20px",G.style.flexGrow="2",G.style.overflow="hidden";var Ae=`<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>`;G.innerHTML=Ae,c.appendChild(G),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}(Me),lt=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 De("Line color",d.defaultColorSet,d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new yt("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 Ue(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}(Ve),be=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},$e=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 Ue(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=z.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 dt;return a.visual.transform.baseVal.appendItem(z.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),at=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 De("Line color",d.defaultColorSet,d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new yt("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 Ue(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=z.createGroup(),this.selectorLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=z.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()),z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),z.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}($e),Ce=function(h){function o(a,u,d,c){var G=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 G.fonts=[],G.fontBoxes=[],G.fonts=u,G.currentFont=d,G.setCurrentFont=G.setCurrentFont.bind(G),G}return Ue(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 G=document.createElement("div");G.style.display="flex",G.style.minHeight="20px",G.style.flexGrow="2",G.style.fontFamily=d,G.style.overflow="hidden";var Ae=document.createElement("div");Ae.style.whiteSpace="nowrap",Ae.style.overflow="hidden",Ae.style.textOverflow="ellipsis",Ae.innerHTML="The quick brown fox jumps over the lazy dog",G.appendChild(Ae),c.appendChild(G),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}(Me),Le=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 De("Color",d.defaultColorSet,d.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new Ce("Font",d.defaultFontFamilies,d.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return Ue(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=z.createGroup(),this.bgRectangle=z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.textElement.transform.baseVal.appendItem(z.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(z.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&&(z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.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&&z.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&&z.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}(Je),X=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 De("Color",d.defaultColorSet,d.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new yt("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return Ue(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=z.createGroup(),this.drawingImage=z.createImage(),this.visual.appendChild(this.drawingImage);var a=z.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),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.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],G=u[2],Ae=u[3],Ge=!1,ut=0;ut<this.canvasElement.height;ut++)for(var Re=0;Re<this.canvasElement.width;Re++)a.data[ut*this.canvasElement.width*4+4*Re+3]>0&&(Ge=!0,ut<c&&(c=ut),Re<d&&(d=Re),ut>Ae&&(Ae=ut),Re>G&&(G=Re));if(Ge){this.left=d/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(G-d)/this.pixelRatio,this.height=(Ae-c)/this.pixelRatio;var kt=document.createElement("canvas");kt.width=G-d,kt.height=Ae-c,kt.getContext("2d").putImageData(this.canvasContext.getImageData(d,c,G-d,Ae-c),0,0),this.drawingImgUrl=kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),z.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}(Je),j=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 Ue(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(Ae){var Ge="both";switch(Ae){case 0:Ge="both";break;case 1:Ge="start";break;case 2:Ge="end";break;case 3:Ge="none"}var ut=document.createElement("div");if(ut.style.display="flex",ut.style.flexGrow="2",ut.style.alignItems="center",ut.style.justifyContent="space-between",ut.style.padding="5px",ut.style.borderWidth="2px",ut.style.borderStyle="solid",ut.style.borderColor=Ge===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",ut.addEventListener("click",function(){a.setCurrentType(Ge,ut)}),u.appendChild(ut),Ge==="both"||Ge==="start"){var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.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>`,Re.style.marginLeft="5px",ut.appendChild(Re)}var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.style.flexGrow="2";var Nt=document.createElement("hr");if(Nt.style.minWidth="20px",Nt.style.border="0px",Nt.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),Nt.style.flexGrow="2",kt.appendChild(Nt),ut.appendChild(kt),Ge==="both"||Ge==="end"){var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.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>`,en.style.marginRight="5px",ut.appendChild(en)}c.typeBoxes.push(ut)},c=this,G=0;G<4;G++)d(G);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}(Me),V=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 j("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return Ue(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=z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(z.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",z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),z.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}(at),E=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 De("Color",d.defaultColorSet,d.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return Ue(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}(Ve),k=function(h){function o(a,u,d,c){var G=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 G.opacities=[],G.opacityBoxes=[],G.opacities=u,G.currentOpacity=d,G.setCurrentOpacity=G.setCurrentOpacity.bind(G),G}return Ue(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 G=document.createElement("div");G.innerText=100*d+"%",c.appendChild(G),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}(Me),R=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 De("Color",d.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new k("Opacity",d.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ue(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.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}(E),W='<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>',ve=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 De("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 De("Fill color",d.defaultColorSet,c.bgColor,W),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new Ce("Font",d.defaultFontFamilies,d.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new dt,c.tipGrip.visual.transform.baseVal.appendItem(z.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return Ue(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(){z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=z.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&&(z.setAttributes(this.bgRectangle,[["fill",a]]),z.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(){z.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}(Le),oe=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 De("Line color",ae(d.defaultColorSet,["transparent"]),d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new De("Fill color",ae(d.defaultColorSet,["transparent"]),c.fillColor,W),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new yt("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 k("Opacity",d.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ue(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.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),z.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&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.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}(Je),Ne=function(h){function o(a,u,d){return h.call(this,a,u,d)||this}return Ue(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=z.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(z.createTransform()),this.visual.appendChild(this.tip1),this.tip2=z.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(z.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&&(z.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()]]),z.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}(at),qe=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 Ue(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}(oe),ft=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}(),st=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 De("Line color",d.defaultColorSet,d.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new yt("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 Ue(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=z.createGroup(),this.selectorCurve=z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=z.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()),z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=z.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}($e),_t=function(){function h(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),Lt=function(h){function o(a,u,d){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=d,c}return Ue(o,h),o}(_t),pt=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 Ue(o,h),o}(_t),$t=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}(),jt=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 be,this._isOpen=!1,this.undoRedoManager=new ft,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 $t,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.instanceCounter++,this.styles=new Ye(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[lt,X,V,Le,qe,oe,R,ve,Ne,E,at,st]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[lt,X,V,Le,oe,R,ve]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[lt,X,V,Le,R]},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(),We.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&it.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=it.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new _t(o))})},h.prototype.render=function(){return Oe(this,void 0,void 0,function(){var o;return Pe(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new nt).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 _t(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 _t(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 Le?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=z.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 de(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 we(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 pt(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 pt(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(G){var Ae=new pt(o,void 0,!0);G(Ae),Ae.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(G){var Ae=d.markers[G];d.setCurrentMarker(d.markers[G]),d._currentMarker.dispose(),d.markerImage.removeChild(d._currentMarker.container),d.markers.splice(d.markers.indexOf(d._currentMarker),1),d.eventListeners.markerdelete.forEach(function(Ge){return Ge(new pt(o,Ae))})},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 _t(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new _t(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 _t(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 _t(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 Oe(this,void 0,void 0,function(){var o,a,u=this;return Pe(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 Lt(u,o,a))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},h.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var d=a._availableMarkerTypes.find(function(G){return G.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 _t(a))})},h.prototype.addNewMarker=function(o){var a=z.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 pt(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 X&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(X):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new pt(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 pt(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 pt(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 pt(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){We.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 _t(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 _t(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 Jt=function(h,o){return(Jt=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 Ht(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}Jt(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Mt(h,o,a,u){return new(a||(a=Promise))(function(d,c){function G(ut){try{Ge(u.next(ut))}catch(Re){c(Re)}}function Ae(ut){try{Ge(u.throw(ut))}catch(Re){c(Re)}}function Ge(ut){var Re;ut.done?d(ut.value):(Re=ut.value,Re instanceof a?Re:new a(function(kt){kt(Re)})).then(G,Ae)}Ge((u=u.apply(h,o||[])).next())})}function Un(h,o){var a,u,d,c,G={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return c={next:Ae(0),throw:Ae(1),return:Ae(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ae(Ge){return function(ut){return function(Re){if(a)throw new TypeError("Generator is already executing.");for(;G;)try{if(a=1,u&&(d=2&Re[0]?u.return:Re[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,Re[1])).done)return d;switch(u=0,d&&(Re=[2&Re[0],d.value]),Re[0]){case 0:case 1:d=Re;break;case 4:return G.label++,{value:Re[1],done:!1};case 5:G.label++,u=Re[1],Re=[0];continue;case 7:Re=G.ops.pop(),G.trys.pop();continue;default:if(!(d=G.trys,(d=d.length>0&&d[d.length-1])||Re[0]!==6&&Re[0]!==2)){G=0;continue}if(Re[0]===3&&(!d||Re[1]>d[0]&&Re[1]<d[3])){G.label=Re[1];break}if(Re[0]===6&&G.label<d[1]){G.label=d[1],d=Re;break}if(d&&G.label<d[2]){G.label=d[2],G.ops.push(Re);break}d[2]&&G.ops.pop(),G.trys.pop();continue}Re=o.call(h,G)}catch(kt){Re=[6,kt],u=0}finally{a=d=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([Ge,ut])}}}var Qn=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}(),bt=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],G=c[0],Ae=c[1];o.setAttribute(G,Ae)}},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 G=document.createElementNS("http://www.w3.org/2000/svg","line");return G.setAttribute("x1",o.toString()),G.setAttribute("y1",a.toString()),G.setAttribute("x2",u.toString()),G.setAttribute("y2",d.toString()),c&&h.setAttributes(G,c),G},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,G,Ae){var Ge=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(Ge,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",c.toString()],["refY",G.toString()]]),Ge.appendChild(Ae),Ge},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,G,Ae,Ge){return"M"+o+","+a+"V"+(a+d)+"H"+(o+u)+"V"+a+"H"+c+"V"+G+"H"+(c+Ae)+"V"+(G+Ge)+"H"+c+"V"+a+"Z"},h}(),wt=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 et("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new et("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new et("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new xt("_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}(),et=function(h,o){this.selector=h,this.style=o},xt=function(h,o){this.localName=h,this.style=o},Zt=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}(),rn=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}(),nn=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return Ht(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}(rn),At=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}(),gt=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return Ht(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}(rn),On=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}(),ni=function(){function h(){}return h.getIcon=function(o,a){if(o>0&&a>0){var u=new On(o,a),d=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),G=document.createElementNS("http://www.w3.org/2000/svg","svg");G.setAttribute("xmlns","http://www.w3.org/2000/svg"),G.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(G);var Ae=bt.createDefs();G.appendChild(Ae);var Ge=bt.createElement("clipPath",[["id","text-bg-clip"]]);Ae.appendChild(Ge);var ut=bt.createPath(bt.getHollowRectanglePath((24-d)/2,(24-c)/2,d,c,(24-d)/2+2,(24-c)/2+2,d-4,c-4));G.appendChild(ut);var Re=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Re.appendChild(bt.createTSpan(o+":"+a)),G.appendChild(Re);var kt=Re.getBBox();bt.setAttributes(Re,[["x",((24-kt.width)/2).toString()],["y",((24-kt.height)/2-kt.y).toString()]]);var Nt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(kt.width))/2,(24-Math.ceil(kt.height))/2,Math.ceil(kt.width),Math.ceil(kt.height)));return Ge.appendChild(Nt),bt.setAttributes(ut,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(G),G.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}(),kn=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 Ht(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}(At),Ot=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.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 bt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),_n=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&&bt.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=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(bt.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=bt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(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),bt.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,G){var Ae=a.y+u*(G+1);bt.setAttributes(c,[["x1",""+a.x],["y1",""+Ae],["x2",""+(a.x+a.width)],["y2",""+Ae]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,G){var Ae=a.x+d*(G+1);bt.setAttributes(c,[["x1",""+Ae],["y1",""+a.y],["x2",""+Ae],["y2",""+(a.y+a.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.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,G){var Ae=u/o,Ge=d/a;return{x:(c.x-G)*Ae+G,y:(c.y-G)*Ge+G,width:c.width*Ae,height:c.height*Ge}},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}(),Vn=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();bt.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=bt.createPath(a);var c=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var G=bt.createTSpan("");return G.innerHTML="°",this.angleLabelElement.appendChild(G),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),ii=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,d,c,G,Ae){var Ge=this;return new Promise(function(ut){var Re=document.createElement("canvas");Re.width=o.width.baseVal.value-2*d,Re.height=o.height.baseVal.value-2*d;var kt=1,Nt=1;Ge.naturalSize===!0?(kt=a.naturalWidth/(o.width.baseVal.value-2*d)/G,Nt=a.naturalHeight/(o.height.baseVal.value-2*d)/Ae,Re.width=a.naturalWidth/G,Re.height=a.naturalHeight/Ae):Ge.width!==void 0&&Ge.height!==void 0&&(kt=Ge.width/u.width,Nt=Ge.height/u.height,Re.width*=kt,Re.height*=Nt);var en=Re.getContext("2d");en.translate(Re.width/2,Re.height/2),en.rotate(c*Math.PI/180),en.scale(G,Ae),en.translate(-Re.width/2,-Re.height/2),en.drawImage(a,0,0,Re.width,Re.height);var Kn=document.createElement("canvas");Kn.width=u.width*kt,Kn.height=u.height*Nt,Kn.getContext("2d").putImageData(en.getImageData((u.x-d)*kt,(u.y-d)*Nt,u.width*kt,u.height*Nt),0,0),ut(Kn.toDataURL(Ge.imageType,Ge.imageQuality))})},h}(),_e=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 wt(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",bt.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();bt.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=bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=bt.createGroup(),this.editingTargetRotationScaleContainer=bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=bt.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=bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new _n(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 Zt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new nn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Nt){var en=new At(ni.getIcon(Nt.horizontal,Nt.vertical),Nt.horizontal===0&&Nt.vertical===0?"FREE":Nt.horizontal+":"+Nt.vertical);en.onClick=function(){return o.ratioButtonClicked(Nt)},u.push(en)}),this.aspectRatioButton=new kn(ni.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 At('<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 At('<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),!Qn.isLicensed){var G=new gt;this.topToolbar.addElementBlock(G);var Ae=document.createElement("div");Ae.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ge=document.createElement("a");Ge.style.color="currentColor",Ge.href="https://markerjs.com/products/cropro",Ge.target="_blank",Ge.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>',Ae.appendChild(Ge),G.addElement(Ae)}var ut=new nn;ut.minWidth=3*this.toolbarHeight+"px",ut.contentAlign="end",this.topToolbar.addButtonBlock(ut);var Re=new At('<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");Re.onClick=this.startRenderAndClose,ut.addButton(Re),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Re.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var kt=new At('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");kt.onClick=this.close,ut.addButton(kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Zt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new nn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new At('<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 At('<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 gt;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new Vn("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(ut){o.rotateBy(ut),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var G=new nn;G.minWidth=2*this.toolbarHeight+"px",G.contentAlign="end",this.bottomToolbar.addButtonBlock(G);var Ae=new At('<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");Ae.onClick=this.flipHorizontallyButtonClicked,G.addButton(Ae);var Ge=new At('<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");Ge.onClick=this.flipVerticallyButtonClicked,G.addButton(Ge)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ni.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 On(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 Mt(this,void 0,void 0,function(){var o,a;return Un(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 Mt(this,void 0,void 0,function(){var o;return Un(this,function(a){switch(a.label){case 0:return(o=new ii).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),bt.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 xt("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 xt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("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 xt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new et("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new et("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("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 xt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},h.instanceCounter=0,h}(),rt=g("8hTe"),Rt=g.n(rt),Gt=/<pre[^>]*>/g;function Xt(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var qt=ie.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,d=u===void 0?!1:u,c=h.className,G=h.showTextOnly,Ae=h.showLines,Ge=h.replaces,ut=h.zoomImg,Re=h.hasMask,kt=h.style,Nt=kt===void 0?{}:kt,en=h.stylesPrev,Kn=en===void 0?{}:en,Xn=String(a),mn=Object(I.useRef)(),qn=Object(I.useRef)(),zi=Object(I.useState)(""),Dn=Object(B.a)(zi,2),Yn=Dn[0],Wn=Dn[1],bi=Object(I.useState)("office"),ri=Object(B.a)(bi,2),mi=ri[0],hi=ri[1],cr=function(){var Ut=new _e(qn.current);Ut.displayMode="popup",Ut.addRenderEventListener(function(){var wn=Object(ee.a)(D.a.mark(function Ft(cn){var Vt;return D.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return mn.current.style.display="none",un.next=3,Object(Qe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cn}});case 3:Vt=un.sent,Vt!=null&&Vt.id&&Ge(qn.current.getAttribute("src").replace(Ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return un.stop()}},Ft)}));return function(Ft){return wn.apply(this,arguments)}}()),Ut.show()},Gi=function(){var Ut=new jt(qn.current);Ut.settings.displayMode="popup",Ut.addEventListener("render",function(){var wn=Object(ee.a)(D.a.mark(function Ft(cn){var Vt;return D.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(mn.current.style.display="none",!qn.current){un.next=6;break}return un.next=4,Object(Qe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cn.dataUrl}});case 4:Vt=un.sent,Vt!=null&&Vt.id&&Ge(qn.current.getAttribute("src").replace(Ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return un.stop()}},Ft)}));return function(Ft){return wn.apply(this,arguments)}}()),Ut.show(),window.markerArea=Ut},oi=Object(I.useMemo)(function(){try{var sn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Xn=Xn.replace(sn,"("+Ee.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+Ee.a.API_SERVER+"/api/attachments/").replace(wn,'"'+Ee.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,`
|
|
`),Xn=Xn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(ci){}var Ft=ye(Xn),cn=me();if(Xn.match(/\[TOC\]/)&&(Ft=Ft.replace("<p>[TOC]</p>",ke()),se()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,function(ci,un){var Rn=cn[un],Vi=Rn.type,Ki=Rn.expression;return Object(Se.renderToString)(Xt(Ki)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581"),Z(),G){var Vt=document.createElement("div");return Vt.innerHTML=Ft,Vt.innerText}return setTimeout(function(){return Oi()},500),Ft},[Xn]),$n=Object(I.useRef)();te.WebkitLineClamp=Ae,Ae&&(Nt=Object(he.a)(Object(he.a)({},Nt),te));function Mi(sn){var Ut=sn.target;if(Ut.tagName.toUpperCase()==="IMG"){if(ut){var wn=Ut.getAttribute("src");Wn(wn),hi("image")}}else if(Ut.tagName.toUpperCase()==="A"){var Ft=Ut.getAttribute("href");if(Ft.indexOf("office")>-1)sn.preventDefault(),Wn(Ft),hi("office");else if(Ft.indexOf("application/pdf")>-1)sn.preventDefault(),Wn(Ft),hi("pdf");else if(Ft.indexOf("type=text")>-1)sn.preventDefault(),Wn(Ft),hi("html");else if(Ft.startsWith("#")){sn.preventDefault();var cn=document.getElementById(Ft.replace("#",""));cn&&cn.scrollIntoView(!0)}}}var Oi=function(){var Ut,wn=(Ut=$n.current)===null||Ut===void 0?void 0:Ut.querySelectorAll("video");wn==null||wn.forEach(function(Ft){if(Ft.oncontextmenu=function(){return!1},Ft.src.indexOf(".m3u8")>-1&&!Ft.canPlayType("application/vnd.apple.mpegurl")){if(q.a.isSupported()){var cn=new q.a;cn.loadSource(Ft.src),cn.attachMedia(Ft)}}})};Object(I.useEffect)(function(){if($n.current&&oi&&(oi.match(Gt)&&window.PR.prettyPrint()),$n.current)return $n.current.addEventListener("click",Mi),function(){$n.current.removeEventListener("click",Mi),Z(),se()}},[oi,$n.current,Mi]);var dr=function(Ut){if(!d)return;Ut.target.nodeName==="IMG"?(mn.current.style.display="flex",mn.current.style.width=Ut.target.clientWidth+"px",mn.current.style.height=Ut.target.clientHeight+"px",mn.current.style.top=Ut.target.offsetTop+"px",mn.current.style.left=Ut.target.offsetLeft+"px",qn.current.src=Ut.target.getAttribute("src")):mn.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:$n,style:Object(he.a)({},Nt),className:"".concat(c||""," markdown-body ").concat(Rt.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:oi}}),y.a.createElement("div",{ref:mn,className:Rt.a.button},y.a.createElement(ge.a,null,y.a.createElement(fe.a,{onClick:function(){return cr()}},"\u88C1\u526A"),y.a.createElement(fe.a,{onClick:function(){return Gi()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:qn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),y.a.createElement(tt.a,{close:!0,data:Yn,hasMask:Re,type:Yn!=null&&Yn.length?mi:"",style:Object(he.a)({},Kn),onClose:function(){return Wn("")}}))}},"9VGf":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return Q});var K=g("q1tI"),ge=g.n(K);function Q(fe,he){var ee=Object(K.useRef)();Object(K.useEffect)(function(){ee.current=fe}),Object(K.useEffect)(function(){function B(){ee.current()}if(he!==null){var Y=setInterval(B,he);return function(){return clearInterval(Y)}}},[he])}},"9ZNV":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return I});var K=g("0Owb"),ge=g("+L6B"),Q=g("2/Rp"),fe=g("q1tI"),he=g.n(fe),ee=g("UUDw"),B=g.n(ee),Y=g("TSYQ"),D=g.n(Y),I=function(x){var L=x.cancelText,w=L===void 0?"\u53D6\u6D88":L,S=x.okText,M=S===void 0?"\u786E\u5B9A":S,m=x.loading,v=m===void 0?!1:m,T=x.hasOkBtn,O=T===void 0?!0:T,se=x.okButtonProps,te=se===void 0?{}:se,ue=x.onCancel,ke=ue===void 0?function(){}:ue,ne=x.onOk,xe=ne===void 0?function(){}:ne,Fe=x.className,re=Fe===void 0?"":Fe;return he.a.createElement("div",{className:D()(B.a.buttonFixed,re)},he.a.createElement("div",{className:B.a.buttonWrap},he.a.createElement(Q.a,{size:"large",className:"".concat(B.a.button," mr20"),onClick:ke},w),O&&he.a.createElement(Q.a,Object(K.a)({size:"large",type:"primary",className:"".concat(B.a.button," mr20"),loading:v,onClick:xe},te),M)))}},Bd2K:function(ct,ie,g){(function(K){K(g("VrN/"),g("osHv"))})(function(K){K.defineOption("autoCloseTags",!1,function(D,I,y){if(y!=K.Init&&y&&D.removeKeyMap("autoCloseTags"),!I)return;var x={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(x["'/'"]=function(L){return ee(L)}),(typeof I!="object"||I.whenOpening!==!1)&&(x["'>'"]=function(L){return fe(L)}),D.addKeyMap(x)});var ge=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Q=["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 fe(D){if(D.getOption("disableInput"))return K.Pass;for(var I=D.listSelections(),y=[],x=D.getOption("autoCloseTags"),L=0;L<I.length;L++){if(!I[L].empty())return K.Pass;var w=I[L].head,S=D.getTokenAt(w),M=K.innerMode(D.getMode(),S.state),m=M.state,v=M.mode.xmlCurrentTag&&M.mode.xmlCurrentTag(m),T=v&&v.name;if(!T)return K.Pass;var O=M.mode.configuration=="html",se=typeof x=="object"&&x.dontCloseTags||O&&ge,te=typeof x=="object"&&x.indentTags||O&&Q;S.end>w.ch&&(T=T.slice(0,T.length-S.end+w.ch));var ue=T.toLowerCase();if(!T||S.type=="string"&&(S.end!=w.ch||!/[\"\']/.test(S.string.charAt(S.string.length-1))||S.string.length==1)||S.type=="tag"&&v.close||S.string.indexOf("/")==w.ch-S.start-1||se&&B(se,ue)>-1||Y(D,M.mode.xmlCurrentContext&&M.mode.xmlCurrentContext(m)||[],T,w,!0))return K.Pass;var ke=typeof x=="object"&&x.emptyTags;if(ke&&B(ke,T)>-1){y[L]={text:"/>",newPos:K.Pos(w.line,w.ch+2)};continue}var ne=te&&B(te,ue)>-1;y[L]={indent:ne,text:">"+(ne?`
|
|
|
|
`:"")+"</"+T+">",newPos:ne?K.Pos(w.line+1,0):K.Pos(w.line,w.ch+1)}}for(var xe=typeof x=="object"&&x.dontIndentOnAutoClose,L=I.length-1;L>=0;L--){var Fe=y[L];D.replaceRange(Fe.text,I[L].head,I[L].anchor,"+insert");var re=D.listSelections().slice(0);re[L]={head:Fe.newPos,anchor:Fe.newPos},D.setSelections(re),!xe&&Fe.indent&&(D.indentLine(Fe.newPos.line,null,!0),D.indentLine(Fe.newPos.line+1,null,!0))}}function he(D,I){for(var y=D.listSelections(),x=[],L=I?"/":"</",w=D.getOption("autoCloseTags"),S=typeof w=="object"&&w.dontIndentOnSlash,M=0;M<y.length;M++){if(!y[M].empty())return K.Pass;var m=y[M].head,v=D.getTokenAt(m),T=K.innerMode(D.getMode(),v.state),O=T.state;if(I&&(v.type=="string"||v.string.charAt(0)!="<"||v.start!=m.ch-1))return K.Pass;var se,te=T.mode.name!="xml"&&D.getMode().name=="htmlmixed";if(te&&T.mode.name=="javascript")se=L+"script";else if(te&&T.mode.name=="css")se=L+"style";else{var ue=T.mode.xmlCurrentContext&&T.mode.xmlCurrentContext(O);if(!ue||ue.length&&Y(D,ue,ue[ue.length-1],m))return K.Pass;se=L+ue[ue.length-1]}D.getLine(m.line).charAt(v.end)!=">"&&(se+=">"),x[M]=se}if(D.replaceSelections(x),y=D.listSelections(),!S)for(var M=0;M<y.length;M++)(M==y.length-1||y[M].head.line<y[M+1].head.line)&&D.indentLine(y[M].head.line)}function ee(D){return D.getOption("disableInput")?K.Pass:he(D,!0)}K.commands.closeTag=function(D){return he(D)};function B(D,I){if(D.indexOf)return D.indexOf(I);for(var y=0,x=D.length;y<x;++y)if(D[y]==I)return y;return-1}function Y(D,I,y,x,L){if(!K.scanForClosingTag)return!1;var w=Math.min(D.lastLine()+1,x.line+500),S=K.scanForClosingTag(D,x,null,w);if(!S||S.tag!=y)return!1;for(var M=L?1:0,m=I.length-1;m>=0&&I[m]==y;m--)++M;x=S.to;for(var m=1;m<M;m++){var v=K.scanForClosingTag(D,x,null,w);if(!v||v.tag!=y)return!1;x=v.to}return!0}})},BjJ7:function(ct,ie,g){"use strict";g.d(ie,"d",function(){return ge}),g.d(ie,"c",function(){return Q}),g.d(ie,"e",function(){return fe}),g.d(ie,"b",function(){return he}),g.d(ie,"a",function(){return B});var K=g("m3rI");function ge(Y){var D=!0;if(Y.length>0){for(var I=0;I<Y.length;I++)if(Y[I].compile_success==0||!Y[I].compile_success){D=!1;break}}else D=!1;return D}function Q(Y){for(var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],y=0;y<Y.length;y++){var x=Y[y],L=D?"".concat(D,"/").concat(x.name):"".concat(x.name);I.push({title:x.name,isLeaf:!(x.type==="tree"),key:L})}return I}function fe(Y,D,I){for(var y=0;y<Y.length;y++){var x=Y[y];if(x.key===D){x.children=I;break}x.children&&fe(x.children,D,I)}return Y}function he(Y,D,I){var y;return function(){var x=this,L=arguments,w=function(){y=null,I||Y.apply(x,L)},S=I&&!y;clearTimeout(y),y=setTimeout(w,D),S&&Y.apply(x,L)}}var ee=!0,B=K.a.API_SERVER},"C+DQ":function(ct,ie,g){},"C/vA":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return K});function K(ge){var Q=this,fe=!1,he;return function(){return fe||(fe=!0,he=ge.apply(Q,arguments)),he}}},"Cg/j":function(ct,ie,g){"use strict";g.d(ie,"b",function(){return K}),g.d(ie,"a",function(){return ge}),g.d(ie,"c",function(){return fe}),g.d(ie,"d",function(){return he});var K;(function(ee){ee.serviceIds=new Map,ee.DI_TARGET="$di$target",ee.DI_DEPENDENCIES="$di$dependencies";function B(Y){return Y[ee.DI_DEPENDENCIES]||[]}ee.getServiceDependencies=B})(K||(K={}));var ge=fe("instantiationService");function Q(ee,B,Y,D){B[K.DI_TARGET]===B?B[K.DI_DEPENDENCIES].push({id:ee,index:Y,optional:D}):(B[K.DI_DEPENDENCIES]=[{id:ee,index:Y,optional:D}],B[K.DI_TARGET]=B)}function fe(ee){if(K.serviceIds.has(ee))return K.serviceIds.get(ee);var B=function(Y,D,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Q(B,Y,I,!1)};return B.toString=function(){return ee},K.serviceIds.set(ee,B),B}function he(ee){return function(B,Y,D){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Q(ee,B,D,!0)}}},DlQD:function(ct,ie,g){(function(K,ge){ct.exports=ge()})(this,function(){"use strict";function K(X,j){for(var V=0;V<j.length;V++){var E=j[V];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(X,E.key,E)}}function ge(X,j,V){return j&&K(X.prototype,j),V&&K(X,V),X}function Q(X,j){if(!X)return;if(typeof X=="string")return fe(X,j);var V=Object.prototype.toString.call(X).slice(8,-1);if(V==="Object"&&X.constructor&&(V=X.constructor.name),V==="Map"||V==="Set")return Array.from(X);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return fe(X,j)}function fe(X,j){(j==null||j>X.length)&&(j=X.length);for(var V=0,E=new Array(j);V<j;V++)E[V]=X[V];return E}function he(X,j){var V;if(typeof Symbol=="undefined"||X[Symbol.iterator]==null){if(Array.isArray(X)||(V=Q(X))||j&&X&&typeof X.length=="number"){V&&(X=V);var E=0;return function(){return E>=X.length?{done:!0}:{done:!1,value:X[E++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return V=X[Symbol.iterator](),V.next.bind(V)}function ee(X,j){return j={exports:{}},X(j,j.exports),j.exports}var B=ee(function(X){function j(){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 V(E){X.exports.defaults=E}X.exports={defaults:j(),getDefaults:j,changeDefaults:V}}),Y=B.defaults,D=B.getDefaults,I=B.changeDefaults,y=/[&<>"']/,x=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},M=function(j){return S[j]};function m(X,j){if(j){if(y.test(X))return X.replace(x,M)}else if(L.test(X))return X.replace(w,M);return X}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function T(X){return X.replace(v,function(j,V){return V=V.toLowerCase(),V==="colon"?":":V.charAt(0)==="#"?V.charAt(1)==="x"?String.fromCharCode(parseInt(V.substring(2),16)):String.fromCharCode(+V.substring(1)):""})}var O=/(^|[^\[])\^/g;function se(X,j){X=X.source||X,j=j||"";var V={replace:function(k,R){return R=R.source||R,R=R.replace(O,"$1"),X=X.replace(k,R),V},getRegex:function(){return new RegExp(X,j)}};return V}var te=/[^\w:]/g,ue=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ke(X,j,V){if(X){var E;try{E=decodeURIComponent(T(V)).replace(te,"").toLowerCase()}catch(k){return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}j&&!ue.test(V)&&(V=A(j,V));try{V=encodeURI(V).replace(/%25/g,"%")}catch(k){return null}return V}var ne={},xe=/^[^:]+:\/*[^/]*$/,Fe=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(X,j){ne[" "+X]||(xe.test(X)?ne[" "+X]=X+"/":ne[" "+X]=J(X,"/",!0)),X=ne[" "+X];var V=X.indexOf(":")===-1;return j.substring(0,2)==="//"?V?j:X.replace(Fe,"$1")+j:j.charAt(0)==="/"?V?j:X.replace(re,"$1")+j:X+j}var me={exec:function(){}};function Z(X){for(var j=1,V,E;j<arguments.length;j++){V=arguments[j];for(E in V)Object.prototype.hasOwnProperty.call(V,E)&&(X[E]=V[E])}return X}function N(X,j){var V=X.replace(/\|/g,function(R,W,ve){for(var oe=!1,Ne=W;--Ne>=0&&ve[Ne]==="\\";)oe=!oe;return oe?"|":" |"}),E=V.split(/ \|/),k=0;if(E.length>j)E.splice(j);else for(;E.length<j;)E.push("");for(;k<E.length;k++)E[k]=E[k].trim().replace(/\\\|/g,"|");return E}function J(X,j,V){var E=X.length;if(E===0)return"";for(var k=0;k<E;){var R=X.charAt(E-k-1);if(R===j&&!V)k++;else if(R!==j&&V)k++;else break}return X.substr(0,E-k)}function ce(X,j){if(X.indexOf(j[1])===-1)return-1;for(var V=X.length,E=0,k=0;k<V;k++)if(X[k]==="\\")k++;else if(X[k]===j[0])E++;else if(X[k]===j[1]&&(E--,E<0))return k;return-1}function $(X){X&&X.sanitize&&!X.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 ye={escape:m,unescape:T,edit:se,cleanUrl:ke,resolveUrl:A,noopTest:me,merge:Z,splitCells:N,rtrim:J,findClosingBracket:ce,checkSanitizeDeprecation:$},_=B.defaults,b=ye.rtrim,q=ye.splitCells,Ee=ye.escape,Se=ye.findClosingBracket;function tt(X,j,V){var E=j.href,k=j.title?Ee(j.title):null,R=X[1].replace(/\\([\[\]])/g,"$1");return X[0].charAt(0)!=="!"?{type:"link",raw:V,href:E,title:k,text:R}:{type:"image",raw:V,href:E,title:k,text:Ee(R)}}function Qe(X,j){var V=X.match(/^(\s+)(?:```)/);if(V===null)return j;var E=V[1];return j.split(`
|
|
`).map(function(k){var R=k.match(/^\s+/);if(R===null)return k;var W=R[0];return W.length>=E.length?k.slice(E.length):k}).join(`
|
|
`)}var je=function(){function X(V){this.options=V||_}var j=X.prototype;return j.space=function(E){var k=this.rules.block.newline.exec(E);if(k)return k[0].length>1?{type:"space",raw:k[0]}:{raw:`
|
|
`}},j.code=function(E,k){var R=this.rules.block.code.exec(E);if(R){var W=k[k.length-1];if(W&&W.type==="paragraph")return{raw:R[0],text:R[0].trimRight()};var ve=R[0].replace(/^ {4}/gm,"");return{type:"code",raw:R[0],codeBlockStyle:"indented",text:this.options.pedantic?ve:b(ve,`
|
|
`)}}},j.fences=function(E){var k=this.rules.block.fences.exec(E);if(k){var R=k[0],W=Qe(R,k[3]||"");return{type:"code",raw:R,lang:k[2]?k[2].trim():k[2],text:W}}},j.heading=function(E){var k=this.rules.block.heading.exec(E);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},j.nptable=function(E){var k=this.rules.block.nptable.exec(E);if(k){var R={type:"table",header:q(k[1].replace(/^ *| *\| *$/g,"")),align:k[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:k[3]?k[3].replace(/\n$/,"").split(`
|
|
`):[],raw:k[0]};if(R.header.length===R.align.length){var W=R.align.length,ve;for(ve=0;ve<W;ve++)/^ *-+: *$/.test(R.align[ve])?R.align[ve]="right":/^ *:-+: *$/.test(R.align[ve])?R.align[ve]="center":/^ *:-+ *$/.test(R.align[ve])?R.align[ve]="left":R.align[ve]=null;for(W=R.cells.length,ve=0;ve<W;ve++)R.cells[ve]=q(R.cells[ve],R.header.length);return R}}},j.hr=function(E){var k=this.rules.block.hr.exec(E);if(k)return{type:"hr",raw:k[0]}},j.blockquote=function(E){var k=this.rules.block.blockquote.exec(E);if(k){var R=k[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:k[0],text:R}}},j.list=function(E){var k=this.rules.block.list.exec(E);if(k){for(var R=k[0],W=k[2],ve=W.length>1,oe=W[W.length-1]===")",Ne={type:"list",raw:R,ordered:ve,start:ve?+W.slice(0,-1):"",loose:!1,items:[]},qe=k[0].match(this.rules.block.item),ft=!1,st,_t,Lt,pt,$t,jt,Jt,Ht=qe.length,Mt=0;Mt<Ht;Mt++)st=qe[Mt],R=st,_t=st.length,st=st.replace(/^ *([*+-]|\d+[.)]) */,""),~st.indexOf(`
|
|
`)&&(_t-=st.length,st=this.options.pedantic?st.replace(/^ {1,4}/gm,""):st.replace(new RegExp("^ {1,"+_t+"}","gm"),"")),Mt!==Ht-1&&(Lt=this.rules.block.bullet.exec(qe[Mt+1])[0],(ve?Lt.length===1||!oe&&Lt[Lt.length-1]===")":Lt.length>1||this.options.smartLists&&Lt!==W)&&(pt=qe.slice(Mt+1).join(`
|
|
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-pt.length),Mt=Ht-1)),$t=ft||/\n\n(?!\s*$)/.test(st),Mt!==Ht-1&&(ft=st.charAt(st.length-1)===`
|
|
`,$t||($t=ft)),$t&&(Ne.loose=!0),jt=/^\[[ xX]\] /.test(st),Jt=void 0,jt&&(Jt=st[1]!==" ",st=st.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:R,task:jt,checked:Jt,loose:$t,text:st});return Ne}},j.html=function(E){var k=this.rules.block.html.exec(E);if(k)return{type:this.options.sanitize?"paragraph":"html",raw:k[0],pre:!this.options.sanitizer&&(k[1]==="pre"||k[1]==="script"||k[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(k[0]):Ee(k[0]):k[0]}},j.def=function(E){var k=this.rules.block.def.exec(E);if(k){k[3]&&(k[3]=k[3].substring(1,k[3].length-1));var R=k[1].toLowerCase().replace(/\s+/g," ");return{tag:R,raw:k[0],href:k[2],title:k[3]}}},j.table=function(E){var k=this.rules.block.table.exec(E);if(k){var R={type:"table",header:q(k[1].replace(/^ *| *\| *$/g,"")),align:k[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:k[3]?k[3].replace(/\n$/,"").split(`
|
|
`):[]};if(R.header.length===R.align.length){R.raw=k[0];var W=R.align.length,ve;for(ve=0;ve<W;ve++)/^ *-+: *$/.test(R.align[ve])?R.align[ve]="right":/^ *:-+: *$/.test(R.align[ve])?R.align[ve]="center":/^ *:-+ *$/.test(R.align[ve])?R.align[ve]="left":R.align[ve]=null;for(W=R.cells.length,ve=0;ve<W;ve++)R.cells[ve]=q(R.cells[ve].replace(/^ *\| *| *\| *$/g,""),R.header.length);return R}}},j.lheading=function(E){var k=this.rules.block.lheading.exec(E);if(k)return{type:"heading",raw:k[0],depth:k[2].charAt(0)==="="?1:2,text:k[1]}},j.paragraph=function(E){var k=this.rules.block.paragraph.exec(E);if(k)return{type:"paragraph",raw:k[0],text:k[1].charAt(k[1].length-1)===`
|
|
`?k[1].slice(0,-1):k[1]}},j.text=function(E,k){var R=this.rules.block.text.exec(E);if(R){var W=k[k.length-1];return W&&W.type==="text"?{raw:R[0],text:R[0]}:{type:"text",raw:R[0],text:R[0]}}},j.escape=function(E){var k=this.rules.inline.escape.exec(E);if(k)return{type:"escape",raw:k[0],text:Ee(k[1])}},j.tag=function(E,k,R){var W=this.rules.inline.tag.exec(E);if(W)return!k&&/^<a /i.test(W[0])?k=!0:k&&/^<\/a>/i.test(W[0])&&(k=!1),!R&&/^<(pre|code|kbd|script)(\s|>)/i.test(W[0])?R=!0:R&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(W[0])&&(R=!1),{type:this.options.sanitize?"text":"html",raw:W[0],inLink:k,inRawBlock:R,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):Ee(W[0]):W[0]}},j.link=function(E){var k=this.rules.inline.link.exec(E);if(k){var R=Se(k[2],"()");if(R>-1){var W=k[0].indexOf("!")===0?5:4,ve=W+k[1].length+R;k[2]=k[2].substring(0,R),k[0]=k[0].substring(0,ve).trim(),k[3]=""}var oe=k[2],Ne="";if(this.options.pedantic){var qe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(oe);qe?(oe=qe[1],Ne=qe[3]):Ne=""}else Ne=k[3]?k[3].slice(1,-1):"";oe=oe.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=tt(k,{href:oe&&oe.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},k[0]);return ft}},j.reflink=function(E,k){var R;if((R=this.rules.inline.reflink.exec(E))||(R=this.rules.inline.nolink.exec(E))){var W=(R[2]||R[1]).replace(/\s+/g," ");if(W=k[W.toLowerCase()],!W||!W.href){var ve=R[0].charAt(0);return{type:"text",raw:ve,text:ve}}var oe=tt(R,W,R[0]);return oe}},j.strong=function(E,k,R){R===void 0&&(R="");var W=this.rules.inline.strong.start.exec(E);if(W&&(!W[1]||W[1]&&(R===""||this.rules.inline.punctuation.exec(R)))){k=k.slice(-1*E.length);var ve=W[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ve.lastIndex=0;for(var oe;(W=ve.exec(k))!=null;)if(oe=this.rules.inline.strong.middle.exec(k.slice(0,W.index+3)),oe)return{type:"strong",raw:E.slice(0,oe[0].length),text:E.slice(2,oe[0].length-2)}}},j.em=function(E,k,R){R===void 0&&(R="");var W=this.rules.inline.em.start.exec(E);if(W&&(!W[1]||W[1]&&(R===""||this.rules.inline.punctuation.exec(R)))){k=k.slice(-1*E.length);var ve=W[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ve.lastIndex=0;for(var oe;(W=ve.exec(k))!=null;)if(oe=this.rules.inline.em.middle.exec(k.slice(0,W.index+2)),oe)return{type:"em",raw:E.slice(0,oe[0].length),text:E.slice(1,oe[0].length-1)}}},j.codespan=function(E){var k=this.rules.inline.code.exec(E);if(k){var R=k[2].replace(/\n/g," "),W=/[^ ]/.test(R),ve=R.startsWith(" ")&&R.endsWith(" ");return W&&ve&&(R=R.substring(1,R.length-1)),R=Ee(R,!0),{type:"codespan",raw:k[0],text:R}}},j.br=function(E){var k=this.rules.inline.br.exec(E);if(k)return{type:"br",raw:k[0]}},j.del=function(E){var k=this.rules.inline.del.exec(E);if(k)return{type:"del",raw:k[0],text:k[1]}},j.autolink=function(E,k){var R=this.rules.inline.autolink.exec(E);if(R){var W,ve;return R[2]==="@"?(W=Ee(this.options.mangle?k(R[1]):R[1]),ve="mailto:"+W):(W=Ee(R[1]),ve=W),{type:"link",raw:R[0],text:W,href:ve,tokens:[{type:"text",raw:W,text:W}]}}},j.url=function(E,k){var R;if(R=this.rules.inline.url.exec(E)){var W,ve;if(R[2]==="@")W=Ee(this.options.mangle?k(R[0]):R[0]),ve="mailto:"+W;else{var oe;do oe=R[0],R[0]=this.rules.inline._backpedal.exec(R[0])[0];while(oe!==R[0]);W=Ee(R[0]),R[1]==="www."?ve="http://"+W:ve=W}return{type:"link",raw:R[0],text:W,href:ve,tokens:[{type:"text",raw:W,text:W}]}}},j.inlineText=function(E,k,R){var W=this.rules.inline.text.exec(E);if(W){var ve;return k?ve=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):Ee(W[0]):W[0]:ve=Ee(this.options.smartypants?R(W[0]):W[0]),{type:"text",raw:W[0],text:ve}}},X}(),Ue=ye.noopTest,Oe=ye.edit,Pe=ye.merge,ae={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:Ue,table:Ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ae.def=Oe(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex(),ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ae.item=Oe(ae.item,"gm").replace(/bull/g,ae.bullet).getRegex(),ae.list=Oe(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex(),ae._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",ae._comment=/<!--(?!-?>)[\s\S]*?-->/,ae.html=Oe(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae.paragraph=Oe(ae._paragraph).replace("hr",ae.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",ae._tag).getRegex(),ae.blockquote=Oe(ae.blockquote).replace("paragraph",ae.paragraph).getRegex(),ae.normal=Pe({},ae),ae.gfm=Pe({},ae.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*|$)"}),ae.gfm.nptable=Oe(ae.gfm.nptable).replace("hr",ae.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",ae._tag).getRegex(),ae.gfm.table=Oe(ae.gfm.table).replace("hr",ae.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",ae._tag).getRegex(),ae.pedantic=Pe({},ae.normal,{html:Oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._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:Ue,paragraph:Oe(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ue,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:Ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",z.punctuation=Oe(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=Oe(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=Oe(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=Oe(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=Oe(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=Oe(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=Oe(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=Oe(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=Oe(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=Oe(z._blockSkip,"g").getRegex(),z.overlapSkip=Oe(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=Oe(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=Oe(z.tag).replace("comment",ae._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=Oe(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=Oe(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=Oe(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=Pe({},z),z.pedantic=Pe({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Oe(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:Oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=Pe({},z.normal,{escape:Oe(z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=Oe(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=Pe({},z.gfm,{br:Oe(z.br).replace("{2,}","*").getRegex(),text:Oe(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var We={block:ae,inline:z},nt=B.defaults,it=We.block,Ye=We.inline;function F(X){return X.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 U(X){var j="",V,E,k=X.length;for(V=0;V<k;V++)E=X.charCodeAt(V),Math.random()>.5&&(E="x"+E.toString(16)),j+="&#"+E+";";return j}var de=function(){function X(V){this.tokens=[],this.tokens.links=Object.create(null),this.options=V||nt,this.options.tokenizer=this.options.tokenizer||new je,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var E={block:it.normal,inline:Ye.normal};this.options.pedantic?(E.block=it.pedantic,E.inline=Ye.pedantic):this.options.gfm&&(E.block=it.gfm,this.options.breaks?E.inline=Ye.breaks:E.inline=Ye.gfm),this.tokenizer.rules=E}X.lex=function(E,k){var R=new X(k);return R.lex(E)};var j=X.prototype;return j.lex=function(E){return E=E.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(E,this.tokens,!0),this.inline(this.tokens),this.tokens},j.blockTokens=function(E,k,R){k===void 0&&(k=[]),R===void 0&&(R=!0),E=E.replace(/^ +$/gm,"");for(var W,ve,oe,Ne;E;){if(W=this.tokenizer.space(E)){E=E.substring(W.raw.length),W.type&&k.push(W);continue}if(W=this.tokenizer.code(E,k)){E=E.substring(W.raw.length),W.type?k.push(W):(Ne=k[k.length-1],Ne.raw+=`
|
|
`+W.raw,Ne.text+=`
|
|
`+W.text);continue}if(W=this.tokenizer.fences(E)){E=E.substring(W.raw.length),k.push(W);continue}if(W=this.tokenizer.heading(E)){E=E.substring(W.raw.length),k.push(W);continue}if(W=this.tokenizer.nptable(E)){E=E.substring(W.raw.length),k.push(W);continue}if(W=this.tokenizer.hr(E)){E=E.substring(W.raw.length),k.push(W);continue}if(W=this.tokenizer.blockquote(E)){E=E.substring(W.raw.length),W.tokens=this.blockTokens(W.text,[],R),k.push(W);continue}if(W=this.tokenizer.list(E)){for(E=E.substring(W.raw.length),oe=W.items.length,ve=0;ve<oe;ve++)W.items[ve].tokens=this.blockTokens(W.items[ve].text,[],!1);k.push(W);continue}if(W=this.tokenizer.html(E)){E=E.substring(W.raw.length),k.push(W);continue}if(R&&(W=this.tokenizer.def(E))){E=E.substring(W.raw.length),this.tokens.links[W.tag]||(this.tokens.links[W.tag]={href:W.href,title:W.title});continue}if(W=this.tokenizer.table(E)){E=E.substring(W.raw.length),k.push(W);continue}if(W=this.tokenizer.lheading(E)){E=E.substring(W.raw.length),k.push(W);continue}if(R&&(W=this.tokenizer.paragraph(E))){E=E.substring(W.raw.length),k.push(W);continue}if(W=this.tokenizer.text(E,k)){E=E.substring(W.raw.length),W.type?k.push(W):(Ne=k[k.length-1],Ne.raw+=`
|
|
`+W.raw,Ne.text+=`
|
|
`+W.text);continue}if(E){var qe="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(qe);break}else throw new Error(qe)}}return k},j.inline=function(E){var k,R,W,ve,oe,Ne,qe=E.length;for(k=0;k<qe;k++){Ne=E[k];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},ve=Ne.header.length,R=0;R<ve;R++)Ne.tokens.header[R]=[],this.inlineTokens(Ne.header[R],Ne.tokens.header[R]);for(ve=Ne.cells.length,R=0;R<ve;R++)for(oe=Ne.cells[R],Ne.tokens.cells[R]=[],W=0;W<oe.length;W++)Ne.tokens.cells[R][W]=[],this.inlineTokens(oe[W],Ne.tokens.cells[R][W]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(ve=Ne.items.length,R=0;R<ve;R++)this.inline(Ne.items[R].tokens);break}}}return E},j.inlineTokens=function(E,k,R,W,ve){k===void 0&&(k=[]),R===void 0&&(R=!1),W===void 0&&(W=!1),ve===void 0&&(ve="");var oe,Ne=E,qe;if(this.tokens.links){var ft=Object.keys(this.tokens.links);if(ft.length>0)for(;(qe=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)ft.includes(qe[0].slice(qe[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,qe.index)+"["+"a".repeat(qe[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(qe=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,qe.index)+"["+"a".repeat(qe[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;E;){if(oe=this.tokenizer.escape(E)){E=E.substring(oe.raw.length),k.push(oe);continue}if(oe=this.tokenizer.tag(E,R,W)){E=E.substring(oe.raw.length),R=oe.inLink,W=oe.inRawBlock,k.push(oe);continue}if(oe=this.tokenizer.link(E)){E=E.substring(oe.raw.length),oe.type==="link"&&(oe.tokens=this.inlineTokens(oe.text,[],!0,W)),k.push(oe);continue}if(oe=this.tokenizer.reflink(E,this.tokens.links)){E=E.substring(oe.raw.length),oe.type==="link"&&(oe.tokens=this.inlineTokens(oe.text,[],!0,W)),k.push(oe);continue}if(oe=this.tokenizer.strong(E,Ne,ve)){E=E.substring(oe.raw.length),oe.tokens=this.inlineTokens(oe.text,[],R,W),k.push(oe);continue}if(oe=this.tokenizer.em(E,Ne,ve)){E=E.substring(oe.raw.length),oe.tokens=this.inlineTokens(oe.text,[],R,W),k.push(oe);continue}if(oe=this.tokenizer.codespan(E)){E=E.substring(oe.raw.length),k.push(oe);continue}if(oe=this.tokenizer.br(E)){E=E.substring(oe.raw.length),k.push(oe);continue}if(oe=this.tokenizer.del(E)){E=E.substring(oe.raw.length),oe.tokens=this.inlineTokens(oe.text,[],R,W),k.push(oe);continue}if(oe=this.tokenizer.autolink(E,U)){E=E.substring(oe.raw.length),k.push(oe);continue}if(!R&&(oe=this.tokenizer.url(E,U))){E=E.substring(oe.raw.length),k.push(oe);continue}if(oe=this.tokenizer.inlineText(E,W,F)){E=E.substring(oe.raw.length),ve=oe.raw.slice(-1),k.push(oe);continue}if(E){var st="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return k},ge(X,null,[{key:"rules",get:function(){return{block:it,inline:Ye}}}]),X}(),we=B.defaults,Me=ye.cleanUrl,De=ye.escape,Be=function(){function X(V){this.options=V||we}var j=X.prototype;return j.code=function(E,k,R){var W=(k||"").match(/\S*/)[0];if(this.options.highlight){var ve=this.options.highlight(E,W);ve!=null&&ve!==E&&(R=!0,E=ve)}return W?'<pre><code class="'+this.options.langPrefix+De(W,!0)+'">'+(R?E:De(E,!0))+`</code></pre>
|
|
`:"<pre><code>"+(R?E:De(E,!0))+`</code></pre>
|
|
`},j.blockquote=function(E){return`<blockquote>
|
|
`+E+`</blockquote>
|
|
`},j.html=function(E){return E},j.heading=function(E,k,R,W){return this.options.headerIds?"<h"+k+' id="'+this.options.headerPrefix+W.slug(R)+'">'+E+"</h"+k+`>
|
|
`:"<h"+k+">"+E+"</h"+k+`>
|
|
`},j.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},j.list=function(E,k,R){var W=k?"ol":"ul",ve=k&&R!==1?' start="'+R+'"':"";return"<"+W+ve+`>
|
|
`+E+"</"+W+`>
|
|
`},j.listitem=function(E){return"<li>"+E+`</li>
|
|
`},j.checkbox=function(E){return"<input "+(E?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},j.paragraph=function(E){return"<p>"+E+`</p>
|
|
`},j.table=function(E,k){return k&&(k="<tbody>"+k+"</tbody>"),`<table>
|
|
<thead>
|
|
`+E+`</thead>
|
|
`+k+`</table>
|
|
`},j.tablerow=function(E){return`<tr>
|
|
`+E+`</tr>
|
|
`},j.tablecell=function(E,k){var R=k.header?"th":"td",W=k.align?"<"+R+' align="'+k.align+'">':"<"+R+">";return W+E+"</"+R+`>
|
|
`},j.strong=function(E){return"<strong>"+E+"</strong>"},j.em=function(E){return"<em>"+E+"</em>"},j.codespan=function(E){return"<code>"+E+"</code>"},j.br=function(){return this.options.xhtml?"<br/>":"<br>"},j.del=function(E){return"<del>"+E+"</del>"},j.link=function(E,k,R){if(E=Me(this.options.sanitize,this.options.baseUrl,E),E===null)return R;var W='<a href="'+De(E)+'"';return k&&(W+=' title="'+k+'"'),W+=">"+R+"</a>",W},j.image=function(E,k,R){if(E=Me(this.options.sanitize,this.options.baseUrl,E),E===null)return R;var W='<img src="'+E+'" alt="'+R+'"';return k&&(W+=' title="'+k+'"'),W+=this.options.xhtml?"/>":">",W},j.text=function(E){return E},X}(),He=function(){function X(){}var j=X.prototype;return j.strong=function(E){return E},j.em=function(E){return E},j.codespan=function(E){return E},j.del=function(E){return E},j.html=function(E){return E},j.text=function(E){return E},j.link=function(E,k,R){return""+R},j.image=function(E,k,R){return""+R},j.br=function(){return""},X}(),dt=function(){function X(){this.seen={}}var j=X.prototype;return j.slug=function(E){var k=E.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(k)){var R=k;do this.seen[R]++,k=R+"-"+this.seen[R];while(this.seen.hasOwnProperty(k))}return this.seen[k]=0,k},X}(),Ze=B.defaults,Je=ye.unescape,Ve=function(){function X(V){this.options=V||Ze,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new dt}X.parse=function(E,k){var R=new X(k);return R.parse(E)};var j=X.prototype;return j.parse=function(E,k){k===void 0&&(k=!0);var R="",W,ve,oe,Ne,qe,ft,st,_t,Lt,pt,$t,jt,Jt,Ht,Mt,Un,Qn,bt,wt=E.length;for(W=0;W<wt;W++){pt=E[W];switch(pt.type){case"space":continue;case"hr":{R+=this.renderer.hr();continue}case"heading":{R+=this.renderer.heading(this.parseInline(pt.tokens),pt.depth,Je(this.parseInline(pt.tokens,this.textRenderer)),this.slugger);continue}case"code":{R+=this.renderer.code(pt.text,pt.lang,pt.escaped);continue}case"table":{for(_t="",st="",Ne=pt.header.length,ve=0;ve<Ne;ve++)st+=this.renderer.tablecell(this.parseInline(pt.tokens.header[ve]),{header:!0,align:pt.align[ve]});for(_t+=this.renderer.tablerow(st),Lt="",Ne=pt.cells.length,ve=0;ve<Ne;ve++){for(ft=pt.tokens.cells[ve],st="",qe=ft.length,oe=0;oe<qe;oe++)st+=this.renderer.tablecell(this.parseInline(ft[oe]),{header:!1,align:pt.align[oe]});Lt+=this.renderer.tablerow(st)}R+=this.renderer.table(_t,Lt);continue}case"blockquote":{Lt=this.parse(pt.tokens),R+=this.renderer.blockquote(Lt);continue}case"list":{for($t=pt.ordered,jt=pt.start,Jt=pt.loose,Ne=pt.items.length,Lt="",ve=0;ve<Ne;ve++)Mt=pt.items[ve],Un=Mt.checked,Qn=Mt.task,Ht="",Mt.task&&(bt=this.renderer.checkbox(Un),Jt?Mt.tokens.length>0&&Mt.tokens[0].type==="text"?(Mt.tokens[0].text=bt+" "+Mt.tokens[0].text,Mt.tokens[0].tokens&&Mt.tokens[0].tokens.length>0&&Mt.tokens[0].tokens[0].type==="text"&&(Mt.tokens[0].tokens[0].text=bt+" "+Mt.tokens[0].tokens[0].text)):Mt.tokens.unshift({type:"text",text:bt}):Ht+=bt),Ht+=this.parse(Mt.tokens,Jt),Lt+=this.renderer.listitem(Ht,Qn,Un);R+=this.renderer.list(Lt,$t,jt);continue}case"html":{R+=this.renderer.html(pt.text);continue}case"paragraph":{R+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(Lt=pt.tokens?this.parseInline(pt.tokens):pt.text;W+1<wt&&E[W+1].type==="text";)pt=E[++W],Lt+=`
|
|
`+(pt.tokens?this.parseInline(pt.tokens):pt.text);R+=k?this.renderer.paragraph(Lt):Lt;continue}default:{var et='Token with "'+pt.type+'" type was not found.';if(this.options.silent){console.error(et);return}else throw new Error(et)}}}return R},j.parseInline=function(E,k){k=k||this.renderer;var R="",W,ve,oe=E.length;for(W=0;W<oe;W++){ve=E[W];switch(ve.type){case"escape":{R+=k.text(ve.text);break}case"html":{R+=k.html(ve.text);break}case"link":{R+=k.link(ve.href,ve.title,this.parseInline(ve.tokens,k));break}case"image":{R+=k.image(ve.href,ve.title,ve.text);break}case"strong":{R+=k.strong(this.parseInline(ve.tokens,k));break}case"em":{R+=k.em(this.parseInline(ve.tokens,k));break}case"codespan":{R+=k.codespan(ve.text);break}case"br":{R+=k.br();break}case"del":{R+=k.del(this.parseInline(ve.tokens,k));break}case"text":{R+=k.text(ve.text);break}default:{var Ne='Token with "'+ve.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return R},X}(),yt=ye.merge,mt=ye.checkSanitizeDeprecation,lt=ye.escape,be=B.getDefaults,$e=B.changeDefaults,at=B.defaults;function Ce(X,j,V){if(typeof X=="undefined"||X===null)throw new Error("marked(): input parameter is undefined or null");if(typeof X!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(X)+", string expected");if(typeof j=="function"&&(V=j,j=null),j=yt({},Ce.defaults,j||{}),mt(j),V){var E=j.highlight,k;try{k=de.lex(X,j)}catch(oe){return V(oe)}var R=function(Ne){var qe;if(!Ne)try{qe=Ve.parse(k,j)}catch(ft){Ne=ft}return j.highlight=E,Ne?V(Ne):V(null,qe)};if(!E||E.length<3)return R();if(delete j.highlight,!k.length)return R();var W=0;Ce.walkTokens(k,function(oe){oe.type==="code"&&(W++,setTimeout(function(){E(oe.text,oe.lang,function(Ne,qe){if(Ne)return R(Ne);qe!=null&&qe!==oe.text&&(oe.text=qe,oe.escaped=!0),W--,W===0&&R()})},0))}),W===0&&R();return}try{var ve=de.lex(X,j);return j.walkTokens&&Ce.walkTokens(ve,j.walkTokens),Ve.parse(ve,j)}catch(oe){if(oe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,j.silent)return"<p>An error occurred:</p><pre>"+lt(oe.message+"",!0)+"</pre>";throw oe}}Ce.options=Ce.setOptions=function(X){return yt(Ce.defaults,X),$e(Ce.defaults),Ce},Ce.getDefaults=be,Ce.defaults=at,Ce.use=function(X){var j=yt({},X);if(X.renderer&&function(){var E=Ce.defaults.renderer||new Be,k=function(ve){var oe=E[ve];E[ve]=function(){for(var Ne=arguments.length,qe=new Array(Ne),ft=0;ft<Ne;ft++)qe[ft]=arguments[ft];var st=X.renderer[ve].apply(E,qe);return st===!1&&(st=oe.apply(E,qe)),st}};for(var R in X.renderer)k(R);j.renderer=E}(),X.tokenizer&&function(){var E=Ce.defaults.tokenizer||new je,k=function(ve){var oe=E[ve];E[ve]=function(){for(var Ne=arguments.length,qe=new Array(Ne),ft=0;ft<Ne;ft++)qe[ft]=arguments[ft];var st=X.tokenizer[ve].apply(E,qe);return st===!1&&(st=oe.apply(E,qe)),st}};for(var R in X.tokenizer)k(R);j.tokenizer=E}(),X.walkTokens){var V=Ce.defaults.walkTokens;j.walkTokens=function(E){X.walkTokens(E),V&&V(E)}}Ce.setOptions(j)},Ce.walkTokens=function(X,j){for(var V=he(X),E;!(E=V()).done;){var k=E.value;j(k);switch(k.type){case"table":{for(var R=he(k.tokens.header),W;!(W=R()).done;){var ve=W.value;Ce.walkTokens(ve,j)}for(var oe=he(k.tokens.cells),Ne;!(Ne=oe()).done;)for(var qe=Ne.value,ft=he(qe),st;!(st=ft()).done;){var _t=st.value;Ce.walkTokens(_t,j)}break}case"list":{Ce.walkTokens(k.items,j);break}default:k.tokens&&Ce.walkTokens(k.tokens,j)}}},Ce.Parser=Ve,Ce.parser=Ve.parse,Ce.Renderer=Be,Ce.TextRenderer=He,Ce.Lexer=de,Ce.lexer=de.lex,Ce.Tokenizer=je,Ce.Slugger=dt,Ce.parse=Ce;var Le=Ce;return Le})},ELLl:function(ct,ie,g){(function(K){K(g("VrN/"))})(function(K){var ge={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Q=K.Pos;K.defineOption("autoCloseBrackets",!1,function(S,M,m){m&&m!=K.Init&&(S.removeKeyMap(he),S.state.closeBrackets=null),M&&(ee(fe(M,"pairs")),S.state.closeBrackets=M,S.addKeyMap(he))});function fe(S,M){return M=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[M]!=null?S[M]:ge[M]}var he={Backspace:D,Enter:I};function ee(S){for(var M=0;M<S.length;M++){var m=S.charAt(M),v="'"+m+"'";he[v]||(he[v]=B(m))}}ee(ge.pairs+"`");function B(S){return function(M){return x(M,S)}}function Y(S){var M=S.state.closeBrackets;if(!M||M.override)return M;var m=S.getModeAt(S.getCursor());return m.closeBrackets||M}function D(S){var M=Y(S);if(!M||S.getOption("disableInput"))return K.Pass;for(var m=fe(M,"pairs"),v=S.listSelections(),T=0;T<v.length;T++){if(!v[T].empty())return K.Pass;var O=L(S,v[T].head);if(!O||m.indexOf(O)%2!=0)return K.Pass}for(var T=v.length-1;T>=0;T--){var se=v[T].head;S.replaceRange("",Q(se.line,se.ch-1),Q(se.line,se.ch+1),"+delete")}}function I(S){var M=Y(S),m=M&&fe(M,"explode");if(!m||S.getOption("disableInput"))return K.Pass;for(var v=S.listSelections(),T=0;T<v.length;T++){if(!v[T].empty())return K.Pass;var O=L(S,v[T].head);if(!O||m.indexOf(O)%2!=0)return K.Pass}S.operation(function(){var se=S.lineSeparator()||`
|
|
`;S.replaceSelection(se+se,null),S.execCommand("goCharLeft"),v=S.listSelections();for(var te=0;te<v.length;te++){var ue=v[te].head.line;S.indentLine(ue,null,!0),S.indentLine(ue+1,null,!0)}})}function y(S){var M=K.cmpPos(S.anchor,S.head)>0;return{anchor:new Q(S.anchor.line,S.anchor.ch+(M?-1:1)),head:new Q(S.head.line,S.head.ch+(M?1:-1))}}function x(S,M){var m=Y(S);if(!m||S.getOption("disableInput"))return K.Pass;var v=fe(m,"pairs"),T=v.indexOf(M);if(T==-1)return K.Pass;for(var O=fe(m,"closeBefore"),se=fe(m,"triples"),te=v.charAt(T+1)==M,ue=S.listSelections(),ke=T%2==0,ne,xe=0;xe<ue.length;xe++){var Fe=ue[xe],re=Fe.head,A,me=S.getRange(re,Q(re.line,re.ch+1));if(ke&&!Fe.empty())A="surround";else if((te||!ke)&&me==M)te&&w(S,re)?A="both":se.indexOf(M)>=0&&S.getRange(re,Q(re.line,re.ch+3))==M+M+M?A="skipThree":A="skip";else if(te&&re.ch>1&&se.indexOf(M)>=0&&S.getRange(Q(re.line,re.ch-2),re)==M+M){if(re.ch>2&&/\bstring/.test(S.getTokenTypeAt(Q(re.line,re.ch-2))))return K.Pass;A="addFour"}else if(te){var Z=re.ch==0?" ":S.getRange(Q(re.line,re.ch-1),re);if(!K.isWordChar(me)&&Z!=M&&!K.isWordChar(Z))A="both";else return K.Pass}else if(ke&&(me.length===0||/\s/.test(me)||O.indexOf(me)>-1))A="both";else return K.Pass;if(!ne)ne=A;else if(ne!=A)return K.Pass}var N=T%2?v.charAt(T-1):M,J=T%2?M:v.charAt(T+1);S.operation(function(){if(ne=="skip")S.execCommand("goCharRight");else if(ne=="skipThree")for(var ce=0;ce<3;ce++)S.execCommand("goCharRight");else if(ne=="surround"){for(var $=S.getSelections(),ce=0;ce<$.length;ce++)$[ce]=N+$[ce]+J;S.replaceSelections($,"around"),$=S.listSelections().slice();for(var ce=0;ce<$.length;ce++)$[ce]=y($[ce]);S.setSelections($)}else ne=="both"?(S.replaceSelection(N+J,null),S.triggerElectric(N+J),S.execCommand("goCharLeft")):ne=="addFour"&&(S.replaceSelection(N+N+N+N,"before"),S.execCommand("goCharRight"))})}function L(S,M){var m=S.getRange(Q(M.line,M.ch-1),Q(M.line,M.ch+1));return m.length==2?m:null}function w(S,M){var m=S.getTokenAt(Q(M.line,M.ch+1));return/\bstring/.test(m.type)&&m.start==M.ch&&(M.ch==0||!/\bstring/.test(S.getTokenTypeAt(M)))}})},F8wB:function(ct,ie,g){ct.exports={loading:"loading___1SIOG"}},Gytx:function(ct,ie){ct.exports=function(K,ge,Q,fe){var he=Q?Q.call(fe,K,ge):void 0;if(he!==void 0)return!!he;if(K===ge)return!0;if(typeof K!="object"||!K||typeof ge!="object"||!ge)return!1;var ee=Object.keys(K),B=Object.keys(ge);if(ee.length!==B.length)return!1;for(var Y=Object.prototype.hasOwnProperty.bind(ge),D=0;D<ee.length;D++){var I=ee[D];if(!Y(I))return!1;var y=K[I],x=ge[I];if(he=Q?Q.call(fe,y,x,I):void 0,he===!1||he===void 0&&y!==x)return!1}return!0}},HmJG:function(ct,ie,g){},JYp7:function(ct,ie,g){"use strict";g.d(ie,"c",function(){return ge}),g.d(ie,"d",function(){return Q}),g.d(ie,"f",function(){return he}),g.d(ie,"a",function(){return ee}),g.d(ie,"b",function(){return B}),g.d(ie,"e",function(){return Y});var K=function(){var D=function(I,y){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,L){x.__proto__=L}||function(x,L){for(var w in L)L.hasOwnProperty(w)&&(x[w]=L[w])},D(I,y)};return function(I,y){D(I,y);function x(){this.constructor=I}I.prototype=y===null?Object.create(y):(x.prototype=y.prototype,new x)}}(),ge={done:!0,value:void 0},Q;(function(D){var I={next:function(){return ge}};function y(){return I}D.empty=y;function x(te){var ue=!1;return{next:function(){return ue?ge:(ue=!0,{done:!1,value:te})}}}D.single=x;function L(te,ue,ke){return ue===void 0&&(ue=0),ke===void 0&&(ke=te.length),{next:function(){return ue>=ke?ge:{done:!1,value:te[ue++]}}}}D.fromArray=L;function w(te){return{next:function(){var ue=te.next();return ue.done?ge:{done:!1,value:ue.value}}}}D.fromNativeIterator=w;function S(te){return te?Array.isArray(te)?D.fromArray(te):te:D.empty()}D.from=S;function M(te,ue){return{next:function(){var ke=te.next();return ke.done?ge:{done:!1,value:ue(ke.value)}}}}D.map=M;function m(te,ue){return{next:function(){for(;;){var ke=te.next();if(ke.done)return ge;if(ue(ke.value))return{done:!1,value:ke.value}}}}}D.filter=m;function v(te,ue){for(var ke=te.next();!ke.done;ke=te.next())ue(ke.value)}D.forEach=v;function T(te,ue){ue===void 0&&(ue=Number.POSITIVE_INFINITY);var ke=[];if(ue===0)return ke;for(var ne=0,xe=te.next();!xe.done&&!(ke.push(xe.value),++ne>=ue);xe=te.next());return ke}D.collect=T;function O(){for(var te=[],ue=0;ue<arguments.length;ue++)te[ue]=arguments[ue];var ke=0;return{next:function(){if(ke>=te.length)return ge;var ne=te[ke],xe=ne.next();return xe.done?(ke++,this.next()):xe}}}D.concat=O;function se(te){return new fe(te)}D.chain=se})(Q||(Q={}));var fe=function(){function D(I){this.it=I}return D.prototype.next=function(){return this.it.next()},D}();function he(D){return Array.isArray(D)?Q.fromArray(D):D||Q.empty()}var ee=function(){function D(I,y,x,L){y===void 0&&(y=0),x===void 0&&(x=I.length),L===void 0&&(L=y-1),this.items=I,this.start=y,this.end=x,this.index=L}return D.prototype.first=function(){return this.index=this.start,this.current()},D.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},D.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},D}(),B=function(D){K(I,D);function I(y,x,L,w){return x===void 0&&(x=0),L===void 0&&(L=y.length),w===void 0&&(w=x-1),D.call(this,y,x,L,w)||this}return I.prototype.current=function(){return D.prototype.current.call(this)},I.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},I.prototype.first=function(){return this.index=this.start,this.current()},I.prototype.last=function(){return this.index=this.end-1,this.current()},I.prototype.parent=function(){return null},I}(ee),Y=function(){function D(I,y){this.iterator=I,this.fn=y}return D.prototype.next=function(){return this.fn(this.iterator.next())},D}()},LdHM:function(ct,ie,g){"use strict";g.d(ie,"b",function(){return O}),g.d(ie,"a",function(){return te});var K=g("1OyB"),ge=g("vuIU"),Q=g("Ji7U"),fe=g("LK+K"),he=g("q1tI"),ee=g("rePB"),B=g("Ff2n"),Y=g("ODXe"),D=g("4IlW"),I=g("bX4T"),y=g("YrtM"),x=g("TSYQ"),L=g.n(x),w=g("+nKL"),S=g("8OUc"),M=function(q,Ee){var Se=q.prefixCls,tt=q.id,Qe=q.flattenOptions,je=q.childrenAsData,Ue=q.values,Oe=q.searchValue,Pe=q.multiple,ae=q.defaultActiveFirstOption,z=q.height,We=q.itemHeight,nt=q.notFoundContent,it=q.open,Ye=q.menuItemSelectedIcon,F=q.virtual,U=q.onSelect,de=q.onToggleOpen,we=q.onActiveValue,Me=q.onScroll,De=q.onMouseEnter,Be="".concat(Se,"-item"),He=Object(y.a)(function(){return Qe},[it,Qe],function(Le,X){return X[0]&&Le[1]!==X[1]}),dt=he.useRef(null),Ze=function(X){X.preventDefault()},Je=function(X){dt.current&&dt.current.scrollTo({index:X})},Ve=function(X){for(var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,V=He.length,E=0;E<V;E+=1){var k=(X+E*j+V)%V,R=He[k],W=R.group,ve=R.data;if(!W&&!ve.disabled)return k}return-1},yt=he.useState(function(){return Ve(0)}),mt=Object(Y.a)(yt,2),lt=mt[0],be=mt[1],$e=function(X){be(X);var j=He[X];if(!j){we(null,-1);return}we(j.data.value,X)};he.useEffect(function(){$e(ae!==!1?Ve(0):-1)},[He.length,Oe]),he.useEffect(function(){var Le=setTimeout(function(){if(!Pe&&it&&Ue.size===1){var X=Array.from(Ue)[0],j=He.findIndex(function(V){var E=V.data;return E.value===X});$e(j),Je(j)}});return function(){return clearTimeout(Le)}},[it]);var at=function(X){X!==void 0&&U(X,{selected:!Ue.has(X)}),Pe||de(!1)};if(he.useImperativeHandle(Ee,function(){return{onKeyDown:function(X){var j=X.which;switch(j){case D.a.UP:case D.a.DOWN:{var V=0;if(j===D.a.UP?V=-1:j===D.a.DOWN&&(V=1),V!==0){var E=Ve(lt+V,V);Je(E),$e(E)}break}case D.a.ENTER:{var k=He[lt];k&&!k.data.disabled?at(k.data.value):at(void 0),it&&X.preventDefault();break}case D.a.ESC:de(!1)}},onKeyUp:function(){},scrollTo:function(X){Je(X)}}}),He.length===0)return he.createElement("div",{role:"listbox",id:"".concat(tt,"_list"),className:"".concat(Be,"-empty"),onMouseDown:Ze},nt);function Ce(Le){var X=He[Le];if(!X)return null;var j=X.data||{},V=j.value,E=j.label,k=j.children,R=Object(I.a)(j,!0),W=je?k:E;return X?he.createElement("div",Object.assign({"aria-label":typeof W=="string"?W:null},R,{key:Le,role:"option",id:"".concat(tt,"_list_").concat(Le),"aria-selected":Ue.has(V)}),V):null}return he.createElement(he.Fragment,null,he.createElement("div",{role:"listbox",id:"".concat(tt,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ce(lt-1),Ce(lt),Ce(lt+1)),he.createElement(w.a,{itemKey:"key",ref:dt,data:He,height:z,itemHeight:We,fullHeight:!1,onMouseDown:Ze,onScroll:Me,virtual:F,onMouseEnter:De},function(Le,X){var j,V=Le.group,E=Le.groupOption,k=Le.data,R=k.label,W=k.key;if(V)return he.createElement("div",{className:L()(Be,"".concat(Be,"-group"))},R!==void 0?R:W);var ve=k.disabled,oe=k.value,Ne=k.title,qe=k.children,ft=k.style,st=k.className,_t=Object(B.a)(k,["disabled","value","title","children","style","className"]),Lt=Ue.has(oe),pt="".concat(Be,"-option"),$t=L()(Be,pt,st,(j={},Object(ee.a)(j,"".concat(pt,"-grouped"),E),Object(ee.a)(j,"".concat(pt,"-active"),lt===X&&!ve),Object(ee.a)(j,"".concat(pt,"-disabled"),ve),Object(ee.a)(j,"".concat(pt,"-selected"),Lt),j)),jt=je?qe:R,Jt=!Ye||typeof Ye=="function"||Lt;return he.createElement("div",Object.assign({},_t,{"aria-selected":Lt,className:$t,title:Ne,onMouseMove:function(){if(lt===X||ve)return;$e(X)},onClick:function(){ve||at(oe)},style:ft}),he.createElement("div",{className:"".concat(pt,"-content")},jt||oe),he.isValidElement(Ye)||Lt,Jt&&he.createElement(S.a,{className:"".concat(Be,"-option-state"),customizeIcon:Ye,customizeIconProps:{isSelected:Lt}},Lt?"\u2713":null))}))},m=he.forwardRef(M);m.displayName="OptionList";var v=m,T=function(){return null};T.isSelectOption=!0;var O=T,se=function(){return null};se.isSelectOptGroup=!0;var te=se,ue=g("VTBJ"),ke=g("Zm9Q");function ne(b){var q=b.key,Ee=b.props,Se=Ee.children,tt=Ee.value,Qe=Object(B.a)(Ee,["children","value"]);return Object(ue.a)({key:q,value:tt!==void 0?tt:q,children:Se},Qe)}function xe(b){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(ke.a)(b).map(function(Ee,Se){if(!he.isValidElement(Ee)||!Ee.type)return null;var tt=Ee.type.isSelectOptGroup,Qe=Ee.key,je=Ee.props,Ue=je.children,Oe=Object(B.a)(je,["children"]);return q||!tt?ne(Ee):Object(ue.a)(Object(ue.a)({key:"__RC_SELECT_GRP__".concat(Qe===null?Se:Qe,"__"),label:Qe},Oe),{},{options:xe(Ue)})}).filter(function(Ee){return Ee})}var Fe=g("2Qr1"),re=g("qNPg"),A=g("U8pU"),me=g("Kwbf"),Z=g("WKfj");function N(b){var q=b.mode,Ee=b.options,Se=b.children,tt=b.backfill,Qe=b.allowClear,je=b.placeholder,Ue=b.getInputElement,Oe=b.showSearch,Pe=b.onSearch,ae=b.defaultOpen,z=b.autoFocus,We=b.labelInValue,nt=b.value,it=b.inputValue,Ye=b.optionLabelProp,F=q==="multiple"||q==="tags",U=Oe!==void 0?Oe:F||q==="combobox",de=Ee||xe(Se);if(Object(me.a)(q!=="tags"||de.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),q==="tags"||q==="combobox"){var we=de.some(function(Be){return Be.options?Be.options.some(function(He){return typeof("value"in He?He.value:He.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(me.a)(!we,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(me.a)(q!=="combobox"||!Ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(me.a)(q==="combobox"||!tt,"`backfill` only works with `combobox` mode."),Object(me.a)(q==="combobox"||!Ue,"`getInputElement` only work with `combobox` mode."),Object(me.b)(q!=="combobox"||!Ue||!Qe||!je,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!U&&q!=="combobox"&&q!=="tags"&&Object(me.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(me.b)(!ae||z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),nt!=null){var Me=Object(Z.d)(nt);Object(me.a)(!We||Me.every(function(Be){return Object(A.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(me.a)(!F||Array.isArray(nt),"`value` should be array when `mode` is `multiple` or `tags`")}if(Se){var De=null;Object(ke.a)(Se).some(function(Be){if(!he.isValidElement(Be)||!Be.type)return!1;var He=Be.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var dt=Object(ke.a)(Be.props.children).every(function(Ze){return!he.isValidElement(Ze)||!Be.type||Ze.type.isSelectOption?!0:(De=Ze.type,!1)});return!dt}return De=He,!0}),De&&Object(me.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(De.displayName||De.name||De,"`.")),Object(me.a)(it===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var J=N,ce=Object(re.a)({prefixCls:"rc-select",components:{optionList:v},convertChildrenToData:xe,flattenOptions:Fe.d,getLabeledValue:Fe.e,filterOptions:Fe.b,isValueDisabled:Fe.g,findValueOption:Fe.c,warningProps:J,fillOptionsWithMissingValue:Fe.a}),$=function(b){Object(Q.a)(Ee,b);var q=Object(fe.a)(Ee);function Ee(){var Se;return Object(K.a)(this,Ee),Se=q.apply(this,arguments),Se.selectRef=he.createRef(),Se.focus=function(){Se.selectRef.current.focus()},Se.blur=function(){Se.selectRef.current.blur()},Se}return Object(ge.a)(Ee,[{key:"render",value:function(){return he.createElement(ce,Object.assign({ref:this.selectRef},this.props))}}]),Ee}(he.Component);$.Option=O,$.OptGroup=te;var ye=$,_=ie.c=ye},M8RZ:function(ct,ie,g){"use strict";g.d(ie,"a",function(){return D});var K=g("fWQN"),ge=g("mtLc"),Q=g("yKVA"),fe=g("879j"),he=g("q1tI"),ee=g.n(he),B=g("i8i4"),Y=g.n(B),D=function(I){Object(Q.a)(x,I);var y=Object(fe.a)(x);function x(L){var w;Object(K.a)(this,x),w=y.call(this,L);var S=window.document;return w.node=S.createElement("div"),S.body.appendChild(w.node),w}return Object(ge.a)(x,[{key:"render",value:function(){var w=this.props.children;return Object(B.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),x}(ee.a.Component)},MI8n:function(ct,ie,g){"use strict";g.d(ie,"b",function(){return ee}),g.d(ie,"a",function(){return D}),g.d(ie,"e",function(){return I}),g.d(ie,"d",function(){return y}),g.d(ie,"c",function(){return x}),g.d(ie,"f",function(){return L});var K=g("/cxE"),ge=g("C/vA"),Q=g("pmY6"),fe=g("24hK"),he=function(){var w=function(S,M){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,v){m.__proto__=v}||function(m,v){for(var T in v)v.hasOwnProperty(T)&&(m[T]=v[T])},w(S,M)};return function(S,M){w(S,M);function m(){this.constructor=S}S.prototype=M===null?Object.create(M):(m.prototype=M.prototype,new m)}}(),ee;(function(w){w.None=function(){return Q.a.None};function S(J){return function(ce,$,ye){$===void 0&&($=null);var _=!1,b;return b=J(function(q){return _?void 0:(b?b.dispose():_=!0,ce.call($,q))},null,ye),_&&b.dispose(),b}}w.once=S;function M(J,ce){return te(function($,ye,_){return ye===void 0&&(ye=null),J(function(b){return $.call(ye,ce(b))},null,_)})}w.map=M;function m(J,ce){return te(function($,ye,_){return ye===void 0&&(ye=null),J(function(b){ce(b),$.call(ye,b)},null,_)})}w.forEach=m;function v(J,ce){return te(function($,ye,_){return ye===void 0&&(ye=null),J(function(b){return ce(b)&&$.call(ye,b)},null,_)})}w.filter=v;function T(J){return J}w.signal=T;function O(){for(var J=[],ce=0;ce<arguments.length;ce++)J[ce]=arguments[ce];return function($,ye,_){return ye===void 0&&(ye=null),Q.e.apply(void 0,J.map(function(b){return b(function(q){return $.call(ye,q)},null,_)}))}}w.any=O;function se(J,ce,$){var ye=$;return M(J,function(_){return ye=ce(ye,_),ye})}w.reduce=se;function te(J){var ce,$=new D({onFirstListenerAdd:function(){ce=J($.fire,$)},onLastListenerRemove:function(){ce.dispose()}});return $.event}w.snapshot=te;function ue(J,ce,$,ye,_){$===void 0&&($=100),ye===void 0&&(ye=!1);var b,q=void 0,Ee=void 0,Se=0,tt=new D({leakWarningThreshold:_,onFirstListenerAdd:function(){b=J(function(Qe){Se++,q=ce(q,Qe),ye&&!Ee&&(tt.fire(q),q=void 0),clearTimeout(Ee),Ee=setTimeout(function(){var je=q;q=void 0,Ee=void 0,(!ye||Se>1)&&tt.fire(je),Se=0},$)})},onLastListenerRemove:function(){b.dispose()}});return tt.event}w.debounce=ue;function ke(J){var ce=new Date().getTime();return M(S(J),function($){return new Date().getTime()-ce})}w.stopwatch=ke;function ne(J){var ce=!0,$;return v(J,function(ye){var _=ce||ye!==$;return ce=!1,$=ye,_})}w.latch=ne;function xe(J,ce,$){ce===void 0&&(ce=!1),$===void 0&&($=[]);var ye=$.slice(),_=J(function(Ee){ye?ye.push(Ee):q.fire(Ee)}),b=function(){ye&&ye.forEach(function(Ee){return q.fire(Ee)}),ye=null},q=new D({onFirstListenerAdd:function(){_||(_=J(function(Ee){return q.fire(Ee)}))},onFirstListenerDidAdd:function(){ye&&(ce?setTimeout(b):b())},onLastListenerRemove:function(){_&&_.dispose(),_=null}});return q.event}w.buffer=xe;var Fe=function(){function J(ce){this.event=ce}return J.prototype.map=function(ce){return new J(M(this.event,ce))},J.prototype.forEach=function(ce){return new J(m(this.event,ce))},J.prototype.filter=function(ce){return new J(v(this.event,ce))},J.prototype.reduce=function(ce,$){return new J(se(this.event,ce,$))},J.prototype.latch=function(){return new J(ne(this.event))},J.prototype.debounce=function(ce,$,ye,_){return $===void 0&&($=100),ye===void 0&&(ye=!1),new J(ue(this.event,ce,$,ye,_))},J.prototype.on=function(ce,$,ye){return this.event(ce,$,ye)},J.prototype.once=function(ce,$,ye){return S(this.event)(ce,$,ye)},J}();function re(J){return new Fe(J)}w.chain=re;function A(J,ce,$){$===void 0&&($=function(Ee){return Ee});var ye=function(){for(var Ee=[],Se=0;Se<arguments.length;Se++)Ee[Se]=arguments[Se];return q.fire($.apply(void 0,Ee))},_=function(){return J.on(ce,ye)},b=function(){return J.removeListener(ce,ye)},q=new D({onFirstListenerAdd:_,onLastListenerRemove:b});return q.event}w.fromNodeEventEmitter=A;function me(J,ce,$){$===void 0&&($=function(Ee){return Ee});var ye=function(){for(var Ee=[],Se=0;Se<arguments.length;Se++)Ee[Se]=arguments[Se];return q.fire($.apply(void 0,Ee))},_=function(){return J.addEventListener(ce,ye)},b=function(){return J.removeEventListener(ce,ye)},q=new D({onFirstListenerAdd:_,onLastListenerRemove:b});return q.event}w.fromDOMEventEmitter=me;function Z(J){var ce=new D,$=!1;return J.then(void 0,function(){return null}).then(function(){$?ce.fire(void 0):setTimeout(function(){return ce.fire(void 0)},0)}),$=!0,ce.event}w.fromPromise=Z;function N(J){return new Promise(function(ce){return S(J)(ce)})}w.toPromise=N})(ee||(ee={}));var B=-1,Y=function(){function w(S,M){M===void 0&&(M=Math.random().toString(18).slice(2,5)),this.customThreshold=S,this.name=M,this._warnCountdown=0}return w.prototype.dispose=function(){this._stacks&&this._stacks.clear()},w.prototype.check=function(S){var M=this,m=B;if(typeof this.customThreshold=="number"&&(m=this.customThreshold),m<=0||S<m)return;this._stacks||(this._stacks=new Map);var v=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),T=this._stacks.get(v)||0;if(this._stacks.set(v,T+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=m*.5;var O,se=0;this._stacks.forEach(function(te,ue){(!O||se<te)&&(O=ue,se=te)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+S+" listeners already. MOST frequent listener ("+se+"):"),console.warn(O)}return function(){var te=M._stacks.get(v)||0;M._stacks.set(v,te-1)}},w}(),D=function(){function w(S){this._disposed=!1,this._options=S,this._leakageMon=B>0?new Y(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(w.prototype,"event",{get:function(){var S=this;return this._event||(this._event=function(M,m,v){S._listeners||(S._listeners=new fe.a);var T=S._listeners.isEmpty();T&&S._options&&S._options.onFirstListenerAdd&&S._options.onFirstListenerAdd(S);var O=S._listeners.push(m?[M,m]:M);T&&S._options&&S._options.onFirstListenerDidAdd&&S._options.onFirstListenerDidAdd(S),S._options&&S._options.onListenerDidAdd&&S._options.onListenerDidAdd(S,M,m);var se;S._leakageMon&&(se=S._leakageMon.check(S._listeners.size));var te;return te={dispose:function(){if(se&&se(),te.dispose=w._noop,!S._disposed&&(O(),S._options&&S._options.onLastListenerRemove)){var ue=S._listeners&&!S._listeners.isEmpty();ue||S._options.onLastListenerRemove(S)}}},v instanceof Q.b?v.add(te):Array.isArray(v)&&v.push(te),te}),this._event},enumerable:!0,configurable:!0}),w.prototype.fire=function(S){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new fe.a);for(var M=this._listeners.iterator(),m=M.next();!m.done;m=M.next())this._deliveryQueue.push([m.value,S]);for(;this._deliveryQueue.size>0;){var v=this._deliveryQueue.shift(),T=v[0],O=v[1];try{typeof T=="function"?T.call(void 0,O):T[0].call(T[1],O)}catch(se){Object(K.e)(se)}}}},w.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},w._noop=function(){},w}(),I=function(w){he(S,w);function S(M){var m=w.call(this,M)||this;return m._isPaused=0,m._eventQueue=new fe.a,m._mergeFn=M&&M.merge,m}return S.prototype.pause=function(){this._isPaused++},S.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var M=this._eventQueue.toArray();this._eventQueue.clear(),w.prototype.fire.call(this,this._mergeFn(M))}else for(;!this._isPaused&&this._eventQueue.size!==0;)w.prototype.fire.call(this,this._eventQueue.shift())},S.prototype.fire=function(M){this._listeners&&(this._isPaused!==0?this._eventQueue.push(M):w.prototype.fire.call(this,M))},S}(D),y=function(){function w(){var S=this;this.hasListeners=!1,this.events=[],this.emitter=new D({onFirstListenerAdd:function(){return S.onFirstListenerAdd()},onLastListenerRemove:function(){return S.onLastListenerRemove()}})}return Object.defineProperty(w.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),w.prototype.add=function(S){var M=this,m={event:S,listener:null};this.events.push(m),this.hasListeners&&this.hook(m);var v=function(){M.hasListeners&&M.unhook(m);var T=M.events.indexOf(m);M.events.splice(T,1)};return Object(Q.h)(Object(ge.a)(v))},w.prototype.onFirstListenerAdd=function(){var S=this;this.hasListeners=!0,this.events.forEach(function(M){return S.hook(M)})},w.prototype.onLastListenerRemove=function(){var S=this;this.hasListeners=!1,this.events.forEach(function(M){return S.unhook(M)})},w.prototype.hook=function(S){var M=this;S.listener=S.event(function(m){return M.emitter.fire(m)})},w.prototype.unhook=function(S){S.listener&&S.listener.dispose(),S.listener=null},w.prototype.dispose=function(){this.emitter.dispose()},w}(),x=function(){function w(){this.buffers=[]}return w.prototype.wrapEvent=function(S){var M=this;return function(m,v,T){return S(function(O){var se=M.buffers[M.buffers.length-1];se?se.push(function(){return m.call(v,O)}):m.call(v,O)},void 0,T)}},w.prototype.bufferEvents=function(S){var M=[];this.buffers.push(M);var m=S();return this.buffers.pop(),M.forEach(function(v){return v()}),m},w}(),L=function(){function w(){var S=this;this.listening=!1,this.inputEvent=ee.None,this.inputEventListener=Q.a.None,this.emitter=new D({onFirstListenerDidAdd:function(){S.listening=!0,S.inputEventListener=S.inputEvent(S.emitter.fire,S.emitter)},onLastListenerRemove:function(){S.listening=!1,S.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(w.prototype,"input",{set:function(S){this.inputEvent=S,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=S(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),w.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},w}()},N0LK:function(ct,ie,g){"use strict";g.d(ie,"x",function(){return K}),g.d(ie,"F",function(){return ge}),g.d(ie,"r",function(){return fe}),g.d(ie,"o",function(){return he}),g.d(ie,"p",function(){return ee}),g.d(ie,"Q",function(){return B}),g.d(ie,"K",function(){return D}),g.d(ie,"k",function(){return I}),g.d(ie,"N",function(){return y}),g.d(ie,"m",function(){return x}),g.d(ie,"l",function(){return L}),g.d(ie,"I",function(){return w}),g.d(ie,"H",function(){return S}),g.d(ie,"q",function(){return M}),g.d(ie,"t",function(){return m}),g.d(ie,"D",function(){return v}),g.d(ie,"e",function(){return T}),g.d(ie,"f",function(){return O}),g.d(ie,"B",function(){return se}),g.d(ie,"C",function(){return te}),g.d(ie,"n",function(){return ke}),g.d(ie,"O",function(){return xe}),g.d(ie,"c",function(){return Fe}),g.d(ie,"d",function(){return re}),g.d(ie,"z",function(){return A}),g.d(ie,"A",function(){return me}),g.d(ie,"u",function(){return Z}),g.d(ie,"E",function(){return J}),g.d(ie,"G",function(){return ce}),g.d(ie,"i",function(){return ye}),g.d(ie,"g",function(){return b}),g.d(ie,"v",function(){return Ee}),g.d(ie,"h",function(){return Se}),g.d(ie,"y",function(){return tt}),g.d(ie,"w",function(){return Qe}),g.d(ie,"a",function(){return je}),g.d(ie,"P",function(){return Ue}),g.d(ie,"L",function(){return Oe}),g.d(ie,"J",function(){return Pe}),g.d(ie,"j",function(){return ae}),g.d(ie,"M",function(){return z}),g.d(ie,"s",function(){return We}),g.d(ie,"b",function(){return nt});function K(F){return!F||typeof F!="string"?!0:F.trim().length===0}function ge(F,U,de){de===void 0&&(de="0");for(var we=""+F,Me=[we],De=we.length;De<U;De++)Me.push(de);return Me.reverse().join("")}var Q=/{(\d+)}/g;function fe(F){for(var U=[],de=1;de<arguments.length;de++)U[de-1]=arguments[de];return U.length===0?F:F.replace(Q,function(we,Me){var De=parseInt(Me,10);return isNaN(De)||De<0||De>=U.length?we:U[De]})}function he(F){return F.replace(/[<>&]/g,function(U){switch(U){case"<":return"<";case">":return">";case"&":return"&";default:return U}})}function ee(F){return F.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function B(F,U){U===void 0&&(U=" ");var de=Y(F,U);return D(de,U)}function Y(F,U){if(!F||!U)return F;var de=U.length;if(de===0||F.length===0)return F;for(var we=0;F.indexOf(U,we)===we;)we=we+de;return F.substring(we)}function D(F,U){if(!F||!U)return F;var de=U.length,we=F.length;if(de===0||we===0)return F;for(var Me=we,De=-1;!(De=F.lastIndexOf(U,Me-1),De===-1||De+de!==Me);){if(De===0)return"";Me=De}return F.substring(0,Me)}function I(F){return F.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function y(F,U){if(F.length<U.length)return!1;if(F===U)return!0;for(var de=0;de<U.length;de++)if(F[de]!==U[de])return!1;return!0}function x(F,U){var de=F.length-U.length;return de>0?F.indexOf(U,de)===de:de===0?F===U:!1}function L(F,U,de){if(de===void 0&&(de={}),!F)throw new Error("Cannot create regex from empty string");U||(F=ee(F)),de.wholeWord&&(/\B/.test(F.charAt(0))||(F="\\b"+F),/\B/.test(F.charAt(F.length-1))||(F=F+"\\b"));var we="";return de.global&&(we+="g"),de.matchCase||(we+="i"),de.multiline&&(we+="m"),de.unicode&&(we+="u"),new RegExp(F,we)}function w(F){if(F.source==="^"||F.source==="^$"||F.source==="$"||F.source==="^\\s*$")return!1;var U=F.exec("");return!!(U&&F.lastIndex===0)}function S(F){return(F.global?"g":"")+(F.ignoreCase?"i":"")+(F.multiline?"m":"")+(F.unicode?"u":"")}function M(F){for(var U=0,de=F.length;U<de;U++){var we=F.charCodeAt(U);if(we!==32&&we!==9)return U}return-1}function m(F,U,de){U===void 0&&(U=0),de===void 0&&(de=F.length);for(var we=U;we<de;we++){var Me=F.charCodeAt(we);if(Me!==32&&Me!==9)return F.substring(U,we)}return F.substring(U,de)}function v(F,U){U===void 0&&(U=F.length-1);for(var de=U;de>=0;de--){var we=F.charCodeAt(de);if(we!==32&&we!==9)return de}return-1}function T(F,U){return F<U?-1:F>U?1:0}function O(F,U){for(var de=Math.min(F.length,U.length),we=0;we<de;we++){var Me=F.charCodeAt(we),De=U.charCodeAt(we);if(Me===De)continue;te(Me)&&(Me+=32),te(De)&&(De+=32);var Be=Me-De;if(Be===0)continue;return se(Me)&&se(De)?Be:T(F.toLowerCase(),U.toLowerCase())}return F.length<U.length?-1:F.length>U.length?1:0}function se(F){return F>=97&&F<=122}function te(F){return F>=65&&F<=90}function ue(F){return se(F)||te(F)}function ke(F,U){return F.length===U.length&&ne(F,U)}function ne(F,U,de){de===void 0&&(de=F.length);for(var we=0;we<de;we++){var Me=F.charCodeAt(we),De=U.charCodeAt(we);if(Me===De)continue;if(ue(Me)&&ue(De)){var Be=Math.abs(Me-De);if(Be!==0&&Be!==32)return!1}else if(String.fromCharCode(Me).toLowerCase()!==String.fromCharCode(De).toLowerCase())return!1}return!0}function xe(F,U){var de=U.length;return U.length>F.length?!1:ne(F,U,de)}function Fe(F,U){var de,we=Math.min(F.length,U.length);for(de=0;de<we;de++)if(F.charCodeAt(de)!==U.charCodeAt(de))return de;return we}function re(F,U){var de,we=Math.min(F.length,U.length),Me=F.length-1,De=U.length-1;for(de=0;de<we;de++)if(F.charCodeAt(Me-de)!==U.charCodeAt(De-de))return de;return we}function A(F){return 55296<=F&&F<=56319}function me(F){return 56320<=F&&F<=57343}function Z(F,U,de){var we=F.charCodeAt(de);if(A(we)&&de+1<U){var Me=F.charCodeAt(de+1);if(me(Me))return(we-55296<<10)+(Me-56320)+65536}return we}function N(F,U){var de=F.charCodeAt(U-1);if(me(de)&&U>1){var we=F.charCodeAt(U-2);if(A(we))return(we-55296<<10)+(de-56320)+65536}return de}function J(F,U){var de=it.getInstance(),we=U,Me=F.length,De=Z(F,Me,U);U+=De>=65536?2:1;for(var Be=de.getGraphemeBreakType(De);U<Me;){var He=Z(F,Me,U),dt=de.getGraphemeBreakType(He);if(nt(Be,dt))break;U+=He>=65536?2:1,Be=dt}return U-we}function ce(F,U){var de=it.getInstance(),we=U,Me=N(F,U);U-=Me>=65536?2:1;for(var De=de.getGraphemeBreakType(Me);U>0;){var Be=N(F,U),He=de.getGraphemeBreakType(Be);if(nt(He,De))break;U-=Be>=65536?2:1,De=He}return we-U}var $=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function ye(F){return $.test(F)}var _=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function b(F){return _.test(F)}var q=/^[\t\n\r\x20-\x7E]*$/;function Ee(F){return q.test(F)}function Se(F){for(var U=0,de=F.length;U<de;U++)if(tt(F.charCodeAt(U)))return!0;return!1}function tt(F){return F=+F,F>=11904&&F<=55215||F>=63744&&F<=64255||F>=65281&&F<=65374}function Qe(F){return F>=127462&&F<=127487||F>=9728&&F<=10175||F>=127744&&F<=128591||F>=128640&&F<=128764||F>=128992&&F<=129003||F>=129280&&F<=129535||F>=129648&&F<=129651||F>=129656&&F<=129666||F>=129680&&F<=129685}var je=String.fromCharCode(65279);function Ue(F){return!!(F&&F.length>0&&F.charCodeAt(0)===65279)}function Oe(F){return btoa(encodeURIComponent(F))}function Pe(F,U){for(var de="",we=0;we<U;we++)de+=F;return de}function ae(F,U){return U===void 0&&(U=!1),F?(U&&(F=F.replace(/\\./g,"")),F.toLowerCase()!==F):!1}function z(F){var U=90-65+1;return F=F%(2*U),F<U?String.fromCharCode(97+F):String.fromCharCode(65+F-U)}function We(F){var U=it.getInstance();return U.getGraphemeBreakType(F)}function nt(F,U){return F===0?U!==5&&U!==7:F===2&&U===3?!1:F===4||F===2||F===3||(U===4||U===2||U===3)?!0:F===8&&(U===8||U===9||U===11||U===12)||((F===11||F===9)&&(U===9||U===10)||((F===12||F===10)&&U===10||(U===5||U===13||(U===7||(F===1||F===13&&U===14)))))?!1:!(F===6&&U===6)}var it=function(){function F(){this._data=Ye()}return F.getInstance=function(){return F._INSTANCE||(F._INSTANCE=new F),F._INSTANCE},F.prototype.getGraphemeBreakType=function(U){if(U<32)return U===10?3:U===13?2:4;if(U<127)return 0;for(var de=this._data,we=de.length/3,Me=1;Me<=we;)if(U<de[3*Me])Me=2*Me;else if(U>de[3*Me+1])Me=2*Me+1;else return de[3*Me+2];return 0},F._INSTANCE=null,F}();function Ye(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},OLES:function(ct,ie,g){"use strict";var K=g("U8pU"),ge=g("VTBJ"),Q=g("Ff2n"),fe=g("q1tI"),he=g("uciX"),ee=g("7ixt"),B=function(L){var w=L.overlay,S=L.prefixCls,M=L.id,m=L.overlayInnerStyle;return fe.createElement("div",{className:"".concat(S,"-inner"),id:M,role:"tooltip",style:m},typeof w=="function"?w():w)},Y=B,D=function(L,w){var S=L.overlayClassName,M=L.trigger,m=M===void 0?["hover"]:M,v=L.mouseEnterDelay,T=v===void 0?0:v,O=L.mouseLeaveDelay,se=O===void 0?.1:O,te=L.overlayStyle,ue=L.prefixCls,ke=ue===void 0?"rc-tooltip":ue,ne=L.children,xe=L.onVisibleChange,Fe=L.afterVisibleChange,re=L.transitionName,A=L.animation,me=L.placement,Z=me===void 0?"right":me,N=L.align,J=N===void 0?{}:N,ce=L.destroyTooltipOnHide,$=ce===void 0?!1:ce,ye=L.defaultVisible,_=L.getTooltipContainer,b=L.overlayInnerStyle,q=Object(Q.a)(L,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Ee=Object(fe.useRef)(null);Object(fe.useImperativeHandle)(w,function(){return Ee.current});var Se=Object(ge.a)({},q);"visible"in L&&(Se.popupVisible=L.visible);var tt=function(){var Pe=L.arrowContent,ae=Pe===void 0?null:Pe,z=L.overlay,We=L.id;return[fe.createElement("div",{className:"".concat(ke,"-arrow"),key:"arrow"},ae),fe.createElement(Y,{key:"content",prefixCls:ke,id:We,overlay:z,overlayInnerStyle:b})]},Qe=!1,je=!1;if(typeof $=="boolean")Qe=$;else if($&&Object(K.a)($)==="object"){var Ue=$.keepParent;Qe=Ue===!0,je=Ue===!1}return fe.createElement(he.a,Object.assign({popupClassName:S,prefixCls:ke,popup:tt,action:m,builtinPlacements:ee.a,popupPlacement:Z,ref:Ee,popupAlign:J,getPopupContainer:_,onPopupVisibleChange:xe,afterPopupVisibleChange:Fe,popupTransitionName:re,popupAnimation:A,defaultPopupVisible:ye,destroyPopupOnHide:Qe,autoDestroy:je,mouseLeaveDelay:se,popupStyle:te,mouseEnterDelay:T},Se),ne)},I=Object(fe.forwardRef)(D),y=ie.a=I},Ot1p:function(ct,ie,g){"use strict";var K=g("2qtc"),ge=g("kLXV"),Q=g("rAM+"),fe=g("miYZ"),he=g("tsqr"),ee=g("9og8"),B=g("tJVT"),Y=g("jrin"),D=g("WmNS"),I=g.n(D),y=g("q1tI"),x=g.n(y),L=g("VrN/"),w=g.n(L),S=g("bdgK"),M=g("p77/"),m=g("Bd2K"),v=g("ELLl"),T=g("19Vz"),O=g("lZu9"),se=g("+NIl"),te=g("kSUc"),ue=g("9Bee"),ke=function(oe){var Ne=oe.value,qe=Ne===void 0?"":Ne,ft=oe.className,st=oe.showTextOnly,_t=oe.showLines,Lt=oe.style,pt=Lt===void 0?{}:Lt,$t=Object(y.useMemo)(function(){return""},[qe]);return x.a.createElement(x.a.Fragment,null,x.a.createElement("div",{dangerouslySetInnerHTML:{__html:$t}}))},ne=g("0Owb"),xe=g("dejd"),Fe=g("C+DQ"),re=g("1vsH"),A=g("m3rI"),me=[{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 Z(oe){var Ne=oe.onActionCallback,qe=oe.title,ft=oe.icon,st=oe.actionName,_t=oe.className,Lt=_t===void 0?"":_t,pt=oe.children;function $t(){Ne(st)}return x.a.createElement("a",{title:qe,className:Lt,onClick:$t},x.a.createElement("i",{className:"md-iconfont ".concat(ft)}),pt)}var N=function(oe){var Ne=oe.watch,qe=oe.showNullButton,ft=oe.onActionCallback,st=oe.fullScreen,_t=oe.insertTemp,Lt=oe.hidetoolBar,pt=oe.uuid,$t=oe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(re.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(re.D)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(A.a.PROXY_SERVER)));var jt=[].concat(me,[{title:"".concat(Ne?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ne?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return x.a.createElement("ul",{className:"markdown-toolbar-container"},!Lt&&jt.map(function(Jt,Ht){return x.a.createElement("li",{key:Ht},Jt.actionName?x.a.createElement(Z,Object(ne.a)({},Jt,{onActionCallback:ft})):x.a.createElement("span",{className:"v-line"}))}),qe?x.a.createElement("li",null,x.a.createElement(Z,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ft},x.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,_t&&x.a.createElement("li",null,x.a.createElement(Z,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(_t),onActionCallback:ft},x.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),x.a.createElement("li",{className:"btn-full-screen"},x.a.createElement(Z,{icon:"".concat(st?"icon-shrink":"icon-enlarge"),title:st?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ft})))},J=g("M8RZ"),ce=g("+L6B"),$=g("2/Rp"),ye=g("y8nQ"),_=g("Vl3Y"),b=g("5NDa"),q=g("5rEg"),Ee={labelCol:{span:4},wrapperCol:{span:20}},Se=function(oe){var Ne=oe.callback,qe=oe.onCancel;function ft(st){Ne(st)}return x.a.createElement(_.a,Object(ne.a)({},Ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ft}),x.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},x.a.createElement(q.a,null)),x.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},x.a.createElement(q.a,null)),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement($.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},tt=g("7ahc"),Qe=g("k1fw"),je=g("HmJG"),Ue=g("BjJ7"),Oe=_.a.useForm,Pe={width:280,marginRight:10},ae={labelCol:{span:5},wrapperCol:{span:19}},z=function(oe){var Ne=oe.callback,qe=oe.onCancel,ft=Oe(),st=Object(B.a)(ft,1),_t=st[0],Lt=Object(y.useRef)();function pt(Jt){Ne(Object(Qe.a)(Object(Qe.a)({},Jt),{},{name:Lt.current}))}function $t(Jt,Ht){_t.setFieldsValue({src:"/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type),type:Ht.type})}function jt(Jt){var Ht=Jt.target.files[0];Lt.current=Ht.name,nt(Ht,$t)}return x.a.createElement(_.a,Object(ne.a)({form:_t},ae,{className:"upload-image-panel",onFinish:pt}),x.a.createElement(_.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},x.a.createElement("div",{className:"flex-container"},x.a.createElement(_.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},x.a.createElement(q.a,{style:Pe})),x.a.createElement(We,{onFileChange:jt}))),x.a.createElement(_.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},x.a.createElement(q.a,{style:{width:264}})),x.a.createElement(_.a.Item,{style:{textAlign:"right"}},x.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement($.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))};function We(oe){var Ne=oe.onFileChange;return x.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",x.a.createElement("input",{type:"file",onChange:Ne}))}function nt(oe,Ne){if(!oe)throw new String("\u6CA1\u6709\u6587\u4EF6");var qe=new FormData;qe.append("editormd-image-file",oe),qe.append("file_param_name","editormd-image-file"),qe.append("byxhr","true");var ft=new window.XMLHttpRequest;ft.withCredentials=!0,ft.addEventListener("load",function(st){Ne(JSON.parse(st.target.responseText),oe)},!1),ft.addEventListener("error",function(st){console.error(st)},!1),ft.open("POST","".concat(Ue.a,"/api/attachments.json")),ft.send(qe)}var it=g("giR+"),Ye=g("fyUT"),F=g("7Kak"),U=g("9yH6"),de=U.a.Group,we={margin:"0 8px"},Me=function(oe){var Ne=oe.callback,qe=oe.onCancel;function ft(st){Ne(st)}return x.a.createElement(_.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ft},x.a.createElement("div",{className:"flex-container"},x.a.createElement("span",{style:we},"\u5355\u5143\u683C\u6570\uFF1A"),x.a.createElement("span",{style:we},"\u884C\u6570"),x.a.createElement(_.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},x.a.createElement(Ye.a,null)),x.a.createElement("span",{style:we},"\u5217\u6570"),x.a.createElement(_.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},x.a.createElement(Ye.a,null))),x.a.createElement("div",{className:"flex-container",style:{marginTop:12}},x.a.createElement("span",{style:we},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),x.a.createElement(_.a.Item,{name:"align"},x.a.createElement(de,null,x.a.createElement(U.a,{value:"default"},x.a.createElement("i",{className:"fa fa-align-justify"})),x.a.createElement(U.a,{value:"left"},x.a.createElement("i",{className:"fa fa-align-left"})),x.a.createElement(U.a,{value:"center"},x.a.createElement("i",{className:"fa fa-align-center"})),x.a.createElement(U.a,{value:"right"},x.a.createElement("i",{className:"fa fa-align-right"}))))),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement($.a,{type:"ghost",onClick:qe},"\u53D6\u6D88")))},De=g("ErOA"),Be=g("7Cbv"),He="link",dt="upload-image",Ze="code-block",Je="add-table",Ve="------------",yt={default:Ve,left:":".concat(Ve),center:":".concat(Ve,":"),right:"".concat(Ve,":")},mt=g("9VGf"),lt,be;function $e(){}var at=0,Ce=1e4,Le="\u2581",X=`
|
|
**\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 j(oe){return/^\d+$/.test(oe)?"".concat(oe,"px"):oe}var V=navigator.platform.toUpperCase().indexOf("MAC")>=0,E=V?"Cmd":"Ctrl",k=["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"],R=(lt={},Object(Y.a)(lt,E+"-B","bold"),Object(Y.a)(lt,E+"-I","italic"),lt),W=(be={},Object(Y.a)(be,He,"\u6DFB\u52A0\u94FE\u63A5"),Object(Y.a)(be,Ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(Y.a)(be,dt,"\u6DFB\u52A0\u6587\u4EF6"),Object(Y.a)(be,Je,"\u6DFB\u52A0\u8868\u683C"),be),ve=ie.a=function(oe){var Ne=oe.defaultValue,qe=Ne===void 0?"":Ne,ft=oe.onChange,st=oe.width,_t=st===void 0?"100%":st,Lt=oe.height,pt=Lt===void 0?400:Lt,$t=oe.miniToolbar,jt=$t===void 0?!1:$t,Jt=oe.isFocus,Ht=Jt===void 0?!1:Jt,Mt=oe.watch,Un=oe.insertTemp,Qn=oe.mode,bt=Qn===void 0?"markdown":Qn,wt=oe.id,et=wt===void 0?"markdown-editor-id":wt,xt=oe.showResizeBar,Zt=xt===void 0?!1:xt,rn=oe.noStorage,nn=rn===void 0?!1:rn,At=oe.showNullButton,gt=At===void 0?!1:At,On=oe.hidetoolBar,ni=On===void 0?!1:On,kn=oe.fullScreen,Ot=kn===void 0?!1:kn,_n=oe.onBlur,Vn=oe.onCMBeforeChange,ii=oe.onFullScreen,_e=oe.className,rt=_e===void 0?"":_e,Rt=oe.disablePaste,Gt=Rt===void 0?!1:Rt,Xt=oe.placeholder,qt=Xt===void 0?"":Xt,h=oe.values,o=h===void 0?"":h,a=Object(y.useState)(null),u=Object(B.a)(a,2),d=u[0],c=u[1],G=Object(y.useState)(qe),Ae=Object(B.a)(G,2),Ge=Ae[0],ut=Ae[1],Re=Object(y.useState)(Mt),kt=Object(B.a)(Re,2),Nt=kt[0],en=kt[1],Kn=Object(y.useState)(Ot),Xn=Object(B.a)(Kn,2),mn=Xn[0],qn=Xn[1],zi=Object(y.useState)(""),Dn=Object(B.a)(zi,2),Yn=Dn[0],Wn=Dn[1],bi=Object(y.useState)(0),ri=Object(B.a)(bi,2),mi=ri[0],hi=ri[1],cr=Object(y.useState)(pt),Gi=Object(B.a)(cr,2),oi=Gi[0],$n=Gi[1],Mi=Object(y.useState)(!1),Oi=Object(B.a)(Mi,2),dr=Oi[0],sn=Oi[1],Ut=Object(y.useRef)(Object(Be.a)()),wn=Object(y.useRef)(!1),Ft=Object(y.useRef)(),cn=Object(y.useRef)(),Vt=Object(y.useRef)(),ci=Object(y.useRef)(),un=Object(y.useRef)(),Rn=function(){var vt=Object(ee.a)(I.a.mark(function Tt(){var Et,Pt;return I.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(De.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ut.current}});case 2:Pt=Yt.sent,Pt!=null&&(Et=Pt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",d,cn),Pt.attachments.map(function(Bt){Bt.content_type.indexOf("image")>-1?d.replaceSelection(".concat(Bt.content_type,")")):Bt.content_type.indexOf("video")>-1?d.replaceSelection('<video width="100%" controls src="'.concat(A.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Bt.content_type.indexOf("pdf")>-1?d.replaceSelection('<a href="'.concat(A.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,'&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):d.replaceSelection("[".concat(Bt.name,"](").concat(A.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}));case 4:case"end":return Yt.stop()}},Tt)}));return function(){return vt.apply(this,arguments)}}();Object(y.useEffect)(function(){ut(o),d==null||d.setValue(o)},[o]),Object(y.useEffect)(function(){ii==null||ii(mn)},[mn]),Object(y.useEffect)(function(){if(cn.current){var vt=w.a.fromTextArea(cn.current,{mode:bt,lineNumbers:!jt,lineWrapping:!0,value:qe,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&vt.focus();function Tt(Et,Pt){if(Gt){Pt.preventDefault();return}var Wt=Pt.clipboardData;if(Wt){var Yt=Wt.types.toString(),Bt=Wt.items;if(Yt==="Files"||Wt.types.indexOf("Files")>-1){if(Pt.preventDefault(),bt=="stex")return;try{var dn,Pn=Bt[1];((dn=Bt[0])===null||dn===void 0?void 0:dn.kind)==="file"&&(Pn=Bt[0]);var It=Pn.getAsFile(),Ci=It.name.split(".").pop();nt(It,function(zt){if(zt.id){var vn,ei,ti;(It==null||((vn=It.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?vt.replaceSelection(".concat(zt.content_type,")")):(It==null||((ei=It.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(It==null||((ti=It.type)===null||ti===void 0)?void 0:ti.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(It.type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):k.includes(Ci)?vt.replaceSelection('<a href="'.concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(It.name,"</a>")):vt.replaceSelection("[".concat(It.name,"](").concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){he.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Tt),vt.on("dragleave",function(Et,Pt){Vt.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(Et,Pt){Vt.current.classList.add("mouse-hover-md")}),vt.on("drop",function(Et,Pt){Vt.current.classList.add("mouse-hover-md");var Wt;if(Wt=Pt.dataTransfer.files,Wt.length>0){Pt.preventDefault(),Pt.stopPropagation();for(var Yt=function(Pn){var It=Wt[Pn],Ci=It.name.split(".").pop();nt(It,function(zt){if(zt.id){var vn,ei,ti;(It==null||((vn=It.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?vt.replaceSelection(".concat(zt.content_type,")")):(It==null||((ei=It.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(It==null||((ti=It.type)===null||ti===void 0)?void 0:ti.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(It.type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):k.includes(Ci)?vt.replaceSelection('<a href="'.concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(It.name,"</a>")):vt.replaceSelection("[".concat(It.name,"](").concat(A.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},Bt=0;Bt<Wt.length;Bt++)Yt(Bt)}}),c(vt),function(){vt.off("paste",Tt)}}},[]);var Vi=Object(y.useCallback)(function(){if(Vt.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[oi,Vt,mn]);Object(y.useEffect)(function(){function vt(){var Et=new S.default(function(Pt){var Wt=Object(Q.a)(Pt),Yt;try{for(Wt.s();!(Yt=Wt.n()).done;){var Bt=Yt.value;(Bt.target.offsetHeight>0||Bt.target.offsetWidth>0)&&(Vi(),d.setSize("100%","100%"),d.refresh())}}catch(dn){Wt.e(dn)}finally{Wt.f()}});return Et.observe(cn.current.parentElement),Et}if(d){var Tt=vt();return function(){Tt.unobserve(cn.current.parentElement)}}},[d,Vi]),Object(y.useEffect)(function(){if(d){for(var vt=[],Tt=function(){var Bt=Pt[Et];Wt=Object(B.a)(Bt,2);var dn=Wt[0],Pn=Wt[1],It=Object(Y.a)({},dn,function(){Ki(Pn)});vt.push(It),d.addKeyMap(It)},Et=0,Pt=Object.entries(R);Et<Pt.length;Et++){var Wt;Tt()}return Ft.current=setInterval(function(){wn.current&&Rn()},4e3),function(){clearInterval(Ft.current);var Yt=Object(Q.a)(vt),Bt;try{for(Yt.s();!(Bt=Yt.n()).done;){var dn=Bt.value;d.removeKeyMap(dn)}}catch(Pn){Yt.e(Pn)}finally{Yt.f()}}}},[d]),Object(y.useEffect)(function(){Ot!==mn&&qn(Ot)},[Ot]),Object(mt.a)(function(){if(!nn&&mi>0){var vt=new Date().getTime(),Tt=window.sessionStorage.getItem(et);vt>=mi+Ce&&(!Tt||Tt!==Ge)&&(window.sessionStorage.setItem(et,Ge),sn(!0))}},Ce),Object(y.useEffect)(function(){en(Mt)},[d,Mt]),Object(y.useEffect)(function(){d&&(Ht&&d.focus())},[d,Ht]),Object(y.useEffect)(function(){if(Nt&&d){var vt=d.getScrollerElement();function Tt(Et){var Pt=Et.target;if(un.current){var Wt=Pt.scrollTop/Pt.scrollHeight;un.current.scrollTop=un.current.scrollHeight*Wt}}return vt.addEventListener("scroll",Tt),function(){vt.removeEventListener("scroll",Tt)}}},[d,Nt]),Object(y.useEffect)(function(){if(d&&Vn){function vt(Tt,Et){Vn(Tt,Et)}return d.on("beforeChange",vt),function(){d.off("beforeChange",vt)}}},[d,Vn]),Object(y.useEffect)(function(){if(d&&_n){function vt(){_n(d.getValue())}return d.on("blur",vt),function(){d.off("blur",vt)}}},[d,_n]),Object(y.useEffect)(function(){if(d){function vt(Tt){var Et=Tt.getValue();ut(Et),hi(new Date().getTime()),Tt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ft&&ft(Et)}return d.on("change",vt),function(){d.off("change",vt)}}},[d,ft]),Object(y.useEffect)(function(){d&&(qe==null?(d.setValue(""),ut("")):qe!==d.getValue()&&(d.setValue(qe),ut(qe),d.setCursor(d.lineCount(),0)))},[d,qe]);var Ki=Object(y.useCallback)(function(vt){var Tt=d.getCursor(),Et=d.getSelection(),Pt=Et.split(`
|
|
`);switch(vt){case"bold":return d.replaceSelection("**"+Et+"**"),Et===""&&d.setCursor(Tt.line,Tt.ch+2),d.focus();case"italic":return d.replaceSelection("*"+Et+"*"),Et===""&&d.setCursor(Tt.line,Tt.ch+1),d.focus();case"code":return d.replaceSelection("`"+Et+"`"),Et===""&&d.setCursor(Tt.line,Tt.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+Et+"$$`"),Et===""&&d.setCursor(Tt.line,Tt.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+Et+"\n```"),d.setCursor(Tt.line+1,Et.length+1),d.focus();case"line-break":return d.replaceSelection(`<br/>
|
|
`),d.focus();case"list-ul":return Et===""?d.replaceSelection("- "+Et):d.replaceSelection(Pt.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(`
|
|
`)),d.focus();case"list-ol":return Et===""?d.replaceSelection("1. "+Et):d.replaceSelection(Pt.map(function(Wt,Yt){return Wt===""?"":"".concat(Yt+1,". ").concat(Wt)}).join(`
|
|
`)),d.focus();case"add-null-ch":return Et===""&&d.setCursor(Tt.line,Tt.ch+1),d.replaceSelection(Le),d.focus();case"inster-template-1":return Et===""&&d.setCursor(Tt.line,Tt.ch),d.replaceSelection(X),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return en(!Nt),d.focus();case"trigger-full-screen":return qn(!mn),d.focus();case He:Wn(He);return;case Ze:Wn(Ze);return;case dt:Wn(dt);return;case Je:Wn(Je);return;default:throw new Error}},[d,Nt,mn]),xi=Object(y.useCallback)(function(vt){Wn("");switch(Yn){case He:var Tt=vt.title,Et=vt.link;return d.replaceSelection("[".concat(Tt,"](").concat(Et,")")),d.focus();case Ze:var Pt=vt.language,Wt=vt.content;return d.replaceSelection(["```"+Pt,Wt,"```"].join(`
|
|
`)),d.focus();case dt:var Yt=vt.src,Bt=vt.alt,dn=vt.name;return Yt.indexOf("type=image")>-1?d.replaceSelection(".concat(Yt,' "').concat(Bt||"",'" )')):Yt.indexOf("type=application/pdf")>-1?d.replaceSelection('<a href="'.concat(Yt,'&disposition=inline" target="_blank">').concat(dn,"</a>")):d.replaceSelection('<a href="'.concat(Yt,'" target="_blank">').concat(dn,"</a>")),d.focus();case Je:for(var Pn=vt.row,It=vt.col,Ci=vt.align,zt=`
|
|
`,vn=0;vn<Pn;vn++){for(var ei=[],ti=[],Wr=0;Wr<It;Wr++)vn===1&&ti.push(yt[Ci]),ei.push(" ");vn===1&&(zt+="| ".concat(ti.join(" | "),` |
|
|
`)),zt+="| ".concat(ei.join(It===1?"":" | "),` |
|
|
`)}return d.replaceSelection(zt+`
|
|
`),d.focus();default:throw new Error}},[d,Yn]),Fr=Object(y.useMemo)(function(){switch(Yn){case He:return x.a.createElement(Se,{callback:xi,onCancel:Hn});case Ze:return x.a.createElement(tt.b,{callback:xi,onCancel:Hn});case dt:return x.a.createElement(z,{callback:xi,onCancel:Hn});case Je:return x.a.createElement(Me,{callback:xi,onCancel:Hn});default:return null}},[Yn]);function Hn(){Wn("")}Object(y.useEffect)(function(){if(ci.current){var vt=ci.current,Tt=!1,Et=0;function Pt(Bt){Tt=!0,Et=Bt.pageY}function Wt(){Tt=!1}function Yt(Bt){if(Tt){var dn=Bt.pageY-Et;dn<0&&(dn=0),dn>300&&(dn=300);var Pn=pt+dn+"px";$n(Pn)}}return vt.addEventListener("mousedown",Pt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Wt),function(){vt.removeEventListener("mousedown",Pt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Wt)}}},[d,ci]),Object(y.useEffect)(function(){$n(pt)},[pt]);var fr=j(_t),ai=j(oi),Xi={width:fr,height:ai},Ur=Object(y.useMemo)(function(){if(mi){var vt=new Date(mi),Tt=vt.getHours(),Et=vt.getMinutes(),Pt=vt.getSeconds();return Tt=Tt<10?"0"+Tt:Tt,Et=Et<10?"0"+Et:Et,Pt=Pt<10?"0"+Pt:Pt,"".concat(Tt,":").concat(Et,":").concat(Pt)}return 0},[mi]);function Di(){window.sessionStorage.removeItem(et),sn(!1),hi(0)}function Jo(){sn(!1),hi(0),d.setValue(window.sessionStorage.getItem(et))}function ho(vt,Tt){var Et=d.getValue();Et=Et.replace(vt,Tt),ut(Et),d==null||d.setValue(Et)}return x.a.createElement(y.Fragment,null,x.a.createElement("div",{className:"markdown-editor-wrapper",ref:Vt},x.a.createElement("div",{className:"markdown-editor-container ".concat(rt," ").concat(Nt?"on-preview":""," ").concat(jt?"mini":""," ").concat(mn?"full-screen":""),style:Xi},x.a.createElement(N,{insertTemp:Un,watch:Nt,fullScreen:mn,showNullButton:gt,onActionCallback:Ki,hidetoolBar:ni,uuid:Ut.current,setOpenPhones:function(){wn.current=!0}}),x.a.createElement("div",{className:"markdown-editor-body"},x.a.createElement("div",{className:"codemirror-container"},x.a.createElement("textarea",{ref:cn,placeholder:qt})),Nt?x.a.createElement("div",{ref:un,className:"preview-container"},bt==="stex"&&x.a.createElement(ke,{value:Ge}),bt!=="stex"&&x.a.createElement(ue.a,{edit:!0,value:Ge,replaces:ho})):null))),Zt?x.a.createElement("a",{ref:ci,className:"editor-resize"}):null,x.a.createElement(J.a,null,W[Yn]?x.a.createElement(ge.a,{centered:!0,title:W[Yn],visible:!0,onCancel:Hn,footer:null},Fr):null))}},QDVR:function(ct,ie,g){"use strict";g.d(ie,"e",function(){return ge}),g.d(ie,"d",function(){return Q}),g.d(ie,"c",function(){return B}),g.d(ie,"b",function(){return Y}),g.d(ie,"a",function(){return I});var K=function(){var y=function(x,L){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,S){w.__proto__=S}||function(w,S){for(var M in S)S.hasOwnProperty(M)&&(w[M]=S[M])},y(x,L)};return function(x,L){y(x,L);function w(){this.constructor=x}x.prototype=L===null?Object.create(L):(w.prototype=L.prototype,new w)}}();function ge(y){var x=[];return y.forEach(function(L){return x.push(L)}),x}function Q(y){var x=[];return y.forEach(function(L,w){return x.push(w)}),x}var fe=function(){function y(){this._value="",this._pos=0}return y.prototype.reset=function(x){return this._value=x,this._pos=0,this},y.prototype.next=function(){return this._pos+=1,this},y.prototype.hasNext=function(){return this._pos<this._value.length-1},y.prototype.cmp=function(x){var L=x.charCodeAt(0),w=this._value.charCodeAt(this._pos);return L-w},y.prototype.value=function(){return this._value[this._pos]},y}(),he=function(){function y(x){x===void 0&&(x=!0),this._splitOnBackslash=x}return y.prototype.reset=function(x){return this._value=x.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},y.prototype.hasNext=function(){return this._to<this._value.length},y.prototype.next=function(){this._from=this._to;for(var x=!0;this._to<this._value.length;this._to++){var L=this._value.charCodeAt(this._to);if(L===47||this._splitOnBackslash&&L===92)if(x)this._from++;else break;else x=!1}return this},y.prototype.cmp=function(x){for(var L=0,w=x.length,S=this._from;L<w&&S<this._to;){var M=x.charCodeAt(L)-this._value.charCodeAt(S);if(M!==0)return M;L+=1,S+=1}return w===this._to-this._from?0:L<w?-1:1},y.prototype.value=function(){return this._value.substring(this._from,this._to)},y}(),ee=function(){function y(){}return y}(),B=function(){function y(x){this._iter=x}return y.forPaths=function(){return new y(new he)},y.forStrings=function(){return new y(new fe)},y.prototype.clear=function(){this._root=void 0},y.prototype.set=function(x,L){var w=this._iter.reset(x),S;for(this._root||(this._root=new ee,this._root.segment=w.value()),S=this._root;;){var M=w.cmp(S.segment);if(M>0)S.left||(S.left=new ee,S.left.segment=w.value()),S=S.left;else if(M<0)S.right||(S.right=new ee,S.right.segment=w.value()),S=S.right;else if(w.hasNext())w.next(),S.mid||(S.mid=new ee,S.mid.segment=w.value()),S=S.mid;else break}var m=S.value;return S.value=L,S.key=x,m},y.prototype.get=function(x){for(var L=this._iter.reset(x),w=this._root;w;){var S=L.cmp(w.segment);if(S>0)w=w.left;else if(S<0)w=w.right;else if(L.hasNext())L.next(),w=w.mid;else break}return w?w.value:void 0},y.prototype.findSubstr=function(x){for(var L=this._iter.reset(x),w=this._root,S=void 0;w;){var M=L.cmp(w.segment);if(M>0)w=w.left;else if(M<0)w=w.right;else if(L.hasNext())L.next(),S=w.value||S,w=w.mid;else break}return w&&w.value||S},y.prototype.forEach=function(x){this._forEach(this._root,x)},y.prototype._forEach=function(x,L){x&&(this._forEach(x.left,L),x.value&&L(x.value,x.key),this._forEach(x.mid,L),this._forEach(x.right,L))},y}(),Y=function(){function y(){this.map=new Map,this.ignoreCase=!1}return y.prototype.set=function(x,L){this.map.set(this.toKey(x),L)},y.prototype.get=function(x){return this.map.get(this.toKey(x))},y.prototype.toKey=function(x){var L=x.toString();return this.ignoreCase&&(L=L.toLowerCase()),L},y}(),D=function(){function y(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return y.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),y.prototype.get=function(x,L){L===void 0&&(L=0);var w=this._map.get(x);return w?(L!==0&&this.touch(w,L),w.value):void 0},y.prototype.set=function(x,L,w){w===void 0&&(w=0);var S=this._map.get(x);if(S)S.value=L,w!==0&&this.touch(S,w);else{S={key:x,value:L,next:void 0,previous:void 0};switch(w){case 0:this.addItemLast(S);break;case 1:this.addItemFirst(S);break;case 2:this.addItemLast(S);break;default:this.addItemLast(S);break}this._map.set(x,S),this._size++}},y.prototype.delete=function(x){return!!this.remove(x)},y.prototype.remove=function(x){var L=this._map.get(x);return L?(this._map.delete(x),this.removeItem(L),this._size--,L.value):void 0},y.prototype.forEach=function(x,L){for(var w=this._head;w;)L?x.bind(L)(w.value,w.key,this):x(w.value,w.key,this),w=w.next},y.prototype.trimOld=function(x){if(x>=this.size)return;if(x===0){this.clear();return}for(var L=this._head,w=this.size;L&&w>x;)this._map.delete(L.key),L=L.next,w--;this._head=L,this._size=w,L&&(L.previous=void 0)},y.prototype.addItemFirst=function(x){if(!this._head&&!this._tail)this._tail=x;else if(this._head)x.next=this._head,this._head.previous=x;else throw new Error("Invalid list");this._head=x},y.prototype.addItemLast=function(x){if(!this._head&&!this._tail)this._head=x;else if(this._tail)x.previous=this._tail,this._tail.next=x;else throw new Error("Invalid list");this._tail=x},y.prototype.removeItem=function(x){if(x===this._head&&x===this._tail)this._head=void 0,this._tail=void 0;else if(x===this._head){if(!x.next)throw new Error("Invalid list");x.next.previous=void 0,this._head=x.next}else if(x===this._tail){if(!x.previous)throw new Error("Invalid list");x.previous.next=void 0,this._tail=x.previous}else{var L=x.next,w=x.previous;if(!L||!w)throw new Error("Invalid list");L.previous=w,w.next=L}x.next=void 0,x.previous=void 0},y.prototype.touch=function(x,L){if(!this._head||!this._tail)throw new Error("Invalid list");if(L!==1&&L!==2)return;if(L===1){if(x===this._head)return;var w=x.next,S=x.previous;x===this._tail?(S.next=void 0,this._tail=S):(w.previous=S,S.next=w),x.previous=void 0,x.next=this._head,this._head.previous=x,this._head=x}else if(L===2){if(x===this._tail)return;var w=x.next,S=x.previous;x===this._head?(w.previous=void 0,this._head=w):(w.previous=S,S.next=w),x.next=void 0,x.previous=this._tail,this._tail.next=x,this._tail=x}},y.prototype.toJSON=function(){var x=[];return this.forEach(function(L,w){x.push([w,L])}),x},y}(),I=function(y){K(x,y);function x(L,w){w===void 0&&(w=1);var S=y.call(this)||this;return S._limit=L,S._ratio=Math.min(Math.max(0,w),1),S}return x.prototype.get=function(L){return y.prototype.get.call(this,L,2)},x.prototype.peek=function(L){return y.prototype.get.call(this,L,0)},x.prototype.set=function(L,w){y.prototype.set.call(this,L,w,2),this.checkTrim()},x.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},x}(D)},SJMd:function(ct,ie){/**
|
|
* @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 g,K,ge,Q=!1,fe,he;window.PR_SHOULD_USE_CONTINUATION=!0;var ee,B;(function(){var Y=window,D=["break,continue,do,else,for,if,return,while"],I=[D,"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"],y=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],x=[y,"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"],L=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[y,"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"],S="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",M=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],m="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",v=[D,"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"],T=[D,"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"],O=[D,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],se=[x,w,L,M,m,v,T,O],te=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ue="str",ke="kwd",ne="com",xe="typ",Fe="lit",re="pun",A="pln",me="tag",Z="dec",N="src",J="atn",ce="atv",$="nocode",ye="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function _(U){for(var de=0,we=!1,Me=!1,De=0,Be=U.length;De<Be;++De){var He=U[De];if(He.ignoreCase)Me=!0;else if(/[a-z]/i.test(He.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){we=!0,Me=!1;break}}var dt={b:8,t:9,n:10,v:11,f:12,r:13};function Ze(lt){var be=lt.charCodeAt(0);if(be!==92)return be;var $e=lt.charAt(1);return be=dt[$e],be||("0"<=$e&&$e<="7"?parseInt(lt.substring(1),8):$e==="u"||$e==="x"?parseInt(lt.substring(2),16):lt.charCodeAt(1))}function Je(lt){if(lt<32)return(lt<16?"\\x0":"\\x")+lt.toString(16);var be=String.fromCharCode(lt);return be==="\\"||be==="-"||be==="]"||be==="^"?"\\"+be:be}function Ve(lt){var be=lt.substring(1,lt.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")),$e=[],at=be[0]==="^",Ce=["["];at&&Ce.push("^");for(var Le=at?1:0,X=be.length;Le<X;++Le){var j=be[Le];if(/\\[bdsw]/i.test(j))Ce.push(j);else{var V=Ze(j),E;Le+2<X&&be[Le+1]==="-"?(E=Ze(be[Le+2]),Le+=2):E=V,$e.push([V,E]),E<65||V>122||(E<65||V>90||$e.push([Math.max(65,V)|32,Math.min(E,90)|32]),E<97||V>122||$e.push([Math.max(97,V)&~32,Math.min(E,122)&~32]))}}$e.sort(function(ve,oe){return ve[0]-oe[0]||oe[1]-ve[1]});for(var k=[],R=[],Le=0;Le<$e.length;++Le){var W=$e[Le];W[0]<=R[1]+1?R[1]=Math.max(R[1],W[1]):k.push(R=W)}for(var Le=0;Le<k.length;++Le){var W=k[Le];Ce.push(Je(W[0])),W[1]>W[0]&&(W[1]+1>W[0]&&Ce.push("-"),Ce.push(Je(W[1])))}return Ce.push("]"),Ce.join("")}function yt(lt){for(var be=lt.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")),$e=be.length,at=[],Ce=0,Le=0;Ce<$e;++Ce){var X=be[Ce];if(X==="(")++Le;else if(X.charAt(0)==="\\"){var j=+X.substring(1);j&&(j<=Le?at[j]=-1:be[Ce]=Je(j))}}for(var Ce=1;Ce<at.length;++Ce)at[Ce]===-1&&(at[Ce]=++de);for(var Ce=0,Le=0;Ce<$e;++Ce){var X=be[Ce];if(X==="(")++Le,at[Le]||(be[Ce]="(?:");else if(X.charAt(0)==="\\"){var j=+X.substring(1);j&&j<=Le&&(be[Ce]="\\"+at[j])}}for(var Ce=0;Ce<$e;++Ce)be[Ce]==="^"&&be[Ce+1]!=="^"&&(be[Ce]="");if(lt.ignoreCase&&we)for(var Ce=0;Ce<$e;++Ce){var X=be[Ce],V=X.charAt(0);X.length>=2&&V==="["?be[Ce]=Ve(X):V!=="\\"&&(be[Ce]=X.replace(/[a-zA-Z]/g,function(R){var W=R.charCodeAt(0);return"["+String.fromCharCode(W&~32,W|32)+"]"}))}return be.join("")}for(var mt=[],De=0,Be=U.length;De<Be;++De){var He=U[De];if(He.global||He.multiline)throw new Error(""+He);mt.push("(?:"+yt(He)+")")}return new RegExp(mt.join("|"),Me?"gi":"g")}function b(U,de){var we=/(?:^|\s)nocode(?:\s|$)/,Me=[],De=0,Be=[],He=0;function dt(Ze){var Je=Ze.nodeType;if(Je==1){if(we.test(Ze.className))return;for(var Ve=Ze.firstChild;Ve;Ve=Ve.nextSibling)dt(Ve);var yt=Ze.nodeName.toLowerCase();(yt==="br"||yt==="li")&&(Me[He]=`
|
|
`,Be[He<<1]=De++,Be[He++<<1|1]=Ze)}else if(Je==3||Je==4){var mt=Ze.nodeValue;mt.length&&(de?mt=mt.replace(/\r\n?/g,`
|
|
`):mt=mt.replace(/[ \t\r\n]+/g," "),Me[He]=mt,Be[He<<1]=De,De+=mt.length,Be[He++<<1|1]=Ze)}}return dt(U),{sourceCode:Me.join("").replace(/\n$/,""),spans:Be}}function q(U,de,we,Me,De){if(!we)return;var Be={sourceNode:U,pre:1,langExtension:null,numberLines:null,sourceCode:we,spans:null,basePos:de,decorations:null};Me(Be),De.push.apply(De,Be.decorations)}var Ee=/\S/;function Se(U){for(var de=void 0,we=U.firstChild;we;we=we.nextSibling){var Me=we.nodeType;de=Me===1?de?U:we:Me===3&&Ee.test(we.nodeValue)?U:de}return de===U?void 0:de}function tt(U,de){var we={},Me;(function(){for(var He=U.concat(de),dt=[],Ze={},Je=0,Ve=He.length;Je<Ve;++Je){var yt=He[Je],mt=yt[3];if(mt)for(var lt=mt.length;--lt>=0;)we[mt.charAt(lt)]=yt;var be=yt[1],$e=""+be;Ze.hasOwnProperty($e)||(dt.push(be),Ze[$e]=null)}dt.push(/[\0-\uffff]/),Me=_(dt)})();var De=de.length,Be=function(He){for(var dt=He.sourceCode,Ze=He.basePos,Je=He.sourceNode,Ve=[Ze,A],yt=0,mt=dt.match(Me)||[],lt={},be=0,$e=mt.length;be<$e;++be){var at=mt[be],Ce=lt[at],Le=void 0,X;if(typeof Ce=="string")X=!1;else{var j=we[at.charAt(0)];if(j)Le=at.match(j[1]),Ce=j[0];else{for(var V=0;V<De;++V)if(j=de[V],Le=at.match(j[1]),Le){Ce=j[0];break}Le||(Ce=A)}X=Ce.length>=5&&Ce.substring(0,5)==="lang-",X&&!(Le&&typeof Le[1]=="string")&&(X=!1,Ce=N),X||(lt[at]=Ce)}var E=yt;if(yt+=at.length,!X)Ve.push(Ze+E,Ce);else{var k=Le[1],R=at.indexOf(k),W=R+k.length;Le[2]&&(W=at.length-Le[2].length,R=W-k.length);var ve=Ce.substring(5);q(Je,Ze+E,at.substring(0,R),Be,Ve),q(Je,Ze+E+R,k,z(ve,k),Ve),q(Je,Ze+E+W,at.substring(W),Be,Ve)}}He.decorations=Ve};return Be}function Qe(U){var de=[],we=[];U.tripleQuotedStrings?de.push([ue,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):U.multiLineStrings?de.push([ue,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):de.push([ue,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),U.verbatimStrings&&we.push([ue,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=U.hashComments;Me&&(U.cStyleComments?(Me>1?de.push([ne,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):de.push([ne,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),we.push([ue,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):de.push([ne,/^#[^\r\n]*/,null,"#"])),U.cStyleComments&&(we.push([ne,/^\/\/[^\r\n]*/,null]),we.push([ne,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var De=U.regexLiterals;if(De){var Be=De>1?"":`
|
|
\r`,He=Be?".":"[\\S\\s]",dt="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+He+")*(?:\\x5D|$))+/";we.push(["lang-regex",RegExp("^"+ye+"("+dt+")")])}var Ze=U.types;Ze&&we.push([xe,Ze]);var Je=(""+U.keywords).replace(/^ | $/g,"");Je.length&&we.push([ke,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),de.push([A,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return U.regexLiterals&&(Ve+="(?!s*/)"),we.push([Fe,/^@[a-z_$][a-z_$@0-9]*/i,null],[xe,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[A,/^[a-z_$][a-z_$@0-9]*/i,null],[Fe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[A,/^\\[\s\S]?/,null],[re,new RegExp(Ve),null]),tt(de,we)}var je=Qe({keywords:se,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ue(U,de,we){for(var Me=/(?:^|\s)nocode(?:\s|$)/,De=/\r\n?|\n/,Be=U.ownerDocument,He=Be.createElement("li");U.firstChild;)He.appendChild(U.firstChild);var dt=[He];function Ze(be){var $e=be.nodeType;if($e==1&&!Me.test(be.className))if(be.nodeName==="br")Je(be),be.parentNode&&be.parentNode.removeChild(be);else for(var at=be.firstChild;at;at=at.nextSibling)Ze(at);else if(($e==3||$e==4)&&we){var Ce=be.nodeValue,Le=Ce.match(De);if(Le){var X=Ce.substring(0,Le.index);be.nodeValue=X;var j=Ce.substring(Le.index+Le[0].length);if(j){var V=be.parentNode;V.insertBefore(Be.createTextNode(j),be.nextSibling)}Je(be),X||be.parentNode.removeChild(be)}}}function Je(be){for(;!be.nextSibling;)if(be=be.parentNode,!be)return;function $e(Le,X){var j=X?Le.cloneNode(!1):Le,V=Le.parentNode;if(V){var E=$e(V,1),k=Le.nextSibling;E.appendChild(j);for(var R=k;R;R=k)k=R.nextSibling,E.appendChild(R)}return j}for(var at=$e(be.nextSibling,0),Ce;(Ce=at.parentNode)&&Ce.nodeType===1;)at=Ce;dt.push(at)}for(var Ve=0;Ve<dt.length;++Ve)Ze(dt[Ve]);de===(de|0)&&dt[0].setAttribute("value",de);var yt=Be.createElement("ol");yt.className="linenums";for(var mt=Math.max(0,de-1|0)||0,Ve=0,lt=dt.length;Ve<lt;++Ve)He=dt[Ve],He.className="L"+(Ve+mt)%10,He.firstChild||He.appendChild(Be.createTextNode("\xA0")),yt.appendChild(He);U.appendChild(yt)}function Oe(U){var de=/\bMSIE\s(\d+)/.exec(navigator.userAgent);de=de&&+de[1]<=8;var we=/\n/g,Me=U.sourceCode,De=Me.length,Be=0,He=U.spans,dt=He.length,Ze=0,Je=U.decorations,Ve=Je.length,yt=0;Je[Ve]=De;var mt,lt;for(lt=mt=0;lt<Ve;)Je[lt]!==Je[lt+2]?(Je[mt++]=Je[lt++],Je[mt++]=Je[lt++]):lt+=2;for(Ve=mt,lt=mt=0;lt<Ve;){for(var be=Je[lt],$e=Je[lt+1],at=lt+2;at+2<=Ve&&Je[at+1]===$e;)at+=2;Je[mt++]=be,Je[mt++]=$e,lt=at}Ve=Je.length=mt;var Ce=U.sourceNode,Le="";Ce&&(Le=Ce.style.display,Ce.style.display="none");try{for(var X=null;Ze<dt;){var j=He[Ze],V=He[Ze+2]||De,E=Je[yt+2]||De,at=Math.min(V,E),k=He[Ze+1],R;if(k.nodeType!==1&&(R=Me.substring(Be,at))){de&&(R=R.replace(we,"\r")),k.nodeValue=R;var W=k.ownerDocument,ve=W.createElement("span");ve.className=Je[yt+1];var oe=k.parentNode;oe.replaceChild(ve,k),ve.appendChild(k),Be<V&&(He[Ze+1]=k=W.createTextNode(Me.substring(at,V)),oe.insertBefore(k,ve.nextSibling))}Be=at,Be>=V&&(Ze+=2),Be>=E&&(yt+=2)}}finally{Ce&&(Ce.style.display=Le)}}var Pe={};function ae(U,de){for(var we=de.length;--we>=0;){var Me=de[we];Pe.hasOwnProperty(Me)?Y.console&&console.warn("cannot override language handler %s",Me):Pe[Me]=U}}function z(U,de){return U&&Pe.hasOwnProperty(U)||(U=/^\s*</.test(de)?"default-markup":"default-code"),Pe[U]}ae(je,["default-code"]),ae(tt([],[[A,/^[^<?]+/],[Z,/^<!\w[^>]*(?:>|$)/],[ne,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[re,/^(?:<[%?]|[%?]>)/],["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"]),ae(tt([[A,/^[\s]+/,null,` \r
|
|
`],[ce,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[me,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[J,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[re,/^[=<>\/]+/],["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"]),ae(tt([],[[ce,/^[\s\S]+/]]),["uq.val"]),ae(Qe({keywords:x,hashComments:!0,cStyleComments:!0,types:te}),["c","cc","cpp","cxx","cyc","m"]),ae(Qe({keywords:"null,true,false"}),["json"]),ae(Qe({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:te}),["cs"]),ae(Qe({keywords:L,cStyleComments:!0}),["java"]),ae(Qe({keywords:O,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ae(Qe({keywords:v,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ae(Qe({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ae(Qe({keywords:T,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ae(Qe({keywords:M,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ae(Qe({keywords:S,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ae(tt([],[[ue,/^[\s\S]+/]]),["regex"]);function We(U){var de=U.langExtension;try{var we=b(U.sourceNode,U.pre),Me=we.sourceCode;U.sourceCode=Me,U.spans=we.spans,U.basePos=0,z(de,Me)(U),Oe(U)}catch(De){Y.console&&console.log(De&&De.stack||De)}}function nt(U,de,we){var Me=we||!1,De=de||null,Be=document.createElement("div");Be.innerHTML="<pre>"+U+"</pre>",Be=Be.firstChild,Me&&Ue(Be,Me,!0);var He={langExtension:De,numberLines:Me,sourceNode:Be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return We(He),Be.innerHTML}function it(U,de){var we=de||document.body,Me=we.ownerDocument||document;function De(j){return we.getElementsByTagName(j)}for(var Be=[De("pre"),De("code"),De("xmp")],He=[],dt=0;dt<Be.length;++dt)for(var Ze=0,Je=Be[dt].length;Ze<Je;++Ze)He.push(Be[dt][Ze]);Be=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var yt=0,mt=/\blang(?:uage)?-([\w.]+)(?!\S)/,lt=/\bprettyprint\b/,be=/\bprettyprinted\b/,$e=/pre|xmp/i,at=/^code$/i,Ce=/^(?:pre|code|xmp)$/i,Le={};function X(){for(var j=Y.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;yt<He.length&&Ve.now()<j;yt++){for(var V=He[yt],E=Le,k=V;k=k.previousSibling;){var R=k.nodeType,W=(R===7||R===8)&&k.nodeValue;if(W?!/^\??prettify\b/.test(W):R!==3||/\S/.test(k.nodeValue))break;if(W){E={},W.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ht,Mt,Un){E[Mt]=Un});break}}var ve=V.className;if((E!==Le||lt.test(ve))&&!be.test(ve)){for(var oe=!1,Ne=V.parentNode;Ne;Ne=Ne.parentNode){var qe=Ne.tagName;if(Ce.test(qe)&&Ne.className&<.test(Ne.className)){oe=!0;break}}if(!oe){V.className+=" prettyprinted";var ft=E.lang;if(!ft){ft=ve.match(mt);var st;!ft&&(st=Se(V))&&at.test(st.tagName)&&(ft=st.className.match(mt)),ft&&(ft=ft[1])}var _t;if($e.test(V.tagName))_t=1;else{var Lt=V.currentStyle,pt=Me.defaultView,$t=Lt?Lt.whiteSpace:pt&&pt.getComputedStyle?pt.getComputedStyle(V,null).getPropertyValue("white-space"):0;_t=$t&&$t.substring(0,3)==="pre"}var jt=E.linenums;(jt=jt==="true"||+jt)||(jt=ve.match(/\blinenums\b(?::(\d+))?/),jt=jt?jt[1]&&jt[1].length?+jt[1]:!0:!1),jt&&Ue(V,jt,_t);var Jt={langExtension:ft,sourceNode:V,numberLines:jt,pre:_t,sourceCode:null,basePos:null,spans:null,decorations:null};We(Jt)}}}yt<He.length?Y.setTimeout(X,250):typeof U=="function"&&U()}X()}var Ye=Y.PR={createSimpleLexer:tt,registerLangHandler:ae,sourceDecorator:Qe,PR_ATTRIB_NAME:J,PR_ATTRIB_VALUE:ce,PR_COMMENT:ne,PR_DECLARATION:Z,PR_KEYWORD:ke,PR_LITERAL:Fe,PR_NOCODE:$,PR_PLAIN:A,PR_PUNCTUATION:re,PR_SOURCE:N,PR_STRING:ue,PR_TAG:me,PR_TYPE:xe,prettyPrintOne:Q?Y.prettyPrintOne=nt:ee=nt,prettyPrint:B=Q?Y.prettyPrint=it:B=it},F=Y.define;typeof F=="function"&&F.amd&&F("google-code-prettify",[],function(){return Ye})})()},T8No:function(ct,ie,g){"use strict";g.d(ie,"a",function(){return fe}),g.d(ie,"b",function(){return L}),g.d(ie,"d",function(){return w}),g.d(ie,"c",function(){return S}),g.d(ie,"e",function(){return M});var K=g("N0LK"),ge=g("Cg/j"),Q=function(){var m=function(v,T){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,se){O.__proto__=se}||function(O,se){for(var te in se)se.hasOwnProperty(te)&&(O[te]=se[te])},m(v,T)};return function(v,T){m(v,T);function O(){this.constructor=v}v.prototype=T===null?Object.create(T):(O.prototype=T.prototype,new O)}}(),fe=function(){function m(){}return m.has=function(v){return ee.create(v)},m.equals=function(v,T){return B.create(v,T)},m.regex=function(v,T){return I.create(v,T)},m.not=function(v){return D.create(v)},m.and=function(){for(var v=[],T=0;T<arguments.length;T++)v[T]=arguments[T];return x.create(v)},m.or=function(){for(var v=[],T=0;T<arguments.length;T++)v[T]=arguments[T];return L.create(v)},m.deserialize=function(v,T){return T===void 0&&(T=!1),v?this._deserializeOrExpression(v,T):void 0},m._deserializeOrExpression=function(v,T){var O=this,se=v.split("||");return L.create(se.map(function(te){return O._deserializeAndExpression(te,T)}))},m._deserializeAndExpression=function(v,T){var O=this,se=v.split("&&");return x.create(se.map(function(te){return O._deserializeOne(te,T)}))},m._deserializeOne=function(v,T){if(v=v.trim(),v.indexOf("!=")>=0){var O=v.split("!=");return Y.create(O[0].trim(),this._deserializeValue(O[1],T))}if(v.indexOf("==")>=0){var O=v.split("==");return B.create(O[0].trim(),this._deserializeValue(O[1],T))}if(v.indexOf("=~")>=0){var O=v.split("=~");return I.create(O[0].trim(),this._deserializeRegexValue(O[1],T))}return/^\!\s*/.test(v)?D.create(v.substr(1).trim()):ee.create(v)},m._deserializeValue=function(v,T){if(v=v.trim(),v==="true")return!0;if(v==="false")return!1;var O=/^'([^']*)'$/.exec(v);return O?O[1].trim():v},m._deserializeRegexValue=function(v,T){if(Object(K.x)(v)){if(T)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var O=v.indexOf("/"),se=v.lastIndexOf("/");if(O===se||O<0){if(T)throw new Error("bad regexp-value '"+v+"', missing /-enclosure");return console.warn("bad regexp-value '"+v+"', missing /-enclosure"),null}var te=v.slice(O+1,se),ue=v[se+1]==="i"?"i":"";try{return new RegExp(te,ue)}catch(ke){if(T)throw new Error("bad regexp-value '"+v+"', parse error: "+ke);return console.warn("bad regexp-value '"+v+"', parse error: "+ke),null}},m}();function he(m,v){var T=m.getType(),O=v.getType();if(T!==O)return T-O;switch(T){case 1:return m.cmp(v);case 2:return m.cmp(v);case 3:return m.cmp(v);case 4:return m.cmp(v);case 6:return m.cmp(v);case 7:return m.cmp(v);case 5:return m.cmp(v);default:throw new Error("Unknown ContextKeyExpr!")}}var ee=function(){function m(v){this.key=v}return m.create=function(v){return new m(v)},m.prototype.getType=function(){return 1},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key:!1},m.prototype.evaluate=function(v){return!!v.getValue(this.key)},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return D.create(this.key)},m}(),B=function(){function m(v,T){this.key=v,this.value=T}return m.create=function(v,T){return typeof T=="boolean"?T?ee.create(v):D.create(v):new m(v,T)},m.prototype.getType=function(){return 3},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:this.value<v.value?-1:this.value>v.value?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key&&this.value===v.value:!1},m.prototype.evaluate=function(v){return v.getValue(this.key)==this.value},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return Y.create(this.key,this.value)},m}(),Y=function(){function m(v,T){this.key=v,this.value=T}return m.create=function(v,T){return typeof T=="boolean"?T?D.create(v):ee.create(v):new m(v,T)},m.prototype.getType=function(){return 4},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:this.value<v.value?-1:this.value>v.value?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key&&this.value===v.value:!1},m.prototype.evaluate=function(v){return v.getValue(this.key)!=this.value},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return B.create(this.key,this.value)},m}(),D=function(){function m(v){this.key=v}return m.create=function(v){return new m(v)},m.prototype.getType=function(){return 2},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key:!1},m.prototype.evaluate=function(v){return!v.getValue(this.key)},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return ee.create(this.key)},m}(),I=function(){function m(v,T){this.key=v,this.regexp=T}return m.create=function(v,T){return new m(v,T)},m.prototype.getType=function(){return 6},m.prototype.cmp=function(v){if(this.key<v.key)return-1;if(this.key>v.key)return 1;var T=this.regexp?this.regexp.source:"",O=v.regexp?v.regexp.source:"";return T<O?-1:T>O?1:0},m.prototype.equals=function(v){if(v instanceof m){var T=this.regexp?this.regexp.source:"",O=v.regexp?v.regexp.source:"";return this.key===v.key&&T===O}return!1},m.prototype.evaluate=function(v){var T=v.getValue(this.key);return this.regexp?this.regexp.test(T):!1},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return y.create(this)},m}(),y=function(){function m(v){this._actual=v}return m.create=function(v){return new m(v)},m.prototype.getType=function(){return 7},m.prototype.cmp=function(v){return this._actual.cmp(v._actual)},m.prototype.equals=function(v){return v instanceof m?this._actual.equals(v._actual):!1},m.prototype.evaluate=function(v){return!this._actual.evaluate(v)},m.prototype.keys=function(){return this._actual.keys()},m.prototype.negate=function(){return this._actual},m}(),x=function(){function m(v){this.expr=v}return m.create=function(v){var T=m._normalizeArr(v);return T.length===0?void 0:T.length===1?T[0]:new m(T)},m.prototype.getType=function(){return 5},m.prototype.cmp=function(v){if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(var T=0,O=this.expr.length;T<O;T++){var se=he(this.expr[T],v.expr[T]);if(se!==0)return se}return 0},m.prototype.equals=function(v){if(v instanceof m){if(this.expr.length!==v.expr.length)return!1;for(var T=0,O=this.expr.length;T<O;T++)if(!this.expr[T].equals(v.expr[T]))return!1;return!0}return!1},m.prototype.evaluate=function(v){for(var T=0,O=this.expr.length;T<O;T++)if(!this.expr[T].evaluate(v))return!1;return!0},m._normalizeArr=function(v){var T=[];if(v){for(var O=0,se=v.length;O<se;O++){var te=v[O];if(!te)continue;if(te instanceof m){T=T.concat(te.expr);continue}if(te instanceof L)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');T.push(te)}T.sort(he)}return T},m.prototype.keys=function(){for(var v=[],T=0,O=this.expr;T<O.length;T++){var se=O[T];v.push.apply(v,se.keys())}return v},m.prototype.negate=function(){for(var v=[],T=0,O=this.expr;T<O.length;T++){var se=O[T];v.push(se.negate())}return L.create(v)},m}(),L=function(){function m(v){this.expr=v}return m.create=function(v){var T=m._normalizeArr(v);return T.length===0?void 0:T.length===1?T[0]:new m(T)},m.prototype.getType=function(){return 8},m.prototype.equals=function(v){if(v instanceof m){if(this.expr.length!==v.expr.length)return!1;for(var T=0,O=this.expr.length;T<O;T++)if(!this.expr[T].equals(v.expr[T]))return!1;return!0}return!1},m.prototype.evaluate=function(v){for(var T=0,O=this.expr.length;T<O;T++)if(this.expr[T].evaluate(v))return!0;return!1},m._normalizeArr=function(v){var T=[];if(v){for(var O=0,se=v.length;O<se;O++){var te=v[O];if(!te)continue;if(te instanceof m){T=T.concat(te.expr);continue}T.push(te)}T.sort(he)}return T},m.prototype.keys=function(){for(var v=[],T=0,O=this.expr;T<O.length;T++){var se=O[T];v.push.apply(v,se.keys())}return v},m.prototype.negate=function(){for(var v=[],T=0,O=this.expr;T<O.length;T++){var se=O[T];v.push(se.negate())}for(var te=function(N){return N instanceof m?N.expr:[N]};v.length>1;){for(var ue=v.shift(),ke=v.shift(),ne=[],xe=0,Fe=te(ue);xe<Fe.length;xe++)for(var re=Fe[xe],A=0,me=te(ke);A<me.length;A++){var Z=me[A];ne.push(fe.and(re,Z))}v.unshift(fe.or.apply(fe,ne))}return v[0]},m}(),w=function(m){Q(v,m);function v(T,O){var se=m.call(this,T)||this;return se._defaultValue=O,se}return v.prototype.bindTo=function(T){return T.createKey(this.key,this._defaultValue)},v.prototype.getValue=function(T){return T.getContextKeyValue(this.key)},v.prototype.toNegated=function(){return fe.not(this.key)},v}(ee),S=Object(ge.c)("contextKeyService"),M="setContext"},UUDw:function(ct,ie,g){ct.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(ct,ie,g){"use strict";g.d(ie,"a",function(){return K});var K=function(Q){var fe=document.createElement("textarea");return fe.value=Q,fe.value}},"VrN/":function(ct,ie,g){(function(K,ge){ct.exports=ge()})(this,function(){"use strict";var K=navigator.userAgent,ge=navigator.platform,Q=/gecko\/\d/i.test(K),fe=/MSIE \d/.test(K),he=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(K),ee=/Edge\/(\d+)/.exec(K),B=fe||he||ee,Y=B&&(fe?document.documentMode||6:+(ee||he)[1]),D=!ee&&/WebKit\//.test(K),I=D&&/Qt\/\d+\.\d+/.test(K),y=!ee&&/Chrome\//.test(K),x=/Opera\//.test(K),L=/Apple Computer/.test(navigator.vendor),w=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(K),S=/PhantomJS/.test(K),M=!ee&&/AppleWebKit/.test(K)&&/Mobile\/\w+/.test(K),m=/Android/.test(K),v=M||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(K),T=M||/Mac/.test(ge),O=/\bCrOS\b/.test(K),se=/win/i.test(ge),te=x&&K.match(/Version\/(\d*\.\d*)/);te&&(te=Number(te[1])),te&&te>=15&&(x=!1,D=!0);var ue=T&&(I||x&&(te==null||te<12.11)),ke=Q||B&&Y>=9;function ne(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var xe=function(e,t){var i=e.className,n=ne(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 Fe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function re(e,t){return Fe(e).appendChild(t)}function A(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 me(e,t,i,n){var r=A(e,t,i,n);return r.setAttribute("role","presentation"),r}var Z;document.createRange?Z=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:Z=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 J(){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 ce(e,t){var i=e.className;ne(t).test(i)||(e.className+=(i?" ":"")+t)}function $(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!ne(i[n]).test(t)&&(t+=" "+i[n]);return t}var ye=function(e){e.select()};M?ye=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:B&&(ye=function(e){try{e.select()}catch(t){}});function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function b(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 q(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 Ee=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};Ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ee.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 Se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var tt=50,Qe={toString:function(){return"CodeMirror.Pass"}},je={scroll:!1},Ue={origin:"*mouse"},Oe={origin:"+move"};function Pe(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 ae=[""];function z(e){for(;ae.length<=e;)ae.push(We(ae)+" ");return ae[e]}function We(e){return e[e.length-1]}function nt(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function it(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function Ye(){}function F(e,t){var i;return Object.create?i=Object.create(e):(Ye.prototype=e,i=new Ye),t&&b(t,i),i}var U=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function de(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||U.test(e))}function we(e,t){return t?t.source.indexOf("\\w")>-1&&de(e)?!0:t.test(e):de(e)}function Me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var De=/[\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&&De.test(e)}function He(e,t,i){for(;(i<0?t>0:t<e.length)&&Be(e.charAt(t));)t+=i;return t}function dt(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 Ze(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 Je=null;function Ve(e,t,i){var n;Je=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:Je=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:Je=r)}return n!=null?n:Je}var yt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(C){return C<=247?e.charAt(C):1424<=C&&C<=1524?"R":1536<=C&&C<=1785?t.charAt(C-1536):1774<=C&&C<=2220?"r":8192<=C&&C<=8203?"w":C==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function p(C,P,H){this.level=C,this.from=P,this.to=H}return function(C,P){var H=P=="ltr"?"L":"R";if(C.length==0||P=="ltr"&&!n.test(C))return!1;for(var pe=C.length,le=[],Te=0;Te<pe;++Te)le.push(i(C.charCodeAt(Te)));for(var Ie=0,ze=H;Ie<pe;++Ie){var Ke=le[Ie];Ke=="m"?le[Ie]=ze:ze=Ke}for(var ot=0,Xe=H;ot<pe;++ot){var ht=le[ot];ht=="1"&&Xe=="r"?le[ot]="n":s.test(ht)&&(Xe=ht,ht=="r"&&(le[ot]="R"))}for(var St=1,Ct=le[0];St<pe-1;++St){var Dt=le[St];Dt=="+"&&Ct=="1"&&le[St+1]=="1"?le[St]="1":Dt==","&&Ct==le[St+1]&&(Ct=="1"||Ct=="n")&&(le[St]=Ct),Ct=Dt}for(var tn=0;tn<pe;++tn){var xn=le[tn];if(xn==",")le[tn]="N";else if(xn=="%"){var an=void 0;for(an=tn+1;an<pe&&le[an]=="%";++an);for(var Gn=tn&&le[tn-1]=="!"||an<pe&&le[an]=="1"?"1":"N",jn=tn;jn<an;++jn)le[jn]=Gn;tn=an-1}}for(var fn=0,Bn=H;fn<pe;++fn){var Sn=le[fn];Bn=="L"&&Sn=="1"?le[fn]="L":s.test(Sn)&&(Bn=Sn)}for(var gn=0;gn<pe;++gn)if(r.test(le[gn])){var pn=void 0;for(pn=gn+1;pn<pe&&r.test(le[pn]);++pn);for(var ln=(gn?le[gn-1]:H)=="L",Fn=(pn<pe?le[pn]:H)=="L",ur=ln==Fn?ln?"L":"R":H,Ai=gn;Ai<pn;++Ai)le[Ai]=ur;gn=pn-1}for(var Tn=[],pi,Cn=0;Cn<pe;)if(l.test(le[Cn])){var Yo=Cn;for(++Cn;Cn<pe&&l.test(le[Cn]);++Cn);Tn.push(new p(0,Yo,Cn))}else{var yi=Cn,Wi=Tn.length,Hi=P=="rtl"?1:0;for(++Cn;Cn<pe&&le[Cn]!="L";++Cn);for(var Mn=yi;Mn<Cn;)if(f.test(le[Mn])){yi<Mn&&(Tn.splice(Wi,0,new p(1,yi,Mn)),Wi+=Hi);var hr=Mn;for(++Mn;Mn<Cn&&f.test(le[Mn]);++Mn);Tn.splice(Wi,0,new p(2,hr,Mn)),Wi+=Hi,yi=Mn}else++Mn;yi<Cn&&Tn.splice(Wi,0,new p(1,yi,Cn))}return P=="ltr"&&(Tn[0].level==1&&(pi=C.match(/^\s+/))&&(Tn[0].from=pi[0].length,Tn.unshift(new p(0,0,pi[0].length))),We(Tn).level==1&&(pi=C.match(/\s+$/))&&(We(Tn).to-=pi[0].length,Tn.push(new p(0,pe-pi[0].length,pe)))),P=="rtl"?Tn.reverse():Tn}}();function mt(e,t){var i=e.order;return i==null&&(i=e.order=yt(e.text,t)),i}var lt=[],be=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]||lt).concat(i)}};function $e(e,t){return e._handlers&&e._handlers[t]||lt}function at(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=Se(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Ce(e,t){var i=$e(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 Le(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,i||t.type,e,t),R(t)||t.codemirrorIgnore}function X(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)Se(i,t[n])==-1&&i.push(t[n])}function j(e,t){return $e(e,t).length>0}function V(e){e.prototype.on=function(t,i){be(this,t,i)},e.prototype.off=function(t,i){at(this,t,i)}}function E(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function k(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function R(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function W(e){E(e),k(e)}function ve(e){return e.target||e.srcElement}function oe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),T&&e.ctrlKey&&t==1&&(t=3),t}var Ne=function(){if(B&&Y<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}(),qe;function ft(e){if(qe==null){var t=A("span","\u200B");re(e,A("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(qe=t.offsetWidth<=1&&t.offsetHeight>2&&!(B&&Y<8))}var i=qe?A("span","\u200B"):A("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var st;function _t(e){if(st!=null)return st;var t=re(e,document.createTextNode("A\u062EA")),i=Z(t,0,1).getBoundingClientRect(),n=Z(t,1,2).getBoundingClientRect();return Fe(e),!i||i.left==i.right?!1:st=n.right-i.right<3}var Lt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
|
|
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},pt=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},$t=function(){var e=A("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jt=null;function Jt(e){if(jt!=null)return jt;var t=re(e,A("span","x")),i=t.getBoundingClientRect(),n=Z(t,0,1).getBoundingClientRect();return jt=Math.abs(i.left-n.left)>1}var Ht={},Mt={};function Un(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ht[e]=t}function Qn(e,t){Mt[e]=t}function bt(e){if(typeof e=="string"&&Mt.hasOwnProperty(e))e=Mt[e];else if(e&&typeof e.name=="string"&&Mt.hasOwnProperty(e.name)){var t=Mt[e.name];typeof t=="string"&&(t={name:t}),e=F(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wt(e,t){t=bt(t);var i=Ht[t.name];if(!i)return wt(e,"text/plain");var n=i(e,t);if(et.hasOwnProperty(t.name)){var r=et[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 et={};function xt(e,t){var i=et.hasOwnProperty(e)?et[e]:et[e]={};b(t,i)}function Zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function rn(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 nn(e,t,i){return e.startState?e.startState(t,i):!0}var At=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};At.prototype.eol=function(){return this.pos>=this.string.length},At.prototype.sol=function(){return this.pos==this.lineStart},At.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},At.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},At.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},At.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},At.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},At.prototype.skipToEnd=function(){this.pos=this.string.length},At.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},At.prototype.backUp=function(e){this.pos-=e},At.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},At.prototype.indentation=function(){return q(this.string,null,this.tabSize)-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},At.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)}},At.prototype.current=function(){return this.string.slice(this.start,this.pos)},At.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},At.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},At.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function gt(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 On(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 ni(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function kn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,i=Se(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 _n(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 Vn(e,t){return t>=e.first&&t<e.first+e.size}function ii(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function _e(e,t,i){if(i===void 0&&(i=null),!(this instanceof _e))return new _e(e,t,i);this.line=e,this.ch=t,this.sticky=i}function rt(e,t){return e.line-t.line||e.ch-t.ch}function Rt(e,t){return e.sticky==t.sticky&&rt(e,t)==0}function Gt(e){return _e(e.line,e.ch)}function Xt(e,t){return rt(e,t)<0?t:e}function qt(e,t){return rt(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 _e(e.first,0);var i=e.first+e.size-1;return t.line>i?_e(i,gt(e,i).text.length):a(t,gt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?_e(e.line,t):i<0?_e(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,Zt(e.mode,t.state),i,t.lookAhead):new c(e,Zt(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new d(t,this.maxLookAhead):t};function G(e,t,i,n){var r=[e.state.modeGen],s={};Xn(e,t.text,e.doc.mode,i,function(C,P){return r.push(C,P)},s,n);for(var l=i.state,f=function(C){i.baseTokens=r;var P=e.state.overlays[C],H=1,pe=0;i.state=!0,Xn(e,t.text,P.mode,i,function(le,Te){for(var Ie=H;pe<le;){var ze=r[H];ze>le&&r.splice(H,1,le,r[H+1],ze),H+=2,pe=Math.min(le,ze)}if(!Te)return;if(P.opaque)r.splice(Ie,H-Ie,le,"overlay "+Te),H=Ie+2;else for(;Ie<H;Ie+=2){var Ke=r[Ie+1];r[Ie+1]=(Ke?Ke+" ":"")+"overlay "+Te}},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 Ae(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ge(e,Ot(t)),r=t.text.length>e.options.maxHighlightLength&&Zt(e.doc.mode,n.state),s=G(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 Ge(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=mn(e,t,i),l=s>n.first&>(n,s-1).stateAfter,f=l?c.fromSaved(n,l,s):new c(n,nn(n.mode),s);return n.iter(s,t,function(p){ut(e,p.text,f);var C=f.line;p.stateAfter=C==t-1||C%5==0||C>=r.viewFrom&&C<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function ut(e,t,i,n){var r=e.doc.mode,s=new At(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Re(r,i.state);!s.eol();)kt(r,s,i.state),s.start=s.pos}function Re(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=rn(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function kt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=rn(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 Nt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function en(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=gt(r,t.line),p=Ge(e,t.line,i),C=new At(f.text,e.options.tabSize,p),P;for(n&&(P=[]);(n||C.pos<t.ch)&&!C.eol();)C.start=C.pos,l=kt(s,C,p.state),n&&P.push(new Nt(C,l,Zt(r.mode,p.state)));return n?P:new Nt(C,l,p.state)}function Kn(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 Xn(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var p=0,C=null,P=new At(t,e.options.tabSize,n),H,pe=e.options.addModeClass&&[null];for(t==""&&Kn(Re(i,n.state),s);!P.eol();){if(P.pos>e.options.maxHighlightLength?(f=!1,l&&ut(e,t,n,P.pos),P.pos=t.length,H=null):H=Kn(kt(i,P,n.state,pe),s),pe){var le=pe[0].name;le&&(H="m-"+(H?le+" "+H:le))}if(!f||C!=H){for(;p<P.start;)p=Math.min(P.start,p+5e3),r(p,C);C=H}P.start=P.pos}for(;p<P.pos;){var Te=Math.min(P.pos,p+5e3);r(Te,C),p=Te}}function mn(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=gt(s,f-1),C=p.stateAfter;if(C&&(!i||f+(C instanceof d?C.lookAhead:0)<=s.modeFrontier))return f;var P=q(p.text,null,e.options.tabSize);(r==null||n>P)&&(r=f-1,n=P)}return r}function qn(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=gt(e,n).stateAfter;if(r&&(!(r instanceof d)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var zi=!1,Dn=!1;function Yn(){zi=!0}function Wn(){Dn=!0}function bi(e,t,i){this.marker=e,this.from=t,this.to=i}function ri(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function mi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function hi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(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 bi(l,s.from,p?null:s.to))}}return n}function Gi(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 bi(l,p?null:s.from-t,s.to==null?null:s.to-t))}}return n}function oi(e,t){if(t.full)return null;var i=Vn(e,t.from.line)&>(e,t.from.line).markedSpans,n=Vn(e,t.to.line)&>(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=rt(t.from,t.to)==0,f=cr(i,r,l),p=Gi(n,s,l),C=t.text.length==1,P=We(t.text).length+(C?r:0);if(f)for(var H=0;H<f.length;++H){var pe=f[H];if(pe.to==null){var le=ri(p,pe.marker);le?C&&(pe.to=le.to==null?null:le.to+P):pe.to=r}}if(p)for(var Te=0;Te<p.length;++Te){var Ie=p[Te];if(Ie.to!=null&&(Ie.to+=P),Ie.from==null){var ze=ri(f,Ie.marker);ze||(Ie.from=P,C&&(f||(f=[])).push(Ie))}else Ie.from+=P,C&&(f||(f=[])).push(Ie)}f&&(f=$n(f)),p&&p!=f&&(p=$n(p));var Ke=[f];if(!C){var ot=t.text.length-2,Xe;if(ot>0&&f)for(var ht=0;ht<f.length;++ht)f[ht].to==null&&(Xe||(Xe=[])).push(new bi(f[ht].marker,null,null));for(var St=0;St<ot;++St)Ke.push(Xe);Ke.push(p)}return Ke}function $n(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 Mi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(le){if(le.markedSpans)for(var Te=0;Te<le.markedSpans.length;++Te){var Ie=le.markedSpans[Te].marker;Ie.readOnly&&(!n||Se(n,Ie)==-1)&&(n||(n=[])).push(Ie)}}),!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 C=r[p];if(rt(C.to,f.from)<0||rt(C.from,f.to)>0)continue;var P=[p,1],H=rt(C.from,f.from),pe=rt(C.to,f.to);(H<0||!l.inclusiveLeft&&!H)&&P.push({from:C.from,to:f.from}),(pe>0||!l.inclusiveRight&&!pe)&&P.push({from:f.to,to:C.to}),r.splice.apply(r,P),p+=P.length-3}return r}function Oi(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 dr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function sn(e){return e.inclusiveLeft?-1:0}function Ut(e){return e.inclusiveRight?1:0}function wn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=rt(n.from,r.from)||sn(e)-sn(t);if(s)return-s;var l=rt(n.to,r.to)||Ut(e)-Ut(t);return l||t.id-e.id}function Ft(e,t){var i=Dn&&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||wn(n,r.marker)<0)&&(n=r.marker);return n}function cn(e){return Ft(e,!0)}function Vt(e){return Ft(e,!1)}function ci(e,t){var i=Dn&&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||wn(n,s.marker)<0)&&(n=s.marker)}return n}function un(e,t,i,n,r){var s=gt(e,t),l=Dn&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var p=l[f];if(!p.marker.collapsed)continue;var C=p.marker.find(0),P=rt(C.from,i)||sn(p.marker)-sn(r),H=rt(C.to,n)||Ut(p.marker)-Ut(r);if(P>=0&&H<=0||P<=0&&H>=0)continue;if(P<=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?rt(C.to,i)>=0:rt(C.to,i)>0)||P>=0&&(p.marker.inclusiveRight&&r.inclusiveLeft?rt(C.from,n)<=0:rt(C.from,n)<0))return!0}}function Rn(e){for(var t;t=cn(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Vt(e);)e=t.find(1,!0).line;return e}function Ki(e){for(var t,i;t=Vt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function xi(e,t){var i=gt(e,t),n=Rn(i);return i==n?t:Ot(n)}function Fr(e,t){if(t>e.lastLine())return t;var i=gt(e,t),n;if(!Hn(e,i))return t;for(;n=Vt(i);)i=n.find(1,!0).line;return Ot(i)+1}function Hn(e,t){var i=Dn&&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&&fr(e,t,n))return!0}}function fr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fr(e,n.line,ri(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)&&fr(e,t,r))return!0}function ai(e){e=Rn(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 Xi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=cn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Vt(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 Ur(e){var t=e.display,i=e.doc;t.maxLine=gt(i,i.first),t.maxLineLength=Xi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Xi(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Di=function(e,t,i){this.text=e,dr(this,t),this.height=i?i(this):1};Di.prototype.lineNo=function(){return Ot(this)},V(Di);function Jo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Oi(e),dr(e,i);var r=n?n(e):1;r!=e.height&&kn(e,r)}function ho(e){e.parent=null,Oi(e)}var vt={},Tt={};function Et(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Tt:vt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Pt(e,t){var i=me("span",null,null,D?"padding-right: .1px":null),n={pre:me("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=Yt,_t(e.display.measure)&&(l=mt(s,e.doc.direction))&&(n.addToken=dn(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Ot(s);It(s,n,Ae(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=$(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=$(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(ft(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(D){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 Ce(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=$(n.pre.className,n.textClass||"")),n}function Wt(e){var t=A("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yt(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?Bt(t,e.trailingSpace):t,p=e.cm.state.specialChars,C=!1,P;if(!p.test(t))e.col+=t.length,P=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,P),B&&Y<9&&(C=!0),e.pos+=t.length;else{P=document.createDocumentFragment();for(var H=0;;){p.lastIndex=H;var pe=p.exec(t),le=pe?pe.index-H:t.length-H;if(le){var Te=document.createTextNode(f.slice(H,H+le));B&&Y<9?P.appendChild(A("span",[Te])):P.appendChild(Te),e.map.push(e.pos,e.pos+le,Te),e.col+=le,e.pos+=le}if(!pe)break;H+=le+1;var Ie=void 0;if(pe[0]==" "){var ze=e.cm.options.tabSize,Ke=ze-e.col%ze;Ie=P.appendChild(A("span",z(Ke),"cm-tab")),Ie.setAttribute("role","presentation"),Ie.setAttribute("cm-text"," "),e.col+=Ke}else pe[0]=="\r"||pe[0]==`
|
|
`?(Ie=P.appendChild(A("span",pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ie.setAttribute("cm-text",pe[0]),e.col+=1):(Ie=e.cm.options.specialCharPlaceholder(pe[0]),Ie.setAttribute("cm-text",pe[0]),B&&Y<9?P.appendChild(A("span",[Ie])):P.appendChild(Ie),e.col+=1);e.map.push(e.pos,e.pos+1,Ie),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||C||s||l){var ot=i||"";n&&(ot+=n),r&&(ot+=r);var Xe=A("span",[P],ot,s);if(l)for(var ht in l)l.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&Xe.setAttribute(ht,l[ht]);return e.content.appendChild(Xe)}e.content.appendChild(P)}function Bt(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 dn(e,t){return function(i,n,r,s,l,f,p){r=r?r+" cm-force-border":"cm-force-border";for(var C=i.pos,P=C+n.length;;){for(var H=void 0,pe=0;pe<t.length&&!(H=t[pe],H.to>C&&H.from<=C);pe++);if(H.to>=P)return e(i,n,r,s,l,f,p);e(i,n.slice(0,H.to-C),r,s,null,f,p),s=null,n=n.slice(H.to-C),C=H.to}}}function Pn(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 It(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]),Et(i[l+1],t.cm.options));return}for(var f=r.length,p=0,C=1,P="",H,pe,le=0,Te,Ie,ze,Ke,ot;;){if(le==p){Te=Ie=ze=pe="",ot=null,Ke=null,le=Infinity;for(var Xe=[],ht=void 0,St=0;St<n.length;++St){var Ct=n[St],Dt=Ct.marker;if(Dt.type=="bookmark"&&Ct.from==p&&Dt.widgetNode)Xe.push(Dt);else if(Ct.from<=p&&(Ct.to==null||Ct.to>p||Dt.collapsed&&Ct.to==p&&Ct.from==p)){if(Ct.to!=null&&Ct.to!=p&&le>Ct.to&&(le=Ct.to,Ie=""),Dt.className&&(Te+=" "+Dt.className),Dt.css&&(pe=(pe?pe+";":"")+Dt.css),Dt.startStyle&&Ct.from==p&&(ze+=" "+Dt.startStyle),Dt.endStyle&&Ct.to==le&&(ht||(ht=[])).push(Dt.endStyle,Ct.to),Dt.title&&((ot||(ot={})).title=Dt.title),Dt.attributes)for(var tn in Dt.attributes)(ot||(ot={}))[tn]=Dt.attributes[tn];Dt.collapsed&&(!Ke||wn(Ke.marker,Dt)<0)&&(Ke=Ct)}else Ct.from>p&&le>Ct.from&&(le=Ct.from)}if(ht)for(var xn=0;xn<ht.length;xn+=2)ht[xn+1]==le&&(Ie+=" "+ht[xn]);if(!Ke||Ke.from==p)for(var an=0;an<Xe.length;++an)Pn(t,0,Xe[an]);if(Ke&&(Ke.from||0)==p){if(Pn(t,(Ke.to==null?f+1:Ke.to)-p,Ke.marker,Ke.from==null),Ke.to==null)return;Ke.to==p&&(Ke=!1)}}if(p>=f)break;for(var Gn=Math.min(f,le);;){if(P){var jn=p+P.length;if(!Ke){var fn=jn>Gn?P.slice(0,Gn-p):P;t.addToken(t,fn,H?H+Te:Te,ze,p+fn.length==le?Ie:"",pe,ot)}if(jn>=Gn){P=P.slice(Gn-p),p=Gn;break}p=jn,ze=""}P=r.slice(s,s=i[C++]),H=Et(i[C++],t.cm.options)}}}function Ci(e,t,i){this.line=t,this.rest=Ki(t),this.size=this.rest?Ot(We(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Hn(e,t)}function zt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Ci(e.doc,gt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var vn=null;function ei(e){vn?vn.ops.push(e):e.ownsGroup=vn={ops:[e],delayedCallbacks:[]}}function ti(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 Wr(e,t){var i=e.ownsGroup;if(!i)return;try{ti(i)}finally{vn=null,t(i)}}var pr=null;function En(e,t){var i=$e(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;vn?r=vn.delayedCallbacks:pr?r=pr:(r=pr=[],setTimeout(Ds,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Ds(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function Zo(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?qo(e,t,i,n):s=="class"?co(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),B&&Y<8&&(e.node.style.zIndex=2)),e.node}function Rs(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=mr(t);t.background=n.insertBefore(A("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Pt(e,t)}function Ps(e,t){var i=t.text.className,n=Qo(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,co(e,t)):i&&(t.text.className=i)}function co(e,t){Rs(e,t),t.line.wrapClass?mr(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 qo(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=mr(t);t.gutterBackground=A("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=mr(t),f=t.gutter=A("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(A("div",ii(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 C=e.display.gutterSpecs[p].className,P=s.hasOwnProperty(C)&&s[C];P&&f.appendChild(A("div",[P],"CodeMirror-gutter-elt","left: "+n.gutterLeft[C]+"px; width: "+n.gutterWidth[C]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=ne("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ea(e,t,i)}function Is(e,t,i,n){var r=Qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),co(e,t),qo(e,t,i,n),ea(e,t,n),t.node}function ea(e,t,i){if(ta(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)ta(e,t.rest[n],t,i,!1)}function ta(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,f=t.widgets;l<f.length;++l){var p=f[l],C=A("div",[p.node],"CodeMirror-linewidget"+(p.className?" "+p.className:""));p.handleMouseEvents||C.setAttribute("cm-ignore-events","true"),js(p,C,i,n),e.display.input.setUneditable(C),r&&p.above?s.insertBefore(C,i.gutter||i.text):s.appendChild(C),En(p,"redraw")}}function js(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 gr(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;"),re(t.display.measure,A("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function gi(e,t){for(var i=ve(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 Hr(e){return e.lineSpace.offsetTop}function fo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function na(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=re(e.measure,A("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 di(e){return tt-e.display.nativeBarWidth}function Ri(e){return e.display.scroller.clientWidth-di(e)-e.display.barWidth}function po(e){return e.display.scroller.clientHeight-di(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Ri(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],C=l[f+1];Math.abs(p.bottom-C.bottom)>2&&s.push((p.bottom+C.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ia(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(Ot(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fs(e,t){t=Rn(t);var i=Ot(t),n=e.display.externalMeasured=new Ci(e.doc,t,i);n.lineN=i;var r=n.built=Pt(e,n);return n.text=r.pre,re(e.display.lineMeasure,r.pre),n}function ra(e,t,i,n){return fi(e,Yi(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ii(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Yi(e,t){var i=Ot(t),n=mo(e,i);n&&!n.text?n=null:n&&n.changes&&(Zo(e,n,i,Co(e)),e.curOp.forceUpdate=!0),n||(n=Fs(e,t));var r=ia(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function fi(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||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Ws(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 oa={left:0,right:0,top:0,bottom:0};function aa(e,t,i){for(var n,r,s,l,f,p,C=0;C<e.length;C+=3)if(f=e[C],p=e[C+1],t<f?(r=0,s=1,l="left"):t<p?(r=t-f,s=r+1):(C==e.length-3||t==p&&e[C+3]>t)&&(s=p-f,r=s-1,t>=p&&(l="right")),r!=null){if(n=e[C+2],f==p&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;C&&e[C-2]==e[C-3]&&e[C-1].insertLeft;)n=e[(C-=3)+2],l="left";if(i=="right"&&r==p-f)for(;C<e.length-3&&e[C+3]==e[C+4]&&!e[C+5].insertLeft;)n=e[(C+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:p}}function Us(e,t){var i=oa;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 Ws(e,t,i,n){var r=aa(t.map,i,n),s=r.node,l=r.start,f=r.end,p=r.collapse,C;if(s.nodeType==3){for(var P=0;P<4;P++){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(B&&Y<9&&l==0&&f==r.coverEnd-r.coverStart?C=s.parentNode.getBoundingClientRect():C=Us(Z(s,l,f).getClientRects(),n),C.left||C.right||l==0)break;f=l,l=l-1,p="right"}B&&Y<11&&(C=Hs(e.display.measure,C))}else{l>0&&(p=n="right");var H;e.options.lineWrapping&&(H=s.getClientRects()).length>1?C=H[n=="right"?H.length-1:0]:C=s.getBoundingClientRect()}if(B&&Y<9&&!l&&(!C||!C.left&&!C.right)){var pe=s.parentNode.getClientRects()[0];pe?C={left:pe.left,right:pe.left+Ji(e.display),top:pe.top,bottom:pe.bottom}:C=oa}for(var le=C.top-t.rect.top,Te=C.bottom-t.rect.top,Ie=(le+Te)/2,ze=t.view.measure.heights,Ke=0;Ke<ze.length-1&&!(Ie<ze[Ke]);Ke++);var ot=Ke?ze[Ke-1]:0,Xe=ze[Ke],ht={left:(p=="right"?C.right:C.left)-t.rect.left,right:(p=="left"?C.left:C.right)-t.rect.left,top:ot,bottom:Xe};return!C.left&&!C.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=le,ht.rbottom=Te),ht}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(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 sa(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 la(e){e.display.externalMeasure=null,Fe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)sa(e.display.view[t])}function vr(e){la(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ua(){return y&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return y&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function go(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function zr(e,t,i,n,r){if(!r){var s=go(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=ai(t);if(n=="local"?l+=Hr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ha());var p=f.left+(n=="window"?0:ua());i.left+=p,i.right+=p}return i.top+=l,i.bottom+=l,i}function ca(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ua(),r-=ha();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 vo(e,t,i,n,r){return n||(n=gt(e.doc,t.line)),zr(e,n,ra(e,n,t.ch,r),i)}function si(e,t,i,n,r,s){n=n||gt(e.doc,t.line),r||(r=Yi(e,n));function l(Te,Ie){var ze=fi(e,r,Te,Ie?"right":"left",s);return Ie?ze.left=ze.right:ze.right=ze.left,zr(e,n,ze,i)}var f=mt(n,e.doc.direction),p=t.ch,C=t.sticky;if(p>=n.text.length?(p=n.text.length,C="before"):p<=0&&(p=0,C="after"),!f)return l(C=="before"?p-1:p,C=="before");function P(Te,Ie,ze){var Ke=f[Ie],ot=Ke.level==1;return l(ze?Te-1:Te,ot!=ze)}var H=Ve(f,p,C),pe=Je,le=P(p,H,C=="before");return pe!=null&&(le.other=P(p,pe,C!="before")),le}function da(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Ji(e.display)*t.ch);var n=gt(e.doc,t.line),r=ai(n)+Hr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function yo(e,t,i,n,r){var s=_e(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function bo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return yo(n.first,0,null,-1,-1);var r=_n(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,gt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=gt(n,r);;){var f=zs(e,l,r,t,i),p=ci(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!p)return f;var C=p.find(1);if(C.line==r)return C;l=gt(n,r=C.line)}}function fa(e,t,i,n){n-=go(t);var r=t.text.length,s=dt(function(l){return fi(e,i,l-1).bottom<=n},r,0);return r=dt(function(l){return fi(e,i,l).top>n},s,r),{begin:s,end:r}}function pa(e,t,i,n){i||(i=Yi(e,t));var r=zr(e,t,fi(e,i,n),"line").top;return fa(e,t,i,r)}function xo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=ai(t);var s=Yi(e,t),l=go(t),f=0,p=t.text.length,C=!0,P=mt(t,e.doc.direction);if(P){var H=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,P,n,r);C=H.level!=1,f=C?H.from:H.to-1,p=C?H.to:H.from-1}var pe=null,le=null,Te=dt(function(St){var Ct=fi(e,s,St);return Ct.top+=l,Ct.bottom+=l,xo(Ct,n,r,!1)?(Ct.top<=r&&Ct.left<=n&&(pe=St,le=Ct),!0):!1},f,p),Ie,ze,Ke=!1;if(le){var ot=n-le.left<le.right-n,Xe=ot==C;Te=pe+(Xe?0:1),ze=Xe?"after":"before",Ie=ot?le.left:le.right}else{!C&&(Te==p||Te==f)&&Te++,ze=Te==0?"after":Te==t.text.length?"before":fi(e,s,Te-(C?1:0)).bottom+l<=r==C?"after":"before";var ht=si(e,_e(i,Te,ze),"line",t,s);Ie=ht.left,Ke=r<ht.top?-1:r>=ht.bottom?1:0}return Te=He(t.text,Te,1),yo(i,Te,ze,Ke,n-Ie)}function Gs(e,t,i,n,r,s,l){var f=dt(function(H){var pe=r[H],le=pe.level!=1;return xo(si(e,_e(i,le?pe.to:pe.from,le?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),p=r[f];if(f>0){var C=p.level!=1,P=si(e,_e(i,C?p.from:p.to,C?"after":"before"),"line",t,n);xo(P,s,l,!0)&&P.top>l&&(p=r[f-1])}return p}function Vs(e,t,i,n,r,s,l){var f=fa(e,t,n,l),p=f.begin,C=f.end;/\s/.test(t.text.charAt(C-1))&&C--;for(var P=null,H=null,pe=0;pe<r.length;pe++){var le=r[pe];if(le.from>=C||le.to<=p)continue;var Te=le.level!=1,Ie=fi(e,n,Te?Math.min(C,le.to)-1:Math.max(p,le.from)).right,ze=Ie<s?s-Ie+1e9:Ie-s;(!P||H>ze)&&(P=le,H=ze)}return P||(P=r[r.length-1]),P.from<p&&(P={from:p,to:P.to,level:P.level}),P.to>C&&(P={from:P.from,to:C,level:P.level}),P}var Pi;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(A("br"));Pi.appendChild(document.createTextNode("x"))}re(e.measure,Pi);var i=Pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Fe(e.measure),i||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),i=A("pre",[t],"CodeMirror-line-like");re(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(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:wo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function wo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=$i(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return function(r){if(Hn(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 Eo(e){var t=e.doc,i=ma(e);t.iter(function(n){var r=i(n);r!=n.height&&kn(n,r)})}function Ni(e,t,i,n){var r=e.display;if(!i&&ve(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(H){return null}var p=bo(e,s,l),C;if(n&&p.xRel>0&&(C=gt(e.doc,p.line).text).length==p.ch){var P=q(C,C.length,e.options.tabSize)-C.length;p=_e(p.line,Math.max(0,Math.round((s-na(e.display).left)/Ji(e.display))-P))}return p}function Ii(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 Nn(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)Dn&&xi(e.doc,t)<r.viewTo&&Ei(e);else if(i<=r.viewFrom)Dn&&Fr(e.doc,i+n)>r.viewFrom?Ei(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ei(e);else if(t<=r.viewFrom){var s=Gr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ei(e)}else if(i>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ei(e)}else{var f=Gr(e,t,t,-1),p=Gr(e,i,i+n,1);f&&p?(r.view=r.view.slice(0,f.index).concat(zt(e,f.lineN,p.lineN)).concat(r.view.slice(p.index)),r.viewTo+=n):Ei(e)}var C=r.externalMeasured;C&&(i<C.lineN?C.lineN+=n:t<C.lineN+C.size&&(r.externalMeasured=null))}function wi(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[Ii(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Se(l,i)==-1&&l.push(i)}function Ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,i,n){var r=Ii(e,t),s,l=e.display.view;if(!Dn||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(;xi(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 Ks(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=zt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=zt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ii(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(zt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ii(e,i)))),n.viewTo=i}function ga(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 yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function va(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)&&ya(e,f.head,r),p||Xs(e,f,s)}return n}function ya(e,t,i){var n=si(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(A("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(A("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 Vr(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=na(e.display),f=l.left,p=Math.max(n.sizerWidth,Ri(e)-n.sizer.offsetLeft)-l.right,C=r.direction=="ltr";function P(Xe,ht,St,Ct){ht<0&&(ht=0),ht=Math.round(ht),Ct=Math.round(Ct),s.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+Xe+`px;
|
|
top: `+ht+"px; width: "+(St==null?p-Xe:St)+`px;
|
|
height: `+(Ct-ht)+"px"))}function H(Xe,ht,St){var Ct=gt(r,Xe),Dt=Ct.text.length,tn,xn;function an(fn,Bn){return vo(e,_e(Xe,fn),"div",Ct,Bn)}function Gn(fn,Bn,Sn){var gn=pa(e,Ct,null,fn),pn=Bn=="ltr"==(Sn=="after")?"left":"right",ln=Sn=="after"?gn.begin:gn.end-(/\s/.test(Ct.text.charAt(gn.end-1))?2:1);return an(ln,pn)[pn]}var jn=mt(Ct,r.direction);return Ze(jn,ht||0,St==null?Dt:St,function(fn,Bn,Sn,gn){var pn=Sn=="ltr",ln=an(fn,pn?"left":"right"),Fn=an(Bn-1,pn?"right":"left"),ur=ht==null&&fn==0,Ai=St==null&&Bn==Dt,Tn=gn==0,pi=!jn||gn==jn.length-1;if(Fn.top-ln.top<=3){var Cn=(C?ur:Ai)&&Tn,Yo=(C?Ai:ur)&&pi,yi=Cn?f:(pn?ln:Fn).left,Wi=Yo?p:(pn?Fn:ln).right;P(yi,ln.top,Wi-yi,ln.bottom)}else{var Hi,Mn,hr,$o;pn?(Hi=C&&ur&&Tn?f:ln.left,Mn=C?p:Gn(fn,Sn,"before"),hr=C?f:Gn(Bn,Sn,"after"),$o=C&&Ai&&pi?p:Fn.right):(Hi=C?Gn(fn,Sn,"before"):f,Mn=!C&&ur&&Tn?p:ln.right,hr=!C&&Ai&&pi?f:Fn.left,$o=C?Gn(Bn,Sn,"after"):p),P(Hi,ln.top,Mn-Hi,ln.bottom),ln.bottom<Fn.top&&P(f,ln.bottom,null,Fn.top),P(hr,Fn.top,$o-hr,Fn.bottom)}(!tn||Vr(ln,tn)<0)&&(tn=ln),Vr(Fn,tn)<0&&(tn=Fn),(!xn||Vr(ln,xn)<0)&&(xn=ln),Vr(Fn,xn)<0&&(xn=Fn)}),{start:tn,end:xn}}var pe=t.from(),le=t.to();if(pe.line==le.line)H(pe.line,pe.ch,le.ch);else{var Te=gt(r,pe.line),Ie=gt(r,le.line),ze=Rn(Te)==Rn(Ie),Ke=H(pe.line,pe.ch,ze?Te.text.length+1:null).end,ot=H(le.line,ze?0:null,le.ch).start;ze&&(Ke.top<ot.top-2?(P(Ke.right,Ke.top,null,Ke.bottom),P(f,ot.top,ot.left,ot.bottom)):P(Ke.right,Ke.top,ot.left-Ke.right,Ke.bottom)),Ke.bottom<ot.top&&P(f,Ke.bottom,null,ot.top)}i.appendChild(s)}function So(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()||Zi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zi(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,ce(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),D&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function Zi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ce(e,"blur",e,t),e.state.focused=!1,xe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Kr(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(B&&Y<8){var p=r.node.offsetTop+r.node.offsetHeight;l=p-i,i=p}else{var C=r.node.getBoundingClientRect();l=C.bottom-C.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-C.left-1)}var P=r.line.height-l;if((P>.005||P<-.005)&&(kn(r.line,l),Ca(r.line),r.rest))for(var H=0;H<r.rest.length;H++)Ca(r.rest[H]);if(f>e.display.sizerWidth){var pe=Math.ceil(f/Ji(e.display));pe>e.display.maxLineLength&&(e.display.maxLineLength=pe,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(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 Xr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Hr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=_n(t,n),l=_n(t,r);if(i&&i.ensure){var f=i.ensure.from.line,p=i.ensure.to.line;f<s?(s=f,l=_n(t,ai(gt(t,f))+e.wrapper.clientHeight)):Math.min(p,t.lastLine())>=l&&(s=_n(t,ai(gt(t,p))-e.wrapper.clientHeight),l=p)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(Le(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&&!S){var s=A("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+di(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 $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?_e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?_e(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=si(e,t),p=!i||i==t?f:si(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 C=Lo(e,r),P=e.doc.scrollTop,H=e.doc.scrollLeft;if(C.scrollTop!=null&&(xr(e,C.scrollTop),Math.abs(e.doc.scrollTop-P)>1&&(l=!0)),C.scrollLeft!=null&&(ji(e,C.scrollLeft),Math.abs(e.doc.scrollLeft-H)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=Lo(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&ji(e,i.scrollLeft)}function Lo(e,t){var i=e.display,n=$i(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+fo(i),p=t.top<n,C=t.bottom>f-n;if(t.top<r)l.scrollTop=p?0:t.top;else if(t.bottom>r+s){var P=Math.min(t.top,(C?f:t.bottom)-s);P!=r&&(l.scrollTop=P)}var H=e.options.fixedGutter?0:i.gutters.offsetWidth,pe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-H,le=Ri(e)-i.gutters.offsetWidth,Te=t.right-t.left>le;return Te&&(t.right=t.left+le),t.left<10?l.scrollLeft=0:t.left<pe?l.scrollLeft=Math.max(0,t.left+H-(Te?0:10)):t.right>le+pe-3&&(l.scrollLeft=t.right+(Te?0:10)-le),l}function To(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=da(e,t.from),n=da(e,t.to);wa(e,i,n,t.margin)}}function wa(e,t,i,n){var r=Lo(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});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;Q||Ao(e,{top:t}),Ea(e,t,!0),Q&&Ao(e),Er(e,100)}function Ea(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 ji(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,_a(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+fo(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+di(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Bi=function(e,t,i){this.cm=i;var n=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),be(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),be(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,B&&Y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bi.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}},Bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bi.prototype.zeroWidthHack=function(){var e=T&&!w?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ee,this.disableVert=new Ee},Bi.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)},Bi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function qi(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Kr(e),Sa(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(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 ka={native:Bi,null:wr};function La(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&xe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(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"?ji(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&ce(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Fi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},ei(e.curOp)}function Ui(e){var t=e.curOp;t&&Wr(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&Ur(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 $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&_o(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Kr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(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+di(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ri(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ji(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==J();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qi(t,e.barMeasure),e.updatedDisplay&&Oo(t,e.barMeasure),e.selectionChanged&&So(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&ba(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Ta(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ji(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||Ce(s[f],"hide");if(l)for(var p=0;p<l.length;++p)l[p].lines.length&&Ce(l[p],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function zn(e,t){if(e.curOp)return t();Fi(e);try{return t()}finally{Ui(e)}}function yn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Fi(e);try{return t.apply(e,arguments)}finally{Ui(e)}}}function An(e){return function(){if(this.curOp)return e.apply(this,arguments);Fi(this);try{return e.apply(this,arguments)}finally{Ui(this)}}}function bn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Fi(t);try{return e.apply(this,arguments)}finally{Ui(t)}}}function Er(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Ge(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?Zt(t.mode,n.state):null,p=G(e,s,n,!0);f&&(n.state=f),s.styles=p.styles;var C=s.styleClasses,P=p.classes;P?s.styleClasses=P:C&&(s.styleClasses=null);for(var H=!l||l.length!=s.styles.length||C!=P&&(!C||!P||C.bgClass!=P.bgClass||C.textClass!=P.textClass),pe=0;!H&&pe<l.length;++pe)H=l[pe]!=s.styles[pe];H&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ut(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&zn(e,function(){for(var s=0;s<r.length;s++)wi(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Xr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ri(e),this.force=i,this.dims=Co(e),this.events=[]};$r.prototype.signal=function(e,t){j(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=di(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=di(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=J();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 ll(e){if(!e||!e.activeElt||e.activeElt==J())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 _o(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ei(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&&ga(e)==0)return!1;Aa(e)&&(Ei(e),t.dims=Co(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)),Dn&&(s=xi(e.doc,s),l=Fr(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ks(e,s,l),i.viewOffset=ai(gt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var p=ga(e);if(!f&&p==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var C=sl(e);return p>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),p>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(C),Fe(i.cursorDiv),Fe(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function Ta(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ri(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+fo(e.display)-po(e),i.top)}),t.visible=Xr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Xr(e.display,e.doc,i));if(!_o(e,t))break;Kr(e);var r=Cr(e);yr(e),qi(e,r),Oo(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 Ao(e,t){var i=new $r(e,t);if(_o(e,i)){Kr(e),Ta(e,i);var n=Cr(e);yr(e),qi(e,n),Oo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Te){var Ie=Te.nextSibling;return D&&T&&e.display.currentWheelTarget==Te?Te.style.display="none":Te.parentNode.removeChild(Te),Ie}for(var p=n.view,C=n.viewFrom,P=0;P<p.length;P++){var H=p[P];if(!H.hidden)if(!H.node||H.node.parentNode!=s){var pe=Is(e,H,C,i);s.insertBefore(pe,l)}else{for(;l!=H.node;)l=f(l);var le=r&&t!=null&&t<=C&&H.lineNumber;H.changes&&(Se(H.changes,"gutter")>-1&&(le=!1),Zo(e,H,C,i)),le&&(Fe(H.lineNumber),H.lineNumber.appendChild(document.createTextNode(ii(e.options,C)))),l=H.node.nextSibling}C+=H.size}for(;l;)l=f(l)}function Mo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(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+di(e)+"px"}function _a(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=wo(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 Aa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ii(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(A("div",[A("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",Mo(e.display),!0}return!1}function Do(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 Ma(e){var t=e.gutters,i=e.gutterSpecs;Fe(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(A("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",Mo(e)}function Sr(e){Ma(e.display),Nn(e),_a(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=me("div",null,"CodeMirror-code"),r.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=A("div",null,"CodeMirror-cursors"),r.measure=A("div",null,"CodeMirror-measure"),r.lineMeasure=A("div",null,"CodeMirror-measure"),r.lineSpace=me("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=me("div",[r.lineSpace],"CodeMirror-lines");r.mover=A("div",[s],null,"position: relative"),r.sizer=A("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=A("div",null,null,"position: absolute; height: "+tt+"px; width: 1px;"),r.gutters=A("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=A("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=A("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),B&&Y<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!D&&!(Q&&v)&&(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=Do(n.gutters,n.lineNumbers),Ma(r),i.init(r)}var Jr=0,Jn=null;B?Jn=-.53:Q?Jn=15:y?Jn=-.7:L&&(Jn=-1/3);function Oa(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 cl(e){var t=Oa(e);return t.x*=Jn,t.y*=Jn,t}function Da(e,t){var i=Oa(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&&T&&D){e:for(var C=t.target,P=s.view;C!=l;C=C.parentNode)for(var H=0;H<P.length;H++)if(P[H].node==C){e.display.currentWheelTarget=C;break e}}if(n&&!Q&&!x&&Jn!=null){r&&p&&xr(e,Math.max(0,l.scrollTop+r*Jn)),ji(e,Math.max(0,l.scrollLeft+n*Jn)),(!r||r&&p)&&E(t),s.wheelStartX=null;return}if(r&&Jn!=null){var pe=r*Jn,le=e.doc.scrollTop,Te=le+s.wrapper.clientHeight;pe<0?le=Math.max(0,le+pe-50):Te=Math.min(e.doc.height,Te+pe+50),Ao(e,{top:le,bottom:Te})}Jr<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 Ie=l.scrollLeft-s.wheelStartX,ze=l.scrollTop-s.wheelStartY,Ke=ze&&s.wheelDY&&ze/s.wheelDY||Ie&&s.wheelDX&&Ie/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Ke)return;Jn=(Jn*Jr+Ke)/(Jr+1),++Jr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Zn=function(e,t){this.ranges=e,this.primIndex=t};Zn.prototype.primary=function(){return this.ranges[this.primIndex]},Zn.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(!Rt(i.anchor,n.anchor)||!Rt(i.head,n.head))return!1}return!0},Zn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Kt(Gt(this.ranges[t].anchor),Gt(this.ranges[t].head));return new Zn(e,this.primIndex)},Zn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Zn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(rt(t,n.from())>=0&&rt(e,n.to())<=0)return i}return-1};var Kt=function(e,t){this.anchor=e,this.head=t};Kt.prototype.from=function(){return qt(this.anchor,this.head)},Kt.prototype.to=function(){return Xt(this.anchor,this.head)},Kt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function li(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(pe,le){return rt(pe.from(),le.from())}),i=Se(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],p=rt(f.to(),l.from());if(n&&!l.empty()?p>0:p>=0){var C=qt(f.from(),l.from()),P=Xt(f.to(),l.to()),H=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Kt(H?P:C,H?C:P))}}return new Zn(t,i)}function Si(e,t){return new Zn([new Kt(e,t||e)],0)}function ki(e){return e.text?_e(e.from.line+e.text.length-1,We(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ra(e,t){if(rt(e,t.from)<0)return e;if(rt(e,t.to)<=0)return ki(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+=ki(t).ch-t.to.ch),_e(i,n)}function Ro(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Kt(Ra(r.anchor,t),Ra(r.head,t)))}return li(e.cm,i,e.sel.primIndex)}function Pa(e,t,i){return e.line==t.line?_e(i.line,e.ch-t.ch+i.ch):_e(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=_e(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],p=Pa(f.from,r,s),C=Pa(ki(f),r,s);if(r=f.to,s=C,i=="around"){var P=e.sel.ranges[l],H=rt(P.head,P.anchor)<0;n[l]=new Kt(H?C:p,H?p:C)}else n[l]=new Kt(p,p)}return new Zn(n,e.sel.primIndex)}function Po(e){e.doc.mode=wt(e.options,e.doc.modeOption),kr(e)}function kr(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,Er(e,100),e.state.modeGen++,e.curOp&&Nn(e)}function Na(e,t){return t.from.ch==0&&t.to.ch==0&&We(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function No(e,t,i,n){function r(ot){return i?i[ot]:null}function s(ot,Xe,ht){Jo(ot,Xe,ht,n),En(ot,"change",ot,t)}function l(ot,Xe){for(var ht=[],St=ot;St<Xe;++St)ht.push(new Di(C[St],r(St),n));return ht}var f=t.from,p=t.to,C=t.text,P=gt(e,f.line),H=gt(e,p.line),pe=We(C),le=r(C.length-1),Te=p.line-f.line;if(t.full)e.insert(0,l(0,C.length)),e.remove(C.length,e.size-C.length);else if(Na(e,t)){var Ie=l(0,C.length-1);s(H,H.text,le),Te&&e.remove(f.line,Te),Ie.length&&e.insert(f.line,Ie)}else if(P==H)if(C.length==1)s(P,P.text.slice(0,f.ch)+pe+P.text.slice(p.ch),le);else{var ze=l(1,C.length-1);ze.push(new Di(pe+P.text.slice(p.ch),le,n)),s(P,P.text.slice(0,f.ch)+C[0],r(0)),e.insert(f.line+1,ze)}else if(C.length==1)s(P,P.text.slice(0,f.ch)+C[0]+H.text.slice(p.ch),r(0)),e.remove(f.line+1,Te);else{s(P,P.text.slice(0,f.ch)+C[0],r(0)),s(H,pe+H.text.slice(p.ch),le);var Ke=l(1,C.length-1);Te>1&&e.remove(f.line+1,Te-1),e.insert(f.line+1,Ke)}En(e,"change",e,t)}function Li(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 C=l&&p.sharedHist;if(i&&!C)continue;t(p.doc,C),n(p.doc,r,C)}}n(e,null,!0)}function Ia(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Eo(e),Po(e),ja(e),e.options.lineWrapping||Ur(e),e.options.mode=t.modeOption,Nn(e)}function ja(e){(e.doc.direction=="rtl"?ce:xe)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){zn(e,function(){ja(e),Nn(e)})}function Zr(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 Io(e,t){var i={from:Gt(t.from),to:ki(t),text:On(e,t.from,t.to)};return Ua(e,i,t.from.line,t.to.line+1),Li(e,function(n){return Ua(n,i,t.from.line,t.to.line+1)},!0),i}function Ba(e){for(;e.length;){var t=We(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ba(e.done),We(e.done);if(e.done.length&&!We(e.done).ranges)return We(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),We(e.done)}function Fa(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=We(l.changes),rt(t.from,t.to)==0&&rt(t.from,f.to)==0?f.to=ki(t):l.changes.push(Io(e,t));else{var p=We(r.done);for((!p||!p.ranges)&&Qr(e.sel,r.done),l={changes:[Io(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||Ce(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,We(r.done),t))?r.done[r.done.length-1]=t:Qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ba(r.undone)}function Qr(e,t){var i=We(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ua(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 Wa(e,t){var i=yl(e,t),n=oi(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],C=0;C<s.length;++C)if(s[C].marker==p.marker)continue e;s.push(p)}}else l&&(i[r]=l)}return i}function er(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Zn.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var p=0;p<l.length;++p){var C=l[p],P=void 0;if(f.push({from:C.from,to:C.to,text:C.text}),t)for(var H in C)(P=H.match(/^spans_(\d+)$/))&&(Se(t,Number(P[1]))>-1&&(We(f)[H]=C[H],delete C[H]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=rt(t,r)<0;s!=rt(i,r)<0?(r=t,t=i):s!=rt(t,i)<0&&(t=i)}return new Kt(r,t)}else return new Kt(i||t,t)}function qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ln(e,new Zn([jo(e.sel.primary(),t,i,r)],0),n)}function Ha(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]=jo(e.sel.ranges[s],t[s],null,r);var l=li(e.cm,n,e.sel.primIndex);Ln(e,l,i)}function Bo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Ln(e,li(e.cm,r,e.sel.primIndex),n)}function za(e,t,i,n){Ln(e,Si(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 Kt(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Ce(e,"beforeSelectionChange",e,n),e.cm&&Ce(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?li(e.cm,n.ranges,n.ranges.length-1):t}function Ga(e,t,i){var n=e.history.done,r=We(n);r&&r.ranges?(n[n.length-1]=t,eo(e,t,i)):Ln(e,t,i)}function Ln(e,t,i){eo(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function eo(e,t,i){(j(e,"beforeSelectionChange")||e.cm&&j(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(rt(t.primary().head,e.sel.primary().head)<0?-1:1);Va(e,Xa(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Qi(e.cm)}function Va(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,X(e.cm)),En(e,"cursorActivity",e)}function Ka(e){Va(e,Xa(e,e.sel,null,!1))}function Xa(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=to(e,l.anchor,f&&f.anchor,i,n),C=to(e,l.head,f&&f.head,i,n);(r||p!=l.anchor||C!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Kt(p,C))}return r?li(e.cm,r,t.primIndex):t}function tr(e,t,i,n,r){var s=gt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],p=f.marker,C="selectLeft"in p?!p.selectLeft:p.inclusiveLeft,P="selectRight"in p?!p.selectRight:p.inclusiveRight;if((f.from==null||(C?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(P?f.to>=t.ch:f.to>t.ch))){if(r&&(Ce(p,"beforeCursorEnter"),p.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!p.atomic)continue;if(i){var H=p.find(n<0?1:-1),pe=void 0;if((n<0?P:C)&&(H=Ya(e,H,-n,H&&H.line==t.line?s:null)),H&&H.line==t.line&&(pe=rt(H,i))&&(n<0?pe<0:pe>0))return tr(e,H,t,n,r)}var le=p.find(n<0?-1:1);return(n<0?C:P)&&(le=Ya(e,le,n,le.line==t.line?s:null)),le?tr(e,le,t,n,r):null}}return t}function to(e,t,i,n,r){var s=n||1,l=tr(e,t,i,s,r)||!r&&tr(e,t,i,s,!0)||tr(e,t,i,-s,r)||!r&&tr(e,t,i,-s,!0);return l||(e.cantEdit=!0,_e(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,_e(t.line-1)):null:i>0&&t.ch==(n||gt(e,t.line)).text.length?t.line<e.first+e.size-1?_e(t.line+1,0):null:new _e(t.line,t.ch+i)}function $a(e){e.setSelection(_e(e.firstLine(),0),_e(e.lastLine()),je)}function Ja(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)}),Ce(e,"beforeChange",e,n),e.cm&&Ce(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function nr(e,t,i){if(e.cm){if(!e.cm.curOp)return yn(e.cm,nr)(e,t,i);if(e.cm.state.suppressEdits)return}if((j(e,"beforeChange")||e.cm&&j(e.cm,"beforeChange"))&&(t=Ja(e,t,!0),!t))return;var n=zi&&!i&&Mi(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Za(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Za(e,t)}function Za(e,t){if(t.text.length==1&&t.text[0]==""&&rt(t.from,t.to)==0)return;var i=Ro(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),Lr(e,t,i,oi(e,t));var n=[];Li(e,function(r,s){!s&&Se(n,r.history)==-1&&(ts(r.history,t),n.push(r.history)),Lr(r,t,null,oi(r,t))})}function no(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,C=0;C<f.length&&!(s=f[C],i?s.ranges&&!s.equals(e.sel):!s.ranges);C++);if(C==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Qr(s,p),i&&!s.equals(e.sel)){Ln(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var P=[];Qr(l,p),p.push({changes:P,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var H=j(e,"beforeChange")||e.cm&&j(e.cm,"beforeChange"),pe=function(Ie){var ze=s.changes[Ie];if(ze.origin=t,H&&!Ja(e,ze,!1))return f.length=0,{};P.push(Io(e,ze));var Ke=Ie?Ro(e,ze):We(f);Lr(e,ze,Ke,Wa(e,ze)),!Ie&&e.cm&&e.cm.scrollIntoView({from:ze.from,to:ki(ze)});var ot=[];Li(e,function(Xe,ht){!ht&&Se(ot,Xe.history)==-1&&(ts(Xe.history,ze),ot.push(Xe.history)),Lr(Xe,ze,null,Wa(Xe,ze))})},le=s.changes.length-1;le>=0;--le){var Te=pe(le);if(Te)return Te.v}}function Qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Zn(nt(e.sel.ranges,function(r){return new Kt(_e(r.anchor.line+t,r.anchor.ch),_e(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Nn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)wi(e.cm,n,"gutter")}}function Lr(e,t,i,n){if(e.cm&&!e.cm.curOp)return yn(e.cm,Lr)(e,t,i,n);if(t.to.line<e.first){Qa(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);Qa(e,r),t={from:_e(e.first,0),to:_e(t.to.line+r,t.to.ch),text:[We(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:_e(s,gt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=On(e,t.from,t.to),i||(i=Ro(e,t)),e.cm?xl(e.cm,t,n):No(e,t,n),eo(e,i,je),e.cantEdit&&to(e,_e(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(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=Ot(Rn(gt(n,s.line))),n.iter(p,l.line+1,function(le){if(le==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&X(e),No(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(p,s.line+t.text.length,function(le){var Te=Xi(le);Te>r.maxLineLength&&(r.maxLine=le,r.maxLineLength=Te,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),qn(n,s.line),Er(e,400);var C=t.text.length-(l.line-s.line)-1;t.full?Nn(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?wi(e,s.line,"text"):Nn(e,s.line,l.line+1,C);var P=j(e,"changes"),H=j(e,"change");if(H||P){var pe={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};H&&En(e,"change",e,pe),P&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(pe)}e.display.selForContextMenu=null}function ir(e,t,i,n,r){var s;n||(n=i),rt(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:r})}function qa(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function es(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++)qa(s.ranges[f].anchor,t,i,n),qa(s.ranges[f].head,t,i,n);continue}for(var p=0;p<s.changes.length;++p){var C=s.changes[p];if(i<C.from.line)C.from=_e(C.from.line+n,C.from.ch),C.to=_e(C.to.line+n,C.to.ch);else if(t<=C.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ts(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;es(e.done,i,n,r),es(e.undone,i,n,r)}function Tr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=gt(e,h(e,t)):r=Ot(t),r==null?null:(n(s,r)&&e.cm&&wi(e.cm,r,i),s)}function _r(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}_r.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,ho(r),En(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 Ar(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}Ar.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 _r))){var f=[];this.collapse(f),this.children=[new _r(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 _r(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 Ar(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=Se(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Ar(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 Mr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Mr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Ot(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=gr(this);kn(i,Math.max(0,i.height-s)),e&&(zn(e,function(){ns(e,i,-s),wi(e,n,"widget")}),En(e,"lineWidgetCleared",e,this,n))},Mr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=gr(this)-t;if(!r)return;Hn(this.doc,n)||kn(n,n.height+r),i&&zn(i,function(){i.curOp.forceUpdate=!0,ns(i,n,r),En(i,"lineWidgetChanged",i,e,Ot(n))})},V(Mr);function ns(e,t,i){ai(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&To(e,i)}function Cl(e,t,i,n){var r=new Mr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Tr(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&&!Hn(e,l)){var p=ai(l)<e.scrollTop;kn(l,l.height+gr(r)),p&&To(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&En(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Ot(t)),r}var is=0,Ti=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++is};Ti.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Fi(e),j(this,"clear")){var i=this.find();i&&En(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=ri(l.markedSpans,this);e&&!this.collapsed?wi(e,Ot(l),"text"):e&&(f.to!=null&&(r=Ot(l)),f.from!=null&&(n=Ot(l))),l.markedSpans=mi(l.markedSpans,f),f.from==null&&this.collapsed&&!Hn(this.doc,l)&&e&&kn(l,$i(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var p=0;p<this.lines.length;++p){var C=Rn(this.lines[p]),P=Xi(C);P>e.display.maxLineLength&&(e.display.maxLine=C,e.display.maxLineLength=P,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Nn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&En(e,"markerCleared",e,this,n,r),t&&Ui(e),this.parent&&this.parent.clear()},Ti.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=ri(s.markedSpans,this);if(l.from!=null&&(i=_e(t?s:Ot(s),l.from),e==-1))return i;if(l.to!=null&&(n=_e(t?s:Ot(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ti.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;zn(n,function(){var r=t.line,s=Ot(t.line),l=mo(n,s);if(l&&(sa(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Hn(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var p=gr(i)-f;p&&kn(r,r.height+p)}En(n,"markerChanged",n,e)})},Ti.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ti.prototype.detachLine=function(e){if(this.lines.splice(Se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},V(Ti);function rr(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return yn(e.cm,rr)(e,t,i,n,r);var s=new Ti(e,r),l=rt(t,i);if(n&&b(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=me("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(un(e,t.line,t,i,s)||t.line!=i.line&&un(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wn()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,p=e.cm,C;if(e.iter(f,i.line+1,function(H){p&&s.collapsed&&!p.options.lineWrapping&&Rn(H)==p.display.maxLine&&(C=!0),s.collapsed&&f!=t.line&&kn(H,0),hi(H,new bi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(H){Hn(e,H)&&kn(H,0)}),s.clearOnEnter&&be(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++is,s.atomic=!0),p){if(C&&(p.curOp.updateMaxLine=!0),s.collapsed)Nn(p,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var P=t.line;P<=i.line;P++)wi(p,P,"text");s.atomic&&Ka(p.doc),En(p,"markerAdded",p,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();En(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},V(Or);function wl(e,t,i,n,r){n=b(n),n.shared=!1;var s=[rr(e,t,i,n,r)],l=s[0],f=n.widgetNode;return Li(e,function(p){f&&(n.widgetNode=f.cloneNode(!0)),s.push(rr(p,o(p,t),o(p,i),n,r));for(var C=0;C<p.linked.length;++C)if(p.linked[C].isParent)return;l=We(s)}),new Or(s,l)}function rs(e){return e.findMarks(_e(e.first,0),e.clipPos(_e(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(rt(s,l)){var f=rr(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];Li(r.primary.doc,function(p){return s.push(p)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];Se(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,In=function(e,t,i,n,r){if(!(this instanceof In))return new In(e,t,i,n,r);i==null&&(i=0),Ar.call(this,[new _r([new Di("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=_e(i,0);this.sel=Si(s),this.history=new Zr(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)),No(this,{from:s,to:s,text:e}),Ln(this,Si(s),je)};In.prototype=F(Ar.prototype,{constructor:In,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=ni(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:bn(function(e){var t=_e(this.first,0),i=this.first+this.size-1;nr(this,{from:t,to:_e(i,gt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Ln(this,Si(t),je)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ir(this,e,t,i,n)},getRange:function(e,t,i){var n=On(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(Vn(this,e))return gt(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=gt(this,e)),Rn(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:bn(function(e,t,i){za(this,o(this,typeof e=="number"?_e(e,t||0):e),null,i)}),setSelection:bn(function(e,t,i){za(this,o(this,e),o(this,t||e),i)}),extendSelection:bn(function(e,t,i){qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:bn(function(e,t){Ha(this,u(this,e),t)}),extendSelectionsBy:bn(function(e,t){var i=nt(this.sel.ranges,e);Ha(this,u(this,i),t)}),setSelections:bn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Kt(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ln(this,li(this.cm,n,t),i)}),addSelection:bn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Kt(o(this,e),o(this,t||e))),Ln(this,li(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=On(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=On(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:bn(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"&&dl(this,n,t),p=n.length-1;p>=0;p--)nr(this,n[p]);f?Ga(this,f):this.cm&&Qi(this.cm)}),undo:bn(function(){no(this,"undo")}),redo:bn(function(){no(this,"redo")}),undoSelection:bn(function(){no(this,"undo",!0)}),redoSelection:bn(function(){no(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 Zr(this.history.maxGeneration),Li(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:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Zr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:bn(function(e,t,i){return Tr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Me(r)&&(n.gutterMarkers=null),!0})}),clearGutter:bn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Tr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Me(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Vn(this,e))return null;if(t=e,e=gt(this,e),!e)return null}else if(t=Ot(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:bn(function(e,t,i){return Tr(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(ne(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:bn(function(e,t,i){return Tr(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(ne(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:bn(function(e,t,i){return Cl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return rr(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),rr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=gt(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,_e(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 In(ni(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 In(ni(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,rs(this)),n},unlinkDoc:function(e){if(e instanceof on&&(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(rs(this));break}if(e.history==this.history){var n=[e.id];Li(e,function(r){return n.push(r.id)},!0),e.history=new Zr(null),e.history.done=er(this.history.done,n),e.history.undone=er(this.history.undone,n)}},iterLinkedDocs:function(e){Li(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Lt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:bn(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)})}),In.prototype.eachLine=In.prototype.iter;var os=0;function Ll(e){var t=this;if(as(t),Le(t,e)||gi(t.display,e))return;E(e),B&&(os=+new Date);var i=Ni(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&&yn(t,function(){i=o(t.doc,i);var le={from:i,to:i,text:t.doc.splitLines(s.filter(function(Te){return Te!=null}).join(t.doc.lineSeparator())),origin:"paste"};nr(t.doc,le),Ga(t.doc,Si(o(t.doc,i),o(t.doc,ki(le))))})()},p=function(le,Te){if(t.options.allowDropFileTypes&&Se(t.options.allowDropFileTypes,le.type)==-1){f();return}var Ie=new FileReader;Ie.onerror=function(){return f()},Ie.onload=function(){var ze=Ie.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ze)){f();return}s[Te]=ze,f()},Ie.readAsText(le)},C=0;C<n.length;C++)p(n[C],C);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 P=e.dataTransfer.getData("Text");if(P){var H;if(t.state.draggingText&&!t.state.draggingText.copy&&(H=t.listSelections()),eo(t.doc,Si(i,i)),H)for(var pe=0;pe<H.length;++pe)ir(t.doc,"",H[pe].anchor,H[pe].head,"drag");t.replaceSelection(P,"around","paste"),t.display.input.focus()}}catch(le){}}}function Tl(e,t){if(B&&(!e.state.draggingText||+new Date-os<100)){W(t);return}if(Le(e,t)||gi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!L){var i=A("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",x&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),x&&i.parentNode.removeChild(i)}}function _l(e,t){var i=Ni(e,t);if(!i)return;var n=document.createDocumentFragment();ya(e,i,n),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),re(e.display.dragCursor,n)}function as(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(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 ls=!1;function Al(){if(ls)return;Ml(),ls=!0}function Ml(){var e;be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ol)},100))}),be(window,"blur",function(){return ss(Zi)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var _i={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"},Dr=0;Dr<10;Dr++)_i[Dr+48]=_i[Dr+96]=String(Dr);for(var io=65;io<=90;io++)_i[io]=String.fromCharCode(io);for(var Rr=1;Rr<=12;Rr++)_i[Rr+111]=_i[Rr+63235]="F"+Rr;var vi={};vi.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"},vi.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"},vi.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"},vi.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"]},vi.default=T?vi.macDefault:vi.pcDefault;function Dl(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 Rl(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=nt(i.split(" "),Dl),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 C in t)e[C]=t[C];return e}function or(e,t,i,n){t=ro(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 or(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=or(e,t.fallthrough[s],i,n);if(l)return l}}}function us(e){var t=typeof e=="string"?e:_i[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ue?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ue?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(x&&e.keyCode==34&&e.char)return!1;var i=_i[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function ro(e){return typeof e=="string"?vi[e]:e}function ar(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&rt(s.from,We(n).to)<=0;){var l=n.pop();if(rt(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}zn(e,function(){for(var f=n.length-1;f>=0;f--)ir(e.doc,"",n[f].from,n[f].to,"+delete");Qi(e)})}function Fo(e,t,i){var n=He(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Uo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new _e(t.line,n,i<0?"after":"before")}function Wo(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?We(s):s[0],f=r<0==(l.level==1),p=f?"after":"before",C;if(l.level>0||t.doc.direction=="rtl"){var P=Yi(t,i);C=r<0?i.text.length-1:0;var H=fi(t,P,C).top;C=dt(function(pe){return fi(t,P,pe).top==H},r<0==(l.level==1)?l.from:l.to-1,C),p=="before"&&(C=Fo(i,C,1))}else C=r<0?l.to:l.from;return new _e(n,C,p)}}return new _e(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 Uo(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=Ve(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 Uo(t,i,n);var f=function(Ke,ot){return Fo(t,Ke instanceof _e?Ke.ch:Ke,ot)},p,C=function(Ke){return e.options.lineWrapping?(p=p||Yi(e,t),pa(e,t,p,Ke)):{begin:0,end:t.text.length}},P=C(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var H=l.level==1==n<0,pe=f(i,H?1:-1);if(pe!=null&&(H?pe<=l.to&&pe<=P.end:pe>=l.from&&pe>=P.begin)){var le=H?"before":"after";return new _e(i.line,pe,le)}}var Te=function(Ke,ot,Xe){for(var ht=function(tn,xn){return xn?new _e(i.line,f(tn,1),"before"):new _e(i.line,tn,"after")};Ke>=0&&Ke<r.length;Ke+=ot){var St=r[Ke],Ct=ot>0==(St.level!=1),Dt=Ct?Xe.begin:f(Xe.end,-1);if(St.from<=Dt&&Dt<St.to)return ht(Dt,Ct);if(Dt=Ct?St.from:f(St.to,-1),Xe.begin<=Dt&&Dt<Xe.end)return ht(Dt,Ct)}},Ie=Te(s+n,n,P);if(Ie)return Ie;var ze=n>0?P.end:f(P.begin,-1);return ze!=null&&!(n>0&&ze==t.text.length)&&(Ie=Te(n>0?0:r.length-1,n,C(ze)),Ie)?Ie:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),je)},killLine:function(e){return ar(e,function(t){if(t.empty()){var i=gt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:_e(t.head.line+1,0)}:{from:t.head,to:_e(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ar(e,function(t){return{from:_e(t.from().line,0),to:o(e.doc,_e(t.to().line+1,0))}})},delLineLeft:function(e){return ar(e,function(t){return{from:_e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ar(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 ar(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(_e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(_e(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(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")},Oe)},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")},Oe)},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/)?fs(e,t.head):n},Oe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=q(e.getLine(s.line),s.ch,n);t.push(z(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return zn(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=gt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new _e(r.line,r.ch-1)),r.ch>0)r=new _e(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),_e(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=gt(e.doc,r.line-1).text;l&&(r=new _e(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),_e(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Kt(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return zn(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);Qi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var i=gt(e.doc,t),n=Rn(i);return n!=i&&(t=Ot(n)),Wo(!0,e,n,t,1)}function Nl(e,t){var i=gt(e.doc,t),n=Vi(i);return n!=i&&(t=Ot(n)),Wo(!0,e,i,t,-1)}function fs(e,t){var i=ds(e,t.line),n=gt(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 _e(i.line,l?0:s,i.sticky)}return i}function oo(e,t,i){if(typeof t=="string"&&(t=Pr[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)!=Qe}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=or(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&or(t,e.options.extraKeys,i,e)||or(t,e.options.keyMap,i,e)}var jl=new Ee;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ps(e,r+" "+t,i,n))return!0}return ps(e,t,i,n)}function ps(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&En(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(E(i),So(e)),!!r}function ms(e,t){var i=cs(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return oo(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return oo(e,n)}):Nr(e,i,t,function(n){return oo(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return oo(e,n,!0)})}var Ho=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=J(),Le(t,e))return;B&&Y<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=ms(t,e);x&&(Ho=n?i:null,!n&&i==88&&!$t&&(T?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),Q&&!T&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;ce(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(xe(t,"CodeMirror-crosshair"),at(document,"keyup",i),at(document,"mouseover",i))}be(document,"keyup",i),be(document,"mouseover",i)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Le(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(gi(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||T&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(x&&i==Ho){Ho=null,E(e);return}if(x&&(!e.which||e.which<10)&&ms(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Ul=400,zo=function(e,t,i){this.time=e,this.pos=t,this.button=i};zo.prototype.compare=function(e,t,i){return this.time+Ul>e&&rt(t,this.pos)==0&&i==this.button};var Ir,jr;function Wl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new zo(i,e,t),Ir=null,"double"):(Ir=new zo(i,e,t),jr=null,"single")}function bs(e){var t=this,i=t.display;if(Le(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,gi(i,e)){D||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Go(t,e))return;var n=Ni(t,e),r=oe(e),s=n?Wl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):ve(e)==i.scroller&&E(e):r==2?(n&&qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(ke?t.display.input.onContextMenu(e):xa(t))}function Hl(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,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Qe}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=O?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=T?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(T?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){B?setTimeout(_(ba,e),0):e.curOp.focus=J();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ne&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(rt((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(rt(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Kl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=yn(e,function(C){D&&(r.scroller.draggable=!1),e.state.draggingText=!1,at(r.wrapper.ownerDocument,"mouseup",l),at(r.wrapper.ownerDocument,"mousemove",f),at(r.scroller,"dragstart",p),at(r.scroller,"drop",l),s||(E(C),n.addNew||qr(e.doc,i,null,null,n.extend),D&&!L||B&&Y==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(C){s=s||Math.abs(t.clientX-C.clientX)+Math.abs(t.clientY-C.clientY)>=10},p=function(){return s=!0};D&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),be(r.wrapper.ownerDocument,"mouseup",l),be(r.wrapper.ownerDocument,"mousemove",f),be(r.scroller,"dragstart",p),be(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Kt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Kt(_e(t.line,0),o(e.doc,_e(t.line+1,0)));var n=i(e,t);return new Kt(n.from,n.to)}function Kl(e,t,i,n){var r=e.display,s=e.doc;E(t);var l,f,p=s.sel,C=p.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=C[f]:l=new Kt(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Kt(i,i)),i=Ni(e,t,!0,!0),f=-1;else{var P=xs(e,i,n.unit);n.extend?l=jo(l,P.anchor,P.head,n.extend):l=P}n.addNew?f==-1?(f=C.length,Ln(s,li(e,C.concat([l]),f),{scroll:!1,origin:"*mouse"})):C.length>1&&C[f].empty()&&n.unit=="char"&&!n.extend?(Ln(s,li(e,C.slice(0,f).concat(C.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=s.sel):Bo(s,f,l,Ue):(f=0,Ln(s,new Zn([l],0),Ue),p=s.sel);var H=i;function pe(Xe){if(rt(H,Xe)==0)return;if(H=Xe,n.unit=="rectangle"){for(var ht=[],St=e.options.tabSize,Ct=q(gt(s,i.line).text,i.ch,St),Dt=q(gt(s,Xe.line).text,Xe.ch,St),tn=Math.min(Ct,Dt),xn=Math.max(Ct,Dt),an=Math.min(i.line,Xe.line),Gn=Math.min(e.lastLine(),Math.max(i.line,Xe.line));an<=Gn;an++){var jn=gt(s,an).text,fn=Pe(jn,tn,St);tn==xn?ht.push(new Kt(_e(an,fn),_e(an,fn))):jn.length>fn&&ht.push(new Kt(_e(an,fn),_e(an,Pe(jn,xn,St))))}ht.length||ht.push(new Kt(i,i)),Ln(s,li(e,p.ranges.slice(0,f).concat(ht),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Xe)}else{var Bn=l,Sn=xs(e,Xe,n.unit),gn=Bn.anchor,pn;rt(Sn.anchor,gn)>0?(pn=Sn.head,gn=qt(Bn.from(),Sn.anchor)):(pn=Sn.anchor,gn=Xt(Bn.to(),Sn.head));var ln=p.ranges.slice(0);ln[f]=Xl(e,new Kt(o(s,gn),pn)),Ln(s,li(e,ln,f),Ue)}}var le=r.wrapper.getBoundingClientRect(),Te=0;function Ie(Xe){var ht=++Te,St=Ni(e,Xe,!0,n.unit=="rectangle");if(!St)return;if(rt(St,H)!=0){e.curOp.focus=J(),pe(St);var Ct=Xr(r,s);(St.line>=Ct.to||St.line<Ct.from)&&setTimeout(yn(e,function(){Te==ht&&Ie(Xe)}),150)}else{var Dt=Xe.clientY<le.top?-20:Xe.clientY>le.bottom?20:0;Dt&&setTimeout(yn(e,function(){if(Te!=ht)return;r.scroller.scrollTop+=Dt,Ie(Xe)}),50)}}function ze(Xe){e.state.selectingText=!1,Te=Infinity,Xe&&(E(Xe),r.input.focus()),at(r.wrapper.ownerDocument,"mousemove",Ke),at(r.wrapper.ownerDocument,"mouseup",ot),s.history.lastSelOrigin=null}var Ke=yn(e,function(Xe){Xe.buttons===0||!oe(Xe)?ze(Xe):Ie(Xe)}),ot=yn(e,ze);e.state.selectingText=ot,be(r.wrapper.ownerDocument,"mousemove",Ke),be(r.wrapper.ownerDocument,"mouseup",ot)}function Xl(e,t){var i=t.anchor,n=t.head,r=gt(e.doc,i.line);if(rt(i,n)==0&&i.sticky==n.sticky)return t;var s=mt(r);if(!s)return t;var l=Ve(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 C;if(n.line!=i.line)C=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var P=Ve(s,n.ch,n.sticky),H=P-l||(n.ch-i.ch)*(f.level==1?-1:1);P==p-1||P==p?C=H<0:C=H>0}var pe=s[p+(C?-1:0)],le=C==(pe.level==1),Te=le?pe.from:pe.to,Ie=le?"after":"before";return i.ch==Te&&i.sticky==Ie?t:new Kt(new _e(i.line,Te,Ie),n)}function Cs(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(pe){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&E(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!j(e,i))return R(t);s-=f.top-l.viewOffset;for(var p=0;p<e.display.gutterSpecs.length;++p){var C=l.gutters.childNodes[p];if(C&&C.getBoundingClientRect().right>=r){var P=_n(e.doc,s),H=e.display.gutterSpecs[p];return Ce(e,i,e,P,H.className,t),R(t)}}}function Go(e,t){return Cs(e,t,"gutterClick",!0)}function ws(e,t){if(gi(e.display,t)||Yl(e,t))return;if(Le(e,t,"contextmenu"))return;ke||e.display.input.onContextMenu(t)}function Yl(e,t){return j(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Es(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var sr={toString:function(){return"CodeMirror.Init"}},Ss={},ao={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,p,C){C!=sr&&s(f,p,C)}:s)}e.defineOption=i,e.Init=sr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Po(n)},!0),i("indentUnit",2,Po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){kr(n),vr(n),Nn(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 C=0;;){var P=p.text.indexOf(r,C);if(P==-1)break;C=P+r.length,s.push(_e(l,P))}l++});for(var f=s.length-1;f>=0;f--)ir(n.doc,r,s[f],_e(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!=sr&&n.refresh()}),i("specialCharPlaceholder",Wt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",v?"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",!se),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Sr(n)},!0),i("keyMap","default",function(n,r,s){var l=ro(r),f=s!=sr&&ro(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Sr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?wo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qi(n)},!0),i("scrollbarStyle","native",function(n){La(n),qi(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=Do(n.options.gutters,r),Sr(n)},!0),i("firstLineNumber",1,Sr,!0),i("lineNumberFormatter",function(n){return n},Sr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(Zi(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,kr,!0),i("addModeClass",!1,kr,!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,kr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=sr;if(!t!=!n){var r=e.display.dragFunctions,s=t?be:at;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(ce(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(xe(e.display.wrapper,"CodeMirror-wrap"),Ur(e)),Eo(e),Nn(e),vr(e),setTimeout(function(){return qi(e)},100)}function on(e,t){var i=this;if(!(this instanceof on))return new on(e,t);this.options=t=t?b(t):{},b(Ss,t,!1);var n=t.value;typeof n=="string"?n=new In(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new on.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),La(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ee,keySeq:null,specialChars:null},t.autofocus&&!v&&s.input.focus(),B&&Y<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Al(),Fi(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):Zi(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);Aa(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Vo.length;++f)Vo[f](this);Ui(this),D&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}on.defaults=Ss,on.optionHandlers=ao;function Ql(e){var t=e.display;be(t.scroller,"mousedown",yn(e,bs)),B&&Y<11?be(t.scroller,"dblclick",yn(e,function(p){if(Le(e,p))return;var C=Ni(e,p);if(!C||Go(e,p)||gi(e.display,p))return;E(p);var P=e.findWordAt(C);qr(e.doc,P.anchor,P.head)})):be(t.scroller,"dblclick",function(p){return Le(e,p)||E(p)}),be(t.scroller,"contextmenu",function(p){return ws(e,p)}),be(t.input.getField(),"contextmenu",function(p){t.scroller.contains(p.target)||ws(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 C=p.touches[0];return C.radiusX<=1&&C.radiusY<=1}function l(p,C){if(C.left==null)return!0;var P=C.left-p.left,H=C.top-p.top;return P*P+H*H>20*20}be(t.scroller,"touchstart",function(p){if(!Le(e,p)&&!s(p)&&!Go(e,p)){t.input.ensurePolled(),clearTimeout(i);var C=+new Date;t.activeTouch={start:C,moved:!1,prev:C-n.end<=300?n:null},p.touches.length==1&&(t.activeTouch.left=p.touches[0].pageX,t.activeTouch.top=p.touches[0].pageY)}}),be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),be(t.scroller,"touchend",function(p){var C=t.activeTouch;if(C&&!gi(t,p)&&C.left!=null&&!C.moved&&new Date-C.start<300){var P=e.coordsChar(t.activeTouch,"page"),H;!C.prev||l(C,C.prev)?H=new Kt(P,P):!C.prev.prev||l(C,C.prev.prev)?H=e.findWordAt(P):H=new Kt(_e(P.line,0),o(e.doc,_e(P.line+1,0))),e.setSelection(H.anchor,H.head),e.focus(),E(p)}r()}),be(t.scroller,"touchcancel",r),be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),ji(e,t.scroller.scrollLeft,!0),Ce(e,"scroll",e))}),be(t.scroller,"mousewheel",function(p){return Da(e,p)}),be(t.scroller,"DOMMouseScroll",function(p){return Da(e,p)}),be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(p){Le(e,p)||W(p)},over:function(p){Le(e,p)||(_l(e,p),W(p))},start:function(p){return Tl(e,p)},drop:yn(e,Ll),leave:function(p){Le(e,p)||as(e)}};var f=t.input.getField();be(f,"keyup",function(p){return vs.call(e,p)}),be(f,"keydown",yn(e,gs)),be(f,"keypress",yn(e,ys)),be(f,"focus",function(p){return ko(e,p)}),be(f,"blur",function(p){return Zi(e,p)})}var Vo=[];on.defineInitHook=function(e){return Vo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=Ge(e,t).state:i="prev");var l=e.options.tabSize,f=gt(r,t),p=q(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var C=f.text.match(/^\s*/)[0],P;if(!n&&!/\S/.test(f.text))P=0,i="not";else if(i=="smart"&&(P=r.mode.indent(s,f.text.slice(C.length),f.text),P==Qe||P>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?P=q(gt(r,t-1).text,null,l):P=0:i=="add"?P=p+e.options.indentUnit:i=="subtract"?P=p-e.options.indentUnit:typeof i=="number"&&(P=p+i),P=Math.max(0,P);var H="",pe=0;if(e.options.indentWithTabs)for(var le=Math.floor(P/l);le;--le)pe+=l,H+=" ";if(pe<P&&(H+=z(P-pe)),H!=C)return ir(r,H,_e(t,0),_e(t,C.length),"+input"),f.stateAfter=null,!0;for(var Te=0;Te<r.sel.ranges.length;Te++){var Ie=r.sel.ranges[Te];if(Ie.head.line==t&&Ie.head.ch<C.length){var ze=_e(t,C.length);Bo(r,Te,new Kt(ze,ze));break}}}var ui=null;function so(e){ui=e}function Ko(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=Lt(t),C=null;if(f&&n.ranges.length>1)if(ui&&ui.text.join(`
|
|
`)==t){if(n.ranges.length%ui.text.length==0){C=[];for(var P=0;P<ui.text.length;P++)C.push(s.splitLines(ui.text[P]))}}else p.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(C=nt(p,function(Ke){return[Ke]}));for(var H=e.curOp.updateInput,pe=n.ranges.length-1;pe>=0;pe--){var le=n.ranges[pe],Te=le.from(),Ie=le.to();le.empty()&&(i&&i>0?Te=_e(Te.line,Te.ch-i):e.state.overwrite&&!f?Ie=_e(Ie.line,Math.min(gt(s,Ie.line).text.length,Ie.ch+We(p).length)):f&&ui&&ui.lineWise&&ui.text.join(`
|
|
`)==p.join(`
|
|
`)&&(Te=Ie=_e(Te.line,0)));var ze={from:Te,to:Ie,text:C?C[pe%C.length]:p,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};nr(e.doc,ze),En(e,"inputRead",e,ze)}t&&!f&&Ls(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=H),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&zn(t,function(){return Ko(t,i,0,null,"paste")}),!0}function Ls(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=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(gt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&En(e,"electricInput",e,r.head.line)}}function Ts(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:_e(r,0),head:_e(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function _s(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function As(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return D?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),_s(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)&&yn(this,t[n])(this,r,l),Ce(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"](ro(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:An(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");it(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Nn(this)}),removeOverlay:An(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++,Nn(this);return}}}),indentLine:An(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Vn(this.doc,n)&&Br(this,n,r,s)}),indentSelection:An(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&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&Qi(this));else{var p=f.from(),C=f.to(),P=Math.max(s,p.line);s=Math.min(this.lastLine(),C.line-(C.ch?0:1))+1;for(var H=P;H<s;++H)Br(this,H,n);var pe=this.doc.sel.ranges;p.ch==0&&r.length==pe.length&&pe[l].from().ch>0&&Bo(this.doc,l,new Kt(p,pe[l].to()),je)}}}),getTokenAt:function(n,r){return en(this,n,r)},getLineTokens:function(n,r){return en(this,_e(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ae(this,gt(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,p;if(f==0)p=r[2];else for(;;){var C=s+l>>1;if((C?r[C*2-1]:0)>=f)l=C;else if(r[C*2+1]<f)s=C+1;else{p=r[C*2+2];break}}var P=p?p.indexOf("overlay "):-1;return P<0?p:P==0?null:p.slice(0,P-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 C=l[f[r][p]];C&&s.push(C)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var P=0;P<l._global.length;P++){var H=l._global[P];H.pred(f,this)&&Se(s,H.val)==-1&&s.push(H.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),Ge(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(),si(this,s,r||"page")},charCoords:function(n,r){return vo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=ca(this,n,r||"page"),bo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=ca(this,{top:n,left:0},r||"page").top,_n(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=gt(this.doc,n)}else f=n;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-ai(f):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return Ji(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=si(this,o(this.doc,n));var C=n.bottom,P=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),p.sizer.appendChild(r),l=="over")C=n.top;else if(l=="above"||l=="near"){var H=Math.max(p.wrapper.clientHeight,this.doc.height),pe=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>H)&&n.top>r.offsetHeight?C=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=H&&(C=n.bottom),P+r.offsetWidth>pe&&(P=pe-r.offsetWidth)}r.style.top=C+"px",r.style.left=r.style.right="",f=="right"?(P=p.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?P=0:f=="middle"&&(P=(p.sizer.clientWidth-r.offsetWidth)/2),r.style.left=P+"px"),s&&Js(this,{left:P,top:C,right:P+r.offsetWidth,bottom:C+r.offsetHeight})},triggerOnKeyDown:An(gs),triggerOnKeyPress:An(ys),triggerOnKeyUp:vs,triggerOnMouseDown:An(bs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:An(function(n){Ls(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var p=o(this.doc,n),C=0;C<r&&!(p=Xo(this.doc,p,f,s,l),p.hitSide);++C);return p},moveH:An(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Xo(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},Oe)}),deleteH:An(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ar(this,function(f){var p=Xo(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 C=o(this.doc,n),P=0;P<r;++P){var H=si(this,C,"div");if(p==null?p=H.left:H.left=p,C=Ms(this,H,f,s),C.hitSide)break}return C},moveV:An(function(n,r){var s=this,l=this.doc,f=[],p=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(P){if(p)return n<0?P.from():P.to();var H=si(s,P.head,"div");P.goalColumn!=null&&(H.left=P.goalColumn),f.push(H.left);var pe=Ms(s,H,n,r);return r=="page"&&P==l.sel.primary()&&To(s,vo(s,pe,"div").top-H.top),pe},Oe),f.length)for(var C=0;C<l.sel.ranges.length;C++)l.sel.ranges[C].goalColumn=f[C]}),findWordAt:function(n){var r=this.doc,s=gt(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 C=s.charAt(l),P=we(C,p)?function(H){return we(H,p)}:/\s/.test(C)?function(H){return/\s/.test(H)}:function(H){return!/\s/.test(H)&&!we(H)};l>0&&P(s.charAt(l-1));)--l;for(;f<s.length&&P(s.charAt(f));)++f}return new Kt(_e(n.line,l),_e(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?ce(this.display.cursorDiv,"CodeMirror-overwrite"):xe(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==J()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:An(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-di(this)-this.display.barHeight,width:n.scrollWidth-di(this)-this.display.barWidth,clientHeight:po(this),clientWidth:Ri(this)}},scrollIntoView:An(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:_e(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?Zs(this,n):wa(this,n.from,n.to,n.margin)}),setSize:An(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&&la(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(p){if(p.widgets){for(var C=0;C<p.widgets.length;C++)if(p.widgets[C].noHScroll){wi(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)}),operation:function(n){return zn(this,n)},startOperation:function(){return Fi(this)},endOperation:function(){return Ui(this)},refresh:An(function(){var n=this.display.cachedTextHeight;Nn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Mo(this.display),(n==null||Math.abs(n-$i(this.display))>.5||this.options.lineWrapping)&&Eo(this),Ce(this,"refresh",this)}),swapDoc:An(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,En(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}},V(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 Xo(e,t,i,n,r){var s=t,l=i,f=gt(e,t.line),p=r&&e.direction=="rtl"?-i:i;function C(){var ot=t.line+p;return ot<e.first||ot>=e.first+e.size?!1:(t=new _e(ot,t.ch,t.sticky),f=gt(e,ot))}function P(ot){var Xe;if(n=="codepoint"){var ht=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ht)?Xe=null:Xe=new _e(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ht>=55296&&ht<56320?2:1))),-i)}else r?Xe=Pl(e.cm,f,t,i):Xe=Uo(f,t,i);if(Xe==null)if(!ot&&C())t=Wo(r,e.cm,f,t.line,p);else return!1;else t=Xe;return!0}if(n=="char"||n=="codepoint")P();else if(n=="column")P(!0);else if(n=="word"||n=="group")for(var H=null,pe=n=="group",le=e.cm&&e.cm.getHelper(t,"wordChars"),Te=!0;!(i<0&&!P(!Te));Te=!1){var Ie=f.text.charAt(t.ch)||`
|
|
`,ze=we(Ie,le)?"w":pe&&Ie==`
|
|
`?"n":!pe||/\s/.test(Ie)?null:"p";if(pe&&!Te&&!ze&&(ze="s"),H&&H!=ze){i<0&&(i=1,P(),t.sticky="after");break}if(ze&&(H=ze),i>0&&!P(!Te))break}var Ke=to(e,t,s,l,!0);return Rt(s,Ke)&&(Ke.hitSide=!0),Ke}function Ms(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*$i(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 C;!(C=bo(e,s,l),!C.outside);){if(i<0?l<=0:l>=r.height){C.hitSide=!0;break}l+=i*5}return C}var Qt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;_s(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}be(r,"paste",function(f){if(!s(f)||Le(n,f)||ks(f,n))return;Y<=11&&setTimeout(yn(n,function(){return t.updateFromDOM()}),20)}),be(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),be(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),be(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),be(r,"touchstart",function(){return i.forceCompositionEnd()}),be(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Le(n,f))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var p=Ts(n);so({lineWise:!0,text:p.text}),f.type=="cut"&&n.operation(function(){n.setSelections(p.ranges,0,je),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var C=ui.text.join(`
|
|
`);if(f.clipboardData.setData("Text",C),f.clipboardData.getData("Text")==C){f.preventDefault();return}}var P=As(),H=P.firstChild;n.display.lineSpace.insertBefore(P,n.display.lineSpace.firstChild),H.value=ui.text.join(`
|
|
`);var pe=document.activeElement;ye(H),setTimeout(function(){n.display.lineSpace.removeChild(P),pe.focus(),pe==r&&i.showPrimarySelection()},50)}be(r,"copy",l),be(r,"cut",l)},Qt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Qt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qt.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=lo(t,e.anchorNode,e.anchorOffset),l=lo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&rt(qt(s,l),n)==0&&rt(Xt(s,l),r)==0)return;var f=t.display.view,p=n.line>=t.display.viewFrom&&Os(t,n)||{node:f[0].measure.map[2],offset:0},C=r.line<t.display.viewTo&&Os(t,r);if(!C){var P=f[f.length-1].measure,H=P.maps?P.maps[P.maps.length-1]:P.map;C={node:H[H.length-1],offset:H[H.length-2]-H[H.length-3]}}if(!p||!C){e.removeAllRanges();return}var pe=e.rangeCount&&e.getRangeAt(0),le;try{le=Z(p.node,p.offset,C.offset,C.node)}catch(Te){}le&&(!Q&&t.state.focused?(e.collapse(p.node,p.offset),le.collapsed||(e.removeAllRanges(),e.addRange(le))):(e.removeAllRanges(),e.addRange(le)),pe&&e.anchorNode==null?e.addRange(pe):Q&&this.startGracePeriod()),this.rememberSelection()},Qt.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)},Qt.prototype.showMultipleSelections=function(e){re(this.cm.display.cursorDiv,e.cursors),re(this.cm.display.selectionDiv,e.selection)},Qt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},Qt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qt.prototype.blur=function(){this.div.blur()},Qt.prototype.getField=function(){return this.div},Qt.prototype.supportsTouch=function(){return!0},Qt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():zn(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)},Qt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(m&&y&&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=lo(t,e.anchorNode,e.anchorOffset),n=lo(t,e.focusNode,e.focusOffset);i&&n&&zn(t,function(){Ln(t.doc,Si(i,n),je),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Qt.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=_e(n.line-1,gt(e.doc,n.line-1).length)),r.ch==gt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=_e(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ii(e,n.line))==0?(l=Ot(t.view[0].line),f=t.view[0].node):(l=Ot(t.view[s].line),f=t.view[s-1].node.nextSibling);var p=Ii(e,r.line),C,P;if(p==t.view.length-1?(C=t.viewTo-1,P=t.lineDiv.lastChild):(C=Ot(t.view[p+1].line)-1,P=t.view[p+1].node.previousSibling),!f)return!1;for(var H=e.doc.splitLines(tu(e,f,P,l,C)),pe=On(e.doc,_e(l,0),_e(C,gt(e.doc,C).text.length));H.length>1&&pe.length>1;)if(We(H)==We(pe))H.pop(),pe.pop(),C--;else if(H[0]==pe[0])H.shift(),pe.shift(),l++;else break;for(var le=0,Te=0,Ie=H[0],ze=pe[0],Ke=Math.min(Ie.length,ze.length);le<Ke&&Ie.charCodeAt(le)==ze.charCodeAt(le);)++le;for(var ot=We(H),Xe=We(pe),ht=Math.min(ot.length-(H.length==1?le:0),Xe.length-(pe.length==1?le:0));Te<ht&&ot.charCodeAt(ot.length-Te-1)==Xe.charCodeAt(Xe.length-Te-1);)++Te;if(H.length==1&&pe.length==1&&l==n.line)for(;le&&le>n.ch&&ot.charCodeAt(ot.length-Te-1)==Xe.charCodeAt(Xe.length-Te-1);)le--,Te++;H[H.length-1]=ot.slice(0,ot.length-Te).replace(/^\u200b+/,""),H[0]=H[0].slice(le).replace(/\u200b+$/,"");var St=_e(l,le),Ct=_e(C,pe.length?We(pe).length-Te:0);if(H.length>1||H[0]||rt(St,Ct))return ir(e.doc,H,St,Ct,"+input"),!0},Qt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qt.prototype.reset=function(){this.forceCompositionEnd()},Qt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Qt.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)},Qt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&zn(this.cm,function(){return Nn(e.cm)})},Qt.prototype.setUneditable=function(e){e.contentEditable="false"},Qt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||yn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Qt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qt.prototype.onContextMenu=function(){},Qt.prototype.resetPosition=function(){},Qt.prototype.needsContentAttribute=!0;function Os(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=gt(e.doc,t.line),r=ia(i,n,t.line),s=mt(n,e.doc.direction),l="left";if(s){var f=Ve(s,t.ch);l=f%2?"right":"left"}var p=aa(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 lr(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 C(le){return function(Te){return Te.id==le}}function P(){l&&(s+=f,p&&(s+=f),l=p=!1)}function H(le){le&&(P(),s+=le)}function pe(le){if(le.nodeType==1){var Te=le.getAttribute("cm-text");if(Te){H(Te);return}var Ie=le.getAttribute("cm-marker"),ze;if(Ie){var Ke=e.findMarks(_e(n,0),_e(r+1,0),C(+Ie));Ke.length&&(ze=Ke[0].find(0))&&H(On(e.doc,ze.from,ze.to).join(f));return}if(le.getAttribute("contenteditable")=="false")return;var ot=/^(pre|div|p|li|table|br)$/i.test(le.nodeName);if(!/^br$/i.test(le.nodeName)&&le.textContent.length==0)return;ot&&P();for(var Xe=0;Xe<le.childNodes.length;Xe++)pe(le.childNodes[Xe]);/^(pre|p)$/i.test(le.nodeName)&&(p=!0),ot&&(l=!0)}else le.nodeType==3&&H(le.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(pe(t),t==i);)t=t.nextSibling,p=!1;return s}function lo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return lr(e.clipPos(_e(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 lr(_e(Ot(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?We(e.rest):e.line;return lr(_e(Ot(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,C=p.maps;function P(ze,Ke,ot){for(var Xe=-1;Xe<(C?C.length:0);Xe++)for(var ht=Xe<0?p.map:C[Xe],St=0;St<ht.length;St+=3){var Ct=ht[St+2];if(Ct==ze||Ct==Ke){var Dt=Ot(Xe<0?e.line:e.rest[Xe]),tn=ht[St]+ot;return(ot<0||Ct!=ze)&&(tn=ht[St+(ot?1:0)]),_e(Dt,tn)}}}var H=P(l,f,i);if(H)return lr(H,r);for(var pe=f.nextSibling,le=l?l.nodeValue.length-i:0;pe;pe=pe.nextSibling){if(H=P(pe,pe.firstChild,0),H)return lr(_e(H.line,H.ch-le),r);le+=pe.textContent.length}for(var Te=f.previousSibling,Ie=i;Te;Te=Te.previousSibling){if(H=P(Te,Te.firstChild,-1),H)return lr(_e(H.line,H.ch+Ie),r);Ie+=Te.textContent.length}}var hn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ee,this.hasSelection=!1,this.composing=null};hn.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),M&&(r.style.width="0px"),be(r,"input",function(){B&&Y>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),be(r,"paste",function(l){if(Le(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Le(n,l))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Ts(n);so({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,je):(i.prevInput="",r.value=f.text.join(`
|
|
`),ye(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}be(r,"cut",s),be(r,"copy",s),be(e.scroller,"paste",function(l){if(gi(e,l)||Le(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)}),be(e.lineSpace,"selectstart",function(l){gi(e,l)||E(l)}),be(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"})}}),be(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},hn.prototype.createField=function(e){this.wrapper=As(),this.textarea=this.wrapper.firstChild},hn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},hn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=va(e);if(e.options.moveInputWithCursor){var r=si(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},hn.prototype.showSelection=function(e){var t=this.cm,i=t.display;re(i.cursorDiv,e.cursors),re(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},hn.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&&ye(this.textarea),B&&Y>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",B&&Y>=9&&(this.hasSelection=null))},hn.prototype.getField=function(){return this.textarea},hn.prototype.supportsTouch=function(){return!1},hn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!v||J()!=this.textarea))try{this.textarea.focus()}catch(e){}},hn.prototype.blur=function(){this.textarea.blur()},hn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},hn.prototype.receivedFocus=function(){this.slowPoll()},hn.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()})},hn.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)},hn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||pt(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(B&&Y>=9&&this.hasSelection===r||T&&/[\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 zn(t,function(){Ko(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},hn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},hn.prototype.onKeyPress=function(){B&&Y>=9&&(this.hasSelection=null),this.fastPoll()},hn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Ni(i,e),l=n.scroller.scrollTop;if(!s||x)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&yn(i,Ln)(i.doc,Si(s),je);var p=r.style.cssText,C=t.wrapper.style.cssText,P=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-P.top-5)+"px; left: "+(e.clientX-P.left-5)+`px;
|
|
z-index: 1000; background: `+(B?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var H;D&&(H=window.scrollY),n.input.focus(),D&&window.scrollTo(null,H),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=le,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function pe(){if(r.selectionStart!=null){var Ie=i.somethingSelected(),ze="\u200B"+(Ie?r.value:"");r.value="\u21DA",r.value=ze,t.prevInput=Ie?"":"\u200B",r.selectionStart=1,r.selectionEnd=ze.length,n.selForContextMenu=i.doc.sel}}function le(){if(t.contextMenuPending!=le)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=C,r.style.cssText=p,B&&Y<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!B||B&&Y<9)&&pe();var Ie=0,ze=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?yn(i,$a)(i):Ie++<10?n.detectingSelectAll=setTimeout(ze,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ze,200)}}if(B&&Y>=9&&pe(),ke){W(e);var Te=function(){at(window,"mouseup",Te),setTimeout(le,20)};be(window,"mouseup",Te)}else setTimeout(le,50)},hn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},hn.prototype.setUneditable=function(){},hn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?b(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=J();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(be(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&&(at(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=on(function(p){return e.parentNode.insertBefore(p,e.nextSibling)},t);return f}function ru(e){e.off=at,e.on=be,e.wheelEventPixels=cl,e.Doc=In,e.splitLines=Lt,e.countColumn=q,e.findColumn=Pe,e.isWordChar=de,e.Pass=Qe,e.signal=Ce,e.Line=Di,e.changeEnd=ki,e.scrollbarModel=ka,e.Pos=_e,e.cmpPos=rt,e.modes=Ht,e.mimeModes=Mt,e.resolveMode=bt,e.getMode=wt,e.modeExtensions=et,e.extendMode=xt,e.copyState=Zt,e.startState=nn,e.innerMode=rn,e.commands=Pr,e.keyMap=vi,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=Rl,e.StringStream=At,e.SharedTextMarker=Or,e.TextMarker=Ti,e.LineWidget=Mr,e.e_preventDefault=E,e.e_stopPropagation=k,e.e_stop=W,e.addClass=ce,e.contains=N,e.rmClass=xe,e.keyNames=_i}$l(on),ql(on);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in In.prototype)In.prototype.hasOwnProperty(uo)&&Se(ou,uo)<0&&(on.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(In.prototype[uo]));return V(In),on.inputStyles={textarea:hn,contenteditable:Qt},on.defineMode=function(e){!on.defaults.mode&&e!="null"&&(on.defaults.mode=e),Un.apply(this,arguments)},on.defineMIME=Qn,on.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),on.defineMIME("text/plain","null"),on.defineExtension=function(e,t){on.prototype[e]=t},on.defineDocExtension=function(e,t){In.prototype[e]=t},on.fromTextArea=iu,ru(on),on.version="5.58.2",on})},Y1PL:function(ct,ie,g){"use strict";g.r(ie),g.d(ie,"ResizableTextArea",function(){return Se});var K=g("wx14"),ge=g("1OyB"),Q=g("vuIU"),fe=g("Ji7U"),he=g("LK+K"),ee=g("q1tI"),B=g("VTBJ"),Y=g("rePB"),D=g("Zm9Q"),I=g("Kwbf"),y=g("c+Xe"),x=g("m+aA"),L=g("bdgK"),w=new Map;function S(je){je.forEach(function(Ue){var Oe,Pe=Ue.target;(Oe=w.get(Pe))===null||Oe===void 0||Oe.forEach(function(ae){return ae(Pe)})})}var M=new L.default(S),m=null,v=null;function T(je,Ue){w.has(je)||(w.set(je,new Set),M.observe(je)),w.get(je).add(Ue)}function O(je,Ue){w.has(je)&&(w.get(je).delete(Ue),w.get(je).size||(M.unobserve(je),w.delete(je)))}var se=function(je){Object(fe.a)(Oe,je);var Ue=Object(he.a)(Oe);function Oe(){return Object(ge.a)(this,Oe),Ue.apply(this,arguments)}return Object(Q.a)(Oe,[{key:"render",value:function(){return this.props.children}}]),Oe}(ee.Component),te=ee.createContext(null);function ue(je){var Ue=je.children,Oe=je.onBatchResize,Pe=ee.useRef(0),ae=ee.useRef([]),z=ee.useContext(te),We=ee.useCallback(function(nt,it,Ye){Pe.current+=1;var F=Pe.current;ae.current.push({size:nt,element:it,data:Ye}),Promise.resolve().then(function(){F===Pe.current&&(Oe==null||Oe(ae.current),ae.current=[])}),z==null||z(nt,it,Ye)},[Oe,z]);return ee.createElement(te.Provider,{value:We},Ue)}function ke(je){var Ue=je.children,Oe=je.disabled,Pe=ee.useRef(null),ae=ee.useRef(null),z=ee.useContext(te),We=ee.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),nt=ee.isValidElement(Ue)&&Object(y.c)(Ue),it=nt?Ue.ref:null,Ye=ee.useMemo(function(){return Object(y.a)(it,Pe)},[it,Pe]),F=ee.useRef(je);F.current=je;var U=ee.useCallback(function(de){var we=F.current,Me=we.onResize,De=we.data,Be=de.getBoundingClientRect(),He=Be.width,dt=Be.height,Ze=de.offsetWidth,Je=de.offsetHeight,Ve=Math.floor(He),yt=Math.floor(dt);if(We.current.width!==Ve||We.current.height!==yt||We.current.offsetWidth!==Ze||We.current.offsetHeight!==Je){var mt={width:Ve,height:yt,offsetWidth:Ze,offsetHeight:Je};We.current=mt;var lt=Ze===Math.round(He)?He:Ze,be=Je===Math.round(dt)?dt:Je,$e=Object(B.a)(Object(B.a)({},mt),{},{offsetWidth:lt,offsetHeight:be});z==null||z($e,de,De),Me&&Promise.resolve().then(function(){Me($e,de)})}},[]);return ee.useEffect(function(){var de=Object(x.a)(Pe.current)||Object(x.a)(ae.current);return de&&!Oe&&T(de,U),function(){return O(de,U)}},[Pe.current,Oe]),ee.createElement(se,{ref:ae},nt?ee.cloneElement(Ue,{ref:Ye}):Ue)}var ne="rc-observer-key";function xe(je){var Ue=je.children,Oe=Object(D.a)(Ue);return Oe.map(function(Pe,ae){var z=(Pe==null?void 0:Pe.key)||"".concat(ne,"-").concat(ae);return ee.createElement(ke,Object(K.a)({},je,{key:z}),Pe)})}xe.Collection=ue;var Fe=xe,re=g("bT9E"),A=g("TSYQ"),me=g.n(A),Z=`
|
|
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"],J={},ce;function $(je){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=je.getAttribute("id")||je.getAttribute("data-reactid")||je.getAttribute("name");if(Ue&&J[Oe])return J[Oe];var Pe=window.getComputedStyle(je),ae=Pe.getPropertyValue("box-sizing")||Pe.getPropertyValue("-moz-box-sizing")||Pe.getPropertyValue("-webkit-box-sizing"),z=parseFloat(Pe.getPropertyValue("padding-bottom"))+parseFloat(Pe.getPropertyValue("padding-top")),We=parseFloat(Pe.getPropertyValue("border-bottom-width"))+parseFloat(Pe.getPropertyValue("border-top-width")),nt=N.map(function(Ye){return"".concat(Ye,":").concat(Pe.getPropertyValue(Ye))}).join(";"),it={sizingStyle:nt,paddingSize:z,borderSize:We,boxSizing:ae};return Ue&&Oe&&(J[Oe]=it),it}function ye(je){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ce||(ce=document.createElement("textarea"),ce.setAttribute("tab-index","-1"),ce.setAttribute("aria-hidden","true"),document.body.appendChild(ce)),je.getAttribute("wrap")?ce.setAttribute("wrap",je.getAttribute("wrap")):ce.removeAttribute("wrap");var ae=$(je,Ue),z=ae.paddingSize,We=ae.borderSize,nt=ae.boxSizing,it=ae.sizingStyle;ce.setAttribute("style","".concat(it,";").concat(Z)),ce.value=je.value||je.placeholder||"";var Ye=Number.MIN_SAFE_INTEGER,F=Number.MAX_SAFE_INTEGER,U=ce.scrollHeight,de;if(nt==="border-box"?U+=We:nt==="content-box"&&(U-=z),Oe!==null||Pe!==null){ce.value=" ";var we=ce.scrollHeight-z;Oe!==null&&(Ye=we*Oe,nt==="border-box"&&(Ye=Ye+z+We),U=Math.max(Ye,U)),Pe!==null&&(F=we*Pe,nt==="border-box"&&(F=F+z+We),de=U>F?"":"hidden",U=Math.min(F,U))}return{height:U,minHeight:Ye,maxHeight:F,overflowY:de,resize:"none"}}var _=g("Gytx"),b=g.n(_),q;(function(je){je[je.NONE=0]="NONE",je[je.RESIZING=1]="RESIZING",je[je.RESIZED=2]="RESIZED"})(q||(q={}));var Ee=function(je){Object(fe.a)(Oe,je);var Ue=Object(he.a)(Oe);function Oe(Pe){var ae;return Object(ge.a)(this,Oe),ae=Ue.call(this,Pe),ae.nextFrameActionId=void 0,ae.resizeFrameId=void 0,ae.textArea=void 0,ae.saveTextArea=function(z){ae.textArea=z},ae.handleResize=function(z){var We=ae.state.resizeStatus,nt=ae.props,it=nt.autoSize,Ye=nt.onResize;if(We!==q.NONE)return;typeof Ye=="function"&&Ye(z),it&&ae.resizeOnNextFrame()},ae.resizeOnNextFrame=function(){cancelAnimationFrame(ae.nextFrameActionId),ae.nextFrameActionId=requestAnimationFrame(ae.resizeTextarea)},ae.resizeTextarea=function(){var z=ae.props.autoSize;if(!z||!ae.textArea)return;var We=z.minRows,nt=z.maxRows,it=ye(ae.textArea,!1,We,nt);ae.setState({textareaStyles:it,resizeStatus:q.RESIZING},function(){cancelAnimationFrame(ae.resizeFrameId),ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:q.RESIZED},function(){ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:q.NONE}),ae.fixFirefoxAutoScroll()})})})})},ae.renderTextArea=function(){var z=ae.props,We=z.prefixCls,nt=We===void 0?"rc-textarea":We,it=z.autoSize,Ye=z.onResize,F=z.className,U=z.disabled,de=ae.state,we=de.textareaStyles,Me=de.resizeStatus,De=Object(re.a)(ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Be=me()(nt,F,Object(Y.a)({},"".concat(nt,"-disabled"),U));"value"in De&&(De.value=De.value||"");var He=Object(B.a)(Object(B.a)(Object(B.a)({},ae.props.style),we),Me===q.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return ee.createElement(Fe,{onResize:ae.handleResize,disabled:!(it||Ye)},ee.createElement("textarea",Object(K.a)({},De,{className:Be,style:He,ref:ae.saveTextArea})))},ae.state={textareaStyles:{},resizeStatus:q.NONE},ae}return Object(Q.a)(Oe,[{key:"componentDidUpdate",value:function(ae){(ae.value!==this.props.value||!b()(ae.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 ae=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(ae,z)}}catch(We){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Oe}(ee.Component),Se=Ee,tt=function(je){Object(fe.a)(Oe,je);var Ue=Object(he.a)(Oe);function Oe(Pe){var ae;Object(ge.a)(this,Oe),ae=Ue.call(this,Pe),ae.resizableTextArea=void 0,ae.focus=function(){ae.resizableTextArea.textArea.focus()},ae.saveTextArea=function(We){ae.resizableTextArea=We},ae.handleChange=function(We){var nt=ae.props.onChange;ae.setValue(We.target.value,function(){ae.resizableTextArea.resizeTextarea()}),nt&&nt(We)},ae.handleKeyDown=function(We){var nt=ae.props,it=nt.onPressEnter,Ye=nt.onKeyDown;We.keyCode===13&&it&&it(We),Ye&&Ye(We)};var z=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return ae.state={value:z},ae}return Object(Q.a)(Oe,[{key:"setValue",value:function(ae,z){"value"in this.props||this.setState({value:ae},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return ee.createElement(Se,Object(K.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ae){return"value"in ae?{value:ae.value}:null}}]),Oe}(ee.Component),Qe=ie.default=tt},ZW9T:function(ct,ie,g){"use strict";g.d(ie,"a",function(){return Fe});var K=g("k1fw"),ge=g("oBTY"),Q=g("9og8"),fe=g("miYZ"),he=g("tsqr"),ee=g("rAM+"),B=g("tJVT"),Y=g("PpiC"),D=g("WmNS"),I=g.n(D),y=g("q1tI"),x=g.n(y),L=g("bdgK");function w(re,A,me,Z,N){var J=A.getWordUntilPosition(me),ce={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},$=Z.map(function(ye){return{label:ye,kind:re.languages.CompletionItemKind.Keyword,insertText:ye,insertTextRules:re.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return N.map(function(ye){$.push(Object(K.a)(Object(K.a)({},ye),{},{range:ce}))}),$}var S=function(re){var A={label:"ifelse",kind:re.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:re.languages.CompletionItemInsertTextRule.InsertAsSnippet},me=["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"];re.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ce,$){var ye=w(re,ce,$,me,[A]);return{suggestions:ye}}});var Z=["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"];re.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ce,$){var ye=[{label:"print",kind:re.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:re.languages.CompletionItemInsertTextRule.InsertAsSnippet}],_=w(re,ce,$,Z,ye);return{suggestions:_}}});var N=["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"];re.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ce,$){var ye=[A,{label:"main",kind:re.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:re.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:re.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:re.languages.CompletionItemInsertTextRule.InsertAsSnippet}],_=w(re,ce,$,N,ye);return{suggestions:_}}})},M="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",m=g("fjLI"),v=g("LvDl"),T=g("+ua5");function O(re){return/^\d+$/.test(re)?"".concat(re,"px"):re}function se(){}var te=!1,ue={"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",Scala:"scale"};function ke(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=re;if(Array.isArray(re)){for(var me=0;me<re.length;me++){var Z=ue[re[me]];if(Z)return Z}return A[0]}return ue[A]||A}var ne=null,xe=ie.b=function(re){var A=re.width,me=A===void 0?"100%":A,Z=re.height,N=Z===void 0?"100%":Z,J=re.value,ce=re.language,$=ce===void 0?"javascript":ce,ye=re.style,_=ye===void 0?{}:ye,b=re.options,q=b===void 0?{}:b,Ee=re.overrideServices,Se=Ee===void 0?{}:Ee,tt=re.theme,Qe=tt===void 0?"vs-dark":tt,je=re.onEditBlur,Ue=re.onSave,Oe=re.autoHeight,Pe=Oe===void 0?!1:Oe,ae=re.forbidCopy,z=ae===void 0?!1:ae,We=re.onChange,nt=We===void 0?se:We,it=re.editorDidMount,Ye=it===void 0?se:it,F=re.onFocus,U=F===void 0?se:F,de=re.onBreakPoint,we=de===void 0?se:de,Me=re.breakPointValue,De=Me===void 0?[]:Me,Be=re.filename,He=Be===void 0?"educoder.txt":Be,dt=re.errorLine,Ze=re.errorContent,Je=Ze===void 0?"":Ze,Ve=re.highlightLine,yt=re.openBreakPoint,mt=yt===void 0?!1:yt,lt=Object(Y.a)(re,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),be=Object(y.useRef)(),$e=Object(y.useRef)({}),at=Object(y.useRef)(),Ce=Object(y.useRef)(),Le=Object(y.useRef)([]),X=Object(y.useRef)(!1),j=Object(y.useRef)(),V=Object(y.useState)(!1),E=Object(B.a)(V,2),k=E[0],R=E[1];function W(){var wt;return be.current&&(wt=new L.default(function(et){var xt=Object(ee.a)(et),Zt;try{for(xt.s();!(Zt=xt.n()).done;){var rn=Zt.value;(rn.target.offsetHeight>0||rn.target.offsetWidth>0)&&$e.current.instance.layout()}}catch(nn){xt.e(nn)}finally{xt.f()}}),wt.observe(be.current)),wt}function ve(){he.b.warn({content:decodeURIComponent(M),key:"monaco-editor-tip"})}var oe=function(){var et=$e.current.instance;if(J!=null&&et&&k){var xt=et.getModel();xt&&J!==xt.getValue()&&(te=!0,xt.setValue(J),et.layout(),te=!1)}};Object(y.useEffect)(function(){try{var wt,et=$e.current.instance;Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(function(){oe()},500),et==null||((wt=et.updateOptions)===null||wt===void 0)||wt.call(et,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(J.split(/\r\n|\r|\n/g).length))+3,5)})}catch(xt){debugger}},[J,k,$e.current]),Object(y.useEffect)(function(){try{if(dt&&$e.current&&$e.current.instance){var wt=$e.current.instance;wt.changeViewZones(function(xt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=Je,xt.addZone({afterLineNumber:dt||11,heightInLines:3,domNode:Zt})});var et={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};wt.addOverlayWidget(et),wt.revealPositionInCenter({lineNumber:20,column:1})}}catch(xt){debugger}},[dt,$e.current,k]),Object(y.useEffect)(function(){var wt;if((wt=$e.current)!==null&&wt!==void 0&&wt.instance&&k&&mt){var et=$e.current.instance,xt=et.getModel();if(!xt)return;var Zt=function(){var rt=[],Rt=[],Gt=xt.getAllDecorations(),Xt=Object(ee.a)(Gt),qt;try{for(Xt.s();!(qt=Xt.n()).done;){var h=qt.value;if(h.options.className==="highlighted-line"){var o;rt.push(h==null||((o=h.range)===null||o===void 0)?void 0:o.startLineNumber),Rt.push(h==null?void 0:h.id)}}}catch(u){Xt.e(u)}finally{Xt.f()}xt.deltaDecorations(Rt,[]);var a=xt.getLineCount();!!Ve&&Ve<=a&&(et.deltaDecorations([],[{range:new ne.Range(Ve,1,Ve,xt.getLineMaxColumn(Ve)),options:{isWholeLine:!0,className:"highlighted-line"}}]),et.revealLineInCenter(Ve))};Zt();var rn=function(){var rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Rt=[],Gt=[],Xt=xt.getAllDecorations(),qt=Object(ee.a)(Xt),h;try{for(qt.s();!(h=qt.n()).done;){var o=h.value;if(o.options.linesDecorationsClassName==="breakpoints"){var a;Rt.push(o==null||((a=o.range)===null||a===void 0)?void 0:a.startLineNumber),Gt.push(o==null?void 0:o.id)}}}catch(u){qt.e(u)}finally{qt.f()}if(rt)return{lines:Rt,ids:Gt};we(Rt)},nn=function(){var _e=Object(Q.a)(I.a.mark(function rt(Rt){var Gt;return I.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return Gt={range:new ne.Range(Rt,1,Rt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},qt.next=3,xt.deltaDecorations([],[Gt]);case 3:rn();case 4:case"end":return qt.stop()}},rt)}));return function(Rt){return _e.apply(this,arguments)}}(),At=function(){var _e=Object(Q.a)(I.a.mark(function rt(Rt){var Gt,Xt,qt,h,o;return I.a.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:Gt=[],Xt=et.getLineDecorations(Rt),qt=Object(ee.a)(Xt);try{for(qt.s();!(h=qt.n()).done;)o=h.value,o.options.linesDecorationsClassName==="breakpoints"&&Gt.push(o.id)}catch(d){qt.e(d)}finally{qt.f()}return u.next=6,xt.deltaDecorations(Gt,[]);case 6:rn();case 7:case"end":return u.stop()}},rt)}));return function(Rt){return _e.apply(this,arguments)}}(),gt=function(rt){var Rt=et.getLineDecorations(rt),Gt=Object(ee.a)(Rt),Xt;try{for(Gt.s();!(Xt=Gt.n()).done;){var qt=Xt.value;if(qt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(h){Gt.e(h)}finally{Gt.f()}return!1};if(!Object(v.isEqual)(De,rn(!0).lines)){xt.deltaDecorations(rn(!0).ids,[]);var On=De.map(function(_e){return{range:new ne.Range(_e,1,_e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});xt.deltaDecorations([],On)}var ni=et.onDidChangeModelContent(function(_e){var rt=et.getPosition();if(rt){var Rt=rt.lineNumber;xt.getLineContent(Rt).trim()===""?At(Rt):gt(Rt)&&(At(Rt),nn(Rt))}}),kn=et.onMouseDown(function(_e){var rt,Rt,Gt;if(_e.target.detail&&(rt=_e.target)!==null&&rt!==void 0&&(Rt=rt.element)!==null&&Rt!==void 0&&(Gt=Rt.className)!==null&&Gt!==void 0&&Gt.includes("line-numbers")){var Xt=_e.target.position.lineNumber;if(xt.getLineContent(Xt).trim()==="")return;gt(Xt)?At(Xt):nn(Xt)}}),Ot=function(rt){var Rt={range:new ne.Range(rt,1,rt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Le.current=et.deltaDecorations(Le.current,[Rt])},_n=function(){Le.current=et.deltaDecorations(Le.current,[])},Vn=et.onMouseMove(function(_e){var rt,Rt,Gt;if(_n(),_e.target.detail&&(rt=_e.target)!==null&&rt!==void 0&&(Rt=rt.element)!==null&&Rt!==void 0&&(Gt=Rt.className)!==null&&Gt!==void 0&&Gt.includes("line-numbers")){var Xt=_e.target.position.lineNumber;if(xt.getLineContent(Xt).trim()==="")return;Ot(Xt)}}),ii=et.onMouseLeave(function(){_n()});return function(){ni.dispose(),kn.dispose(),Vn.dispose(),ii.dispose()}}},[$e.current,k,De,Ve,mt]);function Ne(){var wt=$e.current.instance;if(wt){var et=wt.getSelection(),xt=$e.current.pastePos||{},Zt=new ne.Range(xt.startLineNumber||et.endLineNumber,xt.startColumn||et.endColumn,xt.endLineNumber||et.endLineNumber,xt.endColumn||et.endColumn);setTimeout(function(){wt.executeEdits("",[{range:Zt,text:""}])},300)}}function qe(wt){(window.navigator.platform.match("Mac")?wt.metaKey:wt.ctrlKey)&&wt.keyCode==83&&(wt.preventDefault(),Ue())}var ft=function(){if(Pe&&$e.current.instance){var et=$e.current.instance.getContentHeight();Qn(et<N?N:et)}else Qn(N)};function st(wt){var et=document.createEvent("MouseEvents");et.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),wt.dispatchEvent(et)}var _t=function(et){var xt=et.keyCode,Zt=et.ctrlKey,rn=et.metaKey,nn=et.target,At=et.type;return(At==="paste"||(xt===67||xt===86)&&(rn||Zt))&&nn.nodeName==="TEXTAREA"&&(ve(),et.preventDefault()),!1};function Lt(wt,et){var xt=window.URL||window.webkitURL||window,Zt=new Blob([et]),rn=document.createElementNS("http://www.w3.org/1999/xhtml","a");rn.href=xt.createObjectURL(Zt),rn.download=wt,st(rn)}Object(y.useEffect)(function(){ft()},[ft]),Object(y.useEffect)(function(){be.current&&!k&&g.e(27).then(g.t.bind(null,"M/lh",7)).then(function(wt){try{ne=wt,$e.current.instance=ne.editor.create(be.current,{value:J,language:ke($),theme:Qe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Se);var et=$e.current.instance,xt=m.c._menuItems,Zt=Object(ge.a)(xt).find(function(nn){return nn[0]._debugName=="EditorContext"});if(Ye(et,ne),setTimeout(function(){ft(),$e.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Lt(He||"educoder.txt",et.getValue())}}),et.getDomNode().addEventListener("input",function(){at.current.autoFormat&&et.getAction("editor.action.formatDocument").run()})},500),$e.current.subscription=et.onDidChangeModelContent(function(nn){debugger;X.current?clearTimeout(j.current):(ft(),nt(et.getValue(),nn)),j.current=setTimeout(function(){X.current=!1},500)}),window.Monaco||S(ne,ke($)),z&&(be.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",_t),window.removeEventListener("paste",_t),window.addEventListener("keydown",_t),window.addEventListener("paste",_t)),window.Monaco=ne,je&&et.onDidBlurEditorWidget(function(){je(et.getValue())}),U&&et.onDidFocusEditorText(function(){U(et.getValue())}),z)try{window.addEventListener("paste",Ne)}catch(nn){}var rn=W();return R(!0),function(){var nn=$e.current.instance;nn.dispose();var At=nn.getModel();At&&At.dispose(),$e.current.subscription&&$e.current.subscription.dispose(),z&&window.removeEventListener("paste",Ne),rn.unobserve(be.current)}}catch(nn){debugger}})},[]),Object(y.useEffect)(function(){var wt=$e.current.instance;if(wt&&k)return document.addEventListener("keydown",qe,!1),function(){document.removeEventListener("keydown",qe)}},[Ue,k]),Object(y.useEffect)(function(){var wt=$e.current.instance;if(wt&&k){var et=ke($);ne.editor.setModelLanguage(wt.getModel(),et)}},[$,k]),Object(y.useEffect)(function(){var wt=$e.current.instance;wt&&k&&ne.editor.setTheme(Qe)},[Qe,k]),Object(y.useEffect)(function(){var wt=$e.current.instance;at.current=q,wt&&k&&(wt.updateOptions(Object(K.a)({},q)),setTimeout(function(){wt.getModel().updateOptions(Object(K.a)({},q))},200))},[JSON.stringify(q),k]),Object(y.useEffect)(function(){var wt=$e.current.instance;wt&&k&&wt.layout()},[me,N,k]);var pt=Object(y.useState)(O(me)),$t=Object(B.a)(pt,2),jt=$t[0],Jt=$t[1],Ht=Object(y.useState)(O(N)),Mt=Object(B.a)(Ht,2),Un=Mt[0],Qn=Mt[1],bt=Object(K.a)(Object(K.a)({},_),{},{width:jt,height:Un});return x.a.createElement("div",{className:"my-monaco-editor",ref:be,style:bt})};function Fe(re){var A=re.width,me=A===void 0?"100%":A,Z=re.height,N=Z===void 0?"100%":Z,J=re.original,ce=re.modified,$=re.language,ye=re.options,_=ye===void 0?{}:ye,b=Object(y.useRef)(),q=Object(y.useState)(null),Ee=Object(B.a)(q,2),Se=Ee[0],tt=Ee[1];function Qe(Pe){var ae;return b.current&&(ae=new L.default(function(z){var We=Object(ee.a)(z),nt;try{for(We.s();!(nt=We.n()).done;){var it=nt.value;(it.target.offsetHeight>0||it.target.offsetWidth>0)&&Pe.layout()}}catch(Ye){We.e(Ye)}finally{We.f()}}),ae.observe(b.current)),ae}Object(y.useEffect)(function(){return b.current&&g.e(27).then(g.t.bind(null,"M/lh",7)).then(function(Pe){ne=Pe;var ae=ne.editor.createDiffEditor(b.current,Object(K.a)(Object(K.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},_),{},{wordWrap:!0}));tt(ae);var z=Qe(ae);return function(){ae.dispose();var We=ae.getModel();We&&We.dispose(),z.unobserve(b.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(y.useEffect)(function(){Se&&Se.setModel({original:ne.editor.createModel(J,$),modified:ne.editor.createModel(ce,$)})},[J,ce,$,Se]);var je=O(me),Ue=O(N),Oe={width:je,height:Ue};return x.a.createElement("div",{className:"my-diff-editor",ref:b,style:Oe})}},ZpRC:function(ct,ie,g){"use strict";function K(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function ge(y,x){return(!x||y!=="hidden")&&y!=="visible"&&y!=="clip"}function Q(y,x){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var L=getComputedStyle(y,null);return ge(L.overflowY,x)||ge(L.overflowX,x)||function(w){var S=function(M){if(!M.ownerDocument||!M.ownerDocument.defaultView)return null;try{return M.ownerDocument.defaultView.frameElement}catch(m){return null}}(w);return!!S&&(S.clientHeight<w.scrollHeight||S.clientWidth<w.scrollWidth)}(y)}return!1}function fe(y,x,L,w,S,M,m,v){return M<y&&m>x||M>y&&m<x?0:M<=y&&v<=L||m>=x&&v>=L?M-y-w:m>x&&v<L||M<y&&v>L?m-x+S:0}var he=function(y,x){var L=window,w=x.scrollMode,S=x.block,M=x.inline,m=x.boundary,v=x.skipOverflowHiddenElements,T=typeof m=="function"?m:function(we){return we!==m};if(!K(y))throw new TypeError("Invalid target");for(var O=document.scrollingElement||document.documentElement,se=[],te=y;K(te)&&T(te);){if((te=te.parentElement)===O){se.push(te);break}te!=null&&te===document.body&&Q(te)&&!Q(document.documentElement)||te!=null&&Q(te,v)&&se.push(te)}for(var ue=L.visualViewport?L.visualViewport.width:innerWidth,ke=L.visualViewport?L.visualViewport.height:innerHeight,ne=window.scrollX||pageXOffset,xe=window.scrollY||pageYOffset,Fe=y.getBoundingClientRect(),re=Fe.height,A=Fe.width,me=Fe.top,Z=Fe.right,N=Fe.bottom,J=Fe.left,ce=S==="start"||S==="nearest"?me:S==="end"?N:me+re/2,$=M==="center"?J+A/2:M==="end"?Z:J,ye=[],_=0;_<se.length;_++){var b=se[_],q=b.getBoundingClientRect(),Ee=q.height,Se=q.width,tt=q.top,Qe=q.right,je=q.bottom,Ue=q.left;if(w==="if-needed"&&me>=0&&J>=0&&N<=ke&&Z<=ue&&me>=tt&&N<=je&&J>=Ue&&Z<=Qe)return ye;var Oe=getComputedStyle(b),Pe=parseInt(Oe.borderLeftWidth,10),ae=parseInt(Oe.borderTopWidth,10),z=parseInt(Oe.borderRightWidth,10),We=parseInt(Oe.borderBottomWidth,10),nt=0,it=0,Ye="offsetWidth"in b?b.offsetWidth-b.clientWidth-Pe-z:0,F="offsetHeight"in b?b.offsetHeight-b.clientHeight-ae-We:0;if(O===b)nt=S==="start"?ce:S==="end"?ce-ke:S==="nearest"?fe(xe,xe+ke,ke,ae,We,xe+ce,xe+ce+re,re):ce-ke/2,it=M==="start"?$:M==="center"?$-ue/2:M==="end"?$-ue:fe(ne,ne+ue,ue,Pe,z,ne+$,ne+$+A,A),nt=Math.max(0,nt+xe),it=Math.max(0,it+ne);else{nt=S==="start"?ce-tt-ae:S==="end"?ce-je+We+F:S==="nearest"?fe(tt,je,Ee,ae,We+F,ce,ce+re,re):ce-(tt+Ee/2)+F/2,it=M==="start"?$-Ue-Pe:M==="center"?$-(Ue+Se/2)+Ye/2:M==="end"?$-Qe+z+Ye:fe(Ue,Qe,Se,Pe,z+Ye,$,$+A,A);var U=b.scrollLeft,de=b.scrollTop;ce+=de-(nt=Math.max(0,Math.min(de+nt,b.scrollHeight-Ee+F))),$+=U-(it=Math.max(0,Math.min(U+it,b.scrollWidth-Se+Ye)))}ye.push({el:b,top:nt,left:it})}return ye};function ee(y){return y===Object(y)&&Object.keys(y).length!==0}function B(y,x){x===void 0&&(x="auto");var L="scrollBehavior"in document.body.style;y.forEach(function(w){var S=w.el,M=w.top,m=w.left;S.scroll&&L?S.scroll({top:M,left:m,behavior:x}):(S.scrollTop=M,S.scrollLeft=m)})}function Y(y){return y===!1?{block:"end",inline:"nearest"}:ee(y)?y:{block:"start",inline:"nearest"}}function D(y,x){var L=!y.ownerDocument.documentElement.contains(y);if(ee(x)&&typeof x.behavior=="function")return x.behavior(L?[]:he(y,x));if(L)return;var w=Y(x);return B(he(y,w),w.behavior)}var I=ie.a=D},bNIU:function(ct,ie,g){ct.exports={flex_box_center:"flex_box_center___4ZFPv",flex_space_between:"flex_space_between___1poVp",flex_box_vertical_center:"flex_box_vertical_center___2vHuy",flex_box_center_end:"flex_box_center_end___3AGfr",flex_box_column:"flex_box_column___9QgjS",bg:"bg___2D1BG",flexRow:"flexRow___3qWci",flexJustifyCenter:"flexJustifyCenter___ONt7G",flexAlignEnd:"flexAlignEnd___XXRbD",flexAlingCenter:"flexAlingCenter___3bK98",flexAlignCenter:"flexAlignCenter___2Ct2A",flexColumn:"flexColumn___JTR6P",formWrap:"formWrap___3QUHG",titleWrap:"titleWrap___1MIxp",fieldWrap:"fieldWrap___YXlbk",mdWrap:"mdWrap___ZlPmu",backgroundFa:"backgroundFa___2s4Lu",button:"button___KQ_S9",icons:"icons___zqUcb",navBar:"navBar___3taGH",active:"active____5MwL",tipWrap:"tipWrap___2wfhG",tip:"tip___3fuVl",width300:"width300___1tL-J",popover:"popover___2mWr7",groupWrap:"groupWrap___2zY7s",check:"check___3Eies"}},bT9E:function(ct,ie,g){"use strict";g.d(ie,"a",function(){return ge});var K=g("VTBJ");function ge(Q,fe){var he=Object(K.a)({},Q);return Array.isArray(fe)&&fe.forEach(function(ee){delete he[ee]}),he}},c5Ni:function(ct,ie,g){},dejd:function(ct,ie,g){},dmUQ:function(ct,ie,g){"use strict";var K=g("Ff2n"),ge=g("rePB"),Q=g("1OyB"),fe=g("vuIU"),he=g("Ji7U"),ee=g("md7G"),B=g("foSv"),Y=g("q1tI"),D=g.n(Y),I=g("TSYQ"),y=g.n(I),x=g("4IlW");function L(re,A){var me=Object.keys(re);if(Object.getOwnPropertySymbols){var Z=Object.getOwnPropertySymbols(re);A&&(Z=Z.filter(function(N){return Object.getOwnPropertyDescriptor(re,N).enumerable})),me.push.apply(me,Z)}return me}function w(re){for(var A=1;A<arguments.length;A++){var me=arguments[A]!=null?arguments[A]:{};A%2?L(Object(me),!0).forEach(function(Z){Object(ge.a)(re,Z,me[Z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(re,Object.getOwnPropertyDescriptors(me)):L(Object(me)).forEach(function(Z){Object.defineProperty(re,Z,Object.getOwnPropertyDescriptor(me,Z))})}return re}function S(re){var A=M();return function(){var Z=Object(B.a)(re),N;if(A){var J=Object(B.a)(this).constructor;N=Reflect.construct(Z,arguments,J)}else N=Z.apply(this,arguments);return Object(ee.a)(this,N)}}function M(){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(re){return!1}}function m(){}function v(re){re.preventDefault()}var T=function(A){return A.replace(/[^\w.-]+/g,"")},O=200,se=600,te=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ue=function(A){return A!=null},ke=function(A,me){return me===A||typeof me=="number"&&typeof A=="number"&&isNaN(me)&&isNaN(A)},ne=function(re){Object(he.a)(me,re);var A=S(me);function me(Z){var N;Object(Q.a)(this,me),N=A.call(this,Z),N.onKeyDown=function($){var ye=N.props,_=ye.onKeyDown,b=ye.onPressEnter;if($.keyCode===x.a.UP){var q=N.getRatio($);N.up($,q,null),N.stop()}else if($.keyCode===x.a.DOWN){var Ee=N.getRatio($);N.down($,Ee,null),N.stop()}else $.keyCode===x.a.ENTER&&b&&b($);if(N.recordCursorPosition(),N.lastKeyCode=$.keyCode,_){for(var Se=arguments.length,tt=new Array(Se>1?Se-1:0),Qe=1;Qe<Se;Qe++)tt[Qe-1]=arguments[Qe];_.apply(void 0,[$].concat(tt))}},N.onKeyUp=function($){var ye=N.props.onKeyUp;if(N.stop(),N.recordCursorPosition(),ye){for(var _=arguments.length,b=new Array(_>1?_-1:0),q=1;q<_;q++)b[q-1]=arguments[q];ye.apply(void 0,[$].concat(b))}},N.onChange=function($){var ye=N.props.onChange;N.state.focused&&(N.inputting=!0),N.rawInput=N.props.parser(N.getValueFromEvent($)),N.setState({inputValue:N.rawInput}),ye(N.toNumber(N.rawInput))},N.onMouseUp=function(){var $=N.props.onMouseUp;N.recordCursorPosition(),$&&$.apply(void 0,arguments)},N.onFocus=function(){var $;N.setState({focused:!0}),($=N.props).onFocus.apply($,arguments)},N.onBlur=function(){var $=N.props.onBlur;N.inputting=!1,N.setState({focused:!1});var ye=N.getCurrentValidValue(N.state.inputValue),_=N.setValue(ye,m);if($){var b=N.input.value,q=N.getInputDisplayValue({focus:!1,value:_});N.input.value=q&&Number(q),$.apply(void 0,arguments),N.input.value=b}},N.getRatio=function($){var ye=1;return $.metaKey||$.ctrlKey?ye=.1:$.shiftKey&&(ye=10),ye},N.getFullNum=function($){return isNaN($)?$:/e/i.test(String($))?Number($).toFixed(18).replace(/\.?0+$/,""):$},N.getPrecision=function($){if(ue(N.props.precision))return N.props.precision;var ye=String($);if(ye.indexOf("e-")>=0)return parseInt(ye.slice(ye.indexOf("e-")+2),10);var _=0;return ye.indexOf(".")>=0&&(_=ye.length-ye.indexOf(".")-1),_},N.getInputDisplayValue=function($){var ye=$||N.state,_=ye.focused,b=ye.inputValue,q=ye.value,Ee;_?Ee=b:Ee=N.toPrecisionAsStep(q),Ee==null&&(Ee="");var Se=N.formatWrapper(Ee);return ue(N.props.decimalSeparator)&&(Se=Se.toString().replace(".",N.props.decimalSeparator)),Se},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($){}},N.restoreByAfter=function($){if($===void 0)return!1;var ye=N.input.value,_=ye.lastIndexOf($);if(_===-1)return!1;var b=N.cursorBefore.length;return N.lastKeyCode===x.a.DELETE&&N.cursorBefore.charAt(b-1)===$[0]?(N.fixCaret(b,b),!0):_+$.length===ye.length?(N.fixCaret(_,_),!0):!1},N.partRestoreByAfter=function($){return $===void 0?!1:Array.prototype.some.call($,function(ye,_){var b=$.substring(_);return N.restoreByAfter(b)})},N.isNotCompleteNumber=function($){return isNaN($)||$===""||$===null||$&&$.toString().indexOf(".")===$.toString().length-1},N.stop=function(){N.autoStepTimer&&clearTimeout(N.autoStepTimer)},N.down=function($,ye,_){N.pressingUpOrDown=!0,N.step("down",$,ye,_)},N.up=function($,ye,_){N.pressingUpOrDown=!0,N.step("up",$,ye,_)},N.saveInput=function($){N.input=$};var J=Z.value;J===void 0&&(J=Z.defaultValue),N.state={focused:Z.autoFocus};var ce=N.getValidValue(N.toNumber(J));return N.state=w(w({},N.state),{},{inputValue:N.toPrecisionAsStep(ce),value:ce}),N}return Object(fe.a)(me,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(N){var J=this.props,ce=J.value,$=J.onChange,ye=J.max,_=J.min,b=this.state.focused;if(N){if(!ke(N.value,ce)||!ke(N.max,ye)||!ke(N.min,_)){var q=b?ce:this.getValidValue(ce),Ee;this.pressingUpOrDown?Ee=q:this.inputting?Ee=this.rawInput:Ee=this.toPrecisionAsStep(q),this.setState({value:q,inputValue:Ee})}var Se="value"in this.props?ce:this.state.value;"max"in this.props&&N.max!==ye&&typeof Se=="number"&&Se>ye&&$&&$(ye),"min"in this.props&&N.min!==_&&typeof Se=="number"&&Se<_&&$&&$(_)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var tt=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===x.a.BACKSPACE?tt=this.cursorStart-1:this.lastKeyCode===x.a.DELETE&&(tt=this.cursorStart):tt=this.input.value.length,this.fixCaret(tt,tt)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case x.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case x.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Qe){}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 J=N;return J===""?J="":this.isNotCompleteNumber(parseFloat(J))?J=this.state.value:J=this.getValidValue(J),this.toNumber(J)}},{key:"getValueFromEvent",value:function(N){var J=N.target.value.trim().replace(/。/g,".");return ue(this.props.decimalSeparator)&&(J=J.replace(this.props.decimalSeparator,".")),J}},{key:"getValidValue",value:function(N){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,$=parseFloat(N);return isNaN($)?N:($<J&&($=J),$>ce&&($=ce),$)}},{key:"setValue",value:function(N,J){var ce=this.props.precision,$=this.isNotCompleteNumber(parseFloat(N))?null:parseFloat(N),ye=this.state.value,_=ye===void 0?null:ye,b=this.state.inputValue,q=b===void 0?null:b,Ee=typeof $=="number"?$.toFixed(ce):"".concat($),Se=$!==_||Ee!=="".concat(q);return"value"in this.props?(q=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:q},J)):this.setState({value:$,inputValue:this.toPrecisionAsStep(N)},J),Se&&this.props.onChange($),$}},{key:"getMaxPrecision",value:function(N){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=this.props,$=ce.precision,ye=ce.step;if(ue($))return $;var _=this.getPrecision(J),b=this.getPrecision(ye),q=this.getPrecision(N);return N?Math.max(q,_+b):_+b}},{key:"getPrecisionFactor",value:function(N){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=this.getMaxPrecision(N,J);return Math.pow(10,ce)}},{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 J=Math.abs(this.getMaxPrecision(N));return isNaN(J)?N.toString():Number(N).toFixed(J)}},{key:"toNumber",value:function(N){var J=this.props.precision,ce=this.state.focused,$=N&&N.length>16&&ce;return this.isNotCompleteNumber(N)||$?N:ue(J)?Math.round(N*Math.pow(10,J))/Math.pow(10,J):Number(N)}},{key:"upStep",value:function(N,J){var ce=this.props.step,$=this.getPrecisionFactor(N,J),ye=Math.abs(this.getMaxPrecision(N,J)),_=(($*N+$*ce*J)/$).toFixed(ye);return this.toNumber(_)}},{key:"downStep",value:function(N,J){var ce=this.props.step,$=this.getPrecisionFactor(N,J),ye=Math.abs(this.getMaxPrecision(N,J)),_=(($*N-$*ce*J)/$).toFixed(ye);return this.toNumber(_)}},{key:"step",value:function(N,J){var ce=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,ye=arguments.length>3?arguments[3]:void 0;this.stop(),J&&(J.persist(),J.preventDefault());var _=this.props;if(_.disabled)return;var b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var q=this["".concat(N,"Step")](b,$),Ee=q>_.max||q<_.min;if(q>_.max?q=_.max:q<_.min&&(q=_.min),this.setValue(q,null),this.setState({focused:!0},function(){ce.pressingUpOrDown=!1}),Ee)return;this.autoStepTimer=setTimeout(function(){ce[N](J,$,!0)},ye?O:se)}},{key:"fixCaret",value:function(N,J){if(N===void 0||J===void 0||!this.input||!this.input.value)return;try{var ce=this.input.selectionStart,$=this.input.selectionEnd;(N!==ce||J!==$)&&this.input.setSelectionRange(N,J)}catch(ye){}}},{key:"render",value:function(){var N,J=this.props,ce=J.prefixCls,$=J.disabled,ye=J.readOnly,_=J.useTouch,b=J.autoComplete,q=J.upHandler,Ee=J.downHandler,Se=J.className,tt=J.max,Qe=J.min,je=J.style,Ue=J.title,Oe=J.onMouseEnter,Pe=J.onMouseLeave,ae=J.onMouseOver,z=J.onMouseOut,We=J.required,nt=J.onClick,it=J.tabIndex,Ye=J.type,F=J.placeholder,U=J.id,de=J.inputMode,we=J.pattern,Me=J.step,De=J.maxLength,Be=J.autoFocus,He=J.name,dt=J.onPaste,Ze=J.onInput,Je=Object(K.a)(J,["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"]),Ve=this.state,yt=Ve.value,mt=Ve.focused,lt=y()(ce,(N={},Object(ge.a)(N,Se,!!Se),Object(ge.a)(N,"".concat(ce,"-disabled"),$),Object(ge.a)(N,"".concat(ce,"-focused"),mt),N)),be={};Object.keys(Je).forEach(function(W){(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(be[W]=Je[W])});var $e=!ye&&!$,at=this.getInputDisplayValue(null),Ce=(yt||yt===0)&&(isNaN(yt)||Number(yt)>=tt),Le=(yt||yt===0)&&(isNaN(yt)||Number(yt)<=Qe),X=Ce||$||ye,j=Le||$||ye,V=y()("".concat(ce,"-handler"),"".concat(ce,"-handler-up"),Object(ge.a)({},"".concat(ce,"-handler-up-disabled"),X)),E=y()("".concat(ce,"-handler"),"".concat(ce,"-handler-down"),Object(ge.a)({},"".concat(ce,"-handler-down-disabled"),j)),k=_?{onTouchStart:X?m:this.up,onTouchEnd:this.stop}:{onMouseDown:X?m:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},R=_?{onTouchStart:j?m:this.down,onTouchEnd:this.stop}:{onMouseDown:j?m:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return D.a.createElement("div",{className:lt,style:je,title:Ue,onMouseEnter:Oe,onMouseLeave:Pe,onMouseOver:ae,onMouseOut:z,onFocus:function(){return null},onBlur:function(){return null}},D.a.createElement("div",{className:"".concat(ce,"-handler-wrap")},D.a.createElement("span",Object.assign({unselectable:"on"},k,{role:"button","aria-label":"Increase Value","aria-disabled":X,className:V}),q||D.a.createElement("span",{unselectable:"on",className:"".concat(ce,"-handler-up-inner"),onClick:v})),D.a.createElement("span",Object.assign({unselectable:"on"},R,{role:"button","aria-label":"Decrease Value","aria-disabled":j,className:E}),Ee||D.a.createElement("span",{unselectable:"on",className:"".concat(ce,"-handler-down-inner"),onClick:v}))),D.a.createElement("div",{className:"".concat(ce,"-input-wrap")},D.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Qe,"aria-valuemax":tt,"aria-valuenow":yt,required:We,type:Ye,placeholder:F,onPaste:dt,onClick:nt,onMouseUp:this.onMouseUp,className:"".concat(ce,"-input"),tabIndex:it,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:$e?this.onKeyDown:m,onKeyUp:$e?this.onKeyUp:m,autoFocus:Be,maxLength:De,readOnly:ye,disabled:$,max:tt,min:Qe,step:Me,name:He,title:Ue,id:U,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(at),pattern:we,inputMode:de,onInput:Ze},be))))}}]),me}(D.a.Component);ne.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:te,min:-te,step:1,style:{},onChange:m,onKeyDown:m,onPressEnter:m,onFocus:m,onBlur:m,parser:T,required:!1,autoComplete:"off"};var xe=ne,Fe=ie.a=xe},fjLI:function(ct,ie,g){"use strict";g.d(ie,"e",function(){return I}),g.d(ie,"a",function(){return y}),g.d(ie,"c",function(){return x}),g.d(ie,"d",function(){return w}),g.d(ie,"b",function(){return S});var K=g("8HAY"),ge=g("Cg/j"),Q=g("T8No"),fe=g("nnTU"),he=g("MI8n"),ee=function(){var M=function(m,v){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,O){T.__proto__=O}||function(T,O){for(var se in O)O.hasOwnProperty(se)&&(T[se]=O[se])},M(m,v)};return function(m,v){M(m,v);function T(){this.constructor=m}m.prototype=v===null?Object.create(v):(T.prototype=v.prototype,new T)}}(),B=function(M,m,v,T){var O=arguments.length,se=O<3?m:T===null?T=Object.getOwnPropertyDescriptor(m,v):T,te;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(M,m,v,T);else for(var ue=M.length-1;ue>=0;ue--)(te=M[ue])&&(se=(O<3?te(se):O>3?te(m,v,se):te(m,v))||se);return O>3&&se&&Object.defineProperty(m,v,se),se},Y=function(M,m){return function(v,T){m(v,T,M)}},D=function(){for(var M=0,m=0,v=arguments.length;m<v;m++)M+=arguments[m].length;for(var T=Array(M),O=0,m=0;m<v;m++)for(var se=arguments[m],te=0,ue=se.length;te<ue;te++,O++)T[O]=se[te];return T};function I(M){return M.command!==void 0}var y=Object(ge.c)("menuService"),x=new(function(){function M(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new he.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return M.prototype.addCommand=function(m){var v=this;return this._commands.set(m.id,m),this._onDidChangeMenu.fire(0),{dispose:function(){v._commands.delete(m.id)&&v._onDidChangeMenu.fire(0)}}},M.prototype.getCommand=function(m){return this._commands.get(m)},M.prototype.getCommands=function(){var m=new Map;return this._commands.forEach(function(v,T){return m.set(T,v)}),m},M.prototype.appendMenuItem=function(m,v){var T=this,O=this._menuItems.get(m);return O?O.push(v):(O=[v],this._menuItems.set(m,O)),this._onDidChangeMenu.fire(m),{dispose:function(){var se=O.indexOf(v);se>=0&&(O.splice(se,1),T._onDidChangeMenu.fire(m))}}},M.prototype.getMenuItems=function(m){var v=(this._menuItems.get(m)||[]).slice(0);return m===0&&this._appendImplicitItems(v),v},M.prototype._appendImplicitItems=function(m){for(var v=new Set,T=m.filter(function(ne){return I(ne)}),O=0,se=T;O<se.length;O++){var te=se[O],ue=te.command,ke=te.alt;v.add(ue.id),ke&&v.add(ke.id)}this._commands.forEach(function(ne,xe){v.has(xe)||m.push({command:ne})})},M}()),L=function(M){ee(m,M);function m(v,T,O){var se=M.call(this,v,T)||this;return se._commandService=O,se}return m.prototype.run=function(){for(var v,T=[],O=0;O<arguments.length;O++)T[O]=arguments[O];return(v=this._commandService).executeCommand.apply(v,D([this.id],T))},m=B([Y(2,fe.b)],m),m}(K.a),w=function(M){ee(m,M);function m(v){var T=this;return typeof v.title=="string"?T=M.call(this,"",v.title,"submenu")||this:T=M.call(this,"",v.title.value,"submenu")||this,T.item=v,T}return m}(K.a),S=function(M){ee(m,M);function m(v,T,O,se,te){var ue=this;return typeof v.title=="string"?ue=M.call(this,v.id,v.title,te)||this:ue=M.call(this,v.id,v.title.value,te)||this,ue._cssClass=void 0,ue._enabled=!v.precondition||se.contextMatchesRules(v.precondition),ue._checked=Boolean(v.toggled&&se.contextMatchesRules(v.toggled)),ue._options=O||{},ue.item=v,ue.alt=T?new m(T,void 0,ue._options,se,te):void 0,ue}return m.prototype.dispose=function(){this.alt&&this.alt.dispose(),M.prototype.dispose.call(this)},m.prototype.run=function(){for(var v=[],T=0;T<arguments.length;T++)v[T]=arguments[T];var O=[];return this._options.arg&&(O=D(O,[this._options.arg])),this._options.shouldForwardArgs&&(O=D(O,v)),M.prototype.run.apply(this,O)},m=B([Y(3,Q.c),Y(4,fe.b)],m),m}(L)},fnXi:function(ct,ie,g){"use strict";var K=g("2qtc"),ge=g("kLXV"),Q=g("q1tI"),fe=g.n(Q),he=g("Ty5D"),ee=g("9kvl"),B=g("93VE"),Y=g.n(B),D=function(y){var x=y.activeIndex,L=y.isEdit,w=L===void 0?!0:L,S=y.dispatch,M=y.practiceSetting,m=Object(he.i)(),v=m.id,T=m.challengesId,O=Object(Q.useMemo)(function(){return[{name:"\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(v,"/edit/").concat(T,"/editcheckpoint")},{name:"\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(v,"/edit/").concat(T,"/tab=2")},{name:"\u53C2\u8003\u7B54\u6848",url:"/shixuns/".concat(v,"/edit/").concat(T,"/tab=3")},{name:"\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(v,"/edit/").concat(T,"/tab=4")}]},[v,T]),se=function(ue){var ke,ne=function(){ee.d.push(ue),S({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};M!=null&&(ke=M.sideBar)!==null&&ke!==void 0&&ke.confirmLeave?ge.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(){ne()}}):ne()};return fe.a.createElement("ul",{className:"challenge-nav"},w?O.map(function(te,ue){return x===ue?fe.a.createElement("li",{key:te.url}," ",fe.a.createElement("a",{className:"active"},te.name)," "):fe.a.createElement("li",{key:te.url}," ",fe.a.createElement("a",{onClick:function(){return se(te.url)}},te.name)," ")}):fe.a.createElement("li",{key:O[0].url}," ",fe.a.createElement("a",{className:"active"},O[0].name)," "))};ie.a=Object(ee.a)(function(I){var y=I.globalSetting,x=I.practiceSetting;return{globalSetting:y,practiceSetting:x}})(D)},kSUc:function(ct,ie,g){},lZu9:function(ct,ie,g){(function(K){K(g("VrN/"),g("1eCo"),g("8EBN"))})(function(K){"use strict";K.defineMode("markdown",function(ge,Q){var fe=K.getMode(ge,"text/html"),he=fe.name=="null";function ee(_){if(K.findModeByName){var b=K.findModeByName(_);b&&(_=b.mime||b.mimes[0])}var q=K.getMode(ge,_);return q.name=="null"?null:q}Q.highlightFormatting===void 0&&(Q.highlightFormatting=!1),Q.maxBlockquoteDepth===void 0&&(Q.maxBlockquoteDepth=0),Q.taskLists===void 0&&(Q.taskLists=!1),Q.strikethrough===void 0&&(Q.strikethrough=!1),Q.emoji===void 0&&(Q.emoji=!1),Q.fencedCodeBlockHighlighting===void 0&&(Q.fencedCodeBlockHighlighting=!0),Q.fencedCodeBlockDefaultMode===void 0&&(Q.fencedCodeBlockDefaultMode="text/plain"),Q.xml===void 0&&(Q.xml=!0),Q.tokenTypeOverrides===void 0&&(Q.tokenTypeOverrides={});var B={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 Y in B)B.hasOwnProperty(Y)&&Q.tokenTypeOverrides[Y]&&(B[Y]=Q.tokenTypeOverrides[Y]);var D=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,x=Q.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ {0,3}(?:\={1,}|-{2,})\s*$/,w=/^[^#!\[\]*_\\<>` "'(~:]+/,S=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,M=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,v=" ";function T(_,b,q){return b.f=b.inline=q,q(_,b)}function O(_,b,q){return b.f=b.block=q,q(_,b)}function se(_){return!_||!/\S/.test(_.string)}function te(_){if(_.linkTitle=!1,_.linkHref=!1,_.linkText=!1,_.em=!1,_.strong=!1,_.strikethrough=!1,_.quote=0,_.indentedCode=!1,_.f==ke){var b=he;if(!b){var q=K.innerMode(fe,_.htmlState);b=q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText}b&&(_.f=re,_.block=ue,_.htmlState=null)}return _.trailingSpace=0,_.trailingSpaceNewLine=!1,_.prevLine=_.thisLine,_.thisLine={stream:null},null}function ue(_,b){var q=_.column()===b.indentation,Ee=se(b.prevLine.stream),Se=b.indentedCode,tt=b.prevLine.hr,Qe=b.list!==!1,je=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Ue=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,Qe)){for(b.list=null;Ue<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=Ue-b.listStack[b.listStack.length-1])}var Oe=!Ee&&!tt&&!b.prevLine.header&&(!Qe||!Se)&&!b.prevLine.fencedCodeEnd,Pe=(b.list===!1||tt||Ee)&&b.indentation<=je&&_.match(D),ae=null;if(b.indentationDiff>=4&&(Se||b.prevLine.fencedCodeEnd||b.prevLine.header||Ee))return _.skipToEnd(),b.indentedCode=!0,B.code;if(_.eatSpace())return null;if(q&&b.indentation<=je&&(ae=_.match(x))&&ae[1].length<=6)return b.quote=0,b.header=ae[1].length,b.thisLine.header=!0,Q.highlightFormatting&&(b.formatting="header"),b.f=b.inline,xe(b);if(b.indentation<=je&&_.eat(">"))return b.quote=q?1:b.quote+1,Q.highlightFormatting&&(b.formatting="quote"),_.eatSpace(),xe(b);if(!Pe&&!b.setext&&q&&b.indentation<=je&&(ae=_.match(I))){var z=ae[1]?"ol":"ul";return b.indentation=Ue+_.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,Q.taskLists&&_.match(y,!1)&&(b.taskList=!0),b.f=b.inline,Q.highlightFormatting&&(b.formatting=["list","list-"+z]),xe(b)}else{if(q&&b.indentation<=je&&(ae=_.match(S,!0)))return b.quote=0,b.fencedEndRE=new RegExp(ae[1]+"+ *$"),b.localMode=Q.fencedCodeBlockHighlighting&&ee(ae[2]||Q.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=K.startState(b.localMode)),b.f=b.block=ne,Q.highlightFormatting&&(b.formatting="code-block"),b.code=-1,xe(b);if(b.setext||(!Oe||!Qe)&&!b.quote&&b.list===!1&&!b.code&&!Pe&&!M.test(_.string)&&(ae=_.lookAhead(1))&&(ae=ae.match(L)))return b.setext?(b.header=b.setext,b.setext=0,_.skipToEnd(),Q.highlightFormatting&&(b.formatting="header")):(b.header=ae[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,xe(b);if(Pe)return _.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,B.hr;if(_.peek()==="[")return T(_,b,J)}return T(_,b,b.inline)}function ke(_,b){var q=fe.token(_,b.htmlState);if(!he){var Ee=K.innerMode(fe,b.htmlState);(Ee.mode.name=="xml"&&Ee.state.tagStart===null&&!Ee.state.context&&Ee.state.tokenize.isInText||b.md_inside&&_.current().indexOf(">")>-1)&&(b.f=re,b.block=ue,b.htmlState=null)}return q}function ne(_,b){var q=b.listStack[b.listStack.length-1]||0,Ee=b.indentation<q,Se=q+3;if(b.fencedEndRE&&b.indentation<=Se&&(Ee||_.match(b.fencedEndRE))){Q.highlightFormatting&&(b.formatting="code-block");var tt;return Ee||(tt=xe(b)),b.localMode=b.localState=null,b.block=ue,b.f=re,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,Ee?O(_,b,b.block):tt}else return b.localMode?b.localMode.token(_,b.localState):(_.skipToEnd(),B.code)}function xe(_){var b=[];if(_.formatting){b.push(B.formatting),typeof _.formatting=="string"&&(_.formatting=[_.formatting]);for(var q=0;q<_.formatting.length;q++)b.push(B.formatting+"-"+_.formatting[q]),_.formatting[q]==="header"&&b.push(B.formatting+"-"+_.formatting[q]+"-"+_.header),_.formatting[q]==="quote"&&(!Q.maxBlockquoteDepth||Q.maxBlockquoteDepth>=_.quote?b.push(B.formatting+"-"+_.formatting[q]+"-"+_.quote):b.push("error"))}if(_.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(_.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(_.linkHref?b.push(B.linkHref,"url"):(_.strong&&b.push(B.strong),_.em&&b.push(B.em),_.strikethrough&&b.push(B.strikethrough),_.emoji&&b.push(B.emoji),_.linkText&&b.push(B.linkText),_.code&&b.push(B.code),_.image&&b.push(B.image),_.imageAltText&&b.push(B.imageAltText,"link"),_.imageMarker&&b.push(B.imageMarker)),_.header&&b.push(B.header,B.header+"-"+_.header),_.quote&&(b.push(B.quote),!Q.maxBlockquoteDepth||Q.maxBlockquoteDepth>=_.quote?b.push(B.quote+"-"+_.quote):b.push(B.quote+"-"+Q.maxBlockquoteDepth)),_.list!==!1){var Ee=(_.listStack.length-1)%3;Ee?Ee===1?b.push(B.list2):b.push(B.list3):b.push(B.list1)}return _.trailingSpaceNewLine?b.push("trailing-space-new-line"):_.trailingSpace&&b.push("trailing-space-"+(_.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function Fe(_,b){return _.match(w,!0)?xe(b):void 0}function re(_,b){var q=b.text(_,b);if(typeof q!="undefined")return q;if(b.list)return b.list=null,xe(b);if(b.taskList){var Ee=_.match(y,!0)[1]===" ";return Ee?b.taskOpen=!0:b.taskClosed=!0,Q.highlightFormatting&&(b.formatting="task"),b.taskList=!1,xe(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&_.match(/^#+$/,!0))return Q.highlightFormatting&&(b.formatting="header"),xe(b);var Se=_.next();if(b.linkTitle){b.linkTitle=!1;var tt=Se;Se==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Qe="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(_.match(new RegExp(Qe),!0))return B.linkHref}if(Se==="`"){var je=b.formatting;Q.highlightFormatting&&(b.formatting="code"),_.eatWhile("`");var Ue=_.current().length;if(b.code==0&&(!b.quote||Ue==1))return b.code=Ue,xe(b);if(Ue==b.code){var Oe=xe(b);return b.code=0,Oe}else return b.formatting=je,xe(b)}else if(b.code)return xe(b);if(Se==="\\"&&(_.next(),Q.highlightFormatting)){var Pe=xe(b),ae=B.formatting+"-escape";return Pe?Pe+" "+ae:ae}if(Se==="!"&&_.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,Q.highlightFormatting&&(b.formatting="image"),xe(b);if(Se==="["&&b.imageMarker&&_.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,Q.highlightFormatting&&(b.formatting="image"),xe(b);if(Se==="]"&&b.imageAltText){Q.highlightFormatting&&(b.formatting="image");var Pe=xe(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=me,Pe}if(Se==="["&&!b.image)return b.linkText&&_.match(/^.*?\]/)||(b.linkText=!0,Q.highlightFormatting&&(b.formatting="link")),xe(b);if(Se==="]"&&b.linkText){Q.highlightFormatting&&(b.formatting="link");var Pe=xe(b);return b.linkText=!1,b.inline=b.f=_.match(/\(.*?\)| ?\[.*?\]/,!1)?me:re,Pe}if(Se==="<"&&_.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=A,Q.highlightFormatting&&(b.formatting="link");var Pe=xe(b);return Pe?Pe+=" ":Pe="",Pe+B.linkInline}if(Se==="<"&&_.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=A,Q.highlightFormatting&&(b.formatting="link");var Pe=xe(b);return Pe?Pe+=" ":Pe="",Pe+B.linkEmail}if(Q.xml&&Se==="<"&&_.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var z=_.string.indexOf(">",_.pos);if(z!=-1){var We=_.string.substring(_.start,z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(We)&&(b.md_inside=!0)}return _.backUp(1),b.htmlState=K.startState(fe),O(_,b,ke)}if(Q.xml&&Se==="<"&&_.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(Se==="*"||Se==="_"){for(var nt=1,it=_.pos==1?" ":_.string.charAt(_.pos-2);nt<3&&_.eat(Se);)nt++;var Ye=_.peek()||" ",F=!/\s/.test(Ye)&&(!m.test(Ye)||/\s/.test(it)||m.test(it)),U=!/\s/.test(it)&&(!m.test(it)||/\s/.test(Ye)||m.test(Ye)),de=null,we=null;if(nt%2&&(!b.em&&F&&(Se==="*"||!U||m.test(it))?de=!0:b.em==Se&&U&&(Se==="*"||!F||m.test(Ye))&&(de=!1)),nt>1&&(!b.strong&&F&&(Se==="*"||!U||m.test(it))?we=!0:b.strong==Se&&U&&(Se==="*"||!F||m.test(Ye))&&(we=!1)),we!=null||de!=null){Q.highlightFormatting&&(b.formatting=de==null?"strong":we==null?"em":"strong em"),de===!0&&(b.em=Se),we===!0&&(b.strong=Se);var Oe=xe(b);return de===!1&&(b.em=!1),we===!1&&(b.strong=!1),Oe}}else if(Se===" "&&(_.eat("*")||_.eat("_"))){if(_.peek()===" ")return xe(b);_.backUp(1)}if(Q.strikethrough){if(Se==="~"&&_.eatWhile(Se)){if(b.strikethrough){Q.highlightFormatting&&(b.formatting="strikethrough");var Oe=xe(b);return b.strikethrough=!1,Oe}else if(_.match(/^[^\s]/,!1))return b.strikethrough=!0,Q.highlightFormatting&&(b.formatting="strikethrough"),xe(b)}else if(Se===" "&&_.match(/^~~/,!0)){if(_.peek()===" ")return xe(b);_.backUp(2)}}if(Q.emoji&&Se===":"&&_.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,Q.highlightFormatting&&(b.formatting="emoji");var Me=xe(b);return b.emoji=!1,Me}return Se===" "&&(_.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),xe(b)}function A(_,b){var q=_.next();if(q===">"){b.f=b.inline=re,Q.highlightFormatting&&(b.formatting="link");var Ee=xe(b);return Ee?Ee+=" ":Ee="",Ee+B.linkInline}return _.match(/^[^>]+/,!0),B.linkInline}function me(_,b){if(_.eatSpace())return null;var q=_.next();return q==="("||q==="["?(b.f=b.inline=N(q==="("?")":"]"),Q.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,xe(b)):"error"}var Z={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(_){return function(b,q){var Ee=b.next();if(Ee===_){q.f=q.inline=re,Q.highlightFormatting&&(q.formatting="link-string");var Se=xe(q);return q.linkHref=!1,Se}return b.match(Z[_]),q.linkHref=!0,xe(q)}}function J(_,b){return _.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=ce,_.next(),Q.highlightFormatting&&(b.formatting="link"),b.linkText=!0,xe(b)):T(_,b,re)}function ce(_,b){if(_.match(/^\]:/,!0)){b.f=b.inline=$,Q.highlightFormatting&&(b.formatting="link");var q=xe(b);return b.linkText=!1,q}return _.match(/^([^\]\\]|\\.)+/,!0),B.linkText}function $(_,b){return _.eatSpace()?null:(_.match(/^[^\s]+/,!0),_.peek()===void 0?b.linkTitle=!0:_.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=re,B.linkHref+" url")}var ye={startState:function(){return{f:ue,prevLine:{stream:null},thisLine:{stream:null},block:ue,htmlState:null,indentation:0,inline:re,text:Fe,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(_){return{f:_.f,prevLine:_.prevLine,thisLine:_.thisLine,block:_.block,htmlState:_.htmlState&&K.copyState(fe,_.htmlState),indentation:_.indentation,localMode:_.localMode,localState:_.localMode?K.copyState(_.localMode,_.localState):null,inline:_.inline,text:_.text,formatting:!1,linkText:_.linkText,linkTitle:_.linkTitle,linkHref:_.linkHref,code:_.code,em:_.em,strong:_.strong,strikethrough:_.strikethrough,emoji:_.emoji,header:_.header,setext:_.setext,hr:_.hr,taskList:_.taskList,list:_.list,listStack:_.listStack.slice(0),quote:_.quote,indentedCode:_.indentedCode,trailingSpace:_.trailingSpace,trailingSpaceNewLine:_.trailingSpaceNewLine,md_inside:_.md_inside,fencedEndRE:_.fencedEndRE}},token:function(_,b){if(b.formatting=!1,_!=b.thisLine.stream){if(b.header=0,b.hr=!1,_.match(/^\s*$/,!0))return te(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:_},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=ke)){var q=_.match(/^\s*/,!0)[0].replace(/\t/g,v).length;if(b.indentation=q,b.indentationDiff=null,q>0)return null}}return b.f(_,b)},innerMode:function(_){return _.block==ke?{state:_.htmlState,mode:fe}:_.localState?{state:_.localState,mode:_.localMode}:{state:_,mode:ye}},indent:function(_,b,q){return _.block==ke&&fe.indent?fe.indent(_.htmlState,b,q):_.localState&&_.localMode.indent?_.localMode.indent(_.localState,b,q):K.Pass},blankLine:te,getType:xe,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return ye},"xml"),K.defineMIME("text/markdown","markdown"),K.defineMIME("text/x-markdown","markdown")})},nnTU:function(ct,ie,g){"use strict";g.d(ie,"b",function(){return Y}),g.d(ie,"a",function(){return D});var K=g("pmY6"),ge=g("746U"),Q=g("Cg/j"),fe=g("MI8n"),he=g("24hK"),ee=g("QDVR"),B=function(){for(var I=0,y=0,x=arguments.length;y<x;y++)I+=arguments[y].length;for(var L=Array(I),w=0,y=0;y<x;y++)for(var S=arguments[y],M=0,m=S.length;M<m;M++,w++)L[w]=S[M];return L},Y=Object(Q.c)("commandService"),D=new(function(){function I(){this._commands=new Map,this._onDidRegisterCommand=new fe.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return I.prototype.registerCommand=function(y,x){var L=this;if(!y)throw new Error("invalid command");if(typeof y=="string"){if(!x)throw new Error("invalid command");return this.registerCommand({id:y,handler:x})}if(y.description){for(var w=[],S=0,M=y.description.args;S<M.length;S++){var m=M[S];w.push(m.constraint)}var v=y.handler;y.handler=function(ue){for(var ke=[],ne=1;ne<arguments.length;ne++)ke[ne-1]=arguments[ne];return Object(ge.m)(ke,w),v.apply(void 0,B([ue],ke))}}var T=y.id,O=this._commands.get(T);O||(O=new he.a,this._commands.set(T,O));var se=O.unshift(y),te=Object(K.h)(function(){se();var ue=L._commands.get(T);(ue==null?void 0:ue.isEmpty())&&L._commands.delete(T)});return this._onDidRegisterCommand.fire(T),te},I.prototype.registerCommandAlias=function(y,x){return D.registerCommand(y,function(L){for(var w,S=[],M=1;M<arguments.length;M++)S[M-1]=arguments[M];return(w=L.get(Y)).executeCommand.apply(w,B([x],S))})},I.prototype.getCommand=function(y){var x=this._commands.get(y);return!x||x.isEmpty()?void 0:x.iterator().next().value},I.prototype.getCommands=function(){for(var y=new Map,x=0,L=Object(ee.d)(this._commands);x<L.length;x++){var w=L[x],S=this.getCommand(w);S&&y.set(w,S)}return y},I}())},nuEh:function(ct,ie,g){"use strict";var K=g("T2oS"),ge=g("W9HT"),Q=g("q1tI"),fe=g.n(Q),he=g("F8wB"),ee=g.n(he),B=function(D){var I=D.loading;return I?fe.a.createElement("div",{className:ee.a.loading},fe.a.createElement(ge.a,null)):fe.a.createElement(fe.a.Fragment,null)};ie.a=B},osHv:function(ct,ie,g){(function(K){K(g("VrN/"))})(function(K){"use strict";var ge=K.Pos;function Q(m,v){return m.line-v.line||m.ch-v.ch}var fe="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",he=fe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ee=new RegExp("<(/?)(["+fe+"]["+he+"]*)","g");function B(m,v,T,O){this.line=v,this.ch=T,this.cm=m,this.text=m.getLine(v),this.min=O?Math.max(O.from,m.firstLine()):m.firstLine(),this.max=O?Math.min(O.to-1,m.lastLine()):m.lastLine()}function Y(m,v){var T=m.cm.getTokenTypeAt(ge(m.line,v));return T&&/\btag\b/.test(T)}function D(m){return m.line>=m.max?void 0:(m.ch=0,m.text=m.cm.getLine(++m.line),!0)}function I(m){return m.line<=m.min?void 0:(m.text=m.cm.getLine(--m.line),m.ch=m.text.length,!0)}function y(m){for(;;){var v=m.text.indexOf(">",m.ch);if(v==-1){if(D(m))continue;return}if(!Y(m,v+1)){m.ch=v+1;continue}var T=m.text.lastIndexOf("/",v),O=T>-1&&!/\S/.test(m.text.slice(T+1,v));return m.ch=v+1,O?"selfClose":"regular"}}function x(m){for(;;){var v=m.ch?m.text.lastIndexOf("<",m.ch-1):-1;if(v==-1){if(I(m))continue;return}if(!Y(m,v+1)){m.ch=v;continue}ee.lastIndex=v,m.ch=v;var T=ee.exec(m.text);if(T&&T.index==v)return T}}function L(m){for(;;){ee.lastIndex=m.ch;var v=ee.exec(m.text);if(!v){if(D(m))continue;return}if(!Y(m,v.index+1)){m.ch=v.index+1;continue}return m.ch=v.index+v[0].length,v}}function w(m){for(;;){var v=m.ch?m.text.lastIndexOf(">",m.ch-1):-1;if(v==-1){if(I(m))continue;return}if(!Y(m,v+1)){m.ch=v;continue}var T=m.text.lastIndexOf("/",v),O=T>-1&&!/\S/.test(m.text.slice(T+1,v));return m.ch=v+1,O?"selfClose":"regular"}}function S(m,v){for(var T=[];;){var O=L(m),se,te=m.line,ue=m.ch-(O?O[0].length:0);if(!O||!(se=y(m)))return;if(se=="selfClose")continue;if(O[1]){for(var ke=T.length-1;ke>=0;--ke)if(T[ke]==O[2]){T.length=ke;break}if(ke<0&&(!v||v==O[2]))return{tag:O[2],from:ge(te,ue),to:ge(m.line,m.ch)}}else T.push(O[2])}}function M(m,v){for(var T=[];;){var O=w(m);if(!O)return;if(O=="selfClose"){x(m);continue}var se=m.line,te=m.ch,ue=x(m);if(!ue)return;if(ue[1])T.push(ue[2]);else{for(var ke=T.length-1;ke>=0;--ke)if(T[ke]==ue[2]){T.length=ke;break}if(ke<0&&(!v||v==ue[2]))return{tag:ue[2],from:ge(m.line,m.ch),to:ge(se,te)}}}}K.registerHelper("fold","xml",function(m,v){for(var T=new B(m,v.line,0);;){var O=L(T);if(!O||T.line!=v.line)return;var se=y(T);if(!se)return;if(!O[1]&&se!="selfClose"){var te=ge(T.line,T.ch),ue=S(T,O[2]);return ue&&Q(ue.from,te)>0?{from:te,to:ue.from}:null}}}),K.findMatchingTag=function(m,v,T){var O=new B(m,v.line,v.ch,T);if(O.text.indexOf(">")==-1&&O.text.indexOf("<")==-1)return;var se=y(O),te=se&&ge(O.line,O.ch),ue=se&&x(O);if(!se||!ue||Q(O,v)>0)return;var ke={from:ge(O.line,O.ch),to:te,tag:ue[2]};return se=="selfClose"?{open:ke,close:null,at:"open"}:ue[1]?{open:M(O,ue[2]),close:ke,at:"close"}:(O=new B(m,te.line,te.ch,T),{open:ke,close:S(O,ue[2]),at:"open"})},K.findEnclosingTag=function(m,v,T,O){for(var se=new B(m,v.line,v.ch,T);;){var te=M(se,O);if(!te)break;var ue=new B(m,v.line,v.ch,T),ke=S(ue,te.tag);if(ke)return{open:te,close:ke}}},K.scanForClosingTag=function(m,v,T,O){var se=new B(m,v.line,v.ch,O?{from:0,to:O}:null);return S(se,T)}})},p5ED:function(ct,ie,g){"use strict";var K=g("+L6B"),ge=g("2/Rp"),Q=g("5Dmo"),fe=g("3S7+"),he=g("k1fw"),ee=g("9og8"),B=g("tJVT"),Y=g("WmNS"),D=g.n(Y),I=g("q1tI"),y=g.n(I),x=g("vHTk"),L=g.n(x),w=g("yEEn"),S=g("ZW9T"),M=g("1vsH"),m=g("V0Rq"),v=g("m3rI");ie.a=function(T){var O,se,te,ue,ke,ne,xe=T.editOffice,Fe=xe===void 0?"view":xe,re=T.name,A=T.data,me=T.theme,Z=T.type,N=T.filename,J=T.monacoEditor,ce=T.className,$=T.style,ye=T.close,_=T.onClose,b=T.hasMask,q=T.disabledDownload,Ee=T.onImgDimensions,Se=T.otherData,tt=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Qe=Object(B.a)(tt,2),je=Qe[0],Ue=Qe[1],Oe=Object(I.useState)(""),Pe=Object(B.a)(Oe,2),ae=Pe[0],z=Pe[1],We=Object(I.useState)(),nt=Object(B.a)(We,2),it=nt[0],Ye=nt[1],F=window.ENV==="build"?"/react/build":"",U=location.host.startsWith("localhost")?v.a.PROXY_SERVER:v.a.API_SERVER,de,we=1024*1024,Me=10*we,De=Object(I.useRef)();(O=A)!==null&&O!==void 0&&O.startsWith("/api")&&Z!=="txt"&&(A=v.a.API_SERVER+A),Z==="office"&&(de=Object(M.P)(A).filesize,de>Me&&(Z="other")),N&&(J.filename=N),Object(I.useEffect)(function(){var Ze,Je,Ve=(Ze=document.cookie)===null||Ze===void 0||((Je=Ze.replace(/\s/g,""))===null||Je===void 0)?void 0:Je.split(";");Ve==null||Ve.map(function(yt){var mt=yt.split("=");mt[0]==="_educoder_session"&&z(mt[1])})},[]),Object(I.useEffect)(function(){Z==="office"&&Be()},[Z,A]);var Be=function(){var Ze=Object(ee.a)(D.a.mark(function Je(){var Ve,yt,mt;return D.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return console.log("data:",A),Ve=A,A.startsWith("http")||(Ve=location.origin+Ve),yt=new URL(Ve).pathname.split("/").pop(),be.next=6,Object(m.U)({attachment_id:yt});case 6:mt=be.sent,Ye(mt);case 8:case"end":return be.stop()}},Je)}));return function(){return Ze.apply(this,arguments)}}(),He=function(){if(A.startsWith("http")||A.startsWith("blob:")){dt();return}Object(M.x)(N||"educoder",A,N)},dt=function(){Object(M.v)(N||"educoder",decodeURIComponent(A))};return y.a.createElement("div",{style:Object(he.a)({},$||{}),className:"".concat(b&&L.a.bgBlack," ").concat(Z?L.a.wrp:"hide")},ye&&y.a.createElement("div",{className:L.a.close,ref:De},!!Ee&&y.a.createElement(fe.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return De.current}},y.a.createElement("span",{onClick:function(){_(),Ee()}},y.a.createElement("i",{className:"icon-yulanpizhu"}))),!q&&y.a.createElement(fe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return De.current}},y.a.createElement("span",{onClick:dt},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(fe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return De.current}},y.a.createElement("span",{className:"",onClick:_},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(L.a[ce]," ").concat(ce," ").concat(L.a.monaco," ").concat(Z==="txt"?"show":"hide")},Z==="txt"&&y.a.createElement(S.b,J)),Z==="audio"&&y.a.createElement("audio",{src:"".concat(((se=A)===null||se===void 0?void 0:se.indexOf("http://"))>-1||((te=A)===null||te===void 0?void 0:te.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(A),autoPlay:!0}),Z==="video"&&y.a.createElement(y.a.Fragment,null,((ue=A)===null||ue===void 0?void 0:ue.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(A),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(A),autoPlay:!0})),Z==="office"&&it&&y.a.createElement("iframe",{src:"".concat(F,"/office.html?key=").concat(it.key,"&url=").concat(U+it.url,"&callbackUrl=").concat(U+it.callbackUrl,"&fileType=").concat(it.fileType,"&title=").concat(it.title,"&model=").concat(Fe,"&officeServer=").concat(v.a.OFFICE_SERVER,"&disabledDownload=").concat(!!q)}),(Z==="xlsx"||Z==="doc"||Z==="pptx"||Z==="docx")&&y.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Se.key,"&url=").concat(v.a.API_SERVER+Se.url,"&callbackUrl=").concat(v.a.API_SERVER+Se.callbackUrl,"&fileType=").concat(Se.fileType,"&title=").concat(Se.title,"&model=").concat(Se.model)}),Z==="html"&&y.a.createElement("iframe",{src:A+"&disposition=inline"}),Z==="pdf"&&y.a.createElement("embed",{className:L.a.embed,src:A}),Z==="image"&&y.a.createElement("img",{src:"".concat(((ke=A)===null||ke===void 0?void 0:ke.indexOf("http://"))>-1||((ne=A)===null||ne===void 0?void 0:ne.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(A)}),Z==="other"&&y.a.createElement("div",null,y.a.createElement(ge.a,{type:"primary",size:"large",onClick:He},y.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),Z==="download"&&y.a.createElement(ge.a,{type:"primary",size:"large",onClick:He},y.a.createElement(w.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ct,ie,g){},pmY6:function(ct,ie,g){"use strict";g.d(ie,"g",function(){return he}),g.d(ie,"f",function(){return ee}),g.d(ie,"e",function(){return B}),g.d(ie,"h",function(){return Y}),g.d(ie,"b",function(){return D}),g.d(ie,"a",function(){return I}),g.d(ie,"d",function(){return y}),g.d(ie,"c",function(){return x});var K=!1,ge="__is_disposable_tracked__";function Q(L){if(!K)return;if(L&&L!==I.None)try{L[ge]=!0}catch(w){}}function fe(L){if(!K)return L;var w=new Error("Potentially leaked disposable").stack;return setTimeout(function(){L[ge]||console.log(w)},3e3),L}function he(L){return typeof L.dispose=="function"&&L.dispose.length===0}function ee(L){return Array.isArray(L)?(L.forEach(function(w){w&&(Q(w),w.dispose())}),[]):L?(Q(L),L.dispose(),L):void 0}function B(){for(var L=[],w=0;w<arguments.length;w++)L[w]=arguments[w];return L.forEach(Q),fe({dispose:function(){return ee(L)}})}function Y(L){var w=fe({dispose:function(){Q(w),L()}});return w}var D=function(){function L(){this._toDispose=new Set,this._isDisposed=!1}return L.prototype.dispose=function(){if(this._isDisposed)return;Q(this),this._isDisposed=!0,this.clear()},L.prototype.clear=function(){this._toDispose.forEach(function(w){return w.dispose()}),this._toDispose.clear()},L.prototype.add=function(w){if(!w)return w;if(w===this)throw new Error("Cannot register a disposable on itself!");return Q(w),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(w),w},L}(),I=function(){function L(){this._store=new D,fe(this)}return L.prototype.dispose=function(){Q(this),this._store.dispose()},L.prototype._register=function(w){if(w===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(w)},L.None=Object.freeze({dispose:function(){}}),L}(),y=function(){function L(){this._isDisposed=!1,fe(this)}return Object.defineProperty(L.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(w){if(this._isDisposed||w===this._value)return;this._value&&this._value.dispose(),w&&Q(w),this._value=w},enumerable:!0,configurable:!0}),L.prototype.clear=function(){this.value=void 0},L.prototype.dispose=function(){this._isDisposed=!0,Q(this),this._value&&this._value.dispose(),this._value=void 0},L}(),x=function(){function L(w){this.object=w}return L.prototype.dispose=function(){},L}()},"rAM+":function(ct,ie,g){"use strict";g.d(ie,"a",function(){return ge});var K=g("Qw5x");function ge(Q,fe){var he;if(typeof Symbol=="undefined"||Q[Symbol.iterator]==null){if(Array.isArray(Q)||(he=Object(K.a)(Q))||fe&&Q&&typeof Q.length=="number"){he&&(Q=he);var ee=0,B=function(){};return{s:B,n:function(){return ee>=Q.length?{done:!0}:{done:!1,value:Q[ee++]}},e:function(x){throw x},f: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.`)}var Y=!0,D=!1,I;return{s:function(){he=Q[Symbol.iterator]()},n:function(){var x=he.next();return Y=x.done,x},e:function(x){D=!0,I=x},f:function(){try{!Y&&he.return!=null&&he.return()}finally{if(D)throw I}}}}},rUJ1:function(ct,ie){const g=/[&<>"']/,K=/[&<>"']/g,ge=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,fe={"&":"&","<":"<",">":">",'"':""","'":"'"},he=ne=>fe[ne];function ee(ne,xe){if(xe){if(g.test(ne))return ne.replace(K,he)}else if(ge.test(ne))return ne.replace(Q,he);return ne}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Y(ne){return ne.replace(B,(xe,Fe)=>(Fe=Fe.toLowerCase(),Fe==="colon"?":":Fe.charAt(0)==="#"?Fe.charAt(1)==="x"?String.fromCharCode(parseInt(Fe.substring(2),16)):String.fromCharCode(+Fe.substring(1)):""))}const D=/(^|[^\[])\^/g;function I(ne,xe){ne=ne.source||ne,xe=xe||"";const Fe={replace:(re,A)=>(A=A.source||A,A=A.replace(D,"$1"),ne=ne.replace(re,A),Fe),getRegex:()=>new RegExp(ne,xe)};return Fe}const y=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ne,xe,Fe){if(ne){let re;try{re=decodeURIComponent(Y(Fe)).replace(y,"").toLowerCase()}catch(A){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}xe&&!x.test(Fe)&&(Fe=v(xe,Fe));try{Fe=encodeURI(Fe).replace(/%25/g,"%")}catch(re){return null}return Fe}const w={},S=/^[^:]+:\/*[^/]*$/,M=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(ne,xe){w[" "+ne]||(S.test(ne)?w[" "+ne]=ne+"/":w[" "+ne]=te(ne,"/",!0)),ne=w[" "+ne];const Fe=ne.indexOf(":")===-1;return xe.substring(0,2)==="//"?Fe?xe:ne.replace(M,"$1")+xe:xe.charAt(0)==="/"?Fe?xe:ne.replace(m,"$1")+xe:ne+xe}const T={exec:function(){}};function O(ne){let xe=1,Fe,re;for(;xe<arguments.length;xe++){Fe=arguments[xe];for(re in Fe)Object.prototype.hasOwnProperty.call(Fe,re)&&(ne[re]=Fe[re])}return ne}function se(ne,xe){const Fe=ne.replace(/\|/g,(me,Z,N)=>{let J=!1,ce=Z;for(;--ce>=0&&N[ce]==="\\";)J=!J;return J?"|":" |"}),re=Fe.split(/ \|/);let A=0;if(re.length>xe)re.splice(xe);else for(;re.length<xe;)re.push("");for(;A<re.length;A++)re[A]=re[A].trim().replace(/\\\|/g,"|");return re}function te(ne,xe,Fe){const re=ne.length;if(re===0)return"";let A=0;for(;A<re;){const me=ne.charAt(re-A-1);if(me===xe&&!Fe)A++;else if(me!==xe&&Fe)A++;else break}return ne.substr(0,re-A)}function ue(ne,xe){if(ne.indexOf(xe[1])===-1)return-1;const Fe=ne.length;let re=0,A=0;for(;A<Fe;A++)if(ne[A]==="\\")A++;else if(ne[A]===xe[0])re++;else if(ne[A]===xe[1]&&(re--,re<0))return A;return-1}function ke(ne){ne&&ne.sanitize&&!ne.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")}ct.exports={escape:ee,unescape:Y,edit:I,cleanUrl:L,resolveUrl:v,noopTest:T,merge:O,splitCells:se,rtrim:te,findClosingBracket:ue,checkSanitizeDeprecation:ke}},vHTk:function(ct,ie,g){ct.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|