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

350 lines
637 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[280,6,7,14,17],{"+NIl":function(nt,Ge,v){(function(z){z(v("VrN/"))})(function(z){"use strict";z.defineMode("stex",function(he,oe){"use strict";function xe(H,I){H.cmdState.push(I)}function se(H){return H.cmdState.length>0?H.cmdState[H.cmdState.length-1]:null}function V(H){var I=H.cmdState.pop();I&&I.closeBracket()}function k(H){for(var I=H.cmdState,G=I.length-1;G>=0;G--){var X=I[G];if(X.name=="DEFAULT")continue;return X}return{styleIdentifier:function(){return null}}}function L(H,I,G){return function(){this.name=H,this.bracketNo=0,this.style=I,this.styles=G,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=L("importmodule","tag",["string","builtin"]),P.documentclass=L("documentclass","tag",["","atom"]),P.usepackage=L("usepackage","tag",["atom"]),P.begin=L("begin","tag",["atom"]),P.end=L("end","tag",["atom"]),P.label=L("label","tag",["atom"]),P.ref=L("ref","tag",["atom"]),P.eqref=L("eqref","tag",["atom"]),P.cite=L("cite","tag",["atom"]),P.bibitem=L("bibitem","tag",["atom"]),P.Bibitem=L("Bibitem","tag",["atom"]),P.RBibitem=L("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(H,I){H.f=I}function R(H,I){var G;if(H.match(/^\\[a-zA-Z@]+/)){var X=H.current().slice(1);return G=P.hasOwnProperty(X)?P[X]:P.DEFAULT,G=new G,xe(I,G),A(I,Q),G.style}if(H.match(/^\\[$&%#{}_]/))return"tag";if(H.match(/^\\[,;!\/\\]/))return"tag";if(H.match("\\["))return A(I,function(ce,De){return T(ce,De,"\\]")}),"keyword";if(H.match("\\("))return A(I,function(ce,De){return T(ce,De,"\\)")}),"keyword";if(H.match("$$"))return A(I,function(ce,De){return T(ce,De,"$$")}),"keyword";if(H.match("$"))return A(I,function(ce,De){return T(ce,De,"$")}),"keyword";var Y=H.next();if(Y=="%")return H.skipToEnd(),"comment";if(Y=="}"||Y=="]"){if(G=se(I),G)G.closeBracket(Y),A(I,Q);else return"error";return"bracket"}else return Y=="{"||Y=="["?(G=P.DEFAULT,G=new G,xe(I,G),"bracket"):/\d/.test(Y)?(H.eatWhile(/[\w.%]/),"atom"):(H.eatWhile(/[\w\-_]/),G=k(I),G.name=="begin"&&(G.argument=H.current()),G.styleIdentifier())}function T(H,I,G){if(H.eatSpace())return null;if(G&&H.match(G))return A(I,R),"keyword";if(H.match(/^\\[a-zA-Z@]+/))return"tag";if(H.match(/^[a-zA-Z]+/))return"variable-2";if(H.match(/^\\[$&%#{}_]/))return"tag";if(H.match(/^\\[,;!\/]/))return"tag";if(H.match(/^[\^_&]/))return"tag";if(H.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(H.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var X=H.next();return X=="{"||X=="}"||X=="["||X=="]"||X=="("||X==")"?"bracket":X=="%"?(H.skipToEnd(),"comment"):"error"}function Q(H,I){var G=H.peek(),X;return G=="{"||G=="["?(X=se(I),X.openBracket(G),H.eat(G),A(I,R),"bracket"):/[ \t\r]/.test(G)?(H.eat(G),null):(A(I,R),V(I),R(H,I))}return{startState:function(){var H=oe.inMathMode?function(I,G){return T(I,G)}:R;return{cmdState:[],f:H}},copyState:function(H){return{cmdState:H.cmdState.slice(),f:H.f}},token:function(H,I){return I.f(H,I)},blankLine:function(H){H.f=R,H.cmdState.length=0},lineComment:"%"}}),z.defineMIME("text/x-stex","stex"),z.defineMIME("text/x-latex","stex")})},"19Vz":function(nt,Ge,v){(function(z){z(v("VrN/"))})(function(z){z.defineOption("placeholder","",function(L,P,A){var R=A&&A!=z.Init;if(P&&!R)L.on("blur",se),L.on("change",V),L.on("swapDoc",V),z.on(L.getInputField(),"compositionupdate",L.state.placeholderCompose=function(){xe(L)}),V(L);else if(!P&&R){L.off("blur",se),L.off("change",V),L.off("swapDoc",V),z.off(L.getInputField(),"compositionupdate",L.state.placeholderCompose),he(L);var T=L.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}P&&!L.hasFocus()&&se(L)});function he(L){L.state.placeholder&&(L.state.placeholder.parentNode.removeChild(L.state.placeholder),L.state.placeholder=null)}function oe(L){he(L);var P=L.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=L.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var A=L.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),P.appendChild(A),L.display.lineSpace.insertBefore(P,L.display.lineSpace.firstChild)}function xe(L){setTimeout(function(){var P=!1,A=L.getInputField();A.nodeName=="TEXTAREA"?P=!A.value:L.lineCount()==1&&(P=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),P?oe(L):he(L)},20)}function se(L){k(L)&&oe(L)}function V(L){var P=L.getWrapperElement(),A=k(L);P.className=P.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?oe(L):he(L)}function k(L){return L.lineCount()===1&&L.getLine(0)===""}})},"1ZF9":function(nt,Ge,v){nt.exports=v.p+"static/Authorize.cc9c212f.png"},"1eCo":function(nt,Ge,v){(function(z){z(v("VrN/"))})(function(z){"use strict";var he={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},oe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};z.defineMode("xml",function(xe,se){var V=xe.indentUnit,k={},L=se.htmlMode?he:oe;for(var P in L)k[P]=L[P];for(var P in se)k[P]=se[P];var A,R;function T(O,ue){function J(N){return ue.tokenize=N,N(O,ue)}var x=O.next();if(x=="<")return O.eat("!")?O.eat("[")?O.match("CDATA[")?J(I("atom","]]>")):null:O.match("--")?J(I("comment","-->")):O.match("DOCTYPE",!0,!0)?(O.eatWhile(/[\w\._\-]/),J(G(1))):null:O.eat("?")?(O.eatWhile(/[\w\._\-]/),ue.tokenize=I("meta","?>"),"meta"):(A=O.eat("/")?"closeTag":"openTag",ue.tokenize=Q,"tag bracket");if(x=="&"){var j;return O.eat("#")?O.eat("x")?j=O.eatWhile(/[a-fA-F\d]/)&&O.eat(";"):j=O.eatWhile(/[\d]/)&&O.eat(";"):j=O.eatWhile(/[\w\.\-:]/)&&O.eat(";"),j?"atom":"error"}else return O.eatWhile(/[^&<]/),null}T.isInText=!0;function Q(O,ue){var J=O.next();if(J==">"||J=="/"&&O.eat(">"))return ue.tokenize=T,A=J==">"?"endTag":"selfcloseTag","tag bracket";if(J=="=")return A="equals",null;if(J=="<"){ue.tokenize=T,ue.state=De,ue.tagName=ue.tagStart=null;var x=ue.tokenize(O,ue);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(J)?(ue.tokenize=H(J),ue.stringStartCol=O.column(),ue.tokenize(O,ue)):(O.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function H(O){var ue=function(J,x){for(;!J.eol();)if(J.next()==O){x.tokenize=Q;break}return"string"};return ue.isInAttribute=!0,ue}function I(O,ue){return function(J,x){for(;!J.eol();){if(J.match(ue)){x.tokenize=T;break}J.next()}return O}}function G(O){return function(ue,J){for(var x;(x=ue.next())!=null;){if(x=="<")return J.tokenize=G(O+1),J.tokenize(ue,J);if(x==">")if(O==1){J.tokenize=T;break}else return J.tokenize=G(O-1),J.tokenize(ue,J)}return"meta"}}function X(O,ue,J){this.prev=O.context,this.tagName=ue,this.indent=O.indented,this.startOfLine=J,(k.doNotIndent.hasOwnProperty(ue)||O.context&&O.context.noIndent)&&(this.noIndent=!0)}function Y(O){O.context&&(O.context=O.context.prev)}function ce(O,ue){for(var J;;){if(!O.context)return;if(J=O.context.tagName,!k.contextGrabbers.hasOwnProperty(J)||!k.contextGrabbers[J].hasOwnProperty(ue))return;Y(O)}}function De(O,ue,J){return O=="openTag"?(J.tagStart=ue.column(),Je):O=="closeTag"?_e:De}function Je(O,ue,J){return O=="word"?(J.tagName=ue.current(),R="tag",we):k.allowMissingTagName&&O=="endTag"?(R="tag bracket",we(O,ue,J)):(R="error",Je)}function _e(O,ue,J){if(O=="word"){var x=ue.current();return J.context&&J.context.tagName!=x&&k.implicitlyClosed.hasOwnProperty(J.context.tagName)&&Y(J),J.context&&J.context.tagName==x||k.matchClosing===!1?(R="tag",Te):(R="tag error",Fe)}else return k.allowMissingTagName&&O=="endTag"?(R="tag bracket",Te(O,ue,J)):(R="error",Fe)}function Te(O,ue,J){return O!="endTag"?(R="error",Te):(Y(J),De)}function Fe(O,ue,J){return R="error",Te(O,ue,J)}function we(O,ue,J){if(O=="word")return R="attribute",Se;if(O=="endTag"||O=="selfcloseTag"){var x=J.tagName,j=J.tagStart;return J.tagName=J.tagStart=null,O=="selfcloseTag"||k.autoSelfClosers.hasOwnProperty(x)?ce(J,x):(ce(J,x),J.context=new X(J,x,j==J.indented)),De}return R="error",we}function Se(O,ue,J){return O=="equals"?Pe:(k.allowMissing||(R="error"),we(O,ue,J))}function Pe(O,ue,J){return O=="string"?be:O=="word"&&k.allowUnquoted?(R="string",we):(R="error",we(O,ue,J))}function be(O,ue,J){return O=="string"?be:we(O,ue,J)}return{startState:function(O){var ue={tokenize:T,state:De,indented:O||0,tagName:null,tagStart:null,context:null};return O!=null&&(ue.baseIndent=O),ue},token:function(O,ue){if(!ue.tagName&&O.sol()&&(ue.indented=O.indentation()),O.eatSpace())return null;A=null;var J=ue.tokenize(O,ue);return(J||A)&&J!="comment"&&(R=null,ue.state=ue.state(A||J,O,ue),R&&(J=R=="error"?J+" error":R)),J},indent:function(O,ue,J){var x=O.context;if(O.tokenize.isInAttribute)return O.tagStart==O.indented?O.stringStartCol+1:O.indented+V;if(x&&x.noIndent)return z.Pass;if(O.tokenize!=Q&&O.tokenize!=T)return J?J.match(/^(\s*)/)[0].length:0;if(O.tagName)return k.multilineTagIndentPastTag!==!1?O.tagStart+O.tagName.length+2:O.tagStart+V*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/<!\[CDATA\[/.test(ue))return 0;var j=ue&&/^<(\/)?([\w_:\.-]*)/.exec(ue);if(j&&j[1])for(;x;)if(x.tagName==j[2]){x=x.prev;break}else if(k.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(j)for(;x;){var N=k.contextGrabbers[x.tagName];if(N&&N.hasOwnProperty(j[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+V:O.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(O){O.state==Pe&&(O.state=we)},xmlCurrentTag:function(O){return O.tagName?{name:O.tagName,close:O.type=="closeTag"}:null},xmlCurrentContext:function(O){for(var ue=[],J=O.context;J;J=J.prev)J.tagName&&ue.push(J.tagName);return ue.reverse()}}}),z.defineMIME("text/xml","xml"),z.defineMIME("application/xml","xml"),z.mimeModes.hasOwnProperty("text/html")||z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"3vs6":function(nt,Ge,v){"use strict";var z=v("+L6B"),he=v("2/Rp"),oe=v("5Dmo"),xe=v("3S7+"),se=v("k1fw"),V=v("miYZ"),k=v("tsqr"),L=v("9og8"),P=v("2qtc"),A=v("kLXV"),R=v("tJVT"),T=v("WmNS"),Q=v.n(T),H=v("q1tI"),I=v.n(H),G=v("ttuQ"),X=v.n(G),Y=v("ErOA"),ce=v("m3rI"),De=v("IE1O"),Je=v("xKgJ"),_e=v("NLgs"),Te=v("Ty5D"),Fe=v("9kvl"),we=function(Pe){var be=Pe.virtualSpaces,O=Pe.user,ue=Pe.dispatch,J=Object(H.useState)(!1),x=Object(R.a)(J,2),j=x[0],N=x[1],w=Object(Te.i)(),S=be.virtualSpacesDetails;Object(H.useEffect)(function(){p()},[]);var p=function(){ue({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:w==null?void 0:w.virtual_spacesId}})},d=function(){if(!Object(_e.f)(ue))return;A.a.confirm({centered:!0,width:424,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u7533\u8BF7\u52A0\u5165",icon:null,className:"custom-modal-divider",content:I.a.createElement("div",{className:"font14"},"\u786E\u8BA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\u52A0\u5165\u8BE5\u865A\u62DF\u793E\u533A\u5417\uFF1F"),onOk:function(){var pe=Object(L.a)(Q.a.mark(function ie(){var le;return Q.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,Object(Y.a)("/api/virtual_classrooms/".concat(w==null?void 0:w.virtual_spacesId,"/apply_become_member.json"),{method:"post"});case 2:le=U.sent,(le==null?void 0:le.status)!==-1&&(k.b.success(le==null?void 0:le.message),p());case 4:case"end":return U.stop()}},ie)}));function fe(){return pe.apply(this,arguments)}return fe}()})},_=function(){A.a.confirm({centered:!0,width:424,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u7533\u8BF7\u516C\u5F00",icon:null,className:"custom-modal-divider",content:I.a.createElement("div",{className:"font14"},I.a.createElement("p",null,"\u786E\u8BA4\u5411\u5E73\u53F0\u7533\u8BF7\u516C\u5F00\u865A\u62DF\u793E\u533A\u5417\uFF1F"),I.a.createElement("p",null,"\u516C\u5F00\u865A\u62DF\u793E\u533A\u9700\u7ECF\u8FC7\u5E73\u53F0\u6807\u51C6\u5316\u5BA1\u6838\uFF0C\u5BA1\u6838\u5468\u671F\u4E3A1-2\u5929\uFF0C"),I.a.createElement("div",null,"\u516C\u5F00\u7684\u865A\u62DF\u793E\u533A\u5C06\u5BF9\u5E73\u53F0\u6240\u6709\u4EBA\u53EF\u89C1\u3002")),onOk:function(){var pe=Object(L.a)(Q.a.mark(function ie(){var le;return Q.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,Object(Y.a)("/api/virtual_classrooms/".concat(w==null?void 0:w.virtual_spacesId,"/apply_public.json"),{method:"post"});case 2:le=U.sent,(le==null?void 0:le.status)!==-1&&(k.b.success(le==null?void 0:le.message),p());case 4:case"end":return U.stop()}},ie)}));function fe(){return pe.apply(this,arguments)}return fe}()})},F=function(){var Le=Object(L.a)(Q.a.mark(function pe(fe){var ie;return Q.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(Y.a)("/api/virtual_classrooms/".concat(w==null?void 0:w.virtual_spacesId,".json"),{method:"put",body:fe});case 2:ie=ee.sent,(ie==null?void 0:ie.status)===0&&(p(),N(!1));case 4:case"end":return ee.stop()}},pe)}));return function(fe){return Le.apply(this,arguments)}}(),te=function(){var Le=Object(L.a)(Q.a.mark(function pe(fe){return Q.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:N(Object(se.a)({},S));case 1:case"end":return le.stop()}},pe)}));return function(fe){return Le.apply(this,arguments)}}(),Ce=(S==null?void 0:S.is_member)||Object(Je.v)();return I.a.createElement("div",{className:X.a.bg,style:{background:"url('".concat(ce.a.IMG_SERVER+(S==null?void 0:S.backbground_image_url),"') no-repeat center center")}},I.a.createElement("aside",null,I.a.createElement("div",null,I.a.createElement("div",{className:X.a.member},I.a.createElement("div",null,I.a.createElement(xe.a,{title:"\u6210\u5458\u603B\u6570"},I.a.createElement("i",{style:{color:"#FF8B58",fontSize:24},className:"iconfont icon-a-chengyuan1"})),I.a.createElement(xe.a,{title:"\u6210\u5458\u603B\u6570"},I.a.createElement("span",null,S==null?void 0:S.members_count))),I.a.createElement("div",null,I.a.createElement(xe.a,{title:"\u8D44\u6E90\u603B\u6570"},I.a.createElement("i",{style:{color:"#07C160",marginLeft:100},className:"iconfont icon-a-ziyuanku1"})),I.a.createElement(xe.a,{title:"\u8D44\u6E90\u603B\u6570"},I.a.createElement("span",null,S==null?void 0:S.resources_count)))),Ce&&I.a.createElement(he.a,{disabled:(S==null?void 0:S.status)!==2,onClick:_,type:"primary"},I.a.createElement("i",{className:"iconfont icon-sheweigongkai2 mr5 font14"}),(S==null?void 0:S.status)===2?"\u7533\u8BF7\u516C\u5F00":(S==null?void 0:S.status)===0?"\u7533\u8BF7\u4E2D":"\u5DF2\u516C\u5F00"),!Ce&&I.a.createElement(he.a,{onClick:d,type:"primary"},I.a.createElement("i",{className:"iconfont icon-shenqingjiaru2 mr5 font14"}),"\u7533\u8BF7\u52A0\u5165"))),I.a.createElement(De.b,{visible:j,title:"\u7F16\u8F91\u865A\u62DF\u793E\u533A",onCancel:function(){return N(!1)},onOk:F}))};Ge.a=Object(Fe.a)(function(Se){var Pe=Se.virtualSpaces,be=Se.user;return{virtualSpaces:Pe,user:be}})(we)},"500L":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return _e});var z=v("+L6B"),he=v("2/Rp"),oe=v("2qtc"),xe=v("kLXV"),se=v("9og8"),V=v("k1fw"),k=v("miYZ"),L=v("tsqr"),P=v("oBTY"),A=v("tJVT"),R=v("DZo9"),T=v("8z0m"),Q=v("WmNS"),H=v.n(Q),I=v("q1tI"),G=v.n(I),X=v("m3rI"),Y=v("wzkS"),ce=v("y5JW"),De=v("LtfV"),Je=T.a.Dragger;function _e(Te){var Fe=[];return Te&&Te.length>0&&(Fe=Te.map(function(we){return{uid:we.id,id:we.id,name:we.title+ce.c+we.filesize,url:we.url,filesize:we.filesize,status:"done",response:{id:we.id}}})),Fe}Ge.b=function(Te){var Fe=Te.value,we=Te.onChange,Se=Te.action,Pe=Te.className,be=Te.maxSize,O=be===void 0?150:be,ue=Te.title,J=ue===void 0?"\u4E0A\u4F20\u9644\u4EF6":ue,x=Te.showRemoveModal,j=x===void 0?!1:x,N=Te.accept,w=N===void 0?"":N,S=Te.additionalText,p=Te.isDragger,d=Te.number,_=d===void 0?1e3:d,F=Te.aloneClear,te=F===void 0?!1:F,Ce=Te.restrict,Le=Ce===void 0?!0:Ce,pe=Object(I.useState)(!1),fe=Object(A.a)(pe,2),ie=fe[0],le=fe[1],ee=Object(I.useState)(Fe||[]),U=Object(A.a)(ee,2),b=U[0],K=U[1];Object(I.useEffect)(function(){Fe&&(K(Object(P.a)(Fe)),_===(Fe==null?void 0:Fe.length)&&le(!0))},[Fe]);var M=function(){setTimeout(function(){b.pop(),K(Object(P.a)(b))},500)},ve={multiple:!0,disabled:ie,accept:w,withCredentials:!0,fileList:b,beforeUpload:function(Ae,je){var Ne=Ae.size/1024/1024;return b.concat(je).length>_?(b.pop(),K(Object(P.a)(b)),L.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(_,"\u4E2A\u6587\u4EF6")),te?Promise.reject():(M(),!1)):Ne<O?!0:(L.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(O,"MB).")),te?Promise.reject():(M(),!1))},action:Se||"".concat(X.a.API_SERVER,"/api/attachments.json"),onChange:function(Ae){var je=Object(P.a)(Ae.fileList);je.length>=_?le(!0):le(!1),K(Object(P.a)(je)),je=je.map(function(Ne){var ke;if(Ne!=null&&(ke=Ne.response)!==null&&ke!==void 0&&ke.id){var Me;Ne.url="/api/attachments/".concat(Ne==null||((Me=Ne.response)===null||Me===void 0)?void 0:Me.id)}return Ne.name.indexOf(ce.c)===-1&&(Ne.name="".concat(Ne.name).concat(ce.c).concat(Object(ce.a)(Ne.size))),Object(V.a)({},Ne)}),console.log("info:",Ae),we(je)},onRemove:function(){var re=Object(se.a)(H.a.mark(function je(Ne){var ke;return H.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(ke=function(){var et=Object(se.a)(H.a.mark(function Ve(){var Ze,Qe;return H.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(Ze=Ne.response?Ne.response.id:Ne.id,!Ze){tt.next=8;break}return tt.next=4,Object(Y.d)(Ne.response?Ne.response.id:Ne.uid);case 4:return Qe=tt.sent,tt.abrupt("return",Qe);case 8:return tt.abrupt("return",!0);case 9:case"end":return tt.stop()}},Ve)}));return function(){return et.apply(this,arguments)}}(),!j){Ue.next=5;break}return Ue.abrupt("return",new Promise(function(et,Ve){xe.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:G.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Ze=Object(se.a)(H.a.mark(function at(){var tt;return H.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return Re.next=2,ke();case 2:tt=Re.sent,L.b.success("\u5220\u9664\u6210\u529F"),et(!0);case 5:case"end":return Re.stop()}},at)}));function Qe(){return Ze.apply(this,arguments)}return Qe}(),onCancel:function(){return et(!1)}})}));case 5:return Ue.next=7,ke();case 7:return Ue.abrupt("return",Ue.sent);case 8:case"end":return Ue.stop()}},je)}));function Ae(je){return re.apply(this,arguments)}return Ae}()};function Ee(re){re.preventDefault(),re.stopPropagation()}return G.a.createElement("div",{className:"multi-upload ".concat(Pe||"")},p&&G.a.createElement(Je,ve,G.a.createElement("p",{className:"ant-upload-drag-icon"},G.a.createElement(De.a,null)),G.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",G.a.createElement("br",null),G.a.createElement("span",{style:{display:Le?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",O,"MB) ")),S),!p&&G.a.createElement(T.a,ve,G.a.createElement(he.a,{disabled:ie},J),G.a.createElement("span",{onClick:Ee,style:{marginLeft:10,color:"#FA6400",display:Le?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",O,"MB) ")))}},"7Cbv":function(nt,Ge,v){"use strict";var z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),he=new Uint8Array(16);function oe(){if(!z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(he)}var xe=/^(?:[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 se(Q){return typeof Q=="string"&&xe.test(Q)}for(var V=se,k=[],L=0;L<256;++L)k.push((L+256).toString(16).substr(1));function P(Q){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=(k[Q[H+0]]+k[Q[H+1]]+k[Q[H+2]]+k[Q[H+3]]+"-"+k[Q[H+4]]+k[Q[H+5]]+"-"+k[Q[H+6]]+k[Q[H+7]]+"-"+k[Q[H+8]]+k[Q[H+9]]+"-"+k[Q[H+10]]+k[Q[H+11]]+k[Q[H+12]]+k[Q[H+13]]+k[Q[H+14]]+k[Q[H+15]]).toLowerCase();if(!V(I))throw TypeError("Stringified UUID is invalid");return I}var A=P;function R(Q,H,I){Q=Q||{};var G=Q.random||(Q.rng||oe)();if(G[6]=G[6]&15|64,G[8]=G[8]&63|128,H){I=I||0;for(var X=0;X<16;++X)H[I+X]=G[X];return H}return A(G)}var T=Ge.a=R},"7ahc":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return Je});var z=v("k1fw"),he=v("0Owb"),oe=v("+L6B"),xe=v("2/Rp"),se=v("y8nQ"),V=v("Vl3Y"),k=v("tJVT"),L=v("OaEy"),P=v("2fM7"),A=v("q1tI"),R=v.n(A),T=v("VrN/"),Q=v.n(T),H=v("p77/"),I=v.n(H),G=v("c5Ni"),X=v.n(G),Y=P.a.Option,ce={labelCol:{span:4},wrapperCol:{span:20}},De={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"]};Ge.b=function(_e){var Te=_e.callback,Fe=_e.onCancel,we=Object(A.useState)("python"),Se=Object(k.a)(we,2),Pe=Se[0],be=Se[1];function O(J){be(De[J][1])}function ue(J){Te(J)}return R.a.createElement(V.a,Object(he.a)({},ce,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ue}),R.a.createElement(V.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},R.a.createElement(P.a,{onChange:O},Object.keys(De).map(function(J){return R.a.createElement(Y,{key:J,value:J},De[J][0])}))),R.a.createElement(V.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},R.a.createElement(Je,{mode:Pe})),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(xe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(xe.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function Je(_e){var Te=_e.value,Fe=_e.onChange,we=_e.mode,Se=_e.options,Pe=Se===void 0?{}:Se,be=Object(A.useRef)(),O=Object(A.useState)(),ue=Object(k.a)(O,2),J=ue[0],x=ue[1];return Object(A.useEffect)(function(){if(J){function j(N){var w=N.getValue();Fe&&Fe(w)}return J.on("change",j),function(){J.off("change",j)}}},[J,Fe]),Object(A.useEffect)(function(){J&&J.setOption("mode",we)},[J,we]),Object(A.useEffect)(function(){J&&((Te!==J.getValue()||Te==="")&&setTimeout(function(){J.setValue(Te||" ")},300))},[J,Te]),Object(A.useEffect)(function(){if(be.current&&!J){var j=Q.a.fromTextArea(be.current,Object(z.a)({mode:we,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Pe));x(j)}},[be.current,J]),R.a.createElement("div",{className:"my-codemirror-container"},R.a.createElement("textarea",{ref:be}))}},"7ixt":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return oe});var z={adjustX:1,adjustY:1},he=[0,0],oe={left:{points:["cr","cl"],overflow:z,offset:[-4,0],targetOffset:he},right:{points:["cl","cr"],overflow:z,offset:[4,0],targetOffset:he},top:{points:["bc","tc"],overflow:z,offset:[0,-4],targetOffset:he},bottom:{points:["tc","bc"],overflow:z,offset:[0,4],targetOffset:he},topLeft:{points:["bl","tl"],overflow:z,offset:[0,-4],targetOffset:he},leftTop:{points:["tr","tl"],overflow:z,offset:[-4,0],targetOffset:he},topRight:{points:["br","tr"],overflow:z,offset:[0,-4],targetOffset:he},rightTop:{points:["tl","tr"],overflow:z,offset:[4,0],targetOffset:he},bottomRight:{points:["tr","br"],overflow:z,offset:[0,4],targetOffset:he},rightBottom:{points:["bl","br"],overflow:z,offset:[4,0],targetOffset:he},bottomLeft:{points:["tl","bl"],overflow:z,offset:[0,4],targetOffset:he},leftBottom:{points:["br","bl"],overflow:z,offset:[-4,0],targetOffset:he}},xe=oe},"8EBN":function(nt,Ge,v){(function(z){z(v("VrN/"))})(function(z){"use strict";z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var he=0;he<z.modeInfo.length;he++){var oe=z.modeInfo[he];oe.mimes&&(oe.mime=oe.mimes[0])}z.findModeByMIME=function(xe){xe=xe.toLowerCase();for(var se=0;se<z.modeInfo.length;se++){var V=z.modeInfo[se];if(V.mime==xe)return V;if(V.mimes){for(var k=0;k<V.mimes.length;k++)if(V.mimes[k]==xe)return V}}if(/\+xml$/.test(xe))return z.findModeByMIME("application/xml");if(/\+json$/.test(xe))return z.findModeByMIME("application/json")},z.findModeByExtension=function(xe){xe=xe.toLowerCase();for(var se=0;se<z.modeInfo.length;se++){var V=z.modeInfo[se];if(V.ext){for(var k=0;k<V.ext.length;k++)if(V.ext[k]==xe)return V}}},z.findModeByFileName=function(xe){for(var se=0;se<z.modeInfo.length;se++){var V=z.modeInfo[se];if(V.file&&V.file.test(xe))return V}var k=xe.lastIndexOf("."),L=k>-1&&xe.substring(k+1,xe.length);if(L)return z.findModeByExtension(L)},z.findModeByName=function(xe){xe=xe.toLowerCase();for(var se=0;se<z.modeInfo.length;se++){var V=z.modeInfo[se];if(V.name.toLowerCase()==xe)return V;if(V.alias){for(var k=0;k<V.alias.length;k++)if(V.alias[k].toLowerCase()==xe)return V}}}})},"8hTe":function(nt,Ge,v){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,Ge,v){"use strict";var z=v("DYRE"),he=v("zeV3"),oe=v("+L6B"),xe=v("2/Rp"),se=v("k1fw"),V=v("9og8"),k=v("tJVT"),L=v("WmNS"),P=v.n(L),A=v("q1tI"),R=v.n(A),T=v("vg9a"),Q=v("DlQD"),H=v.n(Q),I=v("rUJ1");function G(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(g){var h=g.match(/^\s+/);if(h===null)return g;var Z=Object(k.a)(h,1),We=Z[0];return We.length>=u.length?g.slice(u.length):g}).join(`
`)}var X=[],Y=["<ul>"],ce=new H.a.Renderer,De=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Je(){X.length=0,Y=["<ul>"]}var _e={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Te(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var g=c[o];u.push("<li><a href='#"+g.anchor+"'>"+g.text+"</a>"),o++;var h=[];return o=Te(c,o,g.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(Z){u.push(Z)}),u.push("</ul>")),u.push("</li>"),o=Te(c,o,a,u),o}function Fe(){return Te(X,0,0,Y),Y.push("</ul>"),Y.join("")}var we={heading:function(o){var a=De.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],g=G(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var Z=be(),We=g;g=Z,O[Z]={type:"block",expression:We}}return{type:"code",raw:u,lang:h,text:g}}}},Se=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Pe=0,be=function(){return"__special_katext_id_".concat(Pe++,"__")},O={};function ue(){return O}function J(){Pe=0,O={}}function x(c){return c=c.replace(Se,function(o,a){var u=be();return O[u]={type:"inline",expression:a},u}),c}var j=ce.listitem;ce.listitem=function(c){return j(x(c))};var N=ce.paragraph;ce.paragraph=function(c){return N(x(c))};var w=ce.tablecell;ce.tablecell=function(c,o){return w(x(c),o)},ce.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(c,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?c:Object(I.escape)(c,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(I.escape)(c,!0))+"</code></pre>"},ce.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return X.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},H.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),H.a.use({tokenizer:we,renderer:ce});var S=H.a,p=v("SJMd"),d=v("ulZh"),_=v.n(d),F=v("m3rI"),te=v("Oy/b"),Ce=v("p5ED"),Le=v("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 pe=function(c,o){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(c,o)};function fe(c,o){function a(){this.constructor=c}pe(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ie(c,o,a,u){return new(a||(a=Promise))(function(g,h){function Z(ct){try{ye(u.next(ct))}catch(He){h(He)}}function We(ct){try{ye(u.throw(ct))}catch(He){h(He)}}function ye(ct){var He;ct.done?g(ct.value):(He=ct.value,He instanceof a?He:new a(function(wt){wt(He)})).then(Z,We)}ye((u=u.apply(c,o||[])).next())})}function le(c,o){var a,u,g,h,Z={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function We(ye){return function(ct){return function(He){if(a)throw new TypeError("Generator is already executing.");for(;Z;)try{if(a=1,u&&(g=2&He[0]?u.return:He[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,He[1])).done)return g;switch(u=0,g&&(He=[2&He[0],g.value]),He[0]){case 0:case 1:g=He;break;case 4:return Z.label++,{value:He[1],done:!1};case 5:Z.label++,u=He[1],He=[0];continue;case 7:He=Z.ops.pop(),Z.trys.pop();continue;default:if(!(g=Z.trys,(g=g.length>0&&g[g.length-1])||He[0]!==6&&He[0]!==2)){Z=0;continue}if(He[0]===3&&(!g||He[1]>g[0]&&He[1]<g[3])){Z.label=He[1];break}if(He[0]===6&&Z.label<g[1]){Z.label=g[1],g=He;break}if(g&&Z.label<g[2]){Z.label=g[2],Z.ops.push(He);break}g[2]&&Z.ops.pop(),Z.trys.pop();continue}He=o.call(c,Z)}catch(wt){He=[6,wt],u=0}finally{a=g=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([ye,ct])}}}function ee(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),g=0;for(o=0;o<a;o++)for(var h=arguments[o],Z=0,We=h.length;Z<We;Z++,g++)u[g]=h[Z];return u}var U=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,g=a;u<g.length;u++){var h=g[u],Z=h[0],We=h[1];o.setAttribute(Z,We)}},c.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&c.setAttributes(g,u),g},c.createLine=function(o,a,u,g,h){var Z=document.createElementNS("http://www.w3.org/2000/svg","line");return Z.setAttribute("x1",o.toString()),Z.setAttribute("y1",a.toString()),Z.setAttribute("x2",u.toString()),Z.setAttribute("y2",g.toString()),h&&c.setAttributes(Z,h),Z},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.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&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(g,u),g},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,g,h,Z,We){var ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(ye,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",h.toString()],["refY",Z.toString()]]),ye.appendChild(We),ye},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c}(),b=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),K=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var g=this;return new Promise(function(h){var Z=u!==void 0?u:document.createElement("canvas");o===null&&(g.markersOnly=!0,g.naturalSize=!1);var We=document.createElementNS("http://www.w3.org/2000/svg","svg");We.setAttribute("xmlns","http://www.w3.org/2000/svg"),We.setAttribute("width",a.width.baseVal.valueAsString),We.setAttribute("height",a.height.baseVal.valueAsString),We.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),We.innerHTML=a.innerHTML,g.naturalSize===!0?(We.width.baseVal.value=o.naturalWidth,We.height.baseVal.value=o.naturalHeight):g.width!==void 0&&g.height!==void 0&&(We.width.baseVal.value=g.width,We.height.baseVal.value=g.height),Z.width=We.width.baseVal.value,Z.height=We.height.baseVal.value;var ye=We.outerHTML,ct=Z.getContext("2d");g.markersOnly!==!0&&ct.drawImage(o,0,0,Z.width,Z.height);var He=window.URL,wt=new Image(Z.width,Z.height);wt.setAttribute("crossOrigin","anonymous");var Dt=new Blob([ye],{type:"image/svg+xml"}),Wt=He.createObjectURL(Dt);wt.onload=function(){ct.drawImage(wt,0,0),He.revokeObjectURL(Wt);var Fn=Z.toDataURL(g.imageType,g.imageQuality);h(Fn)},wt.src=Wt})},c}(),M=function(){},ve=function(){function c(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),c.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},c.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)},c.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 Ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new re("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new re("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),Ee=function(c,o){this.selector=c,this.style=o},re=function(c,o){this.localName=c,this.style=o},Ae=function(){function c(o,a,u,g,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=g,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return c.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(h){var Z=document.createElement("div");Z.className=""+a.toolbarButtonStyleClass.name,Z.setAttribute("data-type-name",h.typeName),Z.innerHTML=h.icon,Z.addEventListener("click",function(){a.markerToolbarButtonClicked(Z,h)}),a.buttons.push(Z),a.markerButtons.push(Z)}),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 g=document.createElement("div");g.className=this.toolbarBlockStyleClass.name,g.style.whiteSpace="nowrap",g.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(g),this.addActionButton(g,'<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(g,'<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()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.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]))}},c.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")},c.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)})},c.prototype.addActionButton=function(o,a,u){var g=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){g.actionToolbarButtonClicked(h,u)}),u){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new re("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 re("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new re("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new re("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 re("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new re("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 re("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ee("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ee("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},c.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"},c.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])},c.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)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.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")})},c}(),je=function(){function c(o,a,u,g){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=g,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new re("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 re("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new re("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new re("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new re("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 re("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new re("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 re("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},c.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)},c.prototype.setPanelButtons=function(o){var a,u,g=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(h){var Z;h.uiStyleSettings=g.uiStyleSettings;var We=document.createElement("div");We.className=g.toolboxButtonStyleClass.name+" "+((Z=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Z!==void 0?Z:g.toolboxButtonStyleColorsClass.name),We.innerHTML=h.icon,We.title=h.title,We.addEventListener("click",function(){g.panelButtonClick(h)}),g.panelButtons.push(We),g.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var g=o.getUi();g.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(g),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(h,Z){var We,ye;h.className=a.toolboxButtonStyleClass.name+" "+(Z===u?""+((We=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:a.toolboxActiveButtonStyleColorsClass.name):""+((ye=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:a.toolboxButtonStyleColorsClass.name))})},c}(),Ne=function(c,o){this.title=c,this.icon=o},ke=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<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 Z.colors=[],Z.addTransparent=!1,Z.colorBoxes=[],Z.colors=u,Z.currentColor=g,Z.setCurrentColor=Z.setCurrentColor.bind(Z),Z.getColorBox=Z.getColorBox.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(g){var h=a.getColorBox(g);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,g=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-g,Z=document.createElement("div");Z.style.display="inline-block",Z.style.boxSizing="content-box",Z.style.width=h-2+"px",Z.style.height=h-2+"px",Z.style.padding="1px",Z.style.marginRight="2px",Z.style.marginBottom="2px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderRadius=(h+2)/2+"px",Z.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){u.setCurrentColor(a,Z)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=h-2+"px",We.style.height=h-2+"px",We.style.backgroundColor=a,We.style.borderRadius=h/2+"px",a==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Z.appendChild(We),Z},o.prototype.setCurrentColor=function(a,u){var g=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ne),Me=function(){function c(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(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.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)}},c.typeName="MarkerBase",c}(),Ue=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.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},c}(),et=function(){function c(){this.GRIP_SIZE=10,this.visual=U.createGroup(),this.visual.appendChild(U.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(U.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),Ve=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.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},c}(),Ze=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(U.createTransform()),h.setupControlBox(),h}return fe(o,c),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=U.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.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){c.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 g=this.unrotatePoint(a);if(this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.offsetX=g.x-this.left,this.offsetY=g.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 h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Z=this.container.transform.baseVal.getItem(0);Z.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Z,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.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,g=this.manipulationStartWidth,h=this.manipulationStartTop,Z=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,g=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:g=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,Z=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Z=this.manipulationStartHeight+a.y-this.manipulationStartY}g>=0?(this.left=u,this.width=g):(this.left=u+g,this.width=-g),Z>=0?(this.top=h,this.height=Z):(this.top=h+Z,this.height=-Z),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(),g=U.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var g=U.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=U.createGroup();var a=U.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=U.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=U.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 Ue,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 et;return a.visual.transform.baseVal.appendItem(U.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,g=u,h=(this.width+this.CB_DISTANCE)/2-a/2,Z=(this.height+this.CB_DISTANCE)/2-a/2,We=this.height+this.CB_DISTANCE-a/2,ye=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,g),this.positionGrip(this.controlGrips.topCenter.visual,h,g),this.positionGrip(this.controlGrips.topRight.visual,ye,g),this.positionGrip(this.controlGrips.centerLeft.visual,u,Z),this.positionGrip(this.controlGrips.centerRight.visual,ye,Z),this.positionGrip(this.controlGrips.bottomLeft.visual,u,We),this.positionGrip(this.controlGrips.bottomCenter.visual,h,We),this.positionGrip(this.controlGrips.bottomRight.visual,ye,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,g-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),a.transform.baseVal.replaceItem(h,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:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.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(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var g=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:g.x*a,y:g.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Me),Qe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=U.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){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),U.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&U.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&U.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&U.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&U.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},c.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(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(Ze),at=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Z.widths=[],Z.widthBoxes=[],Z.widths=u,Z.currentWidth=g,Z.setCurrentWidth=Z.setCurrentWidth.bind(Z),Z}return fe(o,c),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(g){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=g===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.innerText=g.toString(),Z.style.marginRight="5px",h.appendChild(Z);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var ye=document.createElement("hr");ye.style.minWidth="20px",ye.style.border="0px",ye.style.borderTop=g+"px solid "+a.uiStyleSettings.toolboxColor,ye.style.flexGrow="2",We.appendChild(ye),h.appendChild(We),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var g=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ne),tt=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<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 Z.styles=[],Z.styleBoxes=[],Z.styles=u,Z.currentStyle=g,Z.setCurrentStyle=Z.setCurrentStyle.bind(Z),Z}return fe(o,c),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(g){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=g===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.style.minHeight="20px",Z.style.flexGrow="2",Z.style.overflow="hidden";var We=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(g!==""?'stroke-dasharray="'+g+'"':"")+` />
</svg>`;Z.innerHTML=We,h.appendChild(Z),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var g=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ne),st=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new ke("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return fe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.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}(Qe),Re=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},vt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return fe(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.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;c.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(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=U.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 et;return a.visual.transform.baseVal.appendItem(U.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,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.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){c.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}(Me),ut=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new ke("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=U.createGroup(),this.selectorLine=U.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=U.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){c.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()),U.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),U.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),U.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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(vt),Be=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<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 Z.fonts=[],Z.fontBoxes=[],Z.fonts=u,Z.currentFont=g,Z.setCurrentFont=Z.setCurrentFont.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(g){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=g===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.style.display="flex",Z.style.minHeight="20px",Z.style.flexGrow="2",Z.style.fontFamily=g,Z.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",Z.appendChild(We),h.appendChild(Z),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var g=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ne),$e=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=g.defaultColor,h.fontFamily=g.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new ke("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Be("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return fe(o,c),o.prototype.ownsTarget=function(a){if(c.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(g){g===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=U.createGroup(),this.bgRectangle=U.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=U.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(U.createTransform()),this.textElement.transform.baseVal.appendItem(U.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.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(U.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 g=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(g,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),g=0,h=0;return u.width>0&&u.height>0&&(g=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:g,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),g=this.getTextPosition(u);g.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+g.x+"px, "+g.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(g.x,g.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.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){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(U.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),U.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),c.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 g=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(g)),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}),g=this.textElement.getBBox(),h={x:g.width*a,y:g.height*a};u.x-=h.x/2,u.y-=h.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(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&U.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&&U.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},c.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(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.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}(Ze),ae=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=g.defaultColor,h.lineWidth=g.defaultStrokeWidth,h.pixelRatio=g.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new ke("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=U.createGroup(),this.drawingImage=U.createImage(),this.visual.appendChild(this.drawingImage);var a=U.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):c.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()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),U.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),U.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()):c.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(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.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],g=u[0],h=u[1],Z=u[2],We=u[3],ye=!1,ct=0;ct<this.canvasElement.height;ct++)for(var He=0;He<this.canvasElement.width;He++)a.data[ct*this.canvasElement.width*4+4*He+3]>0&&(ye=!0,ct<h&&(h=ct),He<g&&(g=He),ct>We&&(We=ct),He>Z&&(Z=He));if(ye){this.left=g/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(Z-g)/this.pixelRatio,this.height=(We-h)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=Z-g,wt.height=We-h,wt.getContext("2d").putImageData(this.canvasContext.getImageData(g,h,Z-g,We-h),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){U.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),U.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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.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}(Ze),q=function(c){function o(a,u,g){var h=c.call(this,a,g||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return fe(o,c),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 g=function(We){var ye="both";switch(We){case 0:ye="both";break;case 1:ye="start";break;case 2:ye="end";break;case 3:ye="none"}var ct=document.createElement("div");if(ct.style.display="flex",ct.style.flexGrow="2",ct.style.alignItems="center",ct.style.justifyContent="space-between",ct.style.padding="5px",ct.style.borderWidth="2px",ct.style.borderStyle="solid",ct.style.borderColor=ye===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ct.addEventListener("click",function(){a.setCurrentType(ye,ct)}),u.appendChild(ct),ye==="both"||ye==="start"){var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.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="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,He.style.marginLeft="5px",ct.appendChild(He)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var Dt=document.createElement("hr");if(Dt.style.minWidth="20px",Dt.style.border="0px",Dt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Dt.style.flexGrow="2",wt.appendChild(Dt),ct.appendChild(wt),ye==="both"||ye==="end"){var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.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="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Wt.style.marginRight="5px",ct.appendChild(Wt)}h.typeBoxes.push(ct)},h=this,Z=0;Z<4;Z++)g(Z);return u},o.prototype.setCurrentType=function(a,u){var g=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings!==void 0?g.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ne),ne=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new q("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var g=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-g/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+g/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=U.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(U.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=U.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(U.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.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",U.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),U.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 g=this.arrow2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(g,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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(ut),C=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor=g.defaultFillColor,h.strokeWidth=0,h.fillPanel=new ke("Color",g.defaultColorSet,g.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return fe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.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}(Qe),E=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<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 Z.opacities=[],Z.opacityBoxes=[],Z.opacities=u,Z.currentOpacity=g,Z.setCurrentOpacity=Z.setCurrentOpacity.bind(Z),Z}return fe(o,c),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(g){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=g===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.innerText=100*g+"%",h.appendChild(Z),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var g=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ne),D=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=g.defaultHighlightColor,h.strokeWidth=0,h.opacity=g.defaultHighlightOpacity,h.fillPanel=new ke("Color",g.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new E("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return fe(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&U.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=c.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}(C),B='<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>',ge=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=g.defaultStrokeColor,h.bgColor=g.defaultFillColor,h.fontFamily=g.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new ke("Text color",g.defaultColorSet,h.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>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new ke("Fill color",g.defaultColorSet,h.bgColor,B),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Be("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new et,h.tipGrip.visual.transform.baseVal.appendItem(U.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return fe(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){U.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=U.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.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):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.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 c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(U.setAttributes(this.bgRectangle,[["fill",a]]),U.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),g=this.height/5;a&&(this.tipPosition={x:u+g/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+g,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+g}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+g}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-g},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+g,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-g})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){U.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(),c.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},c.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,c.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){c.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}($e),Oe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.fillColor=g.defaultFillColor,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new ke("Line color",ee(g.defaultColorSet,["transparent"]),g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new ke("Fill color",ee(g.defaultColorSet,["transparent"]),h.fillColor,B),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new E("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=U.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){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),U.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){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&U.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&U.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&U.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&U.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&U.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},c.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(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.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}(Ze),Ye=function(c){function o(a,u,g){return c.call(this,a,u,g)||this}return fe(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=U.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(U.createTransform()),this.visual.appendChild(this.tip1),this.tip2=U.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(U.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(U.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()]]),U.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 g=this.tip2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(g,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=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(ut),yt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokePanel.colors=g.defaultColorSet,h.fillColor="transparent",h}return fe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.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),kt=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.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))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.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}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),Ke=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new ke("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.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=U.createGroup(),this.selectorCurve=U.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=U.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){c.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()),U.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),U.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),U.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=U.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=U.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,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.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),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.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,c.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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(vt),_t=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),mt=function(c){function o(a,u,g){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=g,h}return fe(o,c),o}(_t),ot=function(c){function o(a,u,g){g===void 0&&(g=!1);var h=c.call(this,a,g)||this;return h.marker=u,h}return fe(o,c),o}(_t),Pt=function(){function c(){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 c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),At=function(){function c(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 Re,this._isOpen=!1,this.undoRedoManager=new kt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Pt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new ve(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(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[st,ae,ne,$e,yt,Oe,D,ge,Ye,C,ut,Ke]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[st,ae,ne,$e,Oe,D,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[st,ae,ne,$e,D]},enumerable:!1,configurable:!0}),Object.defineProperty(c.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 g=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});g!==void 0&&a._availableMarkerTypes.push(g)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&M.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=M.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new _t(o))})},c.prototype.render=function(){return ie(this,void 0,void 0,function(){var o;return le(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new K).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()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(g){var h=new _t(a,!0);g(h),h.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(g){return g(new _t(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},c.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},c.prototype.removeRenderEventListener=function(o){},c.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},c.prototype.removeCloseEventListener=function(o){},c.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))},c.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)},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,g=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,g),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,g=this;this._currentMarker&&this._currentMarker instanceof $e?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==g._currentMarker&&h.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},c.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"},c.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},c.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)},c.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=U.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},c.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},c.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)},c.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},c.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},c.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)},c.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},c.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)},c.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()},c.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")},c.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"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ae(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},c.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.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())},c.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()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(g){var h=new ot(o,o._currentMarker,!0);g(h),h.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(g){return g(new ot(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Z){var We=new ot(o,void 0,!0);Z(We),We.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(Z){var We=g.markers[Z];g.setCurrentMarker(g.markers[Z]),g._currentMarker.dispose(),g.markerImage.removeChild(g._currentMarker.container),g.markers.splice(g.markers.indexOf(g._currentMarker),1),g.eventListeners.markerdelete.forEach(function(ye){return ye(new ot(o,We))})},g=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.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))},c.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)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.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 g=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),g<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new _t(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new _t(o))})}},c.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},c.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))}))},c.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},c.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))}))},c.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},c.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},c.prototype.startRenderAndClose=function(){return ie(this,void 0,void 0,function(){var o,a,u=this;return le(this,function(g){switch(g.label){case 0:return[4,this.render()];case 1:return o=g.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new mt(u,o,a))}),this.close(!0),[2]}})})},c.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},c.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 g=a._availableMarkerTypes.find(function(Z){return Z.typeName===u.typeName});if(g!==void 0){var h=a.addNewMarker(g);h.restoreState(u),a.markers.push(h)}}),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))})},c.prototype.addNewMarker=function(o){var a=U.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},c.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(g){return g.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(g){return g(new ot(u,u._currentMarker))}))},c.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new ot(a,a._currentMarker))})},c.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},c.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},c.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new ot(a,o))})},c.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 ot(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 ot(a,a._currentMarker))}))},c.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))},c.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()}},c.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}))},c.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()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.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()},c.prototype.addLicenseKey=function(o){b.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.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(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.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))}))},c.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))}))},c.instanceCounter=0,c}();/* **********************************
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 Vt=function(c,o){return(Vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(c,o)};function jt(c,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=c}Vt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function St(c,o,a,u){return new(a||(a=Promise))(function(g,h){function Z(ct){try{ye(u.next(ct))}catch(He){h(He)}}function We(ct){try{ye(u.throw(ct))}catch(He){h(He)}}function ye(ct){var He;ct.done?g(ct.value):(He=ct.value,He instanceof a?He:new a(function(wt){wt(He)})).then(Z,We)}ye((u=u.apply(c,o||[])).next())})}function bn(c,o){var a,u,g,h,Z={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function We(ye){return function(ct){return function(He){if(a)throw new TypeError("Generator is already executing.");for(;Z;)try{if(a=1,u&&(g=2&He[0]?u.return:He[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,He[1])).done)return g;switch(u=0,g&&(He=[2&He[0],g.value]),He[0]){case 0:case 1:g=He;break;case 4:return Z.label++,{value:He[1],done:!1};case 5:Z.label++,u=He[1],He=[0];continue;case 7:He=Z.ops.pop(),Z.trys.pop();continue;default:if(!(g=Z.trys,(g=g.length>0&&g[g.length-1])||He[0]!==6&&He[0]!==2)){Z=0;continue}if(He[0]===3&&(!g||He[1]>g[0]&&He[1]<g[3])){Z.label=He[1];break}if(He[0]===6&&Z.label<g[1]){Z.label=g[1],g=He;break}if(g&&Z.label<g[2]){Z.label=g[2],Z.ops.push(He);break}g[2]&&Z.ops.pop(),Z.trys.pop();continue}He=o.call(c,Z)}catch(wt){He=[6,wt],u=0}finally{a=g=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([ye,ct])}}}var rn=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),pt=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,g=a;u<g.length;u++){var h=g[u],Z=h[0],We=h[1];o.setAttribute(Z,We)}},c.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&c.setAttributes(g,u),g},c.createLine=function(o,a,u,g,h){var Z=document.createElementNS("http://www.w3.org/2000/svg","line");return Z.setAttribute("x1",o.toString()),Z.setAttribute("y1",a.toString()),Z.setAttribute("x2",u.toString()),Z.setAttribute("y2",g.toString()),h&&c.setAttributes(Z,h),Z},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.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&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(g,u),g},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,g,h,Z,We){var ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(ye,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",h.toString()],["refY",Z.toString()]]),ye.appendChild(We),ye},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&c.setAttributes(u,a),u},c.getHollowRectanglePath=function(o,a,u,g,h,Z,We,ye){return"M"+o+","+a+"V"+(a+g)+"H"+(o+u)+"V"+a+"H"+h+"V"+Z+"H"+(h+We)+"V"+(Z+ye)+"H"+h+"V"+a+"Z"},c}(),Vn=function(){function c(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),c.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},c.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)},c.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 xn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new xn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new pn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new pn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),xn=function(c,o){this.selector=c,this.style=o},pn=function(c,o){this.localName=c,this.style=o},Sn=function(){function c(){this.blocks=[],this.display=""}return c.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},c.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},c.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},c}(),li=function(){function c(){}return c.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},c}(),Kn=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return jt(o,c),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=c.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(li),Nt=function(){function c(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(c.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),c.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},c.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,"")))},c.prototype.hide=function(){this._isHidden=!0},c}(),dt=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return jt(o,c),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(li),Un=function(){function c(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(c.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),c.prototype.getVerticalLength=function(o){return o/this.ratio},c.prototype.getHorizontalLength=function(o){return o*this.ratio},c}(),ui=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Un(o,a),g=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),Z=document.createElementNS("http://www.w3.org/2000/svg","svg");Z.setAttribute("xmlns","http://www.w3.org/2000/svg"),Z.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Z);var We=pt.createDefs();Z.appendChild(We);var ye=pt.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(ye);var ct=pt.createPath(pt.getHollowRectanglePath((24-g)/2,(24-h)/2,g,h,(24-g)/2+2,(24-h)/2+2,g-4,h-4));Z.appendChild(ct);var He=pt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);He.appendChild(pt.createTSpan(o+":"+a)),Z.appendChild(He);var wt=He.getBBox();pt.setAttributes(He,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var Dt=pt.createPath(pt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return ye.appendChild(Dt),pt.setAttributes(ct,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Z),Z.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>'},c}(),kn=function(c){function o(a,u,g){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=g,h}return jt(o,c),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}(Nt),Mt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=pt.createGroup(),this.visual.appendChild(pt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return pt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Xn=function(){function c(o,a,u,g){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=g,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(c.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(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&pt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=pt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=pt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(pt.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=pt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},c.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),pt.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(h,Z){var We=a.y+u*(Z+1);pt.setAttributes(h,[["x1",""+a.x],["y1",""+We],["x2",""+(a.x+a.width)],["y2",""+We]])});var g=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,Z){var We=a.x+g*(Z+1);pt.setAttributes(h,[["x1",""+We],["y1",""+a.y],["x2",""+We],["y2",""+(a.y+a.height)]])}),pt.setAttributes(this.cropShadeElement,[["d",pt.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},c.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)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.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)},c.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()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.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},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,g=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+=g,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+=g}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))},c.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),g=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<g/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=g,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)}},c.prototype.getRescaledRect=function(o,a,u,g,h,Z){var We=u/o,ye=g/a;return{x:(h.x-Z)*We+Z,y:(h.y-Z)*ye+Z,width:h.width*We,height:h.height*ye}},c.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)},c}(),hi=function(){function c(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(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.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},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();pt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.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)}},c.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 g=u%5==0?this.height/3:this.height/6;a+="h4v"+-g+"h1v"+g}a+="v1H0Z",this.scaleShape=pt.createPath(a);var h=pt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=pt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=pt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Z=pt.createTSpan("");return Z.innerHTML="&deg;",this.angleLabelElement.appendChild(Z),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),vi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,g,h,Z,We){var ye=this;return new Promise(function(ct){var He=document.createElement("canvas");He.width=o.width.baseVal.value-2*g,He.height=o.height.baseVal.value-2*g;var wt=1,Dt=1;ye.naturalSize===!0?(wt=a.naturalWidth/(o.width.baseVal.value-2*g)/Z,Dt=a.naturalHeight/(o.height.baseVal.value-2*g)/We,He.width=a.naturalWidth/Z,He.height=a.naturalHeight/We):ye.width!==void 0&&ye.height!==void 0&&(wt=ye.width/u.width,Dt=ye.height/u.height,He.width*=wt,He.height*=Dt);var Wt=He.getContext("2d");Wt.translate(He.width/2,He.height/2),Wt.rotate(h*Math.PI/180),Wt.scale(Z,We),Wt.translate(-He.width/2,-He.height/2),Wt.drawImage(a,0,0,He.width,He.height);var Fn=document.createElement("canvas");Fn.width=u.width*wt,Fn.height=u.height*Dt,Fn.getContext("2d").putImageData(Wt.getImageData((u.x-g)*wt,(u.y-g)*Dt,u.width*wt,u.height*Dt),0,0),ct(Fn.toDataURL(ye.imageType,ye.imageQuality))})},c}(),Xe=function(){function c(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=c.instanceCounter++,this.styles=new Vn(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(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.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(c.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(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.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}),c.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},c.prototype.show=function(){this.showUI(),this.open()},c.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)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.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))},c.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)}},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.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",pt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},c.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()},c.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();pt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},c.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},c.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=pt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=pt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=pt.createGroup(),this.editingTargetRotationScaleContainer=pt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=pt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=pt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=pt.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)},c.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},c.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=pt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Xn(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()},c.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)}},c.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)},c.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},c.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},c.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"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.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},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Sn,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 Kn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Dt){var Wt=new Nt(ui.getIcon(Dt.horizontal,Dt.vertical),Dt.horizontal===0&&Dt.vertical===0?"FREE":Dt.horizontal+":"+Dt.vertical);Wt.onClick=function(){return o.ratioButtonClicked(Dt)},u.push(Wt)}),this.aspectRatioButton=new kn(ui.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 g=new Nt('<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");g.isActive=this.isGridVisible,g.onClick=function(){o.isGridVisible=!o.isGridVisible,g.isActive=o.isGridVisible},a.addButton(g);var h=new Nt('<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(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!rn.isLicensed){var Z=new dt;this.topToolbar.addElementBlock(Z);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ye=document.createElement("a");ye.style.color="currentColor",ye.href="https://markerjs.com/products/cropro",ye.target="_blank",ye.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',We.appendChild(ye),Z.addElement(We)}var ct=new Kn;ct.minWidth=3*this.toolbarHeight+"px",ct.contentAlign="end",this.topToolbar.addButtonBlock(ct);var He=new Nt('<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");He.onClick=this.startRenderAndClose,ct.addButton(He),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(He.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new Nt('<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");wt.onClick=this.close,ct.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Sn,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 Kn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Nt('<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 g=new Nt('<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");g.onClick=this.rotateRightButtonClicked,a.addButton(g);var h=new dt;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new hi("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(ct){o.rotateBy(ct),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var Z=new Kn;Z.minWidth=2*this.toolbarHeight+"px",Z.contentAlign="end",this.bottomToolbar.addButtonBlock(Z);var We=new Nt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,Z.addButton(We);var ye=new Nt('<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");ye.onClick=this.flipVerticallyButtonClicked,Z.addButton(ye)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ui.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Un(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.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()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.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()},c.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)},c.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)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.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},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return St(this,void 0,void 0,function(){var o,a;return bn(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(g){return g(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return St(this,void 0,void 0,function(){var o;return bn(this,function(a){switch(a.label){case 0:return(o=new vi).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),pt.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()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pn("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 pn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pn("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 pn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new xn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new xn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new pn("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 pn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pn("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 pn("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 pn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},c.instanceCounter=0,c}(),Ct=v("8hTe"),ti=v.n(Ct),ci=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Mi=Ge.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,g=u===void 0?!1:u,h=c.className,Z=c.showTextOnly,We=c.showLines,ye=c.replaces,ct=c.zoomImg,He=c.hasMask,wt=c.style,Dt=wt===void 0?{}:wt,Wt=c.stylesPrev,Fn=Wt===void 0?{}:Wt,Wn=String(a),ln=Object(A.useRef)(),$n=Object(A.useRef)(),Ki=Object(A.useState)(""),Tn=Object(k.a)(Ki,2),An=Tn[0],ni=Tn[1],yi=Object(A.useState)("office"),Jn=Object(k.a)(yi,2),ii=Jn[0],Hn=Jn[1],fr=function(){var Bt=new Xe($n.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var mn=Object(V.a)(P.a.mark(function Ut(gn){var Xt;return P.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return ln.current.style.display="none",on.next=3,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:gn}});case 3:Xt=on.sent,Xt!=null&&Xt.id&&ye($n.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 5:case"end":return on.stop()}},Ut)}));return function(Ut){return mn.apply(this,arguments)}}()),Bt.show()},Xi=function(){var Bt=new At($n.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var mn=Object(V.a)(P.a.mark(function Ut(gn){var Xt;return P.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(ln.current.style.display="none",!$n.current){on.next=6;break}return on.next=4,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:gn.dataUrl}});case 4:Xt=on.sent,Xt!=null&&Xt.id&&ye($n.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 6:case"end":return on.stop()}},Ut)}));return function(Ut){return mn.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Dn=Object(A.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,mn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Wn=Wn.replace(qt,"("+F.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+F.a.API_SERVER+"/api/attachments/").replace(mn,'"'+F.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,`
`),Wn=Wn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(bi){}var Ut=S(Wn),gn=ue();if(Wn.match(/\[TOC\]/)&&(Ut=Ut.replace("<p>[TOC]</p>",Fe()),Je()),Ut=Ut.replace(/(__special_katext_id_\d+__)/g,function(bi,on){var an=gn[on],ri=an.type,xi=an.expression;return Object(te.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ut=Ut.replace(/▁/g,"\u2581\u2581\u2581"),J(),Z){var Xt=document.createElement("div");return Xt.innerHTML=Ut,Xt.innerText}return setTimeout(function(){return Pi()},500),Ut},[Wn]),Nn=Object(A.useRef)();_e.WebkitLineClamp=We,We&&(Dt=Object(se.a)(Object(se.a)({},Dt),_e));function Ri(qt){var Bt=qt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(ct){var mn=Bt.getAttribute("src");ni(mn),Hn("image")}}else if(Bt.tagName.toUpperCase()==="A"){var Ut=Bt.getAttribute("href");if(Ut.indexOf("office")>-1)qt.preventDefault(),ni(Ut),Hn("office");else if(Ut.indexOf("application/pdf")>-1)qt.preventDefault(),ni(Ut),Hn("pdf");else if(Ut.indexOf("type=text")>-1)qt.preventDefault(),ni(Ut),Hn("html");else if(Ut.startsWith("#")){qt.preventDefault();var gn=document.getElementById(Ut.replace("#",""));gn&&gn.scrollIntoView(!0)}}}var Pi=function(){var Bt,mn=(Bt=Nn.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");mn==null||mn.forEach(function(Ut){if(Ut.oncontextmenu=function(){return!1},Ut.src.indexOf(".m3u8")>-1&&!Ut.canPlayType("application/vnd.apple.mpegurl")){if(_.a.isSupported()){var gn=new _.a;gn.loadSource(Ut.src),gn.attachMedia(Ut)}}})};Object(A.useEffect)(function(){if(Nn.current&&Dn&&(Dn.match(ci)&&window.PR.prettyPrint()),Nn.current)return Nn.current.addEventListener("click",Ri),function(){Nn.current.removeEventListener("click",Ri),J(),Je()}},[Dn,Nn.current,Ri]);var Di=function(Bt){if(!g)return;Bt.target.nodeName==="IMG"?(ln.current.style.display="flex",ln.current.style.width=Bt.target.clientWidth+"px",ln.current.style.height=Bt.target.clientHeight+"px",ln.current.style.top=Bt.target.offsetTop+"px",ln.current.style.left=Bt.target.offsetLeft+"px",$n.current.src=Bt.target.getAttribute("src")):ln.current.style.display="none"};return R.a.createElement("div",{style:{position:"relative"}},R.a.createElement("div",{ref:Nn,style:Object(se.a)({},Dt),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Di,dangerouslySetInnerHTML:{__html:Dn}}),R.a.createElement("div",{ref:ln,className:ti.a.button},R.a.createElement(he.a,null,R.a.createElement(xe.a,{onClick:function(){return fr()}},"\u88C1\u526A"),R.a.createElement(xe.a,{onClick:function(){return Xi()}},"\u7F16\u8F91"))),R.a.createElement("img",{ref:$n,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),R.a.createElement(Ce.a,{close:!0,data:An,hasMask:He,type:An!=null&&An.length?ii:"",style:Object(se.a)({},Fn),onClose:function(){return ni("")}}))}},"9VGf":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return oe});var z=v("q1tI"),he=v.n(z);function oe(xe,se){var V=Object(z.useRef)();Object(z.useEffect)(function(){V.current=xe}),Object(z.useEffect)(function(){function k(){V.current()}if(se!==null){var L=setInterval(k,se);return function(){return clearInterval(L)}}},[se])}},Bd2K:function(nt,Ge,v){(function(z){z(v("VrN/"),v("osHv"))})(function(z){z.defineOption("autoCloseTags",!1,function(P,A,R){if(R!=z.Init&&R&&P.removeKeyMap("autoCloseTags"),!A)return;var T={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(T["'/'"]=function(Q){return V(Q)}),(typeof A!="object"||A.whenOpening!==!1)&&(T["'>'"]=function(Q){return xe(Q)}),P.addKeyMap(T)});var he=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],oe=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function xe(P){if(P.getOption("disableInput"))return z.Pass;for(var A=P.listSelections(),R=[],T=P.getOption("autoCloseTags"),Q=0;Q<A.length;Q++){if(!A[Q].empty())return z.Pass;var H=A[Q].head,I=P.getTokenAt(H),G=z.innerMode(P.getMode(),I.state),X=G.state,Y=G.mode.xmlCurrentTag&&G.mode.xmlCurrentTag(X),ce=Y&&Y.name;if(!ce)return z.Pass;var De=G.mode.configuration=="html",Je=typeof T=="object"&&T.dontCloseTags||De&&he,_e=typeof T=="object"&&T.indentTags||De&&oe;I.end>H.ch&&(ce=ce.slice(0,ce.length-I.end+H.ch));var Te=ce.toLowerCase();if(!ce||I.type=="string"&&(I.end!=H.ch||!/[\"\']/.test(I.string.charAt(I.string.length-1))||I.string.length==1)||I.type=="tag"&&Y.close||I.string.indexOf("/")==H.ch-I.start-1||Je&&k(Je,Te)>-1||L(P,G.mode.xmlCurrentContext&&G.mode.xmlCurrentContext(X)||[],ce,H,!0))return z.Pass;var Fe=typeof T=="object"&&T.emptyTags;if(Fe&&k(Fe,ce)>-1){R[Q]={text:"/>",newPos:z.Pos(H.line,H.ch+2)};continue}var we=_e&&k(_e,Te)>-1;R[Q]={indent:we,text:">"+(we?`
`:"")+"</"+ce+">",newPos:we?z.Pos(H.line+1,0):z.Pos(H.line,H.ch+1)}}for(var Se=typeof T=="object"&&T.dontIndentOnAutoClose,Q=A.length-1;Q>=0;Q--){var Pe=R[Q];P.replaceRange(Pe.text,A[Q].head,A[Q].anchor,"+insert");var be=P.listSelections().slice(0);be[Q]={head:Pe.newPos,anchor:Pe.newPos},P.setSelections(be),!Se&&Pe.indent&&(P.indentLine(Pe.newPos.line,null,!0),P.indentLine(Pe.newPos.line+1,null,!0))}}function se(P,A){for(var R=P.listSelections(),T=[],Q=A?"/":"</",H=P.getOption("autoCloseTags"),I=typeof H=="object"&&H.dontIndentOnSlash,G=0;G<R.length;G++){if(!R[G].empty())return z.Pass;var X=R[G].head,Y=P.getTokenAt(X),ce=z.innerMode(P.getMode(),Y.state),De=ce.state;if(A&&(Y.type=="string"||Y.string.charAt(0)!="<"||Y.start!=X.ch-1))return z.Pass;var Je,_e=ce.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(_e&&ce.mode.name=="javascript")Je=Q+"script";else if(_e&&ce.mode.name=="css")Je=Q+"style";else{var Te=ce.mode.xmlCurrentContext&&ce.mode.xmlCurrentContext(De);if(!Te||Te.length&&L(P,Te,Te[Te.length-1],X))return z.Pass;Je=Q+Te[Te.length-1]}P.getLine(X.line).charAt(Y.end)!=">"&&(Je+=">"),T[G]=Je}if(P.replaceSelections(T),R=P.listSelections(),!I)for(var G=0;G<R.length;G++)(G==R.length-1||R[G].head.line<R[G+1].head.line)&&P.indentLine(R[G].head.line)}function V(P){return P.getOption("disableInput")?z.Pass:se(P,!0)}z.commands.closeTag=function(P){return se(P)};function k(P,A){if(P.indexOf)return P.indexOf(A);for(var R=0,T=P.length;R<T;++R)if(P[R]==A)return R;return-1}function L(P,A,R,T,Q){if(!z.scanForClosingTag)return!1;var H=Math.min(P.lastLine()+1,T.line+500),I=z.scanForClosingTag(P,T,null,H);if(!I||I.tag!=R)return!1;for(var G=Q?1:0,X=A.length-1;X>=0&&A[X]==R;X--)++G;T=I.to;for(var X=1;X<G;X++){var Y=z.scanForClosingTag(P,T,null,H);if(!Y||Y.tag!=R)return!1;T=Y.to}return!0}})},BjJ7:function(nt,Ge,v){"use strict";v.d(Ge,"d",function(){return he}),v.d(Ge,"c",function(){return oe}),v.d(Ge,"e",function(){return xe}),v.d(Ge,"b",function(){return se}),v.d(Ge,"a",function(){return k});var z=v("m3rI");function he(L){var P=!0;if(L.length>0){for(var A=0;A<L.length;A++)if(L[A].compile_success==0||!L[A].compile_success){P=!1;break}}else P=!1;return P}function oe(L){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],R=0;R<L.length;R++){var T=L[R],Q=P?"".concat(P,"/").concat(T.name):"".concat(T.name);A.push({title:T.name,isLeaf:!(T.type==="tree"),key:Q})}return A}function xe(L,P,A){for(var R=0;R<L.length;R++){var T=L[R];if(T.key===P){T.children=A;break}T.children&&xe(T.children,P,A)}return L}function se(L,P,A){var R;return function(){var T=this,Q=arguments,H=function(){R=null,A||L.apply(T,Q)},I=A&&!R;clearTimeout(R),R=setTimeout(H,P),I&&L.apply(T,Q)}}var V=!0,k=z.a.API_SERVER},"C+DQ":function(nt,Ge,v){},D1Df:function(nt,Ge,v){"use strict";function z(x){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(N){return typeof N}:z=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},z(x)}function he(){return he=Object.assign||function(x){for(var j=1;j<arguments.length;j++){var N=arguments[j];for(var w in N)Object.prototype.hasOwnProperty.call(N,w)&&(x[w]=N[w])}return x},he.apply(this,arguments)}function oe(x,j){var N=Object.keys(x);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(x);j&&(w=w.filter(function(S){return Object.getOwnPropertyDescriptor(x,S).enumerable})),N.push.apply(N,w)}return N}function xe(x){for(var j=1;j<arguments.length;j++){var N=arguments[j]!=null?arguments[j]:{};j%2?oe(N,!0).forEach(function(w){I(x,w,N[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(N)):oe(N).forEach(function(w){Object.defineProperty(x,w,Object.getOwnPropertyDescriptor(N,w))})}return x}function se(x,j){if(x==null)return{};var N=V(x,j),w,S;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(x);for(S=0;S<p.length;S++){if(w=p[S],j.indexOf(w)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(x,w))continue;N[w]=x[w]}}return N}function V(x,j){if(x==null)return{};var N={},w=Object.keys(x),S,p;for(p=0;p<w.length;p++){if(S=w[p],j.indexOf(S)>=0)continue;N[S]=x[S]}return N}function k(x,j){if(!(x instanceof j))throw new TypeError("Cannot call a class as a function")}function L(x,j){for(var N=0;N<j.length;N++){var w=j[N];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(x,w.key,w)}}function P(x,j,N){return j&&L(x.prototype,j),N&&L(x,N),x}function A(x,j){return j&&(z(j)==="object"||typeof j=="function")?j:T(x)}function R(x){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},R(x)}function T(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function Q(x,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(j&&j.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),j&&H(x,j)}function H(x,j){return H=Object.setPrototypeOf||function(w,S){return w.__proto__=S,w},H(x,j)}function I(x,j,N){return j in x?Object.defineProperty(x,j,{value:N,enumerable:!0,configurable:!0,writable:!0}):x[j]=N,x}var G=v("q1tI"),X=v("17x9"),Y=v("H38U"),ce=v("aRTE");function De(x){for(var j="",N=0;N<x.length;N++){var w=x.charCodeAt(N);w<128?j+=String.fromCharCode(w):w<2048?(j+=String.fromCharCode(192|w>>6),j+=String.fromCharCode(128|w&63)):w<55296||w>=57344?(j+=String.fromCharCode(224|w>>12),j+=String.fromCharCode(128|w>>6&63),j+=String.fromCharCode(128|w&63)):(N++,w=65536+((w&1023)<<10|x.charCodeAt(N)&1023),j+=String.fromCharCode(240|w>>18),j+=String.fromCharCode(128|w>>12&63),j+=String.fromCharCode(128|w>>6&63),j+=String.fromCharCode(128|w&63))}return j}var Je={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},_e={},Te=4,Fe=.1;function we(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=[];return x.forEach(function(w,S){var p=null;w.forEach(function(d,_){if(!d&&p!==null){N.push("M".concat(p+j," ").concat(S+j,"h").concat(_-p,"v1H").concat(p+j,"z")),p=null;return}if(_===w.length-1){if(!d)return;p===null?N.push("M".concat(_+j,",").concat(S+j," h1v1H").concat(_+j,"z")):N.push("M".concat(p+j,",").concat(S+j," h").concat(_+1-p,"v1H").concat(p+j,"z"));return}d&&p===null&&(p=_)})}),N.join("")}function Se(x,j){return x.slice().map(function(N,w){return w<j.y||w>=j.y+j.h?N:N.map(function(S,p){return p<j.x||p>=j.x+j.w?S:!1})})}function Pe(x,j){var N=x.imageSettings,w=x.size,S=x.includeMargin;if(N==null)return null;var p=S?Te:0,d=j.length+p*2,_=Math.floor(w*Fe),F=d/w,te=(N.width||_)*F,Ce=(N.height||_)*F,Le=N.x==null?j.length/2-te/2:N.x*F,pe=N.y==null?j.length/2-Ce/2:N.y*F,fe=null;if(N.excavate){var ie=Math.floor(Le),le=Math.floor(pe),ee=Math.ceil(te+Le-ie),U=Math.ceil(Ce+pe-le);fe={x:ie,y:le,w:ee,h:U}}return{x:Le,y:pe,h:Ce,w:te,excavation:fe}}var be=function(){try{new Path2D().addPath(new Path2D)}catch(x){return!1}return!0}(),O=function(x){Q(j,x);function j(){var N,w;k(this,j);for(var S=arguments.length,p=new Array(S),d=0;d<S;d++)p[d]=arguments[d];return w=A(this,(N=R(j)).call.apply(N,[this].concat(p))),I(T(w),"_canvas",void 0),I(T(w),"_image",void 0),I(T(w),"state",{imgLoaded:!1}),I(T(w),"handleImageLoad",function(){w.setState({imgLoaded:!0})}),w}return P(j,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var w=this.props,S=w.value,p=w.size,d=w.level,_=w.bgColor,F=w.fgColor,te=w.includeMargin,Ce=w.imageSettings,Le=new Y(-1,ce[d]);if(Le.addData(De(S)),Le.make(),this._canvas!=null){var pe=this._canvas,fe=pe.getContext("2d");if(!fe)return;var ie=Le.modules;if(ie===null)return;var le=te?Te:0,ee=ie.length+le*2,U=Pe(this.props,ie);Ce!=null&&U!=null&&(U.excavation!=null&&(ie=Se(ie,U.excavation)));var b=window.devicePixelRatio||1;pe.height=pe.width=p*b;var K=p/ee*b;fe.scale(K,K),fe.fillStyle=_,fe.fillRect(0,0,ee,ee),fe.fillStyle=F,be?fe.fill(new Path2D(we(ie,le))):ie.forEach(function(M,ve){M.forEach(function(Ee,re){Ee&&fe.fillRect(re+le,ve+le,1,1)})}),this.state.imgLoaded&&this._image&&U!=null&&fe.drawImage(this._image,U.x+le,U.y+le,U.w,U.h)}}},{key:"render",value:function(){var w=this,S=this.props,p=S.value,d=S.size,_=S.level,F=S.bgColor,te=S.fgColor,Ce=S.style,Le=S.includeMargin,pe=S.imageSettings,fe=se(S,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ie=xe({height:d,width:d},Ce),le=null,ee=pe&&pe.src;return pe!=null&&ee!=null&&(le=G.createElement("img",{src:ee,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(b){return w._image=b}})),G.createElement(G.Fragment,null,G.createElement("canvas",he({style:ie,height:d,width:d,ref:function(b){return w._canvas=b}},fe)),le)}}]),j}(G.PureComponent);I(O,"defaultProps",Je);var ue=function(x){Q(j,x);function j(){return k(this,j),A(this,R(j).apply(this,arguments))}return P(j,[{key:"render",value:function(){var w=this.props,S=w.value,p=w.size,d=w.level,_=w.bgColor,F=w.fgColor,te=w.includeMargin,Ce=w.imageSettings,Le=se(w,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),pe=new Y(-1,ce[d]);pe.addData(De(S)),pe.make();var fe=pe.modules;if(fe===null)return null;var ie=te?Te:0,le=fe.length+ie*2,ee=Pe(this.props,fe),U=null;Ce!=null&&ee!=null&&(ee.excavation!=null&&(fe=Se(fe,ee.excavation)),U=G.createElement("image",{xlinkHref:Ce.src,height:ee.h,width:ee.w,x:ee.x+ie,y:ee.y+ie,preserveAspectRatio:"none"}));var b=we(fe,ie);return G.createElement("svg",he({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(le," ").concat(le)},Le),G.createElement("path",{fill:_,d:"M0,0 h".concat(le,"v").concat(le,"H0z")}),G.createElement("path",{fill:F,d:b}),U)}}]),j}(G.PureComponent);I(ue,"defaultProps",Je);var J=function(j){var N=j.renderAs,w=se(j,["renderAs"]),S=N==="svg"?ue:O;return G.createElement(S,w)};J.defaultProps=xe({renderAs:"canvas"},Je),nt.exports=J},DlQD:function(nt,Ge,v){(function(z,he){nt.exports=he()})(this,function(){"use strict";function z(ae,q){for(var ne=0;ne<q.length;ne++){var C=q[ne];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(ae,C.key,C)}}function he(ae,q,ne){return q&&z(ae.prototype,q),ne&&z(ae,ne),ae}function oe(ae,q){if(!ae)return;if(typeof ae=="string")return xe(ae,q);var ne=Object.prototype.toString.call(ae).slice(8,-1);if(ne==="Object"&&ae.constructor&&(ne=ae.constructor.name),ne==="Map"||ne==="Set")return Array.from(ae);if(ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne))return xe(ae,q)}function xe(ae,q){(q==null||q>ae.length)&&(q=ae.length);for(var ne=0,C=new Array(q);ne<q;ne++)C[ne]=ae[ne];return C}function se(ae,q){var ne;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(ne=oe(ae))||q&&ae&&typeof ae.length=="number"){ne&&(ae=ne);var C=0;return function(){return C>=ae.length?{done:!0}:{done:!1,value:ae[C++]}}}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 ne=ae[Symbol.iterator](),ne.next.bind(ne)}function V(ae,q){return q={exports:{}},ae(q,q.exports),q.exports}var k=V(function(ae){function q(){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 ne(C){ae.exports.defaults=C}ae.exports={defaults:q(),getDefaults:q,changeDefaults:ne}}),L=k.defaults,P=k.getDefaults,A=k.changeDefaults,R=/[&<>"']/,T=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,H=/[<>"']|&(?!#?\w+;)/g,I={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},G=function(q){return I[q]};function X(ae,q){if(q){if(R.test(ae))return ae.replace(T,G)}else if(Q.test(ae))return ae.replace(H,G);return ae}var Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ce(ae){return ae.replace(Y,function(q,ne){return ne=ne.toLowerCase(),ne==="colon"?":":ne.charAt(0)==="#"?ne.charAt(1)==="x"?String.fromCharCode(parseInt(ne.substring(2),16)):String.fromCharCode(+ne.substring(1)):""})}var De=/(^|[^\[])\^/g;function Je(ae,q){ae=ae.source||ae,q=q||"";var ne={replace:function(E,D){return D=D.source||D,D=D.replace(De,"$1"),ae=ae.replace(E,D),ne},getRegex:function(){return new RegExp(ae,q)}};return ne}var _e=/[^\w:]/g,Te=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Fe(ae,q,ne){if(ae){var C;try{C=decodeURIComponent(ce(ne)).replace(_e,"").toLowerCase()}catch(E){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}q&&!Te.test(ne)&&(ne=O(q,ne));try{ne=encodeURI(ne).replace(/%25/g,"%")}catch(E){return null}return ne}var we={},Se=/^[^:]+:\/*[^/]*$/,Pe=/^([^:]+:)[\s\S]*$/,be=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(ae,q){we[" "+ae]||(Se.test(ae)?we[" "+ae]=ae+"/":we[" "+ae]=j(ae,"/",!0)),ae=we[" "+ae];var ne=ae.indexOf(":")===-1;return q.substring(0,2)==="//"?ne?q:ae.replace(Pe,"$1")+q:q.charAt(0)==="/"?ne?q:ae.replace(be,"$1")+q:ae+q}var ue={exec:function(){}};function J(ae){for(var q=1,ne,C;q<arguments.length;q++){ne=arguments[q];for(C in ne)Object.prototype.hasOwnProperty.call(ne,C)&&(ae[C]=ne[C])}return ae}function x(ae,q){var ne=ae.replace(/\|/g,function(D,B,ge){for(var Oe=!1,Ye=B;--Ye>=0&&ge[Ye]==="\\";)Oe=!Oe;return Oe?"|":" |"}),C=ne.split(/ \|/),E=0;if(C.length>q)C.splice(q);else for(;C.length<q;)C.push("");for(;E<C.length;E++)C[E]=C[E].trim().replace(/\\\|/g,"|");return C}function j(ae,q,ne){var C=ae.length;if(C===0)return"";for(var E=0;E<C;){var D=ae.charAt(C-E-1);if(D===q&&!ne)E++;else if(D!==q&&ne)E++;else break}return ae.substr(0,C-E)}function N(ae,q){if(ae.indexOf(q[1])===-1)return-1;for(var ne=ae.length,C=0,E=0;E<ne;E++)if(ae[E]==="\\")E++;else if(ae[E]===q[0])C++;else if(ae[E]===q[1]&&(C--,C<0))return E;return-1}function w(ae){ae&&ae.sanitize&&!ae.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var S={escape:X,unescape:ce,edit:Je,cleanUrl:Fe,resolveUrl:O,noopTest:ue,merge:J,splitCells:x,rtrim:j,findClosingBracket:N,checkSanitizeDeprecation:w},p=k.defaults,d=S.rtrim,_=S.splitCells,F=S.escape,te=S.findClosingBracket;function Ce(ae,q,ne){var C=q.href,E=q.title?F(q.title):null,D=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:ne,href:C,title:E,text:D}:{type:"image",raw:ne,href:C,title:E,text:F(D)}}function Le(ae,q){var ne=ae.match(/^(\s+)(?:```)/);if(ne===null)return q;var C=ne[1];return q.split(`
`).map(function(E){var D=E.match(/^\s+/);if(D===null)return E;var B=D[0];return B.length>=C.length?E.slice(C.length):E}).join(`
`)}var pe=function(){function ae(ne){this.options=ne||p}var q=ae.prototype;return q.space=function(C){var E=this.rules.block.newline.exec(C);if(E)return E[0].length>1?{type:"space",raw:E[0]}:{raw:`
`}},q.code=function(C,E){var D=this.rules.block.code.exec(C);if(D){var B=E[E.length-1];if(B&&B.type==="paragraph")return{raw:D[0],text:D[0].trimRight()};var ge=D[0].replace(/^ {4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?ge:d(ge,`
`)}}},q.fences=function(C){var E=this.rules.block.fences.exec(C);if(E){var D=E[0],B=Le(D,E[3]||"");return{type:"code",raw:D,lang:E[2]?E[2].trim():E[2],text:B}}},q.heading=function(C){var E=this.rules.block.heading.exec(C);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},q.nptable=function(C){var E=this.rules.block.nptable.exec(C);if(E){var D={type:"table",header:_(E[1].replace(/^ *| *\| *$/g,"")),align:E[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:E[3]?E[3].replace(/\n$/,"").split(`
`):[],raw:E[0]};if(D.header.length===D.align.length){var B=D.align.length,ge;for(ge=0;ge<B;ge++)/^ *-+: *$/.test(D.align[ge])?D.align[ge]="right":/^ *:-+: *$/.test(D.align[ge])?D.align[ge]="center":/^ *:-+ *$/.test(D.align[ge])?D.align[ge]="left":D.align[ge]=null;for(B=D.cells.length,ge=0;ge<B;ge++)D.cells[ge]=_(D.cells[ge],D.header.length);return D}}},q.hr=function(C){var E=this.rules.block.hr.exec(C);if(E)return{type:"hr",raw:E[0]}},q.blockquote=function(C){var E=this.rules.block.blockquote.exec(C);if(E){var D=E[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:E[0],text:D}}},q.list=function(C){var E=this.rules.block.list.exec(C);if(E){for(var D=E[0],B=E[2],ge=B.length>1,Oe=B[B.length-1]===")",Ye={type:"list",raw:D,ordered:ge,start:ge?+B.slice(0,-1):"",loose:!1,items:[]},yt=E[0].match(this.rules.block.item),kt=!1,Ke,_t,mt,ot,Pt,At,Vt,jt=yt.length,St=0;St<jt;St++)Ke=yt[St],D=Ke,_t=Ke.length,Ke=Ke.replace(/^ *([*+-]|\d+[.)]) */,""),~Ke.indexOf(`
`)&&(_t-=Ke.length,Ke=this.options.pedantic?Ke.replace(/^ {1,4}/gm,""):Ke.replace(new RegExp("^ {1,"+_t+"}","gm"),"")),St!==jt-1&&(mt=this.rules.block.bullet.exec(yt[St+1])[0],(ge?mt.length===1||!Oe&&mt[mt.length-1]===")":mt.length>1||this.options.smartLists&&mt!==B)&&(ot=yt.slice(St+1).join(`
`),Ye.raw=Ye.raw.substring(0,Ye.raw.length-ot.length),St=jt-1)),Pt=kt||/\n\n(?!\s*$)/.test(Ke),St!==jt-1&&(kt=Ke.charAt(Ke.length-1)===`
`,Pt||(Pt=kt)),Pt&&(Ye.loose=!0),At=/^\[[ xX]\] /.test(Ke),Vt=void 0,At&&(Vt=Ke[1]!==" ",Ke=Ke.replace(/^\[[ xX]\] +/,"")),Ye.items.push({type:"list_item",raw:D,task:At,checked:Vt,loose:Pt,text:Ke});return Ye}},q.html=function(C){var E=this.rules.block.html.exec(C);if(E)return{type:this.options.sanitize?"paragraph":"html",raw:E[0],pre:!this.options.sanitizer&&(E[1]==="pre"||E[1]==="script"||E[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(E[0]):F(E[0]):E[0]}},q.def=function(C){var E=this.rules.block.def.exec(C);if(E){E[3]&&(E[3]=E[3].substring(1,E[3].length-1));var D=E[1].toLowerCase().replace(/\s+/g," ");return{tag:D,raw:E[0],href:E[2],title:E[3]}}},q.table=function(C){var E=this.rules.block.table.exec(C);if(E){var D={type:"table",header:_(E[1].replace(/^ *| *\| *$/g,"")),align:E[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:E[3]?E[3].replace(/\n$/,"").split(`
`):[]};if(D.header.length===D.align.length){D.raw=E[0];var B=D.align.length,ge;for(ge=0;ge<B;ge++)/^ *-+: *$/.test(D.align[ge])?D.align[ge]="right":/^ *:-+: *$/.test(D.align[ge])?D.align[ge]="center":/^ *:-+ *$/.test(D.align[ge])?D.align[ge]="left":D.align[ge]=null;for(B=D.cells.length,ge=0;ge<B;ge++)D.cells[ge]=_(D.cells[ge].replace(/^ *\| *| *\| *$/g,""),D.header.length);return D}}},q.lheading=function(C){var E=this.rules.block.lheading.exec(C);if(E)return{type:"heading",raw:E[0],depth:E[2].charAt(0)==="="?1:2,text:E[1]}},q.paragraph=function(C){var E=this.rules.block.paragraph.exec(C);if(E)return{type:"paragraph",raw:E[0],text:E[1].charAt(E[1].length-1)===`
`?E[1].slice(0,-1):E[1]}},q.text=function(C,E){var D=this.rules.block.text.exec(C);if(D){var B=E[E.length-1];return B&&B.type==="text"?{raw:D[0],text:D[0]}:{type:"text",raw:D[0],text:D[0]}}},q.escape=function(C){var E=this.rules.inline.escape.exec(C);if(E)return{type:"escape",raw:E[0],text:F(E[1])}},q.tag=function(C,E,D){var B=this.rules.inline.tag.exec(C);if(B)return!E&&/^<a /i.test(B[0])?E=!0:E&&/^<\/a>/i.test(B[0])&&(E=!1),!D&&/^<(pre|code|kbd|script)(\s|>)/i.test(B[0])?D=!0:D&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(B[0])&&(D=!1),{type:this.options.sanitize?"text":"html",raw:B[0],inLink:E,inRawBlock:D,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(B[0]):F(B[0]):B[0]}},q.link=function(C){var E=this.rules.inline.link.exec(C);if(E){var D=te(E[2],"()");if(D>-1){var B=E[0].indexOf("!")===0?5:4,ge=B+E[1].length+D;E[2]=E[2].substring(0,D),E[0]=E[0].substring(0,ge).trim(),E[3]=""}var Oe=E[2],Ye="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);yt?(Oe=yt[1],Ye=yt[3]):Ye=""}else Ye=E[3]?E[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var kt=Ce(E,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Ye&&Ye.replace(this.rules.inline._escapes,"$1")},E[0]);return kt}},q.reflink=function(C,E){var D;if((D=this.rules.inline.reflink.exec(C))||(D=this.rules.inline.nolink.exec(C))){var B=(D[2]||D[1]).replace(/\s+/g," ");if(B=E[B.toLowerCase()],!B||!B.href){var ge=D[0].charAt(0);return{type:"text",raw:ge,text:ge}}var Oe=Ce(D,B,D[0]);return Oe}},q.strong=function(C,E,D){D===void 0&&(D="");var B=this.rules.inline.strong.start.exec(C);if(B&&(!B[1]||B[1]&&(D===""||this.rules.inline.punctuation.exec(D)))){E=E.slice(-1*C.length);var ge=B[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ge.lastIndex=0;for(var Oe;(B=ge.exec(E))!=null;)if(Oe=this.rules.inline.strong.middle.exec(E.slice(0,B.index+3)),Oe)return{type:"strong",raw:C.slice(0,Oe[0].length),text:C.slice(2,Oe[0].length-2)}}},q.em=function(C,E,D){D===void 0&&(D="");var B=this.rules.inline.em.start.exec(C);if(B&&(!B[1]||B[1]&&(D===""||this.rules.inline.punctuation.exec(D)))){E=E.slice(-1*C.length);var ge=B[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ge.lastIndex=0;for(var Oe;(B=ge.exec(E))!=null;)if(Oe=this.rules.inline.em.middle.exec(E.slice(0,B.index+2)),Oe)return{type:"em",raw:C.slice(0,Oe[0].length),text:C.slice(1,Oe[0].length-1)}}},q.codespan=function(C){var E=this.rules.inline.code.exec(C);if(E){var D=E[2].replace(/\n/g," "),B=/[^ ]/.test(D),ge=D.startsWith(" ")&&D.endsWith(" ");return B&&ge&&(D=D.substring(1,D.length-1)),D=F(D,!0),{type:"codespan",raw:E[0],text:D}}},q.br=function(C){var E=this.rules.inline.br.exec(C);if(E)return{type:"br",raw:E[0]}},q.del=function(C){var E=this.rules.inline.del.exec(C);if(E)return{type:"del",raw:E[0],text:E[1]}},q.autolink=function(C,E){var D=this.rules.inline.autolink.exec(C);if(D){var B,ge;return D[2]==="@"?(B=F(this.options.mangle?E(D[1]):D[1]),ge="mailto:"+B):(B=F(D[1]),ge=B),{type:"link",raw:D[0],text:B,href:ge,tokens:[{type:"text",raw:B,text:B}]}}},q.url=function(C,E){var D;if(D=this.rules.inline.url.exec(C)){var B,ge;if(D[2]==="@")B=F(this.options.mangle?E(D[0]):D[0]),ge="mailto:"+B;else{var Oe;do Oe=D[0],D[0]=this.rules.inline._backpedal.exec(D[0])[0];while(Oe!==D[0]);B=F(D[0]),D[1]==="www."?ge="http://"+B:ge=B}return{type:"link",raw:D[0],text:B,href:ge,tokens:[{type:"text",raw:B,text:B}]}}},q.inlineText=function(C,E,D){var B=this.rules.inline.text.exec(C);if(B){var ge;return E?ge=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(B[0]):F(B[0]):B[0]:ge=F(this.options.smartypants?D(B[0]):B[0]),{type:"text",raw:B[0],text:ge}}},ae}(),fe=S.noopTest,ie=S.edit,le=S.merge,ee={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:fe,table:fe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=ie(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ee.item=ie(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=ie(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._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",ee._comment=/<!--(?!-?>)[\s\S]*?-->/,ee.html=ie(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=ie(ee._paragraph).replace("hr",ee.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",ee._tag).getRegex(),ee.blockquote=ie(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=le({},ee),ee.gfm=le({},ee.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*|$)"}),ee.gfm.nptable=ie(ee.gfm.nptable).replace("hr",ee.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",ee._tag).getRegex(),ee.gfm.table=ie(ee.gfm.table).replace("hr",ee.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",ee._tag).getRegex(),ee.pedantic=le({},ee.normal,{html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._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:fe,paragraph:ie(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var U={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fe,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:fe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};U._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",U.punctuation=ie(U.punctuation).replace(/punctuation/g,U._punctuation).getRegex(),U._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",U._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",U.em.start=ie(U.em.start).replace(/punctuation/g,U._punctuation).getRegex(),U.em.middle=ie(U.em.middle).replace(/punctuation/g,U._punctuation).replace(/overlapSkip/g,U._overlapSkip).getRegex(),U.em.endAst=ie(U.em.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.em.endUnd=ie(U.em.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.start=ie(U.strong.start).replace(/punctuation/g,U._punctuation).getRegex(),U.strong.middle=ie(U.strong.middle).replace(/punctuation/g,U._punctuation).replace(/blockSkip/g,U._blockSkip).getRegex(),U.strong.endAst=ie(U.strong.endAst,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.strong.endUnd=ie(U.strong.endUnd,"g").replace(/punctuation/g,U._punctuation).getRegex(),U.blockSkip=ie(U._blockSkip,"g").getRegex(),U.overlapSkip=ie(U._overlapSkip,"g").getRegex(),U._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,U._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,U._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])?)+(?![-_])/,U.autolink=ie(U.autolink).replace("scheme",U._scheme).replace("email",U._email).getRegex(),U._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,U.tag=ie(U.tag).replace("comment",ee._comment).replace("attribute",U._attribute).getRegex(),U._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,U._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,U._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,U.link=ie(U.link).replace("label",U._label).replace("href",U._href).replace("title",U._title).getRegex(),U.reflink=ie(U.reflink).replace("label",U._label).getRegex(),U.reflinkSearch=ie(U.reflinkSearch,"g").replace("reflink",U.reflink).replace("nolink",U.nolink).getRegex(),U.normal=le({},U),U.pedantic=le({},U.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",U._label).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U._label).getRegex()}),U.gfm=le({},U.normal,{escape:ie(U.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),U.gfm.url=ie(U.gfm.url,"i").replace("email",U.gfm._extended_email).getRegex(),U.breaks=le({},U.gfm,{br:ie(U.br).replace("{2,}","*").getRegex(),text:ie(U.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:ee,inline:U},K=k.defaults,M=b.block,ve=b.inline;function Ee(ae){return ae.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function re(ae){var q="",ne,C,E=ae.length;for(ne=0;ne<E;ne++)C=ae.charCodeAt(ne),Math.random()>.5&&(C="x"+C.toString(16)),q+="&#"+C+";";return q}var Ae=function(){function ae(ne){this.tokens=[],this.tokens.links=Object.create(null),this.options=ne||K,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var C={block:M.normal,inline:ve.normal};this.options.pedantic?(C.block=M.pedantic,C.inline=ve.pedantic):this.options.gfm&&(C.block=M.gfm,this.options.breaks?C.inline=ve.breaks:C.inline=ve.gfm),this.tokenizer.rules=C}ae.lex=function(C,E){var D=new ae(E);return D.lex(C)};var q=ae.prototype;return q.lex=function(C){return C=C.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(C,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(C,E,D){E===void 0&&(E=[]),D===void 0&&(D=!0),C=C.replace(/^ +$/gm,"");for(var B,ge,Oe,Ye;C;){if(B=this.tokenizer.space(C)){C=C.substring(B.raw.length),B.type&&E.push(B);continue}if(B=this.tokenizer.code(C,E)){C=C.substring(B.raw.length),B.type?E.push(B):(Ye=E[E.length-1],Ye.raw+=`
`+B.raw,Ye.text+=`
`+B.text);continue}if(B=this.tokenizer.fences(C)){C=C.substring(B.raw.length),E.push(B);continue}if(B=this.tokenizer.heading(C)){C=C.substring(B.raw.length),E.push(B);continue}if(B=this.tokenizer.nptable(C)){C=C.substring(B.raw.length),E.push(B);continue}if(B=this.tokenizer.hr(C)){C=C.substring(B.raw.length),E.push(B);continue}if(B=this.tokenizer.blockquote(C)){C=C.substring(B.raw.length),B.tokens=this.blockTokens(B.text,[],D),E.push(B);continue}if(B=this.tokenizer.list(C)){for(C=C.substring(B.raw.length),Oe=B.items.length,ge=0;ge<Oe;ge++)B.items[ge].tokens=this.blockTokens(B.items[ge].text,[],!1);E.push(B);continue}if(B=this.tokenizer.html(C)){C=C.substring(B.raw.length),E.push(B);continue}if(D&&(B=this.tokenizer.def(C))){C=C.substring(B.raw.length),this.tokens.links[B.tag]||(this.tokens.links[B.tag]={href:B.href,title:B.title});continue}if(B=this.tokenizer.table(C)){C=C.substring(B.raw.length),E.push(B);continue}if(B=this.tokenizer.lheading(C)){C=C.substring(B.raw.length),E.push(B);continue}if(D&&(B=this.tokenizer.paragraph(C))){C=C.substring(B.raw.length),E.push(B);continue}if(B=this.tokenizer.text(C,E)){C=C.substring(B.raw.length),B.type?E.push(B):(Ye=E[E.length-1],Ye.raw+=`
`+B.raw,Ye.text+=`
`+B.text);continue}if(C){var yt="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return E},q.inline=function(C){var E,D,B,ge,Oe,Ye,yt=C.length;for(E=0;E<yt;E++){Ye=C[E];switch(Ye.type){case"paragraph":case"text":case"heading":{Ye.tokens=[],this.inlineTokens(Ye.text,Ye.tokens);break}case"table":{for(Ye.tokens={header:[],cells:[]},ge=Ye.header.length,D=0;D<ge;D++)Ye.tokens.header[D]=[],this.inlineTokens(Ye.header[D],Ye.tokens.header[D]);for(ge=Ye.cells.length,D=0;D<ge;D++)for(Oe=Ye.cells[D],Ye.tokens.cells[D]=[],B=0;B<Oe.length;B++)Ye.tokens.cells[D][B]=[],this.inlineTokens(Oe[B],Ye.tokens.cells[D][B]);break}case"blockquote":{this.inline(Ye.tokens);break}case"list":{for(ge=Ye.items.length,D=0;D<ge;D++)this.inline(Ye.items[D].tokens);break}}}return C},q.inlineTokens=function(C,E,D,B,ge){E===void 0&&(E=[]),D===void 0&&(D=!1),B===void 0&&(B=!1),ge===void 0&&(ge="");var Oe,Ye=C,yt;if(this.tokens.links){var kt=Object.keys(this.tokens.links);if(kt.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(Ye))!=null;)kt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(Ye=Ye.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(Ye))!=null;)Ye=Ye.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;C;){if(Oe=this.tokenizer.escape(C)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.tag(C,D,B)){C=C.substring(Oe.raw.length),D=Oe.inLink,B=Oe.inRawBlock,E.push(Oe);continue}if(Oe=this.tokenizer.link(C)){C=C.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,B)),E.push(Oe);continue}if(Oe=this.tokenizer.reflink(C,this.tokens.links)){C=C.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,B)),E.push(Oe);continue}if(Oe=this.tokenizer.strong(C,Ye,ge)){C=C.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],D,B),E.push(Oe);continue}if(Oe=this.tokenizer.em(C,Ye,ge)){C=C.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],D,B),E.push(Oe);continue}if(Oe=this.tokenizer.codespan(C)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.br(C)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.del(C)){C=C.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],D,B),E.push(Oe);continue}if(Oe=this.tokenizer.autolink(C,re)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(!D&&(Oe=this.tokenizer.url(C,re))){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.inlineText(C,B,Ee)){C=C.substring(Oe.raw.length),ge=Oe.raw.slice(-1),E.push(Oe);continue}if(C){var Ke="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return E},he(ae,null,[{key:"rules",get:function(){return{block:M,inline:ve}}}]),ae}(),je=k.defaults,Ne=S.cleanUrl,ke=S.escape,Me=function(){function ae(ne){this.options=ne||je}var q=ae.prototype;return q.code=function(C,E,D){var B=(E||"").match(/\S*/)[0];if(this.options.highlight){var ge=this.options.highlight(C,B);ge!=null&&ge!==C&&(D=!0,C=ge)}return B?'<pre><code class="'+this.options.langPrefix+ke(B,!0)+'">'+(D?C:ke(C,!0))+`</code></pre>
`:"<pre><code>"+(D?C:ke(C,!0))+`</code></pre>
`},q.blockquote=function(C){return`<blockquote>
`+C+`</blockquote>
`},q.html=function(C){return C},q.heading=function(C,E,D,B){return this.options.headerIds?"<h"+E+' id="'+this.options.headerPrefix+B.slug(D)+'">'+C+"</h"+E+`>
`:"<h"+E+">"+C+"</h"+E+`>
`},q.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},q.list=function(C,E,D){var B=E?"ol":"ul",ge=E&&D!==1?' start="'+D+'"':"";return"<"+B+ge+`>
`+C+"</"+B+`>
`},q.listitem=function(C){return"<li>"+C+`</li>
`},q.checkbox=function(C){return"<input "+(C?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},q.paragraph=function(C){return"<p>"+C+`</p>
`},q.table=function(C,E){return E&&(E="<tbody>"+E+"</tbody>"),`<table>
<thead>
`+C+`</thead>
`+E+`</table>
`},q.tablerow=function(C){return`<tr>
`+C+`</tr>
`},q.tablecell=function(C,E){var D=E.header?"th":"td",B=E.align?"<"+D+' align="'+E.align+'">':"<"+D+">";return B+C+"</"+D+`>
`},q.strong=function(C){return"<strong>"+C+"</strong>"},q.em=function(C){return"<em>"+C+"</em>"},q.codespan=function(C){return"<code>"+C+"</code>"},q.br=function(){return this.options.xhtml?"<br/>":"<br>"},q.del=function(C){return"<del>"+C+"</del>"},q.link=function(C,E,D){if(C=Ne(this.options.sanitize,this.options.baseUrl,C),C===null)return D;var B='<a href="'+ke(C)+'"';return E&&(B+=' title="'+E+'"'),B+=">"+D+"</a>",B},q.image=function(C,E,D){if(C=Ne(this.options.sanitize,this.options.baseUrl,C),C===null)return D;var B='<img src="'+C+'" alt="'+D+'"';return E&&(B+=' title="'+E+'"'),B+=this.options.xhtml?"/>":">",B},q.text=function(C){return C},ae}(),Ue=function(){function ae(){}var q=ae.prototype;return q.strong=function(C){return C},q.em=function(C){return C},q.codespan=function(C){return C},q.del=function(C){return C},q.html=function(C){return C},q.text=function(C){return C},q.link=function(C,E,D){return""+D},q.image=function(C,E,D){return""+D},q.br=function(){return""},ae}(),et=function(){function ae(){this.seen={}}var q=ae.prototype;return q.slug=function(C){var E=C.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(E)){var D=E;do this.seen[D]++,E=D+"-"+this.seen[D];while(this.seen.hasOwnProperty(E))}return this.seen[E]=0,E},ae}(),Ve=k.defaults,Ze=S.unescape,Qe=function(){function ae(ne){this.options=ne||Ve,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new et}ae.parse=function(C,E){var D=new ae(E);return D.parse(C)};var q=ae.prototype;return q.parse=function(C,E){E===void 0&&(E=!0);var D="",B,ge,Oe,Ye,yt,kt,Ke,_t,mt,ot,Pt,At,Vt,jt,St,bn,rn,pt,Vn=C.length;for(B=0;B<Vn;B++){ot=C[B];switch(ot.type){case"space":continue;case"hr":{D+=this.renderer.hr();continue}case"heading":{D+=this.renderer.heading(this.parseInline(ot.tokens),ot.depth,Ze(this.parseInline(ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{D+=this.renderer.code(ot.text,ot.lang,ot.escaped);continue}case"table":{for(_t="",Ke="",Ye=ot.header.length,ge=0;ge<Ye;ge++)Ke+=this.renderer.tablecell(this.parseInline(ot.tokens.header[ge]),{header:!0,align:ot.align[ge]});for(_t+=this.renderer.tablerow(Ke),mt="",Ye=ot.cells.length,ge=0;ge<Ye;ge++){for(kt=ot.tokens.cells[ge],Ke="",yt=kt.length,Oe=0;Oe<yt;Oe++)Ke+=this.renderer.tablecell(this.parseInline(kt[Oe]),{header:!1,align:ot.align[Oe]});mt+=this.renderer.tablerow(Ke)}D+=this.renderer.table(_t,mt);continue}case"blockquote":{mt=this.parse(ot.tokens),D+=this.renderer.blockquote(mt);continue}case"list":{for(Pt=ot.ordered,At=ot.start,Vt=ot.loose,Ye=ot.items.length,mt="",ge=0;ge<Ye;ge++)St=ot.items[ge],bn=St.checked,rn=St.task,jt="",St.task&&(pt=this.renderer.checkbox(bn),Vt?St.tokens.length>0&&St.tokens[0].type==="text"?(St.tokens[0].text=pt+" "+St.tokens[0].text,St.tokens[0].tokens&&St.tokens[0].tokens.length>0&&St.tokens[0].tokens[0].type==="text"&&(St.tokens[0].tokens[0].text=pt+" "+St.tokens[0].tokens[0].text)):St.tokens.unshift({type:"text",text:pt}):jt+=pt),jt+=this.parse(St.tokens,Vt),mt+=this.renderer.listitem(jt,rn,bn);D+=this.renderer.list(mt,Pt,At);continue}case"html":{D+=this.renderer.html(ot.text);continue}case"paragraph":{D+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(mt=ot.tokens?this.parseInline(ot.tokens):ot.text;B+1<Vn&&C[B+1].type==="text";)ot=C[++B],mt+=`
`+(ot.tokens?this.parseInline(ot.tokens):ot.text);D+=E?this.renderer.paragraph(mt):mt;continue}default:{var xn='Token with "'+ot.type+'" type was not found.';if(this.options.silent){console.error(xn);return}else throw new Error(xn)}}}return D},q.parseInline=function(C,E){E=E||this.renderer;var D="",B,ge,Oe=C.length;for(B=0;B<Oe;B++){ge=C[B];switch(ge.type){case"escape":{D+=E.text(ge.text);break}case"html":{D+=E.html(ge.text);break}case"link":{D+=E.link(ge.href,ge.title,this.parseInline(ge.tokens,E));break}case"image":{D+=E.image(ge.href,ge.title,ge.text);break}case"strong":{D+=E.strong(this.parseInline(ge.tokens,E));break}case"em":{D+=E.em(this.parseInline(ge.tokens,E));break}case"codespan":{D+=E.codespan(ge.text);break}case"br":{D+=E.br();break}case"del":{D+=E.del(this.parseInline(ge.tokens,E));break}case"text":{D+=E.text(ge.text);break}default:{var Ye='Token with "'+ge.type+'" type was not found.';if(this.options.silent){console.error(Ye);return}else throw new Error(Ye)}}}return D},ae}(),at=S.merge,tt=S.checkSanitizeDeprecation,st=S.escape,Re=k.getDefaults,vt=k.changeDefaults,ut=k.defaults;function Be(ae,q,ne){if(typeof ae=="undefined"||ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ae)+", string expected");if(typeof q=="function"&&(ne=q,q=null),q=at({},Be.defaults,q||{}),tt(q),ne){var C=q.highlight,E;try{E=Ae.lex(ae,q)}catch(Oe){return ne(Oe)}var D=function(Ye){var yt;if(!Ye)try{yt=Qe.parse(E,q)}catch(kt){Ye=kt}return q.highlight=C,Ye?ne(Ye):ne(null,yt)};if(!C||C.length<3)return D();if(delete q.highlight,!E.length)return D();var B=0;Be.walkTokens(E,function(Oe){Oe.type==="code"&&(B++,setTimeout(function(){C(Oe.text,Oe.lang,function(Ye,yt){if(Ye)return D(Ye);yt!=null&&yt!==Oe.text&&(Oe.text=yt,Oe.escaped=!0),B--,B===0&&D()})},0))}),B===0&&D();return}try{var ge=Ae.lex(ae,q);return q.walkTokens&&Be.walkTokens(ge,q.walkTokens),Qe.parse(ge,q)}catch(Oe){if(Oe.message+=`
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+st(Oe.message+"",!0)+"</pre>";throw Oe}}Be.options=Be.setOptions=function(ae){return at(Be.defaults,ae),vt(Be.defaults),Be},Be.getDefaults=Re,Be.defaults=ut,Be.use=function(ae){var q=at({},ae);if(ae.renderer&&function(){var C=Be.defaults.renderer||new Me,E=function(ge){var Oe=C[ge];C[ge]=function(){for(var Ye=arguments.length,yt=new Array(Ye),kt=0;kt<Ye;kt++)yt[kt]=arguments[kt];var Ke=ae.renderer[ge].apply(C,yt);return Ke===!1&&(Ke=Oe.apply(C,yt)),Ke}};for(var D in ae.renderer)E(D);q.renderer=C}(),ae.tokenizer&&function(){var C=Be.defaults.tokenizer||new pe,E=function(ge){var Oe=C[ge];C[ge]=function(){for(var Ye=arguments.length,yt=new Array(Ye),kt=0;kt<Ye;kt++)yt[kt]=arguments[kt];var Ke=ae.tokenizer[ge].apply(C,yt);return Ke===!1&&(Ke=Oe.apply(C,yt)),Ke}};for(var D in ae.tokenizer)E(D);q.tokenizer=C}(),ae.walkTokens){var ne=Be.defaults.walkTokens;q.walkTokens=function(C){ae.walkTokens(C),ne&&ne(C)}}Be.setOptions(q)},Be.walkTokens=function(ae,q){for(var ne=se(ae),C;!(C=ne()).done;){var E=C.value;q(E);switch(E.type){case"table":{for(var D=se(E.tokens.header),B;!(B=D()).done;){var ge=B.value;Be.walkTokens(ge,q)}for(var Oe=se(E.tokens.cells),Ye;!(Ye=Oe()).done;)for(var yt=Ye.value,kt=se(yt),Ke;!(Ke=kt()).done;){var _t=Ke.value;Be.walkTokens(_t,q)}break}case"list":{Be.walkTokens(E.items,q);break}default:E.tokens&&Be.walkTokens(E.tokens,q)}}},Be.Parser=Qe,Be.parser=Qe.parse,Be.Renderer=Me,Be.TextRenderer=Ue,Be.Lexer=Ae,Be.lexer=Ae.lex,Be.Tokenizer=pe,Be.Slugger=et,Be.parse=Be;var $e=Be;return $e})},ELLl:function(nt,Ge,v){(function(z){z(v("VrN/"))})(function(z){var he={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},oe=z.Pos;z.defineOption("autoCloseBrackets",!1,function(I,G,X){X&&X!=z.Init&&(I.removeKeyMap(se),I.state.closeBrackets=null),G&&(V(xe(G,"pairs")),I.state.closeBrackets=G,I.addKeyMap(se))});function xe(I,G){return G=="pairs"&&typeof I=="string"?I:typeof I=="object"&&I[G]!=null?I[G]:he[G]}var se={Backspace:P,Enter:A};function V(I){for(var G=0;G<I.length;G++){var X=I.charAt(G),Y="'"+X+"'";se[Y]||(se[Y]=k(X))}}V(he.pairs+"`");function k(I){return function(G){return T(G,I)}}function L(I){var G=I.state.closeBrackets;if(!G||G.override)return G;var X=I.getModeAt(I.getCursor());return X.closeBrackets||G}function P(I){var G=L(I);if(!G||I.getOption("disableInput"))return z.Pass;for(var X=xe(G,"pairs"),Y=I.listSelections(),ce=0;ce<Y.length;ce++){if(!Y[ce].empty())return z.Pass;var De=Q(I,Y[ce].head);if(!De||X.indexOf(De)%2!=0)return z.Pass}for(var ce=Y.length-1;ce>=0;ce--){var Je=Y[ce].head;I.replaceRange("",oe(Je.line,Je.ch-1),oe(Je.line,Je.ch+1),"+delete")}}function A(I){var G=L(I),X=G&&xe(G,"explode");if(!X||I.getOption("disableInput"))return z.Pass;for(var Y=I.listSelections(),ce=0;ce<Y.length;ce++){if(!Y[ce].empty())return z.Pass;var De=Q(I,Y[ce].head);if(!De||X.indexOf(De)%2!=0)return z.Pass}I.operation(function(){var Je=I.lineSeparator()||`
`;I.replaceSelection(Je+Je,null),I.execCommand("goCharLeft"),Y=I.listSelections();for(var _e=0;_e<Y.length;_e++){var Te=Y[_e].head.line;I.indentLine(Te,null,!0),I.indentLine(Te+1,null,!0)}})}function R(I){var G=z.cmpPos(I.anchor,I.head)>0;return{anchor:new oe(I.anchor.line,I.anchor.ch+(G?-1:1)),head:new oe(I.head.line,I.head.ch+(G?1:-1))}}function T(I,G){var X=L(I);if(!X||I.getOption("disableInput"))return z.Pass;var Y=xe(X,"pairs"),ce=Y.indexOf(G);if(ce==-1)return z.Pass;for(var De=xe(X,"closeBefore"),Je=xe(X,"triples"),_e=Y.charAt(ce+1)==G,Te=I.listSelections(),Fe=ce%2==0,we,Se=0;Se<Te.length;Se++){var Pe=Te[Se],be=Pe.head,O,ue=I.getRange(be,oe(be.line,be.ch+1));if(Fe&&!Pe.empty())O="surround";else if((_e||!Fe)&&ue==G)_e&&H(I,be)?O="both":Je.indexOf(G)>=0&&I.getRange(be,oe(be.line,be.ch+3))==G+G+G?O="skipThree":O="skip";else if(_e&&be.ch>1&&Je.indexOf(G)>=0&&I.getRange(oe(be.line,be.ch-2),be)==G+G){if(be.ch>2&&/\bstring/.test(I.getTokenTypeAt(oe(be.line,be.ch-2))))return z.Pass;O="addFour"}else if(_e){var J=be.ch==0?" ":I.getRange(oe(be.line,be.ch-1),be);if(!z.isWordChar(ue)&&J!=G&&!z.isWordChar(J))O="both";else return z.Pass}else if(Fe&&(ue.length===0||/\s/.test(ue)||De.indexOf(ue)>-1))O="both";else return z.Pass;if(!we)we=O;else if(we!=O)return z.Pass}var x=ce%2?Y.charAt(ce-1):G,j=ce%2?G:Y.charAt(ce+1);I.operation(function(){if(we=="skip")I.execCommand("goCharRight");else if(we=="skipThree")for(var N=0;N<3;N++)I.execCommand("goCharRight");else if(we=="surround"){for(var w=I.getSelections(),N=0;N<w.length;N++)w[N]=x+w[N]+j;I.replaceSelections(w,"around"),w=I.listSelections().slice();for(var N=0;N<w.length;N++)w[N]=R(w[N]);I.setSelections(w)}else we=="both"?(I.replaceSelection(x+j,null),I.triggerElectric(x+j),I.execCommand("goCharLeft")):we=="addFour"&&(I.replaceSelection(x+x+x+x,"before"),I.execCommand("goCharRight"))})}function Q(I,G){var X=I.getRange(oe(G.line,G.ch-1),oe(G.line,G.ch+1));return X.length==2?X:null}function H(I,G){var X=I.getTokenAt(oe(G.line,G.ch+1));return/\bstring/.test(X.type)&&X.start==G.ch&&(G.ch==0||!/\bstring/.test(I.getTokenTypeAt(G)))}})},GfqC:function(nt,Ge,v){"use strict";var z=v("q1tI"),he=v.n(z),oe=v("TSYQ"),xe=v.n(oe);function se(S,p){var d="cannot "+S.method+" "+S.action+" "+p.status+"'",_=new Error(d);return _.status=p.status,_.method=S.method,_.url=S.action,_}function V(S){var p=S.responseText||S.response;if(!p)return p;try{return JSON.parse(p)}catch(d){return p}}function k(S){var p=new XMLHttpRequest;S.onProgress&&p.upload&&(p.upload.onprogress=function(te){te.total>0&&(te.percent=te.loaded/te.total*100),S.onProgress(te)});var d=new FormData;S.data&&Object.keys(S.data).forEach(function(F){var te=S.data[F];if(Array.isArray(te)){te.forEach(function(Ce){d.append(F+"[]",Ce)});return}d.append(F,S.data[F])}),S.file instanceof Blob?d.append(S.filename,S.file,S.file.name):d.append(S.filename,S.file),p.onerror=function(te){S.onError(te)},p.onload=function(){return p.status<200||p.status>=300?S.onError(se(S,p),V(p)):S.onSuccess(V(p),p)},p.open(S.method,S.action,!0),S.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var _=S.headers||{};return _["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(_).forEach(function(F){_[F]!==null&&p.setRequestHeader(F,_[F])}),p.send(d),{abort:function(){p.abort()}}}var L=+new Date,P=0;function A(){return"rc-upload-"+L+"-"+ ++P}function R(S,p){return S.indexOf(p,S.length-p.length)!==-1}var T=function(S,p){if(S&&p){var d=Array.isArray(p)?p:p.split(","),_=S.name||"",F=S.type||"",te=F.replace(/\/.*$/,"");return d.some(function(Ce){var Le=Ce.trim();return Le.charAt(0)==="."?R(_.toLowerCase(),Le.toLowerCase()):/\/\*$/.test(Le)?te===Le.replace(/\/.*$/,""):F===Le})}return!0};function Q(S,p){var d=S.createReader(),_=[];function F(){d.readEntries(function(te){var Ce=Array.prototype.slice.apply(te);_=_.concat(Ce);var Le=!Ce.length;Le?p(_):F()})}F()}var H=function(p,d,_){var F=function te(Ce,Le){Le=Le||"",Ce.isFile?Ce.file(function(pe){_(pe)&&(Ce.fullPath&&!pe.webkitRelativePath&&(Object.defineProperties(pe,{webkitRelativePath:{writable:!0}}),pe.webkitRelativePath=Ce.fullPath.replace(/^\//,""),Object.defineProperties(pe,{webkitRelativePath:{writable:!1}})),d([pe]))}):Ce.isDirectory&&Q(Ce,function(pe){pe.forEach(function(fe){te(fe,""+Le+Ce.name+"/")})})};p.forEach(function(te){F(te.webkitGetAsEntry())})},I=H,G=Object.assign||function(S){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var _ in d)Object.prototype.hasOwnProperty.call(d,_)&&(S[_]=d[_])}return S},X=function(){function S(p,d){var _=[],F=!0,te=!1,Ce=void 0;try{for(var Le=p[Symbol.iterator](),pe;!(F=(pe=Le.next()).done)&&!(_.push(pe.value),d&&_.length===d);F=!0);}catch(fe){te=!0,Ce=fe}finally{try{!F&&Le.return&&Le.return()}finally{if(te)throw Ce}}return _}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return S(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Y=function(){function S(p,d){for(var _=0;_<d.length;_++){var F=d[_];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,_){return d&&S(p.prototype,d),_&&S(p,_),p}}();function ce(S,p,d){return p in S?Object.defineProperty(S,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):S[p]=d,S}function De(S,p){var d={};for(var _ in S){if(p.indexOf(_)>=0)continue;if(!Object.prototype.hasOwnProperty.call(S,_))continue;d[_]=S[_]}return d}function Je(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function _e(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function Te(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var Fe=function(p){return Object.keys(p).reduce(function(d,_){return(_.substr(0,5)==="data-"||_.substr(0,5)==="aria-"||_==="role")&&(d[_]=p[_]),d},{})},we=function(S){Te(p,S);function p(){var d,_,F,te;Je(this,p);for(var Ce=arguments.length,Le=Array(Ce),pe=0;pe<Ce;pe++)Le[pe]=arguments[pe];return te=(_=(F=_e(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Le))),F),F.state={uid:A()},F.reqs={},F.onChange=function(fe){var ie=fe.target.files;F.uploadFiles(ie),F.reset()},F.onClick=function(fe){var ie=F.fileInput;if(!ie)return;var le=F.props,ee=le.children,U=le.onClick;ee&&ee.type==="button"&&(ie.parentNode.focus(),ie.parentNode.querySelector("button").blur()),ie.click(),U&&U(fe)},F.onKeyDown=function(fe){fe.key==="Enter"&&F.onClick()},F.onFileDrop=function(fe){var ie=F.props.multiple;if(fe.preventDefault(),fe.type==="dragover")return;if(F.props.directory)I(Array.prototype.slice.call(fe.dataTransfer.items),F.uploadFiles,function(ee){return T(ee,F.props.accept)});else{var le=Array.prototype.slice.call(fe.dataTransfer.files).filter(function(ee){return T(ee,F.props.accept)});ie===!1&&(le=le.slice(0,1)),F.uploadFiles(le)}},F.uploadFiles=function(fe){var ie=Array.prototype.slice.call(fe);ie.map(function(le){return le.uid=A(),le}).forEach(function(le){F.upload(le,ie)})},F.saveFileInput=function(fe){F.fileInput=fe},_),_e(F,te)}return Y(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(_,F){var te=this,Ce=this.props;if(!Ce.beforeUpload)return setTimeout(function(){return te.post(_)},0);var Le=Ce.beforeUpload(_,F);Le&&Le.then?Le.then(function(pe){var fe=Object.prototype.toString.call(pe);return fe==="[object File]"||fe==="[object Blob]"?te.post(pe):te.post(_)}).catch(function(pe){console.log(pe)}):Le!==!1&&setTimeout(function(){return te.post(_)},0);return}},{key:"post",value:function(_){var F=this;if(!this._isMounted)return;var te=this.props,Ce=te.onStart,Le=te.onProgress,pe=te.transformFile,fe=pe===void 0?function(ie){return ie}:pe;new Promise(function(ie){var le=te.action;return typeof le=="function"&&(le=le(_)),ie(le)}).then(function(ie){var le=_.uid,ee=te.customRequest||k,U=Promise.resolve(fe(_)).then(function(b){var K=te.data;return typeof K=="function"&&(K=K(b)),Promise.all([b,K])}).catch(function(b){console.error(b)});U.then(function(b){var K=X(b,2),M=K[0],ve=K[1],Ee={action:ie,filename:te.name,data:ve,file:M,headers:te.headers,withCredentials:te.withCredentials,method:te.method||"post",onProgress:Le?function(re){Le(re,_)}:null,onSuccess:function(Ae,je){delete F.reqs[le],te.onSuccess(Ae,_,je)},onError:function(Ae,je){delete F.reqs[le],te.onError(Ae,je,_)}};Ce(_),F.reqs[le]=ee(Ee)})})}},{key:"reset",value:function(){this.setState({uid:A()})}},{key:"abort",value:function(_){var F=this.reqs;if(_){var te=_;_&&_.uid&&(te=_.uid),F[te]&&F[te].abort&&F[te].abort(),delete F[te]}else Object.keys(F).forEach(function(Ce){F[Ce]&&F[Ce].abort&&F[Ce].abort(),delete F[Ce]})}},{key:"render",value:function(){var _,F=this.props,te=F.component,Ce=F.prefixCls,Le=F.className,pe=F.disabled,fe=F.id,ie=F.style,le=F.multiple,ee=F.accept,U=F.children,b=F.directory,K=F.openFileDialogOnClick,M=F.onMouseEnter,ve=F.onMouseLeave,Ee=De(F,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),re=xe()((_={},ce(_,Ce,!0),ce(_,Ce+"-disabled",pe),ce(_,Le,Le),_)),Ae=pe?{}:{onClick:K?this.onClick:function(){},onKeyDown:K?this.onKeyDown:function(){},onMouseEnter:M,onMouseLeave:ve,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return he.a.createElement(te,G({},Ae,{className:re,role:"button",style:ie}),he.a.createElement("input",G({},Fe(Ee),{id:fe,type:"file",ref:this.saveFileInput,onClick:function(Ne){return Ne.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ee,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:le,onChange:this.onChange})),U)}}]),p}(z.Component),Se=we,Pe=Object.assign||function(S){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var _ in d)Object.prototype.hasOwnProperty.call(d,_)&&(S[_]=d[_])}return S},be=function(){function S(p,d){for(var _=0;_<d.length;_++){var F=d[_];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,_){return d&&S(p.prototype,d),_&&S(p,_),p}}();function O(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function ue(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function J(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}function x(){}var j=function(S){J(p,S);function p(){var d,_,F,te;O(this,p);for(var Ce=arguments.length,Le=Array(Ce),pe=0;pe<Ce;pe++)Le[pe]=arguments[pe];return te=(_=(F=ue(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Le))),F),F.saveUploader=function(fe){F.uploader=fe},_),ue(F,te)}return be(p,[{key:"abort",value:function(_){this.uploader.abort(_)}},{key:"render",value:function(){return he.a.createElement(Se,Pe({},this.props,{ref:this.saveUploader}))}}]),p}(z.Component);j.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:x,onError:x,onSuccess:x,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var N=j,w=Ge.a=N},Gytx:function(nt,Ge){nt.exports=function(z,he,oe,xe){var se=oe?oe.call(xe,z,he):void 0;if(se!==void 0)return!!se;if(z===he)return!0;if(typeof z!="object"||!z||typeof he!="object"||!he)return!1;var V=Object.keys(z),k=Object.keys(he);if(V.length!==k.length)return!1;for(var L=Object.prototype.hasOwnProperty.bind(he),P=0;P<V.length;P++){var A=V[P];if(!L(A))return!1;var R=z[A],T=he[A];if(se=oe?oe.call(xe,R,T,A):void 0,se===!1||se===void 0&&R!==T)return!1}return!0}},H38U:function(nt,Ge,v){var z=v("f4xo"),he=v("rcnY"),oe=v("wU8J"),xe=v("Iq15"),se=v("dWSS");function V(L,P){this.typeNumber=L,this.errorCorrectLevel=P,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var k=V.prototype;k.addData=function(L){var P=new z(L);this.dataList.push(P),this.dataCache=null},k.isDark=function(L,P){if(L<0||this.moduleCount<=L||P<0||this.moduleCount<=P)throw new Error(L+","+P);return this.modules[L][P]},k.getModuleCount=function(){return this.moduleCount},k.make=function(){if(this.typeNumber<1){var L=1;for(L=1;L<40;L++){for(var P=he.getRSBlocks(L,this.errorCorrectLevel),A=new oe,R=0,T=0;T<P.length;T++)R+=P[T].dataCount;for(var T=0;T<this.dataList.length;T++){var Q=this.dataList[T];A.put(Q.mode,4),A.put(Q.getLength(),xe.getLengthInBits(Q.mode,L)),Q.write(A)}if(A.getLengthInBits()<=R*8)break}this.typeNumber=L}this.makeImpl(!1,this.getBestMaskPattern())},k.makeImpl=function(L,P){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var A=0;A<this.moduleCount;A++){this.modules[A]=new Array(this.moduleCount);for(var R=0;R<this.moduleCount;R++)this.modules[A][R]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(L,P),this.typeNumber>=7&&this.setupTypeNumber(L),this.dataCache==null&&(this.dataCache=V.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,P)},k.setupPositionProbePattern=function(L,P){for(var A=-1;A<=7;A++){if(L+A<=-1||this.moduleCount<=L+A)continue;for(var R=-1;R<=7;R++){if(P+R<=-1||this.moduleCount<=P+R)continue;0<=A&&A<=6&&(R==0||R==6)||0<=R&&R<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=R&&R<=4?this.modules[L+A][P+R]=!0:this.modules[L+A][P+R]=!1}}},k.getBestMaskPattern=function(){for(var L=0,P=0,A=0;A<8;A++){this.makeImpl(!0,A);var R=xe.getLostPoint(this);(A==0||L>R)&&(L=R,P=A)}return P},k.createMovieClip=function(L,P,A){var R=L.createEmptyMovieClip(P,A),T=1;this.make();for(var Q=0;Q<this.modules.length;Q++)for(var H=Q*T,I=0;I<this.modules[Q].length;I++){var G=I*T,X=this.modules[Q][I];X&&(R.beginFill(0,100),R.moveTo(G,H),R.lineTo(G+T,H),R.lineTo(G+T,H+T),R.lineTo(G,H+T),R.endFill())}return R},k.setupTimingPattern=function(){for(var L=8;L<this.moduleCount-8;L++){if(this.modules[L][6]!=null)continue;this.modules[L][6]=L%2==0}for(var P=8;P<this.moduleCount-8;P++){if(this.modules[6][P]!=null)continue;this.modules[6][P]=P%2==0}},k.setupPositionAdjustPattern=function(){for(var L=xe.getPatternPosition(this.typeNumber),P=0;P<L.length;P++)for(var A=0;A<L.length;A++){var R=L[P],T=L[A];if(this.modules[R][T]!=null)continue;for(var Q=-2;Q<=2;Q++)for(var H=-2;H<=2;H++)Q==-2||Q==2||H==-2||H==2||Q==0&&H==0?this.modules[R+Q][T+H]=!0:this.modules[R+Q][T+H]=!1}},k.setupTypeNumber=function(L){for(var P=xe.getBCHTypeNumber(this.typeNumber),A=0;A<18;A++){var R=!L&&(P>>A&1)==1;this.modules[Math.floor(A/3)][A%3+this.moduleCount-8-3]=R}for(var A=0;A<18;A++){var R=!L&&(P>>A&1)==1;this.modules[A%3+this.moduleCount-8-3][Math.floor(A/3)]=R}},k.setupTypeInfo=function(L,P){for(var A=this.errorCorrectLevel<<3|P,R=xe.getBCHTypeInfo(A),T=0;T<15;T++){var Q=!L&&(R>>T&1)==1;T<6?this.modules[T][8]=Q:T<8?this.modules[T+1][8]=Q:this.modules[this.moduleCount-15+T][8]=Q}for(var T=0;T<15;T++){var Q=!L&&(R>>T&1)==1;T<8?this.modules[8][this.moduleCount-T-1]=Q:T<9?this.modules[8][15-T-1+1]=Q:this.modules[8][15-T-1]=Q}this.modules[this.moduleCount-8][8]=!L},k.mapData=function(L,P){for(var A=-1,R=this.moduleCount-1,T=7,Q=0,H=this.moduleCount-1;H>0;H-=2)for(H==6&&H--;;){for(var I=0;I<2;I++)if(this.modules[R][H-I]==null){var G=!1;Q<L.length&&(G=(L[Q]>>>T&1)==1);var X=xe.getMask(P,R,H-I);X&&(G=!G),this.modules[R][H-I]=G,T--,T==-1&&(Q++,T=7)}if(R+=A,R<0||this.moduleCount<=R){R-=A,A=-A;break}}},V.PAD0=236,V.PAD1=17,V.createData=function(L,P,A){for(var R=he.getRSBlocks(L,P),T=new oe,Q=0;Q<A.length;Q++){var H=A[Q];T.put(H.mode,4),T.put(H.getLength(),xe.getLengthInBits(H.mode,L)),H.write(T)}for(var I=0,Q=0;Q<R.length;Q++)I+=R[Q].dataCount;if(T.getLengthInBits()>I*8)throw new Error("code length overflow. ("+T.getLengthInBits()+">"+I*8+")");for(T.getLengthInBits()+4<=I*8&&T.put(0,4);T.getLengthInBits()%8!=0;)T.putBit(!1);for(;!(T.getLengthInBits()>=I*8);){if(T.put(V.PAD0,8),T.getLengthInBits()>=I*8)break;T.put(V.PAD1,8)}return V.createBytes(T,R)},V.createBytes=function(L,P){for(var A=0,R=0,T=0,Q=new Array(P.length),H=new Array(P.length),I=0;I<P.length;I++){var G=P[I].dataCount,X=P[I].totalCount-G;R=Math.max(R,G),T=Math.max(T,X),Q[I]=new Array(G);for(var Y=0;Y<Q[I].length;Y++)Q[I][Y]=255&L.buffer[Y+A];A+=G;var ce=xe.getErrorCorrectPolynomial(X),De=new se(Q[I],ce.getLength()-1),Je=De.mod(ce);H[I]=new Array(ce.getLength()-1);for(var Y=0;Y<H[I].length;Y++){var _e=Y+Je.getLength()-H[I].length;H[I][Y]=_e>=0?Je.get(_e):0}}for(var Te=0,Y=0;Y<P.length;Y++)Te+=P[Y].totalCount;for(var Fe=new Array(Te),we=0,Y=0;Y<R;Y++)for(var I=0;I<P.length;I++)Y<Q[I].length&&(Fe[we++]=Q[I][Y]);for(var Y=0;Y<T;Y++)for(var I=0;I<P.length;I++)Y<H[I].length&&(Fe[we++]=H[I][Y]);return Fe},nt.exports=V},HmJG:function(nt,Ge,v){},IE1O:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return Fe});var z=v("2qtc"),he=v("kLXV"),oe=v("DZo9"),xe=v("8z0m"),se=v("+L6B"),V=v("2/Rp"),k=v("5NDa"),L=v("5rEg"),P=v("miYZ"),A=v("tsqr"),R=v("9og8"),T=v("y8nQ"),Q=v("Vl3Y"),H=v("tJVT"),I=v("WmNS"),G=v.n(I),X=v("q1tI"),Y=v.n(X),ce=v("KeLC"),De=v.n(ce),Je=v("m3rI"),_e=v("jN4g"),Te=function(Se){var Pe,be,O,ue,J=Se.visible,x=Se.onOk,j=Se.onCancel,N=Se.title,w=N===void 0?"\u9009\u62E9\u8BA4\u8BC1\u56E2\u961F\u6559\u5E08":N,S=Q.a.useForm(),p=Object(H.a)(S,1),d=p[0],_=Object(X.useState)(!1),F=Object(H.a)(_,2),te=F[0],Ce=F[1],Le=Object(X.useState)([]),pe=Object(H.a)(Le,2),fe=pe[0],ie=pe[1],le=Object(X.useState)([]),ee=Object(H.a)(le,2),U=ee[0],b=ee[1],K=Object(X.useState)(!1),M=Object(H.a)(K,2),ve=M[0],Ee=M[1];Object(X.useEffect)(function(){if(J!=null&&J.name){var et,Ve,Ze,Qe;d.setFieldsValue({name:J==null?void 0:J.name});var at=J!=null&&(et=J.cover_url)!==null&&et!==void 0&&et.includes("attachments")?[{response:{id:J==null||((Ve=J.cover_url)===null||Ve===void 0)?void 0:Ve.split("/")[3]}}]:[],tt=J!=null&&(Ze=J.backbground_image_url)!==null&&Ze!==void 0&&Ze.includes("attachments")?[{response:{id:J==null||((Qe=J.backbground_image_url)===null||Qe===void 0)?void 0:Qe.split("/")[3]}}]:[];ie(at),b(tt)}},[J]);var re=function(){d.submit()},Ae=function(){j()},je=function(){var et=Object(R.a)(G.a.mark(function Ve(Ze){var Qe,at,tt,st,Re;return G.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:Ce(!0),console.log(fe,U,3333),Re={name:Ze==null?void 0:Ze.name,cover_id:(fe==null||((Qe=fe[0])===null||Qe===void 0||((at=Qe.response)===null||at===void 0))?void 0:at.id)||"",backbground_image_id:(U==null||((tt=U[0])===null||tt===void 0||((st=tt.response)===null||st===void 0))?void 0:st.id)||""},x(Re);case 4:case"end":return ut.stop()}},Ve)}));return function(Ze){return et.apply(this,arguments)}}(),Ne=function(Ve,Ze){var Qe=["uploading","done","removed"];Qe.includes(Ve.file.status)&&(Ve.file.status==="uploading"&&Ee(!0),Ve.file.status==="done"&&Ee(!1),Ze===1?ie(Ve.fileList):b(Ve.fileList))},ke=function(Ve,Ze){Ze===1?ie([]):b([])},Me=function(Ve,Ze){var Qe=Ve.type==="image/jpeg"||Ve.type==="image/png";if(!Qe)return A.b.error("\u8BF7\u4E0A\u4F20jpg\u6216png\u7684\u56FE\u7247!"),!1;var at=Ve.size/1024/1024>2;return at?(A.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E2MB"),!1):(Ze===1?ie([]):b([]),!0)},Ue=function(Ve){var Ze,Qe,at,tt;return Y.a.createElement("div",{className:De.a.img},Y.a.createElement("img",{src:Je.a.API_SERVER+"/api/attachments/"+(Ve===1?fe==null||((Ze=fe[0])===null||Ze===void 0||((Qe=Ze.response)===null||Qe===void 0))?void 0:Qe.id:U==null||((at=U[0])===null||at===void 0||((tt=at.response)===null||tt===void 0))?void 0:tt.id),alt:"avatar",style:{width:"100%"}}),Y.a.createElement("div",null,Y.a.createElement(_e.a,{onClick:function(){Ve===1?ie([]):b([])},style:{fontSize:"16px",color:"red"}})))};return Y.a.createElement(he.a,{title:w,visible:J,onOk:re,centered:!0,onCancel:Ae,confirmLoading:te,okButtonProps:{disabled:ve},width:686,afterClose:function(){Ce(!1),ie([]),b([]),d.resetFields()},okText:J!=null&&J.name?"\u786E\u8BA4":"\u786E\u8BA4\u65B0\u5EFA",cancelText:"\u53D6\u6D88"},Y.a.createElement(Q.a,{form:d,colon:!1,onFinish:je,labelCol:{span:4},wrapperCol:{span:18},className:De.a.form},Y.a.createElement(Q.a.Item,{label:"\u793E\u533A\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{max:60,message:"\u53EA\u80FD\u8F93\u516560\u4E2A\u5B57\u7B26"}]},Y.a.createElement(L.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"})),Y.a.createElement(Q.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",valuePropName:"fileList"},Y.a.createElement("div",{className:De.a.upload},fe!=null&&(Pe=fe[0])!==null&&Pe!==void 0&&(be=Pe.response)!==null&&be!==void 0&&be.id?Ue(1):Y.a.createElement(xe.a,{fileList:fe,action:"".concat(Je.a.API_SERVER,"/api/attachments.json"),onChange:function(Ve){return Ne(Ve,1)},onRemove:function(Ve){return ke(Ve,1)},beforeUpload:function(Ve){return Me(Ve,1)},withCredentials:!0,accept:"image/*"},Y.a.createElement(V.a,null,Y.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Y.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528278*225\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"))),Y.a.createElement(Q.a.Item,{name:"backbground_image_id",label:"\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",valuePropName:"fileList"},Y.a.createElement("div",{className:De.a.upload},U!=null&&(O=U[0])!==null&&O!==void 0&&(ue=O.response)!==null&&ue!==void 0&&ue.id?Ue(2):Y.a.createElement(xe.a,{fileList:U,action:"".concat(Je.a.API_SERVER,"/api/attachments.json"),onChange:function(Ve){return Ne(Ve,2)},onRemove:function(Ve){return ke(Ve,2)},beforeUpload:function(Ve){return Me(Ve,2)},withCredentials:!0,accept:"image/*"},Y.a.createElement(V.a,null,Y.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Y.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u75281920*220\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002")))))},Fe=function(Se){var Pe,be,O,ue,J=Se.data,x=Se.onOk,j=Q.a.useForm(),N=Object(H.a)(j,1),w=N[0],S=Object(X.useState)(!1),p=Object(H.a)(S,2),d=p[0],_=p[1],F=Object(X.useState)([]),te=Object(H.a)(F,2),Ce=te[0],Le=te[1],pe=Object(X.useState)([]),fe=Object(H.a)(pe,2),ie=fe[0],le=fe[1],ee=Object(X.useState)(!1),U=Object(H.a)(ee,2),b=U[0],K=U[1];Object(X.useEffect)(function(){if(J!=null&&J.name){var Ne,ke,Me,Ue;w.setFieldsValue({name:J==null?void 0:J.name});var et=J!=null&&(Ne=J.cover_url)!==null&&Ne!==void 0&&Ne.includes("attachments")?[{response:{id:J==null||((ke=J.cover_url)===null||ke===void 0)?void 0:ke.split("/")[3]}}]:[],Ve=J!=null&&(Me=J.backbground_image_url)!==null&&Me!==void 0&&Me.includes("attachments")?[{response:{id:J==null||((Ue=J.backbground_image_url)===null||Ue===void 0)?void 0:Ue.split("/")[3]}}]:[];Le(et),le(Ve)}},[J]);var M=function(){w.submit()},ve=function(){var Ne=Object(R.a)(G.a.mark(function ke(Me){var Ue,et,Ve,Ze,Qe;return G.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:_(!0),Qe={name:Me==null?void 0:Me.name,cover_id:(Ce==null||((Ue=Ce[0])===null||Ue===void 0||((et=Ue.response)===null||et===void 0))?void 0:et.id)||"",backbground_image_id:(ie==null||((Ve=ie[0])===null||Ve===void 0||((Ze=Ve.response)===null||Ze===void 0))?void 0:Ze.id)||""},x(Qe,function(){_(!1)});case 3:case"end":return tt.stop()}},ke)}));return function(Me){return Ne.apply(this,arguments)}}(),Ee=function(ke,Me){var Ue=["uploading","done","removed"];Ue.includes(ke.file.status)&&(ke.file.status==="uploading"&&K(!0),ke.file.status==="done"&&K(!1),Me===1?Le(ke.fileList):le(ke.fileList))},re=function(ke,Me){Me===1?Le([]):le([])},Ae=function(ke,Me){var Ue=ke.type==="image/jpeg"||ke.type==="image/png";if(!Ue)return A.b.error("\u8BF7\u4E0A\u4F20jpg\u6216png\u7684\u56FE\u7247!"),!1;var et=ke.size/1024/1024>2;return et?(A.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E2MB"),!1):(Me===1?Le([]):le([]),!0)},je=function(ke){var Me,Ue,et,Ve;return Y.a.createElement("div",{className:De.a.img},Y.a.createElement("img",{src:Je.a.API_SERVER+"/api/attachments/"+(ke===1?Ce==null||((Me=Ce[0])===null||Me===void 0||((Ue=Me.response)===null||Ue===void 0))?void 0:Ue.id:ie==null||((et=ie[0])===null||et===void 0||((Ve=et.response)===null||Ve===void 0))?void 0:Ve.id),alt:"avatar",style:{width:"100%"}}),Y.a.createElement("div",null,Y.a.createElement(_e.a,{onClick:function(){ke===1?Le([]):le([])},style:{fontSize:"16px",color:"red"}})))};return Y.a.createElement(Q.a,{form:w,colon:!1,onFinish:ve,labelCol:{span:3},wrapperCol:{span:19},className:De.a.form},Y.a.createElement(Q.a.Item,{label:"\u793E\u533A\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{max:60,message:"\u53EA\u80FD\u8F93\u516560\u4E2A\u5B57\u7B26"}]},Y.a.createElement(L.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"})),Y.a.createElement(Q.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",valuePropName:"fileList"},Y.a.createElement("div",{className:De.a.upload},Ce!=null&&(Pe=Ce[0])!==null&&Pe!==void 0&&(be=Pe.response)!==null&&be!==void 0&&be.id?je(1):Y.a.createElement(xe.a,{fileList:Ce,action:"".concat(Je.a.API_SERVER,"/api/attachments.json"),onChange:function(ke){return Ee(ke,1)},onRemove:function(ke){return re(ke,1)},beforeUpload:function(ke){return Ae(ke,1)},withCredentials:!0,accept:"image/*"},Y.a.createElement(V.a,null,Y.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Y.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528278*225\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"))),Y.a.createElement(Q.a.Item,{name:"backbground_image_id",label:"\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",valuePropName:"fileList"},Y.a.createElement("div",{className:De.a.upload},ie!=null&&(O=ie[0])!==null&&O!==void 0&&(ue=O.response)!==null&&ue!==void 0&&ue.id?je(2):Y.a.createElement(xe.a,{fileList:ie,action:"".concat(Je.a.API_SERVER,"/api/attachments.json"),onChange:function(ke){return Ee(ke,2)},onRemove:function(ke){return re(ke,2)},beforeUpload:function(ke){return Ae(ke,2)},withCredentials:!0,accept:"image/*"},Y.a.createElement(V.a,null,Y.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Y.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u75281920*220\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"))),Y.a.createElement(V.a,{disabled:b,loading:d,type:"primary",onClick:M,style:{marginLeft:120}},"\u786E\u8BA4"))};Ge.b=Te},Iq15:function(nt,Ge,v){var z=v("nVVt"),he=v("dWSS"),oe=v("dQei"),xe={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},se={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(V){for(var k=V<<10;se.getBCHDigit(k)-se.getBCHDigit(se.G15)>=0;)k^=se.G15<<se.getBCHDigit(k)-se.getBCHDigit(se.G15);return(V<<10|k)^se.G15_MASK},getBCHTypeNumber:function(V){for(var k=V<<12;se.getBCHDigit(k)-se.getBCHDigit(se.G18)>=0;)k^=se.G18<<se.getBCHDigit(k)-se.getBCHDigit(se.G18);return V<<12|k},getBCHDigit:function(V){for(var k=0;V!=0;)k++,V>>>=1;return k},getPatternPosition:function(V){return se.PATTERN_POSITION_TABLE[V-1]},getMask:function(V,k,L){switch(V){case xe.PATTERN000:return(k+L)%2==0;case xe.PATTERN001:return k%2==0;case xe.PATTERN010:return L%3==0;case xe.PATTERN011:return(k+L)%3==0;case xe.PATTERN100:return(Math.floor(k/2)+Math.floor(L/3))%2==0;case xe.PATTERN101:return k*L%2+k*L%3==0;case xe.PATTERN110:return(k*L%2+k*L%3)%2==0;case xe.PATTERN111:return(k*L%3+(k+L)%2)%2==0;default:throw new Error("bad maskPattern:"+V)}},getErrorCorrectPolynomial:function(V){for(var k=new he([1],0),L=0;L<V;L++)k=k.multiply(new he([1,oe.gexp(L)],0));return k},getLengthInBits:function(V,k){if(1<=k&&k<10)switch(V){case z.MODE_NUMBER:return 10;case z.MODE_ALPHA_NUM:return 9;case z.MODE_8BIT_BYTE:return 8;case z.MODE_KANJI:return 8;default:throw new Error("mode:"+V)}else if(k<27)switch(V){case z.MODE_NUMBER:return 12;case z.MODE_ALPHA_NUM:return 11;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 10;default:throw new Error("mode:"+V)}else if(k<41)switch(V){case z.MODE_NUMBER:return 14;case z.MODE_ALPHA_NUM:return 13;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 12;default:throw new Error("mode:"+V)}else throw new Error("type:"+k)},getLostPoint:function(V){for(var k=V.getModuleCount(),L=0,P=0;P<k;P++)for(var A=0;A<k;A++){for(var R=0,T=V.isDark(P,A),Q=-1;Q<=1;Q++){if(P+Q<0||k<=P+Q)continue;for(var H=-1;H<=1;H++){if(A+H<0||k<=A+H)continue;if(Q==0&&H==0)continue;T==V.isDark(P+Q,A+H)&&R++}}R>5&&(L+=3+R-5)}for(var P=0;P<k-1;P++)for(var A=0;A<k-1;A++){var I=0;V.isDark(P,A)&&I++,V.isDark(P+1,A)&&I++,V.isDark(P,A+1)&&I++,V.isDark(P+1,A+1)&&I++,(I==0||I==4)&&(L+=3)}for(var P=0;P<k;P++)for(var A=0;A<k-6;A++)V.isDark(P,A)&&!V.isDark(P,A+1)&&V.isDark(P,A+2)&&V.isDark(P,A+3)&&V.isDark(P,A+4)&&!V.isDark(P,A+5)&&V.isDark(P,A+6)&&(L+=40);for(var A=0;A<k;A++)for(var P=0;P<k-6;P++)V.isDark(P,A)&&!V.isDark(P+1,A)&&V.isDark(P+2,A)&&V.isDark(P+3,A)&&V.isDark(P+4,A)&&!V.isDark(P+5,A)&&V.isDark(P+6,A)&&(L+=40);for(var G=0,A=0;A<k;A++)for(var P=0;P<k;P++)V.isDark(P,A)&&G++;var X=Math.abs(100*G/k/k-50)/5;return L+=X*10,L}};nt.exports=se},KeLC:function(nt,Ge,v){nt.exports={flex_box_center:"flex_box_center___WC8D3",flex_space_between:"flex_space_between___1oJuS",flex_box_vertical_center:"flex_box_vertical_center___wHVAB",flex_box_center_end:"flex_box_center_end___2rX0l",flex_box_column:"flex_box_column___Iu_rf",form:"form___RRVwq",upload:"upload___2PzlY",img:"img___qC8f0"}},LdHM:function(nt,Ge,v){"use strict";v.d(Ge,"b",function(){return De}),v.d(Ge,"a",function(){return _e});var z=v("1OyB"),he=v("vuIU"),oe=v("Ji7U"),xe=v("LK+K"),se=v("q1tI"),V=v("rePB"),k=v("Ff2n"),L=v("ODXe"),P=v("4IlW"),A=v("bX4T"),R=v("YrtM"),T=v("TSYQ"),Q=v.n(T),H=v("+nKL"),I=v("8OUc"),G=function(_,F){var te=_.prefixCls,Ce=_.id,Le=_.flattenOptions,pe=_.childrenAsData,fe=_.values,ie=_.searchValue,le=_.multiple,ee=_.defaultActiveFirstOption,U=_.height,b=_.itemHeight,K=_.notFoundContent,M=_.open,ve=_.menuItemSelectedIcon,Ee=_.virtual,re=_.onSelect,Ae=_.onToggleOpen,je=_.onActiveValue,Ne=_.onScroll,ke=_.onMouseEnter,Me="".concat(te,"-item"),Ue=Object(R.a)(function(){return Le},[M,Le],function($e,ae){return ae[0]&&$e[1]!==ae[1]}),et=se.useRef(null),Ve=function(ae){ae.preventDefault()},Ze=function(ae){et.current&&et.current.scrollTo({index:ae})},Qe=function(ae){for(var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ne=Ue.length,C=0;C<ne;C+=1){var E=(ae+C*q+ne)%ne,D=Ue[E],B=D.group,ge=D.data;if(!B&&!ge.disabled)return E}return-1},at=se.useState(function(){return Qe(0)}),tt=Object(L.a)(at,2),st=tt[0],Re=tt[1],vt=function(ae){Re(ae);var q=Ue[ae];if(!q){je(null,-1);return}je(q.data.value,ae)};se.useEffect(function(){vt(ee!==!1?Qe(0):-1)},[Ue.length,ie]),se.useEffect(function(){var $e=setTimeout(function(){if(!le&&M&&fe.size===1){var ae=Array.from(fe)[0],q=Ue.findIndex(function(ne){var C=ne.data;return C.value===ae});vt(q),Ze(q)}});return function(){return clearTimeout($e)}},[M]);var ut=function(ae){ae!==void 0&&re(ae,{selected:!fe.has(ae)}),le||Ae(!1)};if(se.useImperativeHandle(F,function(){return{onKeyDown:function(ae){var q=ae.which;switch(q){case P.a.UP:case P.a.DOWN:{var ne=0;if(q===P.a.UP?ne=-1:q===P.a.DOWN&&(ne=1),ne!==0){var C=Qe(st+ne,ne);Ze(C),vt(C)}break}case P.a.ENTER:{var E=Ue[st];E&&!E.data.disabled?ut(E.data.value):ut(void 0),M&&ae.preventDefault();break}case P.a.ESC:Ae(!1)}},onKeyUp:function(){},scrollTo:function(ae){Ze(ae)}}}),Ue.length===0)return se.createElement("div",{role:"listbox",id:"".concat(Ce,"_list"),className:"".concat(Me,"-empty"),onMouseDown:Ve},K);function Be($e){var ae=Ue[$e];if(!ae)return null;var q=ae.data||{},ne=q.value,C=q.label,E=q.children,D=Object(A.a)(q,!0),B=pe?E:C;return ae?se.createElement("div",Object.assign({"aria-label":typeof B=="string"?B:null},D,{key:$e,role:"option",id:"".concat(Ce,"_list_").concat($e),"aria-selected":fe.has(ne)}),ne):null}return se.createElement(se.Fragment,null,se.createElement("div",{role:"listbox",id:"".concat(Ce,"_list"),style:{height:0,width:0,overflow:"hidden"}},Be(st-1),Be(st),Be(st+1)),se.createElement(H.a,{itemKey:"key",ref:et,data:Ue,height:U,itemHeight:b,fullHeight:!1,onMouseDown:Ve,onScroll:Ne,virtual:Ee,onMouseEnter:ke},function($e,ae){var q,ne=$e.group,C=$e.groupOption,E=$e.data,D=E.label,B=E.key;if(ne)return se.createElement("div",{className:Q()(Me,"".concat(Me,"-group"))},D!==void 0?D:B);var ge=E.disabled,Oe=E.value,Ye=E.title,yt=E.children,kt=E.style,Ke=E.className,_t=Object(k.a)(E,["disabled","value","title","children","style","className"]),mt=fe.has(Oe),ot="".concat(Me,"-option"),Pt=Q()(Me,ot,Ke,(q={},Object(V.a)(q,"".concat(ot,"-grouped"),C),Object(V.a)(q,"".concat(ot,"-active"),st===ae&&!ge),Object(V.a)(q,"".concat(ot,"-disabled"),ge),Object(V.a)(q,"".concat(ot,"-selected"),mt),q)),At=pe?yt:D,Vt=!ve||typeof ve=="function"||mt;return se.createElement("div",Object.assign({},_t,{"aria-selected":mt,className:Pt,title:Ye,onMouseMove:function(){if(st===ae||ge)return;vt(ae)},onClick:function(){ge||ut(Oe)},style:kt}),se.createElement("div",{className:"".concat(ot,"-content")},At||Oe),se.isValidElement(ve)||mt,Vt&&se.createElement(I.a,{className:"".concat(Me,"-option-state"),customizeIcon:ve,customizeIconProps:{isSelected:mt}},mt?"\u2713":null))}))},X=se.forwardRef(G);X.displayName="OptionList";var Y=X,ce=function(){return null};ce.isSelectOption=!0;var De=ce,Je=function(){return null};Je.isSelectOptGroup=!0;var _e=Je,Te=v("VTBJ"),Fe=v("Zm9Q");function we(d){var _=d.key,F=d.props,te=F.children,Ce=F.value,Le=Object(k.a)(F,["children","value"]);return Object(Te.a)({key:_,value:Ce!==void 0?Ce:_,children:te},Le)}function Se(d){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Fe.a)(d).map(function(F,te){if(!se.isValidElement(F)||!F.type)return null;var Ce=F.type.isSelectOptGroup,Le=F.key,pe=F.props,fe=pe.children,ie=Object(k.a)(pe,["children"]);return _||!Ce?we(F):Object(Te.a)(Object(Te.a)({key:"__RC_SELECT_GRP__".concat(Le===null?te:Le,"__"),label:Le},ie),{},{options:Se(fe)})}).filter(function(F){return F})}var Pe=v("2Qr1"),be=v("qNPg"),O=v("U8pU"),ue=v("Kwbf"),J=v("WKfj");function x(d){var _=d.mode,F=d.options,te=d.children,Ce=d.backfill,Le=d.allowClear,pe=d.placeholder,fe=d.getInputElement,ie=d.showSearch,le=d.onSearch,ee=d.defaultOpen,U=d.autoFocus,b=d.labelInValue,K=d.value,M=d.inputValue,ve=d.optionLabelProp,Ee=_==="multiple"||_==="tags",re=ie!==void 0?ie:Ee||_==="combobox",Ae=F||Se(te);if(Object(ue.a)(_!=="tags"||Ae.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),_==="tags"||_==="combobox"){var je=Ae.some(function(Me){return Me.options?Me.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(ue.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ue.a)(_!=="combobox"||!ve,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ue.a)(_==="combobox"||!Ce,"`backfill` only works with `combobox` mode."),Object(ue.a)(_==="combobox"||!fe,"`getInputElement` only work with `combobox` mode."),Object(ue.b)(_!=="combobox"||!fe||!Le||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),le&&!re&&_!=="combobox"&&_!=="tags"&&Object(ue.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ue.b)(!ee||U,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),K!=null){var Ne=Object(J.d)(K);Object(ue.a)(!b||Ne.every(function(Me){return Object(O.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ue.a)(!Ee||Array.isArray(K),"`value` should be array when `mode` is `multiple` or `tags`")}if(te){var ke=null;Object(Fe.a)(te).some(function(Me){if(!se.isValidElement(Me)||!Me.type)return!1;var Ue=Me.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var et=Object(Fe.a)(Me.props.children).every(function(Ve){return!se.isValidElement(Ve)||!Me.type||Ve.type.isSelectOption?!0:(ke=Ve.type,!1)});return!et}return ke=Ue,!0}),ke&&Object(ue.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ke.displayName||ke.name||ke,"`.")),Object(ue.a)(M===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=x,N=Object(be.a)({prefixCls:"rc-select",components:{optionList:Y},convertChildrenToData:Se,flattenOptions:Pe.d,getLabeledValue:Pe.e,filterOptions:Pe.b,isValueDisabled:Pe.g,findValueOption:Pe.c,warningProps:j,fillOptionsWithMissingValue:Pe.a}),w=function(d){Object(oe.a)(F,d);var _=Object(xe.a)(F);function F(){var te;return Object(z.a)(this,F),te=_.apply(this,arguments),te.selectRef=se.createRef(),te.focus=function(){te.selectRef.current.focus()},te.blur=function(){te.selectRef.current.blur()},te}return Object(he.a)(F,[{key:"render",value:function(){return se.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),F}(se.Component);w.Option=De,w.OptGroup=_e;var S=w,p=Ge.c=S},M8RZ:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return P});var z=v("fWQN"),he=v("mtLc"),oe=v("yKVA"),xe=v("879j"),se=v("q1tI"),V=v.n(se),k=v("i8i4"),L=v.n(k),P=function(A){Object(oe.a)(T,A);var R=Object(xe.a)(T);function T(Q){var H;Object(z.a)(this,T),H=R.call(this,Q);var I=window.document;return H.node=I.createElement("div"),I.body.appendChild(H.node),H}return Object(he.a)(T,[{key:"render",value:function(){var H=this.props.children;return Object(k.createPortal)(H,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(V.a.Component)},NLgs:function(nt,Ge,v){"use strict";v.d(Ge,"e",function(){return Je}),v.d(Ge,"f",function(){return _e}),v.d(Ge,"d",function(){return Fe}),v.d(Ge,"c",function(){return we}),v.d(Ge,"a",function(){return Se}),v.d(Ge,"b",function(){return Pe});var z=v("miYZ"),he=v("tsqr"),oe=v("9og8"),xe=v("2qtc"),se=v("kLXV"),V=v("WmNS"),k=v.n(V),L=v("q1tI"),P=v.n(L),A=v("9kvl"),R=v("xKgJ"),T=v("1vsH"),Q=v("RCxd"),H=v("mOS8"),I=v.n(H),G=v("1ZF9"),X=v.n(G),Y=v("WdTA"),ce=v.n(Y),De=v("m3rI"),Je=function(O){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(_e(O)&&Te(ue))},_e=function(O){return Object(R.p)()?!0:(O({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},Te=function(){var O,ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,J=Object(A.c)()._store.getState(),x=J.user;return(O=x.userInfo)!==null&&O!==void 0&&O.profile_completed?!0:(se.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:ue?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){A.d.push("/account/profile/edit")}}),!1)},Fe=function(){var O,ue=Object(A.c)()._store.getState(),J=ue.user;return(O=J.userInfo)!==null&&O!==void 0&&O.professional_certification?!0:(se.a.confirm({title:"\u63D0\u793A",centered:!0,content:P.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(T.Q)("/account/certification")}}),!1)},we=function(){return Object(R.a)()?!0:(se.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:P.a.createElement("div",{className:"tc",style:{marginLeft:-38}},P.a.createElement("p",null,"\u60A8\u53EF\u4EE5\u626B\u7801\u52A0\u7FA4@\u7FA4\u7BA1\u7406\u5458\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650\u54E6\uFF01"),P.a.createElement("img",{src:Object(R.t)()?ce.a:"".concat(De.a.IMG_SERVER,"/images/educoder/qqqun20191230.png"),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},Se=function(O,ue){return O?!0:(se.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:P.a.createElement("div",null,P.a.createElement("p",null,ue||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),P.a.createElement("div",{style:{marginLeft:"110px"}},P.a.createElement("img",{src:X.a,width:200}),P.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(T.Q)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},Pe=function(O){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",J=Object(A.c)()._store.getState(),x=J.shixunsDetail.detail;return(x==null?void 0:x.public)===2||(x==null?void 0:x.public)===1||(x==null?void 0:x.shixun_status)===3?(se.a.info({centered:!0,icon:P.a.createElement(Q.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:P.a.createElement("div",{className:"tc",style:{marginLeft:-38}},P.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},P.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(x==null?void 0:x.public)===2?"\u5DF2\u516C\u5F00":(x==null?void 0:x.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",ue,"\u3002"),P.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),P.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:I.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(x==null?void 0:x.shixun_status)===2?(se.a.confirm({centered:!0,icon:P.a.createElement(Q.a,null),title:"\u63D0\u793A",content:P.a.createElement("div",null,P.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",ue,"\u3002"),P.a.createElement("br",null),P.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){se.a.confirm({width:440,centered:!0,icon:P.a.createElement(Q.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var N=Object(oe.a)(k.a.mark(function S(){var p;return k.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,O({type:"shixunsDetail/cancelRelease",payload:{id:x==null?void 0:x.identifier}});case 2:p=_.sent,p.status!==401&&(he.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),O({type:"shixunsDetail/getShixunsDetail",payload:{id:x==null?void 0:x.identifier}}),O({type:"practiceSetting/getCommonData",payload:{id:x==null?void 0:x.identifier}}));case 4:case"end":return _.stop()}},S)}));function w(){return N.apply(this,arguments)}return w}()})}}),!0):!1}},OLES:function(nt,Ge,v){"use strict";var z=v("U8pU"),he=v("VTBJ"),oe=v("Ff2n"),xe=v("q1tI"),se=v("uciX"),V=v("7ixt"),k=function(Q){var H=Q.overlay,I=Q.prefixCls,G=Q.id,X=Q.overlayInnerStyle;return xe.createElement("div",{className:"".concat(I,"-inner"),id:G,role:"tooltip",style:X},typeof H=="function"?H():H)},L=k,P=function(Q,H){var I=Q.overlayClassName,G=Q.trigger,X=G===void 0?["hover"]:G,Y=Q.mouseEnterDelay,ce=Y===void 0?0:Y,De=Q.mouseLeaveDelay,Je=De===void 0?.1:De,_e=Q.overlayStyle,Te=Q.prefixCls,Fe=Te===void 0?"rc-tooltip":Te,we=Q.children,Se=Q.onVisibleChange,Pe=Q.afterVisibleChange,be=Q.transitionName,O=Q.animation,ue=Q.placement,J=ue===void 0?"right":ue,x=Q.align,j=x===void 0?{}:x,N=Q.destroyTooltipOnHide,w=N===void 0?!1:N,S=Q.defaultVisible,p=Q.getTooltipContainer,d=Q.overlayInnerStyle,_=Object(oe.a)(Q,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),F=Object(xe.useRef)(null);Object(xe.useImperativeHandle)(H,function(){return F.current});var te=Object(he.a)({},_);"visible"in Q&&(te.popupVisible=Q.visible);var Ce=function(){var le=Q.arrowContent,ee=le===void 0?null:le,U=Q.overlay,b=Q.id;return[xe.createElement("div",{className:"".concat(Fe,"-arrow"),key:"arrow"},ee),xe.createElement(L,{key:"content",prefixCls:Fe,id:b,overlay:U,overlayInnerStyle:d})]},Le=!1,pe=!1;if(typeof w=="boolean")Le=w;else if(w&&Object(z.a)(w)==="object"){var fe=w.keepParent;Le=fe===!0,pe=fe===!1}return xe.createElement(se.a,Object.assign({popupClassName:I,prefixCls:Fe,popup:Ce,action:X,builtinPlacements:V.a,popupPlacement:J,ref:F,popupAlign:j,getPopupContainer:p,onPopupVisibleChange:Se,afterPopupVisibleChange:Pe,popupTransitionName:be,popupAnimation:O,defaultPopupVisible:S,destroyPopupOnHide:Le,autoDestroy:pe,mouseLeaveDelay:Je,popupStyle:_e,mouseEnterDelay:ce},te),we)},A=Object(xe.forwardRef)(P),R=Ge.a=A},Ot1p:function(nt,Ge,v){"use strict";var z=v("2qtc"),he=v("kLXV"),oe=v("rAM+"),xe=v("miYZ"),se=v("tsqr"),V=v("9og8"),k=v("tJVT"),L=v("jrin"),P=v("WmNS"),A=v.n(P),R=v("q1tI"),T=v.n(R),Q=v("VrN/"),H=v.n(Q),I=v("bdgK"),G=v("p77/"),X=v("Bd2K"),Y=v("ELLl"),ce=v("19Vz"),De=v("lZu9"),Je=v("+NIl"),_e=v("kSUc"),Te=v("9Bee"),Fe=function(Ke){var _t=Ke.value,mt=_t===void 0?"":_t,ot=Ke.className,Pt=Ke.showTextOnly,At=Ke.showLines,Vt=Ke.style,jt=Vt===void 0?{}:Vt,St=Object(R.useMemo)(function(){return""},[mt]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:St}}))},we=v("Q9mQ"),Se=v("diRs"),Pe=v("0Owb"),be=v("dejd"),O=v("C+DQ"),ue=v("D1Df"),J=v.n(ue),x=v("1vsH"),j=v("m3rI"),N=[{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 w(Ke){var _t=Ke.onActionCallback,mt=Ke.title,ot=Ke.icon,Pt=Ke.actionName,At=Ke.className,Vt=At===void 0?"":At,jt=Ke.children;function St(){_t(Pt)}return T.a.createElement("a",{title:mt,className:Vt,onClick:St},T.a.createElement("i",{className:"md-iconfont ".concat(ot)}),jt)}var S=function(Ke){var _t=Ke.watch,mt=Ke.showNullButton,ot=Ke.onActionCallback,Pt=Ke.fullScreen,At=Ke.insertTemp,Vt=Ke.hidetoolBar,jt=Ke.uuid,St=Ke.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.E)("_educoder_session"),"&key=").concat(jt,"&api=").concat(encodeURIComponent(j.a.PROXY_SERVER)));var bn=[].concat(N,[{title:"".concat(_t?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(_t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&bn.map(function(rn,pt){return T.a.createElement("li",{key:pt},rn.actionName?T.a.createElement(w,Object(Pe.a)({},rn,{onActionCallback:ot})):T.a.createElement("span",{className:"v-line"}))}),mt?T.a.createElement("li",null,T.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,At&&T.a.createElement("li",null,T.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(At),onActionCallback:ot},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",null,T.a.createElement(Se.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:T.a.createElement("div",null,T.a.createElement(J.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(x.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.E)("_educoder_session"),"&key=").concat(jt,"&api=").concat(encodeURIComponent(j.a.PROXY_SERVER))}))},T.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return St(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(w,{icon:"".concat(Pt?"icon-shrink":"icon-enlarge"),title:Pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},p=v("M8RZ"),d=v("+L6B"),_=v("2/Rp"),F=v("y8nQ"),te=v("Vl3Y"),Ce=v("5NDa"),Le=v("5rEg"),pe={labelCol:{span:4},wrapperCol:{span:20}},fe=function(Ke){var _t=Ke.callback,mt=Ke.onCancel;function ot(Pt){_t(Pt)}return T.a.createElement(te.a,Object(Pe.a)({},pe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),T.a.createElement(te.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(Le.a,null)),T.a.createElement(te.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(Le.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(_.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},ie=v("7ahc"),le=v("k1fw"),ee=v("HmJG"),U=v("BjJ7"),b=te.a.useForm,K={width:280,marginRight:10},M={labelCol:{span:5},wrapperCol:{span:19}},ve=function(Ke){var _t=Ke.callback,mt=Ke.onCancel,ot=b(),Pt=Object(k.a)(ot,1),At=Pt[0],Vt=Object(R.useRef)();function jt(rn){_t(Object(le.a)(Object(le.a)({},rn),{},{name:Vt.current}))}function St(rn,pt){At.setFieldsValue({src:"/api/attachments/".concat(rn.id,"?type=").concat(rn.content_type),type:pt.type})}function bn(rn){var pt=rn.target.files[0];Vt.current=pt.name,re(pt,St)}return T.a.createElement(te.a,Object(Pe.a)({form:At},M,{className:"upload-image-panel",onFinish:jt}),T.a.createElement(te.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(te.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},T.a.createElement(Le.a,{style:K})),T.a.createElement(Ee,{onFileChange:bn}))),T.a.createElement(te.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},T.a.createElement(Le.a,{style:{width:264}})),T.a.createElement(te.a.Item,{style:{textAlign:"right"}},T.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(_.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))};function Ee(Ke){var _t=Ke.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:_t}))}function re(Ke,_t){if(!Ke)throw new String("\u6CA1\u6709\u6587\u4EF6");var mt=new FormData;mt.append("editormd-image-file",Ke),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(Pt){_t(JSON.parse(Pt.target.responseText),Ke)},!1),ot.addEventListener("error",function(Pt){console.error(Pt)},!1),ot.open("POST","".concat(U.a,"/api/attachments.json")),ot.send(mt)}var Ae=v("giR+"),je=v("fyUT"),Ne=v("7Kak"),ke=v("9yH6"),Me=ke.a.Group,Ue={margin:"0 8px"},et=function(Ke){var _t=Ke.callback,mt=Ke.onCancel;function ot(Pt){_t(Pt)}return T.a.createElement(te.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},T.a.createElement("div",{className:"flex-container"},T.a.createElement("span",{style:Ue},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Ue},"\u884C\u6570"),T.a.createElement(te.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(je.a,null)),T.a.createElement("span",{style:Ue},"\u5217\u6570"),T.a.createElement(te.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(je.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12}},T.a.createElement("span",{style:Ue},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(te.a.Item,{name:"align"},T.a.createElement(Me,null,T.a.createElement(ke.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(ke.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(ke.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(ke.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(_.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},Ve=v("ErOA"),Ze=v("7Cbv"),Qe="link",at="upload-image",tt="code-block",st="add-table",Re="------------",vt={default:Re,left:":".concat(Re),center:":".concat(Re,":"),right:"".concat(Re,":")},ut=v("9VGf"),Be,$e;function ae(){}var q=0,ne=1e4,C="\u2581",E=`
**\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 D(Ke){return/^\d+$/.test(Ke)?"".concat(Ke,"px"):Ke}var B=navigator.platform.toUpperCase().indexOf("MAC")>=0,ge=B?"Cmd":"Ctrl",Oe=["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"],Ye=(Be={},Object(L.a)(Be,ge+"-B","bold"),Object(L.a)(Be,ge+"-I","italic"),Be),yt=($e={},Object(L.a)($e,Qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(L.a)($e,tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(L.a)($e,at,"\u6DFB\u52A0\u6587\u4EF6"),Object(L.a)($e,st,"\u6DFB\u52A0\u8868\u683C"),$e),kt=Ge.a=function(Ke){var _t=Ke.defaultValue,mt=_t===void 0?"":_t,ot=Ke.onChange,Pt=Ke.width,At=Pt===void 0?"100%":Pt,Vt=Ke.height,jt=Vt===void 0?400:Vt,St=Ke.miniToolbar,bn=St===void 0?!1:St,rn=Ke.isFocus,pt=rn===void 0?!1:rn,Vn=Ke.watch,xn=Ke.insertTemp,pn=Ke.mode,Sn=pn===void 0?"markdown":pn,li=Ke.id,Kn=li===void 0?"markdown-editor-id":li,Nt=Ke.showResizeBar,dt=Nt===void 0?!1:Nt,Un=Ke.noStorage,ui=Un===void 0?!1:Un,kn=Ke.showNullButton,Mt=kn===void 0?!1:kn,Xn=Ke.hidetoolBar,hi=Xn===void 0?!1:Xn,vi=Ke.fullScreen,Xe=vi===void 0?!1:vi,Ct=Ke.onBlur,ti=Ke.onCMBeforeChange,ci=Ke.onFullScreen,di=Ke.className,Mi=di===void 0?"":di,c=Ke.disablePaste,o=c===void 0?!1:c,a=Ke.placeholder,u=a===void 0?"":a,g=Ke.values,h=g===void 0?"":g,Z=Object(R.useState)(null),We=Object(k.a)(Z,2),ye=We[0],ct=We[1],He=Object(R.useState)(mt),wt=Object(k.a)(He,2),Dt=wt[0],Wt=wt[1],Fn=Object(R.useState)(Vn),Wn=Object(k.a)(Fn,2),ln=Wn[0],$n=Wn[1],Ki=Object(R.useState)(Xe),Tn=Object(k.a)(Ki,2),An=Tn[0],ni=Tn[1],yi=Object(R.useState)(""),Jn=Object(k.a)(yi,2),ii=Jn[0],Hn=Jn[1],fr=Object(R.useState)(0),Xi=Object(k.a)(fr,2),Dn=Xi[0],Nn=Xi[1],Ri=Object(R.useState)(jt),Pi=Object(k.a)(Ri,2),Di=Pi[0],qt=Pi[1],Bt=Object(R.useState)(!1),mn=Object(k.a)(Bt,2),Ut=mn[0],gn=mn[1],Xt=Object(R.useRef)(Object(Ze.a)()),bi=Object(R.useRef)(!1),on=Object(R.useRef)(),an=Object(R.useRef)(),ri=Object(R.useRef)(),xi=Object(R.useRef)(),Ci=Object(R.useRef)(),Ur=function(){var ft=Object(V.a)(A.a.mark(function Et(){var bt,Ot;return A.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Ve.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:Ot=Ht.sent,Ot!=null&&(bt=Ot.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",ye,an),Ot.attachments.map(function(Rt){Rt.content_type.indexOf("image")>-1?ye.replaceSelection("![,](/api/attachments/".concat(Rt.id,"?type=").concat(Rt.content_type,")")):Rt.content_type.indexOf("video")>-1?ye.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Rt.content_type.indexOf("pdf")>-1?ye.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,'&disposition=inline" target="_blank">').concat(Rt.name,"</a>")):ye.replaceSelection("[".concat(Rt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}));case 4:case"end":return Ht.stop()}},Et)}));return function(){return ft.apply(this,arguments)}}();Object(R.useEffect)(function(){Wt(h),ye==null||ye.setValue(h)},[h]),Object(R.useEffect)(function(){ci==null||ci(An)},[An]),Object(R.useEffect)(function(){if(an.current){var ft=H.a.fromTextArea(an.current,{mode:Sn,lineNumbers:!bn,lineWrapping:!0,value:mt,autoCloseTags:!0,autoCloseBrackets:!0});pt&&ft.focus();function Et(bt,Ot){if(o){Ot.preventDefault();return}var It=Ot.clipboardData;if(It){var Ht=It.types.toString(),Rt=It.items;if(Ht==="Files"||It.types.indexOf("Files")>-1){if(Ot.preventDefault(),Sn=="stex")return;try{var Jt,un=Rt[1];((Jt=Rt[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(un=Rt[0]);var Lt=un.getAsFile(),Ni=Lt.name.split(".").pop();re(Lt,function(zt){if(zt.id){var vn,Kt,Yn;(Lt==null||((vn=Lt.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(Lt==null||((Kt=Lt.type)===null||Kt===void 0)?void 0:Kt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(Lt==null||((Yn=Lt.type)===null||Yn===void 0)?void 0:Yn.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(Lt.type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):Oe.includes(Ni)?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):ft.replaceSelection("[".concat(Lt.name,"](").concat(j.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){se.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",Et),ft.on("dragleave",function(bt,Ot){ri.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function(bt,Ot){ri.current.classList.add("mouse-hover-md")}),ft.on("drop",function(bt,Ot){ri.current.classList.add("mouse-hover-md");var It;if(It=Ot.dataTransfer.files,It.length>0){Ot.preventDefault(),Ot.stopPropagation();for(var Ht=function(un){var Lt=It[un],Ni=Lt.name.split(".").pop();re(Lt,function(zt){if(zt.id){var vn,Kt,Yn;(Lt==null||((vn=Lt.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(Lt==null||((Kt=Lt.type)===null||Kt===void 0)?void 0:Kt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(Lt==null||((Yn=Lt.type)===null||Yn===void 0)?void 0:Yn.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(Lt.type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):Oe.includes(Ni)?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):ft.replaceSelection("[".concat(Lt.name,"](").concat(j.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")})},Rt=0;Rt<It.length;Rt++)Ht(Rt)}}),ct(ft),function(){ft.off("paste",Et)}}},[]);var Zn=Object(R.useCallback)(function(){if(ri.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[Di,ri,An]);Object(R.useEffect)(function(){function ft(){var bt=new I.default(function(Ot){var It=Object(oe.a)(Ot),Ht;try{for(It.s();!(Ht=It.n()).done;){var Rt=Ht.value;(Rt.target.offsetHeight>0||Rt.target.offsetWidth>0)&&(Zn(),ye.setSize("100%","100%"),ye.refresh())}}catch(Jt){It.e(Jt)}finally{It.f()}});return bt.observe(an.current.parentElement),bt}if(ye){var Et=ft();return function(){Et.unobserve(an.current.parentElement)}}},[ye,Zn]),Object(R.useEffect)(function(){if(ye){for(var ft=[],Et=function(){var Rt=Ot[bt];It=Object(k.a)(Rt,2);var Jt=It[0],un=It[1],Lt=Object(L.a)({},Jt,function(){$i(un)});ft.push(Lt),ye.addKeyMap(Lt)},bt=0,Ot=Object.entries(Ye);bt<Ot.length;bt++){var It;Et()}return on.current=setInterval(function(){bi.current&&Ur()},4e3),function(){clearInterval(on.current);var Ht=Object(oe.a)(ft),Rt;try{for(Ht.s();!(Rt=Ht.n()).done;){var Jt=Rt.value;ye.removeKeyMap(Jt)}}catch(un){Ht.e(un)}finally{Ht.f()}}}},[ye]),Object(R.useEffect)(function(){Xe!==An&&ni(Xe)},[Xe]),Object(ut.a)(function(){if(!ui&&Dn>0){var ft=new Date().getTime(),Et=window.sessionStorage.getItem(Kn);ft>=Dn+ne&&(!Et||Et!==Dt)&&(window.sessionStorage.setItem(Kn,Dt),gn(!0))}},ne),Object(R.useEffect)(function(){$n(Vn)},[ye,Vn]),Object(R.useEffect)(function(){ye&&(pt&&ye.focus())},[ye,pt]),Object(R.useEffect)(function(){if(ln&&ye){var ft=ye.getScrollerElement();function Et(bt){var Ot=bt.target;if(Ci.current){var It=Ot.scrollTop/Ot.scrollHeight;Ci.current.scrollTop=Ci.current.scrollHeight*It}}return ft.addEventListener("scroll",Et),function(){ft.removeEventListener("scroll",Et)}}},[ye,ln]),Object(R.useEffect)(function(){if(ye&&ti){function ft(Et,bt){ti(Et,bt)}return ye.on("beforeChange",ft),function(){ye.off("beforeChange",ft)}}},[ye,ti]),Object(R.useEffect)(function(){if(ye&&Ct){function ft(){Ct(ye.getValue())}return ye.on("blur",ft),function(){ye.off("blur",ft)}}},[ye,Ct]),Object(R.useEffect)(function(){if(ye){function ft(Et){var bt=Et.getValue();Wt(bt),Nn(new Date().getTime()),Et.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(bt)}return ye.on("change",ft),function(){ye.off("change",ft)}}},[ye,ot]),Object(R.useEffect)(function(){ye&&(mt==null?(ye.setValue(""),Wt("")):mt!==ye.getValue()&&(ye.setValue(mt),Wt(mt),ye.setCursor(ye.lineCount(),0)))},[ye,mt]);var $i=Object(R.useCallback)(function(ft){var Et=ye.getCursor(),bt=ye.getSelection(),Ot=bt.split(`
`);switch(ft){case"bold":return ye.replaceSelection("**"+bt+"**"),bt===""&&ye.setCursor(Et.line,Et.ch+2),ye.focus();case"italic":return ye.replaceSelection("*"+bt+"*"),bt===""&&ye.setCursor(Et.line,Et.ch+1),ye.focus();case"code":return ye.replaceSelection("`"+bt+"`"),bt===""&&ye.setCursor(Et.line,Et.ch+1),ye.focus();case"inline-latex":return ye.replaceSelection("`$$"+bt+"$$`"),bt===""&&ye.setCursor(Et.line,Et.ch+3),ye.focus();case"latex":return ye.replaceSelection("```latex\n"+bt+"\n```"),ye.setCursor(Et.line+1,bt.length+1),ye.focus();case"line-break":return ye.replaceSelection(`<br/>
`),ye.focus();case"list-ul":return bt===""?ye.replaceSelection("- "+bt):ye.replaceSelection(Ot.map(function(It){return It===""?"":"- ".concat(It)}).join(`
`)),ye.focus();case"list-ol":return bt===""?ye.replaceSelection("1. "+bt):ye.replaceSelection(Ot.map(function(It,Ht){return It===""?"":"".concat(Ht+1,". ").concat(It)}).join(`
`)),ye.focus();case"add-null-ch":return bt===""&&ye.setCursor(Et.line,Et.ch+1),ye.replaceSelection(C),ye.focus();case"inster-template-1":return bt===""&&ye.setCursor(Et.line,Et.ch),ye.replaceSelection(E),ye.focus();case"eraser":return ye.setValue(""),ye.focus();case"trigger-watch":return $n(!ln),ye.focus();case"trigger-full-screen":return ni(!An),ye.focus();case Qe:Hn(Qe);return;case tt:Hn(tt);return;case at:Hn(at);return;case st:Hn(st);return;default:throw new Error}},[ye,ln,An]),In=Object(R.useCallback)(function(ft){Hn("");switch(ii){case Qe:var Et=ft.title,bt=ft.link;return ye.replaceSelection("[".concat(Et,"](").concat(bt,")")),ye.focus();case tt:var Ot=ft.language,It=ft.content;return ye.replaceSelection(["```"+Ot,It,"```"].join(`
`)),ye.focus();case at:var Ht=ft.src,Rt=ft.alt,Jt=ft.name;return Ht.indexOf("type=image")>-1?ye.replaceSelection("![ ".concat(Rt||""," ]( ").concat(Ht,' "').concat(Rt||"",'" )')):Ht.indexOf("type=application/pdf")>-1?ye.replaceSelection('<a href="'.concat(Ht,'&disposition=inline" target="_blank">').concat(Jt,"</a>")):ye.replaceSelection('<a href="'.concat(Ht,'" target="_blank">').concat(Jt,"</a>")),ye.focus();case st:for(var un=ft.row,Lt=ft.col,Ni=ft.align,zt=`
`,vn=0;vn<un;vn++){for(var Kt=[],Yn=[],pr=0;pr<Lt;pr++)vn===1&&Yn.push(vt[Ni]),Kt.push(" ");vn===1&&(zt+="| ".concat(Yn.join(" | "),` |
`)),zt+="| ".concat(Kt.join(Lt===1?"":" | "),` |
`)}return ye.replaceSelection(zt+`
`),ye.focus();default:throw new Error}},[ye,ii]),Yi=Object(R.useMemo)(function(){switch(ii){case Qe:return T.a.createElement(fe,{callback:In,onCancel:fi});case tt:return T.a.createElement(ie.b,{callback:In,onCancel:fi});case at:return T.a.createElement(ve,{callback:In,onCancel:fi});case st:return T.a.createElement(et,{callback:In,onCancel:fi});default:return null}},[ii]);function fi(){Hn("")}Object(R.useEffect)(function(){if(xi.current){var ft=xi.current,Et=!1,bt=0;function Ot(Rt){Et=!0,bt=Rt.pageY}function It(){Et=!1}function Ht(Rt){if(Et){var Jt=Rt.pageY-bt;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var un=jt+Jt+"px";qt(un)}}return ft.addEventListener("mousedown",Ot),document.addEventListener("mousemove",Ht),document.addEventListener("mouseup",It),function(){ft.removeEventListener("mousedown",Ot),document.removeEventListener("mousemove",Ht),document.removeEventListener("mouseup",It)}}},[ye,xi]),Object(R.useEffect)(function(){qt(jt)},[jt]);var wi=D(At),uo=D(Di),ho={width:wi,height:uo},Zo=Object(R.useMemo)(function(){if(Dn){var ft=new Date(Dn),Et=ft.getHours(),bt=ft.getMinutes(),Ot=ft.getSeconds();return Et=Et<10?"0"+Et:Et,bt=bt<10?"0"+bt:bt,Ot=Ot<10?"0"+Ot:Ot,"".concat(Et,":").concat(bt,":").concat(Ot)}return 0},[Dn]);function Qo(){window.sessionStorage.removeItem(Kn),gn(!1),Nn(0)}function co(){gn(!1),Nn(0),ye.setValue(window.sessionStorage.getItem(Kn))}function Fr(ft,Et){var bt=ye.getValue();bt=bt.replace(ft,Et),Wt(bt),ye==null||ye.setValue(bt)}return T.a.createElement(R.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},T.a.createElement("div",{className:"markdown-editor-container ".concat(Mi," ").concat(ln?"on-preview":""," ").concat(bn?"mini":""," ").concat(An?"full-screen":""),style:ho},T.a.createElement(S,{insertTemp:xn,watch:ln,fullScreen:An,showNullButton:Mt,onActionCallback:$i,hidetoolBar:hi,uuid:Xt.current,setOpenPhones:function(){bi.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:an,placeholder:u})),ln?T.a.createElement("div",{ref:Ci,className:"preview-container"},Sn==="stex"&&T.a.createElement(Fe,{value:Dt}),Sn!=="stex"&&T.a.createElement(Te.a,{edit:!0,value:Dt,replaces:Fr})):null))),dt?T.a.createElement("a",{ref:xi,className:"editor-resize"}):null,T.a.createElement(p.a,null,yt[ii]?T.a.createElement(he.a,{centered:!0,title:yt[ii],visible:!0,onCancel:fi,footer:null},Yi):null))}},SJMd:function(nt,Ge){/**
* @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 v,z,he,oe=!1,xe,se;window.PR_SHOULD_USE_CONTINUATION=!0;var V,k;(function(){var L=window,P=["break,continue,do,else,for,if,return,while"],A=[P,"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"],R=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[R,"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"],Q=[R,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],H=[R,"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"],I="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",G=[R,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],X="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",Y=[P,"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"],ce=[P,"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"],De=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Je=[T,H,Q,G,X,Y,ce,De],_e=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,Te="str",Fe="kwd",we="com",Se="typ",Pe="lit",be="pun",O="pln",ue="tag",J="dec",x="src",j="atn",N="atv",w="nocode",S="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(re){for(var Ae=0,je=!1,Ne=!1,ke=0,Me=re.length;ke<Me;++ke){var Ue=re[ke];if(Ue.ignoreCase)Ne=!0;else if(/[a-z]/i.test(Ue.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){je=!0,Ne=!1;break}}var et={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(st){var Re=st.charCodeAt(0);if(Re!==92)return Re;var vt=st.charAt(1);return Re=et[vt],Re||("0"<=vt&&vt<="7"?parseInt(st.substring(1),8):vt==="u"||vt==="x"?parseInt(st.substring(2),16):st.charCodeAt(1))}function Ze(st){if(st<32)return(st<16?"\\x0":"\\x")+st.toString(16);var Re=String.fromCharCode(st);return Re==="\\"||Re==="-"||Re==="]"||Re==="^"?"\\"+Re:Re}function Qe(st){var Re=st.substring(1,st.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")),vt=[],ut=Re[0]==="^",Be=["["];ut&&Be.push("^");for(var $e=ut?1:0,ae=Re.length;$e<ae;++$e){var q=Re[$e];if(/\\[bdsw]/i.test(q))Be.push(q);else{var ne=Ve(q),C;$e+2<ae&&Re[$e+1]==="-"?(C=Ve(Re[$e+2]),$e+=2):C=ne,vt.push([ne,C]),C<65||ne>122||(C<65||ne>90||vt.push([Math.max(65,ne)|32,Math.min(C,90)|32]),C<97||ne>122||vt.push([Math.max(97,ne)&~32,Math.min(C,122)&~32]))}}vt.sort(function(ge,Oe){return ge[0]-Oe[0]||Oe[1]-ge[1]});for(var E=[],D=[],$e=0;$e<vt.length;++$e){var B=vt[$e];B[0]<=D[1]+1?D[1]=Math.max(D[1],B[1]):E.push(D=B)}for(var $e=0;$e<E.length;++$e){var B=E[$e];Be.push(Ze(B[0])),B[1]>B[0]&&(B[1]+1>B[0]&&Be.push("-"),Be.push(Ze(B[1])))}return Be.push("]"),Be.join("")}function at(st){for(var Re=st.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")),vt=Re.length,ut=[],Be=0,$e=0;Be<vt;++Be){var ae=Re[Be];if(ae==="(")++$e;else if(ae.charAt(0)==="\\"){var q=+ae.substring(1);q&&(q<=$e?ut[q]=-1:Re[Be]=Ze(q))}}for(var Be=1;Be<ut.length;++Be)ut[Be]===-1&&(ut[Be]=++Ae);for(var Be=0,$e=0;Be<vt;++Be){var ae=Re[Be];if(ae==="(")++$e,ut[$e]||(Re[Be]="(?:");else if(ae.charAt(0)==="\\"){var q=+ae.substring(1);q&&q<=$e&&(Re[Be]="\\"+ut[q])}}for(var Be=0;Be<vt;++Be)Re[Be]==="^"&&Re[Be+1]!=="^"&&(Re[Be]="");if(st.ignoreCase&&je)for(var Be=0;Be<vt;++Be){var ae=Re[Be],ne=ae.charAt(0);ae.length>=2&&ne==="["?Re[Be]=Qe(ae):ne!=="\\"&&(Re[Be]=ae.replace(/[a-zA-Z]/g,function(D){var B=D.charCodeAt(0);return"["+String.fromCharCode(B&~32,B|32)+"]"}))}return Re.join("")}for(var tt=[],ke=0,Me=re.length;ke<Me;++ke){var Ue=re[ke];if(Ue.global||Ue.multiline)throw new Error(""+Ue);tt.push("(?:"+at(Ue)+")")}return new RegExp(tt.join("|"),Ne?"gi":"g")}function d(re,Ae){var je=/(?:^|\s)nocode(?:\s|$)/,Ne=[],ke=0,Me=[],Ue=0;function et(Ve){var Ze=Ve.nodeType;if(Ze==1){if(je.test(Ve.className))return;for(var Qe=Ve.firstChild;Qe;Qe=Qe.nextSibling)et(Qe);var at=Ve.nodeName.toLowerCase();(at==="br"||at==="li")&&(Ne[Ue]=`
`,Me[Ue<<1]=ke++,Me[Ue++<<1|1]=Ve)}else if(Ze==3||Ze==4){var tt=Ve.nodeValue;tt.length&&(Ae?tt=tt.replace(/\r\n?/g,`
`):tt=tt.replace(/[ \t\r\n]+/g," "),Ne[Ue]=tt,Me[Ue<<1]=ke,ke+=tt.length,Me[Ue++<<1|1]=Ve)}}return et(re),{sourceCode:Ne.join("").replace(/\n$/,""),spans:Me}}function _(re,Ae,je,Ne,ke){if(!je)return;var Me={sourceNode:re,pre:1,langExtension:null,numberLines:null,sourceCode:je,spans:null,basePos:Ae,decorations:null};Ne(Me),ke.push.apply(ke,Me.decorations)}var F=/\S/;function te(re){for(var Ae=void 0,je=re.firstChild;je;je=je.nextSibling){var Ne=je.nodeType;Ae=Ne===1?Ae?re:je:Ne===3&&F.test(je.nodeValue)?re:Ae}return Ae===re?void 0:Ae}function Ce(re,Ae){var je={},Ne;(function(){for(var Ue=re.concat(Ae),et=[],Ve={},Ze=0,Qe=Ue.length;Ze<Qe;++Ze){var at=Ue[Ze],tt=at[3];if(tt)for(var st=tt.length;--st>=0;)je[tt.charAt(st)]=at;var Re=at[1],vt=""+Re;Ve.hasOwnProperty(vt)||(et.push(Re),Ve[vt]=null)}et.push(/[\0-\uffff]/),Ne=p(et)})();var ke=Ae.length,Me=function(Ue){for(var et=Ue.sourceCode,Ve=Ue.basePos,Ze=Ue.sourceNode,Qe=[Ve,O],at=0,tt=et.match(Ne)||[],st={},Re=0,vt=tt.length;Re<vt;++Re){var ut=tt[Re],Be=st[ut],$e=void 0,ae;if(typeof Be=="string")ae=!1;else{var q=je[ut.charAt(0)];if(q)$e=ut.match(q[1]),Be=q[0];else{for(var ne=0;ne<ke;++ne)if(q=Ae[ne],$e=ut.match(q[1]),$e){Be=q[0];break}$e||(Be=O)}ae=Be.length>=5&&Be.substring(0,5)==="lang-",ae&&!($e&&typeof $e[1]=="string")&&(ae=!1,Be=x),ae||(st[ut]=Be)}var C=at;if(at+=ut.length,!ae)Qe.push(Ve+C,Be);else{var E=$e[1],D=ut.indexOf(E),B=D+E.length;$e[2]&&(B=ut.length-$e[2].length,D=B-E.length);var ge=Be.substring(5);_(Ze,Ve+C,ut.substring(0,D),Me,Qe),_(Ze,Ve+C+D,E,U(ge,E),Qe),_(Ze,Ve+C+B,ut.substring(B),Me,Qe)}}Ue.decorations=Qe};return Me}function Le(re){var Ae=[],je=[];re.tripleQuotedStrings?Ae.push([Te,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):re.multiLineStrings?Ae.push([Te,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ae.push([Te,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),re.verbatimStrings&&je.push([Te,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=re.hashComments;Ne&&(re.cStyleComments?(Ne>1?Ae.push([we,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ae.push([we,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([Te,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ae.push([we,/^#[^\r\n]*/,null,"#"])),re.cStyleComments&&(je.push([we,/^\/\/[^\r\n]*/,null]),je.push([we,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ke=re.regexLiterals;if(ke){var Me=ke>1?"":`
\r`,Ue=Me?".":"[\\S\\s]",et="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+S+"("+et+")")])}var Ve=re.types;Ve&&je.push([Se,Ve]);var Ze=(""+re.keywords).replace(/^ | $/g,"");Ze.length&&je.push([Fe,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Ae.push([O,/^\s+/,null,` \r
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return re.regexLiterals&&(Qe+="(?!s*/)"),je.push([Pe,/^@[a-z_$][a-z_$@0-9]*/i,null],[Se,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[O,/^[a-z_$][a-z_$@0-9]*/i,null],[Pe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[O,/^\\[\s\S]?/,null],[be,new RegExp(Qe),null]),Ce(Ae,je)}var pe=Le({keywords:Je,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function fe(re,Ae,je){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,ke=/\r\n?|\n/,Me=re.ownerDocument,Ue=Me.createElement("li");re.firstChild;)Ue.appendChild(re.firstChild);var et=[Ue];function Ve(Re){var vt=Re.nodeType;if(vt==1&&!Ne.test(Re.className))if(Re.nodeName==="br")Ze(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var ut=Re.firstChild;ut;ut=ut.nextSibling)Ve(ut);else if((vt==3||vt==4)&&je){var Be=Re.nodeValue,$e=Be.match(ke);if($e){var ae=Be.substring(0,$e.index);Re.nodeValue=ae;var q=Be.substring($e.index+$e[0].length);if(q){var ne=Re.parentNode;ne.insertBefore(Me.createTextNode(q),Re.nextSibling)}Ze(Re),ae||Re.parentNode.removeChild(Re)}}}function Ze(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function vt($e,ae){var q=ae?$e.cloneNode(!1):$e,ne=$e.parentNode;if(ne){var C=vt(ne,1),E=$e.nextSibling;C.appendChild(q);for(var D=E;D;D=E)E=D.nextSibling,C.appendChild(D)}return q}for(var ut=vt(Re.nextSibling,0),Be;(Be=ut.parentNode)&&Be.nodeType===1;)ut=Be;et.push(ut)}for(var Qe=0;Qe<et.length;++Qe)Ve(et[Qe]);Ae===(Ae|0)&&et[0].setAttribute("value",Ae);var at=Me.createElement("ol");at.className="linenums";for(var tt=Math.max(0,Ae-1|0)||0,Qe=0,st=et.length;Qe<st;++Qe)Ue=et[Qe],Ue.className="L"+(Qe+tt)%10,Ue.firstChild||Ue.appendChild(Me.createTextNode("\xA0")),at.appendChild(Ue);re.appendChild(at)}function ie(re){var Ae=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ae=Ae&&+Ae[1]<=8;var je=/\n/g,Ne=re.sourceCode,ke=Ne.length,Me=0,Ue=re.spans,et=Ue.length,Ve=0,Ze=re.decorations,Qe=Ze.length,at=0;Ze[Qe]=ke;var tt,st;for(st=tt=0;st<Qe;)Ze[st]!==Ze[st+2]?(Ze[tt++]=Ze[st++],Ze[tt++]=Ze[st++]):st+=2;for(Qe=tt,st=tt=0;st<Qe;){for(var Re=Ze[st],vt=Ze[st+1],ut=st+2;ut+2<=Qe&&Ze[ut+1]===vt;)ut+=2;Ze[tt++]=Re,Ze[tt++]=vt,st=ut}Qe=Ze.length=tt;var Be=re.sourceNode,$e="";Be&&($e=Be.style.display,Be.style.display="none");try{for(var ae=null;Ve<et;){var q=Ue[Ve],ne=Ue[Ve+2]||ke,C=Ze[at+2]||ke,ut=Math.min(ne,C),E=Ue[Ve+1],D;if(E.nodeType!==1&&(D=Ne.substring(Me,ut))){Ae&&(D=D.replace(je,"\r")),E.nodeValue=D;var B=E.ownerDocument,ge=B.createElement("span");ge.className=Ze[at+1];var Oe=E.parentNode;Oe.replaceChild(ge,E),ge.appendChild(E),Me<ne&&(Ue[Ve+1]=E=B.createTextNode(Ne.substring(ut,ne)),Oe.insertBefore(E,ge.nextSibling))}Me=ut,Me>=ne&&(Ve+=2),Me>=C&&(at+=2)}}finally{Be&&(Be.style.display=$e)}}var le={};function ee(re,Ae){for(var je=Ae.length;--je>=0;){var Ne=Ae[je];le.hasOwnProperty(Ne)?L.console&&console.warn("cannot override language handler %s",Ne):le[Ne]=re}}function U(re,Ae){return re&&le.hasOwnProperty(re)||(re=/^\s*</.test(Ae)?"default-markup":"default-code"),le[re]}ee(pe,["default-code"]),ee(Ce([],[[O,/^[^<?]+/],[J,/^<!\w[^>]*(?:>|$)/],[we,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[be,/^(?:<[%?]|[%?]>)/],["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"]),ee(Ce([[O,/^[\s]+/,null,` \r
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ue,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[be,/^[=<>\/]+/],["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"]),ee(Ce([],[[N,/^[\s\S]+/]]),["uq.val"]),ee(Le({keywords:T,hashComments:!0,cStyleComments:!0,types:_e}),["c","cc","cpp","cxx","cyc","m"]),ee(Le({keywords:"null,true,false"}),["json"]),ee(Le({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_e}),["cs"]),ee(Le({keywords:Q,cStyleComments:!0}),["java"]),ee(Le({keywords:De,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(Le({keywords:Y,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(Le({keywords:X,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(Le({keywords:ce,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(Le({keywords:G,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(Le({keywords:I,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee(Ce([],[[Te,/^[\s\S]+/]]),["regex"]);function b(re){var Ae=re.langExtension;try{var je=d(re.sourceNode,re.pre),Ne=je.sourceCode;re.sourceCode=Ne,re.spans=je.spans,re.basePos=0,U(Ae,Ne)(re),ie(re)}catch(ke){L.console&&console.log(ke&&ke.stack||ke)}}function K(re,Ae,je){var Ne=je||!1,ke=Ae||null,Me=document.createElement("div");Me.innerHTML="<pre>"+re+"</pre>",Me=Me.firstChild,Ne&&fe(Me,Ne,!0);var Ue={langExtension:ke,numberLines:Ne,sourceNode:Me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Ue),Me.innerHTML}function M(re,Ae){var je=Ae||document.body,Ne=je.ownerDocument||document;function ke(q){return je.getElementsByTagName(q)}for(var Me=[ke("pre"),ke("code"),ke("xmp")],Ue=[],et=0;et<Me.length;++et)for(var Ve=0,Ze=Me[et].length;Ve<Ze;++Ve)Ue.push(Me[et][Ve]);Me=null;var Qe=Date;Qe.now||(Qe={now:function(){return+new Date}});var at=0,tt=/\blang(?:uage)?-([\w.]+)(?!\S)/,st=/\bprettyprint\b/,Re=/\bprettyprinted\b/,vt=/pre|xmp/i,ut=/^code$/i,Be=/^(?:pre|code|xmp)$/i,$e={};function ae(){for(var q=L.PR_SHOULD_USE_CONTINUATION?Qe.now()+250:Infinity;at<Ue.length&&Qe.now()<q;at++){for(var ne=Ue[at],C=$e,E=ne;E=E.previousSibling;){var D=E.nodeType,B=(D===7||D===8)&&E.nodeValue;if(B?!/^\??prettify\b/.test(B):D!==3||/\S/.test(E.nodeValue))break;if(B){C={},B.replace(/\b(\w+)=([\w:.%+-]+)/g,function(jt,St,bn){C[St]=bn});break}}var ge=ne.className;if((C!==$e||st.test(ge))&&!Re.test(ge)){for(var Oe=!1,Ye=ne.parentNode;Ye;Ye=Ye.parentNode){var yt=Ye.tagName;if(Be.test(yt)&&Ye.className&&st.test(Ye.className)){Oe=!0;break}}if(!Oe){ne.className+=" prettyprinted";var kt=C.lang;if(!kt){kt=ge.match(tt);var Ke;!kt&&(Ke=te(ne))&&ut.test(Ke.tagName)&&(kt=Ke.className.match(tt)),kt&&(kt=kt[1])}var _t;if(vt.test(ne.tagName))_t=1;else{var mt=ne.currentStyle,ot=Ne.defaultView,Pt=mt?mt.whiteSpace:ot&&ot.getComputedStyle?ot.getComputedStyle(ne,null).getPropertyValue("white-space"):0;_t=Pt&&Pt.substring(0,3)==="pre"}var At=C.linenums;(At=At==="true"||+At)||(At=ge.match(/\blinenums\b(?::(\d+))?/),At=At?At[1]&&At[1].length?+At[1]:!0:!1),At&&fe(ne,At,_t);var Vt={langExtension:kt,sourceNode:ne,numberLines:At,pre:_t,sourceCode:null,basePos:null,spans:null,decorations:null};b(Vt)}}}at<Ue.length?L.setTimeout(ae,250):typeof re=="function"&&re()}ae()}var ve=L.PR={createSimpleLexer:Ce,registerLangHandler:ee,sourceDecorator:Le,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:N,PR_COMMENT:we,PR_DECLARATION:J,PR_KEYWORD:Fe,PR_LITERAL:Pe,PR_NOCODE:w,PR_PLAIN:O,PR_PUNCTUATION:be,PR_SOURCE:x,PR_STRING:Te,PR_TAG:ue,PR_TYPE:Se,prettyPrintOne:oe?L.prettyPrintOne=K:V=K,prettyPrint:k=oe?L.prettyPrint=M:k=M},Ee=L.define;typeof Ee=="function"&&Ee.amd&&Ee("google-code-prettify",[],function(){return ve})})()},"VrN/":function(nt,Ge,v){(function(z,he){nt.exports=he()})(this,function(){"use strict";var z=navigator.userAgent,he=navigator.platform,oe=/gecko\/\d/i.test(z),xe=/MSIE \d/.test(z),se=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(z),V=/Edge\/(\d+)/.exec(z),k=xe||se||V,L=k&&(xe?document.documentMode||6:+(V||se)[1]),P=!V&&/WebKit\//.test(z),A=P&&/Qt\/\d+\.\d+/.test(z),R=!V&&/Chrome\//.test(z),T=/Opera\//.test(z),Q=/Apple Computer/.test(navigator.vendor),H=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(z),I=/PhantomJS/.test(z),G=!V&&/AppleWebKit/.test(z)&&/Mobile\/\w+/.test(z),X=/Android/.test(z),Y=G||X||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(z),ce=G||/Mac/.test(he),De=/\bCrOS\b/.test(z),Je=/win/i.test(he),_e=T&&z.match(/Version\/(\d*\.\d*)/);_e&&(_e=Number(_e[1])),_e&&_e>=15&&(T=!1,P=!0);var Te=ce&&(A||T&&(_e==null||_e<12.11)),Fe=oe||k&&L>=9;function we(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Se=function(e,t){var i=e.className,n=we(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 Pe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function be(e,t){return Pe(e).appendChild(t)}function O(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 ue(e,t,i,n){var r=O(e,t,i,n);return r.setAttribute("role","presentation"),r}var J;document.createRange?J=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:J=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 x(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 N(e,t){var i=e.className;we(t).test(i)||(e.className+=(i?" ":"")+t)}function w(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!we(i[n]).test(t)&&(t+=" "+i[n]);return t}var S=function(e){e.select()};G?S=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(S=function(e){try{e.select()}catch(t){}});function p(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function d(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 _(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 F=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function te(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ce=50,Le={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},fe={origin:"*mouse"},ie={origin:"+move"};function le(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 ee=[""];function U(e){for(;ee.length<=e;)ee.push(b(ee)+" ");return ee[e]}function b(e){return e[e.length-1]}function K(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function M(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ve(){}function Ee(e,t){var i;return Object.create?i=Object.create(e):(ve.prototype=e,i=new ve),t&&d(t,i),i}var re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ae(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Ae(e)?!0:t.test(e):Ae(e)}function Ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ke=/[\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 Me(e){return e.charCodeAt(0)>=768&&ke.test(e)}function Ue(e,t,i){for(;(i<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=i;return t}function et(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 Ve(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 Ze=null;function Qe(e,t,i){var n;Ze=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:Ze=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:Ze=r)}return n!=null?n:Ze}var at=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(y){return y<=247?e.charAt(y):1424<=y&&y<=1524?"R":1536<=y&&y<=1785?t.charAt(y-1536):1774<=y&&y<=2220?"r":8192<=y&&y<=8203?"w":y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(y,W,$){this.level=y,this.from=W,this.to=$}return function(y,W){var $=W=="ltr"?"L":"R";if(y.length==0||W=="ltr"&&!n.test(y))return!1;for(var me=y.length,de=[],Ie=0;Ie<me;++Ie)de.push(i(y.charCodeAt(Ie)));for(var ze=0,qe=$;ze<me;++ze){var it=de[ze];it=="m"?de[ze]=qe:qe=it}for(var lt=0,rt=$;lt<me;++lt){var ht=de[lt];ht=="1"&&rt=="r"?de[lt]="n":s.test(ht)&&(rt=ht,ht=="r"&&(de[lt]="R"))}for(var xt=1,gt=de[0];xt<me-1;++xt){var Tt=de[xt];Tt=="+"&&gt=="1"&&de[xt+1]=="1"?de[xt]="1":Tt==","&&gt==de[xt+1]&&(gt=="1"||gt=="n")&&(de[xt]=gt),gt=Tt}for(var $t=0;$t<me;++$t){var dn=de[$t];if(dn==",")de[$t]="N";else if(dn=="%"){var Zt=void 0;for(Zt=$t+1;Zt<me&&de[Zt]=="%";++Zt);for(var Bn=$t&&de[$t-1]=="!"||Zt<me&&de[Zt]=="1"?"1":"N",Mn=$t;Mn<Zt;++Mn)de[Mn]=Bn;$t=Zt-1}}for(var tn=0,Rn=$;tn<me;++tn){var yn=de[tn];Rn=="L"&&yn=="1"?de[tn]="L":s.test(yn)&&(Rn=yn)}for(var sn=0;sn<me;++sn)if(r.test(de[sn])){var nn=void 0;for(nn=sn+1;nn<me&&r.test(de[nn]);++nn);for(var Qt=(sn?de[sn-1]:$)=="L",Pn=(nn<me?de[nn]:$)=="L",cr=Qt==Pn?Qt?"L":"R":$,Li=sn;Li<nn;++Li)de[Li]=cr;sn=nn-1}for(var wn=[],si,fn=0;fn<me;)if(l.test(de[fn])){var Yo=fn;for(++fn;fn<me&&l.test(de[fn]);++fn);wn.push(new m(0,Yo,fn))}else{var gi=fn,Gi=wn.length,Vi=W=="rtl"?1:0;for(++fn;fn<me&&de[fn]!="L";++fn);for(var En=gi;En<fn;)if(f.test(de[En])){gi<En&&(wn.splice(Gi,0,new m(1,gi,En)),Gi+=Vi);var dr=En;for(++En;En<fn&&f.test(de[En]);++En);wn.splice(Gi,0,new m(2,dr,En)),Gi+=Vi,gi=En}else++En;gi<fn&&wn.splice(Gi,0,new m(1,gi,fn))}return W=="ltr"&&(wn[0].level==1&&(si=y.match(/^\s+/))&&(wn[0].from=si[0].length,wn.unshift(new m(0,0,si[0].length))),b(wn).level==1&&(si=y.match(/\s+$/))&&(b(wn).to-=si[0].length,wn.push(new m(0,me-si[0].length,me)))),W=="rtl"?wn.reverse():wn}}();function tt(e,t){var i=e.order;return i==null&&(i=e.order=at(e.text,t)),i}var st=[],Re=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]||st).concat(i)}};function vt(e,t){return e._handlers&&e._handlers[t]||st}function ut(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=te(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Be(e,t){var i=vt(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 $e(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Be(e,i||t.type,e,t),D(t)||t.codemirrorIgnore}function ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)te(i,t[n])==-1&&i.push(t[n])}function q(e,t){return vt(e,t).length>0}function ne(e){e.prototype.on=function(t,i){Re(this,t,i)},e.prototype.off=function(t,i){ut(this,t,i)}}function C(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function E(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function D(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function B(e){C(e),E(e)}function ge(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)),ce&&e.ctrlKey&&t==1&&(t=3),t}var Ye=function(){if(k&&L<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}(),yt;function kt(e){if(yt==null){var t=O("span","\u200B");be(e,O("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&L<8))}var i=yt?O("span","\u200B"):O("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ke;function _t(e){if(Ke!=null)return Ke;var t=be(e,document.createTextNode("A\u062EA")),i=J(t,0,1).getBoundingClientRect(),n=J(t,1,2).getBoundingClientRect();return Pe(e),!i||i.left==i.right?!1:Ke=n.right-i.right<3}var mt=`
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/)},ot=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},Pt=function(){var e=O("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Vt(e){if(At!=null)return At;var t=be(e,O("span","x")),i=t.getBoundingClientRect(),n=J(t,0,1).getBoundingClientRect();return At=Math.abs(i.left-n.left)>1}var jt={},St={};function bn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jt[e]=t}function rn(e,t){St[e]=t}function pt(e){if(typeof e=="string"&&St.hasOwnProperty(e))e=St[e];else if(e&&typeof e.name=="string"&&St.hasOwnProperty(e.name)){var t=St[e.name];typeof t=="string"&&(t={name:t}),e=Ee(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return pt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return pt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vn(e,t){t=pt(t);var i=jt[t.name];if(!i)return Vn(e,"text/plain");var n=i(e,t);if(xn.hasOwnProperty(t.name)){var r=xn[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 xn={};function pn(e,t){var i=xn.hasOwnProperty(e)?xn[e]:xn[e]={};d(t,i)}function Sn(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 li(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 Kn(e,t,i){return e.startState?e.startState(t,i):!0}var Nt=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};Nt.prototype.eol=function(){return this.pos>=this.string.length},Nt.prototype.sol=function(){return this.pos==this.lineStart},Nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Nt.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},Nt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Nt.prototype.skipToEnd=function(){this.pos=this.string.length},Nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Nt.prototype.backUp=function(e){this.pos-=e},Nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},Nt.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)}},Nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(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 Un(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 ui(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 Mt(e){if(e.parent==null)return null;for(var t=e.parent,i=te(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Xn(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],m=f.height;if(t<m)break;t-=m}return i+l}function hi(e,t){return t>=e.first&&t<e.first+e.size}function vi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Xe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Xe))return new Xe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function ti(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function ci(e){return Xe(e.line,e.ch)}function di(e,t){return Ct(e,t)<0?t:e}function Mi(e,t){return Ct(e,t)<0?e:t}function c(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 Xe(e.first,0);var i=e.first+e.size-1;return t.line>i?Xe(i,dt(e,i).text.length):a(t,dt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Xe(e.line,t):i<0?Xe(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 g=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},h.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}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof g?new h(e,Sn(e.mode,t.state),i,t.lookAhead):new h(e,Sn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?Sn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new g(t,this.maxLookAhead):t};function Z(e,t,i,n){var r=[e.state.modeGen],s={};Wn(e,t.text,e.doc.mode,i,function(y,W){return r.push(y,W)},s,n);for(var l=i.state,f=function(y){i.baseTokens=r;var W=e.state.overlays[y],$=1,me=0;i.state=!0,Wn(e,t.text,W.mode,i,function(de,Ie){for(var ze=$;me<de;){var qe=r[$];qe>de&&r.splice($,1,de,r[$+1],qe),$+=2,me=Math.min(de,qe)}if(!Ie)return;if(W.opaque)r.splice(ze,$-ze,de,"overlay "+Ie),$=ze+2;else for(;ze<$;ze+=2){var it=r[ze+1];r[ze+1]=(it?it+" ":"")+"overlay "+Ie}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)f(m);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function We(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=ye(e,Mt(t)),r=t.text.length>e.options.maxHighlightLength&&Sn(e.doc.mode,n.state),s=Z(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 ye(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=ln(e,t,i),l=s>n.first&&dt(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,Kn(n.mode),s);return n.iter(s,t,function(m){ct(e,m.text,f);var y=f.line;m.stateAfter=y==t-1||y%5==0||y>=r.viewFrom&&y<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function ct(e,t,i,n){var r=e.doc.mode,s=new Nt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&He(r,i.state);!s.eol();)wt(r,s,i.state),s.start=s.pos}function He(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=li(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function wt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=li(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 Dt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Wt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=dt(r,t.line),m=ye(e,t.line,i),y=new Nt(f.text,e.options.tabSize,m),W;for(n&&(W=[]);(n||y.pos<t.ch)&&!y.eol();)y.start=y.pos,l=wt(s,y,m.state),n&&W.push(new Dt(y,l,Sn(r.mode,m.state)));return n?W:new Dt(y,l,m.state)}function Fn(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 Wn(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var m=0,y=null,W=new Nt(t,e.options.tabSize,n),$,me=e.options.addModeClass&&[null];for(t==""&&Fn(He(i,n.state),s);!W.eol();){if(W.pos>e.options.maxHighlightLength?(f=!1,l&&ct(e,t,n,W.pos),W.pos=t.length,$=null):$=Fn(wt(i,W,n.state,me),s),me){var de=me[0].name;de&&($="m-"+($?de+" "+$:de))}if(!f||y!=$){for(;m<W.start;)m=Math.min(W.start,m+5e3),r(m,y);y=$}W.start=W.pos}for(;m<W.pos;){var Ie=Math.min(W.pos,m+5e3);r(Ie,y),m=Ie}}function ln(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 m=dt(s,f-1),y=m.stateAfter;if(y&&(!i||f+(y instanceof g?y.lookAhead:0)<=s.modeFrontier))return f;var W=_(m.text,null,e.options.tabSize);(r==null||n>W)&&(r=f-1,n=W)}return r}function $n(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=dt(e,n).stateAfter;if(r&&(!(r instanceof g)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Ki=!1,Tn=!1;function An(){Ki=!0}function ni(){Tn=!0}function yi(e,t,i){this.marker=e,this.from=t,this.to=i}function Jn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function ii(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Hn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function fr(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 m=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,m?null:s.to))}}return n}function Xi(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 m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,m?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Dn(e,t){if(t.full)return null;var i=hi(e,t.from.line)&&dt(e,t.from.line).markedSpans,n=hi(e,t.to.line)&&dt(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=Ct(t.from,t.to)==0,f=fr(i,r,l),m=Xi(n,s,l),y=t.text.length==1,W=b(t.text).length+(y?r:0);if(f)for(var $=0;$<f.length;++$){var me=f[$];if(me.to==null){var de=Jn(m,me.marker);de?y&&(me.to=de.to==null?null:de.to+W):me.to=r}}if(m)for(var Ie=0;Ie<m.length;++Ie){var ze=m[Ie];if(ze.to!=null&&(ze.to+=W),ze.from==null){var qe=Jn(f,ze.marker);qe||(ze.from=W,y&&(f||(f=[])).push(ze))}else ze.from+=W,y&&(f||(f=[])).push(ze)}f&&(f=Nn(f)),m&&m!=f&&(m=Nn(m));var it=[f];if(!y){var lt=t.text.length-2,rt;if(lt>0&&f)for(var ht=0;ht<f.length;++ht)f[ht].to==null&&(rt||(rt=[])).push(new yi(f[ht].marker,null,null));for(var xt=0;xt<lt;++xt)it.push(rt);it.push(m)}return it}function Nn(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 Ri(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(de){if(de.markedSpans)for(var Ie=0;Ie<de.markedSpans.length;++Ie){var ze=de.markedSpans[Ie].marker;ze.readOnly&&(!n||te(n,ze)==-1)&&(n||(n=[])).push(ze)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),m=0;m<r.length;++m){var y=r[m];if(Ct(y.to,f.from)<0||Ct(y.from,f.to)>0)continue;var W=[m,1],$=Ct(y.from,f.from),me=Ct(y.to,f.to);($<0||!l.inclusiveLeft&&!$)&&W.push({from:y.from,to:f.from}),(me>0||!l.inclusiveRight&&!me)&&W.push({from:f.to,to:y.to}),r.splice.apply(r,W),m+=W.length-3}return r}function Pi(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 Di(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function qt(e){return e.inclusiveLeft?-1:0}function Bt(e){return e.inclusiveRight?1:0}function mn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=Ct(n.from,r.from)||qt(e)-qt(t);if(s)return-s;var l=Ct(n.to,r.to)||Bt(e)-Bt(t);return l||t.id-e.id}function Ut(e,t){var i=Tn&&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||mn(n,r.marker)<0)&&(n=r.marker);return n}function gn(e){return Ut(e,!0)}function Xt(e){return Ut(e,!1)}function bi(e,t){var i=Tn&&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||mn(n,s.marker)<0)&&(n=s.marker)}return n}function on(e,t,i,n,r){var s=dt(e,t),l=Tn&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var m=l[f];if(!m.marker.collapsed)continue;var y=m.marker.find(0),W=Ct(y.from,i)||qt(m.marker)-qt(r),$=Ct(y.to,n)||Bt(m.marker)-Bt(r);if(W>=0&&$<=0||W<=0&&$>=0)continue;if(W<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(y.to,i)>=0:Ct(y.to,i)>0)||W>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(y.from,n)<=0:Ct(y.from,n)<0))return!0}}function an(e){for(var t;t=gn(e);)e=t.find(-1,!0).line;return e}function ri(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Xt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ci(e,t){var i=dt(e,t),n=an(i);return i==n?t:Mt(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=dt(e,t),n;if(!Zn(e,i))return t;for(;n=Xt(i);)i=n.find(1,!0).line;return Mt(i)+1}function Zn(e,t){var i=Tn&&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&&$i(e,t,n))return!0}}function $i(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return $i(e,n.line,Jn(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)&&$i(e,t,r))return!0}function In(e){e=an(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 Yi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=gn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Xt(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 fi(e){var t=e.display,i=e.doc;t.maxLine=dt(i,i.first),t.maxLineLength=Yi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Yi(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var wi=function(e,t,i){this.text=e,Di(this,t),this.height=i?i(this):1};wi.prototype.lineNo=function(){return Mt(this)},ne(wi);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Pi(e),Di(e,i);var r=n?n(e):1;r!=e.height&&kn(e,r)}function ho(e){e.parent=null,Pi(e)}var Zo={},Qo={};function co(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=ue("span",null,null,P?"padding-right: .1px":null),n={pre:ue("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=Et,_t(e.display.measure)&&(l=tt(s,e.doc.direction))&&(n.addToken=Ot(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Mt(s);Ht(s,n,We(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=w(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=w(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(kt(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(P){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=w(n.pre.className,n.textClass||"")),n}function ft(e){var t=O("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Et(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?bt(t,e.trailingSpace):t,m=e.cm.state.specialChars,y=!1,W;if(!m.test(t))e.col+=t.length,W=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,W),k&&L<9&&(y=!0),e.pos+=t.length;else{W=document.createDocumentFragment();for(var $=0;;){m.lastIndex=$;var me=m.exec(t),de=me?me.index-$:t.length-$;if(de){var Ie=document.createTextNode(f.slice($,$+de));k&&L<9?W.appendChild(O("span",[Ie])):W.appendChild(Ie),e.map.push(e.pos,e.pos+de,Ie),e.col+=de,e.pos+=de}if(!me)break;$+=de+1;var ze=void 0;if(me[0]==" "){var qe=e.cm.options.tabSize,it=qe-e.col%qe;ze=W.appendChild(O("span",U(it),"cm-tab")),ze.setAttribute("role","presentation"),ze.setAttribute("cm-text"," "),e.col+=it}else me[0]=="\r"||me[0]==`
`?(ze=W.appendChild(O("span",me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ze.setAttribute("cm-text",me[0]),e.col+=1):(ze=e.cm.options.specialCharPlaceholder(me[0]),ze.setAttribute("cm-text",me[0]),k&&L<9?W.appendChild(O("span",[ze])):W.appendChild(ze),e.col+=1);e.map.push(e.pos,e.pos+1,ze),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||y||s||l){var lt=i||"";n&&(lt+=n),r&&(lt+=r);var rt=O("span",[W],lt,s);if(l)for(var ht in l)l.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&rt.setAttribute(ht,l[ht]);return e.content.appendChild(rt)}e.content.appendChild(W)}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 Ot(e,t){return function(i,n,r,s,l,f,m){r=r?r+" cm-force-border":"cm-force-border";for(var y=i.pos,W=y+n.length;;){for(var $=void 0,me=0;me<t.length&&!($=t[me],$.to>y&&$.from<=y);me++);if($.to>=W)return e(i,n,r,s,l,f,m);e(i,n.slice(0,$.to-y),r,s,null,f,m),s=null,n=n.slice($.to-y),y=$.to}}}function It(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 Ht(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]),co(i[l+1],t.cm.options));return}for(var f=r.length,m=0,y=1,W="",$,me,de=0,Ie,ze,qe,it,lt;;){if(de==m){Ie=ze=qe=me="",lt=null,it=null,de=Infinity;for(var rt=[],ht=void 0,xt=0;xt<n.length;++xt){var gt=n[xt],Tt=gt.marker;if(Tt.type=="bookmark"&&gt.from==m&&Tt.widgetNode)rt.push(Tt);else if(gt.from<=m&&(gt.to==null||gt.to>m||Tt.collapsed&&gt.to==m&&gt.from==m)){if(gt.to!=null&&gt.to!=m&&de>gt.to&&(de=gt.to,ze=""),Tt.className&&(Ie+=" "+Tt.className),Tt.css&&(me=(me?me+";":"")+Tt.css),Tt.startStyle&&gt.from==m&&(qe+=" "+Tt.startStyle),Tt.endStyle&&gt.to==de&&(ht||(ht=[])).push(Tt.endStyle,gt.to),Tt.title&&((lt||(lt={})).title=Tt.title),Tt.attributes)for(var $t in Tt.attributes)(lt||(lt={}))[$t]=Tt.attributes[$t];Tt.collapsed&&(!it||mn(it.marker,Tt)<0)&&(it=gt)}else gt.from>m&&de>gt.from&&(de=gt.from)}if(ht)for(var dn=0;dn<ht.length;dn+=2)ht[dn+1]==de&&(ze+=" "+ht[dn]);if(!it||it.from==m)for(var Zt=0;Zt<rt.length;++Zt)It(t,0,rt[Zt]);if(it&&(it.from||0)==m){if(It(t,(it.to==null?f+1:it.to)-m,it.marker,it.from==null),it.to==null)return;it.to==m&&(it=!1)}}if(m>=f)break;for(var Bn=Math.min(f,de);;){if(W){var Mn=m+W.length;if(!it){var tn=Mn>Bn?W.slice(0,Bn-m):W;t.addToken(t,tn,$?$+Ie:Ie,qe,m+tn.length==de?ze:"",me,lt)}if(Mn>=Bn){W=W.slice(Bn-m),m=Bn;break}m=Mn,qe=""}W=r.slice(s,s=i[y++]),$=co(i[y++],t.cm.options)}}}function Rt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Mt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zn(e,t)}function Jt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Rt(e.doc,dt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var un=null;function Lt(e){un?un.ops.push(e):e.ownsGroup=un={ops:[e],delayedCallbacks:[]}}function Ni(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 zt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{un=null,t(i)}}var vn=null;function Kt(e,t){var i=vt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;un?r=un.delayedCallbacks:vn?r=vn:(r=vn=[],setTimeout(Yn,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Yn(){var e=vn;vn=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ds(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),k&&L<8&&(e.node.style.zIndex=2)),e.node}function Ps(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(O("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):Fr(e,t)}function Ds(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,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Ps(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 ea(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=O("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=O("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(O("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var m=0;m<e.display.gutterSpecs.length;++m){var y=e.display.gutterSpecs[m].className,W=s.hasOwnProperty(y)&&s[y];W&&f.appendChild(O("div",[W],"CodeMirror-gutter-elt","left: "+n.gutterLeft[y]+"px; width: "+n.gutterWidth[y]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=we("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ta(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),fo(e,t),ea(e,t,i,n),ta(e,t,n),t.node}function ta(e,t,i){if(na(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)na(e,t.rest[n],t,i,!1)}function na(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,f=t.widgets;l<f.length;++l){var m=f[l],y=O("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||y.setAttribute("cm-ignore-events","true"),js(m,y,i,n),e.display.input.setUneditable(y),r&&m.above?s.insertBefore(y,i.gutter||i.text):s.appendChild(y),Kt(m,"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(!x(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;"),be(t.display.measure,O("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=ge(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 Wr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=be(e.measure,O("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 oi(e){return Ce-e.display.nativeBarWidth}function Ii(e){return e.display.scroller.clientWidth-oi(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-oi(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Ii(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 m=l[f],y=l[f+1];Math.abs(m.bottom-y.bottom)>2&&s.push((m.bottom+y.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(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(Mt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=an(t);var i=Mt(t),n=e.display.externalMeasured=new Rt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,be(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ai(e,Ji(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ji(e,t){var i=Mt(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,wo(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ai(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 aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,f,m,y=0;y<e.length;y+=3)if(f=e[y],m=e[y+1],t<f?(r=0,s=1,l="left"):t<m?(r=t-f,s=r+1):(y==e.length-3||t==m&&e[y+3]>t)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[y+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;y&&e[y-2]==e[y-3]&&e[y-1].insertLeft;)n=e[(y-=3)+2],l="left";if(i=="right"&&r==m-f)for(;y<e.length-3&&e[y+3]==e[y+4]&&!e[y+5].insertLeft;)n=e[(y+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:m}}function Fs(e,t){var i=aa;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=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,y;if(s.nodeType==3){for(var W=0;W<4;W++){for(;l&&Me(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Me(t.line.text.charAt(r.coverStart+f));)++f;if(k&&L<9&&l==0&&f==r.coverEnd-r.coverStart?y=s.parentNode.getBoundingClientRect():y=Fs(J(s,l,f).getClientRects(),n),y.left||y.right||l==0)break;f=l,l=l-1,m="right"}k&&L<11&&(y=Hs(e.display.measure,y))}else{l>0&&(m=n="right");var $;e.options.lineWrapping&&($=s.getClientRects()).length>1?y=$[n=="right"?$.length-1:0]:y=s.getBoundingClientRect()}if(k&&L<9&&!l&&(!y||!y.left&&!y.right)){var me=s.parentNode.getClientRects()[0];me?y={left:me.left,right:me.left+Qi(e.display),top:me.top,bottom:me.bottom}:y=aa}for(var de=y.top-t.rect.top,Ie=y.bottom-t.rect.top,ze=(de+Ie)/2,qe=t.view.measure.heights,it=0;it<qe.length-1&&!(ze<qe[it]);it++);var lt=it?qe[it-1]:0,rt=qe[it],ht={left:(m=="right"?y.right:y.left)-t.rect.left,right:(m=="left"?y.left:y.right)-t.rect.left,top:lt,bottom:rt};return!y.left&&!y.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=de,ht.rbottom=Ie),ht}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vt(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 la(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 ua(e){e.display.externalMeasure=null,Pe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function vr(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ha(){return R&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ca(){return R&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(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 Hr(e,t,i,n,r){if(!r){var s=vo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=In(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ca());var m=f.left+(n=="window"?0:ha());i.left+=m,i.right+=m}return i.top+=l,i.bottom+=l,i}function da(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ha(),r-=ca();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 yo(e,t,i,n,r){return n||(n=dt(e.doc,t.line)),Hr(e,n,oa(e,n,t.ch,r),i)}function Qn(e,t,i,n,r,s){n=n||dt(e.doc,t.line),r||(r=Ji(e,n));function l(Ie,ze){var qe=ai(e,r,Ie,ze?"right":"left",s);return ze?qe.left=qe.right:qe.right=qe.left,Hr(e,n,qe,i)}var f=tt(n,e.doc.direction),m=t.ch,y=t.sticky;if(m>=n.text.length?(m=n.text.length,y="before"):m<=0&&(m=0,y="after"),!f)return l(y=="before"?m-1:m,y=="before");function W(Ie,ze,qe){var it=f[ze],lt=it.level==1;return l(qe?Ie-1:Ie,lt!=qe)}var $=Qe(f,m,y),me=Ze,de=W(m,$,y=="before");return me!=null&&(de.other=W(m,me,y!="before")),de}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=dt(e.doc,t.line),r=In(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=Xe(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function xo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=Xn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,dt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=dt(n,r);;){var f=zs(e,l,r,t,i),m=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var y=m.find(1);if(y.line==r)return y;l=dt(n,r=y.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=et(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=et(function(l){return ai(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=Ji(e,t));var r=Hr(e,t,ai(e,i,n),"line").top;return pa(e,t,i,r)}function Co(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-=In(t);var s=Ji(e,t),l=vo(t),f=0,m=t.text.length,y=!0,W=tt(t,e.doc.direction);if(W){var $=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,W,n,r);y=$.level!=1,f=y?$.from:$.to-1,m=y?$.to:$.from-1}var me=null,de=null,Ie=et(function(xt){var gt=ai(e,s,xt);return gt.top+=l,gt.bottom+=l,Co(gt,n,r,!1)?(gt.top<=r&&gt.left<=n&&(me=xt,de=gt),!0):!1},f,m),ze,qe,it=!1;if(de){var lt=n-de.left<de.right-n,rt=lt==y;Ie=me+(rt?0:1),qe=rt?"after":"before",ze=lt?de.left:de.right}else{!y&&(Ie==m||Ie==f)&&Ie++,qe=Ie==0?"after":Ie==t.text.length?"before":ai(e,s,Ie-(y?1:0)).bottom+l<=r==y?"after":"before";var ht=Qn(e,Xe(i,Ie,qe),"line",t,s);ze=ht.left,it=r<ht.top?-1:r>=ht.bottom?1:0}return Ie=Ue(t.text,Ie,1),bo(i,Ie,qe,it,n-ze)}function Gs(e,t,i,n,r,s,l){var f=et(function($){var me=r[$],de=me.level!=1;return Co(Qn(e,Xe(i,de?me.to:me.from,de?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var y=m.level!=1,W=Qn(e,Xe(i,y?m.from:m.to,y?"after":"before"),"line",t,n);Co(W,s,l,!0)&&W.top>l&&(m=r[f-1])}return m}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),m=f.begin,y=f.end;/\s/.test(t.text.charAt(y-1))&&y--;for(var W=null,$=null,me=0;me<r.length;me++){var de=r[me];if(de.from>=y||de.to<=m)continue;var Ie=de.level!=1,ze=ai(e,n,Ie?Math.min(y,de.to)-1:Math.max(m,de.from)).right,qe=ze<s?s-ze+1e9:ze-s;(!W||$>qe)&&(W=de,$=qe)}return W||(W=r[r.length-1]),W.from<m&&(W={from:m,to:W.to,level:W.level}),W.to>y&&(W={from:W.from,to:y,level:W.level}),W}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(O("br"));ji.appendChild(document.createTextNode("x"))}be(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Pe(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),i=O("pre",[t],"CodeMirror-line-like");be(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function wo(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:_o(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _o(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Zi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Qi(e.display)-3);return function(r){if(Zn(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=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&kn(n,r)})}function Bi(e,t,i,n){var r=e.display;if(!i&&ge(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($){return null}var m=xo(e,s,l),y;if(n&&m.xRel>0&&(y=dt(e.doc,m.line).text).length==m.ch){var W=_(y,y.length,e.options.tabSize)-y.length;m=Xe(m.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-W))}return m}function Ui(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 On(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)Tn&&Ci(e.doc,t)<r.viewTo&&Ei(e);else if(i<=r.viewFrom)Tn&&Ur(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=zr(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=zr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ei(e)}else{var f=zr(e,t,t,-1),m=zr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(Jt(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):Ei(e)}var y=r.externalMeasured;y&&(i<y.lineN?y.lineN+=n:t<y.lineN+y.size&&(r.externalMeasured=null))}function _i(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[Ui(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);te(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 zr(e,t,i,n){var r=Ui(e,t),s,l=e.display.view;if(!Tn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m<r;m++)f+=l[m].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(;Ci(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=Jt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Jt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ui(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Jt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ui(e,i)))),n.viewTo=i}function va(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 ya(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 m=f.empty();(m||e.options.showCursorWhenSelecting)&&ba(e,f.head,r),m||Xs(e,f,s)}return n}function ba(e,t,i){var n=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(O("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(O("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 Gr(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=ia(e.display),f=l.left,m=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,y=r.direction=="ltr";function W(rt,ht,xt,gt){ht<0&&(ht=0),ht=Math.round(ht),gt=Math.round(gt),s.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+rt+`px;
top: `+ht+"px; width: "+(xt==null?m-rt:xt)+`px;
height: `+(gt-ht)+"px"))}function $(rt,ht,xt){var gt=dt(r,rt),Tt=gt.text.length,$t,dn;function Zt(tn,Rn){return yo(e,Xe(rt,tn),"div",gt,Rn)}function Bn(tn,Rn,yn){var sn=ma(e,gt,null,tn),nn=Rn=="ltr"==(yn=="after")?"left":"right",Qt=yn=="after"?sn.begin:sn.end-(/\s/.test(gt.text.charAt(sn.end-1))?2:1);return Zt(Qt,nn)[nn]}var Mn=tt(gt,r.direction);return Ve(Mn,ht||0,xt==null?Tt:xt,function(tn,Rn,yn,sn){var nn=yn=="ltr",Qt=Zt(tn,nn?"left":"right"),Pn=Zt(Rn-1,nn?"right":"left"),cr=ht==null&&tn==0,Li=xt==null&&Rn==Tt,wn=sn==0,si=!Mn||sn==Mn.length-1;if(Pn.top-Qt.top<=3){var fn=(y?cr:Li)&&wn,Yo=(y?Li:cr)&&si,gi=fn?f:(nn?Qt:Pn).left,Gi=Yo?m:(nn?Pn:Qt).right;W(gi,Qt.top,Gi-gi,Qt.bottom)}else{var Vi,En,dr,Jo;nn?(Vi=y&&cr&&wn?f:Qt.left,En=y?m:Bn(tn,yn,"before"),dr=y?f:Bn(Rn,yn,"after"),Jo=y&&Li&&si?m:Pn.right):(Vi=y?Bn(tn,yn,"before"):f,En=!y&&cr&&wn?m:Qt.right,dr=!y&&Li&&si?f:Pn.left,Jo=y?Bn(Rn,yn,"after"):m),W(Vi,Qt.top,En-Vi,Qt.bottom),Qt.bottom<Pn.top&&W(f,Qt.bottom,null,Pn.top),W(dr,Pn.top,Jo-dr,Pn.bottom)}(!$t||Gr(Qt,$t)<0)&&($t=Qt),Gr(Pn,$t)<0&&($t=Pn),(!dn||Gr(Qt,dn)<0)&&(dn=Qt),Gr(Pn,dn)<0&&(dn=Pn)}),{start:$t,end:dn}}var me=t.from(),de=t.to();if(me.line==de.line)$(me.line,me.ch,de.ch);else{var Ie=dt(r,me.line),ze=dt(r,de.line),qe=an(Ie)==an(ze),it=$(me.line,me.ch,qe?Ie.text.length+1:null).end,lt=$(de.line,qe?0:null,de.ch).start;qe&&(it.top<lt.top-2?(W(it.right,it.top,null,it.bottom),W(f,lt.top,lt.left,lt.bottom)):W(it.right,it.top,lt.left-it.right,it.bottom)),it.bottom<lt.top&&W(f,it.bottom,null,lt.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()||qi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xa(e){e.state.focused||(e.display.input.focus(),ko(e))}function Ca(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Be(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,Se(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(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(k&&L<8){var m=r.node.offsetTop+r.node.offsetHeight;l=m-i,i=m}else{var y=r.node.getBoundingClientRect();l=y.bottom-y.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-y.left-1)}var W=r.line.height-l;if((W>.005||W<-.005)&&(kn(r.line,l),wa(r.line),r.rest))for(var $=0;$<r.rest.length;$++)wa(r.rest[$]);if(f>e.display.sizerWidth){var me=Math.ceil(f/Qi(e.display));me>e.display.maxLineLength&&(e.display.maxLineLength=me,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(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 Kr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Xn(t,n),l=Xn(t,r);if(i&&i.ensure){var f=i.ensure.from.line,m=i.ensure.to.line;f<s?(s=f,l=Xn(t,In(dt(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=Xn(t,In(dt(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if($e(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&&!I){var s=O("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
height: `+(t.bottom-t.top+oi(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 Ys(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?Xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Xe(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),m=!i||i==t?f:Qn(e,i);r={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var y=To(e,r),W=e.doc.scrollTop,$=e.doc.scrollLeft;if(y.scrollTop!=null&&(xr(e,y.scrollTop),Math.abs(e.doc.scrollTop-W)>1&&(l=!0)),y.scrollLeft!=null&&(Fi(e,y.scrollLeft),Math.abs(e.doc.scrollLeft-$)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=To(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Fi(e,i.scrollLeft)}function To(e,t){var i=e.display,n=Zi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+po(i),m=t.top<n,y=t.bottom>f-n;if(t.top<r)l.scrollTop=m?0:t.top;else if(t.bottom>r+s){var W=Math.min(t.top,(y?f:t.bottom)-s);W!=r&&(l.scrollTop=W)}var $=e.options.fixedGutter?0:i.gutters.offsetWidth,me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-$,de=Ii(e)-i.gutters.offsetWidth,Ie=t.right-t.left>de;return Ie&&(t.right=t.left+de),t.left<10?l.scrollLeft=0:t.left<me?l.scrollLeft=Math.max(0,t.left+$-(Ie?0:10)):t.right>de+me-3&&(l.scrollLeft=t.right+(Ie?0:10)-de),l}function Ao(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function er(e){Xr(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)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);_a(e,i,n,t.margin)}}function _a(e,t,i,n){var r=To(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;oe||Lo(e,{top:t}),Ea(e,t,!0),oe&&Lo(e),_r(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 Fi(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,Oa(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+po(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+oi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Wi=function(e,t,i){this.cm=i;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Re(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Re(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,k&&L<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wi.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}},Wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wi.prototype.zeroWidthHack=function(){var e=ce&&!H?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},Wi.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)},Wi.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 tr(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&&Vr(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:Wi,null:wr};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Se(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),Re(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"?Fi(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Hi(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},Lt(e.curOp)}function zi(e){var t=e.curOp;t&&zt(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&&fi(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&&Oo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(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+oi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ii(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&&Fi(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)&&tr(t,e.barMeasure),e.updatedDisplay&&Ro(t,e.barMeasure),e.selectionChanged&&So(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&xa(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Aa(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&&Fi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||Be(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&Be(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function jn(e,t){if(e.curOp)return t();Hi(e);try{return t()}finally{zi(e)}}function hn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hi(e);try{return t.apply(e,arguments)}finally{zi(e)}}}function _n(e){return function(){if(this.curOp)return e.apply(this,arguments);Hi(this);try{return e.apply(this,arguments)}finally{zi(this)}}}function cn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hi(t);try{return e.apply(this,arguments)}finally{zi(t)}}}function _r(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,p(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=ye(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?Sn(t.mode,n.state):null,m=Z(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var y=s.styleClasses,W=m.classes;W?s.styleClasses=W:y&&(s.styleClasses=null);for(var $=!l||l.length!=s.styles.length||y!=W&&(!y||!W||y.bgClass!=W.bgClass||y.textClass!=W.textClass),me=0;!$&&me<l.length;++me)$=l[me]!=s.styles[me];$&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ct(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return _r(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&jn(e,function(){for(var s=0;s<r.length;s++)_i(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Kr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ii(e),this.force=i,this.dims=wo(e),this.events=[]};$r.prototype.signal=function(e,t){q(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Be.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=oi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=oi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=j();if(!t||!x(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&x(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&&x(document.body,e.anchorNode)&&x(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 Oo(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&&va(e)==0)return!1;La(e)&&(Ei(e),t.dims=wo(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)),Tn&&(s=Ci(e.doc,s),l=Ur(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=In(dt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=va(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var y=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(y),Pe(i.cursorDiv),Pe(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,_r(e,400)),i.updateLineNumbers=null,!0}function Aa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ii(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Kr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Kr(e.display,e.doc,i));if(!Oo(e,t))break;Vr(e);var r=Cr(e);yr(e),tr(e,r),Ro(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 Lo(e,t){var i=new $r(e,t);if(Oo(e,i)){Vr(e),Aa(e,i);var n=Cr(e);yr(e),tr(e,n),Ro(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(Ie){var ze=Ie.nextSibling;return P&&ce&&e.display.currentWheelTarget==Ie?Ie.style.display="none":Ie.parentNode.removeChild(Ie),ze}for(var m=n.view,y=n.viewFrom,W=0;W<m.length;W++){var $=m[W];if(!$.hidden)if(!$.node||$.node.parentNode!=s){var me=Is(e,$,y,i);s.insertBefore(me,l)}else{for(;l!=$.node;)l=f(l);var de=r&&t!=null&&t<=y&&$.lineNumber;$.changes&&(te($.changes,"gutter")>-1&&(de=!1),pr(e,$,y,i)),de&&(Pe($.lineNumber),$.lineNumber.appendChild(document.createTextNode(vi(e.options,y)))),l=$.node.nextSibling}y+=$.size}for(;l;)l=f(l)}function Mo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ro(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+oi(e)+"px"}function Oa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_o(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 m=0;m<f.length;m++)f[m].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function La(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=vi(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(O("div",[O("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 Po(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;Pe(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(O("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 Er(e){Ma(e.display),On(e),Oa(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ue("div",null,"CodeMirror-code"),r.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=O("div",null,"CodeMirror-cursors"),r.measure=O("div",null,"CodeMirror-measure"),r.lineMeasure=O("div",null,"CodeMirror-measure"),r.lineSpace=ue("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ue("div",[r.lineSpace],"CodeMirror-lines");r.mover=O("div",[s],null,"position: relative"),r.sizer=O("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=O("div",null,null,"position: absolute; height: "+Ce+"px; width: 1px;"),r.gutters=O("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=O("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=O("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),k&&L<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!P&&!(oe&&Y)&&(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=Po(n.gutters,n.lineNumbers),Ma(r),i.init(r)}var Yr=0,zn=null;k?zn=-.53:oe?zn=15:R?zn=-.7:Q&&(zn=-1/3);function Ra(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=Ra(e);return t.x*=zn,t.y*=zn,t}function Pa(e,t){var i=Ra(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&ce&&P){e:for(var y=t.target,W=s.view;y!=l;y=y.parentNode)for(var $=0;$<W.length;$++)if(W[$].node==y){e.display.currentWheelTarget=y;break e}}if(n&&!oe&&!T&&zn!=null){r&&m&&xr(e,Math.max(0,l.scrollTop+r*zn)),Fi(e,Math.max(0,l.scrollLeft+n*zn)),(!r||r&&m)&&C(t),s.wheelStartX=null;return}if(r&&zn!=null){var me=r*zn,de=e.doc.scrollTop,Ie=de+s.wrapper.clientHeight;me<0?de=Math.max(0,de+me-50):Ie=Math.min(e.doc.height,Ie+me+50),Lo(e,{top:de,bottom:Ie})}Yr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var ze=l.scrollLeft-s.wheelStartX,qe=l.scrollTop-s.wheelStartY,it=qe&&s.wheelDY&&qe/s.wheelDY||ze&&s.wheelDX&&ze/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!it)return;zn=(zn*Yr+it)/(Yr+1),++Yr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Gn=function(e,t){this.ranges=e,this.primIndex=t};Gn.prototype.primary=function(){return this.ranges[this.primIndex]},Gn.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(!ti(i.anchor,n.anchor)||!ti(i.head,n.head))return!1}return!0},Gn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(ci(this.ranges[t].anchor),ci(this.ranges[t].head));return new Gn(e,this.primIndex)},Gn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Gn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ct(t,n.from())>=0&&Ct(e,n.to())<=0)return i}return-1};var Ft=function(e,t){this.anchor=e,this.head=t};Ft.prototype.from=function(){return Mi(this.anchor,this.head)},Ft.prototype.to=function(){return di(this.anchor,this.head)},Ft.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qn(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(me,de){return Ct(me.from(),de.from())}),i=te(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],m=Ct(f.to(),l.from());if(n&&!l.empty()?m>0:m>=0){var y=Mi(f.from(),l.from()),W=di(f.to(),l.to()),$=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ft($?W:y,$?y:W))}}return new Gn(t,i)}function Si(e,t){return new Gn([new Ft(e,t||e)],0)}function ki(e){return e.text?Xe(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(Ct(e,t.from)<0)return e;if(Ct(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),Xe(i,n)}function Do(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Ft(Da(r.anchor,t),Da(r.head,t)))}return qn(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?Xe(i.line,e.ch-t.ch+i.ch):Xe(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=Xe(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],m=Na(f.from,r,s),y=Na(ki(f),r,s);if(r=f.to,s=y,i=="around"){var W=e.sel.ranges[l],$=Ct(W.head,W.anchor)<0;n[l]=new Ft($?y:m,$?m:y)}else n[l]=new Ft(m,m)}return new Gn(n,e.sel.primIndex)}function No(e){e.doc.mode=Vn(e.options,e.doc.modeOption),Sr(e)}function Sr(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,_r(e,100),e.state.modeGen++,e.curOp&&On(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(lt){return i?i[lt]:null}function s(lt,rt,ht){uo(lt,rt,ht,n),Kt(lt,"change",lt,t)}function l(lt,rt){for(var ht=[],xt=lt;xt<rt;++xt)ht.push(new wi(y[xt],r(xt),n));return ht}var f=t.from,m=t.to,y=t.text,W=dt(e,f.line),$=dt(e,m.line),me=b(y),de=r(y.length-1),Ie=m.line-f.line;if(t.full)e.insert(0,l(0,y.length)),e.remove(y.length,e.size-y.length);else if(Ia(e,t)){var ze=l(0,y.length-1);s($,$.text,de),Ie&&e.remove(f.line,Ie),ze.length&&e.insert(f.line,ze)}else if(W==$)if(y.length==1)s(W,W.text.slice(0,f.ch)+me+W.text.slice(m.ch),de);else{var qe=l(1,y.length-1);qe.push(new wi(me+W.text.slice(m.ch),de,n)),s(W,W.text.slice(0,f.ch)+y[0],r(0)),e.insert(f.line+1,qe)}else if(y.length==1)s(W,W.text.slice(0,f.ch)+y[0]+$.text.slice(m.ch),r(0)),e.remove(f.line+1,Ie);else{s(W,W.text.slice(0,f.ch)+y[0],r(0)),s($,me+$.text.slice(m.ch),de);var it=l(1,y.length-1);Ie>1&&e.remove(f.line+1,Ie-1),e.insert(f.line+1,it)}Kt(e,"change",e,t)}function Ti(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var m=r.linked[f];if(m.doc==s)continue;var y=l&&m.sharedHist;if(i&&!y)continue;t(m.doc,y),n(m.doc,r,y)}}n(e,null,!0)}function ja(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Eo(e),No(e),Ba(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,On(e)}function Ba(e){(e.doc.direction=="rtl"?N:Se)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){jn(e,function(){Ba(e),On(e)})}function Jr(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 jo(e,t){var i={from:ci(t.from),to:ki(t),text:Un(e,t.from,t.to)};return Wa(e,i,t.from.line,t.to.line+1),Ti(e,function(n){return Wa(n,i,t.from.line,t.to.line+1)},!0),i}function Ua(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ua(e.done),b(e.done);if(e.done.length&&!b(e.done).ranges)return b(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(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=b(l.changes),Ct(t.from,t.to)==0&&Ct(t.from,f.to)==0?f.to=ki(t):l.changes.push(jo(e,t));else{var m=b(r.done);for((!m||!m.ranges)&&Zr(e.sel,r.done),l={changes:[jo(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||Be(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,b(r.done),t))?r.done[r.done.length-1]=t:Zr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ua(r.undone)}function Zr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Wa(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 Ha(e,t){var i=yl(e,t),n=Dn(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 m=l[f],y=0;y<s.length;++y)if(s[y].marker==m.marker)continue e;s.push(m)}}else l&&(i[r]=l)}return i}function nr(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Gn.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var m=0;m<l.length;++m){var y=l[m],W=void 0;if(f.push({from:y.from,to:y.to,text:y.text}),t)for(var $ in y)(W=$.match(/^spans_(\d+)$/))&&(te(t,Number(W[1]))>-1&&(b(f)[$]=y[$],delete y[$]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ct(t,r)<0;s!=Ct(i,r)<0?(r=t,t=i):s!=Ct(t,i)<0&&(t=i)}return new Ft(r,t)}else return new Ft(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Cn(e,new Gn([Bo(e.sel.primary(),t,i,r)],0),n)}function za(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]=Bo(e.sel.ranges[s],t[s],null,r);var l=qn(e.cm,n,e.sel.primIndex);Cn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Cn(e,qn(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){Cn(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 Ft(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Be(e,"beforeSelectionChange",e,n),e.cm&&Be(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?qn(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=b(n);r&&r.ranges?(n[n.length-1]=t,qr(e,t,i)):Cn(e,t,i)}function Cn(e,t,i){qr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qr(e,t,i){(q(e,"beforeSelectionChange")||e.cm&&q(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ka(e,$a(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&er(e.cm)}function Ka(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ae(e.cm)),Kt(e,"cursorActivity",e)}function Xa(e){Ka(e,$a(e,e.sel,null,!1))}function $a(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],m=eo(e,l.anchor,f&&f.anchor,i,n),y=eo(e,l.head,f&&f.head,i,n);(r||m!=l.anchor||y!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ft(m,y))}return r?qn(e.cm,r,t.primIndex):t}function ir(e,t,i,n,r){var s=dt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],m=f.marker,y="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,W="selectRight"in m?!m.selectRight:m.inclusiveRight;if((f.from==null||(y?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(W?f.to>=t.ch:f.to>t.ch))){if(r&&(Be(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var $=m.find(n<0?1:-1),me=void 0;if((n<0?W:y)&&($=Ya(e,$,-n,$&&$.line==t.line?s:null)),$&&$.line==t.line&&(me=Ct($,i))&&(n<0?me<0:me>0))return ir(e,$,t,n,r)}var de=m.find(n<0?-1:1);return(n<0?y:W)&&(de=Ya(e,de,n,de.line==t.line?s:null)),de?ir(e,de,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=ir(e,t,i,s,r)||!r&&ir(e,t,i,s,!0)||ir(e,t,i,-s,r)||!r&&ir(e,t,i,-s,!0);return l||(e.cantEdit=!0,Xe(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Xe(t.line-1)):null:i>0&&t.ch==(n||dt(e,t.line)).text.length?t.line<e.first+e.size-1?Xe(t.line+1,0):null:new Xe(t.line,t.ch+i)}function Ja(e){e.setSelection(Xe(e.firstLine(),0),Xe(e.lastLine()),pe)}function Za(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)}),Be(e,"beforeChange",e,n),e.cm&&Be(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 rr(e,t,i){if(e.cm){if(!e.cm.curOp)return hn(e.cm,rr)(e,t,i);if(e.cm.state.suppressEdits)return}if((q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Ki&&!i&&Ri(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Do(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),kr(e,t,i,Dn(e,t));var n=[];Ti(e,function(r,s){!s&&te(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),kr(r,t,null,Dn(r,t))})}function to(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,m=t=="undo"?r.undone:r.done,y=0;y<f.length&&!(s=f[y],i?s.ranges&&!s.equals(e.sel):!s.ranges);y++);if(y==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Zr(s,m),i&&!s.equals(e.sel)){Cn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var W=[];Zr(l,m),m.push({changes:W,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var $=q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"),me=function(ze){var qe=s.changes[ze];if(qe.origin=t,$&&!Za(e,qe,!1))return f.length=0,{};W.push(jo(e,qe));var it=ze?Do(e,qe):b(f);kr(e,qe,it,Ha(e,qe)),!ze&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:ki(qe)});var lt=[];Ti(e,function(rt,ht){!ht&&te(lt,rt.history)==-1&&(ns(rt.history,qe),lt.push(rt.history)),kr(rt,qe,null,Ha(rt,qe))})},de=s.changes.length-1;de>=0;--de){var Ie=me(de);if(Ie)return Ie.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gn(K(e.sel.ranges,function(r){return new Ft(Xe(r.anchor.line+t,r.anchor.ch),Xe(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){On(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)_i(e.cm,n,"gutter")}}function kr(e,t,i,n){if(e.cm&&!e.cm.curOp)return hn(e.cm,kr)(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:Xe(e.first,0),to:Xe(t.to.line+r,t.to.ch),text:[b(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Xe(s,dt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Un(e,t.from,t.to),i||(i=Do(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,pe),e.cantEdit&&eo(e,Xe(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,m=s.line;e.options.lineWrapping||(m=Mt(an(dt(n,s.line))),n.iter(m,l.line+1,function(de){if(de==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ae(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(de){var Ie=Yi(de);Ie>r.maxLineLength&&(r.maxLine=de,r.maxLineLength=Ie,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),$n(n,s.line),_r(e,400);var y=t.text.length-(l.line-s.line)-1;t.full?On(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?_i(e,s.line,"text"):On(e,s.line,l.line+1,y);var W=q(e,"changes"),$=q(e,"change");if($||W){var me={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};$&&Kt(e,"change",e,me),W&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(me)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),Ct(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),rr(e,{from:i,to:n,text:t,origin:r})}function es(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ts(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++)es(s.ranges[f].anchor,t,i,n),es(s.ranges[f].head,t,i,n);continue}for(var m=0;m<s.changes.length;++m){var y=s.changes[m];if(i<y.from.line)y.from=Xe(y.from.line+n,y.from.ch),y.to=Xe(y.to.line+n,y.to.ch);else if(t<=y.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ns(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ts(e.done,i,n,r),ts(e.undone,i,n,r)}function Tr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=dt(e,c(e,t)):r=Mt(t),r==null?null:(n(s,r)&&e.cm&&_i(e.cm,r,i),s)}function Ar(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}Ar.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),Kt(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 Or(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}Or.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 Ar))){var f=[];this.collapse(f),this.children=[new Ar(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 m=new Ar(r.lines.slice(f,f+=25));r.height-=m.height,this.children.splice(++n,0,m),m.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 Or(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=te(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Or(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 Lr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Lr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Mt(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&&(jn(e,function(){is(e,i,-s),_i(e,n,"widget")}),Kt(e,"lineWidgetCleared",e,this,n))},Lr.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;Zn(this.doc,n)||kn(n,n.height+r),i&&jn(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),Kt(i,"lineWidgetChanged",i,e,Mt(n))})},ne(Lr);function is(e,t,i){In(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ao(e,i)}function Cl(e,t,i,n){var r=new Lr(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&&!Zn(e,l)){var m=In(l)<e.scrollTop;kn(l,l.height+gr(r)),m&&Ao(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Kt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Mt(t)),r}var rs=0,Ai=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Ai.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hi(e),q(this,"clear")){var i=this.find();i&&Kt(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=Jn(l.markedSpans,this);e&&!this.collapsed?_i(e,Mt(l),"text"):e&&(f.to!=null&&(r=Mt(l)),f.from!=null&&(n=Mt(l))),l.markedSpans=ii(l.markedSpans,f),f.from==null&&this.collapsed&&!Zn(this.doc,l)&&e&&kn(l,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var y=an(this.lines[m]),W=Yi(y);W>e.display.maxLineLength&&(e.display.maxLine=y,e.display.maxLineLength=W,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&On(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&Kt(e,"markerCleared",e,this,n,r),t&&zi(e),this.parent&&this.parent.clear()},Ai.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=Jn(s.markedSpans,this);if(l.from!=null&&(i=Xe(t?s:Mt(s),l.from),e==-1))return i;if(l.to!=null&&(n=Xe(t?s:Mt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ai.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;jn(n,function(){var r=t.line,s=Mt(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Zn(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var m=gr(i)-f;m&&kn(r,r.height+m)}Kt(n,"markerChanged",n,e)})},Ai.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||te(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ai.prototype.detachLine=function(e){if(this.lines.splice(te(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ne(Ai);function ar(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return hn(e.cm,ar)(e,t,i,n,r);var s=new Ai(e,r),l=Ct(t,i);if(n&&d(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ue("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(on(e,t.line,t,i,s)||t.line!=i.line&&on(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,y;if(e.iter(f,i.line+1,function($){m&&s.collapsed&&!m.options.lineWrapping&&an($)==m.display.maxLine&&(y=!0),s.collapsed&&f!=t.line&&kn($,0),Hn($,new yi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function($){Zn(e,$)&&kn($,0)}),s.clearOnEnter&&Re(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(An(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),m){if(y&&(m.curOp.updateMaxLine=!0),s.collapsed)On(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var W=t.line;W<=i.line;W++)_i(m,W,"text");s.atomic&&Xa(m.doc),Kt(m,"markerAdded",m,s)}return s}var Mr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Mr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Kt(this,"clear")},Mr.prototype.find=function(e,t){return this.primary.find(e,t)},ne(Mr);function wl(e,t,i,n,r){n=d(n),n.shared=!1;var s=[ar(e,t,i,n,r)],l=s[0],f=n.widgetNode;return Ti(e,function(m){f&&(n.widgetNode=f.cloneNode(!0)),s.push(ar(m,o(m,t),o(m,i),n,r));for(var y=0;y<m.linked.length;++y)if(m.linked[y].isParent)return;l=b(s)}),new Mr(s,l)}function os(e){return e.findMarks(Xe(e.first,0),e.clipPos(Xe(e.lastLine())),function(t){return t.parent})}function _l(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(Ct(s,l)){var f=ar(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function El(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ti(r.primary.doc,function(m){return s.push(m)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];te(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Ln=function(e,t,i,n,r){if(!(this instanceof Ln))return new Ln(e,t,i,n,r);i==null&&(i=0),Or.call(this,[new Ar([new wi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Xe(i,0);this.sel=Si(s),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Io(this,{from:s,to:s,text:e}),Cn(this,Si(s),pe)};Ln.prototype=Ee(Or.prototype,{constructor:Ln,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=ui(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:cn(function(e){var t=Xe(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:Xe(i,dt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Cn(this,Si(t),pe)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,or(this,e,t,i,n)},getRange:function(e,t,i){var n=Un(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(hi(this,e))return dt(this,e)},getLineNumber:function(e){return Mt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dt(this,e)),an(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:cn(function(e,t,i){Ga(this,o(this,typeof e=="number"?Xe(e,t||0):e),null,i)}),setSelection:cn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:cn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:cn(function(e,t){za(this,u(this,e),t)}),extendSelectionsBy:cn(function(e,t){var i=K(this.sel.ranges,e);za(this,u(this,i),t)}),setSelections:cn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ft(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Cn(this,qn(this.cm,n,t),i)}),addSelection:cn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ft(o(this,e),o(this,t||e))),Cn(this,qn(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=Un(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=Un(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:cn(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),m=n.length-1;m>=0;m--)rr(this,n[m]);f?Va(this,f):this.cm&&er(this.cm)}),undo:cn(function(){to(this,"undo")}),redo:cn(function(){to(this,"redo")}),undoSelection:cn(function(){to(this,"undo",!0)}),redoSelection:cn(function(){to(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 Jr(this.history.maxGeneration),Ti(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:nr(this.history.done),undone:nr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=nr(e.done.slice(0),null,!0),t.undone=nr(e.undone.slice(0),null,!0)},setGutterMarker:cn(function(e,t,i){return Tr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Ne(r)&&(n.gutterMarkers=null),!0})}),clearGutter:cn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Tr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ne(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!hi(this,e))return null;if(t=e,e=dt(this,e),!e)return null}else if(t=Mt(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:cn(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(we(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:cn(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(we(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:cn(function(e,t,i){return Cl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ar(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),ar(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=dt(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 m=l[f];!(m.to!=null&&r==e.line&&e.ch>=m.to||m.from==null&&r!=e.line||m.from!=null&&r==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.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,Xe(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 Ln(ui(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 Ln(ui(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}],_l(n,os(this)),n},unlinkDoc:function(e){if(e instanceof Yt&&(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),El(os(this));break}if(e.history==this.history){var n=[e.id];Ti(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=nr(this.history.done,n),e.history.undone=nr(this.history.undone,n)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):mt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:cn(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)})}),Ln.prototype.eachLine=Ln.prototype.iter;var as=0;function kl(e){var t=this;if(ss(t),$e(t,e)||pi(t.display,e))return;C(e),k&&(as=+new Date);var i=Bi(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&&hn(t,function(){i=o(t.doc,i);var de={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ie){return Ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,de),Va(t.doc,Si(o(t.doc,i),o(t.doc,ki(de))))})()},m=function(de,Ie){if(t.options.allowDropFileTypes&&te(t.options.allowDropFileTypes,de.type)==-1){f();return}var ze=new FileReader;ze.onerror=function(){return f()},ze.onload=function(){var qe=ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){f();return}s[Ie]=qe,f()},ze.readAsText(de)},y=0;y<n.length;y++)m(n[y],y);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 W=e.dataTransfer.getData("Text");if(W){var $;if(t.state.draggingText&&!t.state.draggingText.copy&&($=t.listSelections()),qr(t.doc,Si(i,i)),$)for(var me=0;me<$.length;++me)or(t.doc,"",$[me].anchor,$[me].head,"drag");t.replaceSelection(W,"around","paste"),t.display.input.focus()}}catch(de){}}}function Tl(e,t){if(k&&(!e.state.draggingText||+new Date-as<100)){B(t);return}if($e(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Q){var i=O("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),T&&i.parentNode.removeChild(i)}}function Al(e,t){var i=Bi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),be(e.display.dragCursor,n)}function ss(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ls(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 us=!1;function Ol(){if(us)return;Ll(),us=!0}function Ll(){var e;Re(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ml)},100))}),Re(window,"blur",function(){return ls(qi)})}function Ml(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Oi={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"},Rr=0;Rr<10;Rr++)Oi[Rr+48]=Oi[Rr+96]=String(Rr);for(var no=65;no<=90;no++)Oi[no]=String.fromCharCode(no);for(var Pr=1;Pr<=12;Pr++)Oi[Pr+111]=Oi[Pr+63235]="F"+Pr;var mi={};mi.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"},mi.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"},mi.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"},mi.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"]},mi.default=ce?mi.macDefault:mi.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Pl(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=K(i.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var m=t[f];if(!m)t[f]=l;else if(m!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var y in t)e[y]=t[y];return e}function sr(e,t,i,n){t=io(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 sr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=sr(e,t.fallthrough[s],i,n);if(l)return l}}}function hs(e){var t=typeof e=="string"?e:Oi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function cs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(Te?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(Te?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(T&&e.keyCode==34&&e.char)return!1;var i=Oi[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),cs(i,e,t))}function io(e){return typeof e=="string"?mi[e]:e}function lr(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&Ct(s.from,b(n).to)<=0;){var l=n.pop();if(Ct(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}jn(e,function(){for(var f=n.length-1;f>=0;f--)or(e.doc,"",n[f].from,n[f].to,"+delete");er(e)})}function Fo(e,t,i){var n=Ue(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Wo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new Xe(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=tt(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",y;if(l.level>0||t.doc.direction=="rtl"){var W=Ji(t,i);y=r<0?i.text.length-1:0;var $=ai(t,W,y).top;y=et(function(me){return ai(t,W,me).top==$},r<0==(l.level==1)?l.from:l.to-1,y),m=="before"&&(y=Fo(i,y,1))}else y=r<0?l.to:l.from;return new Xe(n,y,m)}}return new Xe(n,r<0?i.text.length:0,r<0?"before":"after")}function Dl(e,t,i,n){var r=tt(t,e.doc.direction);if(!r)return Wo(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=Qe(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 Wo(t,i,n);var f=function(it,lt){return Fo(t,it instanceof Xe?it.ch:it,lt)},m,y=function(it){return e.options.lineWrapping?(m=m||Ji(e,t),ma(e,t,m,it)):{begin:0,end:t.text.length}},W=y(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var $=l.level==1==n<0,me=f(i,$?1:-1);if(me!=null&&($?me<=l.to&&me<=W.end:me>=l.from&&me>=W.begin)){var de=$?"before":"after";return new Xe(i.line,me,de)}}var Ie=function(it,lt,rt){for(var ht=function($t,dn){return dn?new Xe(i.line,f($t,1),"before"):new Xe(i.line,$t,"after")};it>=0&&it<r.length;it+=lt){var xt=r[it],gt=lt>0==(xt.level!=1),Tt=gt?rt.begin:f(rt.end,-1);if(xt.from<=Tt&&Tt<xt.to)return ht(Tt,gt);if(Tt=gt?xt.from:f(xt.to,-1),rt.begin<=Tt&&Tt<rt.end)return ht(Tt,gt)}},ze=Ie(s+n,n,W);if(ze)return ze;var qe=n>0?W.end:f(W.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&(ze=Ie(n>0?0:r.length-1,n,y(qe)),ze)?ze:null}var Dr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return lr(e,function(t){if(t.empty()){var i=dt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Xe(t.head.line+1,0)}:{from:t.head,to:Xe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:Xe(t.from().line,0),to:o(e.doc,Xe(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:Xe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return lr(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 lr(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(Xe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Xe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},ie)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},ie)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ps(e,t.head):n},ie)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=_(e.getLine(s.line),s.ch,n);t.push(U(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return jn(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=dt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Xe(r.line,r.ch-1)),r.ch>0)r=new Xe(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Xe(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=dt(e.doc,r.line-1).text;l&&(r=new Xe(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Xe(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ft(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return jn(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);er(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=dt(e.doc,t),n=an(i);return n!=i&&(t=Mt(n)),Ho(!0,e,n,t,1)}function Nl(e,t){var i=dt(e.doc,t),n=ri(i);return n!=i&&(t=Mt(n)),Ho(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=dt(e.doc,i.line),r=tt(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 Xe(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Dr[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)!=Le}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=sr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&sr(t,e.options.extraKeys,i,e)||sr(t,e.options.keyMap,i,e)}var jl=new F;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(hs(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())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&Kt(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(C(i),So(e)),!!r}function gs(e,t){var i=ds(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):Nr(e,i,t,function(n){return ro(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var zo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),$e(t,e))return;k&&L<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);T&&(zo=n?i:null,!n&&i==88&&!Pt&&(ce?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),oe&&!ce&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Se(t,"CodeMirror-crosshair"),ut(document,"keyup",i),ut(document,"mouseover",i))}Re(document,"keyup",i),Re(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),$e(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||$e(t,e)||e.ctrlKey&&!e.altKey||ce&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(T&&i==zo){zo=null,C(e);return}if(T&&(!e.which||e.which<10)&&gs(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 Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&Ct(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 Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),jr=null,"single")}function xs(e){var t=this,i=t.display;if($e(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){P||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(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):ge(e)==i.scroller&&C(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Fe?t.display.input.onContextMenu(e):Ca(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,cs(s,r),r,function(l){if(typeof l=="string"&&(l=Dr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Le}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=De?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=ce?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ce?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){k?setTimeout(p(xa,e),0):e.curOp.focus=j();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ye&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ct((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ct(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=hn(e,function(y){P&&(r.scroller.draggable=!1),e.state.draggingText=!1,ut(r.wrapper.ownerDocument,"mouseup",l),ut(r.wrapper.ownerDocument,"mousemove",f),ut(r.scroller,"dragstart",m),ut(r.scroller,"drop",l),s||(C(y),n.addNew||Qr(e.doc,i,null,null,n.extend),P&&!Q||k&&L==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(y){s=s||Math.abs(t.clientX-y.clientX)+Math.abs(t.clientY-y.clientY)>=10},m=function(){return s=!0};P&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Re(r.wrapper.ownerDocument,"mouseup",l),Re(r.wrapper.ownerDocument,"mousemove",f),Re(r.scroller,"dragstart",m),Re(r.scroller,"drop",l),Ca(e),setTimeout(function(){return r.input.focus()},20)}function Cs(e,t,i){if(i=="char")return new Ft(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ft(Xe(t.line,0),o(e.doc,Xe(t.line+1,0)));var n=i(e,t);return new Ft(n.from,n.to)}function Kl(e,t,i,n){var r=e.display,s=e.doc;C(t);var l,f,m=s.sel,y=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=y[f]:l=new Ft(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ft(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var W=Cs(e,i,n.unit);n.extend?l=Bo(l,W.anchor,W.head,n.extend):l=W}n.addNew?f==-1?(f=y.length,Cn(s,qn(e,y.concat([l]),f),{scroll:!1,origin:"*mouse"})):y.length>1&&y[f].empty()&&n.unit=="char"&&!n.extend?(Cn(s,qn(e,y.slice(0,f).concat(y.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Uo(s,f,l,fe):(f=0,Cn(s,new Gn([l],0),fe),m=s.sel);var $=i;function me(rt){if(Ct($,rt)==0)return;if($=rt,n.unit=="rectangle"){for(var ht=[],xt=e.options.tabSize,gt=_(dt(s,i.line).text,i.ch,xt),Tt=_(dt(s,rt.line).text,rt.ch,xt),$t=Math.min(gt,Tt),dn=Math.max(gt,Tt),Zt=Math.min(i.line,rt.line),Bn=Math.min(e.lastLine(),Math.max(i.line,rt.line));Zt<=Bn;Zt++){var Mn=dt(s,Zt).text,tn=le(Mn,$t,xt);$t==dn?ht.push(new Ft(Xe(Zt,tn),Xe(Zt,tn))):Mn.length>tn&&ht.push(new Ft(Xe(Zt,tn),Xe(Zt,le(Mn,dn,xt))))}ht.length||ht.push(new Ft(i,i)),Cn(s,qn(e,m.ranges.slice(0,f).concat(ht),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(rt)}else{var Rn=l,yn=Cs(e,rt,n.unit),sn=Rn.anchor,nn;Ct(yn.anchor,sn)>0?(nn=yn.head,sn=Mi(Rn.from(),yn.anchor)):(nn=yn.anchor,sn=di(Rn.to(),yn.head));var Qt=m.ranges.slice(0);Qt[f]=Xl(e,new Ft(o(s,sn),nn)),Cn(s,qn(e,Qt,f),fe)}}var de=r.wrapper.getBoundingClientRect(),Ie=0;function ze(rt){var ht=++Ie,xt=Bi(e,rt,!0,n.unit=="rectangle");if(!xt)return;if(Ct(xt,$)!=0){e.curOp.focus=j(),me(xt);var gt=Kr(r,s);(xt.line>=gt.to||xt.line<gt.from)&&setTimeout(hn(e,function(){Ie==ht&&ze(rt)}),150)}else{var Tt=rt.clientY<de.top?-20:rt.clientY>de.bottom?20:0;Tt&&setTimeout(hn(e,function(){if(Ie!=ht)return;r.scroller.scrollTop+=Tt,ze(rt)}),50)}}function qe(rt){e.state.selectingText=!1,Ie=Infinity,rt&&(C(rt),r.input.focus()),ut(r.wrapper.ownerDocument,"mousemove",it),ut(r.wrapper.ownerDocument,"mouseup",lt),s.history.lastSelOrigin=null}var it=hn(e,function(rt){rt.buttons===0||!Oe(rt)?qe(rt):ze(rt)}),lt=hn(e,qe);e.state.selectingText=lt,Re(r.wrapper.ownerDocument,"mousemove",it),Re(r.wrapper.ownerDocument,"mouseup",lt)}function Xl(e,t){var i=t.anchor,n=t.head,r=dt(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var s=tt(r);if(!s)return t;var l=Qe(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var y;if(n.line!=i.line)y=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var W=Qe(s,n.ch,n.sticky),$=W-l||(n.ch-i.ch)*(f.level==1?-1:1);W==m-1||W==m?y=$<0:y=$>0}var me=s[m+(y?-1:0)],de=y==(me.level==1),Ie=de?me.from:me.to,ze=de?"after":"before";return i.ch==Ie&&i.sticky==ze?t:new Ft(new Xe(i.line,Ie,ze),n)}function ws(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(me){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&C(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!q(e,i))return D(t);s-=f.top-l.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var y=l.gutters.childNodes[m];if(y&&y.getBoundingClientRect().right>=r){var W=Xn(e.doc,s),$=e.display.gutterSpecs[m];return Be(e,i,e,W,$.className,t),D(t)}}}function Vo(e,t){return ws(e,t,"gutterClick",!0)}function _s(e,t){if(pi(e.display,t)||$l(e,t))return;if($e(e,t,"contextmenu"))return;Fe||e.display.input.onContextMenu(t)}function $l(e,t){return q(e,"gutterContextMenu")?ws(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 ur={toString:function(){return"CodeMirror.Init"}},Ss={},oo={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,m,y){y!=ur&&s(f,m,y)}:s)}e.defineOption=i,e.Init=ur,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,No(n)},!0),i("indentUnit",2,No,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Sr(n),vr(n),On(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(m){for(var y=0;;){var W=m.text.indexOf(r,y);if(W==-1)break;y=W+r.length,s.push(Xe(l,W))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],Xe(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!=ur&&n.refresh()}),i("specialCharPlaceholder",ft,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",Y?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!Je),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Er(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),f=s!=ur&&io(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=Po(r,n.options.lineNumbers),Er(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?_o(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return tr(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),tr(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=Po(n.options.gutters,r),Er(n)},!0),i("firstLineNumber",1,Er,!0),i("lineNumberFormatter",function(n){return n},Er,!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"&&(qi(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,Sr,!0),i("addModeClass",!1,Sr,!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,Sr,!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!=ur;if(!t!=!n){var r=e.display.dragFunctions,s=t?Re:ut;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?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Se(e.display.wrapper,"CodeMirror-wrap"),fi(e)),Eo(e),On(e),vr(e),setTimeout(function(){return tr(e)},100)}function Yt(e,t){var i=this;if(!(this instanceof Yt))return new Yt(e,t);this.options=t=t?d(t):{},d(Ss,t,!1);var n=t.value;typeof n=="string"?n=new Ln(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Yt.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"),Ta(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 F,keySeq:null,specialChars:null},t.autofocus&&!Y&&s.input.focus(),k&&L<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ol(),Hi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!Y||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):qi(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],ur);La(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Ko.length;++f)Ko[f](this);zi(this),P&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Yt.defaults=Ss,Yt.optionHandlers=oo;function Ql(e){var t=e.display;Re(t.scroller,"mousedown",hn(e,xs)),k&&L<11?Re(t.scroller,"dblclick",hn(e,function(m){if($e(e,m))return;var y=Bi(e,m);if(!y||Vo(e,m)||pi(e.display,m))return;C(m);var W=e.findWordAt(y);Qr(e.doc,W.anchor,W.head)})):Re(t.scroller,"dblclick",function(m){return $e(e,m)||C(m)}),Re(t.scroller,"contextmenu",function(m){return _s(e,m)}),Re(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||_s(e,m)});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(m){if(m.touches.length!=1)return!1;var y=m.touches[0];return y.radiusX<=1&&y.radiusY<=1}function l(m,y){if(y.left==null)return!0;var W=y.left-m.left,$=y.top-m.top;return W*W+$*$>20*20}Re(t.scroller,"touchstart",function(m){if(!$e(e,m)&&!s(m)&&!Vo(e,m)){t.input.ensurePolled(),clearTimeout(i);var y=+new Date;t.activeTouch={start:y,moved:!1,prev:y-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Re(t.scroller,"touchend",function(m){var y=t.activeTouch;if(y&&!pi(t,m)&&y.left!=null&&!y.moved&&new Date-y.start<300){var W=e.coordsChar(t.activeTouch,"page"),$;!y.prev||l(y,y.prev)?$=new Ft(W,W):!y.prev.prev||l(y,y.prev.prev)?$=e.findWordAt(W):$=new Ft(Xe(W.line,0),o(e.doc,Xe(W.line+1,0))),e.setSelection($.anchor,$.head),e.focus(),C(m)}r()}),Re(t.scroller,"touchcancel",r),Re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Fi(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Re(t.scroller,"mousewheel",function(m){return Pa(e,m)}),Re(t.scroller,"DOMMouseScroll",function(m){return Pa(e,m)}),Re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){$e(e,m)||B(m)},over:function(m){$e(e,m)||(Al(e,m),B(m))},start:function(m){return Tl(e,m)},drop:hn(e,kl),leave:function(m){$e(e,m)||ss(e)}};var f=t.input.getField();Re(f,"keyup",function(m){return ys.call(e,m)}),Re(f,"keydown",hn(e,vs)),Re(f,"keypress",hn(e,bs)),Re(f,"focus",function(m){return ko(e,m)}),Re(f,"blur",function(m){return qi(e,m)})}var Ko=[];Yt.defineInitHook=function(e){return Ko.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=ye(e,t).state:i="prev");var l=e.options.tabSize,f=dt(r,t),m=_(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var y=f.text.match(/^\s*/)[0],W;if(!n&&!/\S/.test(f.text))W=0,i="not";else if(i=="smart"&&(W=r.mode.indent(s,f.text.slice(y.length),f.text),W==Le||W>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?W=_(dt(r,t-1).text,null,l):W=0:i=="add"?W=m+e.options.indentUnit:i=="subtract"?W=m-e.options.indentUnit:typeof i=="number"&&(W=m+i),W=Math.max(0,W);var $="",me=0;if(e.options.indentWithTabs)for(var de=Math.floor(W/l);de;--de)me+=l,$+=" ";if(me<W&&($+=U(W-me)),$!=y)return or(r,$,Xe(t,0),Xe(t,y.length),"+input"),f.stateAfter=null,!0;for(var Ie=0;Ie<r.sel.ranges.length;Ie++){var ze=r.sel.ranges[Ie];if(ze.head.line==t&&ze.head.ch<y.length){var qe=Xe(t,y.length);Uo(r,Ie,new Ft(qe,qe));break}}}var ei=null;function ao(e){ei=e}function Xo(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,m=mt(t),y=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(`
`)==t){if(n.ranges.length%ei.text.length==0){y=[];for(var W=0;W<ei.text.length;W++)y.push(s.splitLines(ei.text[W]))}}else m.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(y=K(m,function(it){return[it]}));for(var $=e.curOp.updateInput,me=n.ranges.length-1;me>=0;me--){var de=n.ranges[me],Ie=de.from(),ze=de.to();de.empty()&&(i&&i>0?Ie=Xe(Ie.line,Ie.ch-i):e.state.overwrite&&!f?ze=Xe(ze.line,Math.min(dt(s,ze.line).text.length,ze.ch+b(m).length)):f&&ei&&ei.lineWise&&ei.text.join(`
`)==m.join(`
`)&&(Ie=ze=Xe(Ie.line,0)));var qe={from:Ie,to:ze,text:y?y[me%y.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,qe),Kt(e,"inputRead",e,qe)}t&&!f&&Ts(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=$),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&&jn(t,function(){return Xo(t,i,0,null,"paste")}),!0}function Ts(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(dt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Kt(e,"electricInput",e,r.head.line)}}function As(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:Xe(r,0),head:Xe(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Os(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ls(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),G&&(e.style.border="1px solid black"),Os(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)&&hn(this,t[n])(this,r,l),Be(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"](io(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:_n(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");M(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,On(this)}),removeOverlay:_n(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++,On(this);return}}}),indentLine:_n(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),hi(this.doc,n)&&Br(this,n,r,s)}),indentSelection:_n(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&&er(this));else{var m=f.from(),y=f.to(),W=Math.max(s,m.line);s=Math.min(this.lastLine(),y.line-(y.ch?0:1))+1;for(var $=W;$<s;++$)Br(this,$,n);var me=this.doc.sel.ranges;m.ch==0&&r.length==me.length&&me[l].from().ch>0&&Uo(this.doc,l,new Ft(m,me[l].to()),pe)}}}),getTokenAt:function(n,r){return Wt(this,n,r)},getLineTokens:function(n,r){return Wt(this,Xe(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=We(this,dt(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var y=s+l>>1;if((y?r[y*2-1]:0)>=f)l=y;else if(r[y*2+1]<f)s=y+1;else{m=r[y*2+2];break}}var W=m?m.indexOf("overlay "):-1;return W<0?m:W==0?null:m.slice(0,W-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 m=0;m<f[r].length;m++){var y=l[f[r][m]];y&&s.push(y)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var W=0;W<l._global.length;W++){var $=l._global[W];$.pred(f,this)&&te(s,$.val)==-1&&s.push($.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),ye(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(),Qn(this,s,r||"page")},charCoords:function(n,r){return yo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=da(this,n,r||"page"),xo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=da(this,{top:n,left:0},r||"page").top,Xn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var m=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>m&&(n=m,l=!0),f=dt(this.doc,n)}else f=n;return Hr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-In(f):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return Qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var m=this.display;n=Qn(this,o(this.doc,n));var y=n.bottom,W=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")y=n.top;else if(l=="above"||l=="near"){var $=Math.max(m.wrapper.clientHeight,this.doc.height),me=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>$)&&n.top>r.offsetHeight?y=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=$&&(y=n.bottom),W+r.offsetWidth>me&&(W=me-r.offsetWidth)}r.style.top=y+"px",r.style.left=r.style.right="",f=="right"?(W=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?W=0:f=="middle"&&(W=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=W+"px"),s&&Js(this,{left:W,top:y,right:W+r.offsetWidth,bottom:y+r.offsetHeight})},triggerOnKeyDown:_n(vs),triggerOnKeyPress:_n(bs),triggerOnKeyUp:ys,triggerOnMouseDown:_n(xs),execCommand:function(n){if(Dr.hasOwnProperty(n))return Dr[n].call(null,this)},triggerElectric:_n(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),y=0;y<r&&!(m=$o(this.doc,m,f,s,l),m.hitSide);++y);return m},moveH:_n(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?$o(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},ie)}),deleteH:_n(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(f){var m=$o(l,f.head,n,r,!1);return n<0?{from:m,to:f.head}:{from:f.head,to:m}})}),findPosV:function(n,r,s,l){var f=1,m=l;r<0&&(f=-1,r=-r);for(var y=o(this.doc,n),W=0;W<r;++W){var $=Qn(this,y,"div");if(m==null?m=$.left:$.left=m,y=Ms(this,$,f,s),y.hitSide)break}return y},moveV:_n(function(n,r){var s=this,l=this.doc,f=[],m=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(W){if(m)return n<0?W.from():W.to();var $=Qn(s,W.head,"div");W.goalColumn!=null&&($.left=W.goalColumn),f.push($.left);var me=Ms(s,$,n,r);return r=="page"&&W==l.sel.primary()&&Ao(s,yo(s,me,"div").top-$.top),me},ie),f.length)for(var y=0;y<l.sel.ranges.length;y++)l.sel.ranges[y].goalColumn=f[y]}),findWordAt:function(n){var r=this.doc,s=dt(r,n.line).text,l=n.ch,f=n.ch;if(s){var m=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var y=s.charAt(l),W=je(y,m)?function($){return je($,m)}:/\s/.test(y)?function($){return/\s/.test($)}:function($){return!/\s/.test($)&&!je($)};l>0&&W(s.charAt(l-1));)--l;for(;f<s.length&&W(s.charAt(f));)++f}return new Ft(Xe(n.line,l),Xe(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):Se(this.display.cursorDiv,"CodeMirror-overwrite"),Be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:_n(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oi(this)-this.display.barHeight,width:n.scrollWidth-oi(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Ii(this)}},scrollIntoView:_n(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:Xe(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):_a(this,n.from,n.to,n.margin)}),setSize:_n(function(n,r){var s=this,l=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(m){if(m.widgets){for(var y=0;y<m.widgets.length;y++)if(m.widgets[y].noHScroll){_i(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Be(this,"refresh",this)}),operation:function(n){return jn(this,n)},startOperation:function(){return Hi(this)},endOperation:function(){return zi(this)},refresh:_n(function(){var n=this.display.cachedTextHeight;On(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Mo(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&Eo(this),Be(this,"refresh",this)}),swapDoc:_n(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),ja(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Kt(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}},ne(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 $o(e,t,i,n,r){var s=t,l=i,f=dt(e,t.line),m=r&&e.direction=="rtl"?-i:i;function y(){var lt=t.line+m;return lt<e.first||lt>=e.first+e.size?!1:(t=new Xe(lt,t.ch,t.sticky),f=dt(e,lt))}function W(lt){var rt;if(n=="codepoint"){var ht=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ht)?rt=null:rt=new Xe(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ht>=55296&&ht<56320?2:1))),-i)}else r?rt=Dl(e.cm,f,t,i):rt=Wo(f,t,i);if(rt==null)if(!lt&&y())t=Ho(r,e.cm,f,t.line,m);else return!1;else t=rt;return!0}if(n=="char"||n=="codepoint")W();else if(n=="column")W(!0);else if(n=="word"||n=="group")for(var $=null,me=n=="group",de=e.cm&&e.cm.getHelper(t,"wordChars"),Ie=!0;!(i<0&&!W(!Ie));Ie=!1){var ze=f.text.charAt(t.ch)||`
`,qe=je(ze,de)?"w":me&&ze==`
`?"n":!me||/\s/.test(ze)?null:"p";if(me&&!Ie&&!qe&&(qe="s"),$&&$!=qe){i<0&&(i=1,W(),t.sticky="after");break}if(qe&&($=qe),i>0&&!W(!Ie))break}var it=eo(e,t,s,l,!0);return ti(s,it)&&(it.hitSide=!0),it}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),m=Math.max(f-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var y;!(y=xo(e,s,l),!y.outside);){if(i<0?l<=0:l>=r.height){y.hitSide=!0;break}l+=i*5}return y}var Gt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Gt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Os(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Re(r,"paste",function(f){if(!s(f)||$e(n,f)||ks(f,n))return;L<=11&&setTimeout(hn(n,function(){return t.updateFromDOM()}),20)}),Re(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Re(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Re(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Re(r,"touchstart",function(){return i.forceCompositionEnd()}),Re(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||$e(n,f))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=As(n);ao({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,pe),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var y=ei.text.join(`
`);if(f.clipboardData.setData("Text",y),f.clipboardData.getData("Text")==y){f.preventDefault();return}}var W=Ls(),$=W.firstChild;n.display.lineSpace.insertBefore(W,n.display.lineSpace.firstChild),$.value=ei.text.join(`
`);var me=document.activeElement;S($),setTimeout(function(){n.display.lineSpace.removeChild(W),me.focus(),me==r&&i.showPrimarySelection()},50)}Re(r,"copy",l),Re(r,"cut",l)},Gt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Gt.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},Gt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Gt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Gt.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=so(t,e.anchorNode,e.anchorOffset),l=so(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&Ct(Mi(s,l),n)==0&&Ct(di(s,l),r)==0)return;var f=t.display.view,m=n.line>=t.display.viewFrom&&Rs(t,n)||{node:f[0].measure.map[2],offset:0},y=r.line<t.display.viewTo&&Rs(t,r);if(!y){var W=f[f.length-1].measure,$=W.maps?W.maps[W.maps.length-1]:W.map;y={node:$[$.length-1],offset:$[$.length-2]-$[$.length-3]}}if(!m||!y){e.removeAllRanges();return}var me=e.rangeCount&&e.getRangeAt(0),de;try{de=J(m.node,m.offset,y.offset,y.node)}catch(Ie){}de&&(!oe&&t.state.focused?(e.collapse(m.node,m.offset),de.collapsed||(e.removeAllRanges(),e.addRange(de))):(e.removeAllRanges(),e.addRange(de)),me&&e.anchorNode==null?e.addRange(me):oe&&this.startGracePeriod()),this.rememberSelection()},Gt.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)},Gt.prototype.showMultipleSelections=function(e){be(this.cm.display.cursorDiv,e.cursors),be(this.cm.display.selectionDiv,e.selection)},Gt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Gt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},Gt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Gt.prototype.blur=function(){this.div.blur()},Gt.prototype.getField=function(){return this.div},Gt.prototype.supportsTouch=function(){return!0},Gt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():jn(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)},Gt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Gt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(X&&R&&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=so(t,e.anchorNode,e.anchorOffset),n=so(t,e.focusNode,e.focusOffset);i&&n&&jn(t,function(){Cn(t.doc,Si(i,n),pe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Gt.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=Xe(n.line-1,dt(e.doc,n.line-1).length)),r.ch==dt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Xe(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ui(e,n.line))==0?(l=Mt(t.view[0].line),f=t.view[0].node):(l=Mt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Ui(e,r.line),y,W;if(m==t.view.length-1?(y=t.viewTo-1,W=t.lineDiv.lastChild):(y=Mt(t.view[m+1].line)-1,W=t.view[m+1].node.previousSibling),!f)return!1;for(var $=e.doc.splitLines(tu(e,f,W,l,y)),me=Un(e.doc,Xe(l,0),Xe(y,dt(e.doc,y).text.length));$.length>1&&me.length>1;)if(b($)==b(me))$.pop(),me.pop(),y--;else if($[0]==me[0])$.shift(),me.shift(),l++;else break;for(var de=0,Ie=0,ze=$[0],qe=me[0],it=Math.min(ze.length,qe.length);de<it&&ze.charCodeAt(de)==qe.charCodeAt(de);)++de;for(var lt=b($),rt=b(me),ht=Math.min(lt.length-($.length==1?de:0),rt.length-(me.length==1?de:0));Ie<ht&&lt.charCodeAt(lt.length-Ie-1)==rt.charCodeAt(rt.length-Ie-1);)++Ie;if($.length==1&&me.length==1&&l==n.line)for(;de&&de>n.ch&&lt.charCodeAt(lt.length-Ie-1)==rt.charCodeAt(rt.length-Ie-1);)de--,Ie++;$[$.length-1]=lt.slice(0,lt.length-Ie).replace(/^\u200b+/,""),$[0]=$[0].slice(de).replace(/\u200b+$/,"");var xt=Xe(l,de),gt=Xe(y,me.length?b(me).length-Ie:0);if($.length>1||$[0]||Ct(xt,gt))return or(e.doc,$,xt,gt,"+input"),!0},Gt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gt.prototype.reset=function(){this.forceCompositionEnd()},Gt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Gt.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)},Gt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&jn(this.cm,function(){return On(e.cm)})},Gt.prototype.setUneditable=function(e){e.contentEditable="false"},Gt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||hn(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Gt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Gt.prototype.onContextMenu=function(){},Gt.prototype.resetPosition=function(){},Gt.prototype.needsContentAttribute=!0;function Rs(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=dt(e.doc,t.line),r=ra(i,n,t.line),s=tt(n,e.doc.direction),l="left";if(s){var f=Qe(s,t.ch);l=f%2?"right":"left"}var m=sa(r.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function hr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function y(de){return function(Ie){return Ie.id==de}}function W(){l&&(s+=f,m&&(s+=f),l=m=!1)}function $(de){de&&(W(),s+=de)}function me(de){if(de.nodeType==1){var Ie=de.getAttribute("cm-text");if(Ie){$(Ie);return}var ze=de.getAttribute("cm-marker"),qe;if(ze){var it=e.findMarks(Xe(n,0),Xe(r+1,0),y(+ze));it.length&&(qe=it[0].find(0))&&$(Un(e.doc,qe.from,qe.to).join(f));return}if(de.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(de.nodeName);if(!/^br$/i.test(de.nodeName)&&de.textContent.length==0)return;lt&&W();for(var rt=0;rt<de.childNodes.length;rt++)me(de.childNodes[rt]);/^(pre|p)$/i.test(de.nodeName)&&(m=!0),lt&&(l=!0)}else de.nodeType==3&&$(de.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(me(t),t==i);)t=t.nextSibling,m=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return hr(e.clipPos(Xe(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||!x(n,t))return hr(Xe(Mt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?b(e.rest):e.line;return hr(Xe(Mt(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 m=e.measure,y=m.maps;function W(qe,it,lt){for(var rt=-1;rt<(y?y.length:0);rt++)for(var ht=rt<0?m.map:y[rt],xt=0;xt<ht.length;xt+=3){var gt=ht[xt+2];if(gt==qe||gt==it){var Tt=Mt(rt<0?e.line:e.rest[rt]),$t=ht[xt]+lt;return(lt<0||gt!=qe)&&($t=ht[xt+(lt?1:0)]),Xe(Tt,$t)}}}var $=W(l,f,i);if($)return hr($,r);for(var me=f.nextSibling,de=l?l.nodeValue.length-i:0;me;me=me.nextSibling){if($=W(me,me.firstChild,0),$)return hr(Xe($.line,$.ch-de),r);de+=me.textContent.length}for(var Ie=f.previousSibling,ze=i;Ie;Ie=Ie.previousSibling){if($=W(Ie,Ie.firstChild,-1),$)return hr(Xe($.line,$.ch+ze),r);ze+=Ie.textContent.length}}var en=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};en.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),G&&(r.style.width="0px"),Re(r,"input",function(){k&&L>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Re(r,"paste",function(l){if($e(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if($e(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=As(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,pe):(i.prevInput="",r.value=f.text.join(`
`),S(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Re(r,"cut",s),Re(r,"copy",s),Re(e.scroller,"paste",function(l){if(pi(e,l)||$e(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)}),Re(e.lineSpace,"selectstart",function(l){pi(e,l)||C(l)}),Re(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"})}}),Re(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},en.prototype.createField=function(e){this.wrapper=Ls(),this.textarea=this.wrapper.firstChild},en.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},en.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=Qn(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},en.prototype.showSelection=function(e){var t=this.cm,i=t.display;be(i.cursorDiv,e.cursors),be(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},en.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&&S(this.textarea),k&&L>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",k&&L>=9&&(this.hasSelection=null))},en.prototype.getField=function(){return this.textarea},en.prototype.supportsTouch=function(){return!1},en.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Y||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},en.prototype.blur=function(){this.textarea.blur()},en.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},en.prototype.receivedFocus=function(){this.slowPoll()},en.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()})},en.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)},en.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(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(k&&L>=9&&this.hasSelection===r||ce&&/[\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 jn(t,function(){Xo(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},en.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},en.prototype.onKeyPress=function(){k&&L>=9&&(this.hasSelection=null),this.fastPoll()},en.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Bi(i,e),l=n.scroller.scrollTop;if(!s||T)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&hn(i,Cn)(i.doc,Si(s),pe);var m=r.style.cssText,y=t.wrapper.style.cssText,W=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-W.top-5)+"px; left: "+(e.clientX-W.left-5)+`px;
z-index: 1000; background: `+(k?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var $;P&&($=window.scrollY),n.input.focus(),P&&window.scrollTo(null,$),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=de,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function me(){if(r.selectionStart!=null){var ze=i.somethingSelected(),qe="\u200B"+(ze?r.value:"");r.value="\u21DA",r.value=qe,t.prevInput=ze?"":"\u200B",r.selectionStart=1,r.selectionEnd=qe.length,n.selForContextMenu=i.doc.sel}}function de(){if(t.contextMenuPending!=de)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=y,r.style.cssText=m,k&&L<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!k||k&&L<9)&&me();var ze=0,qe=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?hn(i,Ja)(i):ze++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(k&&L>=9&&me(),Fe){B(e);var Ie=function(){ut(window,"mouseup",Ie),setTimeout(de,20)};Re(window,"mouseup",Ie)}else setTimeout(de,50)},en.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},en.prototype.setUneditable=function(){},en.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?d(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&&(Re(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(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=Yt(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=ut,e.on=Re,e.wheelEventPixels=cl,e.Doc=Ln,e.splitLines=mt,e.countColumn=_,e.findColumn=le,e.isWordChar=Ae,e.Pass=Le,e.signal=Be,e.Line=wi,e.changeEnd=ki,e.scrollbarModel=ka,e.Pos=Xe,e.cmpPos=Ct,e.modes=jt,e.mimeModes=St,e.resolveMode=pt,e.getMode=Vn,e.modeExtensions=xn,e.extendMode=pn,e.copyState=Sn,e.startState=Kn,e.innerMode=li,e.commands=Dr,e.keyMap=mi,e.keyName=ds,e.isModifierKey=hs,e.lookupKey=sr,e.normalizeKeyMap=Pl,e.StringStream=Nt,e.SharedTextMarker=Mr,e.TextMarker=Ai,e.LineWidget=Lr,e.e_preventDefault=C,e.e_stopPropagation=E,e.e_stop=B,e.addClass=N,e.contains=x,e.rmClass=Se,e.keyNames=Oi}Yl(Yt),ql(Yt);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in Ln.prototype)Ln.prototype.hasOwnProperty(lo)&&te(ou,lo)<0&&(Yt.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ln.prototype[lo]));return ne(Ln),Yt.inputStyles={textarea:en,contenteditable:Gt},Yt.defineMode=function(e){!Yt.defaults.mode&&e!="null"&&(Yt.defaults.mode=e),bn.apply(this,arguments)},Yt.defineMIME=rn,Yt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yt.defineMIME("text/plain","null"),Yt.defineExtension=function(e,t){Yt.prototype[e]=t},Yt.defineDocExtension=function(e,t){Ln.prototype[e]=t},Yt.fromTextArea=iu,ru(Yt),Yt.version="5.58.2",Yt})},WdTA:function(nt,Ge,v){nt.exports=v.p+"static/studnetqun.598eeb43.png"},Y1PL:function(nt,Ge,v){"use strict";v.r(Ge),v.d(Ge,"ResizableTextArea",function(){return te});var z=v("wx14"),he=v("1OyB"),oe=v("vuIU"),xe=v("Ji7U"),se=v("LK+K"),V=v("q1tI"),k=v("VTBJ"),L=v("rePB"),P=v("Zm9Q"),A=v("Kwbf"),R=v("c+Xe"),T=v("m+aA"),Q=v("bdgK"),H=new Map;function I(pe){pe.forEach(function(fe){var ie,le=fe.target;(ie=H.get(le))===null||ie===void 0||ie.forEach(function(ee){return ee(le)})})}var G=new Q.default(I),X=null,Y=null;function ce(pe,fe){H.has(pe)||(H.set(pe,new Set),G.observe(pe)),H.get(pe).add(fe)}function De(pe,fe){H.has(pe)&&(H.get(pe).delete(fe),H.get(pe).size||(G.unobserve(pe),H.delete(pe)))}var Je=function(pe){Object(xe.a)(ie,pe);var fe=Object(se.a)(ie);function ie(){return Object(he.a)(this,ie),fe.apply(this,arguments)}return Object(oe.a)(ie,[{key:"render",value:function(){return this.props.children}}]),ie}(V.Component),_e=V.createContext(null);function Te(pe){var fe=pe.children,ie=pe.onBatchResize,le=V.useRef(0),ee=V.useRef([]),U=V.useContext(_e),b=V.useCallback(function(K,M,ve){le.current+=1;var Ee=le.current;ee.current.push({size:K,element:M,data:ve}),Promise.resolve().then(function(){Ee===le.current&&(ie==null||ie(ee.current),ee.current=[])}),U==null||U(K,M,ve)},[ie,U]);return V.createElement(_e.Provider,{value:b},fe)}function Fe(pe){var fe=pe.children,ie=pe.disabled,le=V.useRef(null),ee=V.useRef(null),U=V.useContext(_e),b=V.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),K=V.isValidElement(fe)&&Object(R.c)(fe),M=K?fe.ref:null,ve=V.useMemo(function(){return Object(R.a)(M,le)},[M,le]),Ee=V.useRef(pe);Ee.current=pe;var re=V.useCallback(function(Ae){var je=Ee.current,Ne=je.onResize,ke=je.data,Me=Ae.getBoundingClientRect(),Ue=Me.width,et=Me.height,Ve=Ae.offsetWidth,Ze=Ae.offsetHeight,Qe=Math.floor(Ue),at=Math.floor(et);if(b.current.width!==Qe||b.current.height!==at||b.current.offsetWidth!==Ve||b.current.offsetHeight!==Ze){var tt={width:Qe,height:at,offsetWidth:Ve,offsetHeight:Ze};b.current=tt;var st=Ve===Math.round(Ue)?Ue:Ve,Re=Ze===Math.round(et)?et:Ze,vt=Object(k.a)(Object(k.a)({},tt),{},{offsetWidth:st,offsetHeight:Re});U==null||U(vt,Ae,ke),Ne&&Promise.resolve().then(function(){Ne(vt,Ae)})}},[]);return V.useEffect(function(){var Ae=Object(T.a)(le.current)||Object(T.a)(ee.current);return Ae&&!ie&&ce(Ae,re),function(){return De(Ae,re)}},[le.current,ie]),V.createElement(Je,{ref:ee},K?V.cloneElement(fe,{ref:ve}):fe)}var we="rc-observer-key";function Se(pe){var fe=pe.children,ie=Object(P.a)(fe);return ie.map(function(le,ee){var U=(le==null?void 0:le.key)||"".concat(we,"-").concat(ee);return V.createElement(Fe,Object(z.a)({},pe,{key:U}),le)})}Se.Collection=Te;var Pe=Se,be=v("bT9E"),O=v("TSYQ"),ue=v.n(O),J=`
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
`,x=["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={},N;function w(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(fe&&j[ie])return j[ie];var le=window.getComputedStyle(pe),ee=le.getPropertyValue("box-sizing")||le.getPropertyValue("-moz-box-sizing")||le.getPropertyValue("-webkit-box-sizing"),U=parseFloat(le.getPropertyValue("padding-bottom"))+parseFloat(le.getPropertyValue("padding-top")),b=parseFloat(le.getPropertyValue("border-bottom-width"))+parseFloat(le.getPropertyValue("border-top-width")),K=x.map(function(ve){return"".concat(ve,":").concat(le.getPropertyValue(ve))}).join(";"),M={sizingStyle:K,paddingSize:U,borderSize:b,boxSizing:ee};return fe&&ie&&(j[ie]=M),M}function S(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),pe.getAttribute("wrap")?N.setAttribute("wrap",pe.getAttribute("wrap")):N.removeAttribute("wrap");var ee=w(pe,fe),U=ee.paddingSize,b=ee.borderSize,K=ee.boxSizing,M=ee.sizingStyle;N.setAttribute("style","".concat(M,";").concat(J)),N.value=pe.value||pe.placeholder||"";var ve=Number.MIN_SAFE_INTEGER,Ee=Number.MAX_SAFE_INTEGER,re=N.scrollHeight,Ae;if(K==="border-box"?re+=b:K==="content-box"&&(re-=U),ie!==null||le!==null){N.value=" ";var je=N.scrollHeight-U;ie!==null&&(ve=je*ie,K==="border-box"&&(ve=ve+U+b),re=Math.max(ve,re)),le!==null&&(Ee=je*le,K==="border-box"&&(Ee=Ee+U+b),Ae=re>Ee?"":"hidden",re=Math.min(Ee,re))}return{height:re,minHeight:ve,maxHeight:Ee,overflowY:Ae,resize:"none"}}var p=v("Gytx"),d=v.n(p),_;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(_||(_={}));var F=function(pe){Object(xe.a)(ie,pe);var fe=Object(se.a)(ie);function ie(le){var ee;return Object(he.a)(this,ie),ee=fe.call(this,le),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(U){ee.textArea=U},ee.handleResize=function(U){var b=ee.state.resizeStatus,K=ee.props,M=K.autoSize,ve=K.onResize;if(b!==_.NONE)return;typeof ve=="function"&&ve(U),M&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var U=ee.props.autoSize;if(!U||!ee.textArea)return;var b=U.minRows,K=U.maxRows,M=S(ee.textArea,!1,b,K);ee.setState({textareaStyles:M,resizeStatus:_.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:_.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:_.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var U=ee.props,b=U.prefixCls,K=b===void 0?"rc-textarea":b,M=U.autoSize,ve=U.onResize,Ee=U.className,re=U.disabled,Ae=ee.state,je=Ae.textareaStyles,Ne=Ae.resizeStatus,ke=Object(be.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Me=ue()(K,Ee,Object(L.a)({},"".concat(K,"-disabled"),re));"value"in ke&&(ke.value=ke.value||"");var Ue=Object(k.a)(Object(k.a)(Object(k.a)({},ee.props.style),je),Ne===_.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return V.createElement(Pe,{onResize:ee.handleResize,disabled:!(M||ve)},V.createElement("textarea",Object(z.a)({},ke,{className:Me,style:Ue,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:_.NONE},ee}return Object(oe.a)(ie,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!d()(ee.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 ee=this.textArea.selectionStart,U=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,U)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ie}(V.Component),te=F,Ce=function(pe){Object(xe.a)(ie,pe);var fe=Object(se.a)(ie);function ie(le){var ee;Object(he.a)(this,ie),ee=fe.call(this,le),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(b){ee.resizableTextArea=b},ee.handleChange=function(b){var K=ee.props.onChange;ee.setValue(b.target.value,function(){ee.resizableTextArea.resizeTextarea()}),K&&K(b)},ee.handleKeyDown=function(b){var K=ee.props,M=K.onPressEnter,ve=K.onKeyDown;b.keyCode===13&&M&&M(b),ve&&ve(b)};var U=typeof le.value=="undefined"||le.value===null?le.defaultValue:le.value;return ee.state={value:U},ee}return Object(oe.a)(ie,[{key:"setValue",value:function(ee,U){"value"in this.props||this.setState({value:ee},U)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return V.createElement(te,Object(z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ee){return"value"in ee?{value:ee.value}:null}}]),ie}(V.Component),Le=Ge.default=Ce},ZW9T:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return Je});var z=v("k1fw"),he=v("miYZ"),oe=v("tsqr"),xe=v("rAM+"),se=v("tJVT"),V=v("PpiC"),k=v("q1tI"),L=v.n(k),P=v("bdgK");function A(_e,Te,Fe,we,Se){var Pe=Te.getWordUntilPosition(Fe),be={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},O=we.map(function(ue){return{label:ue,kind:_e.languages.CompletionItemKind.Keyword,insertText:ue,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:be}});return Se.map(function(ue){O.push(Object(z.a)(Object(z.a)({},ue),{},{range:be}))}),O}var R=function(_e){var Te={label:"ifelse",kind:_e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},Fe=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];_e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(be,O){var ue=A(_e,be,O,Fe,[Te]);return{suggestions:ue}}});var we=["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"];_e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(be,O){var ue=[{label:"print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],J=A(_e,be,O,we,ue);return{suggestions:J}}});var Se=["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"];_e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(be,O){var ue=[Te,{label:"main",kind:_e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],J=A(_e,be,O,Se,ue);return{suggestions:J}}})},T="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",Q=v("LvDl");function H(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}function I(){}var G=!1,X={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function Y(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=_e;if(Array.isArray(_e)){for(var Fe=0;Fe<_e.length;Fe++){var we=X[_e[Fe]];if(we)return we}return Te[0]}return X[Te]||Te}var ce=null,De=Ge.b=function(_e){var Te=_e.width,Fe=Te===void 0?"100%":Te,we=_e.height,Se=we===void 0?"100%":we,Pe=_e.value,be=_e.language,O=be===void 0?"javascript":be,ue=_e.style,J=ue===void 0?{}:ue,x=_e.options,j=x===void 0?{}:x,N=_e.overrideServices,w=N===void 0?{}:N,S=_e.theme,p=S===void 0?"vs-dark":S,d=_e.onEditBlur,_=_e.onSave,F=_e.autoHeight,te=F===void 0?!1:F,Ce=_e.forbidCopy,Le=Ce===void 0?!1:Ce,pe=_e.onChange,fe=pe===void 0?I:pe,ie=_e.editorDidMount,le=ie===void 0?I:ie,ee=_e.onFocus,U=ee===void 0?I:ee,b=_e.filename,K=b===void 0?"educoder.txt":b,M=Object(V.a)(_e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ve=Object(k.useRef)(),Ee=Object(k.useRef)({}),re=Object(k.useRef)(),Ae=Object(k.useRef)(!1),je=Object(k.useRef)(),Ne=Object(k.useState)(!1),ke=Object(se.a)(Ne,2),Me=ke[0],Ue=ke[1];function et(){var D;return ve.current&&(D=new P.default(function(B){var ge=Object(xe.a)(B),Oe;try{for(ge.s();!(Oe=ge.n()).done;){var Ye=Oe.value;(Ye.target.offsetHeight>0||Ye.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(yt){ge.e(yt)}finally{ge.f()}}),D.observe(ve.current)),D}function Ve(){oe.b.warn(decodeURIComponent(T))}var Ze=function(){var B=Ee.current.instance;if(Pe!=null&&B&&Me){var ge=B.getModel();ge&&Pe!==ge.getValue()&&(G=!0,ge.setValue(Pe),B.layout(),G=!1)}};Object(k.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){Ze()},500)},[Pe,Me,Ee.current]);function Qe(){var D=Ee.current.instance;if(D){var B=D.getSelection(),ge=Ee.current.pastePos||{},Oe=new ce.Range(ge.startLineNumber||B.endLineNumber,ge.startColumn||B.endColumn,ge.endLineNumber||B.endLineNumber,ge.endColumn||B.endColumn);setTimeout(function(){D.executeEdits("",[{range:Oe,text:""}])},300)}}function at(D){(window.navigator.platform.match("Mac")?D.metaKey:D.ctrlKey)&&D.keyCode==83&&(D.preventDefault(),_())}var tt=function(){if(te&&Ee.current.instance){var B=Ee.current.instance.getContentHeight();C(B<Se?Se:B)}else C(Se)};function st(D){var B=document.createEvent("MouseEvents");B.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),D.dispatchEvent(B)}function Re(D,B){var ge=window.URL||window.webkitURL||window,Oe=new Blob([B]),Ye=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ye.href=ge.createObjectURL(Oe),Ye.download=D,st(Ye)}Object(k.useEffect)(function(){tt()},[tt]),Object(k.useEffect)(function(){ve.current&&!Me&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(D){try{ce=D,Ee.current.instance=ce.editor.create(ve.current,{value:Pe,language:Y(O),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},w);var B=Ee.current.instance;if(le(B,ce),setTimeout(function(){tt(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Re(K||"educoder.txt",B.getValue())}})},500),Ee.current.subscription=B.onDidChangeModelContent(function(Oe){Ae.current?clearTimeout(je.current):(tt(),fe(B.getValue(),Oe)),je.current=setTimeout(function(){Ae.current=!1},500)}),window.Monaco||R(ce),Le&&(B.addCommand(ce.KeyMod.CtrlCmd|ce.KeyMod.Shift|ce.KeyCode.KEY_V,function(){return Ve(),null}),B.addCommand(ce.KeyMod.CtrlCmd|ce.KeyCode.KEY_C,function(){return Ve(),null})),window.Monaco=ce,d&&B.onDidBlurEditorWidget(function(){d(B.getValue())}),U&&B.onDidFocusEditorText(function(){U(B.getValue())}),Le){B.addCommand(ce.KeyMod.CtrlCmd|ce.KeyCode.KEY_V,function(){return Ve(),null}),B.onDidPaste(function(Oe){Ee.current.pastePos=Oe});try{window.addEventListener("paste",Qe)}catch(Oe){}}var ge=et();return Ue(!0),function(){var Oe=Ee.current.instance;Oe.dispose();var Ye=Oe.getModel();Ye&&Ye.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),Le&&window.removeEventListener("paste",Qe),ge.unobserve(ve.current)}}catch(Oe){}})},[]),Object(k.useEffect)(function(){var D=Ee.current.instance;if(D&&Me)return document.addEventListener("keydown",at,!1),function(){document.removeEventListener("keydown",at)}},[_,Me]),Object(k.useEffect)(function(){var D=Ee.current.instance;if(D&&Me){var B=Y(O);ce.editor.setModelLanguage(D.getModel(),B),console.log("language:",O,D.getModel(),B)}},[O,Me]),Object(k.useEffect)(function(){var D=Ee.current.instance;D&&Me&&ce.editor.setTheme(p)},[p,Me]),Object(k.useEffect)(function(){var D=Ee.current.instance;D&&Me&&(D.updateOptions(Object(z.a)({},j)),setTimeout(function(){D.getModel().updateOptions(Object(z.a)({},j))},200))},[JSON.stringify(j),Me]),Object(k.useEffect)(function(){var D=Ee.current.instance;D&&Me&&D.layout()},[Fe,Se,Me]);var vt=Object(k.useState)(H(Fe)),ut=Object(se.a)(vt,2),Be=ut[0],$e=ut[1],ae=Object(k.useState)(H(Se)),q=Object(se.a)(ae,2),ne=q[0],C=q[1],E=Object(z.a)(Object(z.a)({},J),{},{width:Be,height:ne});return L.a.createElement("div",{className:"my-monaco-editor",ref:ve,style:E})};function Je(_e){var Te=_e.width,Fe=Te===void 0?"100%":Te,we=_e.height,Se=we===void 0?"100%":we,Pe=_e.original,be=_e.modified,O=_e.language,ue=_e.options,J=ue===void 0?{}:ue,x=Object(k.useRef)(),j=Object(k.useState)(null),N=Object(se.a)(j,2),w=N[0],S=N[1];function p(te){var Ce;return x.current&&(Ce=new P.default(function(Le){var pe=Object(xe.a)(Le),fe;try{for(pe.s();!(fe=pe.n()).done;){var ie=fe.value;(ie.target.offsetHeight>0||ie.target.offsetWidth>0)&&te.layout()}}catch(le){pe.e(le)}finally{pe.f()}}),Ce.observe(x.current)),Ce}Object(k.useEffect)(function(){x.current&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(te){ce=te;var Ce=ce.editor.createDiffEditor(x.current,Object(z.a)(Object(z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},J),{},{wordWrap:!0}));S(Ce);var Le=p(Ce);return function(){Ce.dispose();var pe=Ce.getModel();pe&&pe.dispose(),Le.unobserve(x.current)}})},[]),Object(k.useEffect)(function(){w&&w.setModel({original:ce.editor.createModel(Pe,O),modified:ce.editor.createModel(be,O)})},[Pe,be,O,w]);var d=H(Fe),_=H(Se),F={width:d,height:_};return L.a.createElement("div",{className:"my-diff-editor",ref:x,style:F})}},ZpRC:function(nt,Ge,v){"use strict";function z(R){return typeof R=="object"&&R!=null&&R.nodeType===1}function he(R,T){return(!T||R!=="hidden")&&R!=="visible"&&R!=="clip"}function oe(R,T){if(R.clientHeight<R.scrollHeight||R.clientWidth<R.scrollWidth){var Q=getComputedStyle(R,null);return he(Q.overflowY,T)||he(Q.overflowX,T)||function(H){var I=function(G){if(!G.ownerDocument||!G.ownerDocument.defaultView)return null;try{return G.ownerDocument.defaultView.frameElement}catch(X){return null}}(H);return!!I&&(I.clientHeight<H.scrollHeight||I.clientWidth<H.scrollWidth)}(R)}return!1}function xe(R,T,Q,H,I,G,X,Y){return G<R&&X>T||G>R&&X<T?0:G<=R&&Y<=Q||X>=T&&Y>=Q?G-R-H:X>T&&Y<Q||G<R&&Y>Q?X-T+I:0}var se=function(R,T){var Q=window,H=T.scrollMode,I=T.block,G=T.inline,X=T.boundary,Y=T.skipOverflowHiddenElements,ce=typeof X=="function"?X:function(je){return je!==X};if(!z(R))throw new TypeError("Invalid target");for(var De=document.scrollingElement||document.documentElement,Je=[],_e=R;z(_e)&&ce(_e);){if((_e=_e.parentElement)===De){Je.push(_e);break}_e!=null&&_e===document.body&&oe(_e)&&!oe(document.documentElement)||_e!=null&&oe(_e,Y)&&Je.push(_e)}for(var Te=Q.visualViewport?Q.visualViewport.width:innerWidth,Fe=Q.visualViewport?Q.visualViewport.height:innerHeight,we=window.scrollX||pageXOffset,Se=window.scrollY||pageYOffset,Pe=R.getBoundingClientRect(),be=Pe.height,O=Pe.width,ue=Pe.top,J=Pe.right,x=Pe.bottom,j=Pe.left,N=I==="start"||I==="nearest"?ue:I==="end"?x:ue+be/2,w=G==="center"?j+O/2:G==="end"?J:j,S=[],p=0;p<Je.length;p++){var d=Je[p],_=d.getBoundingClientRect(),F=_.height,te=_.width,Ce=_.top,Le=_.right,pe=_.bottom,fe=_.left;if(H==="if-needed"&&ue>=0&&j>=0&&x<=Fe&&J<=Te&&ue>=Ce&&x<=pe&&j>=fe&&J<=Le)return S;var ie=getComputedStyle(d),le=parseInt(ie.borderLeftWidth,10),ee=parseInt(ie.borderTopWidth,10),U=parseInt(ie.borderRightWidth,10),b=parseInt(ie.borderBottomWidth,10),K=0,M=0,ve="offsetWidth"in d?d.offsetWidth-d.clientWidth-le-U:0,Ee="offsetHeight"in d?d.offsetHeight-d.clientHeight-ee-b:0;if(De===d)K=I==="start"?N:I==="end"?N-Fe:I==="nearest"?xe(Se,Se+Fe,Fe,ee,b,Se+N,Se+N+be,be):N-Fe/2,M=G==="start"?w:G==="center"?w-Te/2:G==="end"?w-Te:xe(we,we+Te,Te,le,U,we+w,we+w+O,O),K=Math.max(0,K+Se),M=Math.max(0,M+we);else{K=I==="start"?N-Ce-ee:I==="end"?N-pe+b+Ee:I==="nearest"?xe(Ce,pe,F,ee,b+Ee,N,N+be,be):N-(Ce+F/2)+Ee/2,M=G==="start"?w-fe-le:G==="center"?w-(fe+te/2)+ve/2:G==="end"?w-Le+U+ve:xe(fe,Le,te,le,U+ve,w,w+O,O);var re=d.scrollLeft,Ae=d.scrollTop;N+=Ae-(K=Math.max(0,Math.min(Ae+K,d.scrollHeight-F+Ee))),w+=re-(M=Math.max(0,Math.min(re+M,d.scrollWidth-te+ve)))}S.push({el:d,top:K,left:M})}return S};function V(R){return R===Object(R)&&Object.keys(R).length!==0}function k(R,T){T===void 0&&(T="auto");var Q="scrollBehavior"in document.body.style;R.forEach(function(H){var I=H.el,G=H.top,X=H.left;I.scroll&&Q?I.scroll({top:G,left:X,behavior:T}):(I.scrollTop=G,I.scrollLeft=X)})}function L(R){return R===!1?{block:"end",inline:"nearest"}:V(R)?R:{block:"start",inline:"nearest"}}function P(R,T){var Q=!R.ownerDocument.documentElement.contains(R);if(V(T)&&typeof T.behavior=="function")return T.behavior(Q?[]:se(R,T));if(Q)return;var H=L(T);return k(se(R,H),H.behavior)}var A=Ge.a=P},Zss7:function(nt,Ge,v){var z;(function(he){var oe=/^\s+/,xe=/\s+$/,se=0,V=he.round,k=he.min,L=he.max,P=he.random;function A(b,K){if(b=b||"",K=K||{},b instanceof A)return b;if(!(this instanceof A))return new A(b,K);var M=R(b);this._originalInput=b,this._r=M.r,this._g=M.g,this._b=M.b,this._a=M.a,this._roundA=V(100*this._a)/100,this._format=K.format||M.format,this._gradientType=K.gradientType,this._r<1&&(this._r=V(this._r)),this._g<1&&(this._g=V(this._g)),this._b<1&&(this._b=V(this._b)),this._ok=M.ok,this._tc_id=se++}A.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var b=this.toRgb();return(b.r*299+b.g*587+b.b*114)/1e3},getLuminance:function(){var b=this.toRgb(),K,M,ve,Ee,re,Ae;return K=b.r/255,M=b.g/255,ve=b.b/255,K<=.03928?Ee=K/12.92:Ee=he.pow((K+.055)/1.055,2.4),M<=.03928?re=M/12.92:re=he.pow((M+.055)/1.055,2.4),ve<=.03928?Ae=ve/12.92:Ae=he.pow((ve+.055)/1.055,2.4),.2126*Ee+.7152*re+.0722*Ae},setAlpha:function(b){return this._a=S(b),this._roundA=V(100*this._a)/100,this},toHsv:function(){var b=I(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=I(this._r,this._g,this._b),K=V(b.h*360),M=V(b.s*100),ve=V(b.v*100);return this._a==1?"hsv("+K+", "+M+"%, "+ve+"%)":"hsva("+K+", "+M+"%, "+ve+"%, "+this._roundA+")"},toHsl:function(){var b=Q(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=Q(this._r,this._g,this._b),K=V(b.h*360),M=V(b.s*100),ve=V(b.l*100);return this._a==1?"hsl("+K+", "+M+"%, "+ve+"%)":"hsla("+K+", "+M+"%, "+ve+"%, "+this._roundA+")"},toHex:function(b){return X(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return Y(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:V(this._r),g:V(this._g),b:V(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+V(this._r)+", "+V(this._g)+", "+V(this._b)+")":"rgba("+V(this._r)+", "+V(this._g)+", "+V(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:V(p(this._r,255)*100)+"%",g:V(p(this._g,255)*100)+"%",b:V(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+V(p(this._r,255)*100)+"%, "+V(p(this._g,255)*100)+"%, "+V(p(this._b,255)*100)+"%)":"rgba("+V(p(this._r,255)*100)+"%, "+V(p(this._g,255)*100)+"%, "+V(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[X(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var K="#"+ce(this._r,this._g,this._b,this._a),M=K,ve=this._gradientType?"GradientType = 1, ":"";if(b){var Ee=A(b);M="#"+ce(Ee._r,Ee._g,Ee._b,Ee._a)}return"progid:DXImageTransform.Microsoft.gradient("+ve+"startColorstr="+K+",endColorstr="+M+")"},toString:function(b){var K=!!b;b=b||this._format;var M=!1,ve=this._a<1&&this._a>=0,Ee=!K&&ve&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return Ee?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(M=this.toRgbString()),b==="prgb"&&(M=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(M=this.toHexString()),b==="hex3"&&(M=this.toHexString(!0)),b==="hex4"&&(M=this.toHex8String(!0)),b==="hex8"&&(M=this.toHex8String()),b==="name"&&(M=this.toName()),b==="hsl"&&(M=this.toHslString()),b==="hsv"&&(M=this.toHsvString()),M||this.toHexString())},clone:function(){return A(this.toString())},_applyModification:function(b,K){var M=b.apply(null,[this].concat([].slice.call(K)));return this._r=M._r,this._g=M._g,this._b=M._b,this.setAlpha(M._a),this},lighten:function(){return this._applyModification(Te,arguments)},brighten:function(){return this._applyModification(Fe,arguments)},darken:function(){return this._applyModification(we,arguments)},desaturate:function(){return this._applyModification(De,arguments)},saturate:function(){return this._applyModification(Je,arguments)},greyscale:function(){return this._applyModification(_e,arguments)},spin:function(){return this._applyModification(Se,arguments)},_applyCombination:function(b,K){return b.apply(null,[this].concat([].slice.call(K)))},analogous:function(){return this._applyCombination(J,arguments)},complement:function(){return this._applyCombination(Pe,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(ue,arguments)},triad:function(){return this._applyCombination(be,arguments)},tetrad:function(){return this._applyCombination(O,arguments)}},A.fromRatio=function(b,K){if(typeof b=="object"){var M={};for(var ve in b)b.hasOwnProperty(ve)&&(ve==="a"?M[ve]=b[ve]:M[ve]=Le(b[ve]));b=M}return A(b,K)};function R(b){var K={r:0,g:0,b:0},M=1,ve=null,Ee=null,re=null,Ae=!1,je=!1;return typeof b=="string"&&(b=ee(b)),typeof b=="object"&&(le(b.r)&&le(b.g)&&le(b.b)?(K=T(b.r,b.g,b.b),Ae=!0,je=String(b.r).substr(-1)==="%"?"prgb":"rgb"):le(b.h)&&le(b.s)&&le(b.v)?(ve=Le(b.s),Ee=Le(b.v),K=G(b.h,ve,Ee),Ae=!0,je="hsv"):le(b.h)&&le(b.s)&&le(b.l)&&(ve=Le(b.s),re=Le(b.l),K=H(b.h,ve,re),Ae=!0,je="hsl"),b.hasOwnProperty("a")&&(M=b.a)),M=S(M),{ok:Ae,format:b.format||je,r:k(255,L(K.r,0)),g:k(255,L(K.g,0)),b:k(255,L(K.b,0)),a:M}}function T(b,K,M){return{r:p(b,255)*255,g:p(K,255)*255,b:p(M,255)*255}}function Q(b,K,M){b=p(b,255),K=p(K,255),M=p(M,255);var ve=L(b,K,M),Ee=k(b,K,M),re,Ae,je=(ve+Ee)/2;if(ve==Ee)re=Ae=0;else{var Ne=ve-Ee;Ae=je>.5?Ne/(2-ve-Ee):Ne/(ve+Ee);switch(ve){case b:re=(K-M)/Ne+(K<M?6:0);break;case K:re=(M-b)/Ne+2;break;case M:re=(b-K)/Ne+4;break}re/=6}return{h:re,s:Ae,l:je}}function H(b,K,M){var ve,Ee,re;b=p(b,360),K=p(K,100),M=p(M,100);function Ae(ke,Me,Ue){return Ue<0&&(Ue+=1),Ue>1&&(Ue-=1),Ue<1/6?ke+(Me-ke)*6*Ue:Ue<1/2?Me:Ue<2/3?ke+(Me-ke)*(2/3-Ue)*6:ke}if(K===0)ve=Ee=re=M;else{var je=M<.5?M*(1+K):M+K-M*K,Ne=2*M-je;ve=Ae(Ne,je,b+1/3),Ee=Ae(Ne,je,b),re=Ae(Ne,je,b-1/3)}return{r:ve*255,g:Ee*255,b:re*255}}function I(b,K,M){b=p(b,255),K=p(K,255),M=p(M,255);var ve=L(b,K,M),Ee=k(b,K,M),re,Ae,je=ve,Ne=ve-Ee;if(Ae=ve===0?0:Ne/ve,ve==Ee)re=0;else{switch(ve){case b:re=(K-M)/Ne+(K<M?6:0);break;case K:re=(M-b)/Ne+2;break;case M:re=(b-K)/Ne+4;break}re/=6}return{h:re,s:Ae,v:je}}function G(b,K,M){b=p(b,360)*6,K=p(K,100),M=p(M,100);var ve=he.floor(b),Ee=b-ve,re=M*(1-K),Ae=M*(1-Ee*K),je=M*(1-(1-Ee)*K),Ne=ve%6,ke=[M,Ae,re,re,je,M][Ne],Me=[je,M,M,Ae,re,re][Ne],Ue=[re,re,je,M,M,Ae][Ne];return{r:ke*255,g:Me*255,b:Ue*255}}function X(b,K,M,ve){var Ee=[Ce(V(b).toString(16)),Ce(V(K).toString(16)),Ce(V(M).toString(16))];return ve&&Ee[0].charAt(0)==Ee[0].charAt(1)&&Ee[1].charAt(0)==Ee[1].charAt(1)&&Ee[2].charAt(0)==Ee[2].charAt(1)?Ee[0].charAt(0)+Ee[1].charAt(0)+Ee[2].charAt(0):Ee.join("")}function Y(b,K,M,ve,Ee){var re=[Ce(V(b).toString(16)),Ce(V(K).toString(16)),Ce(V(M).toString(16)),Ce(pe(ve))];return Ee&&re[0].charAt(0)==re[0].charAt(1)&&re[1].charAt(0)==re[1].charAt(1)&&re[2].charAt(0)==re[2].charAt(1)&&re[3].charAt(0)==re[3].charAt(1)?re[0].charAt(0)+re[1].charAt(0)+re[2].charAt(0)+re[3].charAt(0):re.join("")}function ce(b,K,M,ve){var Ee=[Ce(pe(ve)),Ce(V(b).toString(16)),Ce(V(K).toString(16)),Ce(V(M).toString(16))];return Ee.join("")}A.equals=function(b,K){return!b||!K?!1:A(b).toRgbString()==A(K).toRgbString()},A.random=function(){return A.fromRatio({r:P(),g:P(),b:P()})};function De(b,K){K=K===0?0:K||10;var M=A(b).toHsl();return M.s-=K/100,M.s=d(M.s),A(M)}function Je(b,K){K=K===0?0:K||10;var M=A(b).toHsl();return M.s+=K/100,M.s=d(M.s),A(M)}function _e(b){return A(b).desaturate(100)}function Te(b,K){K=K===0?0:K||10;var M=A(b).toHsl();return M.l+=K/100,M.l=d(M.l),A(M)}function Fe(b,K){K=K===0?0:K||10;var M=A(b).toRgb();return M.r=L(0,k(255,M.r-V(255*-(K/100)))),M.g=L(0,k(255,M.g-V(255*-(K/100)))),M.b=L(0,k(255,M.b-V(255*-(K/100)))),A(M)}function we(b,K){K=K===0?0:K||10;var M=A(b).toHsl();return M.l-=K/100,M.l=d(M.l),A(M)}function Se(b,K){var M=A(b).toHsl(),ve=(M.h+K)%360;return M.h=ve<0?360+ve:ve,A(M)}function Pe(b){var K=A(b).toHsl();return K.h=(K.h+180)%360,A(K)}function be(b){var K=A(b).toHsl(),M=K.h;return[A(b),A({h:(M+120)%360,s:K.s,l:K.l}),A({h:(M+240)%360,s:K.s,l:K.l})]}function O(b){var K=A(b).toHsl(),M=K.h;return[A(b),A({h:(M+90)%360,s:K.s,l:K.l}),A({h:(M+180)%360,s:K.s,l:K.l}),A({h:(M+270)%360,s:K.s,l:K.l})]}function ue(b){var K=A(b).toHsl(),M=K.h;return[A(b),A({h:(M+72)%360,s:K.s,l:K.l}),A({h:(M+216)%360,s:K.s,l:K.l})]}function J(b,K,M){K=K||6,M=M||30;var ve=A(b).toHsl(),Ee=360/M,re=[A(b)];for(ve.h=(ve.h-(Ee*K>>1)+720)%360;--K;)ve.h=(ve.h+Ee)%360,re.push(A(ve));return re}function x(b,K){K=K||6;for(var M=A(b).toHsv(),ve=M.h,Ee=M.s,re=M.v,Ae=[],je=1/K;K--;)Ae.push(A({h:ve,s:Ee,v:re})),re=(re+je)%1;return Ae}A.mix=function(b,K,M){M=M===0?0:M||50;var ve=A(b).toRgb(),Ee=A(K).toRgb(),re=M/100,Ae={r:(Ee.r-ve.r)*re+ve.r,g:(Ee.g-ve.g)*re+ve.g,b:(Ee.b-ve.b)*re+ve.b,a:(Ee.a-ve.a)*re+ve.a};return A(Ae)},A.readability=function(b,K){var M=A(b),ve=A(K);return(he.max(M.getLuminance(),ve.getLuminance())+.05)/(he.min(M.getLuminance(),ve.getLuminance())+.05)},A.isReadable=function(b,K,M){var ve=A.readability(b,K),Ee,re;re=!1,Ee=U(M);switch(Ee.level+Ee.size){case"AAsmall":case"AAAlarge":re=ve>=4.5;break;case"AAlarge":re=ve>=3;break;case"AAAsmall":re=ve>=7;break}return re},A.mostReadable=function(b,K,M){var ve=null,Ee=0,re,Ae,je,Ne;M=M||{},Ae=M.includeFallbackColors,je=M.level,Ne=M.size;for(var ke=0;ke<K.length;ke++)re=A.readability(b,K[ke]),re>Ee&&(Ee=re,ve=A(K[ke]));return A.isReadable(b,ve,{level:je,size:Ne})||!Ae?ve:(M.includeFallbackColors=!1,A.mostReadable(b,["#fff","#000"],M))};var j=A.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=A.hexNames=w(j);function w(b){var K={};for(var M in b)b.hasOwnProperty(M)&&(K[b[M]]=M);return K}function S(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,K){F(b)&&(b="100%");var M=te(b);return b=k(K,L(0,parseFloat(b))),M&&(b=parseInt(b*K,10)/100),he.abs(b-K)<1e-6?1:b%K/parseFloat(K)}function d(b){return k(1,L(0,b))}function _(b){return parseInt(b,16)}function F(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function te(b){return typeof b=="string"&&b.indexOf("%")!=-1}function Ce(b){return b.length==1?"0"+b:""+b}function Le(b){return b<=1&&(b=b*100+"%"),b}function pe(b){return he.round(parseFloat(b)*255).toString(16)}function fe(b){return _(b)/255}var ie=function(){var b="[-\\+]?\\d+%?",K="[-\\+]?\\d*\\.\\d+%?",M="(?:"+K+")|(?:"+b+")",ve="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",Ee="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?";return{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+ve),rgba:new RegExp("rgba"+Ee),hsl:new RegExp("hsl"+ve),hsla:new RegExp("hsla"+Ee),hsv:new RegExp("hsv"+ve),hsva:new RegExp("hsva"+Ee),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function le(b){return!!ie.CSS_UNIT.exec(b)}function ee(b){b=b.replace(oe,"").replace(xe,"").toLowerCase();var K=!1;if(j[b])b=j[b],K=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var M;return(M=ie.rgb.exec(b))?{r:M[1],g:M[2],b:M[3]}:(M=ie.rgba.exec(b))?{r:M[1],g:M[2],b:M[3],a:M[4]}:(M=ie.hsl.exec(b))?{h:M[1],s:M[2],l:M[3]}:(M=ie.hsla.exec(b))?{h:M[1],s:M[2],l:M[3],a:M[4]}:(M=ie.hsv.exec(b))?{h:M[1],s:M[2],v:M[3]}:(M=ie.hsva.exec(b))?{h:M[1],s:M[2],v:M[3],a:M[4]}:(M=ie.hex8.exec(b))?{r:_(M[1]),g:_(M[2]),b:_(M[3]),a:fe(M[4]),format:K?"name":"hex8"}:(M=ie.hex6.exec(b))?{r:_(M[1]),g:_(M[2]),b:_(M[3]),format:K?"name":"hex"}:(M=ie.hex4.exec(b))?{r:_(M[1]+""+M[1]),g:_(M[2]+""+M[2]),b:_(M[3]+""+M[3]),a:fe(M[4]+""+M[4]),format:K?"name":"hex8"}:(M=ie.hex3.exec(b))?{r:_(M[1]+""+M[1]),g:_(M[2]+""+M[2]),b:_(M[3]+""+M[3]),format:K?"name":"hex"}:!1}function U(b){var K,M;return b=b||{level:"AA",size:"small"},K=(b.level||"AA").toUpperCase(),M=(b.size||"small").toLowerCase(),K!=="AA"&&K!=="AAA"&&(K="AA"),M!=="small"&&M!=="large"&&(M="small"),{level:K,size:M}}nt.exports?nt.exports=A:!(z=function(){return A}.call(Ge,v,Ge,nt),z!==void 0&&(nt.exports=z))})(Math)},aRTE:function(nt,Ge){nt.exports={L:1,M:0,Q:3,H:2}},bT9E:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return he});var z=v("VTBJ");function he(oe,xe){var se=Object(z.a)({},oe);return Array.isArray(xe)&&xe.forEach(function(V){delete se[V]}),se}},c5Ni:function(nt,Ge,v){},dQei:function(nt,Ge){for(var v={glog:function(he){if(he<1)throw new Error("glog("+he+")");return v.LOG_TABLE[he]},gexp:function(he){for(;he<0;)he+=255;for(;he>=256;)he-=255;return v.EXP_TABLE[he]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},z=0;z<8;z++)v.EXP_TABLE[z]=1<<z;for(var z=8;z<256;z++)v.EXP_TABLE[z]=v.EXP_TABLE[z-4]^v.EXP_TABLE[z-5]^v.EXP_TABLE[z-6]^v.EXP_TABLE[z-8];for(var z=0;z<255;z++)v.LOG_TABLE[v.EXP_TABLE[z]]=z;nt.exports=v},dWSS:function(nt,Ge,v){var z=v("dQei");function he(oe,xe){if(oe.length==null)throw new Error(oe.length+"/"+xe);for(var se=0;se<oe.length&&oe[se]==0;)se++;this.num=new Array(oe.length-se+xe);for(var V=0;V<oe.length-se;V++)this.num[V]=oe[V+se]}he.prototype={get:function(oe){return this.num[oe]},getLength:function(){return this.num.length},multiply:function(oe){for(var xe=new Array(this.getLength()+oe.getLength()-1),se=0;se<this.getLength();se++)for(var V=0;V<oe.getLength();V++)xe[se+V]^=z.gexp(z.glog(this.get(se))+z.glog(oe.get(V)));return new he(xe,0)},mod:function(oe){if(this.getLength()-oe.getLength()<0)return this;for(var xe=z.glog(this.get(0))-z.glog(oe.get(0)),se=new Array(this.getLength()),V=0;V<this.getLength();V++)se[V]=this.get(V);for(var V=0;V<oe.getLength();V++)se[V]^=z.gexp(z.glog(oe.get(V))+xe);return new he(se,0).mod(oe)}},nt.exports=he},dejd:function(nt,Ge,v){},dmUQ:function(nt,Ge,v){"use strict";var z=v("Ff2n"),he=v("rePB"),oe=v("1OyB"),xe=v("vuIU"),se=v("Ji7U"),V=v("md7G"),k=v("foSv"),L=v("q1tI"),P=v.n(L),A=v("TSYQ"),R=v.n(A),T=v("4IlW");function Q(be,O){var ue=Object.keys(be);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(be);O&&(J=J.filter(function(x){return Object.getOwnPropertyDescriptor(be,x).enumerable})),ue.push.apply(ue,J)}return ue}function H(be){for(var O=1;O<arguments.length;O++){var ue=arguments[O]!=null?arguments[O]:{};O%2?Q(Object(ue),!0).forEach(function(J){Object(he.a)(be,J,ue[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(ue)):Q(Object(ue)).forEach(function(J){Object.defineProperty(be,J,Object.getOwnPropertyDescriptor(ue,J))})}return be}function I(be){var O=G();return function(){var J=Object(k.a)(be),x;if(O){var j=Object(k.a)(this).constructor;x=Reflect.construct(J,arguments,j)}else x=J.apply(this,arguments);return Object(V.a)(this,x)}}function G(){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(be){return!1}}function X(){}function Y(be){be.preventDefault()}var ce=function(O){return O.replace(/[^\w.-]+/g,"")},De=200,Je=600,_e=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Te=function(O){return O!=null},Fe=function(O,ue){return ue===O||typeof ue=="number"&&typeof O=="number"&&isNaN(ue)&&isNaN(O)},we=function(be){Object(se.a)(ue,be);var O=I(ue);function ue(J){var x;Object(oe.a)(this,ue),x=O.call(this,J),x.onKeyDown=function(w){var S=x.props,p=S.onKeyDown,d=S.onPressEnter;if(w.keyCode===T.a.UP){var _=x.getRatio(w);x.up(w,_,null),x.stop()}else if(w.keyCode===T.a.DOWN){var F=x.getRatio(w);x.down(w,F,null),x.stop()}else w.keyCode===T.a.ENTER&&d&&d(w);if(x.recordCursorPosition(),x.lastKeyCode=w.keyCode,p){for(var te=arguments.length,Ce=new Array(te>1?te-1:0),Le=1;Le<te;Le++)Ce[Le-1]=arguments[Le];p.apply(void 0,[w].concat(Ce))}},x.onKeyUp=function(w){var S=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),S){for(var p=arguments.length,d=new Array(p>1?p-1:0),_=1;_<p;_++)d[_-1]=arguments[_];S.apply(void 0,[w].concat(d))}},x.onChange=function(w){var S=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(w)),x.setState({inputValue:x.rawInput}),S(x.toNumber(x.rawInput))},x.onMouseUp=function(){var w=x.props.onMouseUp;x.recordCursorPosition(),w&&w.apply(void 0,arguments)},x.onFocus=function(){var w;x.setState({focused:!0}),(w=x.props).onFocus.apply(w,arguments)},x.onBlur=function(){var w=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var S=x.getCurrentValidValue(x.state.inputValue),p=x.setValue(S,X);if(w){var d=x.input.value,_=x.getInputDisplayValue({focus:!1,value:p});x.input.value=_&&Number(_),w.apply(void 0,arguments),x.input.value=d}},x.getRatio=function(w){var S=1;return w.metaKey||w.ctrlKey?S=.1:w.shiftKey&&(S=10),S},x.getFullNum=function(w){return isNaN(w)?w:/e/i.test(String(w))?Number(w).toFixed(18).replace(/\.?0+$/,""):w},x.getPrecision=function(w){if(Te(x.props.precision))return x.props.precision;var S=String(w);if(S.indexOf("e-")>=0)return parseInt(S.slice(S.indexOf("e-")+2),10);var p=0;return S.indexOf(".")>=0&&(p=S.length-S.indexOf(".")-1),p},x.getInputDisplayValue=function(w){var S=w||x.state,p=S.focused,d=S.inputValue,_=S.value,F;p?F=d:F=x.toPrecisionAsStep(_),F==null&&(F="");var te=x.formatWrapper(F);return Te(x.props.decimalSeparator)&&(te=te.toString().replace(".",x.props.decimalSeparator)),te},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(w){}},x.restoreByAfter=function(w){if(w===void 0)return!1;var S=x.input.value,p=S.lastIndexOf(w);if(p===-1)return!1;var d=x.cursorBefore.length;return x.lastKeyCode===T.a.DELETE&&x.cursorBefore.charAt(d-1)===w[0]?(x.fixCaret(d,d),!0):p+w.length===S.length?(x.fixCaret(p,p),!0):!1},x.partRestoreByAfter=function(w){return w===void 0?!1:Array.prototype.some.call(w,function(S,p){var d=w.substring(p);return x.restoreByAfter(d)})},x.isNotCompleteNumber=function(w){return isNaN(w)||w===""||w===null||w&&w.toString().indexOf(".")===w.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(w,S,p){x.pressingUpOrDown=!0,x.step("down",w,S,p)},x.up=function(w,S,p){x.pressingUpOrDown=!0,x.step("up",w,S,p)},x.saveInput=function(w){x.input=w};var j=J.value;j===void 0&&(j=J.defaultValue),x.state={focused:J.autoFocus};var N=x.getValidValue(x.toNumber(j));return x.state=H(H({},x.state),{},{inputValue:x.toPrecisionAsStep(N),value:N}),x}return Object(xe.a)(ue,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var j=this.props,N=j.value,w=j.onChange,S=j.max,p=j.min,d=this.state.focused;if(x){if(!Fe(x.value,N)||!Fe(x.max,S)||!Fe(x.min,p)){var _=d?N:this.getValidValue(N),F;this.pressingUpOrDown?F=_:this.inputting?F=this.rawInput:F=this.toPrecisionAsStep(_),this.setState({value:_,inputValue:F})}var te="value"in this.props?N:this.state.value;"max"in this.props&&x.max!==S&&typeof te=="number"&&te>S&&w&&w(S),"min"in this.props&&x.min!==p&&typeof te=="number"&&te<p&&w&&w(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ce=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?Ce=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(Ce=this.cursorStart):Ce=this.input.value.length,this.fixCaret(Ce,Ce)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Le){}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(x){var j=x;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(x){var j=x.target.value.trim().replace(/。/g,".");return Te(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,w=parseFloat(x);return isNaN(w)?x:(w<j&&(w=j),w>N&&(w=N),w)}},{key:"setValue",value:function(x,j){var N=this.props.precision,w=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),S=this.state.value,p=S===void 0?null:S,d=this.state.inputValue,_=d===void 0?null:d,F=typeof w=="number"?w.toFixed(N):"".concat(w),te=w!==p||F!=="".concat(_);return"value"in this.props?(_=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:_},j)):this.setState({value:w,inputValue:this.toPrecisionAsStep(x)},j),te&&this.props.onChange(w),w}},{key:"getMaxPrecision",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,w=N.precision,S=N.step;if(Te(w))return w;var p=this.getPrecision(j),d=this.getPrecision(S),_=this.getPrecision(x);return x?Math.max(_,p+d):p+d}},{key:"getPrecisionFactor",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(x,j);return Math.pow(10,N)}},{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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var j=Math.abs(this.getMaxPrecision(x));return isNaN(j)?x.toString():Number(x).toFixed(j)}},{key:"toNumber",value:function(x){var j=this.props.precision,N=this.state.focused,w=x&&x.length>16&&N;return this.isNotCompleteNumber(x)||w?x:Te(j)?Math.round(x*Math.pow(10,j))/Math.pow(10,j):Number(x)}},{key:"upStep",value:function(x,j){var N=this.props.step,w=this.getPrecisionFactor(x,j),S=Math.abs(this.getMaxPrecision(x,j)),p=((w*x+w*N*j)/w).toFixed(S);return this.toNumber(p)}},{key:"downStep",value:function(x,j){var N=this.props.step,w=this.getPrecisionFactor(x,j),S=Math.abs(this.getMaxPrecision(x,j)),p=((w*x-w*N*j)/w).toFixed(S);return this.toNumber(p)}},{key:"step",value:function(x,j){var N=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var _=this["".concat(x,"Step")](d,w),F=_>p.max||_<p.min;if(_>p.max?_=p.max:_<p.min&&(_=p.min),this.setValue(_,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),F)return;this.autoStepTimer=setTimeout(function(){N[x](j,w,!0)},S?De:Je)}},{key:"fixCaret",value:function(x,j){if(x===void 0||j===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,w=this.input.selectionEnd;(x!==N||j!==w)&&this.input.setSelectionRange(x,j)}catch(S){}}},{key:"render",value:function(){var x,j=this.props,N=j.prefixCls,w=j.disabled,S=j.readOnly,p=j.useTouch,d=j.autoComplete,_=j.upHandler,F=j.downHandler,te=j.className,Ce=j.max,Le=j.min,pe=j.style,fe=j.title,ie=j.onMouseEnter,le=j.onMouseLeave,ee=j.onMouseOver,U=j.onMouseOut,b=j.required,K=j.onClick,M=j.tabIndex,ve=j.type,Ee=j.placeholder,re=j.id,Ae=j.inputMode,je=j.pattern,Ne=j.step,ke=j.maxLength,Me=j.autoFocus,Ue=j.name,et=j.onPaste,Ve=j.onInput,Ze=Object(z.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"]),Qe=this.state,at=Qe.value,tt=Qe.focused,st=R()(N,(x={},Object(he.a)(x,te,!!te),Object(he.a)(x,"".concat(N,"-disabled"),w),Object(he.a)(x,"".concat(N,"-focused"),tt),x)),Re={};Object.keys(Ze).forEach(function(B){(B.substr(0,5)==="data-"||B.substr(0,5)==="aria-"||B==="role")&&(Re[B]=Ze[B])});var vt=!S&&!w,ut=this.getInputDisplayValue(null),Be=(at||at===0)&&(isNaN(at)||Number(at)>=Ce),$e=(at||at===0)&&(isNaN(at)||Number(at)<=Le),ae=Be||w||S,q=$e||w||S,ne=R()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(he.a)({},"".concat(N,"-handler-up-disabled"),ae)),C=R()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(he.a)({},"".concat(N,"-handler-down-disabled"),q)),E=p?{onTouchStart:ae?X:this.up,onTouchEnd:this.stop}:{onMouseDown:ae?X:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},D=p?{onTouchStart:q?X:this.down,onTouchEnd:this.stop}:{onMouseDown:q?X:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:st,style:pe,title:fe,onMouseEnter:ie,onMouseLeave:le,onMouseOver:ee,onMouseOut:U,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(N,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},E,{role:"button","aria-label":"Increase Value","aria-disabled":ae,className:ne}),_||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:Y})),P.a.createElement("span",Object.assign({unselectable:"on"},D,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:C}),F||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:Y}))),P.a.createElement("div",{className:"".concat(N,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Le,"aria-valuemax":Ce,"aria-valuenow":at,required:b,type:ve,placeholder:Ee,onPaste:et,onClick:K,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:M,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:X,onKeyUp:vt?this.onKeyUp:X,autoFocus:Me,maxLength:ke,readOnly:S,disabled:w,max:Ce,min:Le,step:Ne,name:Ue,title:fe,id:re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ut),pattern:je,inputMode:Ae,onInput:Ve},Re))))}}]),ue}(P.a.Component);we.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_e,min:-_e,step:1,style:{},onChange:X,onKeyDown:X,onPressEnter:X,onFocus:X,onBlur:X,parser:ce,required:!1,autoComplete:"off"};var Se=we,Pe=Ge.a=Se},f4xo:function(nt,Ge,v){var z=v("nVVt");function he(oe){this.mode=z.MODE_8BIT_BYTE,this.data=oe}he.prototype={getLength:function(oe){return this.data.length},write:function(oe){for(var xe=0;xe<this.data.length;xe++)oe.put(this.data.charCodeAt(xe),8)}},nt.exports=he},gHQ5:function(nt,Ge,v){"use strict";v.r(Ge);var z=v("+L6B"),he=v("2/Rp"),oe=v("5NDa"),xe=v("5rEg"),se=v("k1fw"),V=v("9og8"),k=v("y8nQ"),L=v("Vl3Y"),P=v("tJVT"),A=v("CiB2"),R=v("WmNS"),T=v.n(R),Q=v("q1tI"),H=v.n(Q),I=v("3vs6"),G=v("l3Yi"),X=v.n(G),Y=v("Ot1p"),ce=v("500L"),De=v("ErOA"),Je=v("Ty5D"),_e=v("9kvl"),Te=function(we){var Se;Object(A.a)(we);var Pe=Object(Q.useState)({}),be=Object(P.a)(Pe,2),O=be[0],ue=be[1],J=L.a.useForm(),x=Object(P.a)(J,1),j=x[0],N=Object(Q.useState)(!0),w=Object(P.a)(N,2),S=w[0],p=w[1],d=Object(Q.useState)(!1),_=Object(P.a)(d,2),F=_[0],te=_[1],Ce=Object(Q.useState)(!1),Le=Object(P.a)(Ce,2),pe=Le[0],fe=Le[1],ie=Object(Je.i)(),le=ie==null?void 0:ie.virtual_spacesId;Object(Q.useEffect)(function(){ie!=null&&ie.id?ee():fe(!0)},[]);var ee=function(){var b=Object(V.a)(T.a.mark(function K(){var M,ve;return T.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(De.a)("/api/virtual_classrooms/".concat(le,"/syllabuses/").concat(ie==null?void 0:ie.id,"/edit.json"),{method:"get"});case 2:M=re.sent,M&&(ve={title:M.title,description:M.description,attachment_ids:Object(ce.a)(M.attachments)},console.log(ve,"formData"),j.setFieldsValue(Object(se.a)({},ve)),ue(Object(se.a)({},ve)),fe(!0));case 4:case"end":return re.stop()}},K)}));return function(){return b.apply(this,arguments)}}(),U=function(){var b=Object(V.a)(T.a.mark(function K(M){var ve,Ee,re,Ae,je;return T.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:if(Ee=Object(se.a)({},O),Ee.attachment_ids&&(Ee.attachment_ids=Ee==null||((re=Ee.attachment_ids)===null||re===void 0)?void 0:re.map(function(Me){return Me.response.id})),te(!0),!(ie!=null&&ie.id)){ke.next=9;break}return ke.next=6,Object(De.a)("/api/virtual_classrooms/".concat(le,"/syllabuses/").concat(ie==null?void 0:ie.id,".json"),{method:"put",body:Object(se.a)({},Ee)});case 6:Ae=ke.sent,ke.next=12;break;case 9:return ke.next=11,Object(De.a)("/api/virtual_classrooms/".concat(le,"/syllabuses.json"),{method:"post",body:Object(se.a)({},Ee)});case 11:Ae=ke.sent;case 12:(ve=Ae)!==null&&ve!==void 0&&ve.virtual_classroom_id&&_e.d.push("/vspaces/".concat(le,"/syllabuses/").concat((je=Ae)===null||je===void 0?void 0:je.id,"/detail")),te(!1);case 14:case"end":return ke.stop()}},K)}));return function(M){return b.apply(this,arguments)}}();return H.a.createElement("div",{className:X.a.wrap},H.a.createElement(I.a,null),H.a.createElement("div",{className:X.a.form},H.a.createElement("div",{className:X.a.title},H.a.createElement("span",{onClick:function(){return _e.d.push("/vspaces/".concat(le,"/syllabuses"))}},H.a.createElement("i",{className:"iconfont icon-zuoshangjiaofanhui"}),"\u8FD4\u56DE"),H.a.createElement("span",null,"\u65B0\u5EFA\u6559\u5B66\u5927\u7EB2")),H.a.createElement(L.a,{colon:!1,form:j,scrollToFirstError:!0,onValuesChange:function(){ue(Object(se.a)({},j.getFieldsValue()))},onFinish:U},H.a.createElement(L.a.Item,{name:"title",label:"\u5927\u7EB2\u6807\u9898",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5927\u7EB2\u6807\u9898"}]},H.a.createElement(xe.a,{maxLength:60,suffix:"".concat(((Se=O.title)===null||Se===void 0?void 0:Se.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u5927\u7EB2\u6807\u9898"})),H.a.createElement("div",{style:{margin:"20px 0 12px 10px"}},"\u5927\u7EB2\u5185\u5BB9"),H.a.createElement(L.a.Item,{className:"ml10",name:"description",rules:[{max:5e4,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u523650000\u4E2A\u5B57\u7B26"}]},H.a.createElement(Y.a,{watch:!0,defaultValue:O.description})),H.a.createElement(L.a.Item,{className:"ml10",name:"attachment_ids",label:"\u9644\u4EF6"},pe&&H.a.createElement(ce.b,{className:X.a.file,title:H.a.createElement("span",null,H.a.createElement("i",{className:"iconfont icon-shangchuan1 font14 mr5"}),"\u4E0A\u4F20\u9644\u4EF6")})),H.a.createElement("div",{style:{textAlign:"right"}},H.a.createElement(L.a.Item,null,H.a.createElement(he.a,{onClick:function(){return _e.d.push("/vspaces/".concat(le,"/syllabuses"))},className:"mr10"},"\u53D6\u6D88"),H.a.createElement(he.a,{type:"primary",htmlType:"submit",loading:F},"\u786E\u8BA4"))))))};Ge.default=Te},h78n:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return x});var z=v("q1tI"),he=v.n(z),oe=v("TSYQ"),xe=v.n(oe),se={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},V=function(w){var S=w.map(function(){return Object(z.useRef)()}),p=Object(z.useRef)();return Object(z.useEffect)(function(){var d=Date.now(),_=!1;Object.keys(S).forEach(function(F){var te=S[F].current;if(!te)return;_=!0;var Ce=te.style;Ce.transitionDuration=".3s, .3s, .3s, .06s",p.current&&d-p.current<100&&(Ce.transitionDuration="0s, 0s")}),_&&(p.current=Date.now())}),[S]};function k(){return k=Object.assign||function(N){for(var w=1;w<arguments.length;w++){var S=arguments[w];for(var p in S)Object.prototype.hasOwnProperty.call(S,p)&&(N[p]=S[p])}return N},k.apply(this,arguments)}function L(N,w){return Q(N)||T(N,w)||A(N,w)||P()}function P(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(N,w){if(!N)return;if(typeof N=="string")return R(N,w);var S=Object.prototype.toString.call(N).slice(8,-1);if(S==="Object"&&N.constructor&&(S=N.constructor.name),S==="Map"||S==="Set")return Array.from(N);if(S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S))return R(N,w)}function R(N,w){(w==null||w>N.length)&&(w=N.length);for(var S=0,p=new Array(w);S<w;S++)p[S]=N[S];return p}function T(N,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var S=[],p=!0,d=!1,_=void 0;try{for(var F=N[Symbol.iterator](),te;!(p=(te=F.next()).done)&&!(S.push(te.value),w&&S.length===w);p=!0);}catch(Ce){d=!0,_=Ce}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw _}}return S}function Q(N){if(Array.isArray(N))return N}function H(N,w){if(N==null)return{};var S=I(N,w),p,d;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(N);for(d=0;d<_.length;d++){if(p=_[d],w.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,p))continue;S[p]=N[p]}}return S}function I(N,w){if(N==null)return{};var S={},p=Object.keys(N),d,_;for(_=0;_<p.length;_++){if(d=p[_],w.indexOf(d)>=0)continue;S[d]=N[d]}return S}var G=function(w){var S=w.className,p=w.percent,d=w.prefixCls,_=w.strokeColor,F=w.strokeLinecap,te=w.strokeWidth,Ce=w.style,Le=w.trailColor,pe=w.trailWidth,fe=w.transition,ie=H(w,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ie.gapPosition;var le=Array.isArray(p)?p:[p],ee=Array.isArray(_)?_:[_],U=V(le),b=L(U,1),K=b[0],M=te/2,ve=100-te/2,Ee="M ".concat(F==="round"?M:0,",").concat(M,`
L `).concat(F==="round"?ve:100,",").concat(M),re="0 0 100 ".concat(te),Ae=0;return he.a.createElement("svg",k({className:xe()("".concat(d,"-line"),S),viewBox:re,preserveAspectRatio:"none",style:Ce},ie),he.a.createElement("path",{className:"".concat(d,"-line-trail"),d:Ee,strokeLinecap:F,stroke:Le,strokeWidth:pe||te,fillOpacity:"0"}),le.map(function(je,Ne){var ke={strokeDasharray:"".concat(je,"px, 100px"),strokeDashoffset:"-".concat(Ae,"px"),transition:fe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Me=ee[Ne]||ee[ee.length-1];return Ae+=je,he.a.createElement("path",{key:Ne,className:"".concat(d,"-line-path"),d:Ee,strokeLinecap:F,stroke:Me,strokeWidth:te,fillOpacity:"0",ref:K[Ne],style:ke})}))};G.defaultProps=se;var X=G;function Y(){return Y=Object.assign||function(N){for(var w=1;w<arguments.length;w++){var S=arguments[w];for(var p in S)Object.prototype.hasOwnProperty.call(S,p)&&(N[p]=S[p])}return N},Y.apply(this,arguments)}function ce(N,w){return Fe(N)||Te(N,w)||Je(N,w)||De()}function De(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(N,w){if(!N)return;if(typeof N=="string")return _e(N,w);var S=Object.prototype.toString.call(N).slice(8,-1);if(S==="Object"&&N.constructor&&(S=N.constructor.name),S==="Map"||S==="Set")return Array.from(N);if(S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S))return _e(N,w)}function _e(N,w){(w==null||w>N.length)&&(w=N.length);for(var S=0,p=new Array(w);S<w;S++)p[S]=N[S];return p}function Te(N,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var S=[],p=!0,d=!1,_=void 0;try{for(var F=N[Symbol.iterator](),te;!(p=(te=F.next()).done)&&!(S.push(te.value),w&&S.length===w);p=!0);}catch(Ce){d=!0,_=Ce}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw _}}return S}function Fe(N){if(Array.isArray(N))return N}function we(N,w){if(N==null)return{};var S=Se(N,w),p,d;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(N);for(d=0;d<_.length;d++){if(p=_[d],w.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,p))continue;S[p]=N[p]}}return S}function Se(N,w){if(N==null)return{};var S={},p=Object.keys(N),d,_;for(_=0;_<p.length;_++){if(d=p[_],w.indexOf(d)>=0)continue;S[d]=N[d]}return S}var Pe=0;function be(N){return+N.replace("%","")}function O(N){return Array.isArray(N)?N:[N]}function ue(N,w,S,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,_=arguments.length>5?arguments[5]:void 0,F=50-p/2,te=0,Ce=-F,Le=0,pe=-2*F;switch(_){case"left":te=-F,Ce=0,Le=2*F,pe=0;break;case"right":te=F,Ce=0,Le=-2*F,pe=0;break;case"bottom":Ce=F,pe=2*F;break;default:}var fe="M 50,50 m ".concat(te,",").concat(Ce,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(Le,",").concat(-pe,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(-Le,",").concat(pe),ie=Math.PI*2*F,le={stroke:S,strokeDasharray:"".concat(w/100*(ie-d),"px ").concat(ie,"px"),strokeDashoffset:"-".concat(d/2+N/100*(ie-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:fe,pathStyle:le}}var J=function(w){var S=w.prefixCls,p=w.strokeWidth,d=w.trailWidth,_=w.gapDegree,F=w.gapPosition,te=w.trailColor,Ce=w.strokeLinecap,Le=w.style,pe=w.className,fe=w.strokeColor,ie=w.percent,le=we(w,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ee=Object(z.useMemo)(function(){return Pe+=1,Pe},[]),U=ue(0,100,te,p,_,F),b=U.pathString,K=U.pathStyle,M=O(ie),ve=O(fe),Ee=ve.find(function(ke){return Object.prototype.toString.call(ke)==="[object Object]"}),re=V(M),Ae=ce(re,1),je=Ae[0],Ne=function(){var Me=0;return M.map(function(Ue,et){var Ve=ve[et]||ve[ve.length-1],Ze=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(S,"-gradient-").concat(ee,")"):"",Qe=ue(Me,Ue,Ve,p,_,F);return Me+=Ue,he.a.createElement("path",{key:et,className:"".concat(S,"-circle-path"),d:Qe.pathString,stroke:Ze,strokeLinecap:Ce,strokeWidth:p,opacity:Ue===0?0:1,fillOpacity:"0",style:Qe.pathStyle,ref:je[et]})})};return he.a.createElement("svg",Y({className:xe()("".concat(S,"-circle"),pe),viewBox:"0 0 100 100",style:Le},le),Ee&&he.a.createElement("defs",null,he.a.createElement("linearGradient",{id:"".concat(S,"-gradient-").concat(ee),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ee).sort(function(ke,Me){return be(ke)-be(Me)}).map(function(ke,Me){return he.a.createElement("stop",{key:Me,offset:ke,stopColor:Ee[ke]})}))),he.a.createElement("path",{className:"".concat(S,"-circle-trail"),d:b,stroke:te,strokeLinecap:Ce,strokeWidth:d||p,fillOpacity:"0",style:K}),Ne().reverse())};J.defaultProps=se;var x=J,j={Line:X,Circle:x}},kSUc:function(nt,Ge,v){},l3Yi:function(nt,Ge,v){nt.exports={flex_box_center:"flex_box_center___354pw",flex_space_between:"flex_space_between___10PE2",flex_box_vertical_center:"flex_box_vertical_center___YT9_A",flex_box_center_end:"flex_box_center_end___1qNoU",flex_box_column:"flex_box_column___2E4_8",wrap:"wrap___1umYZ",form:"form___2x_Sk",title:"title___idVlc",file:"file___1g_02"}},lZu9:function(nt,Ge,v){(function(z){z(v("VrN/"),v("1eCo"),v("8EBN"))})(function(z){"use strict";z.defineMode("markdown",function(he,oe){var xe=z.getMode(he,"text/html"),se=xe.name=="null";function V(p){if(z.findModeByName){var d=z.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var _=z.getMode(he,p);return _.name=="null"?null:_}oe.highlightFormatting===void 0&&(oe.highlightFormatting=!1),oe.maxBlockquoteDepth===void 0&&(oe.maxBlockquoteDepth=0),oe.taskLists===void 0&&(oe.taskLists=!1),oe.strikethrough===void 0&&(oe.strikethrough=!1),oe.emoji===void 0&&(oe.emoji=!1),oe.fencedCodeBlockHighlighting===void 0&&(oe.fencedCodeBlockHighlighting=!0),oe.fencedCodeBlockDefaultMode===void 0&&(oe.fencedCodeBlockDefaultMode="text/plain"),oe.xml===void 0&&(oe.xml=!0),oe.tokenTypeOverrides===void 0&&(oe.tokenTypeOverrides={});var k={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 L in k)k.hasOwnProperty(L)&&oe.tokenTypeOverrides[L]&&(k[L]=oe.tokenTypeOverrides[L]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,R=/^\[(x| )\](?=\s)/i,T=oe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Q=/^ {0,3}(?:\={1,}|-{2,})\s*$/,H=/^[^#!\[\]*_\\<>` "'(~:]+/,I=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,G=/^\s*\[[^\]]+?\]:.*$/,X=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Y=" ";function ce(p,d,_){return d.f=d.inline=_,_(p,d)}function De(p,d,_){return d.f=d.block=_,_(p,d)}function Je(p){return!p||!/\S/.test(p.string)}function _e(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==Fe){var d=se;if(!d){var _=z.innerMode(xe,p.htmlState);d=_.mode.name=="xml"&&_.state.tagStart===null&&!_.state.context&&_.state.tokenize.isInText}d&&(p.f=be,p.block=Te,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function Te(p,d){var _=p.column()===d.indentation,F=Je(d.prevLine.stream),te=d.indentedCode,Ce=d.prevLine.hr,Le=d.list!==!1,pe=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var fe=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Le)){for(d.list=null;fe<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=fe-d.listStack[d.listStack.length-1])}var ie=!F&&!Ce&&!d.prevLine.header&&(!Le||!te)&&!d.prevLine.fencedCodeEnd,le=(d.list===!1||Ce||F)&&d.indentation<=pe&&p.match(P),ee=null;if(d.indentationDiff>=4&&(te||d.prevLine.fencedCodeEnd||d.prevLine.header||F))return p.skipToEnd(),d.indentedCode=!0,k.code;if(p.eatSpace())return null;if(_&&d.indentation<=pe&&(ee=p.match(T))&&ee[1].length<=6)return d.quote=0,d.header=ee[1].length,d.thisLine.header=!0,oe.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Se(d);if(d.indentation<=pe&&p.eat(">"))return d.quote=_?1:d.quote+1,oe.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Se(d);if(!le&&!d.setext&&_&&d.indentation<=pe&&(ee=p.match(A))){var U=ee[1]?"ol":"ul";return d.indentation=fe+p.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,oe.taskLists&&p.match(R,!1)&&(d.taskList=!0),d.f=d.inline,oe.highlightFormatting&&(d.formatting=["list","list-"+U]),Se(d)}else{if(_&&d.indentation<=pe&&(ee=p.match(I,!0)))return d.quote=0,d.fencedEndRE=new RegExp(ee[1]+"+ *$"),d.localMode=oe.fencedCodeBlockHighlighting&&V(ee[2]||oe.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=z.startState(d.localMode)),d.f=d.block=we,oe.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Se(d);if(d.setext||(!ie||!Le)&&!d.quote&&d.list===!1&&!d.code&&!le&&!G.test(p.string)&&(ee=p.lookAhead(1))&&(ee=ee.match(Q)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),oe.highlightFormatting&&(d.formatting="header")):(d.header=ee[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Se(d);if(le)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,k.hr;if(p.peek()==="[")return ce(p,d,j)}return ce(p,d,d.inline)}function Fe(p,d){var _=xe.token(p,d.htmlState);if(!se){var F=z.innerMode(xe,d.htmlState);(F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=be,d.block=Te,d.htmlState=null)}return _}function we(p,d){var _=d.listStack[d.listStack.length-1]||0,F=d.indentation<_,te=_+3;if(d.fencedEndRE&&d.indentation<=te&&(F||p.match(d.fencedEndRE))){oe.highlightFormatting&&(d.formatting="code-block");var Ce;return F||(Ce=Se(d)),d.localMode=d.localState=null,d.block=Te,d.f=be,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,F?De(p,d,d.block):Ce}else return d.localMode?d.localMode.token(p,d.localState):(p.skipToEnd(),k.code)}function Se(p){var d=[];if(p.formatting){d.push(k.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var _=0;_<p.formatting.length;_++)d.push(k.formatting+"-"+p.formatting[_]),p.formatting[_]==="header"&&d.push(k.formatting+"-"+p.formatting[_]+"-"+p.header),p.formatting[_]==="quote"&&(!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=p.quote?d.push(k.formatting+"-"+p.formatting[_]+"-"+p.quote):d.push("error"))}if(p.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(p.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(p.linkHref?d.push(k.linkHref,"url"):(p.strong&&d.push(k.strong),p.em&&d.push(k.em),p.strikethrough&&d.push(k.strikethrough),p.emoji&&d.push(k.emoji),p.linkText&&d.push(k.linkText),p.code&&d.push(k.code),p.image&&d.push(k.image),p.imageAltText&&d.push(k.imageAltText,"link"),p.imageMarker&&d.push(k.imageMarker)),p.header&&d.push(k.header,k.header+"-"+p.header),p.quote&&(d.push(k.quote),!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=p.quote?d.push(k.quote+"-"+p.quote):d.push(k.quote+"-"+oe.maxBlockquoteDepth)),p.list!==!1){var F=(p.listStack.length-1)%3;F?F===1?d.push(k.list2):d.push(k.list3):d.push(k.list1)}return p.trailingSpaceNewLine?d.push("trailing-space-new-line"):p.trailingSpace&&d.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function Pe(p,d){return p.match(H,!0)?Se(d):void 0}function be(p,d){var _=d.text(p,d);if(typeof _!="undefined")return _;if(d.list)return d.list=null,Se(d);if(d.taskList){var F=p.match(R,!0)[1]===" ";return F?d.taskOpen=!0:d.taskClosed=!0,oe.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Se(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return oe.highlightFormatting&&(d.formatting="header"),Se(d);var te=p.next();if(d.linkTitle){d.linkTitle=!1;var Ce=te;te==="("&&(Ce=")"),Ce=(Ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Le="^\\s*(?:[^"+Ce+"\\\\]+|\\\\\\\\|\\\\.)"+Ce;if(p.match(new RegExp(Le),!0))return k.linkHref}if(te==="`"){var pe=d.formatting;oe.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var fe=p.current().length;if(d.code==0&&(!d.quote||fe==1))return d.code=fe,Se(d);if(fe==d.code){var ie=Se(d);return d.code=0,ie}else return d.formatting=pe,Se(d)}else if(d.code)return Se(d);if(te==="\\"&&(p.next(),oe.highlightFormatting)){var le=Se(d),ee=k.formatting+"-escape";return le?le+" "+ee:ee}if(te==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,oe.highlightFormatting&&(d.formatting="image"),Se(d);if(te==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,oe.highlightFormatting&&(d.formatting="image"),Se(d);if(te==="]"&&d.imageAltText){oe.highlightFormatting&&(d.formatting="image");var le=Se(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=ue,le}if(te==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,oe.highlightFormatting&&(d.formatting="link")),Se(d);if(te==="]"&&d.linkText){oe.highlightFormatting&&(d.formatting="link");var le=Se(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?ue:be,le}if(te==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,oe.highlightFormatting&&(d.formatting="link");var le=Se(d);return le?le+=" ":le="",le+k.linkInline}if(te==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,oe.highlightFormatting&&(d.formatting="link");var le=Se(d);return le?le+=" ":le="",le+k.linkEmail}if(oe.xml&&te==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var U=p.string.indexOf(">",p.pos);if(U!=-1){var b=p.string.substring(p.start,U);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=z.startState(xe),De(p,d,Fe)}if(oe.xml&&te==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(te==="*"||te==="_"){for(var K=1,M=p.pos==1?" ":p.string.charAt(p.pos-2);K<3&&p.eat(te);)K++;var ve=p.peek()||" ",Ee=!/\s/.test(ve)&&(!X.test(ve)||/\s/.test(M)||X.test(M)),re=!/\s/.test(M)&&(!X.test(M)||/\s/.test(ve)||X.test(ve)),Ae=null,je=null;if(K%2&&(!d.em&&Ee&&(te==="*"||!re||X.test(M))?Ae=!0:d.em==te&&re&&(te==="*"||!Ee||X.test(ve))&&(Ae=!1)),K>1&&(!d.strong&&Ee&&(te==="*"||!re||X.test(M))?je=!0:d.strong==te&&re&&(te==="*"||!Ee||X.test(ve))&&(je=!1)),je!=null||Ae!=null){oe.highlightFormatting&&(d.formatting=Ae==null?"strong":je==null?"em":"strong em"),Ae===!0&&(d.em=te),je===!0&&(d.strong=te);var ie=Se(d);return Ae===!1&&(d.em=!1),je===!1&&(d.strong=!1),ie}}else if(te===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Se(d);p.backUp(1)}if(oe.strikethrough){if(te==="~"&&p.eatWhile(te)){if(d.strikethrough){oe.highlightFormatting&&(d.formatting="strikethrough");var ie=Se(d);return d.strikethrough=!1,ie}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,oe.highlightFormatting&&(d.formatting="strikethrough"),Se(d)}else if(te===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Se(d);p.backUp(2)}}if(oe.emoji&&te===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,oe.highlightFormatting&&(d.formatting="emoji");var Ne=Se(d);return d.emoji=!1,Ne}return te===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Se(d)}function O(p,d){var _=p.next();if(_===">"){d.f=d.inline=be,oe.highlightFormatting&&(d.formatting="link");var F=Se(d);return F?F+=" ":F="",F+k.linkInline}return p.match(/^[^>]+/,!0),k.linkInline}function ue(p,d){if(p.eatSpace())return null;var _=p.next();return _==="("||_==="["?(d.f=d.inline=x(_==="("?")":"]"),oe.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Se(d)):"error"}var J={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(p){return function(d,_){var F=d.next();if(F===p){_.f=_.inline=be,oe.highlightFormatting&&(_.formatting="link-string");var te=Se(_);return _.linkHref=!1,te}return d.match(J[p]),_.linkHref=!0,Se(_)}}function j(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=N,p.next(),oe.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Se(d)):ce(p,d,be)}function N(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=w,oe.highlightFormatting&&(d.formatting="link");var _=Se(d);return d.linkText=!1,_}return p.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function w(p,d){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?d.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=be,k.linkHref+" url")}var S={startState:function(){return{f:Te,prevLine:{stream:null},thisLine:{stream:null},block:Te,htmlState:null,indentation:0,inline:be,text:Pe,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(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&z.copyState(xe,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?z.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,d){if(d.formatting=!1,p!=d.thisLine.stream){if(d.header=0,d.hr=!1,p.match(/^\s*$/,!0))return _e(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:p},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=Fe)){var _=p.match(/^\s*/,!0)[0].replace(/\t/g,Y).length;if(d.indentation=_,d.indentationDiff=null,_>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==Fe?{state:p.htmlState,mode:xe}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:S}},indent:function(p,d,_){return p.block==Fe&&xe.indent?xe.indent(p.htmlState,d,_):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,_):z.Pass},blankLine:_e,getType:Se,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return S},"xml"),z.defineMIME("text/markdown","markdown"),z.defineMIME("text/x-markdown","markdown")})},mOS8:function(nt,Ge,v){nt.exports=v.p+"static/403Qrcode.6c17b6f4.png"},nVVt:function(nt,Ge){nt.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(nt,Ge,v){(function(z){z(v("VrN/"))})(function(z){"use strict";var he=z.Pos;function oe(X,Y){return X.line-Y.line||X.ch-Y.ch}var xe="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",se=xe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",V=new RegExp("<(/?)(["+xe+"]["+se+"]*)","g");function k(X,Y,ce,De){this.line=Y,this.ch=ce,this.cm=X,this.text=X.getLine(Y),this.min=De?Math.max(De.from,X.firstLine()):X.firstLine(),this.max=De?Math.min(De.to-1,X.lastLine()):X.lastLine()}function L(X,Y){var ce=X.cm.getTokenTypeAt(he(X.line,Y));return ce&&/\btag\b/.test(ce)}function P(X){return X.line>=X.max?void 0:(X.ch=0,X.text=X.cm.getLine(++X.line),!0)}function A(X){return X.line<=X.min?void 0:(X.text=X.cm.getLine(--X.line),X.ch=X.text.length,!0)}function R(X){for(;;){var Y=X.text.indexOf(">",X.ch);if(Y==-1){if(P(X))continue;return}if(!L(X,Y+1)){X.ch=Y+1;continue}var ce=X.text.lastIndexOf("/",Y),De=ce>-1&&!/\S/.test(X.text.slice(ce+1,Y));return X.ch=Y+1,De?"selfClose":"regular"}}function T(X){for(;;){var Y=X.ch?X.text.lastIndexOf("<",X.ch-1):-1;if(Y==-1){if(A(X))continue;return}if(!L(X,Y+1)){X.ch=Y;continue}V.lastIndex=Y,X.ch=Y;var ce=V.exec(X.text);if(ce&&ce.index==Y)return ce}}function Q(X){for(;;){V.lastIndex=X.ch;var Y=V.exec(X.text);if(!Y){if(P(X))continue;return}if(!L(X,Y.index+1)){X.ch=Y.index+1;continue}return X.ch=Y.index+Y[0].length,Y}}function H(X){for(;;){var Y=X.ch?X.text.lastIndexOf(">",X.ch-1):-1;if(Y==-1){if(A(X))continue;return}if(!L(X,Y+1)){X.ch=Y;continue}var ce=X.text.lastIndexOf("/",Y),De=ce>-1&&!/\S/.test(X.text.slice(ce+1,Y));return X.ch=Y+1,De?"selfClose":"regular"}}function I(X,Y){for(var ce=[];;){var De=Q(X),Je,_e=X.line,Te=X.ch-(De?De[0].length:0);if(!De||!(Je=R(X)))return;if(Je=="selfClose")continue;if(De[1]){for(var Fe=ce.length-1;Fe>=0;--Fe)if(ce[Fe]==De[2]){ce.length=Fe;break}if(Fe<0&&(!Y||Y==De[2]))return{tag:De[2],from:he(_e,Te),to:he(X.line,X.ch)}}else ce.push(De[2])}}function G(X,Y){for(var ce=[];;){var De=H(X);if(!De)return;if(De=="selfClose"){T(X);continue}var Je=X.line,_e=X.ch,Te=T(X);if(!Te)return;if(Te[1])ce.push(Te[2]);else{for(var Fe=ce.length-1;Fe>=0;--Fe)if(ce[Fe]==Te[2]){ce.length=Fe;break}if(Fe<0&&(!Y||Y==Te[2]))return{tag:Te[2],from:he(X.line,X.ch),to:he(Je,_e)}}}}z.registerHelper("fold","xml",function(X,Y){for(var ce=new k(X,Y.line,0);;){var De=Q(ce);if(!De||ce.line!=Y.line)return;var Je=R(ce);if(!Je)return;if(!De[1]&&Je!="selfClose"){var _e=he(ce.line,ce.ch),Te=I(ce,De[2]);return Te&&oe(Te.from,_e)>0?{from:_e,to:Te.from}:null}}}),z.findMatchingTag=function(X,Y,ce){var De=new k(X,Y.line,Y.ch,ce);if(De.text.indexOf(">")==-1&&De.text.indexOf("<")==-1)return;var Je=R(De),_e=Je&&he(De.line,De.ch),Te=Je&&T(De);if(!Je||!Te||oe(De,Y)>0)return;var Fe={from:he(De.line,De.ch),to:_e,tag:Te[2]};return Je=="selfClose"?{open:Fe,close:null,at:"open"}:Te[1]?{open:G(De,Te[2]),close:Fe,at:"close"}:(De=new k(X,_e.line,_e.ch,ce),{open:Fe,close:I(De,Te[2]),at:"open"})},z.findEnclosingTag=function(X,Y,ce,De){for(var Je=new k(X,Y.line,Y.ch,ce);;){var _e=G(Je,De);if(!_e)break;var Te=new k(X,Y.line,Y.ch,ce),Fe=I(Te,_e.tag);if(Fe)return{open:_e,close:Fe}}},z.scanForClosingTag=function(X,Y,ce,De){var Je=new k(X,Y.line,Y.ch,De?{from:0,to:De}:null);return I(Je,ce)}})},p5ED:function(nt,Ge,v){"use strict";var z=v("+L6B"),he=v("2/Rp"),oe=v("5Dmo"),xe=v("3S7+"),se=v("k1fw"),V=v("tJVT"),k=v("q1tI"),L=v.n(k),P=v("vHTk"),A=v.n(P),R=v("yEEn"),T=v("ZW9T"),Q=v("1vsH");Ge.a=function(H){var I=H.name,G=H.data,X=H.theme,Y=H.type,ce=H.filename,De=H.monacoEditor,Je=H.className,_e=H.style,Te=H.close,Fe=H.onClose,we=H.hasMask,Se=Object(k.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Pe=Object(V.a)(Se,2),be=Pe[0],O=Pe[1],ue=Object(k.useState)(""),J=Object(V.a)(ue,2),x=J[0],j=J[1],N=Object(k.useRef)();ce&&(De.filename=ce),Object(k.useEffect)(function(){var p,d,_=(p=document.cookie)===null||p===void 0||((d=p.replace(/\s/g,""))===null||d===void 0)?void 0:d.split(";");_==null||_.map(function(F){var te=F.split("=");te[0]==="_educoder_session"&&j(te[1])})},[]);var w=function(){if(G.startsWith("http")||G.startsWith("/")){S();return}Object(Q.x)(ce||"educoder",G,ce)},S=function(){Object(Q.v)(ce||I,G)};return console.log("data:",G,"fileanme:",ce," name:",I),L.a.createElement("div",{style:Object(se.a)({},_e||{}),className:"".concat(we&&A.a.bgBlack," ").concat(Y?A.a.wrp:"hide")},Te&&L.a.createElement("div",{className:A.a.close,ref:N},L.a.createElement(xe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return N.current}},L.a.createElement("span",{onClick:S},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(xe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return N.current}},L.a.createElement("span",{className:"",onClick:Fe},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(A.a[Je]," ").concat(Je," ").concat(A.a.monaco," ").concat(Y==="txt"?"show":"hide")},Y==="txt"&&L.a.createElement(T.b,De)),Y==="audio"&&L.a.createElement("audio",{src:"".concat(G!=null&&G.startsWith("/")||(G==null?void 0:G.indexOf("https://"))>-1?G:"data:audio/mp3;base64,").concat(G),autoPlay:!0}),Y==="video"&&L.a.createElement(L.a.Fragment,null,G!=null&&G.startsWith("/")?L.a.createElement("video",{controls:!0,src:"".concat(G),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(G),autoPlay:!0})),Y==="html"&&L.a.createElement("iframe",{src:G+"&disposition=inline"}),Y==="pdf"&&L.a.createElement("embed",{className:A.a.embed,src:G}),Y==="image"&&L.a.createElement(L.a.Fragment,null,L.a.createElement("img",{src:"".concat(G!=null&&G.startsWith("/")||(G==null?void 0:G.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(G)})),Y==="other"&&L.a.createElement("div",null,L.a.createElement(he.a,{type:"primary",size:"large",onClick:w},L.a.createElement(R.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(Y==="download"||Y==="office")&&L.a.createElement(he.a,{type:"primary",size:"large",onClick:w},L.a.createElement(R.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,Ge,v){},"rAM+":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return he});var z=v("Qw5x");function he(oe,xe){var se;if(typeof Symbol=="undefined"||oe[Symbol.iterator]==null){if(Array.isArray(oe)||(se=Object(z.a)(oe))||xe&&oe&&typeof oe.length=="number"){se&&(oe=se);var V=0,k=function(){};return{s:k,n:function(){return V>=oe.length?{done:!0}:{done:!1,value:oe[V++]}},e:function(T){throw T},f:k}}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 L=!0,P=!1,A;return{s:function(){se=oe[Symbol.iterator]()},n:function(){var T=se.next();return L=T.done,T},e:function(T){P=!0,A=T},f:function(){try{!L&&se.return!=null&&se.return()}finally{if(P)throw A}}}}},rUJ1:function(nt,Ge){const v=/[&<>"']/,z=/[&<>"']/g,he=/[<>"']|&(?!#?\w+;)/,oe=/[<>"']|&(?!#?\w+;)/g,xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},se=we=>xe[we];function V(we,Se){if(Se){if(v.test(we))return we.replace(z,se)}else if(he.test(we))return we.replace(oe,se);return we}const k=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function L(we){return we.replace(k,(Se,Pe)=>(Pe=Pe.toLowerCase(),Pe==="colon"?":":Pe.charAt(0)==="#"?Pe.charAt(1)==="x"?String.fromCharCode(parseInt(Pe.substring(2),16)):String.fromCharCode(+Pe.substring(1)):""))}const P=/(^|[^\[])\^/g;function A(we,Se){we=we.source||we,Se=Se||"";const Pe={replace:(be,O)=>(O=O.source||O,O=O.replace(P,"$1"),we=we.replace(be,O),Pe),getRegex:()=>new RegExp(we,Se)};return Pe}const R=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Q(we,Se,Pe){if(we){let be;try{be=decodeURIComponent(L(Pe)).replace(R,"").toLowerCase()}catch(O){return null}if(be.indexOf("javascript:")===0||be.indexOf("vbscript:")===0||be.indexOf("data:")===0)return null}Se&&!T.test(Pe)&&(Pe=Y(Se,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(be){return null}return Pe}const H={},I=/^[^:]+:\/*[^/]*$/,G=/^([^:]+:)[\s\S]*$/,X=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Y(we,Se){H[" "+we]||(I.test(we)?H[" "+we]=we+"/":H[" "+we]=_e(we,"/",!0)),we=H[" "+we];const Pe=we.indexOf(":")===-1;return Se.substring(0,2)==="//"?Pe?Se:we.replace(G,"$1")+Se:Se.charAt(0)==="/"?Pe?Se:we.replace(X,"$1")+Se:we+Se}const ce={exec:function(){}};function De(we){let Se=1,Pe,be;for(;Se<arguments.length;Se++){Pe=arguments[Se];for(be in Pe)Object.prototype.hasOwnProperty.call(Pe,be)&&(we[be]=Pe[be])}return we}function Je(we,Se){const Pe=we.replace(/\|/g,(ue,J,x)=>{let j=!1,N=J;for(;--N>=0&&x[N]==="\\";)j=!j;return j?"|":" |"}),be=Pe.split(/ \|/);let O=0;if(be.length>Se)be.splice(Se);else for(;be.length<Se;)be.push("");for(;O<be.length;O++)be[O]=be[O].trim().replace(/\\\|/g,"|");return be}function _e(we,Se,Pe){const be=we.length;if(be===0)return"";let O=0;for(;O<be;){const ue=we.charAt(be-O-1);if(ue===Se&&!Pe)O++;else if(ue!==Se&&Pe)O++;else break}return we.substr(0,be-O)}function Te(we,Se){if(we.indexOf(Se[1])===-1)return-1;const Pe=we.length;let be=0,O=0;for(;O<Pe;O++)if(we[O]==="\\")O++;else if(we[O]===Se[0])be++;else if(we[O]===Se[1]&&(be--,be<0))return O;return-1}function Fe(we){we&&we.sanitize&&!we.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")}nt.exports={escape:V,unescape:L,edit:A,cleanUrl:Q,resolveUrl:Y,noopTest:ce,merge:De,splitCells:Je,rtrim:_e,findClosingBracket:Te,checkSanitizeDeprecation:Fe}},rcnY:function(nt,Ge,v){var z=v("aRTE");function he(oe,xe){this.totalCount=oe,this.dataCount=xe}he.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],he.getRSBlocks=function(oe,xe){var se=he.getRsBlockTable(oe,xe);if(se==null)throw new Error("bad rs block @ typeNumber:"+oe+"/errorCorrectLevel:"+xe);for(var V=se.length/3,k=new Array,L=0;L<V;L++)for(var P=se[L*3+0],A=se[L*3+1],R=se[L*3+2],T=0;T<P;T++)k.push(new he(A,R));return k},he.getRsBlockTable=function(oe,xe){switch(xe){case z.L:return he.RS_BLOCK_TABLE[(oe-1)*4+0];case z.M:return he.RS_BLOCK_TABLE[(oe-1)*4+1];case z.Q:return he.RS_BLOCK_TABLE[(oe-1)*4+2];case z.H:return he.RS_BLOCK_TABLE[(oe-1)*4+3];default:return}},nt.exports=he},ttuQ:function(nt,Ge,v){nt.exports={bg:"bg___3F6Km",name:"name___1NsJT",member:"member___2pzzt"}},vHTk:function(nt,Ge,v){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(nt,Ge){function v(){this.buffer=new Array,this.length=0}v.prototype={get:function(z){var he=Math.floor(z/8);return(this.buffer[he]>>>7-z%8&1)==1},put:function(z,he){for(var oe=0;oe<he;oe++)this.putBit((z>>>he-oe-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(z){var he=Math.floor(this.length/8);this.buffer.length<=he&&this.buffer.push(0),z&&(this.buffer[he]|=128>>>this.length%8),this.length++}},nt.exports=v},wzkS:function(nt,Ge,v){"use strict";v.d(Ge,"c",function(){return se}),v.d(Ge,"b",function(){return V}),v.d(Ge,"d",function(){return k}),v.d(Ge,"a",function(){return P}),v.d(Ge,"e",function(){return A});var z=v("9og8"),he=v("WmNS"),oe=v.n(he),xe=v("ErOA");function se(R){return Object(xe.c)("libraries/".concat(R,".json"))}function V(){return Object(xe.c)("library_tags.json")}function k(R){return L.apply(this,arguments)}function L(){return L=Object(z.a)(oe.a.mark(function R(T){var Q;return oe.a.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Object(xe.b)("attachments/".concat(T,".json"));case 2:return Q=I.sent,I.abrupt("return",Q.status===0);case 4:case"end":return I.stop()}},R)})),L.apply(this,arguments)}function P(R){return Object(xe.f)("libraries.json",R)}function A(R,T){return Object(xe.g)("libraries/".concat(R,".json"),T)}},y5JW:function(nt,Ge,v){"use strict";v.d(Ge,"c",function(){return G}),v.d(Ge,"a",function(){return X});var z=v("DZo9"),he=v("8z0m"),oe=v("+L6B"),xe=v("2/Rp"),se=v("9og8"),V=v("k1fw"),k=v("oBTY"),L=v("miYZ"),P=v("tsqr"),A=v("WmNS"),R=v.n(A),T=v("q1tI"),Q=v.n(T),H=v("m3rI"),I=v("wzkS"),G="\u3000\u3000";function X(Y){var ce=["Bytes","KB","MB","GB","TB"];if(Y==0)return"0 Byte";var De=parseInt(""+Math.floor(Math.log(Y)/Math.log(1024)),10);return(Y/Math.pow(1024,De)).toFixed(1)+" "+ce[De]}Ge.b=function(Y){var ce=Y.value,De=ce===void 0?[]:ce,Je=Y.action,_e=Y.onChange,Te=Y.className,Fe=Y.maxSize,we=Fe===void 0?150:Fe,Se=Y.title,Pe=Se===void 0?"\u6587\u4EF6\u4E0A\u4F20":Se,be=Y.accept,O=be===void 0?null:be,ue={multiple:!1,fileList:De,accept:O,withCredentials:!0,beforeUpload:function(j){var N=j.size/1024/1024;return N<we?!0:(P.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(we,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),Promise.reject())},action:"".concat(H.a.API_SERVER,"/api/attachments.json"),onChange:function(j){var N=Object(k.a)(j.fileList);N=N.map(function(w){return w.name.indexOf(G)===-1&&(w.name="".concat(w.name).concat(G).concat(X(w.size))),Object(V.a)({},w)}),_e(N)},onRemove:function(){var x=Object(se.a)(R.a.mark(function N(w){var S,p,d;return R.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(S=w.size/1024/1024,!(w.status==="uploading")){F.next=3;break}return F.abrupt("return",!0);case 3:if(S<we){F.next=7;break}return F.abrupt("return",!0);case 7:if(p=w.response?w.response.id:w.uid,!p){F.next=15;break}return F.next=11,Object(I.d)(w.response?w.response.id:w.id);case 11:return d=F.sent,F.abrupt("return",d);case 15:return F.abrupt("return",!0);case 16:case"end":return F.stop()}},N)}));function j(N){return x.apply(this,arguments)}return j}()};function J(x){x.preventDefault(),x.stopPropagation()}return Q.a.createElement("div",{className:"single-upload ".concat(Te||"")},Q.a.createElement(he.a,ue,Q.a.createElement(xe.a,{type:"primary",title:De.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:De.length>0,ghost:!0},Pe),Q.a.createElement("span",{onClick:J,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",we,"M) ")))}}}]);