(window.webpackJsonp=window.webpackJsonp||[]).push([[175,7,8],{"+NIl":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Ae,me){"use strict";function Me(X,D){X.cmdState.push(D)}function xe(X){return X.cmdState.length>0?X.cmdState[X.cmdState.length-1]:null}function Ce(X){var D=X.cmdState.pop();D&&D.closeBracket()}function Y(X){for(var D=X.cmdState,$=D.length-1;$>=0;$--){var L=D[$];if(L.name=="DEFAULT")continue;return L}return{styleIdentifier:function(){return null}}}function I(X,D,$){return function(){this.name=X,this.bracketNo=0,this.style=D,this.styles=$,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var V={};V.importmodule=I("importmodule","tag",["string","builtin"]),V.documentclass=I("documentclass","tag",["","atom"]),V.usepackage=I("usepackage","tag",["atom"]),V.begin=I("begin","tag",["atom"]),V.end=I("end","tag",["atom"]),V.label=I("label","tag",["atom"]),V.ref=I("ref","tag",["atom"]),V.eqref=I("eqref","tag",["atom"]),V.cite=I("cite","tag",["atom"]),V.bibitem=I("bibitem","tag",["atom"]),V.Bibitem=I("Bibitem","tag",["atom"]),V.RBibitem=I("RBibitem","tag",["atom"]),V.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function J(X,D){X.f=D}function j(X,D){var $;if(X.match(/^\\[a-zA-Z@]+/)){var L=X.current().slice(1);return $=V.hasOwnProperty(L)?V[L]:V.DEFAULT,$=new $,Me(D,$),J(D,se),$.style}if(X.match(/^\\[$&%#{}_]/))return"tag";if(X.match(/^\\[,;!\/\\]/))return"tag";if(X.match("\\["))return J(D,function(_,de){return F(_,de,"\\]")}),"keyword";if(X.match("\\("))return J(D,function(_,de){return F(_,de,"\\)")}),"keyword";if(X.match("$$"))return J(D,function(_,de){return F(_,de,"$$")}),"keyword";if(X.match("$"))return J(D,function(_,de){return F(_,de,"$")}),"keyword";var te=X.next();if(te=="%")return X.skipToEnd(),"comment";if(te=="}"||te=="]"){if($=xe(D),$)$.closeBracket(te),J(D,se);else return"error";return"bracket"}else return te=="{"||te=="["?($=V.DEFAULT,$=new $,Me(D,$),"bracket"):/\d/.test(te)?(X.eatWhile(/[\w.%]/),"atom"):(X.eatWhile(/[\w\-_]/),$=Y(D),$.name=="begin"&&($.argument=X.current()),$.styleIdentifier())}function F(X,D,$){if(X.eatSpace())return null;if($&&X.match($))return J(D,j),"keyword";if(X.match(/^\\[a-zA-Z@]+/))return"tag";if(X.match(/^[a-zA-Z]+/))return"variable-2";if(X.match(/^\\[$&%#{}_]/))return"tag";if(X.match(/^\\[,;!\/]/))return"tag";if(X.match(/^[\^_&]/))return"tag";if(X.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(X.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var L=X.next();return L=="{"||L=="}"||L=="["||L=="]"||L=="("||L==")"?"bracket":L=="%"?(X.skipToEnd(),"comment"):"error"}function se(X,D){var $=X.peek(),L;return $=="{"||$=="["?(L=xe(D),L.openBracket($),X.eat($),J(D,j),"bracket"):/[ \t\r]/.test($)?(X.eat($),null):(J(D,j),Ce(D),j(X,D))}return{startState:function(){var X=me.inMathMode?function(D,$){return F(D,$)}:j;return{cmdState:[],f:X}},copyState:function(X){return{cmdState:X.cmdState.slice(),f:X.f}},token:function(X,D){return D.f(X,D)},blankLine:function(X){X.f=j,X.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+RXH":function(at,Ge,p){at.exports=p.p+"static/shu.a39bf729.svg"},"+yhJ":function(at,Ge,p){at.exports=p.p+"static/xixi.d492fb65.svg"},"0eGx":function(at,Ge,p){at.exports=p.p+"static/zhong.c1924b73.svg"},"19Vz":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(I,V,J){var j=J&&J!=ie.Init;if(V&&!j)I.on("blur",xe),I.on("change",Ce),I.on("swapDoc",Ce),ie.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){Me(I)}),Ce(I);else if(!V&&j){I.off("blur",xe),I.off("change",Ce),I.off("swapDoc",Ce),ie.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),Ae(I);var F=I.getWrapperElement();F.className=F.className.replace(" CodeMirror-empty","")}V&&!I.hasFocus()&&xe(I)});function Ae(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function me(I){Ae(I);var V=I.state.placeholder=document.createElement("pre");V.style.cssText="height: 0; overflow: visible",V.style.direction=I.getOption("direction"),V.className="CodeMirror-placeholder CodeMirror-line-like";var J=I.getOption("placeholder");typeof J=="string"&&(J=document.createTextNode(J)),V.appendChild(J),I.display.lineSpace.insertBefore(V,I.display.lineSpace.firstChild)}function Me(I){setTimeout(function(){var V=!1,J=I.getInputField();J.nodeName=="TEXTAREA"?V=!J.value:I.lineCount()==1&&(V=!/[^\u200b]/.test(J.querySelector(".CodeMirror-line").textContent)),V?me(I):Ae(I)},20)}function xe(I){Y(I)&&me(I)}function Ce(I){var V=I.getWrapperElement(),J=Y(I);V.className=V.className.replace(" CodeMirror-empty","")+(J?" CodeMirror-empty":""),J?me(I):Ae(I)}function Y(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1eCo":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";var Ae={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},me={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Me,xe){var Ce=Me.indentUnit,Y={},I=xe.htmlMode?Ae:me;for(var V in I)Y[V]=I[V];for(var V in xe)Y[V]=xe[V];var J,j;function F(b,z){function A(be){return z.tokenize=be,be(b,z)}var k=b.next();if(k=="<")return b.eat("!")?b.eat("[")?b.match("CDATA[")?A(D("atom","]]>")):null:b.match("--")?A(D("comment","-->")):b.match("DOCTYPE",!0,!0)?(b.eatWhile(/[\w\._\-]/),A($(1))):null:b.eat("?")?(b.eatWhile(/[\w\._\-]/),z.tokenize=D("meta","?>"),"meta"):(J=b.eat("/")?"closeTag":"openTag",z.tokenize=se,"tag bracket");if(k=="&"){var Z;return b.eat("#")?b.eat("x")?Z=b.eatWhile(/[a-fA-F\d]/)&&b.eat(";"):Z=b.eatWhile(/[\d]/)&&b.eat(";"):Z=b.eatWhile(/[\w\.\-:]/)&&b.eat(";"),Z?"atom":"error"}else return b.eatWhile(/[^&<]/),null}F.isInText=!0;function se(b,z){var A=b.next();if(A==">"||A=="/"&&b.eat(">"))return z.tokenize=F,J=A==">"?"endTag":"selfcloseTag","tag bracket";if(A=="=")return J="equals",null;if(A=="<"){z.tokenize=F,z.state=de,z.tagName=z.tagStart=null;var k=z.tokenize(b,z);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(A)?(z.tokenize=X(A),z.stringStartCol=b.column(),z.tokenize(b,z)):(b.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function X(b){var z=function(A,k){for(;!A.eol();)if(A.next()==b){k.tokenize=se;break}return"string"};return z.isInAttribute=!0,z}function D(b,z){return function(A,k){for(;!A.eol();){if(A.match(z)){k.tokenize=F;break}A.next()}return b}}function $(b){return function(z,A){for(var k;(k=z.next())!=null;){if(k=="<")return A.tokenize=$(b+1),A.tokenize(z,A);if(k==">")if(b==1){A.tokenize=F;break}else return A.tokenize=$(b-1),A.tokenize(z,A)}return"meta"}}function L(b,z,A){this.prev=b.context,this.tagName=z,this.indent=b.indented,this.startOfLine=A,(Y.doNotIndent.hasOwnProperty(z)||b.context&&b.context.noIndent)&&(this.noIndent=!0)}function te(b){b.context&&(b.context=b.context.prev)}function _(b,z){for(var A;;){if(!b.context)return;if(A=b.context.tagName,!Y.contextGrabbers.hasOwnProperty(A)||!Y.contextGrabbers[A].hasOwnProperty(z))return;te(b)}}function de(b,z,A){return b=="openTag"?(A.tagStart=z.column(),_e):b=="closeTag"?ce:de}function _e(b,z,A){return b=="word"?(A.tagName=z.current(),j="tag",ee):Y.allowMissingTagName&&b=="endTag"?(j="tag bracket",ee(b,z,A)):(j="error",_e)}function ce(b,z,A){if(b=="word"){var k=z.current();return A.context&&A.context.tagName!=k&&Y.implicitlyClosed.hasOwnProperty(A.context.tagName)&&te(A),A.context&&A.context.tagName==k||Y.matchClosing===!1?(j="tag",M):(j="tag error",g)}else return Y.allowMissingTagName&&b=="endTag"?(j="tag bracket",M(b,z,A)):(j="error",g)}function M(b,z,A){return b!="endTag"?(j="error",M):(te(A),de)}function g(b,z,A){return j="error",M(b,z,A)}function ee(b,z,A){if(b=="word")return j="attribute",S;if(b=="endTag"||b=="selfcloseTag"){var k=A.tagName,Z=A.tagStart;return A.tagName=A.tagStart=null,b=="selfcloseTag"||Y.autoSelfClosers.hasOwnProperty(k)?_(A,k):(_(A,k),A.context=new L(A,k,Z==A.indented)),de}return j="error",ee}function S(b,z,A){return b=="equals"?B:(Y.allowMissing||(j="error"),ee(b,z,A))}function B(b,z,A){return b=="string"?x:b=="word"&&Y.allowUnquoted?(j="string",ee):(j="error",ee(b,z,A))}function x(b,z,A){return b=="string"?x:ee(b,z,A)}return{startState:function(b){var z={tokenize:F,state:de,indented:b||0,tagName:null,tagStart:null,context:null};return b!=null&&(z.baseIndent=b),z},token:function(b,z){if(!z.tagName&&b.sol()&&(z.indented=b.indentation()),b.eatSpace())return null;J=null;var A=z.tokenize(b,z);return(A||J)&&A!="comment"&&(j=null,z.state=z.state(J||A,b,z),j&&(A=j=="error"?A+" error":j)),A},indent:function(b,z,A){var k=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+Ce;if(k&&k.noIndent)return ie.Pass;if(b.tokenize!=se&&b.tokenize!=F)return A?A.match(/^(\s*)/)[0].length:0;if(b.tagName)return Y.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+Ce*(Y.multilineTagIndentFactor||1);if(Y.alignCDATA&&/$/,blockCommentStart:"",configuration:Y.htmlMode?"html":"xml",helperType:Y.htmlMode?"html":"xml",skipAttribute:function(b){b.state==B&&(b.state=ee)},xmlCurrentTag:function(b){return b.tagName?{name:b.tagName,close:b.type=="closeTag"}:null},xmlCurrentContext:function(b){for(var z=[],A=b.context;A;A=A.prev)A.tagName&&z.push(A.tagName);return z.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2sxD":function(at,Ge,p){at.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB":function(at,Ge,p){at.exports=p.p+"static/sc.c1696770.svg"},"5MlY":function(at,Ge,p){at.exports=p.p+"static/sm.8ccb50bf.svg"},"6+eU":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return M});var ie=p("wx14"),Ae=p("rePB"),me=p("VTBJ"),Me=p("1OyB"),xe=p("vuIU"),Ce=p("Ji7U"),Y=p("LK+K"),I=p("q1tI"),V=p.n(I),J=p("TSYQ"),j=p.n(J),F=function(ee){var S,B="".concat(ee.rootPrefixCls,"-item"),x=j()(B,"".concat(B,"-").concat(ee.page),(S={},Object(Ae.a)(S,"".concat(B,"-active"),ee.active),Object(Ae.a)(S,ee.className,!!ee.className),Object(Ae.a)(S,"".concat(B,"-disabled"),!ee.page),S)),b=function(){ee.onClick(ee.page)},z=function(k){ee.onKeyPress(k,ee.onClick,ee.page)};return V.a.createElement("li",{title:ee.showTitle?ee.page:null,className:x,onClick:b,onKeyPress:z,tabIndex:"0"},ee.itemRender(ee.page,"page",V.a.createElement("a",{rel:"nofollow"},ee.page)))},se=F,X={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},D=function(g){Object(Ce.a)(S,g);var ee=Object(Y.a)(S);function S(){var B;Object(Me.a)(this,S);for(var x=arguments.length,b=new Array(x),z=0;z=0||A.relatedTarget.className.indexOf("".concat(ae,"-next"))>=0))return;B.setState({goInputText:""}),be(B.getValidValue())},B.go=function(A){var k=B.state.goInputText;if(k==="")return;(A.keyCode===X.ENTER||A.type==="click")&&(B.setState({goInputText:""}),B.props.quickGo(B.getValidValue()))},B}return Object(xe.a)(S,[{key:"getValidValue",value:function(){var x=this.state,b=x.goInputText,z=x.current;return!b||isNaN(b)?z:Number(b)}},{key:"getPageSizeOptions",value:function(){var x=this.props,b=x.pageSize,z=x.pageSizeOptions;return z.some(function(A){return A.toString()===b.toString()})?z:z.concat([b.toString()]).sort(function(A,k){var Z=isNaN(Number(A))?0:Number(A),be=isNaN(Number(k))?0:Number(k);return Z-be})}},{key:"render",value:function(){var x=this,b=this.props,z=b.pageSize,A=b.locale,k=b.rootPrefixCls,Z=b.changeSize,be=b.quickGo,ae=b.goButton,Te=b.selectComponentClass,P=b.buildOptionText,v=b.selectPrefixCls,le=b.disabled,He=this.state.goInputText,je="".concat(k,"-options"),Je=Te,we=null,Ee=null,G=null;if(!Z&&!be)return null;var U=this.getPageSizeOptions();if(Z&&Je){var ue=U.map(function(T,E){return V.a.createElement(Je.Option,{key:E,value:T.toString()},(P||x.buildOptionText)(T))});we=V.a.createElement(Je,{disabled:le,prefixCls:v,showSearch:!1,className:"".concat(je,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(z||U[0]).toString(),onChange:this.changeSize,getPopupContainer:function(E){return E.parentNode}},ue)}return be&&(ae&&(G=typeof ae=="boolean"?V.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:le,className:"".concat(je,"-quick-jumper-button")},A.jump_to_confirm):V.a.createElement("span",{onClick:this.go,onKeyUp:this.go},ae)),Ee=V.a.createElement("div",{className:"".concat(je,"-quick-jumper")},A.jump_to,V.a.createElement("input",{disabled:le,type:"text",value:He,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),A.page,G)),V.a.createElement("li",{className:"".concat(je)},we,Ee)}}]),S}(V.a.Component);D.defaultProps={pageSizeOptions:["10","20","50","100"]};var $=D,L=p("N2Kk");function te(){}function _(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function de(g,ee,S){return S}function _e(g,ee,S){var B=typeof g=="undefined"?ee.pageSize:g;return Math.floor((S.total-1)/B)+1}var ce=function(g){Object(Ce.a)(S,g);var ee=Object(Y.a)(S);function S(B){var x;Object(Me.a)(this,S),x=ee.call(this,B),x.getJumpPrevPage=function(){return Math.max(1,x.state.current-(x.props.showLessItems?3:5))},x.getJumpNextPage=function(){return Math.min(_e(void 0,x.state,x.props),x.state.current+(x.props.showLessItems?3:5))},x.getItemIcon=function(Z,be){var ae=x.props.prefixCls,Te=Z||V.a.createElement("button",{type:"button","aria-label":be,className:"".concat(ae,"-item-link")});return typeof Z=="function"&&(Te=V.a.createElement(Z,Object(me.a)({},x.props))),Te},x.savePaginationNode=function(Z){x.paginationNode=Z},x.isValid=function(Z){return _(Z)&&Z!==x.state.current},x.shouldDisplayQuickJumper=function(){var Z=x.props,be=Z.showQuickJumper,ae=Z.pageSize,Te=Z.total;return Te<=ae?!1:be},x.handleKeyDown=function(Z){(Z.keyCode===X.ARROW_UP||Z.keyCode===X.ARROW_DOWN)&&Z.preventDefault()},x.handleKeyUp=function(Z){var be=x.getValidValue(Z),ae=x.state.currentInputValue;be!==ae&&x.setState({currentInputValue:be}),Z.keyCode===X.ENTER?x.handleChange(be):Z.keyCode===X.ARROW_UP?x.handleChange(be-1):Z.keyCode===X.ARROW_DOWN&&x.handleChange(be+1)},x.changePageSize=function(Z){var be=x.state.current,ae=_e(Z,x.state,x.props);be=be>ae?ae:be,ae===0&&(be=x.state.current),typeof Z=="number"&&("pageSize"in x.props||x.setState({pageSize:Z}),"current"in x.props||x.setState({current:be,currentInputValue:be})),x.props.onShowSizeChange(be,Z),"onChange"in x.props&&x.props.onChange&&x.props.onChange(be,Z)},x.handleChange=function(Z){var be=x.props.disabled,ae=Z;if(x.isValid(ae)&&!be){var Te=_e(void 0,x.state,x.props);ae>Te?ae=Te:ae<1&&(ae=1),"current"in x.props||x.setState({current:ae,currentInputValue:ae});var P=x.state.pageSize;return x.props.onChange(ae,P),ae}return x.state.current},x.prev=function(){x.hasPrev()&&x.handleChange(x.state.current-1)},x.next=function(){x.hasNext()&&x.handleChange(x.state.current+1)},x.jumpPrev=function(){x.handleChange(x.getJumpPrevPage())},x.jumpNext=function(){x.handleChange(x.getJumpNextPage())},x.hasPrev=function(){return x.state.current>1},x.hasNext=function(){return x.state.current<_e(void 0,x.state,x.props)},x.runIfEnter=function(Z,be){if(Z.key==="Enter"||Z.charCode===13){for(var ae=arguments.length,Te=new Array(ae>2?ae-2:0),P=2;P=z?k=z:k=Number(b),k}},{key:"getShowSizeChanger",value:function(){var x=this.props,b=x.showSizeChanger,z=x.total,A=x.totalBoundaryShowSizeChanger;return typeof b!="undefined"?b:z>A}},{key:"renderPrev",value:function(x){var b=this.props,z=b.prevIcon,A=b.itemRender,k=A(x,"prev",this.getItemIcon(z,"prev page")),Z=!this.hasPrev();return Object(I.isValidElement)(k)?Object(I.cloneElement)(k,{disabled:Z}):k}},{key:"renderNext",value:function(x){var b=this.props,z=b.nextIcon,A=b.itemRender,k=A(x,"next",this.getItemIcon(z,"next page")),Z=!this.hasNext();return Object(I.isValidElement)(k)?Object(I.cloneElement)(k,{disabled:Z}):k}},{key:"render",value:function(){var x=this,b=this.props,z=b.prefixCls,A=b.className,k=b.style,Z=b.disabled,be=b.hideOnSinglePage,ae=b.total,Te=b.locale,P=b.showQuickJumper,v=b.showLessItems,le=b.showTitle,He=b.showTotal,je=b.simple,Je=b.itemRender,we=b.showPrevNextJumpers,Ee=b.jumpPrevIcon,G=b.jumpNextIcon,U=b.selectComponentClass,ue=b.selectPrefixCls,T=b.pageSizeOptions,E=this.state,he=E.current,Le=E.pageSize,Ze=E.currentInputValue;if(be===!0&&ae<=Le)return null;var ke=_e(void 0,this.state,this.props),Ue=[],ge=null,Re=null,Be=null,Qe=null,it=null,Xe=P&&P.goButton,De=v?1:2,Et=he-1>0?he-1:0,pt=he+1=De*2&&he!==1+2&&(Ue[0]=Object(I.cloneElement)(Ue[0],{className:"".concat(z,"-item-after-jump-prev")}),Ue.unshift(ge)),ke-he>=De*2&&he!==ke-2&&(Ue[Ue.length-1]=Object(I.cloneElement)(Ue[Ue.length-1],{className:"".concat(z,"-item-before-jump-next")}),Ue.push(Re)),Ut!==1&&Ue.unshift(Be),kt!==ke&&Ue.push(Qe)}var N=null;He&&(N=V.a.createElement("li",{className:"".concat(z,"-total-text")},He(ae,[ae===0?0:(he-1)*Le+1,he*Le>ae?ae:he*Le])));var H=!this.hasPrev()||!ke,K=!this.hasNext()||!ke;return V.a.createElement("ul",Object(ie.a)({className:j()(z,A,Object(Ae.a)({},"".concat(z,"-disabled"),Z)),style:k,unselectable:"unselectable",ref:this.savePaginationNode},bt),N,V.a.createElement("li",{title:le?Te.prev_page:null,onClick:this.prev,tabIndex:H?null:0,onKeyPress:this.runIfEnterPrev,className:j()("".concat(z,"-prev"),Object(Ae.a)({},"".concat(z,"-disabled"),H)),"aria-disabled":H},this.renderPrev(Et)),Ue,V.a.createElement("li",{title:le?Te.next_page:null,onClick:this.next,tabIndex:K?null:0,onKeyPress:this.runIfEnterNext,className:j()("".concat(z,"-next"),Object(Ae.a)({},"".concat(z,"-disabled"),K)),"aria-disabled":K},this.renderNext(pt)),V.a.createElement($,{disabled:Z,locale:Te,rootPrefixCls:z,selectComponentClass:U,selectPrefixCls:ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:he,pageSize:Le,pageSizeOptions:T,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Xe}))}}],[{key:"getDerivedStateFromProps",value:function(x,b){var z={};if("current"in x&&(z.current=x.current,x.current!==b.current&&(z.currentInputValue=z.current)),"pageSize"in x&&x.pageSize!==b.pageSize){var A=b.current,k=_e(x.pageSize,b,x);A=A>k?k:A,"current"in x||(z.current=A,z.currentInputValue=A),z.pageSize=x.pageSize}return z}}]),S}(V.a.Component);ce.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:te,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:te,locale:L.a,style:{},itemRender:de,totalBoundaryShowSizeChanger:50};var M=ce},"6K3P":function(at,Ge,p){at.exports=p.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(at,Ge,p){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Ae=new Uint8Array(16);function me(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(Ae)}var Me=/^(?:[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 xe(se){return typeof se=="string"&&Me.test(se)}for(var Ce=xe,Y=[],I=0;I<256;++I)Y.push((I+256).toString(16).substr(1));function V(se){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=(Y[se[X+0]]+Y[se[X+1]]+Y[se[X+2]]+Y[se[X+3]]+"-"+Y[se[X+4]]+Y[se[X+5]]+"-"+Y[se[X+6]]+Y[se[X+7]]+"-"+Y[se[X+8]]+Y[se[X+9]]+"-"+Y[se[X+10]]+Y[se[X+11]]+Y[se[X+12]]+Y[se[X+13]]+Y[se[X+14]]+Y[se[X+15]]).toLowerCase();if(!Ce(D))throw TypeError("Stringified UUID is invalid");return D}var J=V;function j(se,X,D){se=se||{};var $=se.random||(se.rng||me)();if($[6]=$[6]&15|64,$[8]=$[8]&63|128,X){D=D||0;for(var L=0;L<16;++L)X[D+L]=$[L];return X}return J($)}var F=Ge.a=j},"7ahc":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return _e});var ie=p("k1fw"),Ae=p("0Owb"),me=p("+L6B"),Me=p("2/Rp"),xe=p("y8nQ"),Ce=p("Vl3Y"),Y=p("tJVT"),I=p("OaEy"),V=p("2fM7"),J=p("q1tI"),j=p.n(J),F=p("VrN/"),se=p.n(F),X=p("p77/"),D=p.n(X),$=p("c5Ni"),L=p.n($),te=V.a.Option,_={labelCol:{span:4},wrapperCol:{span:20}},de={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ge.b=function(ce){var M=ce.callback,g=ce.onCancel,ee=Object(J.useState)("python"),S=Object(Y.a)(ee,2),B=S[0],x=S[1];function b(A){x(de[A][1])}function z(A){M(A)}return j.a.createElement(Ce.a,Object(Ae.a)({},_,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:z}),j.a.createElement(Ce.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},j.a.createElement(V.a,{onChange:b},Object.keys(de).map(function(A){return j.a.createElement(te,{key:A,value:A},de[A][0])}))),j.a.createElement(Ce.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},j.a.createElement(_e,{mode:B})),j.a.createElement("div",{className:"flex-container flex-end"},j.a.createElement(Me.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),j.a.createElement(Me.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function _e(ce){var M=ce.value,g=ce.onChange,ee=ce.mode,S=ce.options,B=S===void 0?{}:S,x=Object(J.useRef)(),b=Object(J.useState)(),z=Object(Y.a)(b,2),A=z[0],k=z[1];return Object(J.useEffect)(function(){if(A){function Z(be){var ae=be.getValue();g&&g(ae)}return A.on("change",Z),function(){A.off("change",Z)}}},[A,g]),Object(J.useEffect)(function(){A&&A.setOption("mode",ee)},[A,ee]),Object(J.useEffect)(function(){A&&((M!==A.getValue()||M==="")&&setTimeout(function(){A.setValue(M||" ")},300))},[A,M]),Object(J.useEffect)(function(){if(x.current&&!A){var Z=se.a.fromTextArea(x.current,Object(ie.a)({mode:ee,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},B));k(Z)}},[x.current,A]),j.a.createElement("div",{className:"my-codemirror-container"},j.a.createElement("textarea",{ref:x}))}},"7ixt":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return me});var ie={adjustX:1,adjustY:1},Ae=[0,0],me={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:Ae},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:Ae},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:Ae},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:Ae},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:Ae},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:Ae},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:Ae},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:Ae},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:Ae},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:Ae},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:Ae},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:Ae}},Me=me},"7qnI":function(at,Ge,p){"use strict";var ie=p("5Dmo"),Ae=p("3S7+"),me=p("fWQN"),Me=p("mtLc"),xe=p("yKVA"),Ce=p("879j"),Y=p("5NDa"),I=p("5rEg"),V=p("q1tI"),J=p.n(V),j=p("O2Wb"),F=p.n(j),se=I.a.TextArea,X=function(D){Object(xe.a)(L,D);var $=Object(Ce.a)(L);function L(){return Object(me.a)(this,L),$.apply(this,arguments)}return Object(Me.a)(L,[{key:"render",value:function(){var _=this,de=this.props,_e=de.index,ce=de.onAnswerChange,M=de.addChildAnswer,g=de.exerciseIsPublish,ee=de.answers,S=de.activeOptionErrorIndex,B=de.flex,x=B===void 0?"0 0 1000px":B;return J.a.createElement("div",{className:F.a.flex},J.a.createElement("div",{className:"".concat(F.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",_e+1,"):"),J.a.createElement("div",{className:"".concat(F.a.flex," ").concat(F.a.flex1),style:{flexDirection:"column"}},ee.map(function(b,z){var A="".concat(_e,"-").concat(z);return J.a.createElement("div",{className:"".concat(F.a.flex," ").concat(F.a.flex1),key:z},J.a.createElement("div",{className:F.a.flex1,style:{flex:x}},J.a.createElement("div",null,J.a.createElement(se,{className:A===S?F.a.error:"",spellCheck:!1,rows:4,value:b||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(z==0?"":"(\u53EF\u9009)"),onChange:function(Z){return ce(_e,z,Z.target.value)},style:{minHeight:95}}))),!g&&J.a.createElement(J.a.Fragment,null,z!=0&&J.a.createElement(Ae.a,{title:"\u5220\u9664"},J.a.createElement("i",{className:"".concat(F.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _.props.deleteChildAnswer(_e,z)},style:{float:"right"}})),z===0&&J.a.createElement(Ae.a,{title:"\u5220\u9664"},J.a.createElement("i",{className:"".concat(F.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _.props.deleteChildAnswermain(_e,z)},style:{float:"right"}})),J.a.createElement(Ae.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},J.a.createElement("i",{className:"".concat(F.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return M(_e)},style:{float:"right",visibility:z==ee.length-1?"":"hidden"}}))))})))}}]),L}(V.Component);Ge.a=X},"815F":function(at,Ge,p){"use strict";p.d(Ge,"e",function(){return Y}),p.d(Ge,"c",function(){return V}),p.d(Ge,"d",function(){return J}),p.d(Ge,"a",function(){return F}),p.d(Ge,"f",function(){return se}),p.d(Ge,"b",function(){return X});var ie=p("KQm4"),Ae=p("VTBJ"),me=p("Ff2n"),Me=p("Zm9Q"),xe=p("Kwbf"),Ce=p("OZM5");function Y(D,$){return D!=null?D:$}function I(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=new Map;function L(te){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(te||[]).forEach(function(de){var _e=de.key,ce=de.children;Object(xe.a)(_e!=null,"Tree node must have a certain key: [".concat(_).concat(_e,"]"));var M=String(_e);Object(xe.a)(!$.has(M)||_e===null||_e===void 0,"Same 'key' exist in the Tree: ".concat(M)),$.set(M,!0),L(ce,"".concat(_).concat(M," > "))})}L(D)}function V(D){function $(L){var te=Object(Me.a)(L);return te.map(function(_){if(!Object(Ce.i)(_))return Object(xe.a)(!_,"Tree/TreeNode can only accept TreeNode as children."),null;var de=_.key,_e=_.props,ce=_e.children,M=Object(me.a)(_e,["children"]),g=Object(Ae.a)({key:de},M),ee=$(ce);return ee.length&&(g.children=ee),g}).filter(function(_){return _})}return $(D)}function J(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],L=new Set($===!0?[]:$),te=[];function _(de){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return de.map(function(ce,M){var g=Object(Ce.h)(_e?_e.pos:"0",M),ee=Y(ce.key,g),S=Object(Ae.a)(Object(Ae.a)({},ce),{},{parent:_e,pos:g,children:null,data:ce,isStart:[].concat(Object(ie.a)(_e?_e.isStart:[]),[M===0]),isEnd:[].concat(Object(ie.a)(_e?_e.isEnd:[]),[M===de.length-1])});return te.push(S),$===!0||L.has(ee)?S.children=_(ce.children||[],S):S.children=[],S})}return _(D),te}function j(D,$,L){var te;L?typeof L=="string"?te=function(_e){return _e[L]}:typeof L=="function"&&(te=function(_e){return L(_e)}):te=function(_e,ce){return Y(_e.key,ce)};function _(de,_e,ce){var M=de?de.children:D,g=de?Object(Ce.h)(ce.pos,_e):"0";if(de){var ee=te(de,g),S={node:de,index:_e,pos:g,key:ee,parentPos:ce.node?ce.pos:null,level:ce.level+1};$(S)}M&&M.forEach(function(B,x){_(B,x,{node:de,pos:g,level:ce?ce.level+1:-1})})}_(null)}function F(D){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=$.initWrapper,te=$.processEntity,_=$.onProcessFinished,de=arguments.length>2?arguments[2]:void 0,_e={},ce={},M={posEntities:_e,keyEntities:ce};return L&&(M=L(M)||M),j(D,function(g){var ee=g.node,S=g.index,B=g.pos,x=g.key,b=g.parentPos,z=g.level,A={node:ee,index:S,key:x,pos:B,level:z},k=Y(x,B);_e[B]=A,ce[k]=A,A.parent=_e[b],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),te&&te(A,M)},de),_&&_(M),M}function se(D,$){var L=$.expandedKeys,te=$.selectedKeys,_=$.loadedKeys,de=$.loadingKeys,_e=$.checkedKeys,ce=$.halfCheckedKeys,M=$.dragOverNodeKey,g=$.dropPosition,ee=$.keyEntities,S=ee[D],B={eventKey:D,expanded:L.indexOf(D)!==-1,selected:te.indexOf(D)!==-1,loaded:_.indexOf(D)!==-1,loading:de.indexOf(D)!==-1,checked:_e.indexOf(D)!==-1,halfChecked:ce.indexOf(D)!==-1,pos:String(S?S.pos:""),dragOver:M===D&&g===0,dragOverGapTop:M===D&&g===-1,dragOverGapBottom:M===D&&g===1};return B}function X(D){var $=D.data,L=D.expanded,te=D.selected,_=D.checked,de=D.loaded,_e=D.loading,ce=D.halfChecked,M=D.dragOver,g=D.dragOverGapTop,ee=D.dragOverGapBottom,S=D.pos,B=D.active,x=Object(Ae.a)(Object(Ae.a)({},$),{},{expanded:L,selected:te,checked:_,loaded:de,loading:_e,halfChecked:ce,dragOver:M,dragOverGapTop:g,dragOverGapBottom:ee,pos:S,active:B});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(xe.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),D}}),x}},"8EBN":function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){"use strict";ie.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 Ae=0;Ae-1&&Me.substring(Y+1,Me.length);if(I)return ie.findModeByExtension(I)},ie.findModeByName=function(Me){Me=Me.toLowerCase();for(var xe=0;xe=u.length?h.slice(u.length):h}).join(`
`)}var L=[],te=[""],_=new X.a.Renderer,de=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _e(){L.length=0,te=[""]}var ce={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function M(c,o,r,u){if(o>=c.length||c[o].level<=r)return o;var h=c[o];u.push("- "+h.text+""),o++;var d=[];return o=M(c,o,h.level,d),d.length>0&&(u.push("
"),d.forEach(function(q){u.push(q)}),u.push("
")),u.push(" "),o=M(c,o,r,u),o}function g(){return M(L,0,0,te),te.push("
"),te.join("")}var ee={heading:function(o){var r=de.exec(o);if(r)return{type:"heading",raw:r[0],depth:r[1].length,text:r[2]}},fences:function(o){var r=this.rules.block.fences.exec(o);if(r){var u=r[0],h=$(u,r[3]||""),d=r[2]?r[2].trim():r[2];if(["latex","katex","math"].indexOf(d)>=0){var q=x(),Ye=h;h=q,b[q]={type:"block",expression:Ye}}return{type:"code",raw:u,lang:d,text:h}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,B=0,x=function(){return"__special_katext_id_".concat(B++,"__")},b={};function z(){return b}function A(){B=0,b={}}function k(c){return c=c.replace(S,function(o,r){var u=x();return b[u]={type:"inline",expression:r},u}),c}var Z=_.listitem;_.listitem=function(c){return Z(k(c))};var be=_.paragraph;_.paragraph=function(c){return be(k(c))};var ae=_.tablecell;_.tablecell=function(c,o){return ae(k(c),o)},_.code=function(c,o,r){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"".concat(c,"
"):'
').concat(r?c:Object(D.escape)(c,!0),`
`):''+(r?c:Object(D.escape)(c,!0))+"
"},_.heading=function(c,o,r){var u=this.options.headerPrefix+r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return L.push({anchor:u,level:o,text:c}),"'+c+""},X.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),X.a.use({tokenizer:ee,renderer:_});var Te=X.a,P=p("SJMd"),v=p("ulZh"),le=p.n(v),He=p("m3rI"),je=p("Oy/b"),Je=p("p5ED"),we=p("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 Ee=function(c,o){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,u){r.__proto__=u}||function(r,u){for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(r[h]=u[h])})(c,o)};function G(c,o){function r(){this.constructor=c}Ee(c,o),c.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}function U(c,o,r,u){return new(r||(r=Promise))(function(h,d){function q(Nt){try{st(u.next(Nt))}catch(ve){d(ve)}}function Ye(Nt){try{st(u.throw(Nt))}catch(ve){d(ve)}}function st(Nt){var ve;Nt.done?h(Nt.value):(ve=Nt.value,ve instanceof r?ve:new r(function(oe){oe(ve)})).then(q,Ye)}st((u=u.apply(c,o||[])).next())})}function ue(c,o){var r,u,h,d,q={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return d={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function Ye(st){return function(Nt){return function(ve){if(r)throw new TypeError("Generator is already executing.");for(;q;)try{if(r=1,u&&(h=2&ve[0]?u.return:ve[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,ve[1])).done)return h;switch(u=0,h&&(ve=[2&ve[0],h.value]),ve[0]){case 0:case 1:h=ve;break;case 4:return q.label++,{value:ve[1],done:!1};case 5:q.label++,u=ve[1],ve=[0];continue;case 7:ve=q.ops.pop(),q.trys.pop();continue;default:if(!(h=q.trys,(h=h.length>0&&h[h.length-1])||ve[0]!==6&&ve[0]!==2)){q=0;continue}if(ve[0]===3&&(!h||ve[1]>h[0]&&ve[1]',"select"),this.addActionButton(u,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'',"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(d){var q=document.createElement("div");q.className=""+r.toolbarButtonStyleClass.name,q.setAttribute("data-type-name",d.typeName),q.innerHTML=d.icon,q.addEventListener("click",function(){r.markerToolbarButtonClicked(q,d)}),r.buttons.push(q),r.markerButtons.push(q)}),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 h=document.createElement("div");h.className=this.toolbarBlockStyleClass.name,h.style.whiteSpace="nowrap",h.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(h),this.addActionButton(h,'',"render"),this.addActionButton(h,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var r=0;r0&&this.buttonClickListeners.forEach(function(u){return u("marker",r)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,r){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",r)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var r=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});r&&this.setActiveButton(r)},c.prototype.setCurrentMarker=function(o){var r=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){r.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),Be=function(){function c(o,r,u,h){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=r,this.uiStyleSettings=u,this.styles=h,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new ge("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 ge("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var r=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ge("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ge("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ge("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 ge("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ge("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*r)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*r)+`px;
padding: `+r+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ge("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ge("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ue("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ue("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},c.prototype.show=function(o){var r;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((r=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&r!==void 0?r:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var r,u,h=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((r=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&r!==void 0?r:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(d){var q;d.uiStyleSettings=h.uiStyleSettings;var Ye=document.createElement("div");Ye.className=h.toolboxButtonStyleClass.name+" "+((q=h.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&q!==void 0?q:h.toolboxButtonStyleColorsClass.name),Ye.innerHTML=d.icon,Ye.title=d.title,Ye.addEventListener("click",function(){h.panelButtonClick(d)}),h.panelButtons.push(Ye),h.buttonRow.appendChild(Ye)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var r=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var h=o.getUi();h.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(h),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){r.displayMode==="inline"?r.panelRow.style.display="none":r.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(d,q){var Ye,st;d.className=r.toolboxButtonStyleClass.name+" "+(q===u?""+((Ye=r.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:r.toolboxActiveButtonStyleColorsClass.name):""+((st=r.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&st!==void 0?st:r.toolboxButtonStyleColorsClass.name))})},c}(),Qe=function(c,o){this.title=c,this.icon=o},it=function(c){function o(r,u,h,d){var q=c.call(this,r,d||'')||this;return q.colors=[],q.addTransparent=!1,q.colorBoxes=[],q.colors=u,q.currentColor=h,q.setCurrentColor=q.setCurrentColor.bind(q),q.getColorBox=q.getColorBox.bind(q),q}return G(o,c),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(h){var d=r.getColorBox(h);u.appendChild(d),r.colorBoxes.push(d)}),u},o.prototype.getColorBox=function(r){var u=this,h=this.uiStyleSettings.toolbarHeight/4,d=this.uiStyleSettings.toolbarHeight-h,q=document.createElement("div");q.style.display="inline-block",q.style.boxSizing="content-box",q.style.width=d-2+"px",q.style.height=d-2+"px",q.style.padding="1px",q.style.marginRight="2px",q.style.marginBottom="2px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderRadius=(d+2)/2+"px",q.style.borderColor=r===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){u.setCurrentColor(r,q)});var Ye=document.createElement("div");return Ye.style.display="inline-block",Ye.style.width=d-2+"px",Ye.style.height=d-2+"px",Ye.style.backgroundColor=r,Ye.style.borderRadius=d/2+"px",r==="transparent"&&(Ye.style.fill=this.uiStyleSettings.toolboxAccentColor,Ye.innerHTML=``),q.appendChild(Ye),q},o.prototype.setCurrentColor=function(r,u){var h=this;this.currentColor=r,this.colorBoxes.forEach(function(d){d.style.borderColor=d===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(r)},o}(Qe),Xe=function(){function c(o,r,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=r,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,r){},c.prototype.dblClick=function(o,r){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,r){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},c.typeName="MarkerBase",c}(),De=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},c}(),Et=function(){function c(){this.GRIP_SIZE=10,this.visual=E.createGroup(),this.visual.appendChild(E.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(E.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),pt=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.toSVGMatrix=function(o,r){return o.a=r.a,o.b=r.b,o.c=r.c,o.d=r.d,o.e=r.e,o.f=r.f,o},c}(),bt=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.left=0,d.top=0,d.width=0,d.height=0,d.defaultSize={x:50,y:20},d.offsetX=0,d.offsetY=0,d.rotationAngle=0,d.CB_DISTANCE=10,d._suppressMarkerCreateEvent=!1,d.container.transform.baseVal.appendItem(E.createTransform()),d.setupControlBox(),d}return G(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(r){this._visual=r;var u=E.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(r){return!!c.prototype.ownsTarget.call(this,r)||!!(this.controlGrips.findGripByVisual(r)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(r))},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.left=r.x,this.top=r.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var h=this.unrotatePoint(r);if(this.manipulationStartX=h.x,this.manipulationStartY=h.y,this.offsetX=h.x-this.left,this.offsetY=h.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var d=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=d.x-this.width/2,this.top=d.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var q=this.container.transform.baseVal.getItem(0);q.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(q,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(r){var u=this.state;c.prototype.pointerUp.call(this,r),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(r),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(r){this.visual.style.transform="translate("+r.x+"px, "+r.y+"px)"},o.prototype.manipulate=function(r){var u=this.unrotatePoint(r);this.state==="creating"?this.resize(r):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(r)},o.prototype.resize=function(r){var u=this.manipulationStartLeft,h=this.manipulationStartWidth,d=this.manipulationStartTop,q=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+r.x-this.manipulationStartX,h=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:h=this.manipulationStartWidth+r.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:d=this.manipulationStartTop+r.y-this.manipulationStartY,q=this.manipulationStartHeight+this.manipulationStartTop-d;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:q=this.manipulationStartHeight+r.y-this.manipulationStartY}h>=0?(this.left=u,this.width=h):(this.left=u+h,this.width=-h),q>=0?(this.top=d,this.height=q):(this.top=d+q,this.height=-q),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(r){if(Math.abs(r.x-this.centerX)>.1){var u=Math.sign(r.x-this.centerX);this.rotationAngle=180*Math.atan((r.y-this.centerY)/(r.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var r=this.container.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(r,0)},o.prototype.rotatePoint=function(r){if(this.rotationAngle===0)return r;var u=this.container.getCTM(),h=E.createPoint(r.x,r.y);return{x:(h=h.matrixTransform(u)).x,y:h.y}},o.prototype.unrotatePoint=function(r){if(this.rotationAngle===0)return r;var u=this.container.getCTM();u=u.inverse();var h=E.createPoint(r.x,r.y);return{x:(h=h.matrixTransform(u)).x,y:h.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=E.createGroup();var r=E.createTransform();r.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(r),this.container.appendChild(this.controlBox),this.controlRect=E.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=E.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 De,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var r=this.controlBox.transform.baseVal.getItem(0);r.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(r,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var r=new Et;return r.visual.transform.baseVal.appendItem(E.createTransform()),this.controlBox.appendChild(r.visual),r},o.prototype.positionGrips=function(){var r=this.controlGrips.topLeft.GRIP_SIZE,u=-r/2,h=u,d=(this.width+this.CB_DISTANCE)/2-r/2,q=(this.height+this.CB_DISTANCE)/2-r/2,Ye=this.height+this.CB_DISTANCE-r/2,st=this.width+this.CB_DISTANCE-r/2;this.positionGrip(this.controlGrips.topLeft.visual,u,h),this.positionGrip(this.controlGrips.topCenter.visual,d,h),this.positionGrip(this.controlGrips.topRight.visual,st,h),this.positionGrip(this.controlGrips.centerLeft.visual,u,q),this.positionGrip(this.controlGrips.centerRight.visual,st,q),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ye),this.positionGrip(this.controlGrips.bottomCenter.visual,d,Ye),this.positionGrip(this.controlGrips.bottomRight.visual,st,Ye),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,d,h-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(r,u,h){var d=r.transform.baseVal.getItem(0);d.setTranslate(u,h),r.transform.baseVal.replaceItem(d,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(r){c.prototype.restoreState.call(this,r);var u=r;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(r,u){c.prototype.scale.call(this,r,u);var h=this.rotatePoint({x:this.left,y:this.top}),d=this.unrotatePoint({x:h.x*r,y:h.y*u});this.left=d.x,this.top=d.y,this.width=this.width*r,this.height=this.height*u,this.adjustControlBox()},o}(Xe),ct=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.fillColor="transparent",d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.opacity=1,d.setStrokeColor=d.setStrokeColor.bind(d),d.setFillColor=d.setFillColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.createVisual=d.createVisual.bind(d),d}return G(o,c),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.visual)},o.prototype.createVisual=function(){this.visual=E.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.manipulate=function(r){c.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){c.prototype.resize.call(this,r),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),E.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(r){c.prototype.pointerUp.call(this,r),this.setSize()},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.visual&&E.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(r),this.stateChanged()},o.prototype.setFillColor=function(r){this.fillColor=r,this.visual&&E.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.visual&&E.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.visual&&E.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this))},o.prototype.restoreState=function(r){var u=r;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,u){c.prototype.scale.call(this,r,u),this.setSize()},o.title="Rectangle marker",o}(bt),Mt=function(c){function o(r,u,h,d){var q=c.call(this,r,d||'')||this;return q.widths=[],q.widthBoxes=[],q.widths=u,q.currentWidth=h,q.setCurrentWidth=q.setCurrentWidth.bind(q),q}return G(o,c),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(h){var d=document.createElement("div");d.style.display="flex",d.style.flexGrow="2",d.style.alignItems="center",d.style.justifyContent="space-between",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.borderColor=h===r.currentWidth?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentWidth(h,d)}),u.appendChild(d);var q=document.createElement("div");q.innerText=h.toString(),q.style.marginRight="5px",d.appendChild(q);var Ye=document.createElement("div");Ye.style.minHeight="20px",Ye.style.flexGrow="2",Ye.style.display="flex",Ye.style.alignItems="center";var st=document.createElement("hr");st.style.minWidth="20px",st.style.border="0px",st.style.borderTop=h+"px solid "+r.uiStyleSettings.toolboxColor,st.style.flexGrow="2",Ye.appendChild(st),d.appendChild(Ye),r.widthBoxes.push(d)}),u},o.prototype.setCurrentWidth=function(r,u){var h=this;this.currentWidth=r,this.widthBoxes.forEach(function(d){d.style.borderColor=d===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Qe),Ot=function(c){function o(r,u,h,d){var q=c.call(this,r,d||'')||this;return q.styles=[],q.styleBoxes=[],q.styles=u,q.currentStyle=h,q.setCurrentStyle=q.setCurrentStyle.bind(q),q}return G(o,c),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(h){var d=document.createElement("div");d.style.display="flex",d.style.alignItems="center",d.style.justifyContent="space-between",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.overflow="hidden",d.style.maxWidth=100/r.styles.length-5+"%",d.style.borderColor=h===r.currentStyle?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentStyle(h,d)}),u.appendChild(d);var q=document.createElement("div");q.style.minHeight="20px",q.style.flexGrow="2",q.style.overflow="hidden";var Ye=``;q.innerHTML=Ye,d.appendChild(q),r.styleBoxes.push(d)}),u},o.prototype.setCurrentStyle=function(r,u){var h=this;this.currentStyle=r,this.styleBoxes.forEach(function(d){d.style.borderColor=d===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Qe),Ct=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.strokeColor=h.defaultColor,d.strokeWidth=h.defaultStrokeWidth,d.strokeDasharray=h.defaultStrokeDasharray,d.strokePanel=new it("Line color",h.defaultColorSet,h.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.strokeWidthPanel=new Mt("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d}return G(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=c.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="FrameMarker",o.title="Frame marker",o.icon='',o}(ct),Pe=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},Ut=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.x1=0,d.y1=0,d.x2=0,d.y2=0,d.defaultLength=50,d.manipulationStartX=0,d.manipulationStartY=0,d.manipulationStartX1=0,d.manipulationStartY1=0,d.manipulationStartX2=0,d.manipulationStartY2=0,d.setupControlBox(),d}return G(o,c),o.prototype.ownsTarget=function(r){return!!c.prototype.ownsTarget.call(this,r)||!(!this.grip1.ownsTarget(r)&&!this.grip2.ownsTarget(r))},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.manipulationStartX=r.x,this.manipulationStartY=r.y,this.state==="new"&&(this.x1=r.x,this.y1=r.y,this.x2=r.x,this.y2=r.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(r){var u=this.state;c.prototype.pointerUp.call(this,r),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(r),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(r){this.state==="creating"?this.resize(r):this.state==="move"?(this.x1=this.manipulationStartX1+r.x-this.manipulationStartX,this.y1=this.manipulationStartY1+r.y-this.manipulationStartY,this.x2=this.manipulationStartX2+r.x-this.manipulationStartX,this.y2=this.manipulationStartY2+r.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(r)},o.prototype.resize=function(r){switch(this.activeGrip){case this.grip1:this.x1=r.x,this.y1=r.y;break;case this.grip2:case void 0:this.x2=r.x,this.y2=r.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=E.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var r=new Et;return r.visual.transform.baseVal.appendItem(E.createTransform()),this.controlBox.appendChild(r.visual),r},o.prototype.positionGrips=function(){var r=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-r/2,this.y1-r/2),this.positionGrip(this.grip2.visual,this.x2-r/2,this.y2-r/2)},o.prototype.positionGrip=function(r,u,h){var d=r.transform.baseVal.getItem(0);d.setTranslate(u,h),r.transform.baseVal.replaceItem(d,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(r){c.prototype.restoreState.call(this,r);var u=r;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(r,u){c.prototype.scale.call(this,r,u),this.x1=this.x1*r,this.y1=this.y1*u,this.x2=this.x2*r,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Xe),kt=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.setStrokeColor=d.setStrokeColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.strokeColor=h.defaultColor,d.strokeWidth=h.defaultStrokeWidth,d.strokeDasharray=h.defaultStrokeDasharray,d.strokePanel=new it("Line color",h.defaultColorSet,h.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.strokeWidthPanel=new Mt("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d}return G(o,c),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.selectorLine&&r!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=E.createGroup(),this.selectorLine=E.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=E.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),E.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),E.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),E.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.adjustVisual(),this.colorChanged(r)},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.adjustVisual()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){c.prototype.restoreState.call(this,r);var u=r;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='',o}(Ut),Ne=function(c){function o(r,u,h,d){var q=c.call(this,r,d||'')||this;return q.fonts=[],q.fontBoxes=[],q.fonts=u,q.currentFont=h,q.setCurrentFont=q.setCurrentFont.bind(q),q}return G(o,c),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(h){var d=document.createElement("div");d.style.display="inline-block",d.style.alignItems="center",d.style.justifyContent="space-between",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.overflow="hidden",d.style.maxWidth=100/r.fonts.length-5+"%",d.style.borderColor=h===r.currentFont?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentFont(h,d)}),u.appendChild(d);var q=document.createElement("div");q.style.display="flex",q.style.minHeight="20px",q.style.flexGrow="2",q.style.fontFamily=h,q.style.overflow="hidden";var Ye=document.createElement("div");Ye.style.whiteSpace="nowrap",Ye.style.overflow="hidden",Ye.style.textOverflow="ellipsis",Ye.innerHTML="The quick brown fox jumps over the lazy dog",q.appendChild(Ye),d.appendChild(q),r.fontBoxes.push(d)}),u},o.prototype.setCurrentFont=function(r,u){var h=this;this.currentFont=r,this.fontBoxes.forEach(function(d){d.style.borderColor=d===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Qe),Fe=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.color="transparent",d.padding=5,d.DEFAULT_TEXT="your text here",d.text=d.DEFAULT_TEXT,d.isMoved=!1,d.color=h.defaultColor,d.fontFamily=h.defaultFontFamily,d.defaultSize={x:100,y:30},d.setColor=d.setColor.bind(d),d.setFont=d.setFont.bind(d),d.renderText=d.renderText.bind(d),d.sizeText=d.sizeText.bind(d),d.textEditDivClicked=d.textEditDivClicked.bind(d),d.showTextEditor=d.showTextEditor.bind(d),d.setSize=d.setSize.bind(d),d.positionTextEditor=d.positionTextEditor.bind(d),d.colorPanel=new it("Color",h.defaultColorSet,h.defaultColor),d.colorPanel.onColorChanged=d.setColor,d.fontFamilyPanel=new Ne("Font",h.defaultFontFamilies,h.defaultFontFamily),d.fontFamilyPanel.onFontChanged=d.setFont,d}return G(o,c),o.prototype.ownsTarget=function(r){if(c.prototype.ownsTarget.call(this,r)||r===this.visual||r===this.textElement||r===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(h){h===r&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=E.createGroup(),this.bgRectangle=E.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=E.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(E.createTransform()),this.textElement.transform.baseVal.appendItem(E.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.isMoved=!1,this.pointerDownPoint=r,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.renderText=function(){var r=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){r.textElement.appendChild(E.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var r=this.textElement.getBBox(),u=1;if(r.width>0&&r.height>0){var h=(1*this.width-this.width*this.padding*2/100)/r.width,d=(1*this.height-this.height*this.padding*2/100)/r.height;u=Math.min(h,d)}return u},o.prototype.getTextPosition=function(r){var u=this.textElement.getBBox(),h=0,d=0;return u.width>0&&u.height>0&&(h=(this.width-u.width*r)/2,d=this.height/2-u.height*r/2),{x:h,y:d}},o.prototype.sizeText=function(){var r=this.textElement.getBBox(),u=this.getTextScale(),h=this.getTextPosition(u);h.y-=r.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+h.x+"px, "+h.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(h.x,h.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(r){c.prototype.manipulate.call(this,r),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(r.x-this.pointerDownPoint.x)>5||Math.abs(r.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(r){c.prototype.resize.call(this,r),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(E.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),E.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(r){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,r),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var r=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(r.textEditor.style.fontSize);r.textEditor.clientWidth>=Number.parseInt(r.textEditor.style.maxWidth)&&u>.9;)u-=.1,r.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var h=u.clipboardData.getData("text"),d=window.getSelection();if(!d.rangeCount)return!1;d.deleteFromDocument(),d.getRangeAt(0).insertNode(document.createTextNode(h)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){r.textEditDivClicked(r.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var r=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),h=this.textElement.getBBox(),d={x:h.width*r,y:h.height*r};u.x-=d.x/2,u.y-=d.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*r,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(r){this.text=r.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(r,u){c.prototype.dblClick.call(this,r,u),this.showTextEditor()},o.prototype.setColor=function(r){this.textElement&&E.setAttributes(this.textElement,[["fill",r]]),this.color=r,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(r)},o.prototype.setFont=function(r){this.textElement&&E.setAttributes(this.textElement,[["font-family",r]]),this.fontFamily=r,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var u=r;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,u){c.prototype.scale.call(this,r,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='',o}(bt),N=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.color="transparent",d.lineWidth=3,d.drawing=!1,d.pixelRatio=1,d.color=h.defaultColor,d.lineWidth=h.defaultStrokeWidth,d.pixelRatio=h.freehandPixelRatio,d.setColor=d.setColor.bind(d),d.addCanvas=d.addCanvas.bind(d),d.finishCreation=d.finishCreation.bind(d),d.setLineWidth=d.setLineWidth.bind(d),d.colorPanel=new it("Color",h.defaultColorSet,h.defaultColor),d.colorPanel.onColorChanged=d.setColor,d.lineWidthPanel=new Mt("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),d.lineWidthPanel.onWidthChanged=d.setLineWidth,d}return G(o,c),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=E.createGroup(),this.drawingImage=E.createImage(),this.visual.appendChild(this.drawingImage);var r=E.createTransform();this.visual.transform.baseVal.appendItem(r),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(r.x,r.y),this.drawing=!0):c.prototype.pointerDown.call(this,r,u)},o.prototype.manipulate=function(r){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(r.x,r.y),this.canvasContext.stroke()):c.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){c.prototype.resize.call(this,r),E.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),E.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(r){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,r)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var r=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],h=u[0],d=u[1],q=u[2],Ye=u[3],st=!1,Nt=0;Nt0&&(st=!0,NtYe&&(Ye=Nt),ve>q&&(q=ve));if(st){this.left=h/this.pixelRatio,this.top=d/this.pixelRatio,this.width=(q-h)/this.pixelRatio,this.height=(Ye-d)/this.pixelRatio;var oe=document.createElement("canvas");oe.width=q-h,oe.height=Ye-d,oe.getContext("2d").putImageData(this.canvasContext.getImageData(h,d,q-h,Ye-d),0,0),this.drawingImgUrl=oe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){E.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),E.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(r){this.color=r,this.colorChanged(r)},o.prototype.setLineWidth=function(r){this.lineWidth=r},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){this.createVisual(),c.prototype.restoreState.call(this,r),this.drawingImgUrl=r.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(r,u){c.prototype.scale.call(this,r,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='',o}(bt),H=function(c){function o(r,u,h){var d=c.call(this,r,h||'')||this;return d.typeBoxes=[],d.currentType=u,d.setCurrentType=d.setCurrentType.bind(d),d}return G(o,c),o.prototype.getUi=function(){var r=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var h=function(Ye){var st="both";switch(Ye){case 0:st="both";break;case 1:st="start";break;case 2:st="end";break;case 3:st="none"}var Nt=document.createElement("div");if(Nt.style.display="flex",Nt.style.flexGrow="2",Nt.style.alignItems="center",Nt.style.justifyContent="space-between",Nt.style.padding="5px",Nt.style.borderWidth="2px",Nt.style.borderStyle="solid",Nt.style.borderColor=st===d.currentType?d.uiStyleSettings.toolboxAccentColor:"transparent",Nt.addEventListener("click",function(){r.setCurrentType(st,Nt)}),u.appendChild(Nt),st==="both"||st==="start"){var ve=document.createElement("div");ve.style.display="flex",ve.style.alignItems="center",ve.style.minHeight="20px",ve.innerHTML=``,ve.style.marginLeft="5px",Nt.appendChild(ve)}var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.minHeight="20px",oe.style.flexGrow="2";var Ve=document.createElement("hr");if(Ve.style.minWidth="20px",Ve.style.border="0px",Ve.style.borderTop="3px solid "+(d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxColor:"#eeeeee"),Ve.style.flexGrow="2",oe.appendChild(Ve),Nt.appendChild(oe),st==="both"||st==="end"){var Pt=document.createElement("div");Pt.style.display="flex",Pt.style.alignItems="center",Pt.style.minHeight="20px",Pt.innerHTML=``,Pt.style.marginRight="5px",Nt.appendChild(Pt)}d.typeBoxes.push(Nt)},d=this,q=0;q<4;q++)h(q);return u},o.prototype.setCurrentType=function(r,u){var h=this;this.currentType=r,this.typeBoxes.forEach(function(d){d.style.borderColor=d===u?h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Qe),K=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.arrowType="end",d.arrowBaseHeight=10,d.arrowBaseWidth=10,d.getArrowPoints=d.getArrowPoints.bind(d),d.setArrowType=d.setArrowType.bind(d),d.arrowTypePanel=new H("Arrow type","end"),d.arrowTypePanel.onArrowTypeChanged=d.setArrowType,d}return G(o,c),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.arrow1&&r!==this.arrow2)},o.prototype.getArrowPoints=function(r,u){var h=this.arrowBaseWidth+2*this.strokeWidth,d=this.arrowBaseHeight+2*this.strokeWidth;return r-h/2+","+(u+d/2)+" "+r+","+(u-d/2)+" "+(r+h/2)+","+(u+d/2)},o.prototype.createTips=function(){this.arrow1=E.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(E.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=E.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(E.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",E.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),E.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var r=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(r,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var h=this.arrow2.transform.baseVal.getItem(0);h.setRotate(r+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(h,0)}},o.prototype.setArrowType=function(r){this.arrowType=r,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({arrowType:this.arrowType},c.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){c.prototype.restoreState.call(this,r);var u=r;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='',o}(kt),C=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.fillColor=h.defaultFillColor,d.strokeWidth=0,d.fillPanel=new it("Color",h.defaultColorSet,h.defaultFillColor),d.fillPanel.onColorChanged=d.setFillColor,d}return G(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=c.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="CoverMarker",o.title="Cover marker",o.icon='',o}(ct),w=function(c){function o(r,u,h,d){var q=c.call(this,r,d||'')||this;return q.opacities=[],q.opacityBoxes=[],q.opacities=u,q.currentOpacity=h,q.setCurrentOpacity=q.setCurrentOpacity.bind(q),q}return G(o,c),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(h){var d=document.createElement("div");d.style.display="flex",d.style.alignItems="center",d.style.justifyContent="center",d.style.padding="5px",d.style.borderWidth="2px",d.style.borderStyle="solid",d.style.borderColor=h===r.currentOpacity?r.uiStyleSettings.toolboxAccentColor:"transparent",d.addEventListener("click",function(){r.setCurrentOpacity(h,d)}),u.appendChild(d);var q=document.createElement("div");q.innerText=100*h+"%",d.appendChild(q),r.opacityBoxes.push(d)}),u},o.prototype.setCurrentOpacity=function(r,u){var h=this;this.currentOpacity=r,this.opacityBoxes.forEach(function(d){d.style.borderColor=d===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Qe),O=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.setOpacity=d.setOpacity.bind(d),d.fillColor=h.defaultHighlightColor,d.strokeWidth=0,d.opacity=h.defaultHighlightOpacity,d.fillPanel=new it("Color",h.defaultColorSet,d.fillColor),d.fillPanel.onColorChanged=d.setFillColor,d.opacityPanel=new w("Opacity",h.defaultOpacitySteps,d.opacity),d.opacityPanel.onOpacityChanged=d.setOpacity,d}return G(o,c),o.prototype.setOpacity=function(r){this.opacity=r,this.visual&&E.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=c.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='',o}(C),R='',re=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.bgColor="transparent",d.tipPosition={x:0,y:0},d.tipBase1Position={x:0,y:0},d.tipBase2Position={x:0,y:0},d.tipMoving=!1,d.color=h.defaultStrokeColor,d.bgColor=h.defaultFillColor,d.fontFamily=h.defaultFontFamily,d.defaultSize={x:100,y:30},d.setBgColor=d.setBgColor.bind(d),d.getTipPoints=d.getTipPoints.bind(d),d.positionTip=d.positionTip.bind(d),d.setTipPoints=d.setTipPoints.bind(d),d.colorPanel=new it("Text color",h.defaultColorSet,d.color,''),d.colorPanel.onColorChanged=d.setColor,d.bgColorPanel=new it("Fill color",h.defaultColorSet,d.bgColor,R),d.bgColorPanel.onColorChanged=d.setBgColor,d.fontFamilyPanel=new Ne("Font",h.defaultFontFamilies,h.defaultFontFamily),d.fontFamilyPanel.onFontChanged=d.setFont,d.tipGrip=new Et,d.tipGrip.visual.transform.baseVal.appendItem(E.createTransform()),d.controlBox.appendChild(d.tipGrip.visual),d}return G(o,c),o.prototype.ownsTarget=function(r){return c.prototype.ownsTarget.call(this,r)||this.tipGrip.ownsTarget(r)||this.tip===r},o.prototype.createTip=function(){E.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=E.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(r,u){this.state==="new"&&c.prototype.pointerDown.call(this,r,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):c.prototype.pointerDown.call(this,r,u)},o.prototype.pointerUp=function(r){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,r);else{var u=this.state==="creating";c.prototype.pointerUp.call(this,r),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(r){if(this.tipMoving){var u=this.unrotatePoint(r);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else c.prototype.manipulate.call(this,r)},o.prototype.setBgColor=function(r){this.bgRectangle&&this.tip&&(E.setAttributes(this.bgRectangle,[["fill",r]]),E.setAttributes(this.tip,[["fill",r]])),this.bgColor=r,this.fillColorChanged(r)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(r){r===void 0&&(r=!1);var u=Math.min(this.height/2,15),h=this.height/5;r&&(this.tipPosition={x:u+h/2,y:this.height+20});var d=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?d',o}(Fe),ne=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.fillColor="transparent",d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.opacity=1,d.strokeColor=h.defaultColor,d.strokeWidth=h.defaultStrokeWidth,d.strokeDasharray=h.defaultStrokeDasharray,d.fillColor=h.defaultFillColor,d.setStrokeColor=d.setStrokeColor.bind(d),d.setFillColor=d.setFillColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.setOpacity=d.setOpacity.bind(d),d.createVisual=d.createVisual.bind(d),d.strokePanel=new it("Line color",T(h.defaultColorSet,["transparent"]),h.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.fillPanel=new it("Fill color",T(h.defaultColorSet,["transparent"]),d.fillColor,R),d.fillPanel.onColorChanged=d.setFillColor,d.strokeWidthPanel=new Mt("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d.opacityPanel=new w("Opacity",h.defaultOpacitySteps,d.opacity),d.opacityPanel.onOpacityChanged=d.setOpacity,d}return G(o,c),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.visual)},o.prototype.createVisual=function(){this.visual=E.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.manipulate=function(r){c.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){c.prototype.resize.call(this,r),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),E.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(r){c.prototype.pointerUp.call(this,r),this.setSize()},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.visual&&E.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(r),this.stateChanged()},o.prototype.setFillColor=function(r){this.fillColor=r,this.visual&&E.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(r),this.stateChanged()},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.visual&&E.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.visual&&E.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(r){this.opacity=r,this.visual&&E.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var u=r;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,u){c.prototype.scale.call(this,r,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='',o}(bt),pe=function(c){function o(r,u,h){return c.call(this,r,u,h)||this}return G(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.tip1&&r!==this.tip2)},o.prototype.createTips=function(){this.tip1=E.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(E.createTransform()),this.visual.appendChild(this.tip1),this.tip2=E.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(E.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(E.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()]]),E.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 r=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(r,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var h=this.tip2.transform.baseVal.getItem(0);h.setRotate(r+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(h,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=c.prototype.getState.call(this);return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){c.prototype.restoreState.call(this,r),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='',o}(kt),nt=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.strokePanel.colors=h.defaultColorSet,d.fillColor="transparent",d}return G(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=c.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='',o}(ne),Ke=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),Se=function(c){function o(r,u,h){var d=c.call(this,r,u,h)||this;return d.strokeColor="transparent",d.strokeWidth=0,d.strokeDasharray="",d.curveX=0,d.curveY=0,d.manipulationStartCurveX=0,d.manipulationStartCurveY=0,d.setStrokeColor=d.setStrokeColor.bind(d),d.setStrokeWidth=d.setStrokeWidth.bind(d),d.setStrokeDasharray=d.setStrokeDasharray.bind(d),d.positionGrips=d.positionGrips.bind(d),d.addControlGrips=d.addControlGrips.bind(d),d.adjustVisual=d.adjustVisual.bind(d),d.setupControlBox=d.setupControlBox.bind(d),d.resize=d.resize.bind(d),d.strokeColor=h.defaultColor,d.strokeWidth=h.defaultStrokeWidth,d.strokeDasharray=h.defaultStrokeDasharray,d.strokePanel=new it("Line color",h.defaultColorSet,h.defaultColor),d.strokePanel.onColorChanged=d.setStrokeColor,d.strokeWidthPanel=new Mt("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),d.strokeWidthPanel.onWidthChanged=d.setStrokeWidth,d.strokeStylePanel=new Ot("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),d.strokeStylePanel.onStyleChanged=d.setStrokeDasharray,d}return G(o,c),o.prototype.ownsTarget=function(r){return!(!c.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.selectorCurve&&r!==this.visibleCurve&&!this.curveGrip.ownsTarget(r))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=E.createGroup(),this.selectorCurve=E.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=E.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){c.prototype.pointerDown.call(this,r,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=r.x,this.curveY=r.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),E.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),E.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),E.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=E.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=E.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var r=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-r/2,this.curveY-r/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(r){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+r.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+r.y-this.manipulationStartY),c.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){this.activeGrip===this.curveGrip&&(this.curveX=r.x,this.curveY=r.y),c.prototype.resize.call(this,r),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.adjustVisual(),this.colorChanged(r)},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.adjustVisual()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.adjustVisual()},o.prototype.scale=function(r,u){this.curveX=this.curveX*r,this.curveY=this.curveY*u,c.prototype.scale.call(this,r,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){c.prototype.restoreState.call(this,r);var u=r;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='',o}(Ut),gt=function(){function c(o,r){r===void 0&&(r=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=r}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),jt=function(c){function o(r,u,h){var d=c.call(this,r,!1)||this;return d.dataUrl=u,d.state=h,d}return G(o,c),o}(gt),ot=function(c){function o(r,u,h){h===void 0&&(h=!1);var d=c.call(this,r,h)||this;return d.marker=u,d}return G(o,c),o}(gt),Xt=function(){function c(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return c.prototype.addEventListener=function(o,r){this[o].push(r)},c.prototype.removeEventListener=function(o,r){var u=this[o].indexOf(r);u>-1&&this[o].splice(u,1)},c}(),tt=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Pe,this._isOpen=!1,this.undoRedoManager=new Ke,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 Xt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ct,N,K,Fe,nt,ne,O,re,pe,C,kt,Se]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ct,N,K,Fe,ne,O,re]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ct,N,K,Fe,O]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var r=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var h=r.ALL_MARKER_TYPES.find(function(d){return d.typeName===u});h!==void 0&&r._availableMarkerTypes.push(h)}else r._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),he.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&Ze.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ze.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(r){return r(new gt(o))})},c.prototype.render=function(){return U(this,void 0,void 0,function(){var o;return ue(this,function(r){switch(r.label){case 0:return this.setCurrentMarker(),(o=new Le).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return r.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,r.sent()]}})})},c.prototype.close=function(o){var r=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(h){var d=new gt(r,!0);h(d),d.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(h){return h(new gt(r))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,r=[],u=0;uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=r',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Re(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(o),1),o.dispose()},c.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},c.prototype.toolbarButtonClicked=function(o,r){if(o==="marker"&&r!==void 0)this.createNewMarker(r);else if(o==="action")switch(r){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var r=!1;if(this.eventListeners.markerbeforedelete.forEach(function(h){var d=new ot(o,o._currentMarker,!0);h(d),d.defaultPrevented&&(r=!0)}),!r){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(h){return h(new ot(o,u))})}}},c.prototype.clear=function(){var o=this,r=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(q){var Ye=new ot(o,void 0,!0);q(Ye),Ye.defaultPrevented&&(r=!0)}),!r)){this.setCurrentMarker();for(var u=function(q){var Ye=h.markers[q];h.setCurrentMarker(h.markers[q]),h._currentMarker.dispose(),h.markerImage.removeChild(h._currentMarker.container),h.markers.splice(h.markers.indexOf(h._currentMarker),1),h.eventListeners.markerdelete.forEach(function(st){return st(new ot(o,Ye))})},h=this,d=this.markers.length-1;d>=0;d--)u(d);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var r=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===r.width&&u.height===r.height){var h=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(r),h1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,r){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(r-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},c.prototype.addLicenseKey=function(o){he.addKey(o)},c.prototype.addEventListener=function(o,r){this.eventListeners.addEventListener(o,r)},c.prototype.removeEventListener=function(o,r){this.eventListeners.removeEventListener(o,r)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(r){return r(new gt(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(r){return r(new gt(o))}))},c.instanceCounter=0,c}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ht=function(c,o){return(Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,u){r.__proto__=u}||function(r,u){for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(r[h]=u[h])})(c,o)};function It(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=c}Ht(c,o),c.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}function Rt(c,o,r,u){return new(r||(r=Promise))(function(h,d){function q(Nt){try{st(u.next(Nt))}catch(ve){d(ve)}}function Ye(Nt){try{st(u.throw(Nt))}catch(ve){d(ve)}}function st(Nt){var ve;Nt.done?h(Nt.value):(ve=Nt.value,ve instanceof r?ve:new r(function(oe){oe(ve)})).then(q,Ye)}st((u=u.apply(c,o||[])).next())})}function Jt(c,o){var r,u,h,d,q={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return d={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function Ye(st){return function(Nt){return function(ve){if(r)throw new TypeError("Generator is already executing.");for(;q;)try{if(r=1,u&&(h=2&ve[0]?u.return:ve[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,ve[1])).done)return h;switch(u=0,h&&(ve=[2&ve[0],h.value]),ve[0]){case 0:case 1:h=ve;break;case 4:return q.label++,{value:ve[1],done:!1};case 5:q.label++,u=ve[1],ve=[0];continue;case 7:ve=q.ops.pop(),q.trys.pop();continue;default:if(!(h=q.trys,(h=h.length>0&&h[h.length-1])||ve[0]!==6&&ve[0]!==2)){q=0;continue}if(ve[0]===3&&(!h||ve[1]>h[0]&&ve[1]0&&r>0){var u=new tn(o,r),h=u.ratio>=1?20:u.getHorizontalLength(20),d=u.ratio<1?20:u.getVerticalLength(20),q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("xmlns","http://www.w3.org/2000/svg"),q.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(q);var Ye=We.createDefs();q.appendChild(Ye);var st=We.createElement("clipPath",[["id","text-bg-clip"]]);Ye.appendChild(st);var Nt=We.createPath(We.getHollowRectanglePath((24-h)/2,(24-d)/2,h,d,(24-h)/2+2,(24-d)/2+2,h-4,d-4));q.appendChild(Nt);var ve=We.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ve.appendChild(We.createTSpan(o+":"+r)),q.appendChild(ve);var oe=ve.getBBox();We.setAttributes(ve,[["x",((24-oe.width)/2).toString()],["y",((24-oe.height)/2-oe.y).toString()]]);var Ve=We.createPath(We.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(oe.width))/2,(24-Math.ceil(oe.height))/2,Math.ceil(oe.width),Math.ceil(oe.height)));return st.appendChild(Ve),We.setAttributes(Nt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(q),q.outerHTML}return''},c}(),un=function(c){function o(r,u,h){var d=c.call(this,r,u)||this;return d.isDropdownOpen=!1,d.onClick=d.dropdownButtonClicked,d.dropdownButtons=h,d}return It(o,c),o.prototype.setupDropdown=function(){var r=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=r.className,u.colorsClassName=r.colorsClassName,r.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Vt),zt=function(){function c(o,r){this.GRIP_SIZE=10,this.color=o,this.fillColor=r,this.visual=We.createGroup(),this.visual.appendChild(We.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(We.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,r){this.visual.childNodes.forEach(function(u){return We.setAttributes(u,[["cx",o.toString()],["cy",r.toString()]])})},c}(),dn=function(){function c(o,r,u,h){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=r,this.margin=u,this.container=h,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&We.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=We.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=We.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var r=0;rthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-r.height/2),We.setAttributes(this.cropRectElement,[["x",r.x.toString()],["y",r.y.toString()],["width",r.width.toString()],["height",r.height.toString()]]);var u=r.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(d,q){var Ye=r.y+u*(q+1);We.setAttributes(d,[["x1",""+r.x],["y1",""+Ye],["x2",""+(r.x+r.width)],["y2",""+Ye]])});var h=r.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(d,q){var Ye=r.x+h*(q+1);We.setAttributes(d,[["x1",""+Ye],["y1",""+r.y],["x2",""+Ye],["y2",""+(r.y+r.height)]])}),We.setAttributes(this.cropShadeElement,[["d",We.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,r.x,r.y,r.width,r.height)]]),this.topLeftGrip.setCenter(r.x,r.y),this.topRightGrip.setCenter(r.x+r.width,r.y),this.bottomLeftGrip.setCenter(r.x,r.y+r.height),this.bottomRightGrip.setCenter(r.x+r.width,r.y+r.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},c.prototype.clientToLocalCoordinates=function(o,r){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:r-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var r=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(r)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var r=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(r=-r/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+r),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},c.prototype.resize=function(o){var r=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,h=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:r.x+uthis.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-r.width),r.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(r.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),r.height=this.aspectRatio.getVerticalLength(r.width)):(r.y+=h,r.height=this.cropRect.y+this.cropRect.height-r.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?r.height=this.aspectRatio.getVerticalLength(r.width):r.height+=h}r.width<10&&(r.x=this.cropRect.x,r.width=10),r.height<10&&(r.y=this.cropRect.y,r.height=10),this.previousPoint=o,r.x>=this.margin&&r.y>=this.margin&&r.x-this.margin+r.width<=this.canvasWidth&&r.y-this.margin+r.height<=this.canvasHeight&&(this.cropRect=r,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,r=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),h=this.aspectRatio.getVerticalLength(this.cropRect.width);u/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=o-this.cropRect.width/2,this.cropRect.y=r-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},c.prototype.getRescaledRect=function(o,r,u,h,d,q){var Ye=u/o,st=h/r;return{x:(d.x-q)*Ye+q,y:(d.y-q)*st+q,width:d.width*Ye,height:d.height*st}},c.prototype.scaleCanvas=function(o,r){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,r,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=r,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),In=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();We.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var r="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var h=u%5==0?this.height/3:this.height/6;r+="h4v"+-h+"h1v"+h}r+="v1H0Z",this.scaleShape=We.createPath(r);var d=We.createTransform();this.scaleShape.transform.baseVal.appendItem(d),o.appendChild(this.scaleShape),this.angleLabelElement=We.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=We.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var q=We.createTSpan("");return q.innerHTML="°",this.angleLabelElement.appendChild(q),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),nn=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,r,u,h,d,q,Ye){var st=this;return new Promise(function(Nt){var ve=document.createElement("canvas");ve.width=o.width.baseVal.value-2*h,ve.height=o.height.baseVal.value-2*h;var oe=1,Ve=1;st.naturalSize===!0?(oe=r.naturalWidth/(o.width.baseVal.value-2*h)/q,Ve=r.naturalHeight/(o.height.baseVal.value-2*h)/Ye,ve.width=r.naturalWidth/q,ve.height=r.naturalHeight/Ye):st.width!==void 0&&st.height!==void 0&&(oe=st.width/u.width,Ve=st.height/u.height,ve.width*=oe,ve.height*=Ve);var Pt=ve.getContext("2d");Pt.translate(ve.width/2,ve.height/2),Pt.rotate(d*Math.PI/180),Pt.scale(q,Ye),Pt.translate(-ve.width/2,-ve.height/2),Pt.drawImage(r,0,0,ve.width,ve.height);var Tt=document.createElement("canvas");Tt.width=u.width*oe,Tt.height=u.height*Ve,Tt.getContext("2d").putImageData(Pt.getImageData((u.x-h)*oe,(u.y-h)*Ve,u.width*oe,u.height*Ve),0,0),Nt(Tt.toDataURL(st.imageType,st.imageQuality))})},c}(),$e=function(){function c(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=c.instanceCounter++,this.styles=new lt(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(r){return r()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,r=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=r+2*this.CANVAS_MARGINo+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=r+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Gt,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 r=new on;r.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(r);var u=[];this.aspectRatios.forEach(function(Ve){var Pt=new Vt(Lt.getIcon(Ve.horizontal,Ve.vertical),Ve.horizontal===0&&Ve.vertical===0?"FREE":Ve.horizontal+":"+Ve.vertical);Pt.onClick=function(){return o.ratioButtonClicked(Ve)},u.push(Pt)}),this.aspectRatioButton=new un(Lt.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,r.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var h=new Vt('',"Toggle grid");h.isActive=this.isGridVisible,h.onClick=function(){o.isGridVisible=!o.isGridVisible,h.isActive=o.isGridVisible},r.addButton(h);var d=new Vt('',"Zoom to selection");if(d.isActive=this.zoomToCropEnabled,d.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,d.isActive=o.zoomToCropEnabled},r.addButton(d),!Ft.isLicensed){var q=new _t;this.topToolbar.addElementBlock(q);var Ye=document.createElement("div");Ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var st=document.createElement("a");st.style.color="currentColor",st.href="https://markerjs.com/products/cropro",st.target="_blank",st.innerHTML='',Ye.appendChild(st),q.addElement(Ye)}var Nt=new on;Nt.minWidth=3*this.toolbarHeight+"px",Nt.contentAlign="end",this.topToolbar.addButtonBlock(Nt);var ve=new Vt('',"OK");ve.onClick=this.startRenderAndClose,Nt.addButton(ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var oe=new Vt('',"Close");oe.onClick=this.close,Nt.addButton(oe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(oe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Gt,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 r=new on;r.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(r);var u=new Vt('',"Rotate left");u.onClick=this.rotateLeftButtonClicked,r.addButton(u);var h=new Vt('',"Rotate right");h.onClick=this.rotateRightButtonClicked,r.addButton(h);var d=new _t;d.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(d),this.straightener=new In("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(Nt){o.rotateBy(Nt),o.straightener.angle=o.rotationAngle},d.addElement(this.straightener.getUI());var q=new on;q.minWidth=2*this.toolbarHeight+"px",q.contentAlign="end",this.bottomToolbar.addButtonBlock(q);var Ye=new Vt('',"Flip horizontal");Ye.onClick=this.flipHorizontallyButtonClicked,q.addButton(Ye);var st=new Vt('',"Flip vertical");st.onClick=this.flipVerticallyButtonClicked,q.addButton(st)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Lt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new tn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var r=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(r),this.cropRectChanged(r),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,r){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:r-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var r=this.editingTargetRotationContainer.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(r,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return Rt(this,void 0,void 0,function(){var o,r;return Jt(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),r=this.getState(),this.renderEventListeners.forEach(function(h){return h(o,r)}),this.close(!0),[2]}})})},c.prototype.render=function(){return Rt(this,void 0,void 0,function(){var o;return Jt(this,function(r){switch(r.label){case 0:return(o=new nn).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),We.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return r.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,r.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new dt("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 dt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new dt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new dt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*o)+`px;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new qe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new qe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new dt("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 dt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new dt("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 dt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new dt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},c.instanceCounter=0,c}(),ut=p("8hTe"),mn=p.n(ut),En=/]*>/g;function On(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Bn=Ge.a=function(c){var o=c.value,r=o===void 0?"":o,u=c.edit,h=u===void 0?!1:u,d=c.className,q=c.showTextOnly,Ye=c.showLines,st=c.replaces,Nt=c.zoomImg,ve=c.hasMask,oe=c.style,Ve=oe===void 0?{}:oe,Pt=c.stylesPrev,Tt=Pt===void 0?{}:Pt,St=String(r),At=Object(J.useRef)(),cn=Object(J.useRef)(),Nn=Object(J.useState)(""),wn=Object(Y.a)(Nn,2),yn=wn[0],An=wn[1],Dn=Object(J.useState)("office"),ti=Object(Y.a)(Dn,2),wi=ti[0],Xn=ti[1],$n=function(){var gn=new $e(cn.current);gn.displayMode="popup",gn.addRenderEventListener(function(){var li=Object(Ce.a)(V.a.mark(function pn(Hn){var Cn;return V.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return At.current.style.display="none",Yn.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Hn}});case 3:Cn=Yn.sent,Cn!=null&&Cn.id&&st(cn.current.getAttribute("src").replace(He.a.API_SERVER,""),"/api/attachments/".concat(Cn==null?void 0:Cn.id,"?type=").concat(Cn.content_type));case 5:case"end":return Yn.stop()}},pn)}));return function(pn){return li.apply(this,arguments)}}()),gn.show()},$i=function(){var gn=new tt(cn.current);gn.settings.displayMode="popup",gn.addEventListener("render",function(){var li=Object(Ce.a)(V.a.mark(function pn(Hn){var Cn;return V.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:if(At.current.style.display="none",!cn.current){Yn.next=6;break}return Yn.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Hn.dataUrl}});case 4:Cn=Yn.sent,Cn!=null&&Cn.id&&st(cn.current.getAttribute("src").replace(He.a.API_SERVER,""),"/api/attachments/".concat(Cn==null?void 0:Cn.id,"?type=").concat(Cn.content_type));case 6:case"end":return Yn.stop()}},pn)}));return function(pn){return li.apply(this,arguments)}}()),gn.show(),window.markerArea=gn},Ei=Object(J.useMemo)(function(){try{var zn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,gn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,li=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;St=St.replace(zn,"("+He.a.API_SERVER+"/api/attachments/").replace(gn,'"'+He.a.API_SERVER+"/api/attachments/").replace(li,'"'+He.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,`
`),St=St.replace(new RegExp("(?[TOC]
",g()),_e()),pn=pn.replace(/(__special_katext_id_\d+__)/g,function(di,Yn){var Ci=Hn[Yn],fa=Ci.type,na=Ci.expression;return Object(je.renderToString)(On(na)||"",{displayMode:fa==="block",throwOnError:!1,output:"html"})}),pn=pn.replace(/▁/g,"\u2581\u2581\u2581"),A(),q){var Cn=document.createElement("div");return Cn.innerHTML=pn,Cn.innerText}return setTimeout(function(){return ra()},500),pn},[St]),Tn=Object(J.useRef)();ce.WebkitLineClamp=Ye,Ye&&(Ve=Object(xe.a)(Object(xe.a)({},Ve),ce));function Fi(zn){var gn=zn.target;if(gn.tagName.toUpperCase()==="IMG"){if(Nt){var li=gn.getAttribute("src");An(li),Xn("image")}}else if(gn.tagName.toUpperCase()==="A"){var pn=gn.getAttribute("href");if(pn.indexOf("office")>-1)zn.preventDefault(),An(pn),Xn("office");else if(pn.indexOf("application/pdf")>-1)zn.preventDefault(),An(pn),Xn("pdf");else if(pn.indexOf("type=text")>-1)zn.preventDefault(),An(pn),Xn("html");else if(pn.startsWith("#")){zn.preventDefault();var Hn=document.getElementById(pn.replace("#",""));Hn&&Hn.scrollIntoView(!0)}}}var ra=function(){var gn,li=(gn=Tn.current)===null||gn===void 0?void 0:gn.querySelectorAll("video");li==null||li.forEach(function(pn){if(pn.oncontextmenu=function(){return!1},pn.src.indexOf(".m3u8")>-1&&!pn.canPlayType("application/vnd.apple.mpegurl")){if(le.a.isSupported()){var Hn=new le.a;Hn.loadSource(pn.src),Hn.attachMedia(pn)}}})};Object(J.useEffect)(function(){if(Tn.current&&Ei&&(Ei.match(En)&&window.PR.prettyPrint()),Tn.current)return Tn.current.addEventListener("click",Fi),function(){Tn.current.removeEventListener("click",Fi),A(),_e()}},[Ei,Tn.current,Fi]);var pa=function(gn){if(!h)return;gn.target.nodeName==="IMG"?(At.current.style.display="flex",At.current.style.width=gn.target.clientWidth+"px",At.current.style.height=gn.target.clientHeight+"px",At.current.style.top=gn.target.offsetTop+"px",At.current.style.left=gn.target.offsetLeft+"px",cn.current.src=gn.target.getAttribute("src")):At.current.style.display="none"};return j.a.createElement("div",{style:{position:"relative"}},j.a.createElement("div",{ref:Tn,style:Object(xe.a)({},Ve),className:"".concat(d||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:pa,dangerouslySetInnerHTML:{__html:Ei}}),j.a.createElement("div",{ref:At,className:mn.a.button},j.a.createElement(Ae.a,null,j.a.createElement(Me.a,{onClick:function(){return $n()}},"\u88C1\u526A"),j.a.createElement(Me.a,{onClick:function(){return $i()}},"\u7F16\u8F91"))),j.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),j.a.createElement(Je.a,{close:!0,data:yn,hasMask:ve,type:yn!=null&&yn.length?wi:"",style:Object(xe.a)({},Tt),onClose:function(){return An("")}}))}},"9VGf":function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return me});var ie=p("q1tI"),Ae=p.n(ie);function me(Me,xe){var Ce=Object(ie.useRef)();Object(ie.useEffect)(function(){Ce.current=Me}),Object(ie.useEffect)(function(){function Y(){Ce.current()}if(xe!==null){var I=setInterval(Y,xe);return function(){return clearInterval(I)}}},[xe])}},"A+k2":function(at,Ge,p){at.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(at,Ge,p){(function(ie){ie(p("VrN/"),p("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(V,J,j){if(j!=ie.Init&&j&&V.removeKeyMap("autoCloseTags"),!J)return;var F={name:"autoCloseTags"};(typeof J!="object"||J.whenClosing!==!1)&&(F["'/'"]=function(se){return Ce(se)}),(typeof J!="object"||J.whenOpening!==!1)&&(F["'>'"]=function(se){return Me(se)}),V.addKeyMap(F)});var Ae=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],me=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Me(V){if(V.getOption("disableInput"))return ie.Pass;for(var J=V.listSelections(),j=[],F=V.getOption("autoCloseTags"),se=0;seX.ch&&(_=_.slice(0,_.length-D.end+X.ch));var M=_.toLowerCase();if(!_||D.type=="string"&&(D.end!=X.ch||!/[\"\']/.test(D.string.charAt(D.string.length-1))||D.string.length==1)||D.type=="tag"&&te.close||D.string.indexOf("/")==X.ch-D.start-1||_e&&Y(_e,M)>-1||I(V,$.mode.xmlCurrentContext&&$.mode.xmlCurrentContext(L)||[],_,X,!0))return ie.Pass;var g=typeof F=="object"&&F.emptyTags;if(g&&Y(g,_)>-1){j[se]={text:"/>",newPos:ie.Pos(X.line,X.ch+2)};continue}var ee=ce&&Y(ce,M)>-1;j[se]={indent:ee,text:">"+(ee?`
`:"")+""+_+">",newPos:ee?ie.Pos(X.line+1,0):ie.Pos(X.line,X.ch+1)}}for(var S=typeof F=="object"&&F.dontIndentOnAutoClose,se=J.length-1;se>=0;se--){var B=j[se];V.replaceRange(B.text,J[se].head,J[se].anchor,"+insert");var x=V.listSelections().slice(0);x[se]={head:B.newPos,anchor:B.newPos},V.setSelections(x),!S&&B.indent&&(V.indentLine(B.newPos.line,null,!0),V.indentLine(B.newPos.line+1,null,!0))}}function xe(V,J){for(var j=V.listSelections(),F=[],se=J?"/":"",X=V.getOption("autoCloseTags"),D=typeof X=="object"&&X.dontIndentOnSlash,$=0;$"&&(_e+=">"),F[$]=_e}if(V.replaceSelections(F),j=V.listSelections(),!D)for(var $=0;$=0&&J[L]==j;L--)++$;F=D.to;for(var L=1;L<$;L++){var te=ie.scanForClosingTag(V,F,null,X);if(!te||te.tag!=j)return!1;F=te.to}return!0}})},BjJ7:function(at,Ge,p){"use strict";p.d(Ge,"d",function(){return Ae}),p.d(Ge,"c",function(){return me}),p.d(Ge,"e",function(){return Me}),p.d(Ge,"b",function(){return xe}),p.d(Ge,"a",function(){return Y});var ie=p("m3rI");function Ae(I){var V=!0;if(I.length>0){for(var J=0;J1&&arguments[1]!==void 0?arguments[1]:"",J=[],j=0;jN.length)&&(H=N.length);for(var K=0,C=new Array(H);K=N.length?{done:!0}:{done:!1,value:N[C++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return K=N[Symbol.iterator](),K.next.bind(K)}function Ce(N,H){return H={exports:{}},N(H,H.exports),H.exports}var Y=Ce(function(N){function H(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function K(C){N.exports.defaults=C}N.exports={defaults:H(),getDefaults:H,changeDefaults:K}}),I=Y.defaults,V=Y.getDefaults,J=Y.changeDefaults,j=/[&<>"']/,F=/[&<>"']/g,se=/[<>"']|&(?!#?\w+;)/,X=/[<>"']|&(?!#?\w+;)/g,D={"&":"&","<":"<",">":">",'"':""","'":"'"},$=function(H){return D[H]};function L(N,H){if(H){if(j.test(N))return N.replace(F,$)}else if(se.test(N))return N.replace(X,$);return N}var te=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _(N){return N.replace(te,function(H,K){return K=K.toLowerCase(),K==="colon"?":":K.charAt(0)==="#"?K.charAt(1)==="x"?String.fromCharCode(parseInt(K.substring(2),16)):String.fromCharCode(+K.substring(1)):""})}var de=/(^|[^\[])\^/g;function _e(N,H){N=N.source||N,H=H||"";var K={replace:function(w,O){return O=O.source||O,O=O.replace(de,"$1"),N=N.replace(w,O),K},getRegex:function(){return new RegExp(N,H)}};return K}var ce=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(N,H,K){if(N){var C;try{C=decodeURIComponent(_(K)).replace(ce,"").toLowerCase()}catch(w){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}H&&!M.test(K)&&(K=b(H,K));try{K=encodeURI(K).replace(/%25/g,"%")}catch(w){return null}return K}var ee={},S=/^[^:]+:\/*[^/]*$/,B=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(N,H){ee[" "+N]||(S.test(N)?ee[" "+N]=N+"/":ee[" "+N]=Z(N,"/",!0)),N=ee[" "+N];var K=N.indexOf(":")===-1;return H.substring(0,2)==="//"?K?H:N.replace(B,"$1")+H:H.charAt(0)==="/"?K?H:N.replace(x,"$1")+H:N+H}var z={exec:function(){}};function A(N){for(var H=1,K,C;H=0&&re[pe]==="\\";)ne=!ne;return ne?"|":" |"}),C=K.split(/ \|/),w=0;if(C.length>H)C.splice(H);else for(;C.length=C.length?w.slice(C.length):w}).join(`
`)}var Ee=function(){function N(K){this.options=K||P}var H=N.prototype;return H.space=function(C){var w=this.rules.block.newline.exec(C);if(w)return w[0].length>1?{type:"space",raw:w[0]}:{raw:`
`}},H.code=function(C,w){var O=this.rules.block.code.exec(C);if(O){var R=w[w.length-1];if(R&&R.type==="paragraph")return{raw:O[0],text:O[0].trimRight()};var re=O[0].replace(/^ {4}/gm,"");return{type:"code",raw:O[0],codeBlockStyle:"indented",text:this.options.pedantic?re:v(re,`
`)}}},H.fences=function(C){var w=this.rules.block.fences.exec(C);if(w){var O=w[0],R=we(O,w[3]||"");return{type:"code",raw:O,lang:w[2]?w[2].trim():w[2],text:R}}},H.heading=function(C){var w=this.rules.block.heading.exec(C);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},H.nptable=function(C){var w=this.rules.block.nptable.exec(C);if(w){var O={type:"table",header:le(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
`):[],raw:w[0]};if(O.header.length===O.align.length){var R=O.align.length,re;for(re=0;re ?/gm,"");return{type:"blockquote",raw:w[0],text:O}}},H.list=function(C){var w=this.rules.block.list.exec(C);if(w){for(var O=w[0],R=w[2],re=R.length>1,ne=R[R.length-1]===")",pe={type:"list",raw:O,ordered:re,start:re?+R.slice(0,-1):"",loose:!1,items:[]},nt=w[0].match(this.rules.block.item),Ke=!1,Se,gt,jt,ot,Xt,tt,Ht,It=nt.length,Rt=0;Rt1||this.options.smartLists&&jt!==R)&&(ot=nt.slice(Rt+1).join(`
`),pe.raw=pe.raw.substring(0,pe.raw.length-ot.length),Rt=It-1)),Xt=Ke||/\n\n(?!\s*$)/.test(Se),Rt!==It-1&&(Ke=Se.charAt(Se.length-1)===`
`,Xt||(Xt=Ke)),Xt&&(pe.loose=!0),tt=/^\[[ xX]\] /.test(Se),Ht=void 0,tt&&(Ht=Se[1]!==" ",Se=Se.replace(/^\[[ xX]\] +/,"")),pe.items.push({type:"list_item",raw:O,task:tt,checked:Ht,loose:Xt,text:Se});return pe}},H.html=function(C){var w=this.rules.block.html.exec(C);if(w)return{type:this.options.sanitize?"paragraph":"html",raw:w[0],pre:!this.options.sanitizer&&(w[1]==="pre"||w[1]==="script"||w[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(w[0]):He(w[0]):w[0]}},H.def=function(C){var w=this.rules.block.def.exec(C);if(w){w[3]&&(w[3]=w[3].substring(1,w[3].length-1));var O=w[1].toLowerCase().replace(/\s+/g," ");return{tag:O,raw:w[0],href:w[2],title:w[3]}}},H.table=function(C){var w=this.rules.block.table.exec(C);if(w){var O={type:"table",header:le(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
`):[]};if(O.header.length===O.align.length){O.raw=w[0];var R=O.align.length,re;for(re=0;re/i.test(R[0])&&(w=!1),!O&&/^<(pre|code|kbd|script)(\s|>)/i.test(R[0])?O=!0:O&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(R[0])&&(O=!1),{type:this.options.sanitize?"text":"html",raw:R[0],inLink:w,inRawBlock:O,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):He(R[0]):R[0]}},H.link=function(C){var w=this.rules.inline.link.exec(C);if(w){var O=je(w[2],"()");if(O>-1){var R=w[0].indexOf("!")===0?5:4,re=R+w[1].length+O;w[2]=w[2].substring(0,O),w[0]=w[0].substring(0,re).trim(),w[3]=""}var ne=w[2],pe="";if(this.options.pedantic){var nt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ne);nt?(ne=nt[1],pe=nt[3]):pe=""}else pe=w[3]?w[3].slice(1,-1):"";ne=ne.trim().replace(/^<([\s\S]*)>$/,"$1");var Ke=Je(w,{href:ne&&ne.replace(this.rules.inline._escapes,"$1"),title:pe&&pe.replace(this.rules.inline._escapes,"$1")},w[0]);return Ke}},H.reflink=function(C,w){var O;if((O=this.rules.inline.reflink.exec(C))||(O=this.rules.inline.nolink.exec(C))){var R=(O[2]||O[1]).replace(/\s+/g," ");if(R=w[R.toLowerCase()],!R||!R.href){var re=O[0].charAt(0);return{type:"text",raw:re,text:re}}var ne=Je(O,R,O[0]);return ne}},H.strong=function(C,w,O){O===void 0&&(O="");var R=this.rules.inline.strong.start.exec(C);if(R&&(!R[1]||R[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){w=w.slice(-1*C.length);var re=R[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;re.lastIndex=0;for(var ne;(R=re.exec(w))!=null;)if(ne=this.rules.inline.strong.middle.exec(w.slice(0,R.index+3)),ne)return{type:"strong",raw:C.slice(0,ne[0].length),text:C.slice(2,ne[0].length-2)}}},H.em=function(C,w,O){O===void 0&&(O="");var R=this.rules.inline.em.start.exec(C);if(R&&(!R[1]||R[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){w=w.slice(-1*C.length);var re=R[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;re.lastIndex=0;for(var ne;(R=re.exec(w))!=null;)if(ne=this.rules.inline.em.middle.exec(w.slice(0,R.index+2)),ne)return{type:"em",raw:C.slice(0,ne[0].length),text:C.slice(1,ne[0].length-1)}}},H.codespan=function(C){var w=this.rules.inline.code.exec(C);if(w){var O=w[2].replace(/\n/g," "),R=/[^ ]/.test(O),re=O.startsWith(" ")&&O.endsWith(" ");return R&&re&&(O=O.substring(1,O.length-1)),O=He(O,!0),{type:"codespan",raw:w[0],text:O}}},H.br=function(C){var w=this.rules.inline.br.exec(C);if(w)return{type:"br",raw:w[0]}},H.del=function(C){var w=this.rules.inline.del.exec(C);if(w)return{type:"del",raw:w[0],text:w[1]}},H.autolink=function(C,w){var O=this.rules.inline.autolink.exec(C);if(O){var R,re;return O[2]==="@"?(R=He(this.options.mangle?w(O[1]):O[1]),re="mailto:"+R):(R=He(O[1]),re=R),{type:"link",raw:O[0],text:R,href:re,tokens:[{type:"text",raw:R,text:R}]}}},H.url=function(C,w){var O;if(O=this.rules.inline.url.exec(C)){var R,re;if(O[2]==="@")R=He(this.options.mangle?w(O[0]):O[0]),re="mailto:"+R;else{var ne;do ne=O[0],O[0]=this.rules.inline._backpedal.exec(O[0])[0];while(ne!==O[0]);R=He(O[0]),O[1]==="www."?re="http://"+R:re=R}return{type:"link",raw:O[0],text:R,href:re,tokens:[{type:"text",raw:R,text:R}]}}},H.inlineText=function(C,w,O){var R=this.rules.inline.text.exec(C);if(R){var re;return w?re=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):He(R[0]):R[0]:re=He(this.options.smartypants?O(R[0]):R[0]),{type:"text",raw:R[0],text:re}}},N}(),G=Te.noopTest,U=Te.edit,ue=Te.merge,T={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:G,table:G,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};T._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,T._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,T.def=U(T.def).replace("label",T._label).replace("title",T._title).getRegex(),T.bullet=/(?:[*+-]|\d{1,9}[.)])/,T.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,T.item=U(T.item,"gm").replace(/bull/g,T.bullet).getRegex(),T.list=U(T.list).replace(/bull/g,T.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+T.def.source+")").getRegex(),T._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",T._comment=//,T.html=U(T.html,"i").replace("comment",T._comment).replace("tag",T._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),T.paragraph=U(T._paragraph).replace("hr",T.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",T._tag).getRegex(),T.blockquote=U(T.blockquote).replace("paragraph",T.paragraph).getRegex(),T.normal=ue({},T),T.gfm=ue({},T.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*|$)"}),T.gfm.nptable=U(T.gfm.nptable).replace("hr",T.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",T._tag).getRegex(),T.gfm.table=U(T.gfm.table).replace("hr",T.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",T._tag).getRegex(),T.pedantic=ue({},T.normal,{html:U(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",T._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:G,paragraph:U(T.normal._paragraph).replace("hr",T.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",T.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var E={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:G,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:G,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",E.punctuation=U(E.punctuation).replace(/punctuation/g,E._punctuation).getRegex(),E._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",E._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",E.em.start=U(E.em.start).replace(/punctuation/g,E._punctuation).getRegex(),E.em.middle=U(E.em.middle).replace(/punctuation/g,E._punctuation).replace(/overlapSkip/g,E._overlapSkip).getRegex(),E.em.endAst=U(E.em.endAst,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.em.endUnd=U(E.em.endUnd,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.strong.start=U(E.strong.start).replace(/punctuation/g,E._punctuation).getRegex(),E.strong.middle=U(E.strong.middle).replace(/punctuation/g,E._punctuation).replace(/blockSkip/g,E._blockSkip).getRegex(),E.strong.endAst=U(E.strong.endAst,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.strong.endUnd=U(E.strong.endUnd,"g").replace(/punctuation/g,E._punctuation).getRegex(),E.blockSkip=U(E._blockSkip,"g").getRegex(),E.overlapSkip=U(E._overlapSkip,"g").getRegex(),E._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,E._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,E._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])?)+(?![-_])/,E.autolink=U(E.autolink).replace("scheme",E._scheme).replace("email",E._email).getRegex(),E._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,E.tag=U(E.tag).replace("comment",T._comment).replace("attribute",E._attribute).getRegex(),E._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,E._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,E._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,E.link=U(E.link).replace("label",E._label).replace("href",E._href).replace("title",E._title).getRegex(),E.reflink=U(E.reflink).replace("label",E._label).getRegex(),E.reflinkSearch=U(E.reflinkSearch,"g").replace("reflink",E.reflink).replace("nolink",E.nolink).getRegex(),E.normal=ue({},E),E.pedantic=ue({},E.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:U(/^!?\[(label)\]\((.*?)\)/).replace("label",E._label).getRegex(),reflink:U(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",E._label).getRegex()}),E.gfm=ue({},E.normal,{escape:U(E.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&&(C="x"+C.toString(16)),H+=""+C+";";return H}var Re=function(){function N(K){this.tokens=[],this.tokens.links=Object.create(null),this.options=K||Le,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var C={block:Ze.normal,inline:ke.normal};this.options.pedantic?(C.block=Ze.pedantic,C.inline=ke.pedantic):this.options.gfm&&(C.block=Ze.gfm,this.options.breaks?C.inline=ke.breaks:C.inline=ke.gfm),this.tokenizer.rules=C}N.lex=function(C,w){var O=new N(w);return O.lex(C)};var H=N.prototype;return H.lex=function(C){return C=C.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(C,this.tokens,!0),this.inline(this.tokens),this.tokens},H.blockTokens=function(C,w,O){w===void 0&&(w=[]),O===void 0&&(O=!0),C=C.replace(/^ +$/gm,"");for(var R,re,ne,pe;C;){if(R=this.tokenizer.space(C)){C=C.substring(R.raw.length),R.type&&w.push(R);continue}if(R=this.tokenizer.code(C,w)){C=C.substring(R.raw.length),R.type?w.push(R):(pe=w[w.length-1],pe.raw+=`
`+R.raw,pe.text+=`
`+R.text);continue}if(R=this.tokenizer.fences(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.heading(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.nptable(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.hr(C)){C=C.substring(R.raw.length),w.push(R);continue}if(R=this.tokenizer.blockquote(C)){C=C.substring(R.raw.length),R.tokens=this.blockTokens(R.text,[],O),w.push(R);continue}if(R=this.tokenizer.list(C)){for(C=C.substring(R.raw.length),ne=R.items.length,re=0;re0)for(;(nt=this.tokenizer.rules.inline.reflinkSearch.exec(pe))!=null;)Ke.includes(nt[0].slice(nt[0].lastIndexOf("[")+1,-1))&&(pe=pe.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(nt=this.tokenizer.rules.inline.blockSkip.exec(pe))!=null;)pe=pe.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;C;){if(ne=this.tokenizer.escape(C)){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.tag(C,O,R)){C=C.substring(ne.raw.length),O=ne.inLink,R=ne.inRawBlock,w.push(ne);continue}if(ne=this.tokenizer.link(C)){C=C.substring(ne.raw.length),ne.type==="link"&&(ne.tokens=this.inlineTokens(ne.text,[],!0,R)),w.push(ne);continue}if(ne=this.tokenizer.reflink(C,this.tokens.links)){C=C.substring(ne.raw.length),ne.type==="link"&&(ne.tokens=this.inlineTokens(ne.text,[],!0,R)),w.push(ne);continue}if(ne=this.tokenizer.strong(C,pe,re)){C=C.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],O,R),w.push(ne);continue}if(ne=this.tokenizer.em(C,pe,re)){C=C.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],O,R),w.push(ne);continue}if(ne=this.tokenizer.codespan(C)){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.br(C)){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.del(C)){C=C.substring(ne.raw.length),ne.tokens=this.inlineTokens(ne.text,[],O,R),w.push(ne);continue}if(ne=this.tokenizer.autolink(C,ge)){C=C.substring(ne.raw.length),w.push(ne);continue}if(!O&&(ne=this.tokenizer.url(C,ge))){C=C.substring(ne.raw.length),w.push(ne);continue}if(ne=this.tokenizer.inlineText(C,R,Ue)){C=C.substring(ne.raw.length),re=ne.raw.slice(-1),w.push(ne);continue}if(C){var Se="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(Se);break}else throw new Error(Se)}}return w},Ae(N,null,[{key:"rules",get:function(){return{block:Ze,inline:ke}}}]),N}(),Be=Y.defaults,Qe=Te.cleanUrl,it=Te.escape,Xe=function(){function N(K){this.options=K||Be}var H=N.prototype;return H.code=function(C,w,O){var R=(w||"").match(/\S*/)[0];if(this.options.highlight){var re=this.options.highlight(C,R);re!=null&&re!==C&&(O=!0,C=re)}return R?''+(O?C:it(C,!0))+`
`:""+(O?C:it(C,!0))+`
`},H.blockquote=function(C){return`
`+C+`
`},H.html=function(C){return C},H.heading=function(C,w,O,R){return this.options.headerIds?"
`:""+C+"
`},H.hr=function(){return this.options.xhtml?`
`:`
`},H.list=function(C,w,O){var R=w?"ol":"ul",re=w&&O!==1?' start="'+O+'"':"";return"<"+R+re+`>
`+C+""+R+`>
`},H.listitem=function(C){return""+C+`
`},H.checkbox=function(C){return" "},H.paragraph=function(C){return""+C+`
`},H.table=function(C,w){return w&&(w=""+w+""),`
`},H.tablerow=function(C){return`
`+C+`
`},H.tablecell=function(C,w){var O=w.header?"th":"td",R=w.align?"<"+O+' align="'+w.align+'">':"<"+O+">";return R+C+""+O+`>
`},H.strong=function(C){return""+C+""},H.em=function(C){return""+C+""},H.codespan=function(C){return""+C+""},H.br=function(){return this.options.xhtml?"
":"
"},H.del=function(C){return""+C+""},H.link=function(C,w,O){if(C=Qe(this.options.sanitize,this.options.baseUrl,C),C===null)return O;var R='"+O+"",R},H.image=function(C,w,O){if(C=Qe(this.options.sanitize,this.options.baseUrl,C),C===null)return O;var R='
":">",R},H.text=function(C){return C},N}(),De=function(){function N(){}var H=N.prototype;return H.strong=function(C){return C},H.em=function(C){return C},H.codespan=function(C){return C},H.del=function(C){return C},H.html=function(C){return C},H.text=function(C){return C},H.link=function(C,w,O){return""+O},H.image=function(C,w,O){return""+O},H.br=function(){return""},N}(),Et=function(){function N(){this.seen={}}var H=N.prototype;return H.slug=function(C){var w=C.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(w)){var O=w;do this.seen[O]++,w=O+"-"+this.seen[O];while(this.seen.hasOwnProperty(w))}return this.seen[w]=0,w},N}(),pt=Y.defaults,bt=Te.unescape,ct=function(){function N(K){this.options=K||pt,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new Et}N.parse=function(C,w){var O=new N(w);return O.parse(C)};var H=N.prototype;return H.parse=function(C,w){w===void 0&&(w=!0);var O="",R,re,ne,pe,nt,Ke,Se,gt,jt,ot,Xt,tt,Ht,It,Rt,Jt,Ft,We,lt=C.length;for(R=0;R0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=We+" "+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=We+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:We}):It+=We),It+=this.parse(Rt.tokens,Ht),jt+=this.renderer.listitem(It,Ft,Jt);O+=this.renderer.list(jt,Xt,tt);continue}case"html":{O+=this.renderer.html(ot.text);continue}case"paragraph":{O+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(jt=ot.tokens?this.parseInline(ot.tokens):ot.text;R+1An error occurred:"+Ct(ne.message+"",!0)+"
";throw ne}}Ne.options=Ne.setOptions=function(N){return Mt(Ne.defaults,N),Ut(Ne.defaults),Ne},Ne.getDefaults=Pe,Ne.defaults=kt,Ne.use=function(N){var H=Mt({},N);if(N.renderer&&function(){var C=Ne.defaults.renderer||new Xe,w=function(re){var ne=C[re];C[re]=function(){for(var pe=arguments.length,nt=new Array(pe),Ke=0;KeWe.length){var on=Object(De.xor)(Gt,We);console.log(on,"newLevel"),Kt=Kt.filter(function(Vt){return!on.includes(Vt)})}nt(Kt),tt(We.length===(Ke==null||((qe=Ke.tag_disciplines)===null||qe===void 0)?void 0:qe.length))},It=function(We){var lt,qe=Ke==null||((lt=Ke.tag_disciplines)===null||lt===void 0)?void 0:lt.map(function(dt){return dt.id});nt(We.target.checked?Object(De.uniq)([].concat(Object(Te.a)(pe),Object(Te.a)(qe))):pe==null?void 0:pe.filter(function(dt){return!qe.includes(dt)})),tt(We.target.checked)};console.log(Ke,"options");var Rt=function(){var We,lt,qe=(Ke==null?void 0:Ke.tag_disciplines)||[];if(Se){var dt;qe=(dt=qe)===null||dt===void 0?void 0:dt.filter(function(Gt){var Kt;return Gt==null||((Kt=Gt.name)===null||Kt===void 0)?void 0:Kt.includes(Se)})}return qe=(We=qe)===null||We===void 0?void 0:We.map(function(Gt){return Object(J.a)(Object(J.a)({},Gt),{},{label:"".concat(Gt.name,"(".concat(Gt==null?void 0:Gt.item_count,")")),value:Gt.id})}),qe=(lt=qe)===null||lt===void 0?void 0:lt.filter(function(Gt){return Gt.item_count!==0}),qe},Jt=function(){var We=!1;if(!Se)We=!0;else{var lt;(lt=Ke.tag_disciplines)===null||lt===void 0||lt.forEach(function(qe){if(!We){var dt;We=((dt=qe.name)===null||dt===void 0?void 0:dt.includes(Se))&&qe.item_count!==0}})}return We};return(Ke==null?void 0:Ke.item_count)===0||!Jt()?_.a.createElement(_.a.Fragment,null):_.a.createElement("div",{className:Xe.a.cInput},_.a.createElement("div",{className:Xe.a.cl},_.a.createElement(A.a,{checked:Xt,onChange:It},_.a.createElement("span",{className:Xe.a.box},_.a.createElement("span",{className:"font14 c-light-primary"},_.a.createElement("span",{title:Ke==null?void 0:Ke.name,className:Xe.a.box1}," ",Ke==null?void 0:Ke.name),_.a.createElement("span",null," ","(".concat(Ke==null?void 0:Ke.item_count,")"))),_.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),_.a.createElement("div",{className:Xe.a.cr},_.a.createElement(Et,{options:Rt(),value:pe,onChange:Ht})))},bt=pt,ct=p("ErOA"),Mt=p("ozfa"),Ot=p("MJZm"),Ct=p("0Owb"),Pe=p("tmPe"),Ut=p.n(Pe),kt=function(re){var ne=re.value,pe=re.onChange,nt=re.defaultValue,Ke=re.treeData,Se=Ke===void 0?[]:Ke,gt=Object(Qe.a)(re,["value","onChange","defaultValue","treeData"]);return _.a.createElement("div",{className:Ut.a.customTree},_.a.createElement(Ot.a,Object(Ct.a)({multiple:!0,showIcon:!0,selectedKeys:ne,defaultExpandedKeys:nt,treeData:Se,onSelect:pe},gt)))},Ne=kt,Fe=p("sbIO"),N=D.a.Search,H=function(re){var ne,pe=re.formValue,nt=re.setFatherTabs,Ke=re.tabs,Se=re.editData,gt=re.dispatch,jt=Object(de.i)().id,ot=Object(te.useState)(["mine"]),Xt=Object(se.a)(ot,2),tt=Xt[0],Ht=Xt[1],It=Object(te.useState)(!0),Rt=Object(se.a)(It,2),Jt=Rt[0],Ft=Rt[1],We=Object(te.useState)(!1),lt=Object(se.a)(We,2),qe=lt[0],dt=lt[1],Gt=Object(te.useState)(!1),Kt=Object(se.a)(Gt,2),on=Kt[0],Vt=Kt[1],_t=Object(te.useState)(""),tn=Object(se.a)(_t,2),Lt=tn[0],un=tn[1],zt=Object(te.useState)(!1),dn=Object(se.a)(zt,2),In=dn[0],nn=dn[1],$e=Object(te.useState)(!1),ut=Object(se.a)($e,2),mn=ut[0],En=ut[1],On=Object(te.useState)({}),Bn=Object(se.a)(On,2),c=Bn[0],o=Bn[1],r=Object(te.useState)([]),u=Object(se.a)(r,2),h=u[0],d=u[1],q=Object(te.useState)([]),Ye=Object(se.a)(q,2),st=Ye[0],Nt=Ye[1],ve=Object(te.useState)([]),oe=Object(se.a)(ve,2),Ve=oe[0],Pt=oe[1],Tt=Object(te.useState)([]),St=Object(se.a)(Tt,2),At=St[0],cn=St[1],Nn=Object(te.useState)(null),wn=Object(se.a)(Nn,2),yn=wn[0],An=wn[1],Dn=Object(te.useRef)([]),ti=Object(te.useState)(!1),wi=Object(se.a)(ti,2),Xn=wi[0],$n=wi[1],$i=Object(te.useState)([]),Ei=Object(se.a)($i,2),Tn=Ei[0],Fi=Ei[1],ra=Object(te.useState)([0]),pa=Object(se.a)(ra,2),zn=pa[0],gn=pa[1],li=Object(te.useState)([]),pn=Object(se.a)(li,2),Hn=pn[0],Cn=pn[1],di=Object(te.useRef)([]),Yn=Object(te.useState)(!1),Ci=Object(se.a)(Yn,2),fa=Ci[0],na=Ci[1],ia=Object(te.useState)([]),Sa=Object(se.a)(ia,2),bn=Sa[0],Ji=Sa[1],Vi=Object(te.useState)([]),sa=Object(se.a)(Vi,2),Zi=sa[0],la=sa[1],ua=Object(te.useRef)([]),no=Object(te.useState)([]),Wt=Object(se.a)(no,2),qt=Wt[0],$t=Wt[1],rn=Object(te.useState)(!1),vn=Object(se.a)(rn,2),Sn=vn[0],fn=vn[1],Kn=Object(te.useRef)([]),Si=Object(te.useState)(0),sn=Object(se.a)(Si,2),aa=sn[0],hn=sn[1],Jn=Hn==null?void 0:Hn.filter(function(mt){return Tn==null?void 0:Tn.includes(mt.id)}),Wi=Zi==null?void 0:Zi.filter(function(mt){return bn==null?void 0:bn.includes(mt.id)});Object(te.useEffect)(function(){ka()},[]),Object(te.useEffect)(function(){return Ke===1&&(gt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),gt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){gt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),gt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[Ke]),Object(te.useEffect)(function(){jt?Se&&ui():(Fa(tt),ma(),Ft(!1))},[Se]),Object(te.useEffect)(function(){Lt&&zi()},[Lt]);var zi=function(){var rt=null;st==null||st.forEach(function(Ie){var Oe;(Oe=Ie.sub_disciplines)===null||Oe===void 0||Oe.forEach(function(vt){var ft;(ft=vt.tag_disciplines)===null||ft===void 0||ft.forEach(function(yt){var Zt,an=((Zt=yt.name)===null||Zt===void 0?void 0:Zt.includes(Lt))&&yt.item_count!==0;an&&!rt&&(rt=Ie.id)})})}),rt&&An(rt)},Ba=function(rt){function Ie(Oe){var vt=Oe.children,ft=Array.isArray(vt)&&vt.length>0,yt=Oe==null?void 0:Oe.group_id;return Kn.current.push({name:Oe==null?void 0:Oe.name,id:yt,count:Oe==null?void 0:Oe.count}),{title:_.a.createElement("div",{title:Oe==null?void 0:Oe.name,className:v.a.name},Oe==null?void 0:Oe.name,"\uFF08".concat(Oe==null?void 0:Oe.count,"\uFF09")),value:yt,name:Oe==null?void 0:Oe.name,key:yt,count:Oe==null?void 0:Oe.count,id:yt,icon:_.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:ft?vt==null?void 0:vt.map(function(Zt){return Ie(Zt)}):[]}}return rt==null?void 0:rt.map(function(Oe){return Ie(Oe)})},ka=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie,Oe;return L.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(le.x)({});case 2:Ie=ft.sent,Kn.current=[{id:0,name:"\u6839\u76EE\u5F55",count:Ie==null?void 0:Ie.root_count}],Ie!=null&&Ie.data&&(Oe=[{title:_.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:v.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((Ie==null?void 0:Ie.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:Ie==null?void 0:Ie.root_count,name:"\u6839\u76EE\u5F55",icon:_.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Ba(Ie.data||[])}],Cn(Kn.current),$t(Oe));case 5:case"end":return ft.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),ui=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie,Oe,vt,ft,yt,Zt,an,Pn,kn,Mn,xn,ni,Fn,Wn,hi,ai,qn,pi;return L.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return Mn=Se==null||((Ie=Se.tag_disciplines)===null||Ie===void 0)?void 0:Ie.map(function(_n){return _n.tag_discipline_id}),xn=Se==null||((Oe=Se.groups)===null||Oe===void 0)?void 0:Oe.map(function(_n){return _n.id}),ni={source:Se==null||((vt=Se.examination_bank)===null||vt===void 0)?void 0:vt.source,group_ids:xn,tag_discipline_ids:Mn,teach_group_ids:Se==null?void 0:Se.teach_group_ids},en.next=5,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ni});case 5:if(Fn=en.sent,!((Fn==null?void 0:Fn.status)===-1)){en.next=8;break}return en.abrupt("return");case 8:Wn=Fn==null?void 0:Fn.filter(function(_n){var Zn;return!!(_n!=null&&(Zn=_n.item_banks)!==null&&Zn!==void 0&&Zn.length)}),Wn=Wn.map(function(_n){return Object(J.a)(Object(J.a)({},_n),{},{scoreTotal:0,score:0,questionTotal:0})}),Wn=(ft=Wn)===null||ft===void 0?void 0:ft.map(function(_n,Zn){var fi,oi,Pi;return Object(J.a)(Object(J.a)({},_n),{},{score:(Se==null||((fi=Se.score_settings)===null||fi===void 0||((oi=fi.find(function(Ai){return Ai.item_type===(_n==null?void 0:_n.item_type)}))===null||oi===void 0))?void 0:oi.score)||0,item_banks:_n==null||((Pi=_n.item_banks)===null||Pi===void 0)?void 0:Pi.map(function(Ai){var jn;return Object(J.a)(Object(J.a)({},Ai),{},{tag_disciplines:Ai==null||((jn=Ai.tag_disciplines)===null||jn===void 0)?void 0:jn.map(function(Vn){var mi;return Object(J.a)(Object(J.a)({},Vn),{},{difficulties:Vn==null||((mi=Vn.difficulties)===null||mi===void 0)?void 0:mi.map(function(ki){var vi=Se==null?void 0:Se.contents.find(function(Ni){return Ni.item_type===_n.item_type&&Ni.sub_discipline_id===Ai.sub_discipline_id&&Ni.tag_discipline_id===Vn.tag_discipline_id&&Ni.difficulty===ki.difficulty});return vi?Object(J.a)(Object(J.a)({},ki),{},{num:vi==null?void 0:vi.quanlity}):Object(J.a)({},ki)})})})})})})}),hi=Ra(Wn),ai=hi.panel,qn=hi.score_num_item,Wn=(yt=Wn)===null||yt===void 0?void 0:yt.map(function(_n,Zn){var fi,oi=(ai==null||((fi=ai[Zn])===null||fi===void 0)?void 0:fi.reduce(function(Pi,Ai){return Pi+Ai},0))||0;return Object(J.a)(Object(J.a)({},_n),{},{scoreTotal:oi*(qn[Zn]||0),questionTotal:oi})}),pi=[],Se==null||((Zt=Se.sort_by_item_type)===null||Zt===void 0)||Zt.forEach(function(_n){var Zn=Wn.find(function(fi){var oi,Pi=(oi=Oa.find(function(Ai){return Ai.type===(fi==null?void 0:fi.item_type)}))===null||oi===void 0?void 0:oi.name;return Pi===_n});pi.push(Zn)}),pi=Object(De.compact)(pi),Fa(Se==null||((an=Se.examination_bank)===null||an===void 0)?void 0:an.source),ma(),Ht(Se==null||((Pn=Se.examination_bank)===null||Pn===void 0)?void 0:Pn.source),cn(Mn),Dn.current=Mn,Fi(xn),Ji((Se==null?void 0:Se.teach_group_ids)||[]),hn(Se==null||((kn=Se.groups)===null||kn===void 0)?void 0:kn.map(function(_n){return _n.count}).reduce(function(_n,Zn){return _n+Zn},0)),di.current=xn,gn(xn!=null&&xn.length?xn:[0]),d(Object(De.cloneDeep)(pi)),Ft(!1);case 29:case"end":return en.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),qo=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie;return L.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:Ie={source:tt,group_ids:Tn,tag_discipline_ids:At,teach_group_ids:bn},ca(Ie),Dn.current=At,nn(!1);case 4:case"end":return vt.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),Fa=function(){var mt=Object(V.a)(L.a.mark(function rt(Ie){var Oe,vt,ft,yt,Zt,an;return L.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(ct.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:Ie}});case 2:ft=kn.sent,yt=[],ft==null||((Oe=ft.disciplines)===null||Oe===void 0)||Oe.forEach(function(Mn){var xn;Mn==null||((xn=Mn.sub_disciplines)===null||xn===void 0)||xn.forEach(function(ni){yt=yt.concat((ni==null?void 0:ni.tag_disciplines)||[])})}),Zt=null,an=ft==null||((vt=ft.disciplines)===null||vt===void 0)?void 0:vt.map(function(Mn){var xn,ni=Mn==null||((xn=Mn.sub_disciplines)===null||xn===void 0)?void 0:xn.reduce(function(Fn,Wn){return Fn+Wn.item_count},0);return!Zt&&ni!==0&&(Zt=Mn.id),Object(J.a)(Object(J.a)({},Mn),{},{item_count:ni})}),console.log(an,48767874),Nt(an),Pt(yt),An(Zt);case 11:case"end":return kn.stop()}},rt)}));return function(Ie){return mt.apply(this,arguments)}}(),ma=function(){var mt=Object(V.a)(L.a.mark(function rt(){var Ie;return L.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,Object(ct.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:Ie=vt.sent,la((Ie==null?void 0:Ie.groups)||[]);case 4:case"end":return vt.stop()}},rt)}));return function(){return mt.apply(this,arguments)}}(),ca=function(){var mt=Object(V.a)(L.a.mark(function rt(Ie){var Oe,vt;return L.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return Ft(!0),yt.next=3,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:Ie});case 3:Oe=yt.sent,vt=Oe==null?void 0:Oe.filter(function(Zt){var an;return!!(Zt!=null&&(an=Zt.item_banks)!==null&&an!==void 0&&an.length)}),vt=vt.map(function(Zt){return Object(J.a)(Object(J.a)({},Zt),{},{scoreTotal:0,score:0,questionTotal:0})}),d(vt),Ft(!1);case 8:case"end":return yt.stop()}},rt)}));return function(Ie){return mt.apply(this,arguments)}}(),To=function(){cn(Dn.current),nn(!1),un("")},er=function(rt){cn(rt)},io=function(){for(var rt=Ve==null?void 0:Ve.filter(function(Pn){return At==null?void 0:At.includes(Pn.id)}),Ie=Object(Te.a)(rt),Oe=0,vt=[],ft=0;ft1&&rt!==0&&(Ie=va(Oe,rt,rt-1)),d(Ie)},Wa=function(rt){var Ie=[],Oe=Object(De.cloneDeep)(h);Oe.length>1&&rt!==Oe.length-1&&(Ie=va(Oe,rt,rt+1)),d(Ie)},Ta=function(){var mt=Object(V.a)(L.a.mark(function rt(Ie){var Oe,vt,ft,yt;return L.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(ft=Object(Te.a)(tt),tt.includes(Ie)?ft=ft.filter(function(Pn){return Pn!==Ie}):ft.push(Ie),!(ft.length===0)){an.next=5;break}return ae.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),an.abrupt("return");case 5:(Oe=ft)!==null&&Oe!==void 0&&Oe.includes("mine")||(Fi([]),di.current=[]),(vt=ft)!==null&&vt!==void 0&&vt.includes("teach_groups")||(Ji([]),ua.current=[]),Ht(ft),Fa(ft),cn([]),Dn.current=[],yt={source:ft,group_ids:di.current,tag_discipline_ids:[],teach_group_ids:ua.current},ca(yt);case 13:case"end":return an.stop()}},rt)}));return function(Ie){return mt.apply(this,arguments)}}(),Mo=function(rt){var Ie={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!rt)return;var Oe=rt||{},vt=Oe.exam,ft=Oe.single_questions,yt=Oe.multiple_questions,Zt=Oe.judgement_questions,an=Oe.program_questions,Pn=Oe.completion_questions,kn=Oe.subjective_questions,Mn=Oe.practical_questions,xn=Oe.combination_questions,ni=[Object(J.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},ft),Object(J.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},yt),Object(J.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Pn),Object(J.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Zt),Object(J.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},kn),Object(J.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},an),Object(J.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Mn),Object(J.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},xn)],Fn=[],Wn=0,hi=0,ai=ni.filter(function(qn){return qn.questions_count>0}).map(function(qn,pi){var Ti;return(Ti=qn.questions)===null||Ti===void 0||Ti.forEach(function(en){Fn.push(en.id),Wn=Wn+en.score,hi=hi+1}),Object(J.a)(Object(J.a)({},qn),{number:Ie[pi+1]})});return{all_questions_count:hi,all_score:Wn,questionList:ai,ids:Fn,exam:vt}},Yi=function(rt){var Ie,Oe,vt=Object(De.cloneDeep)(c),ft=Object(De.cloneDeep)(h);vt.questionList=vt==null||((Ie=vt.questionList)===null||Ie===void 0)?void 0:Ie.map(function(yt){return yt.type===rt.type?Object(J.a)(Object(J.a)({},yt),{},{questions_score:rt.scoreTotal}):yt}),ft=(Oe=ft)===null||Oe===void 0?void 0:Oe.map(function(yt){return yt.item_type===rt.type?Object(J.a)(Object(J.a)({},yt),{},{score:rt.score,scoreTotal:rt.scoreTotal}):yt}),d(ft),o(vt),console.log(rt,c,h)},qi=st==null||((ne=st.find(function(mt){return mt.id===yn}))===null||ne===void 0)?void 0:ne.sub_disciplines,Pa=io();return mn?_.a.createElement(Fe.a,{loading:qe,submit:Ao,goBack:function(){return En(!1)},data:c,onTypeScore:Yi,onExchange:ao}):_.a.createElement("section",{className:v.a.wrap,style:{display:Ke?"flex":"none"}},_.a.createElement("div",{id:"id_left",className:v.a.left,onMouseEnter:function(rt){var Ie=document.getElementById("id_left");Ie.style.overflowY="auto"},onMouseLeave:function(rt){var Ie=document.getElementById("id_left");Ie.style.overflowY="hidden"}},_.a.createElement(Ae.a,{loading:Jt,active:!0,paragraph:{rows:5}},h.map(function(mt,rt){var Ie;return _.a.createElement("div",{className:v.a.list,key:rt},_.a.createElement("div",{className:v.a.name},_.a.createElement("b",null),_.a.createElement("span",null,(Ie=Oa.find(function(Oe){return Oe.type===(mt==null?void 0:mt.item_type)}))===null||Ie===void 0?void 0:Ie.name)),_.a.createElement("aside",null,_.a.createElement("div",null,"\u5171",_.a.createElement("span",{className:v.a.b},mt.questionTotal),"\u9898",_.a.createElement("span",{className:v.a.l},"|"),"\u5171",_.a.createElement("span",{className:v.a.r},mt.scoreTotal),"\u5206"),_.a.createElement("div",null,rt>0?_.a.createElement(Z.a,{getPopupContainer:function(vt){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},_.a.createElement("span",{onClick:function(){return Qi(rt)},className:"mb20",style:{transform:"rotate(270deg)"}}," ",_.a.createElement("i",{className:"icon-jiantou1"}))):_.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}}," ",_.a.createElement("i",{className:"icon-jiantou1"})),rt"),_.a.createElement("span",{className:"current",onClick:function(){return _e.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),_.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),jt===0&&_.a.createElement(B,{value:jt,onChange:un}),jt===0&&_.a.createElement("section",{className:M.a.oneWrap},_.a.createElement("div",{className:M.a.title},_.a.createElement("b",null),_.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),_.a.createElement("div",null,"STEP1")," "),_.a.createElement(F.a,{className:M.a.formWrap,form:Ht,layout:"horizontal",onValuesChange:tn},_.a.createElement(F.a.Item,{label:"\u8BD5\u5377\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^(?!(\s+$))/,message:"\u8F93\u5165\u6846\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C"}]},_.a.createElement(D.a,{className:M.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),_.a.createElement("div",{style:{position:"relative"}},_.a.createElement(F.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},_.a.createElement(I.a,{min:1,parser:zt,max:9999,placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F",style:{width:190}})),_.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),_.a.createElement(F.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},_.a.createElement(Ce.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},_.a.createElement(Ce.a.Button,{className:M.a.rb,value:1},"\u7B80\u5355"),_.a.createElement(Ce.a.Button,{className:M.a.rb,value:2},"\u9002\u4E2D"),_.a.createElement(Ce.a.Button,{className:M.a.rb,value:3},"\u56F0\u96BE"))),_.a.createElement(F.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},_.a.createElement(C,{placeholder:"\u8003\u751F\u5FC5\u987B\u4E25\u683C\u9075\u5B88\u8003\u573A\u7EAA\u5F8B\uFF0C\u4E0D\u51C6\u5192\u540D\u9876\u66FF\uFF0C\u4E0D\u51C6\u6709\u4EFB\u4F55\u4F5C\u5F0A\u884C\u4E3A\u3002\u5982\u53D1\u73B0\u8FDD\u7EAA\uFF0C\u5E76\u7ED9\u4E88\u4E25\u5389\u5904\u5206\u3002",rows:4,maxLength:300}))),_.a.createElement("div",{className:M.a.btns},_.a.createElement(Me.a,{className:"mr40",onClick:function(){return _e.d.push("/paperlibrary")}},"\u8FD4\u56DE"),_.a.createElement(Me.a,{type:"primary",onClick:Object(V.a)(L.a.mark(function dn(){return L.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Ht.validateFields();case 2:ot(1);case 3:case"end":return nn.stop()}},dn)}))},"\u4E0B\u4E00\u6B65"))),_.a.createElement(K,{tabs:jt,dispatch:Ke,editData:on,setFatherTabs:ot,formValue:Jt})))},O=Ge.default=Object(_e.a)(function(R){var re=R.paperlibrary,ne=R.user,pe=R.globalSetting;return{paperlibrary:re,user:ne,globalSetting:pe}})(w)},"E/GV":function(at,Ge,p){at.exports=p.p+"static/swenjianjia.1640bf70.svg"},ELLl:function(at,Ge,p){(function(ie){ie(p("VrN/"))})(function(ie){var Ae={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},me=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(D,$,L){L&&L!=ie.Init&&(D.removeKeyMap(xe),D.state.closeBrackets=null),$&&(Ce(Me($,"pairs")),D.state.closeBrackets=$,D.addKeyMap(xe))});function Me(D,$){return $=="pairs"&&typeof D=="string"?D:typeof D=="object"&&D[$]!=null?D[$]:Ae[$]}var xe={Backspace:V,Enter:J};function Ce(D){for(var $=0;$=0;_--){var _e=te[_].head;D.replaceRange("",me(_e.line,_e.ch-1),me(_e.line,_e.ch+1),"+delete")}}function J(D){var $=I(D),L=$&&Me($,"explode");if(!L||D.getOption("disableInput"))return ie.Pass;for(var te=D.listSelections(),_=0;_0;return{anchor:new me(D.anchor.line,D.anchor.ch+($?-1:1)),head:new me(D.head.line,D.head.ch+($?1:-1))}}function F(D,$){var L=I(D);if(!L||D.getOption("disableInput"))return ie.Pass;var te=Me(L,"pairs"),_=te.indexOf($);if(_==-1)return ie.Pass;for(var de=Me(L,"closeBefore"),_e=Me(L,"triples"),ce=te.charAt(_+1)==$,M=D.listSelections(),g=_%2==0,ee,S=0;S=0&&D.getRange(x,me(x.line,x.ch+3))==$+$+$?b="skipThree":b="skip";else if(ce&&x.ch>1&&_e.indexOf($)>=0&&D.getRange(me(x.line,x.ch-2),x)==$+$){if(x.ch>2&&/\bstring/.test(D.getTokenTypeAt(me(x.line,x.ch-2))))return ie.Pass;b="addFour"}else if(ce){var A=x.ch==0?" ":D.getRange(me(x.line,x.ch-1),x);if(!ie.isWordChar(z)&&A!=$&&!ie.isWordChar(A))b="both";else return ie.Pass}else if(g&&(z.length===0||/\s/.test(z)||de.indexOf(z)>-1))b="both";else return ie.Pass;if(!ee)ee=b;else if(ee!=b)return ie.Pass}var k=_%2?te.charAt(_-1):$,Z=_%2?$:te.charAt(_+1);D.operation(function(){if(ee=="skip")D.execCommand("goCharRight");else if(ee=="skipThree")for(var be=0;be<3;be++)D.execCommand("goCharRight");else if(ee=="surround"){for(var ae=D.getSelections(),be=0;be1&&arguments[1]!==void 0?arguments[1]:1,K=De.length,C=0;C1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(v).map(function(He,je){if(!xe.isValidElement(He)||!He.type)return null;var Je=He.type.isSelectOptGroup,we=He.key,Ee=He.props,G=Ee.children,U=Object(Y.a)(Ee,["children"]);return le||!Je?ee(He):Object(M.a)(Object(M.a)({key:"__RC_SELECT_GRP__".concat(we===null?je:we,"__"),label:we},U),{},{options:S(G)})}).filter(function(He){return He})}var B=p("2Qr1"),x=p("qNPg"),b=p("U8pU"),z=p("Kwbf"),A=p("WKfj");function k(v){var le=v.mode,He=v.options,je=v.children,Je=v.backfill,we=v.allowClear,Ee=v.placeholder,G=v.getInputElement,U=v.showSearch,ue=v.onSearch,T=v.defaultOpen,E=v.autoFocus,he=v.labelInValue,Le=v.value,Ze=v.inputValue,ke=v.optionLabelProp,Ue=le==="multiple"||le==="tags",ge=U!==void 0?U:Ue||le==="combobox",Re=He||S(je);if(Object(z.a)(le!=="tags"||Re.every(function(Xe){return!Xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),le==="tags"||le==="combobox"){var Be=Re.some(function(Xe){return Xe.options?Xe.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in Xe?Xe.value:Xe.key)=="number"});Object(z.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(z.a)(le!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(z.a)(le==="combobox"||!Je,"`backfill` only works with `combobox` mode."),Object(z.a)(le==="combobox"||!G,"`getInputElement` only work with `combobox` mode."),Object(z.b)(le!=="combobox"||!G||!we||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!ge&&le!=="combobox"&&le!=="tags"&&Object(z.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(z.b)(!T||E,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Le!=null){var Qe=Object(A.d)(Le);Object(z.a)(!he||Qe.every(function(Xe){return Object(b.a)(Xe)==="object"&&("key"in Xe||"value"in Xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(z.a)(!Ue||Array.isArray(Le),"`value` should be array when `mode` is `multiple` or `tags`")}if(je){var it=null;Object(g.a)(je).some(function(Xe){if(!xe.isValidElement(Xe)||!Xe.type)return!1;var De=Xe.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var Et=Object(g.a)(Xe.props.children).every(function(pt){return!xe.isValidElement(pt)||!Xe.type||pt.type.isSelectOption?!0:(it=pt.type,!1)});return!Et}return it=De,!0}),it&&Object(z.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(it.displayName||it.name||it,"`.")),Object(z.a)(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var Z=k,be=Object(x.a)({prefixCls:"rc-select",components:{optionList:te},convertChildrenToData:S,flattenOptions:B.d,getLabeledValue:B.e,filterOptions:B.b,isValueDisabled:B.g,findValueOption:B.c,warningProps:Z,fillOptionsWithMissingValue:B.a}),ae=function(v){Object(me.a)(He,v);var le=Object(Me.a)(He);function He(){var je;return Object(ie.a)(this,He),je=le.apply(this,arguments),je.selectRef=xe.createRef(),je.focus=function(){je.selectRef.current.focus()},je.blur=function(){je.selectRef.current.blur()},je}return Object(Ae.a)(He,[{key:"render",value:function(){return xe.createElement(be,Object.assign({ref:this.selectRef},this.props))}}]),He}(xe.Component);ae.Option=de,ae.OptGroup=ce;var Te=ae,P=Ge.c=Te},M8RZ:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return V});var ie=p("fWQN"),Ae=p("mtLc"),me=p("yKVA"),Me=p("879j"),xe=p("q1tI"),Ce=p.n(xe),Y=p("i8i4"),I=p.n(Y),V=function(J){Object(me.a)(F,J);var j=Object(Me.a)(F);function F(se){var X;Object(ie.a)(this,F),X=j.call(this,se);var D=window.document;return X.node=D.createElement("div"),D.body.appendChild(X.node),X}return Object(Ae.a)(F,[{key:"render",value:function(){var X=this.props.children;return Object(Y.createPortal)(X,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),F}(Ce.a.Component)},NvD2:function(at,Ge,p){"use strict";p.d(Ge,"a",function(){return Ce});var ie=p("Kwbf");function Ae(Y,I){var V=new Set;return Y.forEach(function(J){I.has(J)||V.add(J)}),V}function me(Y){var I=Y||{},V=I.disabled,J=I.disableCheckbox,j=I.checkable;return!!(V||J)||j===!1}function Me(Y,I,V,J){for(var j=new Set(Y),F=new Set,se=0;se<=V;se+=1){var X=I.get(se)||new Set;X.forEach(function(te){var _=te.key,de=te.node,_e=te.children,ce=_e===void 0?[]:_e;j.has(_)&&!J(de)&&ce.filter(function(M){return!J(M.node)}).forEach(function(M){j.add(M.key)})})}for(var D=new Set,$=V;$>=0;$-=1){var L=I.get($)||new Set;L.forEach(function(te){var _=te.parent,de=te.node;if(J(de)||!te.parent||D.has(te.parent.key))return;if(J(te.parent.node)){D.add(_.key);return}var _e=!0,ce=!1;(_.children||[]).filter(function(M){return!J(M.node)}).forEach(function(M){var g=M.key,ee=j.has(g);_e&&!ee&&(_e=!1),!ce&&(ee||F.has(g))&&(ce=!0)}),_e&&j.add(_.key),ce&&F.add(_.key),D.add(_.key)})}return{checkedKeys:Array.from(j),halfCheckedKeys:Array.from(Ae(F,j))}}function xe(Y,I,V,J,j){for(var F=new Set(Y),se=new Set(I),X=0;X<=J;X+=1){var D=V.get(X)||new Set;D.forEach(function(_){var de=_.key,_e=_.node,ce=_.children,M=ce===void 0?[]:ce;!F.has(de)&&!se.has(de)&&!j(_e)&&M.filter(function(g){return!j(g.node)}).forEach(function(g){F.delete(g.key)})})}se=new Set;for(var $=new Set,L=J;L>=0;L-=1){var te=V.get(L)||new Set;te.forEach(function(_){var de=_.parent,_e=_.node;if(j(_e)||!_.parent||$.has(_.parent.key))return;if(j(_.parent.node)){$.add(de.key);return}var ce=!0,M=!1;(de.children||[]).filter(function(g){return!j(g.node)}).forEach(function(g){var ee=g.key,S=F.has(ee);ce&&!S&&(ce=!1),!M&&(S||se.has(ee))&&(M=!0)}),ce||F.delete(de.key),M&&se.add(de.key),$.add(de.key)})}return{checkedKeys:Array.from(F),halfCheckedKeys:Array.from(Ae(se,F))}}function Ce(Y,I,V,J){var j=[],F;J?F=J:F=me;var se=new Set(Y.filter(function(L){var te=!!V[L];return te||j.push(L),te})),X=new Map,D=0;Object.keys(V).forEach(function(L){var te=V[L],_=te.level,de=X.get(_);de||(de=new Set,X.set(_,de)),de.add(te),D=Math.max(D,_)}),Object(ie.a)(!j.length,"Tree missing follow keys: ".concat(j.slice(0,100).map(function(L){return"'".concat(L,"'")}).join(", ")));var $;return I===!0?$=Me(se,X,D,F):$=xe(se,I.halfCheckedKeys,X,D,F),$}},O2Wb:function(at,Ge,p){at.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(at,Ge,p){"use strict";var ie=p("U8pU"),Ae=p("VTBJ"),me=p("Ff2n"),Me=p("q1tI"),xe=p("uciX"),Ce=p("7ixt"),Y=function(se){var X=se.overlay,D=se.prefixCls,$=se.id,L=se.overlayInnerStyle;return Me.createElement("div",{className:"".concat(D,"-inner"),id:$,role:"tooltip",style:L},typeof X=="function"?X():X)},I=Y,V=function(se,X){var D=se.overlayClassName,$=se.trigger,L=$===void 0?["hover"]:$,te=se.mouseEnterDelay,_=te===void 0?0:te,de=se.mouseLeaveDelay,_e=de===void 0?.1:de,ce=se.overlayStyle,M=se.prefixCls,g=M===void 0?"rc-tooltip":M,ee=se.children,S=se.onVisibleChange,B=se.afterVisibleChange,x=se.transitionName,b=se.animation,z=se.placement,A=z===void 0?"right":z,k=se.align,Z=k===void 0?{}:k,be=se.destroyTooltipOnHide,ae=be===void 0?!1:be,Te=se.defaultVisible,P=se.getTooltipContainer,v=se.overlayInnerStyle,le=Object(me.a)(se,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),He=Object(Me.useRef)(null);Object(Me.useImperativeHandle)(X,function(){return He.current});var je=Object(Ae.a)({},le);"visible"in se&&(je.popupVisible=se.visible);var Je=function(){var ue=se.arrowContent,T=ue===void 0?null:ue,E=se.overlay,he=se.id;return[Me.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},T),Me.createElement(I,{key:"content",prefixCls:g,id:he,overlay:E,overlayInnerStyle:v})]},we=!1,Ee=!1;if(typeof ae=="boolean")we=ae;else if(ae&&Object(ie.a)(ae)==="object"){var G=ae.keepParent;we=G===!0,Ee=G===!1}return Me.createElement(xe.a,Object.assign({popupClassName:D,prefixCls:g,popup:Je,action:L,builtinPlacements:Ce.a,popupPlacement:A,ref:He,popupAlign:Z,getPopupContainer:P,onPopupVisibleChange:S,afterPopupVisibleChange:B,popupTransitionName:x,popupAnimation:b,defaultPopupVisible:Te,destroyPopupOnHide:we,autoDestroy:Ee,mouseLeaveDelay:_e,popupStyle:ce,mouseEnterDelay:_},je),ee)},J=Object(Me.forwardRef)(V),j=Ge.a=J},OZM5:function(at,Ge,p){"use strict";p.d(Ge,"b",function(){return J}),p.d(Ge,"a",function(){return j}),p.d(Ge,"k",function(){return F}),p.d(Ge,"h",function(){return se}),p.d(Ge,"i",function(){return X}),p.d(Ge,"g",function(){return D}),p.d(Ge,"c",function(){return $}),p.d(Ge,"d",function(){return L}),p.d(Ge,"j",function(){return de}),p.d(Ge,"e",function(){return _e}),p.d(Ge,"f",function(){return ce});var ie=p("KQm4"),Ae=p("U8pU"),me=p("Ff2n"),Me=p("q1tI"),xe=p.n(Me),Ce=p("Kwbf"),Y=p("WaYH"),I=.25,V=2;function J(M,g){var ee=M.slice(),S=ee.indexOf(g);return S>=0&&ee.splice(S,1),ee}function j(M,g){var ee=M.slice();return ee.indexOf(g)===-1&&ee.push(g),ee}function F(M){return M.split("-")}function se(M,g){return"".concat(M,"-").concat(g)}function X(M){return M&&M.type&&M.type.isTreeNode}function D(M,g){var ee=[M],S=g[M];function B(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(b){var z=b.key,A=b.children;ee.push(z),B(A)})}return B(S.children),ee}function $(M,g){var ee=M.clientY,S=g.selectHandle.getBoundingClientRect(),B=S.top,x=S.bottom,b=S.height,z=Math.max(b*I,V);return ee<=B+z?-1:ee>=x-z?1:0}function L(M,g){if(!M)return;var ee=g.multiple;return ee?M.slice():M.length?[M[0]]:M}var te=function(g){return g};function _(M,g){if(!M)return[];var ee=g||{},S=ee.processProps,B=S===void 0?te:S,x=Array.isArray(M)?M:[M];return x.map(function(b){var z=b.children,A=Object(me.a)(b,["children"]),k=_(z,g);return xe.a.createElement(Y.a,Object.assign({},B(A)),k)})}function de(M){if(!M)return null;var g;if(Array.isArray(M))g={checkedKeys:M,halfCheckedKeys:void 0};else if(Object(Ae.a)(M)==="object")g={checkedKeys:M.checked||void 0,halfCheckedKeys:M.halfChecked||void 0};else return Object(Ce.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function _e(M,g){var ee=new Set;function S(B){if(ee.has(B))return;var x=g[B];if(!x)return;ee.add(B);var b=x.parent,z=x.node;if(z.disabled)return;b&&S(b.key)}return(M||[]).forEach(function(B){S(B)}),Object(ie.a)(ee)}function ce(M){var g={};return Object.keys(M).forEach(function(ee){(ee.startsWith("data-")||ee.startsWith("aria-"))&&(g[ee]=M[ee])}),g}},Ot1p:function(at,Ge,p){"use strict";var ie=p("2qtc"),Ae=p("kLXV"),me=p("rAM+"),Me=p("miYZ"),xe=p("tsqr"),Ce=p("9og8"),Y=p("tJVT"),I=p("jrin"),V=p("WmNS"),J=p.n(V),j=p("q1tI"),F=p.n(j),se=p("VrN/"),X=p.n(se),D=p("bdgK"),$=p("p77/"),L=p("Bd2K"),te=p("ELLl"),_=p("19Vz"),de=p("lZu9"),_e=p("+NIl"),ce=p("kSUc"),M=p("9Bee"),g=function(ne){var pe=ne.value,nt=pe===void 0?"":pe,Ke=ne.className,Se=ne.showTextOnly,gt=ne.showLines,jt=ne.style,ot=jt===void 0?{}:jt,Xt=Object(j.useMemo)(function(){return""},[nt]);return F.a.createElement(F.a.Fragment,null,F.a.createElement("div",{dangerouslySetInnerHTML:{__html:Xt}}))},ee=p("0Owb"),S=p("dejd"),B=p("C+DQ"),x=p("1vsH"),b=p("m3rI"),z=[{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 A(ne){var pe=ne.onActionCallback,nt=ne.title,Ke=ne.icon,Se=ne.actionName,gt=ne.className,jt=gt===void 0?"":gt,ot=ne.children;function Xt(){pe(Se)}return F.a.createElement("a",{title:nt,className:jt,onClick:Xt},F.a.createElement("i",{className:"md-iconfont ".concat(Ke)}),ot)}var k=function(ne){var pe=ne.watch,nt=ne.showNullButton,Ke=ne.onActionCallback,Se=ne.fullScreen,gt=ne.insertTemp,jt=ne.hidetoolBar,ot=ne.uuid,Xt=ne.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.E)("_educoder_session"),"&key=").concat(ot,"&api=").concat(encodeURIComponent(b.a.PROXY_SERVER)));var tt=[].concat(z,[{title:"".concat(pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(pe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return F.a.createElement("ul",{className:"markdown-toolbar-container"},!jt&&tt.map(function(Ht,It){return F.a.createElement("li",{key:It},Ht.actionName?F.a.createElement(A,Object(ee.a)({},Ht,{onActionCallback:Ke})):F.a.createElement("span",{className:"v-line"}))}),nt?F.a.createElement("li",null,F.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ke},F.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,gt&&F.a.createElement("li",null,F.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(gt),onActionCallback:Ke},F.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),F.a.createElement("li",{className:"btn-full-screen"},F.a.createElement(A,{icon:"".concat(Se?"icon-shrink":"icon-enlarge"),title:Se?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ke})))},Z=p("M8RZ"),be=p("+L6B"),ae=p("2/Rp"),Te=p("y8nQ"),P=p("Vl3Y"),v=p("5NDa"),le=p("5rEg"),He={labelCol:{span:4},wrapperCol:{span:20}},je=function(ne){var pe=ne.callback,nt=ne.onCancel;function Ke(Se){pe(Se)}return F.a.createElement(P.a,Object(ee.a)({},He,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ke}),F.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},F.a.createElement(le.a,null)),F.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},F.a.createElement(le.a,null)),F.a.createElement("div",{className:"flex-container flex-end"},F.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(ae.a,{type:"ghost",onClick:nt},"\u53D6\u6D88")))},Je=p("7ahc"),we=p("k1fw"),Ee=p("HmJG"),G=p("BjJ7"),U=P.a.useForm,ue={width:280,marginRight:10},T={labelCol:{span:5},wrapperCol:{span:19}},E=function(ne){var pe=ne.callback,nt=ne.onCancel,Ke=U(),Se=Object(Y.a)(Ke,1),gt=Se[0],jt=Object(j.useRef)();function ot(Ht){pe(Object(we.a)(Object(we.a)({},Ht),{},{name:jt.current}))}function Xt(Ht,It){gt.setFieldsValue({src:"/api/attachments/".concat(Ht.id,"?type=").concat(Ht.content_type),type:It.type})}function tt(Ht){var It=Ht.target.files[0];jt.current=It.name,Le(It,Xt)}return F.a.createElement(P.a,Object(ee.a)({form:gt},T,{className:"upload-image-panel",onFinish:ot}),F.a.createElement(P.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},F.a.createElement("div",{className:"flex-container"},F.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},F.a.createElement(le.a,{style:ue})),F.a.createElement(he,{onFileChange:tt}))),F.a.createElement(P.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},F.a.createElement(le.a,{style:{width:264}})),F.a.createElement(P.a.Item,{style:{textAlign:"right"}},F.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(ae.a,{type:"ghost",onClick:nt},"\u53D6\u6D88")))};function he(ne){var pe=ne.onFileChange;return F.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",F.a.createElement("input",{type:"file",onChange:pe}))}function Le(ne,pe){if(!ne)throw new String("\u6CA1\u6709\u6587\u4EF6");var nt=new FormData;nt.append("editormd-image-file",ne),nt.append("file_param_name","editormd-image-file"),nt.append("byxhr","true");var Ke=new window.XMLHttpRequest;Ke.withCredentials=!0,Ke.addEventListener("load",function(Se){pe(JSON.parse(Se.target.responseText),ne)},!1),Ke.addEventListener("error",function(Se){console.error(Se)},!1),Ke.open("POST","".concat(G.a,"/api/attachments.json")),Ke.send(nt)}var Ze=p("giR+"),ke=p("fyUT"),Ue=p("7Kak"),ge=p("9yH6"),Re=ge.a.Group,Be={margin:"0 8px"},Qe=function(ne){var pe=ne.callback,nt=ne.onCancel;function Ke(Se){pe(Se)}return F.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ke},F.a.createElement("div",{className:"flex-container"},F.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),F.a.createElement("span",{style:Be},"\u884C\u6570"),F.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},F.a.createElement(ke.a,null)),F.a.createElement("span",{style:Be},"\u5217\u6570"),F.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},F.a.createElement(ke.a,null))),F.a.createElement("div",{className:"flex-container",style:{marginTop:12}},F.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),F.a.createElement(P.a.Item,{name:"align"},F.a.createElement(Re,null,F.a.createElement(ge.a,{value:"default"},F.a.createElement("i",{className:"fa fa-align-justify"})),F.a.createElement(ge.a,{value:"left"},F.a.createElement("i",{className:"fa fa-align-left"})),F.a.createElement(ge.a,{value:"center"},F.a.createElement("i",{className:"fa fa-align-center"})),F.a.createElement(ge.a,{value:"right"},F.a.createElement("i",{className:"fa fa-align-right"}))))),F.a.createElement("div",{className:"flex-container flex-end"},F.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),F.a.createElement(ae.a,{type:"ghost",onClick:nt},"\u53D6\u6D88")))},it=p("ErOA"),Xe=p("7Cbv"),De="link",Et="upload-image",pt="code-block",bt="add-table",ct="------------",Mt={default:ct,left:":".concat(ct),center:":".concat(ct,":"),right:"".concat(ct,":")},Ot=p("9VGf"),Ct,Pe;function Ut(){}var kt=0,Ne=1e4,Fe="\u2581",N=`
**\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 H(ne){return/^\d+$/.test(ne)?"".concat(ne,"px"):ne}var K=navigator.platform.toUpperCase().indexOf("MAC")>=0,C=K?"Cmd":"Ctrl",w=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],O=(Ct={},Object(I.a)(Ct,C+"-B","bold"),Object(I.a)(Ct,C+"-I","italic"),Ct),R=(Pe={},Object(I.a)(Pe,De,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(Pe,pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(Pe,Et,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(Pe,bt,"\u6DFB\u52A0\u8868\u683C"),Pe),re=Ge.a=function(ne){var pe=ne.defaultValue,nt=pe===void 0?"":pe,Ke=ne.onChange,Se=ne.width,gt=Se===void 0?"100%":Se,jt=ne.height,ot=jt===void 0?400:jt,Xt=ne.miniToolbar,tt=Xt===void 0?!1:Xt,Ht=ne.isFocus,It=Ht===void 0?!1:Ht,Rt=ne.watch,Jt=ne.insertTemp,Ft=ne.mode,We=Ft===void 0?"markdown":Ft,lt=ne.id,qe=lt===void 0?"markdown-editor-id":lt,dt=ne.showResizeBar,Gt=dt===void 0?!1:dt,Kt=ne.noStorage,on=Kt===void 0?!1:Kt,Vt=ne.showNullButton,_t=Vt===void 0?!1:Vt,tn=ne.hidetoolBar,Lt=tn===void 0?!1:tn,un=ne.fullScreen,zt=un===void 0?!1:un,dn=ne.onBlur,In=ne.onCMBeforeChange,nn=ne.onFullScreen,$e=ne.className,ut=$e===void 0?"":$e,mn=ne.disablePaste,En=mn===void 0?!1:mn,On=ne.placeholder,Bn=On===void 0?"":On,c=ne.values,o=c===void 0?"":c,r=Object(j.useState)(null),u=Object(Y.a)(r,2),h=u[0],d=u[1],q=Object(j.useState)(nt),Ye=Object(Y.a)(q,2),st=Ye[0],Nt=Ye[1],ve=Object(j.useState)(Rt),oe=Object(Y.a)(ve,2),Ve=oe[0],Pt=oe[1],Tt=Object(j.useState)(zt),St=Object(Y.a)(Tt,2),At=St[0],cn=St[1],Nn=Object(j.useState)(""),wn=Object(Y.a)(Nn,2),yn=wn[0],An=wn[1],Dn=Object(j.useState)(0),ti=Object(Y.a)(Dn,2),wi=ti[0],Xn=ti[1],$n=Object(j.useState)(ot),$i=Object(Y.a)($n,2),Ei=$i[0],Tn=$i[1],Fi=Object(j.useState)(!1),ra=Object(Y.a)(Fi,2),pa=ra[0],zn=ra[1],gn=Object(j.useRef)(Object(Xe.a)()),li=Object(j.useRef)(!1),pn=Object(j.useRef)(),Hn=Object(j.useRef)(),Cn=Object(j.useRef)(),di=Object(j.useRef)(),Yn=Object(j.useRef)(),Ci=function(){var Wt=Object(Ce.a)(J.a.mark(function qt(){var $t,rn;return J.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(it.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:gn.current}});case 2:rn=Sn.sent,rn!=null&&($t=rn.attachments)!==null&&$t!==void 0&&$t.length&&(console.log("cm:",h,Hn),rn.attachments.map(function(fn){fn.content_type.indexOf("image")>-1?h.replaceSelection(".concat(fn.content_type,")")):fn.content_type.indexOf("video")>-1?h.replaceSelection('')):fn.content_type.indexOf("pdf")>-1?h.replaceSelection('').concat(fn.name,"")):h.replaceSelection("[".concat(fn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(fn.id,"?type=").concat(fn.content_type,")"))}));case 4:case"end":return Sn.stop()}},qt)}));return function(){return Wt.apply(this,arguments)}}();Object(j.useEffect)(function(){Nt(o),h==null||h.setValue(o)},[o]),Object(j.useEffect)(function(){nn==null||nn(At)},[At]),Object(j.useEffect)(function(){if(Hn.current){var Wt=X.a.fromTextArea(Hn.current,{mode:We,lineNumbers:!tt,lineWrapping:!0,value:nt,autoCloseTags:!0,autoCloseBrackets:!0});It&&Wt.focus();function qt($t,rn){if(En){rn.preventDefault();return}var vn=rn.clipboardData;if(vn){var Sn=vn.types.toString(),fn=vn.items;if(Sn==="Files"||vn.types.indexOf("Files")>-1){if(rn.preventDefault(),We=="stex")return;try{var Kn,Si=fn[1];((Kn=fn[0])===null||Kn===void 0?void 0:Kn.kind)==="file"&&(Si=fn[0]);var sn=Si.getAsFile(),aa=sn.name.split(".").pop();Le(sn,function(hn){if(hn.id){var Jn,Wi,zi;(sn==null||((Jn=sn.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?Wt.replaceSelection(".concat(hn.content_type,")")):(sn==null||((Wi=sn.type)===null||Wi===void 0)?void 0:Wi.indexOf("video"))>-1?Wt.replaceSelection('')):(sn==null||((zi=sn.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Wt.replaceSelection('').concat(sn.name,"")):w.includes(aa)?Wt.replaceSelection('').concat(sn.name,"")):Wt.replaceSelection("[".concat(sn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,")"))}else(hn==null?void 0:hn.status)===401&&(document.location.href="/user/login")})}catch(hn){xe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Wt.on("paste",qt),Wt.on("dragleave",function($t,rn){Cn.current.classList.remove("mouse-hover-md")}),Wt.on("dragover",function($t,rn){Cn.current.classList.add("mouse-hover-md")}),Wt.on("drop",function($t,rn){Cn.current.classList.add("mouse-hover-md");var vn;if(vn=rn.dataTransfer.files,vn.length>0){rn.preventDefault(),rn.stopPropagation();for(var Sn=function(Si){var sn=vn[Si],aa=sn.name.split(".").pop();Le(sn,function(hn){if(hn.id){var Jn,Wi,zi;(sn==null||((Jn=sn.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?Wt.replaceSelection(".concat(hn.content_type,")")):(sn==null||((Wi=sn.type)===null||Wi===void 0)?void 0:Wi.indexOf("video"))>-1?Wt.replaceSelection('')):(sn==null||((zi=sn.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Wt.replaceSelection('').concat(sn.name,"")):w.includes(aa)?Wt.replaceSelection('').concat(sn.name,"")):Wt.replaceSelection("[".concat(sn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,")"))}else(hn==null?void 0:hn.status)===401&&(document.location.href="/user/login")})},fn=0;fn0||fn.target.offsetWidth>0)&&(fa(),h.setSize("100%","100%"),h.refresh())}}catch(Kn){vn.e(Kn)}finally{vn.f()}});return $t.observe(Hn.current.parentElement),$t}if(h){var qt=Wt();return function(){qt.unobserve(Hn.current.parentElement)}}},[h,fa]),Object(j.useEffect)(function(){if(h){for(var Wt=[],qt=function(){var fn=rn[$t];vn=Object(Y.a)(fn,2);var Kn=vn[0],Si=vn[1],sn=Object(I.a)({},Kn,function(){na(Si)});Wt.push(sn),h.addKeyMap(sn)},$t=0,rn=Object.entries(O);$t0){var Wt=new Date().getTime(),qt=window.sessionStorage.getItem(qe);Wt>=wi+Ne&&(!qt||qt!==st)&&(window.sessionStorage.setItem(qe,st),zn(!0))}},Ne),Object(j.useEffect)(function(){Pt(Rt)},[h,Rt]),Object(j.useEffect)(function(){h&&(It&&h.focus())},[h,It]),Object(j.useEffect)(function(){if(Ve&&h){var Wt=h.getScrollerElement();function qt($t){var rn=$t.target;if(Yn.current){var vn=rn.scrollTop/rn.scrollHeight;Yn.current.scrollTop=Yn.current.scrollHeight*vn}}return Wt.addEventListener("scroll",qt),function(){Wt.removeEventListener("scroll",qt)}}},[h,Ve]),Object(j.useEffect)(function(){if(h&&In){function Wt(qt,$t){In(qt,$t)}return h.on("beforeChange",Wt),function(){h.off("beforeChange",Wt)}}},[h,In]),Object(j.useEffect)(function(){if(h&&dn){function Wt(){dn(h.getValue())}return h.on("blur",Wt),function(){h.off("blur",Wt)}}},[h,dn]),Object(j.useEffect)(function(){if(h){function Wt(qt){var $t=qt.getValue();Nt($t),Xn(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ke&&Ke($t)}return h.on("change",Wt),function(){h.off("change",Wt)}}},[h,Ke]),Object(j.useEffect)(function(){h&&(nt==null?(h.setValue(""),Nt("")):nt!==h.getValue()&&(h.setValue(nt),Nt(nt),h.setCursor(h.lineCount(),0)))},[h,nt]);var na=Object(j.useCallback)(function(Wt){var qt=h.getCursor(),$t=h.getSelection(),rn=$t.split(`
`);switch(Wt){case"bold":return h.replaceSelection("**"+$t+"**"),$t===""&&h.setCursor(qt.line,qt.ch+2),h.focus();case"italic":return h.replaceSelection("*"+$t+"*"),$t===""&&h.setCursor(qt.line,qt.ch+1),h.focus();case"code":return h.replaceSelection("`"+$t+"`"),$t===""&&h.setCursor(qt.line,qt.ch+1),h.focus();case"inline-latex":return h.replaceSelection("`$$"+$t+"$$`"),$t===""&&h.setCursor(qt.line,qt.ch+3),h.focus();case"latex":return h.replaceSelection("```latex\n"+$t+"\n```"),h.setCursor(qt.line+1,$t.length+1),h.focus();case"line-break":return h.replaceSelection(`
`),h.focus();case"list-ul":return $t===""?h.replaceSelection("- "+$t):h.replaceSelection(rn.map(function(vn){return vn===""?"":"- ".concat(vn)}).join(`
`)),h.focus();case"list-ol":return $t===""?h.replaceSelection("1. "+$t):h.replaceSelection(rn.map(function(vn,Sn){return vn===""?"":"".concat(Sn+1,". ").concat(vn)}).join(`
`)),h.focus();case"add-null-ch":return $t===""&&h.setCursor(qt.line,qt.ch+1),h.replaceSelection(Fe),h.focus();case"inster-template-1":return $t===""&&h.setCursor(qt.line,qt.ch),h.replaceSelection(N),h.focus();case"eraser":return h.setValue(""),h.focus();case"trigger-watch":return Pt(!Ve),h.focus();case"trigger-full-screen":return cn(!At),h.focus();case De:An(De);return;case pt:An(pt);return;case Et:An(Et);return;case bt:An(bt);return;default:throw new Error}},[h,Ve,At]),ia=Object(j.useCallback)(function(Wt){An("");switch(yn){case De:var qt=Wt.title,$t=Wt.link;return h.replaceSelection("[".concat(qt,"](").concat($t,")")),h.focus();case pt:var rn=Wt.language,vn=Wt.content;return h.replaceSelection(["```"+rn,vn,"```"].join(`
`)),h.focus();case Et:var Sn=Wt.src,fn=Wt.alt,Kn=Wt.name;return Sn.indexOf("type=image")>-1?h.replaceSelection(".concat(Sn,' "').concat(fn||"",'" )')):Sn.indexOf("type=application/pdf")>-1?h.replaceSelection('').concat(Kn,"")):h.replaceSelection('').concat(Kn,"")),h.focus();case bt:for(var Si=Wt.row,sn=Wt.col,aa=Wt.align,hn=`
`,Jn=0;Jn300&&(Kn=300);var Si=ot+Kn+"px";Tn(Si)}}return Wt.addEventListener("mousedown",rn),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",vn),function(){Wt.removeEventListener("mousedown",rn),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",vn)}}},[h,di]),Object(j.useEffect)(function(){Tn(ot)},[ot]);var Ji=H(gt),Vi=H(Ei),sa={width:Ji,height:Vi},Zi=Object(j.useMemo)(function(){if(wi){var Wt=new Date(wi),qt=Wt.getHours(),$t=Wt.getMinutes(),rn=Wt.getSeconds();return qt=qt<10?"0"+qt:qt,$t=$t<10?"0"+$t:$t,rn=rn<10?"0"+rn:rn,"".concat(qt,":").concat($t,":").concat(rn)}return 0},[wi]);function la(){window.sessionStorage.removeItem(qe),zn(!1),Xn(0)}function ua(){zn(!1),Xn(0),h.setValue(window.sessionStorage.getItem(qe))}function no(Wt,qt){var $t=h.getValue();$t=$t.replace(Wt,qt),Nt($t),h==null||h.setValue($t)}return F.a.createElement(j.Fragment,null,F.a.createElement("div",{className:"markdown-editor-wrapper",ref:Cn},F.a.createElement("div",{className:"markdown-editor-container ".concat(ut," ").concat(Ve?"on-preview":""," ").concat(tt?"mini":""," ").concat(At?"full-screen":""),style:sa},F.a.createElement(k,{insertTemp:Jt,watch:Ve,fullScreen:At,showNullButton:_t,onActionCallback:na,hidetoolBar:Lt,uuid:gn.current,setOpenPhones:function(){li.current=!0}}),F.a.createElement("div",{className:"markdown-editor-body"},F.a.createElement("div",{className:"codemirror-container"},F.a.createElement("textarea",{ref:Hn,placeholder:Bn})),Ve?F.a.createElement("div",{ref:Yn,className:"preview-container"},We==="stex"&&F.a.createElement(g,{value:st}),We!=="stex"&&F.a.createElement(M.a,{edit:!0,value:st,replaces:no})):null))),Gt?F.a.createElement("a",{ref:di,className:"editor-resize"}):null,F.a.createElement(Z.a,null,R[yn]?F.a.createElement(Ae.a,{centered:!0,title:R[yn],visible:!0,onCancel:bn,footer:null},Sa):null))}},PGNT:function(at,Ge,p){at.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE:function(at,Ge,p){at.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},QSKd:function(at,Ge,p){at.exports=p.p+"static/wenhao.50b63ac4.svg"},"RZ/O":function(at,Ge,p){at.exports=p.p+"static/bi.9c9b0364.svg"},SJMd:function(at,Ge){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var p,ie,Ae,me=!1,Me,xe;window.PR_SHOULD_USE_CONTINUATION=!0;var Ce,Y;(function(){var I=window,V=["break,continue,do,else,for,if,return,while"],J=[V,"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"],j=[J,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[j,"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"],se=[j,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],X=[j,"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"],D="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",$=[j,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],L="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",te=[V,"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"],_=[V,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],de=[V,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],_e=[F,X,se,$,L,te,_,de],ce=/^(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",g="kwd",ee="com",S="typ",B="lit",x="pun",b="pln",z="tag",A="dec",k="src",Z="atn",be="atv",ae="nocode",Te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(ge){for(var Re=0,Be=!1,Qe=!1,it=0,Xe=ge.length;it122||(C<65||K>90||Ut.push([Math.max(65,K)|32,Math.min(C,90)|32]),C<97||K>122||Ut.push([Math.max(97,K)&~32,Math.min(C,122)&~32]))}}Ut.sort(function(re,ne){return re[0]-ne[0]||ne[1]-re[1]});for(var w=[],O=[],Fe=0;FeR[0]&&(R[1]+1>R[0]&&Ne.push("-"),Ne.push(bt(R[1])))}return Ne.push("]"),Ne.join("")}function Mt(Ct){for(var Pe=Ct.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ut=Pe.length,kt=[],Ne=0,Fe=0;Ne=2&&K==="["?Pe[Ne]=ct(N):K!=="\\"&&(Pe[Ne]=N.replace(/[a-zA-Z]/g,function(O){var R=O.charCodeAt(0);return"["+String.fromCharCode(R&~32,R|32)+"]"}))}return Pe.join("")}for(var Ot=[],it=0,Xe=ge.length;it=0;)Be[Ot.charAt(Ct)]=Mt;var Pe=Mt[1],Ut=""+Pe;pt.hasOwnProperty(Ut)||(Et.push(Pe),pt[Ut]=null)}Et.push(/[\0-\uffff]/),Qe=P(Et)})();var it=Re.length,Xe=function(De){for(var Et=De.sourceCode,pt=De.basePos,bt=De.sourceNode,ct=[pt,b],Mt=0,Ot=Et.match(Qe)||[],Ct={},Pe=0,Ut=Ot.length;Pe=5&&Ne.substring(0,5)==="lang-",N&&!(Fe&&typeof Fe[1]=="string")&&(N=!1,Ne=k),N||(Ct[kt]=Ne)}var C=Mt;if(Mt+=kt.length,!N)ct.push(pt+C,Ne);else{var w=Fe[1],O=kt.indexOf(w),R=O+w.length;Fe[2]&&(R=kt.length-Fe[2].length,O=R-w.length);var re=Ne.substring(5);le(bt,pt+C,kt.substring(0,O),Xe,ct),le(bt,pt+C+O,w,E(re,w),ct),le(bt,pt+C+R,kt.substring(R),Xe,ct)}}De.decorations=ct};return Xe}function we(ge){var Re=[],Be=[];ge.tripleQuotedStrings?Re.push([M,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ge.multiLineStrings?Re.push([M,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([M,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ge.verbatimStrings&&Be.push([M,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Qe=ge.hashComments;Qe&&(ge.cStyleComments?(Qe>1?Re.push([ee,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([ee,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([M,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([ee,/^#[^\r\n]*/,null,"#"])),ge.cStyleComments&&(Be.push([ee,/^\/\/[^\r\n]*/,null]),Be.push([ee,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var it=ge.regexLiterals;if(it){var Xe=it>1?"":`
\r`,De=Xe?".":"[\\S\\s]",Et="/(?=[^/*"+Xe+"])(?:[^/\\x5B\\x5C"+Xe+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+Xe+"]|\\x5C"+De+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+Te+"("+Et+")")])}var pt=ge.types;pt&&Be.push([S,pt]);var bt=(""+ge.keywords).replace(/^ | $/g,"");bt.length&&Be.push([g,new RegExp("^(?:"+bt.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([b,/^\s+/,null,` \r
\xA0`]);var ct="^.[^\\s\\w.$@'\"`/\\\\]*";return ge.regexLiterals&&(ct+="(?!s*/)"),Be.push([B,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[b,/^[a-z_$][a-z_$@0-9]*/i,null],[B,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[b,/^\\[\s\S]?/,null],[x,new RegExp(ct),null]),Je(Re,Be)}var Ee=we({keywords:_e,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function G(ge,Re,Be){for(var Qe=/(?:^|\s)nocode(?:\s|$)/,it=/\r\n?|\n/,Xe=ge.ownerDocument,De=Xe.createElement("li");ge.firstChild;)De.appendChild(ge.firstChild);var Et=[De];function pt(Pe){var Ut=Pe.nodeType;if(Ut==1&&!Qe.test(Pe.className))if(Pe.nodeName==="br")bt(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var kt=Pe.firstChild;kt;kt=kt.nextSibling)pt(kt);else if((Ut==3||Ut==4)&&Be){var Ne=Pe.nodeValue,Fe=Ne.match(it);if(Fe){var N=Ne.substring(0,Fe.index);Pe.nodeValue=N;var H=Ne.substring(Fe.index+Fe[0].length);if(H){var K=Pe.parentNode;K.insertBefore(Xe.createTextNode(H),Pe.nextSibling)}bt(Pe),N||Pe.parentNode.removeChild(Pe)}}}function bt(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function Ut(Fe,N){var H=N?Fe.cloneNode(!1):Fe,K=Fe.parentNode;if(K){var C=Ut(K,1),w=Fe.nextSibling;C.appendChild(H);for(var O=w;O;O=w)w=O.nextSibling,C.appendChild(O)}return H}for(var kt=Ut(Pe.nextSibling,0),Ne;(Ne=kt.parentNode)&&Ne.nodeType===1;)kt=Ne;Et.push(kt)}for(var ct=0;ct=K&&(pt+=2),Xe>=C&&(Mt+=2)}}finally{Ne&&(Ne.style.display=Fe)}}var ue={};function T(ge,Re){for(var Be=Re.length;--Be>=0;){var Qe=Re[Be];ue.hasOwnProperty(Qe)?I.console&&console.warn("cannot override language handler %s",Qe):ue[Qe]=ge}}function E(ge,Re){return ge&&ue.hasOwnProperty(ge)||(ge=/^\s*]*(?:>|$)/],[ee,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^