(window.webpackJsonp=window.webpackJsonp||[]).push([[241,7],{"+NIl":function(xt,at,re){(function(ne){ne(re("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function($,_){"use strict";function V(L,w){L.cmdState.push(w)}function N(L){return L.cmdState.length>0?L.cmdState[L.cmdState.length-1]:null}function M(L){var w=L.cmdState.pop();w&&w.closeBracket()}function H(L){for(var w=L.cmdState,x=w.length-1;x>=0;x--){var u=w[x];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function F(L,w,x){return function(){this.name=L,this.bracketNo=0,this.style=w,this.styles=x,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=F("importmodule","tag",["string","builtin"]),P.documentclass=F("documentclass","tag",["","atom"]),P.usepackage=F("usepackage","tag",["atom"]),P.begin=F("begin","tag",["atom"]),P.end=F("end","tag",["atom"]),P.label=F("label","tag",["atom"]),P.ref=F("ref","tag",["atom"]),P.eqref=F("eqref","tag",["atom"]),P.cite=F("cite","tag",["atom"]),P.bibitem=F("bibitem","tag",["atom"]),P.Bibitem=F("Bibitem","tag",["atom"]),P.RBibitem=F("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function O(L,w){L.f=w}function b(L,w){var x;if(L.match(/^\\[a-zA-Z@]+/)){var u=L.current().slice(1);return x=P.hasOwnProperty(u)?P[u]:P.DEFAULT,x=new x,V(w,x),O(w,D),x.style}if(L.match(/^\\[$&%#{}_]/))return"tag";if(L.match(/^\\[,;!\/\\]/))return"tag";if(L.match("\\["))return O(w,function(l,h){return A(l,h,"\\]")}),"keyword";if(L.match("\\("))return O(w,function(l,h){return A(l,h,"\\)")}),"keyword";if(L.match("$$"))return O(w,function(l,h){return A(l,h,"$$")}),"keyword";if(L.match("$"))return O(w,function(l,h){return A(l,h,"$")}),"keyword";var a=L.next();if(a=="%")return L.skipToEnd(),"comment";if(a=="}"||a=="]"){if(x=N(w),x)x.closeBracket(a),O(w,D);else return"error";return"bracket"}else return a=="{"||a=="["?(x=P.DEFAULT,x=new x,V(w,x),"bracket"):/\d/.test(a)?(L.eatWhile(/[\w.%]/),"atom"):(L.eatWhile(/[\w\-_]/),x=H(w),x.name=="begin"&&(x.argument=L.current()),x.styleIdentifier())}function A(L,w,x){if(L.eatSpace())return null;if(x&&L.match(x))return O(w,b),"keyword";if(L.match(/^\\[a-zA-Z@]+/))return"tag";if(L.match(/^[a-zA-Z]+/))return"variable-2";if(L.match(/^\\[$&%#{}_]/))return"tag";if(L.match(/^\\[,;!\/]/))return"tag";if(L.match(/^[\^_&]/))return"tag";if(L.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(L.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=L.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(L.skipToEnd(),"comment"):"error"}function D(L,w){var x=L.peek(),u;return x=="{"||x=="["?(u=N(w),u.openBracket(x),L.eat(x),O(w,b),"bracket"):/[ \t\r]/.test(x)?(L.eat(x),null):(O(w,b),M(w),b(L,w))}return{startState:function(){var L=_.inMathMode?function(w,x){return A(w,x)}:b;return{cmdState:[],f:L}},copyState:function(L){return{cmdState:L.cmdState.slice(),f:L.f}},token:function(L,w){return w.f(L,w)},blankLine:function(L){L.f=b,L.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"19Vz":function(xt,at,re){(function(ne){ne(re("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(F,P,O){var b=O&&O!=ne.Init;if(P&&!b)F.on("blur",N),F.on("change",M),F.on("swapDoc",M),ne.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){V(F)}),M(F);else if(!P&&b){F.off("blur",N),F.off("change",M),F.off("swapDoc",M),ne.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),$(F);var A=F.getWrapperElement();A.className=A.className.replace(" CodeMirror-empty","")}P&&!F.hasFocus()&&N(F)});function $(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function _(F){$(F);var P=F.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=F.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var O=F.getOption("placeholder");typeof O=="string"&&(O=document.createTextNode(O)),P.appendChild(O),F.display.lineSpace.insertBefore(P,F.display.lineSpace.firstChild)}function V(F){setTimeout(function(){var P=!1,O=F.getInputField();O.nodeName=="TEXTAREA"?P=!O.value:F.lineCount()==1&&(P=!/[^\u200b]/.test(O.querySelector(".CodeMirror-line").textContent)),P?_(F):$(F)},20)}function N(F){H(F)&&_(F)}function M(F){var P=F.getWrapperElement(),O=H(F);P.className=P.className.replace(" CodeMirror-empty","")+(O?" CodeMirror-empty":""),O?_(F):$(F)}function H(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(xt,at,re){(function(ne){ne(re("VrN/"))})(function(ne){"use strict";var $={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},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(V,N){var M=V.indentUnit,H={},F=N.htmlMode?$:_;for(var P in F)H[P]=F[P];for(var P in N)H[P]=N[P];var O,b;function A(o,S){function y(G){return S.tokenize=G,G(o,S)}var T=o.next();if(T=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?y(w("atom","]]>")):null:o.match("--")?y(w("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),y(x(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),S.tokenize=w("meta","?>"),"meta"):(O=o.eat("/")?"closeTag":"openTag",S.tokenize=D,"tag bracket");if(T=="&"){var I;return o.eat("#")?o.eat("x")?I=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):I=o.eatWhile(/[\d]/)&&o.eat(";"):I=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),I?"atom":"error"}else return o.eatWhile(/[^&<]/),null}A.isInText=!0;function D(o,S){var y=o.next();if(y==">"||y=="/"&&o.eat(">"))return S.tokenize=A,O=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return O="equals",null;if(y=="<"){S.tokenize=A,S.state=h,S.tagName=S.tagStart=null;var T=S.tokenize(o,S);return T?T+" tag error":"tag error"}else return/[\'\"]/.test(y)?(S.tokenize=L(y),S.stringStartCol=o.column(),S.tokenize(o,S)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function L(o){var S=function(y,T){for(;!y.eol();)if(y.next()==o){T.tokenize=D;break}return"string"};return S.isInAttribute=!0,S}function w(o,S){return function(y,T){for(;!y.eol();){if(y.match(S)){T.tokenize=A;break}y.next()}return o}}function x(o){return function(S,y){for(var T;(T=S.next())!=null;){if(T=="<")return y.tokenize=x(o+1),y.tokenize(S,y);if(T==">")if(o==1){y.tokenize=A;break}else return y.tokenize=x(o-1),y.tokenize(S,y)}return"meta"}}function u(o,S,y){this.prev=o.context,this.tagName=S,this.indent=o.indented,this.startOfLine=y,(H.doNotIndent.hasOwnProperty(S)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function l(o,S){for(var y;;){if(!o.context)return;if(y=o.context.tagName,!H.contextGrabbers.hasOwnProperty(y)||!H.contextGrabbers[y].hasOwnProperty(S))return;a(o)}}function h(o,S,y){return o=="openTag"?(y.tagStart=S.column(),C):o=="closeTag"?g:h}function C(o,S,y){return o=="word"?(y.tagName=S.current(),b="tag",v):H.allowMissingTagName&&o=="endTag"?(b="tag bracket",v(o,S,y)):(b="error",C)}function g(o,S,y){if(o=="word"){var T=S.current();return y.context&&y.context.tagName!=T&&H.implicitlyClosed.hasOwnProperty(y.context.tagName)&&a(y),y.context&&y.context.tagName==T||H.matchClosing===!1?(b="tag",m):(b="tag error",k)}else return H.allowMissingTagName&&o=="endTag"?(b="tag bracket",m(o,S,y)):(b="error",k)}function m(o,S,y){return o!="endTag"?(b="error",m):(a(y),h)}function k(o,S,y){return b="error",m(o,S,y)}function v(o,S,y){if(o=="word")return b="attribute",f;if(o=="endTag"||o=="selfcloseTag"){var T=y.tagName,I=y.tagStart;return y.tagName=y.tagStart=null,o=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(T)?l(y,T):(l(y,T),y.context=new u(y,T,I==y.indented)),h}return b="error",v}function f(o,S,y){return o=="equals"?p:(H.allowMissing||(b="error"),v(o,S,y))}function p(o,S,y){return o=="string"?d:o=="word"&&H.allowUnquoted?(b="string",v):(b="error",v(o,S,y))}function d(o,S,y){return o=="string"?d:v(o,S,y)}return{startState:function(o){var S={tokenize:A,state:h,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(S.baseIndent=o),S},token:function(o,S){if(!S.tagName&&o.sol()&&(S.indented=o.indentation()),o.eatSpace())return null;O=null;var y=S.tokenize(o,S);return(y||O)&&y!="comment"&&(b=null,S.state=S.state(O||y,o,S),b&&(y=b=="error"?y+" error":b)),y},indent:function(o,S,y){var T=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+M;if(T&&T.noIndent)return ne.Pass;if(o.tokenize!=D&&o.tokenize!=A)return y?y.match(/^(\s*)/)[0].length:0;if(o.tagName)return H.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+M*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(o){o.state==p&&(o.state=v)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var S=[],y=o.context;y;y=y.prev)y.tagName&&S.push(y.tagName);return S.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"389U":function(xt,at,re){"use strict";re.r(at);var ne=re("+L6B"),$=re("2/Rp"),_=re("oBTY"),V=re("giR+"),N=re("fyUT"),M=re("5Dmo"),H=re("3S7+"),F=re("sRBo"),P=re("kaz8"),O=re("2qtc"),b=re("kLXV"),A=re("miYZ"),D=re("tsqr"),L=re("k1fw"),w=re("9og8"),x=re("tJVT"),u=re("PpiC"),a=re("5NDa"),l=re("5rEg"),h=re("OaEy"),C=re("2fM7"),g=re("WmNS"),m=re.n(g),k=re("q1tI"),v=re.n(k),f=re("9kvl"),p=re("Ot1p"),d=re("HBuW"),o=re("LvDl"),S=re.n(o),y=re("bNIU"),T=re.n(y),I=re("9ZNV"),G=re("fnXi"),X=re("nuEh"),Q=re("UqFu"),z=C.a.Option,W=l.a.TextArea,ee=function(pe){var ve=pe.shixunsDetail,De=pe.dispatch,xe=pe.match,Ce=pe.practiceSetting,Ae=Object(u.a)(pe,["shixunsDetail","dispatch","match","practiceSetting"]),Se=Object(k.useState)({}),ge=Object(x.a)(Se,2),oe=ge[0],Re=ge[1],Ze=Object(k.useState)([]),He=Object(x.a)(Ze,2),Ge=He[0],$e=He[1],_e=Object(k.useState)(!1),Ie=Object(x.a)(_e,2),We=Ie[0],Ve=Ie[1],ze=Object(k.useRef)(null),Be=Object(k.useRef)({editData:null,answerList:null}),Fe=Object(k.useState)(!0),ot=Object(x.a)(Fe,2),it=ot[0],Je=ot[1];Object(k.useEffect)(function(){qe()},[]),Object(k.useEffect)(function(){we()},[oe,Ge]);var qe=function(){var Te=Object(w.a)(m.a.mark(function Le(){return m.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return Je(!0),le.next=3,ct();case 3:return le.next=5,et();case 5:Je(!1);case 6:case"end":return le.stop()}},Le)}));return function(){return Te.apply(this,arguments)}}(),ct=function(){var Te=Object(w.a)(m.a.mark(function Le(){var fe;return m.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(d.H)({id:xe.params.id,challengeId:xe.params.challengesId,tab:2});case 2:fe=ue.sent,Be.current.editData=fe,fe&&Re(fe);case 5:case"end":return ue.stop()}},Le)}));return function(){return Te.apply(this,arguments)}}(),et=function(){var Te=Object(w.a)(m.a.mark(function Le(){var fe,le;return m.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(d.I)({id:xe.params.id,challengeId:xe.params.challengesId});case 2:fe=q.sent,le=fe.map(function(te){return Object(L.a)(Object(L.a)({},te),{},{contents:Object(Q.a)(te.contents)})}),Be.current.answerList=le,fe&&$e(le);case 6:case"end":return q.stop()}},Le)}));return function(){return Te.apply(this,arguments)}}(),Qe=function(){var Te=Object(w.a)(m.a.mark(function Le(){var fe,le,ue;return m.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:if(Ve(!0),fe=Ge.map(function(ie){return ie.score}),le=fe.reduce(function(ie,de){return ie+de},0),!(le!==100&&Ge!==null&&Ge!==void 0&&Ge.length)){te.next=7;break}return Ve(!1),D.b.info("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),te.abrupt("return");case 7:if(Ge.every(function(ie){return ie.name})){te.next=11;break}return Ve(!1),D.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u540D\u79F0"),te.abrupt("return");case 11:if(Ge.every(function(ie){return ie.contents})){te.next=15;break}return Ve(!1),D.b.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u5185\u5BB9"),te.abrupt("return");case 15:return te.next=17,Object(d.Lb)({id:xe.params.id,challengeId:xe.params.challengesId,challenge_answer:Ge,hide_answer:oe==null?void 0:oe.hide_answer,disable_copy:oe==null?void 0:oe.disable_copy});case 17:ue=te.sent,Ve(!1),De({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),ue!=null&&ue.message&&D.b.info(ue.message),ue.status===1&&f.d.push("/shixuns/".concat(xe.params.id,"/edit/").concat(xe.params.challengesId,"/tab=4"));case 22:case"end":return te.stop()}},Le)}));return function(){return Te.apply(this,arguments)}}(),we=function(){clearTimeout(ze.current),ze.current=setTimeout(lt,500)},lt=function(){!Object(o.isEqual)(Be.current.editData,oe)||!Object(o.isEqual)(Be.current.answerList,Ge)?De({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):De({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},tt=function(){var Le,fe=function(){f.d.push("/shixuns/".concat(xe.params.id,"/challenges")),De({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Ce!=null&&(Le=Ce.sideBar)!==null&&Le!==void 0&&Le.confirmLeave?b.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){fe()}}):fe()};return v.a.createElement("section",{className:T.a.bg},v.a.createElement("div",{className:T.a.formWrap},v.a.createElement(G.a,{activeIndex:2}),v.a.createElement("div",{className:T.a.check},v.a.createElement("div",null,v.a.createElement(P.a,{checked:oe==null?void 0:oe.hide_answer,onChange:function(Le){return Re(Object(L.a)(Object(L.a)({},oe),{},{hide_answer:Le.target.checked}))}},"\u9690\u85CF\u53C2\u8003\u7B54\u6848\u6A21\u5757")),v.a.createElement("div",null,v.a.createElement(P.a,{checked:oe==null?void 0:oe.disable_copy,onChange:function(Le){return Re(Object(L.a)(Object(L.a)({},oe),{},{disable_copy:Le.target.checked}))}},"\u7981\u6B62\u590D\u5236\u53C2\u8003\u7B54\u6848"))),v.a.createElement("div",{className:T.a.fieldWrap},v.a.createElement("p",null,"\u53EF\u4EE5\u5C06\u53C2\u8003\u7B54\u6848\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),v.a.createElement("p",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),v.a.createElement("p",null,"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002"),Ge==null?void 0:Ge.map(function(Te,Le){return v.a.createElement("div",{key:Le,className:"mt30 pb5"},v.a.createElement("div",{className:T.a.flexRow},v.a.createElement("b",{className:"font16"},"\u7EA7\u522B\uFF1A",Le+1),v.a.createElement("div",{className:"tr flex1"},v.a.createElement(H.a,{placement:"bottom",title:"\u5220\u9664"},v.a.createElement("span",{className:"font14 c-red current",onClick:function(){var le=Ge.filter(function(te,ie){return ie!==Le}),ue=Math.floor(100/le.length),q=ue+100%le.length;le=le.map(function(te,ie){return ie===le.length-1?Object(L.a)(Object(L.a)({},te),{},{score:q}):Object(L.a)(Object(L.a)({},te),{},{score:ue})}),$e(le)}},"\u5220\xA0\u9664")))),v.a.createElement("div",{className:T.a.contentWrap},v.a.createElement("div",{className:T.a.flexRow},v.a.createElement("div",null,v.a.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),v.a.createElement(l.a,{bordered:!1,value:Te.name,onChange:function(le){var ue=Ge.map(function(q,te){return te===Le?Object(L.a)(Object(L.a)({},q),{},{name:le.target.value}):q});$e(ue)}})),v.a.createElement("div",{className:"ml10"},v.a.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),v.a.createElement(N.a,{min:0,max:100,value:Te.score,onChange:function(le){var ue=Ge.map(function(q,te){return te===Le?Object(L.a)(Object(L.a)({},q),{},{score:le}):q});$e(ue)}})))),v.a.createElement("div",{className:"mt10 mb10"},v.a.createElement("div",{className:"font16 mb20"},"\u5185\u5BB9\uFF1A"),v.a.createElement(p.a,{placeholder:"\u5EFA\u8BAE\u63D0\u4F9B\u5305\u62EC\u6587\u4EF6\u6240\u6709\u4EE3\u7801\u7684\u5B8C\u6574\u7B54\u6848",defaultValue:Te.contents,onChange:function(le){var ue=Ge.map(function(q,te){return te===Le?Object(L.a)(Object(L.a)({},q),{},{contents:le}):q});$e(ue)}})))}),v.a.createElement("div",null,v.a.createElement($.a,{type:"primary",size:"large",ghost:!0,style:{width:200},className:"mt10",onClick:function(){var Le=[].concat(Object(_.a)(Ge),[{name:"\u89E3\u9898\u601D\u8DEF".concat(Ge.length+1),contents:"",score:0,id:null,level:null}]),fe=Math.floor(100/Le.length),le=fe+100%Le.length;Le=Le.map(function(ue,q){return q===Le.length-1?Object(L.a)(Object(L.a)({},ue),{},{score:le}):Object(L.a)(Object(L.a)({},ue),{},{score:fe})}),$e(Le)}},"\u65B0\u589E\u53C2\u8003\u7B54\u6848")))),v.a.createElement(I.a,{onOk:Qe,className:"customFixedButton",onCancel:tt,loading:We}),v.a.createElement(X.a,{loading:it}))};at.default=Object(f.a)(function(ae){var pe=ae.shixunsDetail,ve=ae.newCourse,De=ae.globalSetting,xe=ae.practiceSetting;return{shixunsDetail:pe,newCourse:ve,globalSetting:De,practiceSetting:xe}})(ee)},"7Cbv":function(xt,at,re){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function _(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne($)}var V=/^(?:[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 N(D){return typeof D=="string"&&V.test(D)}for(var M=N,H=[],F=0;F<256;++F)H.push((F+256).toString(16).substr(1));function P(D){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=(H[D[L+0]]+H[D[L+1]]+H[D[L+2]]+H[D[L+3]]+"-"+H[D[L+4]]+H[D[L+5]]+"-"+H[D[L+6]]+H[D[L+7]]+"-"+H[D[L+8]]+H[D[L+9]]+"-"+H[D[L+10]]+H[D[L+11]]+H[D[L+12]]+H[D[L+13]]+H[D[L+14]]+H[D[L+15]]).toLowerCase();if(!M(w))throw TypeError("Stringified UUID is invalid");return w}var O=P;function b(D,L,w){D=D||{};var x=D.random||(D.rng||_)();if(x[6]=x[6]&15|64,x[8]=x[8]&63|128,L){w=w||0;for(var u=0;u<16;++u)L[w+u]=x[u];return L}return O(x)}var A=at.a=b},"7ahc":function(xt,at,re){"use strict";re.d(at,"a",function(){return C});var ne=re("k1fw"),$=re("0Owb"),_=re("+L6B"),V=re("2/Rp"),N=re("y8nQ"),M=re("Vl3Y"),H=re("tJVT"),F=re("OaEy"),P=re("2fM7"),O=re("q1tI"),b=re.n(O),A=re("VrN/"),D=re.n(A),L=re("p77/"),w=re.n(L),x=re("c5Ni"),u=re.n(x),a=P.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};at.b=function(g){var m=g.callback,k=g.onCancel,v=Object(O.useState)("python"),f=Object(H.a)(v,2),p=f[0],d=f[1];function o(y){d(h[y][1])}function S(y){m(y)}return b.a.createElement(M.a,Object($.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(P.a,{onChange:o},Object.keys(h).map(function(y){return b.a.createElement(a,{key:y,value:y},h[y][0])}))),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(C,{mode:p})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(V.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function C(g){var m=g.value,k=g.onChange,v=g.mode,f=g.options,p=f===void 0?{}:f,d=Object(O.useRef)(),o=Object(O.useState)(),S=Object(H.a)(o,2),y=S[0],T=S[1];return Object(O.useEffect)(function(){if(y){function I(G){var X=G.getValue();k&&k(X)}return y.on("change",I),function(){y.off("change",I)}}},[y,k]),Object(O.useEffect)(function(){y&&y.setOption("mode",v)},[y,v]),Object(O.useEffect)(function(){y&&((m!==y.getValue()||m==="")&&setTimeout(function(){y.setValue(m||" ")},300))},[y,m]),Object(O.useEffect)(function(){if(d.current&&!y){var I=D.a.fromTextArea(d.current,Object(ne.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},p));T(I)}},[d.current,y]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:d}))}},"7ixt":function(xt,at,re){"use strict";re.d(at,"a",function(){return _});var ne={adjustX:1,adjustY:1},$=[0,0],_={left:{points:["cr","cl"],overflow:ne,offset:[-4,0],targetOffset:$},right:{points:["cl","cr"],overflow:ne,offset:[4,0],targetOffset:$},top:{points:["bc","tc"],overflow:ne,offset:[0,-4],targetOffset:$},bottom:{points:["tc","bc"],overflow:ne,offset:[0,4],targetOffset:$},topLeft:{points:["bl","tl"],overflow:ne,offset:[0,-4],targetOffset:$},leftTop:{points:["tr","tl"],overflow:ne,offset:[-4,0],targetOffset:$},topRight:{points:["br","tr"],overflow:ne,offset:[0,-4],targetOffset:$},rightTop:{points:["tl","tr"],overflow:ne,offset:[4,0],targetOffset:$},bottomRight:{points:["tr","br"],overflow:ne,offset:[0,4],targetOffset:$},rightBottom:{points:["bl","br"],overflow:ne,offset:[4,0],targetOffset:$},bottomLeft:{points:["tl","bl"],overflow:ne,offset:[0,4],targetOffset:$},leftBottom:{points:["br","bl"],overflow:ne,offset:[-4,0],targetOffset:$}},V=_},"8EBN":function(xt,at,re){(function(ne){ne(re("VrN/"))})(function(ne){"use strict";ne.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 $=0;$-1&&V.substring(H+1,V.length);if(F)return ne.findModeByExtension(F)},ne.findModeByName=function(V){V=V.toLowerCase();for(var N=0;N=R.length?Z.slice(R.length):Z}).join(`
`)}var u=[],a=[""],l=new L.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){u.length=0,a=[""]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(j,s,c,R){if(s>=j.length||j[s].level<=c)return s;var Z=j[s];R.push("- "+Z.text+""),s++;var U=[];return s=m(j,s,Z.level,U),U.length>0&&(R.push("
"),U.forEach(function(ce){R.push(ce)}),R.push("
")),R.push(" "),s=m(j,s,c,R),s}function k(){return m(u,0,0,a),a.push("
"),a.join("")}var v={heading:function(s){var c=h.exec(s);if(c)return{type:"heading",raw:c[0],depth:c[1].length,text:c[2]}},fences:function(s){var c=this.rules.block.fences.exec(s);if(c){var R=c[0],Z=x(R,c[3]||""),U=c[2]?c[2].trim():c[2];if(["latex","katex","math"].indexOf(U)>=0){var ce=d(),Oe=Z;Z=ce,o[ce]={type:"block",expression:Oe}}return{type:"code",raw:R,lang:U,text:Z}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,p=0,d=function(){return"__special_katext_id_".concat(p++,"__")},o={};function S(){return o}function y(){p=0,o={}}function T(j){return j=j.replace(f,function(s,c){var R=d();return o[R]={type:"inline",expression:c},R}),j}var I=l.listitem;l.listitem=function(j){return I(T(j))};var G=l.paragraph;l.paragraph=function(j){return G(T(j))};var X=l.tablecell;l.tablecell=function(j,s){return X(T(j),s)},l.code=function(j,s,c){var R=(s||"").match(/\S*/)[0];return R?["latex","katex","math"].indexOf(R)>=0?"".concat(j,"
"):'
').concat(c?j:Object(w.escape)(j,!0),`
`):''+(c?j:Object(w.escape)(j,!0))+"
"},l.heading=function(j,s,c){var R=this.options.headerPrefix+c.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:R,level:s,text:j}),"'+j+""},L.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),L.a.use({tokenizer:v,renderer:l});var Q=L.a,z=re("SJMd"),W=re("ulZh"),ee=re.n(W),ae=re("m3rI"),pe=re("Oy/b"),ve=re("p5ED"),De=re("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 xe=function(j,s){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,R){c.__proto__=R}||function(c,R){for(var Z in R)Object.prototype.hasOwnProperty.call(R,Z)&&(c[Z]=R[Z])})(j,s)};function Ce(j,s){function c(){this.constructor=j}xe(j,s),j.prototype=s===null?Object.create(s):(c.prototype=s.prototype,new c)}function Ae(j,s,c,R){return new(c||(c=Promise))(function(Z,U){function ce(dt){try{Ke(R.next(dt))}catch(Me){U(Me)}}function Oe(dt){try{Ke(R.throw(dt))}catch(Me){U(Me)}}function Ke(dt){var Me;dt.done?Z(dt.value):(Me=dt.value,Me instanceof c?Me:new c(function(vt){vt(Me)})).then(ce,Oe)}Ke((R=R.apply(j,s||[])).next())})}function Se(j,s){var c,R,Z,U,ce={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return U={next:Oe(0),throw:Oe(1),return:Oe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Oe(Ke){return function(dt){return function(Me){if(c)throw new TypeError("Generator is already executing.");for(;ce;)try{if(c=1,R&&(Z=2&Me[0]?R.return:Me[0]?R.throw||((Z=R.return)&&Z.call(R),0):R.next)&&!(Z=Z.call(R,Me[1])).done)return Z;switch(R=0,Z&&(Me=[2&Me[0],Z.value]),Me[0]){case 0:case 1:Z=Me;break;case 4:return ce.label++,{value:Me[1],done:!1};case 5:ce.label++,R=Me[1],Me=[0];continue;case 7:Me=ce.ops.pop(),ce.trys.pop();continue;default:if(!(Z=ce.trys,(Z=Z.length>0&&Z[Z.length-1])||Me[0]!==6&&Me[0]!==2)){ce=0;continue}if(Me[0]===3&&(!Z||Me[1]>Z[0]&&Me[1]',"select"),this.addActionButton(R,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(R,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(R,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(R,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(R,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(R,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(R,'',"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(U){var ce=document.createElement("div");ce.className=""+c.toolbarButtonStyleClass.name,ce.setAttribute("data-type-name",U.typeName),ce.innerHTML=U.icon,ce.addEventListener("click",function(){c.markerToolbarButtonClicked(ce,U)}),c.buttons.push(ce),c.markerButtons.push(ce)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Z=document.createElement("div");Z.className=this.toolbarBlockStyleClass.name,Z.style.whiteSpace="nowrap",Z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Z),this.addActionButton(Z,'',"render"),this.addActionButton(Z,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},j.prototype.addButtonClickListener=function(s){this.buttonClickListeners.push(s)},j.prototype.removeButtonClickListener=function(s){this.buttonClickListeners.indexOf(s)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(s),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var s=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var c=0;c0&&this.buttonClickListeners.forEach(function(R){return R("marker",c)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(s,c){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(R){return R("action",c)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},j.prototype.setActiveButton=function(s){this.resetButtonStyles(),s.className=s.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),s.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},j.prototype.setActiveMarkerButton=function(s){var c=this.markerButtons.find(function(R){return R.getAttribute("data-type-name")===s});c&&this.setActiveButton(c)},j.prototype.setCurrentMarker=function(s){var c=this;this.currentMarker=s,this.buttons.filter(function(R){return/delete|notes/.test(R.getAttribute("data-action"))}).forEach(function(R){c.currentMarker===void 0?(R.style.fillOpacity="0.4",R.style.pointerEvents="none"):(R.style.fillOpacity="1",R.style.pointerEvents="all")})},j}(),We=function(){function j(s,c,R,Z){this.panels=[],this.panelButtons=[],this.markerjsContainer=s,this.displayMode=c,this.uiStyleSettings=R,this.styles=Z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var s;this.toolboxStyleClass=this.styles.addClass(new _e("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 _e("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var c=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new _e("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new _e("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new _e("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 _e("toolbox-panel-row_colors",`
background-color: `+((s=this.uiStyleSettings.toolboxBackgroundColor)!==null&&s!==void 0?s:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new _e("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*c)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*c)+`px;
padding: `+c+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new _e("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new _e("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},j.prototype.show=function(s){var c;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolboxStyleClass.name+" "+((c=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&c!==void 0?c:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(s){var c,R,Z=this;this.panels=s,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((c=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&c!==void 0?c:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((R=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var ce;U.uiStyleSettings=Z.uiStyleSettings;var Oe=document.createElement("div");Oe.className=Z.toolboxButtonStyleClass.name+" "+((ce=Z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ce!==void 0?ce:Z.toolboxButtonStyleColorsClass.name),Oe.innerHTML=U.icon,Oe.title=U.title,Oe.addEventListener("click",function(){Z.panelButtonClick(U)}),Z.panelButtons.push(Oe),Z.buttonRow.appendChild(Oe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(s){var c=this,R=-1;if(s!==this.activePanel){R=this.panels.indexOf(s),this.panelRow.innerHTML="";var Z=s.getUi();Z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Z),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=s}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){c.displayMode==="inline"?c.panelRow.style.display="none":c.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,ce){var Oe,Ke;U.className=c.toolboxButtonStyleClass.name+" "+(ce===R?""+((Oe=c.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Oe!==void 0?Oe:c.toolboxActiveButtonStyleColorsClass.name):""+((Ke=c.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:c.toolboxButtonStyleColorsClass.name))})},j}(),Ve=function(j,s){this.title=j,this.icon=s},ze=function(j){function s(c,R,Z,U){var ce=j.call(this,c,U||'')||this;return ce.colors=[],ce.addTransparent=!1,ce.colorBoxes=[],ce.colors=R,ce.currentColor=Z,ce.setCurrentColor=ce.setCurrentColor.bind(ce),ce.getColorBox=ce.getColorBox.bind(ce),ce}return Ce(s,j),s.prototype.getUi=function(){var c=this,R=document.createElement("div");return R.style.overflow="hidden",R.style.whiteSpace="nowrap",this.colors.forEach(function(Z){var U=c.getColorBox(Z);R.appendChild(U),c.colorBoxes.push(U)}),R},s.prototype.getColorBox=function(c){var R=this,Z=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-Z,ce=document.createElement("div");ce.style.display="inline-block",ce.style.boxSizing="content-box",ce.style.width=U-2+"px",ce.style.height=U-2+"px",ce.style.padding="1px",ce.style.marginRight="2px",ce.style.marginBottom="2px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderRadius=(U+2)/2+"px",ce.style.borderColor=c===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){R.setCurrentColor(c,ce)});var Oe=document.createElement("div");return Oe.style.display="inline-block",Oe.style.width=U-2+"px",Oe.style.height=U-2+"px",Oe.style.backgroundColor=c,Oe.style.borderRadius=U/2+"px",c==="transparent"&&(Oe.style.fill=this.uiStyleSettings.toolboxAccentColor,Oe.innerHTML=``),ce.appendChild(Oe),ce},s.prototype.setCurrentColor=function(c,R){var Z=this;this.currentColor=c,this.colorBoxes.forEach(function(U){U.style.borderColor=U===R?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(c)},s}(Ve),Be=function(){function j(s,c,R){this._state="new",this._isSelected=!1,this._container=s,this._overlayContainer=c,this.globalSettings=R,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(s){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(s,c){},j.prototype.dblClick=function(s,c){},j.prototype.manipulate=function(s){},j.prototype.pointerUp=function(s){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(s){this.container.childNodes.length>0?this.container.insertBefore(s,this.container.childNodes[0]):this.container.appendChild(s)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(s){this._state=s.state,this.notes=s.notes},j.prototype.scale=function(s,c){},j.prototype.colorChanged=function(s){this.onColorChanged&&this.onColorChanged(s),this.stateChanged()},j.prototype.fillColorChanged=function(s){this.onFillColorChanged&&this.onFillColorChanged(s),this.stateChanged()},j.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var s=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),s.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(s)&&this.onStateChanged(this)}},j.typeName="MarkerBase",j}(),Fe=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.prototype.findGripByVisual=function(s){return this.topLeft.ownsTarget(s)?this.topLeft:this.topCenter.ownsTarget(s)?this.topCenter:this.topRight.ownsTarget(s)?this.topRight:this.centerLeft.ownsTarget(s)?this.centerLeft:this.centerRight.ownsTarget(s)?this.centerRight:this.bottomLeft.ownsTarget(s)?this.bottomLeft:this.bottomCenter.ownsTarget(s)?this.bottomCenter:this.bottomRight.ownsTarget(s)?this.bottomRight:void 0},j}(),ot=function(){function j(){this.GRIP_SIZE=10,this.visual=oe.createGroup(),this.visual.appendChild(oe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(oe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},j}(),it=function(){function j(){}return j.toITransformMatrix=function(s){return{a:s.a,b:s.b,c:s.c,d:s.d,e:s.e,f:s.f}},j.toSVGMatrix=function(s,c){return s.a=c.a,s.b=c.b,s.c=c.c,s.d=c.d,s.e=c.e,s.f=c.f,s},j}(),Je=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.left=0,U.top=0,U.width=0,U.height=0,U.defaultSize={x:50,y:20},U.offsetX=0,U.offsetY=0,U.rotationAngle=0,U.CB_DISTANCE=10,U._suppressMarkerCreateEvent=!1,U.container.transform.baseVal.appendItem(oe.createTransform()),U.setupControlBox(),U}return Ce(s,j),Object.defineProperty(s.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visual",{get:function(){return this._visual},set:function(c){this._visual=c;var R=oe.createTransform();this._visual.transform.baseVal.appendItem(R)},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(c){return!!j.prototype.ownsTarget.call(this,c)||!!(this.controlGrips.findGripByVisual(c)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(c))},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.state==="new"&&(this.left=c.x,this.top=c.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Z=this.unrotatePoint(c);if(this.manipulationStartX=Z.x,this.manipulationStartY=Z.y,this.offsetX=Z.x-this.left,this.offsetY=Z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(R),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(R)){this.activeGrip=this.rotatorGrip;var U=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=U.x-this.width/2,this.top=U.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ce=this.container.transform.baseVal.getItem(0);ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},s.prototype.pointerUp=function(c){var R=this.state;j.prototype.pointerUp.call(this,c),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(c),this._state="select",R==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},s.prototype.moveVisual=function(c){this.visual.style.transform="translate("+c.x+"px, "+c.y+"px)"},s.prototype.manipulate=function(c){var R=this.unrotatePoint(c);this.state==="creating"?this.resize(c):this.state==="move"?(this.left=this.manipulationStartLeft+(R.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(R.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(R):this.state==="rotate"&&this.rotate(c)},s.prototype.resize=function(c){var R=this.manipulationStartLeft,Z=this.manipulationStartWidth,U=this.manipulationStartTop,ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:R=this.manipulationStartLeft+c.x-this.manipulationStartX,Z=this.manipulationStartWidth+this.manipulationStartLeft-R;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Z=this.manipulationStartWidth+c.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+c.y-this.manipulationStartY,ce=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ce=this.manipulationStartHeight+c.y-this.manipulationStartY}Z>=0?(this.left=R,this.width=Z):(this.left=R+Z,this.width=-Z),ce>=0?(this.top=U,this.height=ce):(this.top=U+ce,this.height=-ce),this.setSize()},s.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},s.prototype.rotate=function(c){if(Math.abs(c.x-this.centerX)>.1){var R=Math.sign(c.x-this.centerX);this.rotationAngle=180*Math.atan((c.y-this.centerY)/(c.x-this.centerX))/Math.PI+90*R,this.applyRotation()}},s.prototype.applyRotation=function(){var c=this.container.transform.baseVal.getItem(0);c.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(c,0)},s.prototype.rotatePoint=function(c){if(this.rotationAngle===0)return c;var R=this.container.getCTM(),Z=oe.createPoint(c.x,c.y);return{x:(Z=Z.matrixTransform(R)).x,y:Z.y}},s.prototype.unrotatePoint=function(c){if(this.rotationAngle===0)return c;var R=this.container.getCTM();R=R.inverse();var Z=oe.createPoint(c.x,c.y);return{x:(Z=Z.matrixTransform(R)).x,y:Z.y}},s.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=oe.createGroup();var c=oe.createTransform();c.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(c),this.container.appendChild(this.controlBox),this.controlRect=oe.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=oe.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 Fe,this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){var c=this.controlBox.transform.baseVal.getItem(0);c.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(c,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()},s.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()},s.prototype.createGrip=function(){var c=new ot;return c.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(c.visual),c},s.prototype.positionGrips=function(){var c=this.controlGrips.topLeft.GRIP_SIZE,R=-c/2,Z=R,U=(this.width+this.CB_DISTANCE)/2-c/2,ce=(this.height+this.CB_DISTANCE)/2-c/2,Oe=this.height+this.CB_DISTANCE-c/2,Ke=this.width+this.CB_DISTANCE-c/2;this.positionGrip(this.controlGrips.topLeft.visual,R,Z),this.positionGrip(this.controlGrips.topCenter.visual,U,Z),this.positionGrip(this.controlGrips.topRight.visual,Ke,Z),this.positionGrip(this.controlGrips.centerLeft.visual,R,ce),this.positionGrip(this.controlGrips.centerRight.visual,Ke,ce),this.positionGrip(this.controlGrips.bottomLeft.visual,R,Oe),this.positionGrip(this.controlGrips.bottomCenter.visual,U,Oe),this.positionGrip(this.controlGrips.bottomRight.visual,Ke,Oe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,Z-3*this.CB_DISTANCE)},s.prototype.positionGrip=function(c,R,Z){var U=c.transform.baseVal.getItem(0);U.setTranslate(R,Z),c.transform.baseVal.replaceItem(U,0)},s.prototype.hideControlBox=function(){this.controlBox.style.display="none"},s.prototype.showControlBox=function(){this.controlBox.style.display=""},s.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:it.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:it.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},s.prototype.restoreState=function(c){j.prototype.restoreState.call(this,c);var R=c;this.left=R.left,this.top=R.top,this.width=R.width,this.height=R.height,this.rotationAngle=R.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,R.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,R.containerTransformMatrix))},s.prototype.scale=function(c,R){j.prototype.scale.call(this,c,R);var Z=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:Z.x*c,y:Z.y*R});this.left=U.x,this.top=U.y,this.width=this.width*c,this.height=this.height*R,this.adjustControlBox()},s}(Be),qe=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.createVisual=U.createVisual.bind(U),U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.visual)},s.prototype.createVisual=function(){this.visual=oe.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)},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.state==="new"&&(this.createVisual(),this.moveVisual(c),this._state="creating")},s.prototype.manipulate=function(c){j.prototype.manipulate.call(this,c)},s.prototype.resize=function(c){j.prototype.resize.call(this,c),this.setSize()},s.prototype.setSize=function(){j.prototype.setSize.call(this),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(c){j.prototype.pointerUp.call(this,c),this.setSize()},s.prototype.setStrokeColor=function(c){this.strokeColor=c,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(c),this.stateChanged()},s.prototype.setFillColor=function(c){this.fillColor=c,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},s.prototype.setStrokeWidth=function(c){this.strokeWidth=c,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(c){this.strokeDasharray=c,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this))},s.prototype.restoreState=function(c){var R=c;this.fillColor=R.fillColor,this.strokeColor=R.strokeColor,this.strokeWidth=R.strokeWidth,this.strokeDasharray=R.strokeDasharray,this.opacity=R.opacity,this.createVisual(),j.prototype.restoreState.call(this,c),this.setSize()},s.prototype.scale=function(c,R){j.prototype.scale.call(this,c,R),this.setSize()},s.title="Rectangle marker",s}(Je),ct=function(j){function s(c,R,Z,U){var ce=j.call(this,c,U||'')||this;return ce.widths=[],ce.widthBoxes=[],ce.widths=R,ce.currentWidth=Z,ce.setCurrentWidth=ce.setCurrentWidth.bind(ce),ce}return Ce(s,j),s.prototype.getUi=function(){var c=this,R=document.createElement("div");return R.style.display="flex",R.style.overflow="hidden",R.style.flexGrow="2",this.widths.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.flexGrow="2",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=Z===c.currentWidth?c.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){c.setCurrentWidth(Z,U)}),R.appendChild(U);var ce=document.createElement("div");ce.innerText=Z.toString(),ce.style.marginRight="5px",U.appendChild(ce);var Oe=document.createElement("div");Oe.style.minHeight="20px",Oe.style.flexGrow="2",Oe.style.display="flex",Oe.style.alignItems="center";var Ke=document.createElement("hr");Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop=Z+"px solid "+c.uiStyleSettings.toolboxColor,Ke.style.flexGrow="2",Oe.appendChild(Ke),U.appendChild(Oe),c.widthBoxes.push(U)}),R},s.prototype.setCurrentWidth=function(c,R){var Z=this;this.currentWidth=c,this.widthBoxes.forEach(function(U){U.style.borderColor=U===R?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},s}(Ve),et=function(j){function s(c,R,Z,U){var ce=j.call(this,c,U||'')||this;return ce.styles=[],ce.styleBoxes=[],ce.styles=R,ce.currentStyle=Z,ce.setCurrentStyle=ce.setCurrentStyle.bind(ce),ce}return Ce(s,j),s.prototype.getUi=function(){var c=this,R=document.createElement("div");return R.style.display="flex",R.style.overflow="hidden",R.style.flexGrow="2",this.styles.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/c.styles.length-5+"%",U.style.borderColor=Z===c.currentStyle?c.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){c.setCurrentStyle(Z,U)}),R.appendChild(U);var ce=document.createElement("div");ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.overflow="hidden";var Oe=``;ce.innerHTML=Oe,U.appendChild(ce),c.styleBoxes.push(U)}),R},s.prototype.setCurrentStyle=function(c,R){var Z=this;this.currentStyle=c,this.styleBoxes.forEach(function(U){U.style.borderColor=U===R?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},s}(Ve),Qe=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ze("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new et("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ce(s,j),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=j.prototype.getState.call(this);return c.typeName=s.typeName,c},s.typeName="FrameMarker",s.title="Frame marker",s.icon='',s}(qe),we=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},lt=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.x1=0,U.y1=0,U.x2=0,U.y2=0,U.defaultLength=50,U.manipulationStartX=0,U.manipulationStartY=0,U.manipulationStartX1=0,U.manipulationStartY1=0,U.manipulationStartX2=0,U.manipulationStartY2=0,U.setupControlBox(),U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!!j.prototype.ownsTarget.call(this,c)||!(!this.grip1.ownsTarget(c)&&!this.grip2.ownsTarget(c))},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.manipulationStartX=c.x,this.manipulationStartY=c.y,this.state==="new"&&(this.x1=c.x,this.y1=c.y,this.x2=c.x,this.y2=c.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(R)?this.activeGrip=this.grip1:this.grip2.ownsTarget(R)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},s.prototype.pointerUp=function(c){var R=this.state;j.prototype.pointerUp.call(this,c),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(c),this._state="select",R==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},s.prototype.adjustVisual=function(){},s.prototype.manipulate=function(c){this.state==="creating"?this.resize(c):this.state==="move"?(this.x1=this.manipulationStartX1+c.x-this.manipulationStartX,this.y1=this.manipulationStartY1+c.y-this.manipulationStartY,this.x2=this.manipulationStartX2+c.x-this.manipulationStartX,this.y2=this.manipulationStartY2+c.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(c)},s.prototype.resize=function(c){switch(this.activeGrip){case this.grip1:this.x1=c.x,this.y1=c.y;break;case this.grip2:case void 0:this.x2=c.x,this.y2=c.y}this.adjustVisual(),this.adjustControlBox()},s.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=oe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){this.positionGrips()},s.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},s.prototype.createGrip=function(){var c=new ot;return c.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(c.visual),c},s.prototype.positionGrips=function(){var c=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-c/2,this.y1-c/2),this.positionGrip(this.grip2.visual,this.x2-c/2,this.y2-c/2)},s.prototype.positionGrip=function(c,R,Z){var U=c.transform.baseVal.getItem(0);U.setTranslate(R,Z),c.transform.baseVal.replaceItem(U,0)},s.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},s.prototype.restoreState=function(c){j.prototype.restoreState.call(this,c);var R=c;this.x1=R.x1,this.y1=R.y1,this.x2=R.x2,this.y2=R.y2},s.prototype.scale=function(c,R){j.prototype.scale.call(this,c,R),this.x1=this.x1*c,this.y1=this.y1*R,this.x2=this.x2*c,this.y2=this.y2*R,this.adjustVisual(),this.adjustControlBox()},s}(Be),tt=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ze("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new et("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.visual&&c!==this.selectorLine&&c!==this.visibleLine)},s.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=oe.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)},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},s.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()),oe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setStrokeColor=function(c){this.strokeColor=c,this.adjustVisual(),this.colorChanged(c)},s.prototype.setStrokeWidth=function(c){this.strokeWidth=c,this.adjustVisual()},s.prototype.setStrokeDasharray=function(c){this.strokeDasharray=c,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){j.prototype.restoreState.call(this,c);var R=c;this.strokeColor=R.strokeColor,this.strokeWidth=R.strokeWidth,this.strokeDasharray=R.strokeDasharray,this.createVisual(),this.adjustVisual()},s.typeName="LineMarker",s.title="Line marker",s.icon='',s}(lt),Te=function(j){function s(c,R,Z,U){var ce=j.call(this,c,U||'')||this;return ce.fonts=[],ce.fontBoxes=[],ce.fonts=R,ce.currentFont=Z,ce.setCurrentFont=ce.setCurrentFont.bind(ce),ce}return Ce(s,j),s.prototype.getUi=function(){var c=this,R=document.createElement("div");return R.style.overflow="hidden",R.style.flexGrow="2",this.fonts.forEach(function(Z){var U=document.createElement("div");U.style.display="inline-block",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/c.fonts.length-5+"%",U.style.borderColor=Z===c.currentFont?c.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){c.setCurrentFont(Z,U)}),R.appendChild(U);var ce=document.createElement("div");ce.style.display="flex",ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.fontFamily=Z,ce.style.overflow="hidden";var Oe=document.createElement("div");Oe.style.whiteSpace="nowrap",Oe.style.overflow="hidden",Oe.style.textOverflow="ellipsis",Oe.innerHTML="The quick brown fox jumps over the lazy dog",ce.appendChild(Oe),U.appendChild(ce),c.fontBoxes.push(U)}),R},s.prototype.setCurrentFont=function(c,R){var Z=this;this.currentFont=c,this.fontBoxes.forEach(function(U){U.style.borderColor=U===R?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},s}(Ve),Le=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.color="transparent",U.padding=5,U.DEFAULT_TEXT="your text here",U.text=U.DEFAULT_TEXT,U.isMoved=!1,U.color=Z.defaultColor,U.fontFamily=Z.defaultFontFamily,U.defaultSize={x:100,y:30},U.setColor=U.setColor.bind(U),U.setFont=U.setFont.bind(U),U.renderText=U.renderText.bind(U),U.sizeText=U.sizeText.bind(U),U.textEditDivClicked=U.textEditDivClicked.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.setSize=U.setSize.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.colorPanel=new ze("Color",Z.defaultColorSet,Z.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.fontFamilyPanel=new Te("Font",Z.defaultFontFamilies,Z.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U}return Ce(s,j),s.prototype.ownsTarget=function(c){if(j.prototype.ownsTarget.call(this,c)||c===this.visual||c===this.textElement||c===this.bgRectangle)return!0;var R=!1;return this.textElement.childNodes.forEach(function(Z){Z===c&&(R=!0)}),R},s.prototype.createVisual=function(){this.visual=oe.createGroup(),this.bgRectangle=oe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=oe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.isMoved=!1,this.pointerDownPoint=c,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(c),this._state="creating")},s.prototype.renderText=function(){var c=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(R){c.textElement.appendChild(oe.createTSpan(R.trim()===""?" ":R.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},s.prototype.getTextScale=function(){var c=this.textElement.getBBox(),R=1;if(c.width>0&&c.height>0){var Z=(1*this.width-this.width*this.padding*2/100)/c.width,U=(1*this.height-this.height*this.padding*2/100)/c.height;R=Math.min(Z,U)}return R},s.prototype.getTextPosition=function(c){var R=this.textElement.getBBox(),Z=0,U=0;return R.width>0&&R.height>0&&(Z=(this.width-R.width*c)/2,U=this.height/2-R.height*c/2),{x:Z,y:U}},s.prototype.sizeText=function(){var c=this.textElement.getBBox(),R=this.getTextScale(),Z=this.getTextPosition(R);Z.y-=c.y*R,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Z.x+"px, "+Z.y+"px) scale("+R+", "+R+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Z.x,Z.y),this.textElement.transform.baseVal.getItem(1).setScale(R,R))},s.prototype.manipulate=function(c){j.prototype.manipulate.call(this,c),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(c.x-this.pointerDownPoint.x)>5||Math.abs(c.y-this.pointerDownPoint.y)>5)},s.prototype.resize=function(c){j.prototype.resize.call(this,c),this.isMoved=!0,this.setSize(),this.sizeText()},s.prototype.setSize=function(){j.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},s.prototype.pointerUp=function(c){var R=this.state;R==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,c),this.setSize(),(R==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},s.prototype.showTextEditor=function(){var c=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(R){R.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var R=Number.parseFloat(c.textEditor.style.fontSize);c.textEditor.clientWidth>=Number.parseInt(c.textEditor.style.maxWidth)&&R>.9;)R-=.1,c.textEditor.style.fontSize=Math.max(R,.9)+"em"}),this.textEditor.addEventListener("keyup",function(R){R.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(R){if(R.clipboardData){var Z=R.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(Z)),R.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){c.textEditDivClicked(c.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},s.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var c=this.getTextScale(),R=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Z=this.textElement.getBBox(),U={x:Z.width*c,y:Z.height*c};R.x-=U.x/2,R.y-=U.y/2,this.textEditor.style.top=R.y+"px",this.textEditor.style.left=R.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-R.x+"px",this.textEditor.style.fontSize=Math.max(16*c,12)+"px",this.textElement.style.display="none"}},s.prototype.textEditDivClicked=function(c){this.text=c.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},s.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},s.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},s.prototype.dblClick=function(c,R){j.prototype.dblClick.call(this,c,R),this.showTextEditor()},s.prototype.setColor=function(c){this.textElement&&oe.setAttributes(this.textElement,[["fill",c]]),this.color=c,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(c)},s.prototype.setFont=function(c){this.textElement&&oe.setAttributes(this.textElement,[["font-family",c]]),this.fontFamily=c,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},s.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},s.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){var R=c;this.color=R.color,this.fontFamily=R.fontFamily,this.padding=R.padding,this.text=R.text,this.createVisual(),j.prototype.restoreState.call(this,c),this.setSize()},s.prototype.scale=function(c,R){j.prototype.scale.call(this,c,R),this.setSize(),this.sizeText(),this.positionTextEditor()},s.typeName="TextMarker",s.title="Text marker",s.icon='',s}(Je),fe=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=Z.defaultColor,U.lineWidth=Z.defaultStrokeWidth,U.pixelRatio=Z.freehandPixelRatio,U.setColor=U.setColor.bind(U),U.addCanvas=U.addCanvas.bind(U),U.finishCreation=U.finishCreation.bind(U),U.setLineWidth=U.setLineWidth.bind(U),U.colorPanel=new ze("Color",Z.defaultColorSet,Z.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new ct("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.visual&&c!==this.drawingImage)},s.prototype.createVisual=function(){this.visual=oe.createGroup(),this.drawingImage=oe.createImage(),this.visual.appendChild(this.drawingImage);var c=oe.createTransform();this.visual.transform.baseVal.appendItem(c),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(c,R){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(c.x,c.y),this.drawing=!0):j.prototype.pointerDown.call(this,c,R)},s.prototype.manipulate=function(c){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(c.x,c.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,c)},s.prototype.resize=function(c){j.prototype.resize.call(this,c),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(c){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,c)},s.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)},s.prototype.select=function(){this.state==="creating"&&this.finishCreation(),j.prototype.select.call(this)},s.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},s.prototype.finishCreation=function(){for(var c=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),R=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Z=R[0],U=R[1],ce=R[2],Oe=R[3],Ke=!1,dt=0;dt0&&(Ke=!0,dtOe&&(Oe=dt),Me>ce&&(ce=Me));if(Ke){this.left=Z/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(ce-Z)/this.pixelRatio,this.height=(Oe-U)/this.pixelRatio;var vt=document.createElement("canvas");vt.width=ce-Z,vt.height=Oe-U,vt.getContext("2d").putImageData(this.canvasContext.getImageData(Z,U,ce-Z,Oe-U),0,0),this.drawingImgUrl=vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},s.prototype.setDrawingImage=function(){oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},s.prototype.setColor=function(c){this.color=c,this.colorChanged(c)},s.prototype.setLineWidth=function(c){this.lineWidth=c},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){this.createVisual(),j.prototype.restoreState.call(this,c),this.drawingImgUrl=c.drawingImgUrl,this.setDrawingImage()},s.prototype.scale=function(c,R){j.prototype.scale.call(this,c,R),this.setDrawingImage()},s.typeName="FreehandMarker",s.title="Freehand marker",s.icon='',s}(Je),le=function(j){function s(c,R,Z){var U=j.call(this,c,Z||'')||this;return U.typeBoxes=[],U.currentType=R,U.setCurrentType=U.setCurrentType.bind(U),U}return Ce(s,j),s.prototype.getUi=function(){var c=this,R=document.createElement("div");R.style.display="flex",R.style.overflow="hidden",R.style.flexGrow="2";for(var Z=function(Oe){var Ke="both";switch(Oe){case 0:Ke="both";break;case 1:Ke="start";break;case 2:Ke="end";break;case 3:Ke="none"}var dt=document.createElement("div");if(dt.style.display="flex",dt.style.flexGrow="2",dt.style.alignItems="center",dt.style.justifyContent="space-between",dt.style.padding="5px",dt.style.borderWidth="2px",dt.style.borderStyle="solid",dt.style.borderColor=Ke===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",dt.addEventListener("click",function(){c.setCurrentType(Ke,dt)}),R.appendChild(dt),Ke==="both"||Ke==="start"){var Me=document.createElement("div");Me.style.display="flex",Me.style.alignItems="center",Me.style.minHeight="20px",Me.innerHTML=``,Me.style.marginLeft="5px",dt.appendChild(Me)}var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.style.flexGrow="2";var Nt=document.createElement("hr");if(Nt.style.minWidth="20px",Nt.style.border="0px",Nt.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Nt.style.flexGrow="2",vt.appendChild(Nt),dt.appendChild(vt),Ke==="both"||Ke==="end"){var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.innerHTML=``,Kt.style.marginRight="5px",dt.appendChild(Kt)}U.typeBoxes.push(dt)},U=this,ce=0;ce<4;ce++)Z(ce);return R},s.prototype.setCurrentType=function(c,R){var Z=this;this.currentType=c,this.typeBoxes.forEach(function(U){U.style.borderColor=U===R?Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},s}(Ve),ue=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.arrowType="end",U.arrowBaseHeight=10,U.arrowBaseWidth=10,U.getArrowPoints=U.getArrowPoints.bind(U),U.setArrowType=U.setArrowType.bind(U),U.arrowTypePanel=new le("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.arrow1&&c!==this.arrow2)},s.prototype.getArrowPoints=function(c,R){var Z=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return c-Z/2+","+(R+U/2)+" "+c+","+(R-U/2)+" "+(c+Z/2)+","+(R+U/2)},s.prototype.createTips=function(){this.arrow1=oe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=oe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow2)},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(j.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",oe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),oe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var c=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),R=this.arrow1.transform.baseVal.getItem(0);R.setRotate(c,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(R,0);var Z=this.arrow2.transform.baseVal.getItem(0);Z.setRotate(c+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Z,0)}},s.prototype.setArrowType=function(c){this.arrowType=c,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){j.prototype.restoreState.call(this,c);var R=c;this.arrowType=R.arrowType,this.createTips(),this.adjustVisual()},s.typeName="ArrowMarker",s.title="Arrow marker",s.icon='',s}(tt),q=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.fillColor=Z.defaultFillColor,U.strokeWidth=0,U.fillPanel=new ze("Color",Z.defaultColorSet,Z.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Ce(s,j),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=j.prototype.getState.call(this);return c.typeName=s.typeName,c},s.typeName="CoverMarker",s.title="Cover marker",s.icon='',s}(qe),te=function(j){function s(c,R,Z,U){var ce=j.call(this,c,U||'')||this;return ce.opacities=[],ce.opacityBoxes=[],ce.opacities=R,ce.currentOpacity=Z,ce.setCurrentOpacity=ce.setCurrentOpacity.bind(ce),ce}return Ce(s,j),s.prototype.getUi=function(){var c=this,R=document.createElement("div");return R.style.display="flex",R.style.overflow="hidden",R.style.flexGrow="2",R.style.justifyContent="space-between",this.opacities.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=Z===c.currentOpacity?c.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){c.setCurrentOpacity(Z,U)}),R.appendChild(U);var ce=document.createElement("div");ce.innerText=100*Z+"%",U.appendChild(ce),c.opacityBoxes.push(U)}),R},s.prototype.setCurrentOpacity=function(c,R){var Z=this;this.currentOpacity=c,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===R?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},s}(Ve),ie=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=Z.defaultHighlightColor,U.strokeWidth=0,U.opacity=Z.defaultHighlightOpacity,U.fillPanel=new ze("Color",Z.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new te("Opacity",Z.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Ce(s,j),s.prototype.setOpacity=function(c){this.opacity=c,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=j.prototype.getState.call(this);return c.typeName=s.typeName,c},s.typeName="HighlightMarker",s.title="Highlight marker",s.icon='',s}(q),de='',me=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.bgColor="transparent",U.tipPosition={x:0,y:0},U.tipBase1Position={x:0,y:0},U.tipBase2Position={x:0,y:0},U.tipMoving=!1,U.color=Z.defaultStrokeColor,U.bgColor=Z.defaultFillColor,U.fontFamily=Z.defaultFontFamily,U.defaultSize={x:100,y:30},U.setBgColor=U.setBgColor.bind(U),U.getTipPoints=U.getTipPoints.bind(U),U.positionTip=U.positionTip.bind(U),U.setTipPoints=U.setTipPoints.bind(U),U.colorPanel=new ze("Text color",Z.defaultColorSet,U.color,''),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new ze("Fill color",Z.defaultColorSet,U.bgColor,de),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new Te("Font",Z.defaultFontFamilies,Z.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new ot,U.tipGrip.visual.transform.baseVal.appendItem(oe.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Ce(s,j),s.prototype.ownsTarget=function(c){return j.prototype.ownsTarget.call(this,c)||this.tipGrip.ownsTarget(c)||this.tip===c},s.prototype.createTip=function(){oe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=oe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},s.prototype.pointerDown=function(c,R){this.state==="new"&&j.prototype.pointerDown.call(this,c,R),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(R)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):j.prototype.pointerDown.call(this,c,R)},s.prototype.pointerUp=function(c){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,c);else{var R=this.state==="creating";j.prototype.pointerUp.call(this,c),this.setTipPoints(R),this.positionTip()}},s.prototype.manipulate=function(c){if(this.tipMoving){var R=this.unrotatePoint(c);this.tipPosition={x:R.x-this.manipulationStartLeft,y:R.y-this.manipulationStartTop},this.positionTip()}else j.prototype.manipulate.call(this,c)},s.prototype.setBgColor=function(c){this.bgRectangle&&this.tip&&(oe.setAttributes(this.bgRectangle,[["fill",c]]),oe.setAttributes(this.tip,[["fill",c]])),this.bgColor=c,this.fillColorChanged(c)},s.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},s.prototype.setTipPoints=function(c){c===void 0&&(c=!1);var R=Math.min(this.height/2,15),Z=this.height/5;c&&(this.tipPosition={x:R+Z/2,y:this.height+20});var U=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?U',s}(Le),Ee=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.fillColor=Z.defaultFillColor,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.setOpacity=U.setOpacity.bind(U),U.createVisual=U.createVisual.bind(U),U.strokePanel=new ze("Line color",ge(Z.defaultColorSet,["transparent"]),Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new ze("Fill color",ge(Z.defaultColorSet,["transparent"]),U.fillColor,de),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new ct("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new et("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new te("Opacity",Z.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.visual)},s.prototype.createVisual=function(){this.visual=oe.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)},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.state==="new"&&(this.createVisual(),this.moveVisual(c),this._state="creating")},s.prototype.manipulate=function(c){j.prototype.manipulate.call(this,c)},s.prototype.resize=function(c){j.prototype.resize.call(this,c),this.setSize()},s.prototype.setSize=function(){j.prototype.setSize.call(this),oe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},s.prototype.pointerUp=function(c){j.prototype.pointerUp.call(this,c),this.setSize()},s.prototype.setStrokeColor=function(c){this.strokeColor=c,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(c),this.stateChanged()},s.prototype.setFillColor=function(c){this.fillColor=c,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(c),this.stateChanged()},s.prototype.setStrokeWidth=function(c){this.strokeWidth=c,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(c){this.strokeDasharray=c,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.setOpacity=function(c){this.opacity=c,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){var R=c;this.fillColor=R.fillColor,this.strokeColor=R.strokeColor,this.strokeWidth=R.strokeWidth,this.strokeDasharray=R.strokeDasharray,this.opacity=R.opacity,this.createVisual(),j.prototype.restoreState.call(this,c),this.setSize()},s.prototype.scale=function(c,R){j.prototype.scale.call(this,c,R),this.setSize()},s.typeName="EllipseMarker",s.title="Ellipse marker",s.icon='',s}(Je),Pe=function(j){function s(c,R,Z){return j.call(this,c,R,Z)||this}return Ce(s,j),Object.defineProperty(s.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.tip1&&c!==this.tip2)},s.prototype.createTips=function(){this.tip1=oe.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(oe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=oe.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(oe.createTransform()),this.visual.appendChild(this.tip2)},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(oe.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()]]),oe.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 c=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),R=this.tip1.transform.baseVal.getItem(0);R.setRotate(c,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(R,0);var Z=this.tip2.transform.baseVal.getItem(0);Z.setRotate(c+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Z,0)}},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=j.prototype.getState.call(this);return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){j.prototype.restoreState.call(this,c),this.createTips(),this.adjustVisual()},s.typeName="MeasurementMarker",s.title="Measurement marker",s.icon='',s}(tt),rt=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.strokePanel.colors=Z.defaultColorSet,U.fillColor="transparent",U}return Ce(s,j),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=j.prototype.getState.call(this);return c.typeName=s.typeName,c},s.typeName="EllipseFrameMarker",s.title="Ellipse frame marker",s.icon='',s}(Ee),mt=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.prototype.addUndoStep=function(s){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(s)||(this.undoStack.push(s),JSON.stringify(this.lastRedoStep)!==JSON.stringify(s)&&this.redoStack.splice(0,this.redoStack.length))},j.prototype.replaceLastUndoStep=function(s){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=s)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.prototype.undo=function(){if(this.undoStack.length>1){var s=this.undoStack.pop();return s!==void 0&&this.redoStack.push(s),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),ft=function(j){function s(c,R,Z){var U=j.call(this,c,R,Z)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.curveX=0,U.curveY=0,U.manipulationStartCurveX=0,U.manipulationStartCurveY=0,U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.positionGrips=U.positionGrips.bind(U),U.addControlGrips=U.addControlGrips.bind(U),U.adjustVisual=U.adjustVisual.bind(U),U.setupControlBox=U.setupControlBox.bind(U),U.resize=U.resize.bind(U),U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ze("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new et("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ce(s,j),s.prototype.ownsTarget=function(c){return!(!j.prototype.ownsTarget.call(this,c)&&c!==this.visual&&c!==this.selectorCurve&&c!==this.visibleCurve&&!this.curveGrip.ownsTarget(c))},s.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},s.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorCurve=oe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=oe.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)},s.prototype.pointerDown=function(c,R){j.prototype.pointerDown.call(this,c,R),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=c.x,this.curveY=c.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(R)&&(this.activeGrip=this.curveGrip,this._state="resize")},s.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),oe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setupControlBox=function(){j.prototype.setupControlBox.call(this),this.curveControlLine1=oe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=oe.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)},s.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,j.prototype.addControlGrips.call(this)},s.prototype.positionGrips=function(){j.prototype.positionGrips.call(this);var c=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-c/2,this.curveY-c/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()))},s.prototype.manipulate=function(c){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+c.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+c.y-this.manipulationStartY),j.prototype.manipulate.call(this,c)},s.prototype.resize=function(c){this.activeGrip===this.curveGrip&&(this.curveX=c.x,this.curveY=c.y),j.prototype.resize.call(this,c),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},s.prototype.setStrokeColor=function(c){this.strokeColor=c,this.adjustVisual(),this.colorChanged(c)},s.prototype.setStrokeWidth=function(c){this.strokeWidth=c,this.adjustVisual()},s.prototype.setStrokeDasharray=function(c){this.strokeDasharray=c,this.adjustVisual()},s.prototype.scale=function(c,R){this.curveX=this.curveX*c,this.curveY=this.curveY*R,j.prototype.scale.call(this,c,R)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var c=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return c.typeName=s.typeName,c},s.prototype.restoreState=function(c){j.prototype.restoreState.call(this,c);var R=c;this.strokeColor=R.strokeColor,this.strokeWidth=R.strokeWidth,this.strokeDasharray=R.strokeDasharray,this.curveX=R.curveX,this.curveY=R.curveY,this.createVisual(),this.adjustVisual()},s.typeName="CurveMarker",s.title="Curve marker",s.icon='',s}(lt),wt=function(){function j(s,c){c===void 0&&(c=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=s,this.cancelable=c}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),Tt=function(j){function s(c,R,Z){var U=j.call(this,c,!1)||this;return U.dataUrl=R,U.state=Z,U}return Ce(s,j),s}(wt),ut=function(j){function s(c,R,Z){Z===void 0&&(Z=!1);var U=j.call(this,c,Z)||this;return U.marker=R,U}return Ce(s,j),s}(wt),Ft=function(){function j(){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 j.prototype.addEventListener=function(s,c){this[s].push(c)},j.prototype.removeEventListener=function(s,c){var R=this[s].indexOf(c);R>-1&&this[s].splice(R,1)},j}(),Ot=function(){function j(s){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new we,this._isOpen=!1,this.undoRedoManager=new mt,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=j.instanceCounter++,this.styles=new Ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=s,this.targetRoot=document.body,this.width=s.clientWidth,this.height=s.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(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,fe,ue,Le,rt,Ee,ie,me,Pe,q,tt,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,fe,ue,Le,Ee,ie,me]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,fe,ue,Le,ie]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(s){var c=this;this._availableMarkerTypes.splice(0),s.forEach(function(R){if(typeof R=="string"){var Z=c.ALL_MARKER_TYPES.find(function(U){return U.typeName===R});Z!==void 0&&c._availableMarkerTypes.push(Z)}else c._availableMarkerTypes.push(R)})},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(s){this._zoomLevel=s,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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var s=this;this.styles.styleSheetRoot===void 0&&He.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=He.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(c){return c(new wt(s))})},j.prototype.render=function(){return Ae(this,void 0,void 0,function(){var s;return Se(this,function(c){switch(c.label){case 0:return this.setCurrentMarker(),(s=new Ze).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.markersOnly=this.renderMarkersOnly,s.width=this.renderWidth,s.height=this.renderHeight,[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return c.sent(),[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,c.sent()]}})})},j.prototype.close=function(s){var c=this;if(s===void 0&&(s=!1),this.isOpen){var R=!1;s||this.eventListeners.beforeclose.forEach(function(Z){var U=new wt(c,!0);Z(U),U.defaultPrevented&&(R=!0)}),R||(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(Z){return Z(new wt(c))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var s,c=[],R=0;Rthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*s:this.editorCanvas.clientWidth,R=c',s.title="Powered by marker.js",s.style.display="grid",s.style.alignItems="center",s.style.justifyItems="center",s.style.padding="3px",s.style.width="20px",s.style.height="20px",this.logoUI.appendChild(s),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},j.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")},j.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"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.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 s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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 Ie(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-1&&this.markers.splice(this.markers.indexOf(s),1),s.dispose()},j.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())},j.prototype.toolbarButtonClicked=function(s,c){if(s==="marker"&&c!==void 0)this.createNewMarker(c);else if(s==="action")switch(c){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()}},j.prototype.deleteSelectedMarker=function(){var s=this;if(this._currentMarker!==void 0){var c=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Z){var U=new ut(s,s._currentMarker,!0);Z(U),U.defaultPrevented&&(c=!0)}),!c){var R=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(Z){return Z(new ut(s,R))})}}},j.prototype.clear=function(){var s=this,c=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ce){var Oe=new ut(s,void 0,!0);ce(Oe),Oe.defaultPrevented&&(c=!0)}),!c)){this.setCurrentMarker();for(var R=function(ce){var Oe=Z.markers[ce];Z.setCurrentMarker(Z.markers[ce]),Z._currentMarker.dispose(),Z.markerImage.removeChild(Z._currentMarker.container),Z.markers.splice(Z.markers.indexOf(Z._currentMarker),1),Z.eventListeners.markerdelete.forEach(function(Ke){return Ke(new ut(s,Oe))})},Z=this,U=this.markers.length-1;U>=0;U--)R(U);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.prototype.showNotesEditor=function(){var s;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=(s=this._currentMarker.notes)!==null&&s!==void 0?s:"",this.overlayContainer.appendChild(this.notesArea))},j.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)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var s=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var c=this.getState(),R=this.undoRedoManager.getLastUndoStep();if(!R||R.width===c.width&&R.height===c.height){var Z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(c),Z1&&this.panTo({x:s.clientX,y:s.clientY}))},j.prototype.onPointerUp=function(s){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(s.clientX,s.clientY)),this.isDragging=!1,this.addUndoStep()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(s){this._currentMarker===void 0||this.notesArea!==void 0||s.key!=="Delete"&&s.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(s,c){var R=this.markerImage.getBoundingClientRect();return{x:(s-R.left)/this.zoomLevel,y:(c-R.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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()},j.prototype.addLicenseKey=function(s){Re.addKey(s)},j.prototype.addEventListener=function(s,c){this.eventListeners.addEventListener(s,c)},j.prototype.removeEventListener=function(s,c){this.eventListeners.removeEventListener(s,c)},j.prototype.renderState=function(s){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(s),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.prototype.focus=function(){var s=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(c){return c(new wt(s))}))},j.prototype.blur=function(){var s=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(c){return c(new wt(s))}))},j.instanceCounter=0,j}();/* **********************************
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 Zt=function(j,s){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,R){c.__proto__=R}||function(c,R){for(var Z in R)Object.prototype.hasOwnProperty.call(R,Z)&&(c[Z]=R[Z])})(j,s)};function Xt(j,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function c(){this.constructor=j}Zt(j,s),j.prototype=s===null?Object.create(s):(c.prototype=s.prototype,new c)}function Rt(j,s,c,R){return new(c||(c=Promise))(function(Z,U){function ce(dt){try{Ke(R.next(dt))}catch(Me){U(Me)}}function Oe(dt){try{Ke(R.throw(dt))}catch(Me){U(Me)}}function Ke(dt){var Me;dt.done?Z(dt.value):(Me=dt.value,Me instanceof c?Me:new c(function(vt){vt(Me)})).then(ce,Oe)}Ke((R=R.apply(j,s||[])).next())})}function Ir(j,s){var c,R,Z,U,ce={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return U={next:Oe(0),throw:Oe(1),return:Oe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Oe(Ke){return function(dt){return function(Me){if(c)throw new TypeError("Generator is already executing.");for(;ce;)try{if(c=1,R&&(Z=2&Me[0]?R.return:Me[0]?R.throw||((Z=R.return)&&Z.call(R),0):R.next)&&!(Z=Z.call(R,Me[1])).done)return Z;switch(R=0,Z&&(Me=[2&Me[0],Z.value]),Me[0]){case 0:case 1:Z=Me;break;case 4:return ce.label++,{value:Me[1],done:!1};case 5:ce.label++,R=Me[1],Me=[0];continue;case 7:Me=ce.ops.pop(),ce.trys.pop();continue;default:if(!(Z=ce.trys,(Z=Z.length>0&&Z[Z.length-1])||Me[0]!==6&&Me[0]!==2)){ce=0;continue}if(Me[0]===3&&(!Z||Me[1]>Z[0]&&Me[1]0&&c>0){var R=new Hr(s,c),Z=R.ratio>=1?20:R.getHorizontalLength(20),U=R.ratio<1?20:R.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var Oe=bt.createDefs();ce.appendChild(Oe);var Ke=bt.createElement("clipPath",[["id","text-bg-clip"]]);Oe.appendChild(Ke);var dt=bt.createPath(bt.getHollowRectanglePath((24-Z)/2,(24-U)/2,Z,U,(24-Z)/2+2,(24-U)/2+2,Z-4,U-4));ce.appendChild(dt);var Me=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Me.appendChild(bt.createTSpan(s+":"+c)),ce.appendChild(Me);var vt=Me.getBBox();bt.setAttributes(Me,[["x",((24-vt.width)/2).toString()],["y",((24-vt.height)/2-vt.y).toString()]]);var Nt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(vt.width))/2,(24-Math.ceil(vt.height))/2,Math.ceil(vt.width),Math.ceil(vt.height)));return Ke.appendChild(Nt),bt.setAttributes(dt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.outerHTML}return''},j}(),mr=function(j){function s(c,R,Z){var U=j.call(this,c,R)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=Z,U}return Xt(s,j),s.prototype.setupDropdown=function(){var c=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(R){R.className=c.className,R.colorsClassName=c.colorsClassName,c.dropdownBlock.appendChild(R.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},s.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},s.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},s.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},s.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},s.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},s}(It),kt=function(){function j(s,c){this.GRIP_SIZE=10,this.color=s,this.fillColor=c,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},j.prototype.setCenter=function(s,c){this.visual.childNodes.forEach(function(R){return bt.setAttributes(R,[["cx",s.toString()],["cy",c.toString()]])})},j}(),Fr=function(){function j(s,c,R,Z){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=s,this.canvasHeight=c,this.margin=R,this.container=Z,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(j.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(s){this._aspectRatio=s,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(s){this._zoomFactor=s,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),j.prototype.open=function(){var s=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var c=0;cthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-c.height/2),bt.setAttributes(this.cropRectElement,[["x",c.x.toString()],["y",c.y.toString()],["width",c.width.toString()],["height",c.height.toString()]]);var R=c.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,ce){var Oe=c.y+R*(ce+1);bt.setAttributes(U,[["x1",""+c.x],["y1",""+Oe],["x2",""+(c.x+c.width)],["y2",""+Oe]])});var Z=c.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,ce){var Oe=c.x+Z*(ce+1);bt.setAttributes(U,[["x1",""+Oe],["y1",""+c.y],["x2",""+Oe],["y2",""+(c.y+c.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,c.x,c.y,c.width,c.height)]]),this.topLeftGrip.setCenter(c.x,c.y),this.topRightGrip.setCenter(c.x+c.width,c.y),this.bottomLeftGrip.setCenter(c.x,c.y+c.height),this.bottomRightGrip.setCenter(c.x+c.width,c.y+c.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},j.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)},j.prototype.clientToLocalCoordinates=function(s,c){var R=this.container.getBoundingClientRect();return{x:s-R.left+this.margin,y:c-R.top+this.margin}},j.prototype.onPointerDown=function(s){this.container.setPointerCapture(s.pointerId),this.previousPoint=this.clientToLocalCoordinates(s.clientX,s.clientY),this.cropRectElement===s.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(s.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(s.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(s.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(s.target)&&(this.activeGrip=this.bottomRightGrip)},j.prototype.onPointerMove=function(s){if(this.isMoving)this.move(this.clientToLocalCoordinates(s.clientX,s.clientY));else if(this.activeGrip){var c=this.clientToLocalCoordinates(s.clientX,s.clientY);this.resize(c)}s.preventDefault()},j.prototype.onPointerUp=function(s){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(s.pointerId)},j.prototype.move=function(s){var c=s.x-this.previousPoint.x,R=s.y-this.previousPoint.y;this.zoomFactor!==1&&(c=-c/this.zoomFactor,R=-R/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+c),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+R),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=s},j.prototype.resize=function(s){var c=Object.assign({},this.cropRect),R=s.x-this.previousPoint.x,Z=s.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:c.x+Rthis.canvasWidth*this.zoomFactor&&(R=this.canvasWidth*this.zoomFactor-c.width),c.width+=R}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(c.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(R),c.height=this.aspectRatio.getVerticalLength(c.width)):(c.y+=Z,c.height=this.cropRect.y+this.cropRect.height-c.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?c.height=this.aspectRatio.getVerticalLength(c.width):c.height+=Z}c.width<10&&(c.x=this.cropRect.x,c.width=10),c.height<10&&(c.y=this.cropRect.y,c.height=10),this.previousPoint=s,c.x>=this.margin&&c.y>=this.margin&&c.x-this.margin+c.width<=this.canvasWidth&&c.y-this.margin+c.height<=this.canvasHeight&&(this.cropRect=c,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},j.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var s=this.cropRect.x+this.cropRect.width/2,c=this.cropRect.y+this.cropRect.height/2,R=this.aspectRatio.getHorizontalLength(this.cropRect.height),Z=this.aspectRatio.getVerticalLength(this.cropRect.width);R/this.canvasWidththis.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=s-this.cropRect.width/2,this.cropRect.y=c-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)}},j.prototype.getRescaledRect=function(s,c,R,Z,U,ce){var Oe=R/s,Ke=Z/c;return{x:(U.x-ce)*Oe+ce,y:(U.y-ce)*Ke+ce,width:U.width*Oe,height:U.height*Ke}},j.prototype.scaleCanvas=function(s,c){var R=this.getRescaledRect(this.canvasWidth,this.canvasHeight,s,c,this.cropRect,this.margin);this.canvasWidth=s,this.canvasHeight=c,this.onCropChange&&this.onCropChange(R),this.setCropRectangle(R)},j}(),Vr=function(){function j(s){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=s,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(j.prototype,"angle",{get:function(){return this._angle},set:function(s){this._angle=s,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),j.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},j.prototype.onPointerDown=function(s){this.controlContainer.setPointerCapture(s.pointerId),this.isDragging=!0,this.previousPoint={x:s.clientX,y:s.clientY}},j.prototype.onPointerMove=function(s){this.isDragging&&(this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.previousPoint.x=s.clientX)},j.prototype.onPointerUp=function(s){this.isDragging&&this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(s.pointerId)},j.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var s=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-s.width)/2).toString()],["y",(this.height/2).toString()]])}},j.prototype.positionScaleShape=function(){if(this.scaleShape){var s=this.scaleShape.transform.baseVal.getItem(0);s.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(s,0)}},j.prototype.getVisual=function(){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",this.width+"px"),s.setAttribute("height",this.height+"px"),s.setAttribute("viewBox","0 0 "+this.width+" "+this.height),s.style.flexShrink="0",document.body.appendChild(s);for(var c="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,R=1;R<=this.width/5+10;R++){var Z=R%5==0?this.height/3:this.height/6;c+="h4v"+-Z+"h1v"+Z}c+="v1H0Z",this.scaleShape=bt.createPath(c);var U=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(U),s.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=bt.createTSpan("");return ce.innerHTML="°",this.angleLabelElement.appendChild(ce),s.appendChild(this.angleLabelElement),document.body.removeChild(s),s},j}(),fi=function(){function j(){this.naturalSize=!1,this.imageType="image/png"}return j.prototype.rasterize=function(s,c,R,Z,U,ce,Oe){var Ke=this;return new Promise(function(dt){var Me=document.createElement("canvas");Me.width=s.width.baseVal.value-2*Z,Me.height=s.height.baseVal.value-2*Z;var vt=1,Nt=1;Ke.naturalSize===!0?(vt=c.naturalWidth/(s.width.baseVal.value-2*Z)/ce,Nt=c.naturalHeight/(s.height.baseVal.value-2*Z)/Oe,Me.width=c.naturalWidth/ce,Me.height=c.naturalHeight/Oe):Ke.width!==void 0&&Ke.height!==void 0&&(vt=Ke.width/R.width,Nt=Ke.height/R.height,Me.width*=vt,Me.height*=Nt);var Kt=Me.getContext("2d");Kt.translate(Me.width/2,Me.height/2),Kt.rotate(U*Math.PI/180),Kt.scale(ce,Oe),Kt.translate(-Me.width/2,-Me.height/2),Kt.drawImage(c,0,0,Me.width,Me.height);var Rr=document.createElement("canvas");Rr.width=R.width*vt,Rr.height=R.height*Nt,Rr.getContext("2d").putImageData(Kt.getImageData((R.x-Z)*vt,(R.y-Z)*Nt,R.width*vt,R.height*Nt),0,0),dt(Rr.toDataURL(Ke.imageType,Ke.imageQuality))})},j}(),Ue=function(){function j(s){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=j.instanceCounter++,this.styles=new Nr(this.instanceNo),this.target=s,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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(s){this._zoomToCropEnabled=s,s?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"gridLines",{get:function(){return this._gridLines},set:function(s){this._gridLines=s,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(s){this._rotationAngle=s,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"aspectRatio",{get:function(){var s;return(s=this._aspectRatio)!==null&&s!==void 0?s:this.aspectRatios[0]},set:function(s){this._aspectRatio=s},enumerable:!1,configurable:!0}),j.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},j.prototype.show=function(){this.showUI(),this.open()},j.prototype.close=function(s){s===void 0&&(s=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),s||this.closeEventListeners.forEach(function(c){return c()}),this._isOpen=!1)},j.prototype.addRenderEventListener=function(s){this.renderEventListeners.push(s)},j.prototype.removeRenderEventListener=function(s){this.renderEventListeners.indexOf(s)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(s),1)},j.prototype.addCloseEventListener=function(s){this.closeEventListeners.push(s)},j.prototype.removeCloseEventListener=function(s){this.closeEventListeners.indexOf(s)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(s),1)},j.prototype.setupResizeObserver=function(){var s=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.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))},j.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var s=1*this.target.clientWidth/this.target.clientHeight,c=this.contentDiv.clientWidth/s>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*s:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,R=c+2*this.CANVAS_MARGINs+this.CANVAS_MARGIN?this.target.offsetTop-(s+this.CANVAS_MARGIN):0;this.coverDiv.style.top=c+"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},j.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},j.prototype.addTopToolbar=function(){var s=this;this.topToolbar=new Br,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 c=new qr;c.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(c);var R=[];this.aspectRatios.forEach(function(Nt){var Kt=new It(ei.getIcon(Nt.horizontal,Nt.vertical),Nt.horizontal===0&&Nt.vertical===0?"FREE":Nt.horizontal+":"+Nt.vertical);Kt.onClick=function(){return s.ratioButtonClicked(Nt)},R.push(Kt)}),this.aspectRatioButton=new mr(ei.getIcon(0,0),"Aspect ratio",R),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,c.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Z=new It('',"Toggle grid");Z.isActive=this.isGridVisible,Z.onClick=function(){s.isGridVisible=!s.isGridVisible,Z.isActive=s.isGridVisible},c.addButton(Z);var U=new It('',"Zoom to selection");if(U.isActive=this.zoomToCropEnabled,U.onClick=function(){s.zoomToCropEnabled=!s.zoomToCropEnabled,U.isActive=s.zoomToCropEnabled},c.addButton(U),!Kr.isLicensed){var ce=new ht;this.topToolbar.addElementBlock(ce);var Oe=document.createElement("div");Oe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ke=document.createElement("a");Ke.style.color="currentColor",Ke.href="https://markerjs.com/products/cropro",Ke.target="_blank",Ke.innerHTML='',Oe.appendChild(Ke),ce.addElement(Oe)}var dt=new qr;dt.minWidth=3*this.toolbarHeight+"px",dt.contentAlign="end",this.topToolbar.addButtonBlock(dt);var Me=new It('',"OK");Me.onClick=this.startRenderAndClose,dt.addButton(Me),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Me.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var vt=new It('',"Close");vt.onClick=this.close,dt.addButton(vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},j.prototype.addBottomToolbar=function(){var s=this;this.bottomToolbar=new Br,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 c=new qr;c.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(c);var R=new It('',"Rotate left");R.onClick=this.rotateLeftButtonClicked,c.addButton(R);var Z=new It('',"Rotate right");Z.onClick=this.rotateRightButtonClicked,c.addButton(Z);var U=new ht;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new Vr("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(dt){s.rotateBy(dt),s.straightener.angle=s.rotationAngle},U.addElement(this.straightener.getUI());var ce=new qr;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var Oe=new It('',"Flip horizontal");Oe.onClick=this.flipHorizontallyButtonClicked,ce.addButton(Oe);var Ke=new It('',"Flip vertical");Ke.onClick=this.flipVerticallyButtonClicked,ce.addButton(Ke)},j.prototype.ratioButtonClicked=function(s){this.aspectRatio=s,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},j.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ei.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},j.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},j.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},j.prototype.restoreState=function(s){if(s){var c=this.cropLayer.getRescaledRect(s.width,s.height,this.imageWidth,this.imageHeight,s.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(c),this.cropRectChanged(c),this.flippedHorizontally=s.flippedHorizontally,this.flippedVertically=s.flippedVertically,this.applyFlip(),this.rotationAngle=s.rotationAngle,this.applyRotation()}},j.prototype.clientToLocalCoordinates=function(s,c){var R=this.cropImage.getBoundingClientRect();return{x:s-R.left,y:c-R.top}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var s=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=s+"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()},j.prototype.rotateLeftButtonClicked=function(){var s=this.rotationAngle-90;this.rotationAngle%90!=0&&(s+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(s)},j.prototype.rotateRightButtonClicked=function(){var s=this.rotationAngle+90;this.rotationAngle%90!=0&&(s-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(s)},j.prototype.rotateTo=function(s){s=(s=s>180?s-360:s)<=-180?s+360:s,this.rotationAngle=s,this.applyRotation()},j.prototype.rotateBy=function(s){this.rotateTo((this.rotationAngle+s)%360)},j.prototype.applyRotation=function(){var s=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var c=this.editingTargetRotationContainer.transform.baseVal.getItem(0);c.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(c,0);var R=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/R.width,this.imageHeight/R.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=s},j.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},j.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},j.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},j.prototype.startRenderAndClose=function(){return Rt(this,void 0,void 0,function(){var s,c;return Ir(this,function(R){switch(R.label){case 0:return[4,this.render()];case 1:return s=R.sent(),c=this.getState(),this.renderEventListeners.forEach(function(Z){return Z(s,c)}),this.close(!0),[2]}})})},j.prototype.render=function(){return Rt(this,void 0,void 0,function(){var s;return Ir(this,function(c){switch(c.label){case 0:return(s=new fi).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.width=this.renderWidth,s.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,s.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 c.sent(),[4,s.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,c.sent()]}})})},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pr("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 pr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var s=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pr("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*s)+`px;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new pr("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 pr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pr("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 pr("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new pr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},j.instanceCounter=0,j}(),St=re("8hTe"),pi=re.n(St),mi=/]*>/g;function gi(j){var s=document.createElement("div");return s.innerHTML=j,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var vi=at.a=function(j){var s=j.value,c=s===void 0?"":s,R=j.edit,Z=R===void 0?!1:R,U=j.className,ce=j.showTextOnly,Oe=j.showLines,Ke=j.replaces,dt=j.zoomImg,Me=j.hasMask,vt=j.style,Nt=vt===void 0?{}:vt,Kt=j.stylesPrev,Rr=Kt===void 0?{}:Kt,gr=String(c),vr=Object(O.useRef)(),Xr=Object(O.useRef)(),Ri=Object(O.useState)(""),nr=Object(H.a)(Ri,2),Ur=nr[0],oi=nr[1],si=Object(O.useState)("office"),Or=Object(H.a)(si,2),Oi=Or[0],yi=Or[1],zi=function(){var Bt=new Ue(Xr.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var dr=Object(M.a)(P.a.mark(function _t(qt){var Wt;return P.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return vr.current.style.display="none",ar.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:qt}});case 3:Wt=ar.sent,Wt!=null&&Wt.id&&Ke(Xr.current.getAttribute("src").replace(ae.a.API_SERVER,""),"/api/attachments/".concat(Wt==null?void 0:Wt.id,"?type=").concat(Wt.content_type));case 5:case"end":return ar.stop()}},_t)}));return function(_t){return dr.apply(this,arguments)}}()),Bt.show()},Ki=function(){var Bt=new Ot(Xr.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var dr=Object(M.a)(P.a.mark(function _t(qt){var Wt;return P.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:if(vr.current.style.display="none",!Xr.current){ar.next=6;break}return ar.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:qt.dataUrl}});case 4:Wt=ar.sent,Wt!=null&&Wt.id&&Ke(Xr.current.getAttribute("src").replace(ae.a.API_SERVER,""),"/api/attachments/".concat(Wt==null?void 0:Wt.id,"?type=").concat(Wt.content_type));case 6:case"end":return ar.stop()}},_t)}));return function(_t){return dr.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Yr=Object(O.useMemo)(function(){vr.current&&(vr.current.style.zIndex=-1);try{var Jt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,dr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;gr=gr.replace(Jt,"("+ae.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+ae.a.API_SERVER+"/api/attachments/").replace(dr,'"'+ae.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,`
`)}catch(ti){}var _t=Q(gr),qt=S();if(gr.match(/\[TOC\]/)&&(_t=_t.replace("[TOC]
",k()),C()),_t=_t.replace(/(__special_katext_id_\d+__)/g,function(ti,ar){var Er=qt[ar],Vi=Er.type,Ei=Er.expression;return Object(pe.renderToString)(gi(Ei)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),_t=_t.replace(/▁/g,"\u2581\u2581\u2581"),y(),ce){var Wt=document.createElement("div");return Wt.innerHTML=_t,Wt.innerText}return setTimeout(function(){return dn()},500),_t},[gr]),Gr=Object(O.useRef)();g.WebkitLineClamp=Oe,Oe&&(Nt=Object(N.a)(Object(N.a)({},Nt),g));function bi(Jt){var Bt=Jt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(dt){var dr=Bt.getAttribute("src");oi(dr),yi("image")}}else if(Bt.tagName.toUpperCase()==="A"){var _t=Bt.getAttribute("href");if(_t.indexOf("office")>-1)Jt.preventDefault(),oi(_t),yi("office");else if(_t.indexOf("application/pdf")>-1)Jt.preventDefault(),oi(_t),yi("pdf");else if(_t.indexOf("text/html")>-1)Jt.preventDefault(),oi(_t),yi("html");else if(_t.startsWith("#")){Jt.preventDefault();var qt=document.getElementById(_t.replace("#",""));qt&&qt.scrollIntoView(!0)}}}var dn=function(){var Bt,dr=(Bt=Gr.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");dr==null||dr.forEach(function(_t){if(_t.oncontextmenu=function(){return!1},_t.src.indexOf(".m3u8")>-1&&!_t.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var qt=new ee.a;qt.loadSource(_t.src),qt.attachMedia(_t)}}})};Object(O.useEffect)(function(){if(Gr.current&&Yr&&(Yr.match(mi)&&window.PR.prettyPrint()),Gr.current)return Gr.current.addEventListener("click",bi),function(){Gr.current.removeEventListener("click",bi),y(),C()}},[Yr,Gr.current,bi]);var xi=function(Bt){if(!Z)return;Bt.target.nodeName==="IMG"?(vr.current.style.zIndex=1,vr.current.style.display="flex",vr.current.style.width=Bt.target.clientWidth+"px",vr.current.style.height=Bt.target.clientHeight+"px",vr.current.style.top=Bt.target.offsetTop+"px",vr.current.style.left=Bt.target.offsetLeft+"px",Xr.current.src=Bt.target.getAttribute("src")):vr.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:Gr,style:Object(N.a)({},Nt),className:"".concat(U||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:xi,dangerouslySetInnerHTML:{__html:Yr}}),b.a.createElement("div",{ref:vr,className:pi.a.button},b.a.createElement($.a,null,b.a.createElement(V.a,{onClick:function(){return zi()}},"\u88C1\u526A"),b.a.createElement(V.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Xr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(ve.a,{close:!0,data:Ur,type:Ur!=null&&Ur.length?Oi:"",style:Object(N.a)({},Rr),onClose:function(){return oi("")}}))}},"9VGf":function(xt,at,re){"use strict";re.d(at,"a",function(){return _});var ne=re("q1tI"),$=re.n(ne);function _(V,N){var M=Object(ne.useRef)();Object(ne.useEffect)(function(){M.current=V}),Object(ne.useEffect)(function(){function H(){M.current()}if(N!==null){var F=setInterval(H,N);return function(){return clearInterval(F)}}},[N])}},"9ZNV":function(xt,at,re){"use strict";re.d(at,"a",function(){return O});var ne=re("0Owb"),$=re("+L6B"),_=re("2/Rp"),V=re("q1tI"),N=re.n(V),M=re("UUDw"),H=re.n(M),F=re("TSYQ"),P=re.n(F),O=function(A){var D=A.cancelText,L=D===void 0?"\u53D6\u6D88":D,w=A.okText,x=w===void 0?"\u786E\u5B9A":w,u=A.loading,a=u===void 0?!1:u,l=A.hasOkBtn,h=l===void 0?!0:l,C=A.okButtonProps,g=C===void 0?{}:C,m=A.onCancel,k=m===void 0?function(){}:m,v=A.onOk,f=v===void 0?function(){}:v,p=A.className,d=p===void 0?"":p;return N.a.createElement("div",{className:P()(H.a.buttonFixed,d)},N.a.createElement("div",{className:H.a.buttonWrap},N.a.createElement(_.a,{size:"large",className:"".concat(H.a.button," mr20"),onClick:k},L),h&&N.a.createElement(_.a,Object(ne.a)({size:"large",type:"primary",className:"".concat(H.a.button," mr20"),loading:a,onClick:f},g),x)))}},Bd2K:function(xt,at,re){(function(ne){ne(re("VrN/"),re("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(P,O,b){if(b!=ne.Init&&b&&P.removeKeyMap("autoCloseTags"),!O)return;var A={name:"autoCloseTags"};(typeof O!="object"||O.whenClosing!==!1)&&(A["'/'"]=function(D){return M(D)}),(typeof O!="object"||O.whenOpening!==!1)&&(A["'>'"]=function(D){return V(D)}),P.addKeyMap(A)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],_=["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 V(P){if(P.getOption("disableInput"))return ne.Pass;for(var O=P.listSelections(),b=[],A=P.getOption("autoCloseTags"),D=0;DL.ch&&(l=l.slice(0,l.length-w.end+L.ch));var m=l.toLowerCase();if(!l||w.type=="string"&&(w.end!=L.ch||!/[\"\']/.test(w.string.charAt(w.string.length-1))||w.string.length==1)||w.type=="tag"&&a.close||w.string.indexOf("/")==L.ch-w.start-1||C&&H(C,m)>-1||F(P,x.mode.xmlCurrentContext&&x.mode.xmlCurrentContext(u)||[],l,L,!0))return ne.Pass;var k=typeof A=="object"&&A.emptyTags;if(k&&H(k,l)>-1){b[D]={text:"/>",newPos:ne.Pos(L.line,L.ch+2)};continue}var v=g&&H(g,m)>-1;b[D]={indent:v,text:">"+(v?`
`:"")+""+l+">",newPos:v?ne.Pos(L.line+1,0):ne.Pos(L.line,L.ch+1)}}for(var f=typeof A=="object"&&A.dontIndentOnAutoClose,D=O.length-1;D>=0;D--){var p=b[D];P.replaceRange(p.text,O[D].head,O[D].anchor,"+insert");var d=P.listSelections().slice(0);d[D]={head:p.newPos,anchor:p.newPos},P.setSelections(d),!f&&p.indent&&(P.indentLine(p.newPos.line,null,!0),P.indentLine(p.newPos.line+1,null,!0))}}function N(P,O){for(var b=P.listSelections(),A=[],D=O?"/":"",L=P.getOption("autoCloseTags"),w=typeof L=="object"&&L.dontIndentOnSlash,x=0;x"&&(C+=">"),A[x]=C}if(P.replaceSelections(A),b=P.listSelections(),!w)for(var x=0;x=0&&O[u]==b;u--)++x;A=w.to;for(var u=1;u0){for(var O=0;O1&&arguments[1]!==void 0?arguments[1]:"",O=[],b=0;bfe.length)&&(le=fe.length);for(var ue=0,q=new Array(le);ue=fe.length?{done:!0}:{done:!1,value:fe[q++]}}}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 ue=fe[Symbol.iterator](),ue.next.bind(ue)}function M(fe,le){return le={exports:{}},fe(le,le.exports),le.exports}var H=M(function(fe){function le(){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 ue(q){fe.exports.defaults=q}fe.exports={defaults:le(),getDefaults:le,changeDefaults:ue}}),F=H.defaults,P=H.getDefaults,O=H.changeDefaults,b=/[&<>"']/,A=/[&<>"']/g,D=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},x=function(le){return w[le]};function u(fe,le){if(le){if(b.test(fe))return fe.replace(A,x)}else if(D.test(fe))return fe.replace(L,x);return fe}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(fe){return fe.replace(a,function(le,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var h=/(^|[^\[])\^/g;function C(fe,le){fe=fe.source||fe,le=le||"";var ue={replace:function(te,ie){return ie=ie.source||ie,ie=ie.replace(h,"$1"),fe=fe.replace(te,ie),ue},getRegex:function(){return new RegExp(fe,le)}};return ue}var g=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(fe,le,ue){if(fe){var q;try{q=decodeURIComponent(l(ue)).replace(g,"").toLowerCase()}catch(te){return null}if(q.indexOf("javascript:")===0||q.indexOf("vbscript:")===0||q.indexOf("data:")===0)return null}le&&!m.test(ue)&&(ue=o(le,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(te){return null}return ue}var v={},f=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(fe,le){v[" "+fe]||(f.test(fe)?v[" "+fe]=fe+"/":v[" "+fe]=I(fe,"/",!0)),fe=v[" "+fe];var ue=fe.indexOf(":")===-1;return le.substring(0,2)==="//"?ue?le:fe.replace(p,"$1")+le:le.charAt(0)==="/"?ue?le:fe.replace(d,"$1")+le:fe+le}var S={exec:function(){}};function y(fe){for(var le=1,ue,q;le=0&&me[Pe]==="\\";)Ee=!Ee;return Ee?"|":" |"}),q=ue.split(/ \|/),te=0;if(q.length>le)q.splice(le);else for(;q.length=q.length?te.slice(q.length):te}).join(`
`)}var xe=function(){function fe(ue){this.options=ue||z}var le=fe.prototype;return le.space=function(q){var te=this.rules.block.newline.exec(q);if(te)return te[0].length>1?{type:"space",raw:te[0]}:{raw:`
`}},le.code=function(q,te){var ie=this.rules.block.code.exec(q);if(ie){var de=te[te.length-1];if(de&&de.type==="paragraph")return{raw:ie[0],text:ie[0].trimRight()};var me=ie[0].replace(/^ {4}/gm,"");return{type:"code",raw:ie[0],codeBlockStyle:"indented",text:this.options.pedantic?me:W(me,`
`)}}},le.fences=function(q){var te=this.rules.block.fences.exec(q);if(te){var ie=te[0],de=De(ie,te[3]||"");return{type:"code",raw:ie,lang:te[2]?te[2].trim():te[2],text:de}}},le.heading=function(q){var te=this.rules.block.heading.exec(q);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},le.nptable=function(q){var te=this.rules.block.nptable.exec(q);if(te){var ie={type:"table",header:ee(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[],raw:te[0]};if(ie.header.length===ie.align.length){var de=ie.align.length,me;for(me=0;me ?/gm,"");return{type:"blockquote",raw:te[0],text:ie}}},le.list=function(q){var te=this.rules.block.list.exec(q);if(te){for(var ie=te[0],de=te[2],me=de.length>1,Ee=de[de.length-1]===")",Pe={type:"list",raw:ie,ordered:me,start:me?+de.slice(0,-1):"",loose:!1,items:[]},rt=te[0].match(this.rules.block.item),mt=!1,ft,wt,Tt,ut,Ft,Ot,Zt,Xt=rt.length,Rt=0;Rt1||this.options.smartLists&&Tt!==de)&&(ut=rt.slice(Rt+1).join(`
`),Pe.raw=Pe.raw.substring(0,Pe.raw.length-ut.length),Rt=Xt-1)),Ft=mt||/\n\n(?!\s*$)/.test(ft),Rt!==Xt-1&&(mt=ft.charAt(ft.length-1)===`
`,Ft||(Ft=mt)),Ft&&(Pe.loose=!0),Ot=/^\[[ xX]\] /.test(ft),Zt=void 0,Ot&&(Zt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Pe.items.push({type:"list_item",raw:ie,task:Ot,checked:Zt,loose:Ft,text:ft});return Pe}},le.html=function(q){var te=this.rules.block.html.exec(q);if(te)return{type:this.options.sanitize?"paragraph":"html",raw:te[0],pre:!this.options.sanitizer&&(te[1]==="pre"||te[1]==="script"||te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):ae(te[0]):te[0]}},le.def=function(q){var te=this.rules.block.def.exec(q);if(te){te[3]&&(te[3]=te[3].substring(1,te[3].length-1));var ie=te[1].toLowerCase().replace(/\s+/g," ");return{tag:ie,raw:te[0],href:te[2],title:te[3]}}},le.table=function(q){var te=this.rules.block.table.exec(q);if(te){var ie={type:"table",header:ee(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[]};if(ie.header.length===ie.align.length){ie.raw=te[0];var de=ie.align.length,me;for(me=0;me/i.test(de[0])&&(te=!1),!ie&&/^<(pre|code|kbd|script)(\s|>)/i.test(de[0])?ie=!0:ie&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(de[0])&&(ie=!1),{type:this.options.sanitize?"text":"html",raw:de[0],inLink:te,inRawBlock:ie,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ae(de[0]):de[0]}},le.link=function(q){var te=this.rules.inline.link.exec(q);if(te){var ie=pe(te[2],"()");if(ie>-1){var de=te[0].indexOf("!")===0?5:4,me=de+te[1].length+ie;te[2]=te[2].substring(0,ie),te[0]=te[0].substring(0,me).trim(),te[3]=""}var Ee=te[2],Pe="";if(this.options.pedantic){var rt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ee);rt?(Ee=rt[1],Pe=rt[3]):Pe=""}else Pe=te[3]?te[3].slice(1,-1):"";Ee=Ee.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ve(te,{href:Ee&&Ee.replace(this.rules.inline._escapes,"$1"),title:Pe&&Pe.replace(this.rules.inline._escapes,"$1")},te[0]);return mt}},le.reflink=function(q,te){var ie;if((ie=this.rules.inline.reflink.exec(q))||(ie=this.rules.inline.nolink.exec(q))){var de=(ie[2]||ie[1]).replace(/\s+/g," ");if(de=te[de.toLowerCase()],!de||!de.href){var me=ie[0].charAt(0);return{type:"text",raw:me,text:me}}var Ee=ve(ie,de,ie[0]);return Ee}},le.strong=function(q,te,ie){ie===void 0&&(ie="");var de=this.rules.inline.strong.start.exec(q);if(de&&(!de[1]||de[1]&&(ie===""||this.rules.inline.punctuation.exec(ie)))){te=te.slice(-1*q.length);var me=de[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var Ee;(de=me.exec(te))!=null;)if(Ee=this.rules.inline.strong.middle.exec(te.slice(0,de.index+3)),Ee)return{type:"strong",raw:q.slice(0,Ee[0].length),text:q.slice(2,Ee[0].length-2)}}},le.em=function(q,te,ie){ie===void 0&&(ie="");var de=this.rules.inline.em.start.exec(q);if(de&&(!de[1]||de[1]&&(ie===""||this.rules.inline.punctuation.exec(ie)))){te=te.slice(-1*q.length);var me=de[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var Ee;(de=me.exec(te))!=null;)if(Ee=this.rules.inline.em.middle.exec(te.slice(0,de.index+2)),Ee)return{type:"em",raw:q.slice(0,Ee[0].length),text:q.slice(1,Ee[0].length-1)}}},le.codespan=function(q){var te=this.rules.inline.code.exec(q);if(te){var ie=te[2].replace(/\n/g," "),de=/[^ ]/.test(ie),me=ie.startsWith(" ")&&ie.endsWith(" ");return de&&me&&(ie=ie.substring(1,ie.length-1)),ie=ae(ie,!0),{type:"codespan",raw:te[0],text:ie}}},le.br=function(q){var te=this.rules.inline.br.exec(q);if(te)return{type:"br",raw:te[0]}},le.del=function(q){var te=this.rules.inline.del.exec(q);if(te)return{type:"del",raw:te[0],text:te[1]}},le.autolink=function(q,te){var ie=this.rules.inline.autolink.exec(q);if(ie){var de,me;return ie[2]==="@"?(de=ae(this.options.mangle?te(ie[1]):ie[1]),me="mailto:"+de):(de=ae(ie[1]),me=de),{type:"link",raw:ie[0],text:de,href:me,tokens:[{type:"text",raw:de,text:de}]}}},le.url=function(q,te){var ie;if(ie=this.rules.inline.url.exec(q)){var de,me;if(ie[2]==="@")de=ae(this.options.mangle?te(ie[0]):ie[0]),me="mailto:"+de;else{var Ee;do Ee=ie[0],ie[0]=this.rules.inline._backpedal.exec(ie[0])[0];while(Ee!==ie[0]);de=ae(ie[0]),ie[1]==="www."?me="http://"+de:me=de}return{type:"link",raw:ie[0],text:de,href:me,tokens:[{type:"text",raw:de,text:de}]}}},le.inlineText=function(q,te,ie){var de=this.rules.inline.text.exec(q);if(de){var me;return te?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ae(de[0]):de[0]:me=ae(this.options.smartypants?ie(de[0]):de[0]),{type:"text",raw:de[0],text:me}}},fe}(),Ce=Q.noopTest,Ae=Q.edit,Se=Q.merge,ge={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*|\\n*|\\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:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=Ae(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=Ae(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=Ae(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._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",ge._comment=//,ge.html=Ae(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=Ae(ge._paragraph).replace("hr",ge.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",ge._tag).getRegex(),ge.blockquote=Ae(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Se({},ge),ge.gfm=Se({},ge.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*|$)"}),ge.gfm.nptable=Ae(ge.gfm.nptable).replace("hr",ge.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",ge._tag).getRegex(),ge.gfm.table=Ae(ge.gfm.table).replace("hr",ge.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",ge._tag).getRegex(),ge.pedantic=Se({},ge.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._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:Ce,paragraph:Ae(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",oe.punctuation=Ae(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",oe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",oe.em.start=Ae(oe.em.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.middle=Ae(oe.em.middle).replace(/punctuation/g,oe._punctuation).replace(/overlapSkip/g,oe._overlapSkip).getRegex(),oe.em.endAst=Ae(oe.em.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.endUnd=Ae(oe.em.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.start=Ae(oe.strong.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.middle=Ae(oe.strong.middle).replace(/punctuation/g,oe._punctuation).replace(/blockSkip/g,oe._blockSkip).getRegex(),oe.strong.endAst=Ae(oe.strong.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.endUnd=Ae(oe.strong.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=Ae(oe._blockSkip,"g").getRegex(),oe.overlapSkip=Ae(oe._overlapSkip,"g").getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=Ae(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=Ae(oe.tag).replace("comment",ge._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=Ae(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=Ae(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=Ae(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=Se({},oe),oe.pedantic=Se({},oe.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:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=Se({},oe.normal,{escape:Ae(oe.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]*?(?:(?=[\\.5&&(q="x"+q.toString(16)),le+=""+q+";";return le}var Ie=function(){function fe(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||Ze,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var q={block:He.normal,inline:Ge.normal};this.options.pedantic?(q.block=He.pedantic,q.inline=Ge.pedantic):this.options.gfm&&(q.block=He.gfm,this.options.breaks?q.inline=Ge.breaks:q.inline=Ge.gfm),this.tokenizer.rules=q}fe.lex=function(q,te){var ie=new fe(te);return ie.lex(q)};var le=fe.prototype;return le.lex=function(q){return q=q.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(q,this.tokens,!0),this.inline(this.tokens),this.tokens},le.blockTokens=function(q,te,ie){te===void 0&&(te=[]),ie===void 0&&(ie=!0),q=q.replace(/^ +$/gm,"");for(var de,me,Ee,Pe;q;){if(de=this.tokenizer.space(q)){q=q.substring(de.raw.length),de.type&&te.push(de);continue}if(de=this.tokenizer.code(q,te)){q=q.substring(de.raw.length),de.type?te.push(de):(Pe=te[te.length-1],Pe.raw+=`
`+de.raw,Pe.text+=`
`+de.text);continue}if(de=this.tokenizer.fences(q)){q=q.substring(de.raw.length),te.push(de);continue}if(de=this.tokenizer.heading(q)){q=q.substring(de.raw.length),te.push(de);continue}if(de=this.tokenizer.nptable(q)){q=q.substring(de.raw.length),te.push(de);continue}if(de=this.tokenizer.hr(q)){q=q.substring(de.raw.length),te.push(de);continue}if(de=this.tokenizer.blockquote(q)){q=q.substring(de.raw.length),de.tokens=this.blockTokens(de.text,[],ie),te.push(de);continue}if(de=this.tokenizer.list(q)){for(q=q.substring(de.raw.length),Ee=de.items.length,me=0;me0)for(;(rt=this.tokenizer.rules.inline.reflinkSearch.exec(Pe))!=null;)mt.includes(rt[0].slice(rt[0].lastIndexOf("[")+1,-1))&&(Pe=Pe.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rt=this.tokenizer.rules.inline.blockSkip.exec(Pe))!=null;)Pe=Pe.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;q;){if(Ee=this.tokenizer.escape(q)){q=q.substring(Ee.raw.length),te.push(Ee);continue}if(Ee=this.tokenizer.tag(q,ie,de)){q=q.substring(Ee.raw.length),ie=Ee.inLink,de=Ee.inRawBlock,te.push(Ee);continue}if(Ee=this.tokenizer.link(q)){q=q.substring(Ee.raw.length),Ee.type==="link"&&(Ee.tokens=this.inlineTokens(Ee.text,[],!0,de)),te.push(Ee);continue}if(Ee=this.tokenizer.reflink(q,this.tokens.links)){q=q.substring(Ee.raw.length),Ee.type==="link"&&(Ee.tokens=this.inlineTokens(Ee.text,[],!0,de)),te.push(Ee);continue}if(Ee=this.tokenizer.strong(q,Pe,me)){q=q.substring(Ee.raw.length),Ee.tokens=this.inlineTokens(Ee.text,[],ie,de),te.push(Ee);continue}if(Ee=this.tokenizer.em(q,Pe,me)){q=q.substring(Ee.raw.length),Ee.tokens=this.inlineTokens(Ee.text,[],ie,de),te.push(Ee);continue}if(Ee=this.tokenizer.codespan(q)){q=q.substring(Ee.raw.length),te.push(Ee);continue}if(Ee=this.tokenizer.br(q)){q=q.substring(Ee.raw.length),te.push(Ee);continue}if(Ee=this.tokenizer.del(q)){q=q.substring(Ee.raw.length),Ee.tokens=this.inlineTokens(Ee.text,[],ie,de),te.push(Ee);continue}if(Ee=this.tokenizer.autolink(q,_e)){q=q.substring(Ee.raw.length),te.push(Ee);continue}if(!ie&&(Ee=this.tokenizer.url(q,_e))){q=q.substring(Ee.raw.length),te.push(Ee);continue}if(Ee=this.tokenizer.inlineText(q,de,$e)){q=q.substring(Ee.raw.length),me=Ee.raw.slice(-1),te.push(Ee);continue}if(q){var ft="Infinite loop on byte: "+q.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return te},$(fe,null,[{key:"rules",get:function(){return{block:He,inline:Ge}}}]),fe}(),We=H.defaults,Ve=Q.cleanUrl,ze=Q.escape,Be=function(){function fe(ue){this.options=ue||We}var le=fe.prototype;return le.code=function(q,te,ie){var de=(te||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(q,de);me!=null&&me!==q&&(ie=!0,q=me)}return de?''+(ie?q:ze(q,!0))+`
`:""+(ie?q:ze(q,!0))+`
`},le.blockquote=function(q){return`
`+q+`
`},le.html=function(q){return q},le.heading=function(q,te,ie,de){return this.options.headerIds?"
`:""+q+"
`},le.hr=function(){return this.options.xhtml?`
`:`
`},le.list=function(q,te,ie){var de=te?"ol":"ul",me=te&&ie!==1?' start="'+ie+'"':"";return"<"+de+me+`>
`+q+""+de+`>
`},le.listitem=function(q){return""+q+`
`},le.checkbox=function(q){return" "},le.paragraph=function(q){return""+q+`
`},le.table=function(q,te){return te&&(te=""+te+""),`
`},le.tablerow=function(q){return`
`+q+`
`},le.tablecell=function(q,te){var ie=te.header?"th":"td",de=te.align?"<"+ie+' align="'+te.align+'">':"<"+ie+">";return de+q+""+ie+`>
`},le.strong=function(q){return""+q+""},le.em=function(q){return""+q+""},le.codespan=function(q){return""+q+""},le.br=function(){return this.options.xhtml?"
":"
"},le.del=function(q){return""+q+""},le.link=function(q,te,ie){if(q=Ve(this.options.sanitize,this.options.baseUrl,q),q===null)return ie;var de='"+ie+"",de},le.image=function(q,te,ie){if(q=Ve(this.options.sanitize,this.options.baseUrl,q),q===null)return ie;var de='
":">",de},le.text=function(q){return q},fe}(),Fe=function(){function fe(){}var le=fe.prototype;return le.strong=function(q){return q},le.em=function(q){return q},le.codespan=function(q){return q},le.del=function(q){return q},le.html=function(q){return q},le.text=function(q){return q},le.link=function(q,te,ie){return""+ie},le.image=function(q,te,ie){return""+ie},le.br=function(){return""},fe}(),ot=function(){function fe(){this.seen={}}var le=fe.prototype;return le.slug=function(q){var te=q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(te)){var ie=te;do this.seen[ie]++,te=ie+"-"+this.seen[ie];while(this.seen.hasOwnProperty(te))}return this.seen[te]=0,te},fe}(),it=H.defaults,Je=Q.unescape,qe=function(){function fe(ue){this.options=ue||it,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fe,this.slugger=new ot}fe.parse=function(q,te){var ie=new fe(te);return ie.parse(q)};var le=fe.prototype;return le.parse=function(q,te){te===void 0&&(te=!0);var ie="",de,me,Ee,Pe,rt,mt,ft,wt,Tt,ut,Ft,Ot,Zt,Xt,Rt,Ir,Kr,bt,Nr=q.length;for(de=0;de0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=bt+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=bt+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:bt}):Xt+=bt),Xt+=this.parse(Rt.tokens,Zt),Tt+=this.renderer.listitem(Xt,Kr,Ir);ie+=this.renderer.list(Tt,Ft,Ot);continue}case"html":{ie+=this.renderer.html(ut.text);continue}case"paragraph":{ie+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(Tt=ut.tokens?this.parseInline(ut.tokens):ut.text;de+1An error occurred:
"+Qe(Ee.message+"",!0)+"
";throw Ee}}Te.options=Te.setOptions=function(fe){return ct(Te.defaults,fe),lt(Te.defaults),Te},Te.getDefaults=we,Te.defaults=tt,Te.use=function(fe){var le=ct({},fe);if(fe.renderer&&function(){var q=Te.defaults.renderer||new Be,te=function(me){var Ee=q[me];q[me]=function(){for(var Pe=arguments.length,rt=new Array(Pe),mt=0;mt`,triples:"",explode:"[]{}"},_=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(w,x,u){u&&u!=ne.Init&&(w.removeKeyMap(N),w.state.closeBrackets=null),x&&(M(V(x,"pairs")),w.state.closeBrackets=x,w.addKeyMap(N))});function V(w,x){return x=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[x]!=null?w[x]:$[x]}var N={Backspace:P,Enter:O};function M(w){for(var x=0;x=0;l--){var C=a[l].head;w.replaceRange("",_(C.line,C.ch-1),_(C.line,C.ch+1),"+delete")}}function O(w){var x=F(w),u=x&&V(x,"explode");if(!u||w.getOption("disableInput"))return ne.Pass;for(var a=w.listSelections(),l=0;l0;return{anchor:new _(w.anchor.line,w.anchor.ch+(x?-1:1)),head:new _(w.head.line,w.head.ch+(x?1:-1))}}function A(w,x){var u=F(w);if(!u||w.getOption("disableInput"))return ne.Pass;var a=V(u,"pairs"),l=a.indexOf(x);if(l==-1)return ne.Pass;for(var h=V(u,"closeBefore"),C=V(u,"triples"),g=a.charAt(l+1)==x,m=w.listSelections(),k=l%2==0,v,f=0;f=0&&w.getRange(d,_(d.line,d.ch+3))==x+x+x?o="skipThree":o="skip";else if(g&&d.ch>1&&C.indexOf(x)>=0&&w.getRange(_(d.line,d.ch-2),d)==x+x){if(d.ch>2&&/\bstring/.test(w.getTokenTypeAt(_(d.line,d.ch-2))))return ne.Pass;o="addFour"}else if(g){var y=d.ch==0?" ":w.getRange(_(d.line,d.ch-1),d);if(!ne.isWordChar(S)&&y!=x&&!ne.isWordChar(y))o="both";else return ne.Pass}else if(k&&(S.length===0||/\s/.test(S)||h.indexOf(S)>-1))o="both";else return ne.Pass;if(!v)v=o;else if(v!=o)return ne.Pass}var T=l%2?a.charAt(l-1):x,I=l%2?x:a.charAt(l+1);w.operation(function(){if(v=="skip")w.execCommand("goCharRight");else if(v=="skipThree")for(var G=0;G<3;G++)w.execCommand("goCharRight");else if(v=="surround"){for(var X=w.getSelections(),G=0;G1&&arguments[1]!==void 0?arguments[1]:1,ue=Fe.length,q=0;q1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(W).map(function(ae,pe){if(!N.isValidElement(ae)||!ae.type)return null;var ve=ae.type.isSelectOptGroup,De=ae.key,xe=ae.props,Ce=xe.children,Ae=Object(H.a)(xe,["children"]);return ee||!ve?v(ae):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(De===null?pe:De,"__"),label:De},Ae),{},{options:f(Ce)})}).filter(function(ae){return ae})}var p=re("2Qr1"),d=re("qNPg"),o=re("U8pU"),S=re("Kwbf"),y=re("WKfj");function T(W){var ee=W.mode,ae=W.options,pe=W.children,ve=W.backfill,De=W.allowClear,xe=W.placeholder,Ce=W.getInputElement,Ae=W.showSearch,Se=W.onSearch,ge=W.defaultOpen,oe=W.autoFocus,Re=W.labelInValue,Ze=W.value,He=W.inputValue,Ge=W.optionLabelProp,$e=ee==="multiple"||ee==="tags",_e=Ae!==void 0?Ae:$e||ee==="combobox",Ie=ae||f(pe);if(Object(S.a)(ee!=="tags"||Ie.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var We=Ie.some(function(Be){return Be.options?Be.options.some(function(Fe){return typeof("value"in Fe?Fe.value:Fe.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(S.a)(!We,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(ee!=="combobox"||!Ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(ee==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(S.a)(ee==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(S.b)(ee!=="combobox"||!Ce||!De||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!_e&&ee!=="combobox"&&ee!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!ge||oe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ze!=null){var Ve=Object(y.d)(Ze);Object(S.a)(!Re||Ve.every(function(Be){return Object(o.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!$e||Array.isArray(Ze),"`value` should be array when `mode` is `multiple` or `tags`")}if(pe){var ze=null;Object(k.a)(pe).some(function(Be){if(!N.isValidElement(Be)||!Be.type)return!1;var Fe=Be.type;if(Fe.isSelectOption)return!1;if(Fe.isSelectOptGroup){var ot=Object(k.a)(Be.props.children).every(function(it){return!N.isValidElement(it)||!Be.type||it.type.isSelectOption?!0:(ze=it.type,!1)});return!ot}return ze=Fe,!0}),ze&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ze.displayName||ze.name||ze,"`.")),Object(S.a)(He===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=T,G=Object(d.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:f,flattenOptions:p.d,getLabeledValue:p.e,filterOptions:p.b,isValueDisabled:p.g,findValueOption:p.c,warningProps:I,fillOptionsWithMissingValue:p.a}),X=function(W){Object(_.a)(ae,W);var ee=Object(V.a)(ae);function ae(){var pe;return Object(ne.a)(this,ae),pe=ee.apply(this,arguments),pe.selectRef=N.createRef(),pe.focus=function(){pe.selectRef.current.focus()},pe.blur=function(){pe.selectRef.current.blur()},pe}return Object($.a)(ae,[{key:"render",value:function(){return N.createElement(G,Object.assign({ref:this.selectRef},this.props))}}]),ae}(N.Component);X.Option=h,X.OptGroup=g;var Q=X,z=at.c=Q},M8RZ:function(xt,at,re){"use strict";re.d(at,"a",function(){return P});var ne=re("fWQN"),$=re("mtLc"),_=re("yKVA"),V=re("879j"),N=re("q1tI"),M=re.n(N),H=re("i8i4"),F=re.n(H),P=function(O){Object(_.a)(A,O);var b=Object(V.a)(A);function A(D){var L;Object(ne.a)(this,A),L=b.call(this,D);var w=window.document;return L.node=w.createElement("div"),w.body.appendChild(L.node),L}return Object($.a)(A,[{key:"render",value:function(){var L=this.props.children;return Object(H.createPortal)(L,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),A}(M.a.Component)},OLES:function(xt,at,re){"use strict";var ne=re("U8pU"),$=re("VTBJ"),_=re("Ff2n"),V=re("q1tI"),N=re("uciX"),M=re("7ixt"),H=function(D){var L=D.overlay,w=D.prefixCls,x=D.id,u=D.overlayInnerStyle;return V.createElement("div",{className:"".concat(w,"-inner"),id:x,role:"tooltip",style:u},typeof L=="function"?L():L)},F=H,P=function(D,L){var w=D.overlayClassName,x=D.trigger,u=x===void 0?["hover"]:x,a=D.mouseEnterDelay,l=a===void 0?0:a,h=D.mouseLeaveDelay,C=h===void 0?.1:h,g=D.overlayStyle,m=D.prefixCls,k=m===void 0?"rc-tooltip":m,v=D.children,f=D.onVisibleChange,p=D.afterVisibleChange,d=D.transitionName,o=D.animation,S=D.placement,y=S===void 0?"right":S,T=D.align,I=T===void 0?{}:T,G=D.destroyTooltipOnHide,X=G===void 0?!1:G,Q=D.defaultVisible,z=D.getTooltipContainer,W=D.overlayInnerStyle,ee=Object(_.a)(D,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ae=Object(V.useRef)(null);Object(V.useImperativeHandle)(L,function(){return ae.current});var pe=Object($.a)({},ee);"visible"in D&&(pe.popupVisible=D.visible);var ve=function(){var Se=D.arrowContent,ge=Se===void 0?null:Se,oe=D.overlay,Re=D.id;return[V.createElement("div",{className:"".concat(k,"-arrow"),key:"arrow"},ge),V.createElement(F,{key:"content",prefixCls:k,id:Re,overlay:oe,overlayInnerStyle:W})]},De=!1,xe=!1;if(typeof X=="boolean")De=X;else if(X&&Object(ne.a)(X)==="object"){var Ce=X.keepParent;De=Ce===!0,xe=Ce===!1}return V.createElement(N.a,Object.assign({popupClassName:w,prefixCls:k,popup:ve,action:u,builtinPlacements:M.a,popupPlacement:y,ref:ae,popupAlign:I,getPopupContainer:z,onPopupVisibleChange:f,afterPopupVisibleChange:p,popupTransitionName:d,popupAnimation:o,defaultPopupVisible:Q,destroyPopupOnHide:De,autoDestroy:xe,mouseLeaveDelay:C,popupStyle:g,mouseEnterDelay:l},pe),v)},O=Object(V.forwardRef)(P),b=at.a=O},Ot1p:function(xt,at,re){"use strict";var ne=re("2qtc"),$=re("kLXV"),_=re("rAM+"),V=re("miYZ"),N=re("tsqr"),M=re("9og8"),H=re("tJVT"),F=re("jrin"),P=re("WmNS"),O=re.n(P),b=re("q1tI"),A=re.n(b),D=re("VrN/"),L=re.n(D),w=re("bdgK"),x=re("p77/"),u=re("Bd2K"),a=re("ELLl"),l=re("19Vz"),h=re("lZu9"),C=re("+NIl"),g=re("kSUc"),m=re("9Bee"),k=function(me){var Ee=me.value,Pe=Ee===void 0?"":Ee,rt=me.className,mt=me.showTextOnly,ft=me.showLines,wt=me.style,Tt=wt===void 0?{}:wt,ut=Object(b.useMemo)(function(){return""},[Pe]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},v=re("0Owb"),f=re("dejd"),p=re("C+DQ"),d=re("1vsH"),o=re("m3rI"),S=[{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 y(me){var Ee=me.onActionCallback,Pe=me.title,rt=me.icon,mt=me.actionName,ft=me.className,wt=ft===void 0?"":ft,Tt=me.children;function ut(){Ee(mt)}return A.a.createElement("a",{title:Pe,className:wt,onClick:ut},A.a.createElement("i",{className:"md-iconfont ".concat(rt)}),Tt)}var T=function(me){var Ee=me.watch,Pe=me.showNullButton,rt=me.onActionCallback,mt=me.fullScreen,ft=me.insertTemp,wt=me.hidetoolBar,Tt=me.uuid,ut=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.F)("_educoder_session"),"&key=").concat(Tt,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Ft=[].concat(S,[{title:"".concat(Ee?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ee?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ft.map(function(Ot,Zt){return A.a.createElement("li",{key:Zt},Ot.actionName?A.a.createElement(y,Object(v.a)({},Ot,{onActionCallback:rt})):A.a.createElement("span",{className:"v-line"}))}),Pe?A.a.createElement("li",null,A.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&A.a.createElement("li",null,A.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:rt},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},I=re("M8RZ"),G=re("+L6B"),X=re("2/Rp"),Q=re("y8nQ"),z=re("Vl3Y"),W=re("5NDa"),ee=re("5rEg"),ae={labelCol:{span:4},wrapperCol:{span:20}},pe=function(me){var Ee=me.callback,Pe=me.onCancel;function rt(mt){Ee(mt)}return A.a.createElement(z.a,Object(v.a)({},ae,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),A.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement(ee.a,null)),A.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement(ee.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(X.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},ve=re("7ahc"),De=re("HmJG"),xe=re("BjJ7"),Ce=z.a.useForm,Ae={width:280,marginRight:10},Se={labelCol:{span:5},wrapperCol:{span:19}},ge=function(me){var Ee=me.callback,Pe=me.onCancel,rt=Ce(),mt=Object(H.a)(rt,1),ft=mt[0];function wt(Ft){Ee(Ft)}function Tt(Ft,Ot){if(Ft.status===-1){N.b.error(Ft.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:Ot.type})}function ut(Ft){var Ot=Ft.target.files[0];Re(Ot,Tt)}return A.a.createElement(z.a,Object(v.a)({form:ft},Se,{className:"upload-image-panel",onFinish:wt}),A.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},A.a.createElement(ee.a,{style:Ae})),A.a.createElement(oe,{onFileChange:ut}))),A.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},A.a.createElement(ee.a,{style:{width:264}})),A.a.createElement(z.a.Item,{style:{textAlign:"right"}},A.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(X.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))};function oe(me){var Ee=me.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:Ee}))}function Re(me,Ee){if(!me)throw new String("\u6CA1\u6709\u6587\u4EF6");var Pe=new FormData;Pe.append("editormd-image-file",me),Pe.append("file_param_name","editormd-image-file"),Pe.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(mt){Ee(JSON.parse(mt.target.responseText),me)},!1),rt.addEventListener("error",function(mt){console.error(mt)},!1),rt.open("POST","".concat(xe.a,"/api/attachments.json")),rt.send(Pe)}var Ze=re("giR+"),He=re("fyUT"),Ge=re("7Kak"),$e=re("9yH6"),_e=$e.a.Group,Ie={margin:"0 8px"},We=function(me){var Ee=me.callback,Pe=me.onCancel;function rt(mt){Ee(mt)}return A.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},A.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},A.a.createElement("span",{style:Ie},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:Ie},"\u884C\u6570"),A.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(He.a,null)),A.a.createElement("span",{style:Ie},"\u5217\u6570"),A.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(He.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},A.a.createElement("span",{style:Ie},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(z.a.Item,{name:"align"},A.a.createElement(_e,null,A.a.createElement($e.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement($e.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement($e.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement($e.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(X.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},Ve=re("ErOA"),ze=re("7Cbv"),Be="link",Fe="upload-image",ot="code-block",it="add-table",Je="------------",qe={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},ct=re("9VGf"),et,Qe;function we(){}var lt=0,tt=1e4,Te="\u2581",Le=`
**\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 fe(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var le=navigator.platform.toUpperCase().indexOf("MAC")>=0,ue=le?"Cmd":"Ctrl",q=["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"],te=(et={},Object(F.a)(et,ue+"-B","bold"),Object(F.a)(et,ue+"-I","italic"),et),ie=(Qe={},Object(F.a)(Qe,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Qe,ot,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Qe,Fe,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Qe,it,"\u6DFB\u52A0\u8868\u683C"),Qe),de=at.a=function(me){var Ee=me.defaultValue,Pe=Ee===void 0?"":Ee,rt=me.onChange,mt=me.width,ft=mt===void 0?"100%":mt,wt=me.height,Tt=wt===void 0?400:wt,ut=me.miniToolbar,Ft=ut===void 0?!1:ut,Ot=me.isFocus,Zt=Ot===void 0?!1:Ot,Xt=me.watch,Rt=me.insertTemp,Ir=me.mode,Kr=Ir===void 0?"markdown":Ir,bt=me.id,Nr=bt===void 0?"markdown-editor-id":bt,hr=me.showResizeBar,pr=hr===void 0?!1:hr,Br=me.noStorage,ci=Br===void 0?!1:Br,qr=me.showNullButton,It=qr===void 0?!1:qr,ht=me.hidetoolBar,Hr=ht===void 0?!1:ht,ei=me.fullScreen,mr=ei===void 0?!1:ei,kt=me.onBlur,Fr=me.onCMBeforeChange,Vr=me.onFullScreen,fi=me.className,Ue=fi===void 0?"":fi,St=me.disablePaste,pi=St===void 0?!1:St,mi=me.placeholder,gi=mi===void 0?"":mi,vi=me.values,j=vi===void 0?"":vi,s=Object(b.useState)(null),c=Object(H.a)(s,2),R=c[0],Z=c[1],U=Object(b.useState)(Pe),ce=Object(H.a)(U,2),Oe=ce[0],Ke=ce[1],dt=Object(b.useState)(Xt),Me=Object(H.a)(dt,2),vt=Me[0],Nt=Me[1],Kt=Object(b.useState)(mr),Rr=Object(H.a)(Kt,2),gr=Rr[0],vr=Rr[1],Xr=Object(b.useState)(""),Ri=Object(H.a)(Xr,2),nr=Ri[0],Ur=Ri[1],oi=Object(b.useState)(0),si=Object(H.a)(oi,2),Or=si[0],Oi=si[1],yi=Object(b.useState)(Tt),zi=Object(H.a)(yi,2),Ki=zi[0],Yr=zi[1],Gr=Object(b.useState)(!1),bi=Object(H.a)(Gr,2),dn=bi[0],xi=bi[1],Jt=Object(b.useRef)(Object(ze.a)()),Bt=Object(b.useRef)(!1),dr=Object(b.useRef)(),_t=Object(b.useRef)(),qt=Object(b.useRef)(),Wt=Object(b.useRef)(),ti=Object(b.useRef)(),ar=function(){var pt=Object(M.a)(O.a.mark(function Ct(){var yt,Lt;return O.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(Ve.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Jt.current}});case 2:Lt=Gt.sent,Lt!=null&&(yt=Lt.attachments)!==null&&yt!==void 0&&yt.length&&(console.log("cm:",R,_t),Lt.attachments.map(function(Pt){Pt.content_type.indexOf("image")>-1?R.replaceSelection(".concat(Pt.content_type,")")):Pt.content_type.indexOf("video")>-1?R.replaceSelection('')):Pt.content_type.indexOf("pdf")>-1?R.replaceSelection('').concat(Pt.name,"")):R.replaceSelection("[".concat(Pt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(Pt.content_type,")"))}));case 4:case"end":return Gt.stop()}},Ct)}));return function(){return pt.apply(this,arguments)}}();Object(b.useEffect)(function(){Ke(j),R==null||R.setValue(j)},[j]),Object(b.useEffect)(function(){Vr==null||Vr(gr)},[gr]),Object(b.useEffect)(function(){if(_t.current){var pt=L.a.fromTextArea(_t.current,{mode:Kr,lineNumbers:!Ft,lineWrapping:!0,value:Pe,autoCloseTags:!0,autoCloseBrackets:!0});Zt&&pt.focus();function Ct(yt,Lt){if(pi){Lt.preventDefault();return}var Mt=Lt.clipboardData;if(Mt){var Gt=Mt.types.toString(),Pt=Mt.items;if(Gt==="Files"||Mt.types.indexOf("Files")>-1){if(Lt.preventDefault(),Kr=="stex")return;try{var rr,Cr=Pt[1];((rr=Pt[0])===null||rr===void 0?void 0:rr.kind)==="file"&&(Cr=Pt[0]);var Dt=Cr.getAsFile(),li=Dt.name.split(".").pop();Re(Dt,function(Ut){if(Ut.id){var wr,yr,zr;(Dt==null||((wr=Dt.type)===null||wr===void 0)?void 0:wr.indexOf("image"))>-1?pt.replaceSelection(".concat(Ut.content_type,")")):(Dt==null||((yr=Dt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?pt.replaceSelection('')):(Dt==null||((zr=Dt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?pt.replaceSelection('').concat(Dt.name,"")):q.includes(li)?pt.replaceSelection('').concat(Dt.name,"")):pt.replaceSelection("[".concat(Dt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}else(Ut==null?void 0:Ut.status)===401&&(document.location.href="/user/login")})}catch(Ut){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return pt.on("paste",Ct),pt.on("dragleave",function(yt,Lt){qt.current.classList.remove("mouse-hover-md")}),pt.on("dragover",function(yt,Lt){qt.current.classList.add("mouse-hover-md")}),pt.on("drop",function(yt,Lt){qt.current.classList.add("mouse-hover-md");var Mt;if(Mt=Lt.dataTransfer.files,Mt.length>0){Lt.preventDefault(),Lt.stopPropagation();for(var Gt=function(Cr){var Dt=Mt[Cr],li=Dt.name.split(".").pop();Re(Dt,function(Ut){if(Ut.id){var wr,yr,zr;(Dt==null||((wr=Dt.type)===null||wr===void 0)?void 0:wr.indexOf("image"))>-1?pt.replaceSelection(".concat(Ut.content_type,")")):(Dt==null||((yr=Dt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?pt.replaceSelection('')):(Dt==null||((zr=Dt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?pt.replaceSelection('').concat(Dt.name,"")):q.includes(li)?pt.replaceSelection('').concat(Dt.name,"")):pt.replaceSelection("[".concat(Dt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}else(Ut==null?void 0:Ut.status)===401&&(document.location.href="/user/login")})},Pt=0;Pt0||Pt.target.offsetWidth>0)&&(Er(),R.setSize("100%","100%"),R.refresh())}}catch(rr){Mt.e(rr)}finally{Mt.f()}});return yt.observe(_t.current.parentElement),yt}if(R){var Ct=pt();return function(){Ct.unobserve(_t.current.parentElement)}}},[R,Er]),Object(b.useEffect)(function(){if(R){for(var pt=[],Ct=function(){var Pt=Lt[yt];Mt=Object(H.a)(Pt,2);var rr=Mt[0],Cr=Mt[1],Dt=Object(F.a)({},rr,function(){Vi(Cr)});pt.push(Dt),R.addKeyMap(Dt)},yt=0,Lt=Object.entries(te);yt0){var pt=new Date().getTime(),Ct=window.sessionStorage.getItem(Nr);pt>=Or+tt&&(!Ct||Ct!==Oe)&&(window.sessionStorage.setItem(Nr,Oe),xi(!0))}},tt),Object(b.useEffect)(function(){Nt(Xt)},[R,Xt]),Object(b.useEffect)(function(){R&&(Zt&&R.focus())},[R,Zt]),Object(b.useEffect)(function(){if(vt&&R){var pt=R.getScrollerElement();function Ct(yt){var Lt=yt.target;if(ti.current){var Mt=Lt.scrollTop/Lt.scrollHeight;ti.current.scrollTop=ti.current.scrollHeight*Mt}}return pt.addEventListener("scroll",Ct),function(){pt.removeEventListener("scroll",Ct)}}},[R,vt]),Object(b.useEffect)(function(){if(R&&Fr){function pt(Ct,yt){Fr(Ct,yt)}return R.on("beforeChange",pt),function(){R.off("beforeChange",pt)}}},[R,Fr]),Object(b.useEffect)(function(){if(R&&kt){function pt(){kt(R.getValue())}return R.on("blur",pt),function(){R.off("blur",pt)}}},[R,kt]),Object(b.useEffect)(function(){if(R){function pt(Ct){var yt=Ct.getValue();Ke(yt),Oi(new Date().getTime()),Ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(yt)}return R.on("change",pt),function(){R.off("change",pt)}}},[R,rt]),Object(b.useEffect)(function(){R&&(Pe==null?(R.setValue(""),Ke("")):Pe!==R.getValue()&&(R.setValue(Pe),Ke(Pe),R.setCursor(R.lineCount(),0)))},[R,Pe]);var Vi=Object(b.useCallback)(function(pt){var Ct=R.getCursor(),yt=R.getSelection(),Lt=yt.split(`
`);switch(pt){case"bold":return R.replaceSelection("**"+yt+"**"),yt===""&&R.setCursor(Ct.line,Ct.ch+2),R.focus();case"italic":return R.replaceSelection("*"+yt+"*"),yt===""&&R.setCursor(Ct.line,Ct.ch+1),R.focus();case"code":return R.replaceSelection("`"+yt+"`"),yt===""&&R.setCursor(Ct.line,Ct.ch+1),R.focus();case"inline-latex":return R.replaceSelection("`$$"+yt+"$$`"),yt===""&&R.setCursor(Ct.line,Ct.ch+3),R.focus();case"latex":return R.replaceSelection("```latex\n"+yt+"\n```"),R.setCursor(Ct.line+1,yt.length+1),R.focus();case"line-break":return R.replaceSelection(`
`),R.focus();case"list-ul":return yt===""?R.replaceSelection("- "+yt):R.replaceSelection(Lt.map(function(Mt){return Mt===""?"":"- ".concat(Mt)}).join(`
`)),R.focus();case"list-ol":return yt===""?R.replaceSelection("1. "+yt):R.replaceSelection(Lt.map(function(Mt,Gt){return Mt===""?"":"".concat(Gt+1,". ").concat(Mt)}).join(`
`)),R.focus();case"add-null-ch":return yt===""&&R.setCursor(Ct.line,Ct.ch+1),R.replaceSelection(Te),R.focus();case"inster-template-1":return yt===""&&R.setCursor(Ct.line,Ct.ch),R.replaceSelection(Le),R.focus();case"eraser":return R.setValue(""),R.focus();case"trigger-watch":return Nt(!vt),R.focus();case"trigger-full-screen":return vr(!gr),R.focus();case Be:Ur(Be);return;case ot:Ur(ot);return;case Fe:Ur(Fe);return;case it:Ur(it);return;default:throw new Error}},[R,vt,gr]),Ei=Object(b.useCallback)(function(pt){Ur("");switch(nr){case Be:var Ct=pt.title,yt=pt.link;return R.replaceSelection("[".concat(Ct,"](").concat(yt,")")),R.focus();case ot:var Lt=pt.language,Mt=pt.content;return R.replaceSelection(["```"+Lt,Mt,"```"].join(`
`)),R.focus();case Fe:var Gt=pt.src,Pt=pt.alt;return Pt?R.replaceSelection(".concat(Gt,' "').concat(Pt,'" )')):R.replaceSelection("")),R.focus();case it:for(var rr=pt.row,Cr=pt.col,Dt=pt.align,li=`
`,Ut=0;Ut300&&(rr=300);var Cr=Tt+rr+"px";Yr(Cr)}}return pt.addEventListener("mousedown",Lt),document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",Mt),function(){pt.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",Mt)}}},[R,Wt]),Object(b.useEffect)(function(){Yr(Tt)},[Tt]);var ri=fe(ft),fn=fe(Ki),$r={width:ri,height:fn},pn=Object(b.useMemo)(function(){if(Or){var pt=new Date(Or),Ct=pt.getHours(),yt=pt.getMinutes(),Lt=pt.getSeconds();return Ct=Ct<10?"0"+Ct:Ct,yt=yt<10?"0"+yt:yt,Lt=Lt<10?"0"+Lt:Lt,"".concat(Ct,":").concat(yt,":").concat(Lt)}return 0},[Or]);function jn(){window.sessionStorage.removeItem(Nr),xi(!1),Oi(0)}function Pi(){xi(!1),Oi(0),R.setValue(window.sessionStorage.getItem(Nr))}function ua(pt,Ct){var yt=R.getValue();yt=yt.replace(pt,Ct),Ke(yt),R==null||R.setValue(yt)}return A.a.createElement(b.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:qt},A.a.createElement("div",{className:"markdown-editor-container ".concat(Ue," ").concat(vt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(gr?"full-screen":""),style:$r},A.a.createElement(T,{insertTemp:Rt,watch:vt,fullScreen:gr,showNullButton:It,onActionCallback:Vi,hidetoolBar:Hr,uuid:Jt.current,setOpenPhones:function(){Bt.current=!0}}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:_t,placeholder:gi})),vt?A.a.createElement("div",{ref:ti,className:"preview-container"},Kr==="stex"&&A.a.createElement(k,{value:Oe}),Kr!=="stex"&&A.a.createElement(m.a,{edit:!0,value:Oe,replaces:ua})):null))),pr?A.a.createElement("a",{ref:Wt,className:"editor-resize"}):null,A.a.createElement(I.a,null,ie[nr]?A.a.createElement($.a,{centered:!0,title:ie[nr],visible:!0,onCancel:Si,footer:null,className:"markdown-popup-form"},cn):null))}},SJMd:function(xt,at){/**
* @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 re,ne,$,_=!1,V,N;window.PR_SHOULD_USE_CONTINUATION=!0;var M,H;(function(){var F=window,P=["break,continue,do,else,for,if,return,while"],O=[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"],b=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],A=[b,"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"],D=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],L=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],w="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",x=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[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"],l=[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"],h=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[A,L,D,x,u,a,l,h],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",k="kwd",v="com",f="typ",p="lit",d="pun",o="pln",S="tag",y="dec",T="src",I="atn",G="atv",X="nocode",Q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(_e){for(var Ie=0,We=!1,Ve=!1,ze=0,Be=_e.length;ze122||(q<65||ue>90||lt.push([Math.max(65,ue)|32,Math.min(q,90)|32]),q<97||ue>122||lt.push([Math.max(97,ue)&~32,Math.min(q,122)&~32]))}}lt.sort(function(me,Ee){return me[0]-Ee[0]||Ee[1]-me[1]});for(var te=[],ie=[],Le=0;Lede[0]&&(de[1]+1>de[0]&&Te.push("-"),Te.push(Je(de[1])))}return Te.push("]"),Te.join("")}function ct(Qe){for(var we=Qe.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")),lt=we.length,tt=[],Te=0,Le=0;Te=2&&ue==="["?we[Te]=qe(fe):ue!=="\\"&&(we[Te]=fe.replace(/[a-zA-Z]/g,function(ie){var de=ie.charCodeAt(0);return"["+String.fromCharCode(de&~32,de|32)+"]"}))}return we.join("")}for(var et=[],ze=0,Be=_e.length;ze=0;)We[et.charAt(Qe)]=ct;var we=ct[1],lt=""+we;it.hasOwnProperty(lt)||(ot.push(we),it[lt]=null)}ot.push(/[\0-\uffff]/),Ve=z(ot)})();var ze=Ie.length,Be=function(Fe){for(var ot=Fe.sourceCode,it=Fe.basePos,Je=Fe.sourceNode,qe=[it,o],ct=0,et=ot.match(Ve)||[],Qe={},we=0,lt=et.length;we=5&&Te.substring(0,5)==="lang-",fe&&!(Le&&typeof Le[1]=="string")&&(fe=!1,Te=T),fe||(Qe[tt]=Te)}var q=ct;if(ct+=tt.length,!fe)qe.push(it+q,Te);else{var te=Le[1],ie=tt.indexOf(te),de=ie+te.length;Le[2]&&(de=tt.length-Le[2].length,ie=de-te.length);var me=Te.substring(5);ee(Je,it+q,tt.substring(0,ie),Be,qe),ee(Je,it+q+ie,te,oe(me,te),qe),ee(Je,it+q+de,tt.substring(de),Be,qe)}}Fe.decorations=qe};return Be}function De(_e){var Ie=[],We=[];_e.tripleQuotedStrings?Ie.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_e.multiLineStrings?Ie.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ie.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_e.verbatimStrings&&We.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ve=_e.hashComments;Ve&&(_e.cStyleComments?(Ve>1?Ie.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ie.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),We.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ie.push([v,/^#[^\r\n]*/,null,"#"])),_e.cStyleComments&&(We.push([v,/^\/\/[^\r\n]*/,null]),We.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ze=_e.regexLiterals;if(ze){var Be=ze>1?"":`
\r`,Fe=Be?".":"[\\S\\s]",ot="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+Fe+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+Fe+")*(?:\\x5D|$))+/";We.push(["lang-regex",RegExp("^"+Q+"("+ot+")")])}var it=_e.types;it&&We.push([f,it]);var Je=(""+_e.keywords).replace(/^ | $/g,"");Je.length&&We.push([k,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),Ie.push([o,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return _e.regexLiterals&&(qe+="(?!s*/)"),We.push([p,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[p,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[d,new RegExp(qe),null]),ve(Ie,We)}var xe=De({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(_e,Ie,We){for(var Ve=/(?:^|\s)nocode(?:\s|$)/,ze=/\r\n?|\n/,Be=_e.ownerDocument,Fe=Be.createElement("li");_e.firstChild;)Fe.appendChild(_e.firstChild);var ot=[Fe];function it(we){var lt=we.nodeType;if(lt==1&&!Ve.test(we.className))if(we.nodeName==="br")Je(we),we.parentNode&&we.parentNode.removeChild(we);else for(var tt=we.firstChild;tt;tt=tt.nextSibling)it(tt);else if((lt==3||lt==4)&&We){var Te=we.nodeValue,Le=Te.match(ze);if(Le){var fe=Te.substring(0,Le.index);we.nodeValue=fe;var le=Te.substring(Le.index+Le[0].length);if(le){var ue=we.parentNode;ue.insertBefore(Be.createTextNode(le),we.nextSibling)}Je(we),fe||we.parentNode.removeChild(we)}}}function Je(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function lt(Le,fe){var le=fe?Le.cloneNode(!1):Le,ue=Le.parentNode;if(ue){var q=lt(ue,1),te=Le.nextSibling;q.appendChild(le);for(var ie=te;ie;ie=te)te=ie.nextSibling,q.appendChild(ie)}return le}for(var tt=lt(we.nextSibling,0),Te;(Te=tt.parentNode)&&Te.nodeType===1;)tt=Te;ot.push(tt)}for(var qe=0;qe=ue&&(it+=2),Be>=q&&(ct+=2)}}finally{Te&&(Te.style.display=Le)}}var Se={};function ge(_e,Ie){for(var We=Ie.length;--We>=0;){var Ve=Ie[We];Se.hasOwnProperty(Ve)?F.console&&console.warn("cannot override language handler %s",Ve):Se[Ve]=_e}}function oe(_e,Ie){return _e&&Se.hasOwnProperty(_e)||(_e=/^\s*]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^