(window.webpackJsonp=window.webpackJsonp||[]).push([[185,6,7,16],{"+NIl":function(yt,qe,b){(function(Z){Z(b("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(Pe,Le){"use strict";function He(de,B){de.cmdState.push(B)}function _e(de){return de.cmdState.length>0?de.cmdState[de.cmdState.length-1]:null}function ye(de){var B=de.cmdState.pop();B&&B.closeBracket()}function F(de){for(var B=de.cmdState,X=B.length-1;X>=0;X--){var z=B[X];if(z.name=="DEFAULT")continue;return z}return{styleIdentifier:function(){return null}}}function q(de,B,X){return function(){this.name=de,this.bracketNo=0,this.style=B,this.styles=X,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var V={};V.importmodule=q("importmodule","tag",["string","builtin"]),V.documentclass=q("documentclass","tag",["","atom"]),V.usepackage=q("usepackage","tag",["atom"]),V.begin=q("begin","tag",["atom"]),V.end=q("end","tag",["atom"]),V.label=q("label","tag",["atom"]),V.ref=q("ref","tag",["atom"]),V.eqref=q("eqref","tag",["atom"]),V.cite=q("cite","tag",["atom"]),V.bibitem=q("bibitem","tag",["atom"]),V.Bibitem=q("Bibitem","tag",["atom"]),V.RBibitem=q("RBibitem","tag",["atom"]),V.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function se(de,B){de.f=B}function j(de,B){var X;if(de.match(/^\\[a-zA-Z@]+/)){var z=de.current().slice(1);return X=V.hasOwnProperty(z)?V[z]:V.DEFAULT,X=new X,He(B,X),se(B,ke),X.style}if(de.match(/^\\[$&%#{}_]/))return"tag";if(de.match(/^\\[,;!\/\\]/))return"tag";if(de.match("\\["))return se(B,function(he,Ne){return Y(he,Ne,"\\]")}),"keyword";if(de.match("\\("))return se(B,function(he,Ne){return Y(he,Ne,"\\)")}),"keyword";if(de.match("$$"))return se(B,function(he,Ne){return Y(he,Ne,"$$")}),"keyword";if(de.match("$"))return se(B,function(he,Ne){return Y(he,Ne,"$")}),"keyword";var fe=de.next();if(fe=="%")return de.skipToEnd(),"comment";if(fe=="}"||fe=="]"){if(X=_e(B),X)X.closeBracket(fe),se(B,ke);else return"error";return"bracket"}else return fe=="{"||fe=="["?(X=V.DEFAULT,X=new X,He(B,X),"bracket"):/\d/.test(fe)?(de.eatWhile(/[\w.%]/),"atom"):(de.eatWhile(/[\w\-_]/),X=F(B),X.name=="begin"&&(X.argument=de.current()),X.styleIdentifier())}function Y(de,B,X){if(de.eatSpace())return null;if(X&&de.match(X))return se(B,j),"keyword";if(de.match(/^\\[a-zA-Z@]+/))return"tag";if(de.match(/^[a-zA-Z]+/))return"variable-2";if(de.match(/^\\[$&%#{}_]/))return"tag";if(de.match(/^\\[,;!\/]/))return"tag";if(de.match(/^[\^_&]/))return"tag";if(de.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(de.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var z=de.next();return z=="{"||z=="}"||z=="["||z=="]"||z=="("||z==")"?"bracket":z=="%"?(de.skipToEnd(),"comment"):"error"}function ke(de,B){var X=de.peek(),z;return X=="{"||X=="["?(z=_e(B),z.openBracket(X),de.eat(X),se(B,j),"bracket"):/[ \t\r]/.test(X)?(de.eat(X),null):(se(B,j),ye(B),j(de,B))}return{startState:function(){var de=Le.inMathMode?function(B,X){return Y(B,X)}:j;return{cmdState:[],f:de}},copyState:function(de){return{cmdState:de.cmdState.slice(),f:de.f}},token:function(de,B){return B.f(de,B)},blankLine:function(de){de.f=j,de.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"19Vz":function(yt,qe,b){(function(Z){Z(b("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(q,V,se){var j=se&&se!=Z.Init;if(V&&!j)q.on("blur",_e),q.on("change",ye),q.on("swapDoc",ye),Z.on(q.getInputField(),"compositionupdate",q.state.placeholderCompose=function(){He(q)}),ye(q);else if(!V&&j){q.off("blur",_e),q.off("change",ye),q.off("swapDoc",ye),Z.off(q.getInputField(),"compositionupdate",q.state.placeholderCompose),Pe(q);var Y=q.getWrapperElement();Y.className=Y.className.replace(" CodeMirror-empty","")}V&&!q.hasFocus()&&_e(q)});function Pe(q){q.state.placeholder&&(q.state.placeholder.parentNode.removeChild(q.state.placeholder),q.state.placeholder=null)}function Le(q){Pe(q);var V=q.state.placeholder=document.createElement("pre");V.style.cssText="height: 0; overflow: visible",V.style.direction=q.getOption("direction"),V.className="CodeMirror-placeholder CodeMirror-line-like";var se=q.getOption("placeholder");typeof se=="string"&&(se=document.createTextNode(se)),V.appendChild(se),q.display.lineSpace.insertBefore(V,q.display.lineSpace.firstChild)}function He(q){setTimeout(function(){var V=!1,se=q.getInputField();se.nodeName=="TEXTAREA"?V=!se.value:q.lineCount()==1&&(V=!/[^\u200b]/.test(se.querySelector(".CodeMirror-line").textContent)),V?Le(q):Pe(q)},20)}function _e(q){F(q)&&Le(q)}function ye(q){var V=q.getWrapperElement(),se=F(q);V.className=V.className.replace(" CodeMirror-empty","")+(se?" CodeMirror-empty":""),se?Le(q):Pe(q)}function F(q){return q.lineCount()===1&&q.getLine(0)===""}})},"1eCo":function(yt,qe,b){(function(Z){Z(b("VrN/"))})(function(Z){"use strict";var Pe={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},Le={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(He,_e){var ye=He.indentUnit,F={},q=_e.htmlMode?Pe:Le;for(var V in q)F[V]=q[V];for(var V in _e)F[V]=_e[V];var se,j;function Y(_,me){function ee(ae){return me.tokenize=ae,ae(_,me)}var L=_.next();if(L=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?ee(B("atom","]]>")):null:_.match("--")?ee(B("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),ee(X(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),me.tokenize=B("meta","?>"),"meta"):(se=_.eat("/")?"closeTag":"openTag",me.tokenize=ke,"tag bracket");if(L=="&"){var U;return _.eat("#")?_.eat("x")?U=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):U=_.eatWhile(/[\d]/)&&_.eat(";"):U=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),U?"atom":"error"}else return _.eatWhile(/[^&<]/),null}Y.isInText=!0;function ke(_,me){var ee=_.next();if(ee==">"||ee=="/"&&_.eat(">"))return me.tokenize=Y,se=ee==">"?"endTag":"selfcloseTag","tag bracket";if(ee=="=")return se="equals",null;if(ee=="<"){me.tokenize=Y,me.state=Ne,me.tagName=me.tagStart=null;var L=me.tokenize(_,me);return L?L+" tag error":"tag error"}else return/[\'\"]/.test(ee)?(me.tokenize=de(ee),me.stringStartCol=_.column(),me.tokenize(_,me)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function de(_){var me=function(ee,L){for(;!ee.eol();)if(ee.next()==_){L.tokenize=ke;break}return"string"};return me.isInAttribute=!0,me}function B(_,me){return function(ee,L){for(;!ee.eol();){if(ee.match(me)){L.tokenize=Y;break}ee.next()}return _}}function X(_){return function(me,ee){for(var L;(L=me.next())!=null;){if(L=="<")return ee.tokenize=X(_+1),ee.tokenize(me,ee);if(L==">")if(_==1){ee.tokenize=Y;break}else return ee.tokenize=X(_-1),ee.tokenize(me,ee)}return"meta"}}function z(_,me,ee){this.prev=_.context,this.tagName=me,this.indent=_.indented,this.startOfLine=ee,(F.doNotIndent.hasOwnProperty(me)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function fe(_){_.context&&(_.context=_.context.prev)}function he(_,me){for(var ee;;){if(!_.context)return;if(ee=_.context.tagName,!F.contextGrabbers.hasOwnProperty(ee)||!F.contextGrabbers[ee].hasOwnProperty(me))return;fe(_)}}function Ne(_,me,ee){return _=="openTag"?(ee.tagStart=me.column(),Ue):_=="closeTag"?we:Ne}function Ue(_,me,ee){return _=="word"?(ee.tagName=me.current(),j="tag",ce):F.allowMissingTagName&&_=="endTag"?(j="tag bracket",ce(_,me,ee)):(j="error",Ue)}function we(_,me,ee){if(_=="word"){var L=me.current();return ee.context&&ee.context.tagName!=L&&F.implicitlyClosed.hasOwnProperty(ee.context.tagName)&&fe(ee),ee.context&&ee.context.tagName==L||F.matchClosing===!1?(j="tag",Q):(j="tag error",Ce)}else return F.allowMissingTagName&&_=="endTag"?(j="tag bracket",Q(_,me,ee)):(j="error",Ce)}function Q(_,me,ee){return _!="endTag"?(j="error",Q):(fe(ee),Ne)}function Ce(_,me,ee){return j="error",Q(_,me,ee)}function ce(_,me,ee){if(_=="word")return j="attribute",P;if(_=="endTag"||_=="selfcloseTag"){var L=ee.tagName,U=ee.tagStart;return ee.tagName=ee.tagStart=null,_=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(L)?he(ee,L):(he(ee,L),ee.context=new z(ee,L,U==ee.indented)),Ne}return j="error",ce}function P(_,me,ee){return _=="equals"?le:(F.allowMissing||(j="error"),ce(_,me,ee))}function le(_,me,ee){return _=="string"?$:_=="word"&&F.allowUnquoted?(j="string",ce):(j="error",ce(_,me,ee))}function $(_,me,ee){return _=="string"?$:ce(_,me,ee)}return{startState:function(_){var me={tokenize:Y,state:Ne,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(me.baseIndent=_),me},token:function(_,me){if(!me.tagName&&_.sol()&&(me.indented=_.indentation()),_.eatSpace())return null;se=null;var ee=me.tokenize(_,me);return(ee||se)&&ee!="comment"&&(j=null,me.state=me.state(se||ee,_,me),j&&(ee=j=="error"?ee+" error":j)),ee},indent:function(_,me,ee){var L=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+ye;if(L&&L.noIndent)return Z.Pass;if(_.tokenize!=ke&&_.tokenize!=Y)return ee?ee.match(/^(\s*)/)[0].length:0;if(_.tagName)return F.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+ye*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/$/,blockCommentStart:"",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(_){_.state==le&&(_.state=ce)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var me=[],ee=_.context;ee;ee=ee.prev)ee.tagName&&me.push(ee.tagName);return me.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(yt,qe,b){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Pe=new Uint8Array(16);function Le(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(Pe)}var He=/^(?:[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 _e(ke){return typeof ke=="string"&&He.test(ke)}for(var ye=_e,F=[],q=0;q<256;++q)F.push((q+256).toString(16).substr(1));function V(ke){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=(F[ke[de+0]]+F[ke[de+1]]+F[ke[de+2]]+F[ke[de+3]]+"-"+F[ke[de+4]]+F[ke[de+5]]+"-"+F[ke[de+6]]+F[ke[de+7]]+"-"+F[ke[de+8]]+F[ke[de+9]]+"-"+F[ke[de+10]]+F[ke[de+11]]+F[ke[de+12]]+F[ke[de+13]]+F[ke[de+14]]+F[ke[de+15]]).toLowerCase();if(!ye(B))throw TypeError("Stringified UUID is invalid");return B}var se=V;function j(ke,de,B){ke=ke||{};var X=ke.random||(ke.rng||Le)();if(X[6]=X[6]&15|64,X[8]=X[8]&63|128,de){B=B||0;for(var z=0;z<16;++z)de[B+z]=X[z];return de}return se(X)}var Y=qe.a=j},"7ahc":function(yt,qe,b){"use strict";b.d(qe,"a",function(){return Ue});var Z=b("k1fw"),Pe=b("0Owb"),Le=b("+L6B"),He=b("2/Rp"),_e=b("y8nQ"),ye=b("Vl3Y"),F=b("tJVT"),q=b("OaEy"),V=b("2fM7"),se=b("q1tI"),j=b.n(se),Y=b("VrN/"),ke=b.n(Y),de=b("p77/"),B=b.n(de),X=b("c5Ni"),z=b.n(X),fe=V.a.Option,he={labelCol:{span:4},wrapperCol:{span:20}},Ne={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"]};qe.b=function(we){var Q=we.callback,Ce=we.onCancel,ce=Object(se.useState)("python"),P=Object(F.a)(ce,2),le=P[0],$=P[1];function _(ee){$(Ne[ee][1])}function me(ee){Q(ee)}return j.a.createElement(ye.a,Object(Pe.a)({},he,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:me}),j.a.createElement(ye.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},j.a.createElement(V.a,{onChange:_},Object.keys(Ne).map(function(ee){return j.a.createElement(fe,{key:ee,value:ee},Ne[ee][0])}))),j.a.createElement(ye.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},j.a.createElement(Ue,{mode:le})),j.a.createElement("div",{className:"flex-container flex-end"},j.a.createElement(He.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),j.a.createElement(He.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))};function Ue(we){var Q=we.value,Ce=we.onChange,ce=we.mode,P=we.options,le=P===void 0?{}:P,$=Object(se.useRef)(),_=Object(se.useState)(),me=Object(F.a)(_,2),ee=me[0],L=me[1];return Object(se.useEffect)(function(){if(ee){function U(ae){var K=ae.getValue();Ce&&Ce(K)}return ee.on("change",U),function(){ee.off("change",U)}}},[ee,Ce]),Object(se.useEffect)(function(){ee&&ee.setOption("mode",ce)},[ee,ce]),Object(se.useEffect)(function(){ee&&((Q!==ee.getValue()||Q==="")&&setTimeout(function(){ee.setValue(Q||" ")},300))},[ee,Q]),Object(se.useEffect)(function(){if($.current&&!ee){var U=ke.a.fromTextArea($.current,Object(Z.a)({mode:ce,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},le));L(U)}},[$.current,ee]),j.a.createElement("div",{className:"my-codemirror-container"},j.a.createElement("textarea",{ref:$}))}},"7ixt":function(yt,qe,b){"use strict";b.d(qe,"a",function(){return Le});var Z={adjustX:1,adjustY:1},Pe=[0,0],Le={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:Pe},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:Pe},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:Pe},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:Pe},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:Pe},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:Pe},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:Pe},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:Pe},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:Pe},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:Pe},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:Pe},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:Pe}},He=Le},"815F":function(yt,qe,b){"use strict";b.d(qe,"e",function(){return F}),b.d(qe,"c",function(){return V}),b.d(qe,"d",function(){return se}),b.d(qe,"a",function(){return Y}),b.d(qe,"f",function(){return ke}),b.d(qe,"b",function(){return de});var Z=b("KQm4"),Pe=b("VTBJ"),Le=b("Ff2n"),He=b("Zm9Q"),_e=b("Kwbf"),ye=b("OZM5");function F(B,X){return B!=null?B:X}function q(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],X=new Map;function z(fe){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(fe||[]).forEach(function(Ne){var Ue=Ne.key,we=Ne.children;Object(_e.a)(Ue!=null,"Tree node must have a certain key: [".concat(he).concat(Ue,"]"));var Q=String(Ue);Object(_e.a)(!X.has(Q)||Ue===null||Ue===void 0,"Same 'key' exist in the Tree: ".concat(Q)),X.set(Q,!0),z(we,"".concat(he).concat(Q," > "))})}z(B)}function V(B){function X(z){var fe=Object(He.a)(z);return fe.map(function(he){if(!Object(ye.i)(he))return Object(_e.a)(!he,"Tree/TreeNode can only accept TreeNode as children."),null;var Ne=he.key,Ue=he.props,we=Ue.children,Q=Object(Le.a)(Ue,["children"]),Ce=Object(Pe.a)({key:Ne},Q),ce=X(we);return ce.length&&(Ce.children=ce),Ce}).filter(function(he){return he})}return X(B)}function se(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=new Set(X===!0?[]:X),fe=[];function he(Ne){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Ne.map(function(we,Q){var Ce=Object(ye.h)(Ue?Ue.pos:"0",Q),ce=F(we.key,Ce),P=Object(Pe.a)(Object(Pe.a)({},we),{},{parent:Ue,pos:Ce,children:null,data:we,isStart:[].concat(Object(Z.a)(Ue?Ue.isStart:[]),[Q===0]),isEnd:[].concat(Object(Z.a)(Ue?Ue.isEnd:[]),[Q===Ne.length-1])});return fe.push(P),X===!0||z.has(ce)?P.children=he(we.children||[],P):P.children=[],P})}return he(B),fe}function j(B,X,z){var fe;z?typeof z=="string"?fe=function(Ue){return Ue[z]}:typeof z=="function"&&(fe=function(Ue){return z(Ue)}):fe=function(Ue,we){return F(Ue.key,we)};function he(Ne,Ue,we){var Q=Ne?Ne.children:B,Ce=Ne?Object(ye.h)(we.pos,Ue):"0";if(Ne){var ce=fe(Ne,Ce),P={node:Ne,index:Ue,pos:Ce,key:ce,parentPos:we.node?we.pos:null,level:we.level+1};X(P)}Q&&Q.forEach(function(le,$){he(le,$,{node:Ne,pos:Ce,level:we?we.level+1:-1})})}he(null)}function Y(B){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=X.initWrapper,fe=X.processEntity,he=X.onProcessFinished,Ne=arguments.length>2?arguments[2]:void 0,Ue={},we={},Q={posEntities:Ue,keyEntities:we};return z&&(Q=z(Q)||Q),j(B,function(Ce){var ce=Ce.node,P=Ce.index,le=Ce.pos,$=Ce.key,_=Ce.parentPos,me=Ce.level,ee={node:ce,index:P,key:$,pos:le,level:me},L=F($,le);Ue[le]=ee,we[L]=ee,ee.parent=Ue[_],ee.parent&&(ee.parent.children=ee.parent.children||[],ee.parent.children.push(ee)),fe&&fe(ee,Q)},Ne),he&&he(Q),Q}function ke(B,X){var z=X.expandedKeys,fe=X.selectedKeys,he=X.loadedKeys,Ne=X.loadingKeys,Ue=X.checkedKeys,we=X.halfCheckedKeys,Q=X.dragOverNodeKey,Ce=X.dropPosition,ce=X.keyEntities,P=ce[B],le={eventKey:B,expanded:z.indexOf(B)!==-1,selected:fe.indexOf(B)!==-1,loaded:he.indexOf(B)!==-1,loading:Ne.indexOf(B)!==-1,checked:Ue.indexOf(B)!==-1,halfChecked:we.indexOf(B)!==-1,pos:String(P?P.pos:""),dragOver:Q===B&&Ce===0,dragOverGapTop:Q===B&&Ce===-1,dragOverGapBottom:Q===B&&Ce===1};return le}function de(B){var X=B.data,z=B.expanded,fe=B.selected,he=B.checked,Ne=B.loaded,Ue=B.loading,we=B.halfChecked,Q=B.dragOver,Ce=B.dragOverGapTop,ce=B.dragOverGapBottom,P=B.pos,le=B.active,$=Object(Pe.a)(Object(Pe.a)({},X),{},{expanded:z,selected:fe,checked:he,loaded:Ne,loading:Ue,halfChecked:we,dragOver:Q,dragOverGapTop:Ce,dragOverGapBottom:ce,pos:P,active:le});return"props"in $||Object.defineProperty($,"props",{get:function(){return Object(_e.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),B}}),$}},"8EBN":function(yt,qe,b){(function(Z){Z(b("VrN/"))})(function(Z){"use strict";Z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Pe=0;Pe-1&&He.substring(F+1,He.length);if(q)return Z.findModeByExtension(q)},Z.findModeByName=function(He){He=He.toLowerCase();for(var _e=0;_e1&&arguments[1]!==void 0?arguments[1]:"select",xe=arguments.length>2?arguments[2]:void 0,et=pe.get(Ye);return!xe&&Ue(et,Ve)?null:et},[pe]),Ke=V.useCallback(function(Ye){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",xe=arguments.length>2?arguments[2]:void 0,et=De.get(Ye);return!xe&&Ue(et,Ve)?null:et},[De]);return[je,Ke]}function Q(pe){return V.useMemo(function(){var De=new Map,je=new Map;return pe.forEach(function(Ke){De.set(Ke.key,Ke),je.set(Ke.data.value,Ke)}),[De,je]},[pe])}var Ce={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},ce=function(De,je){var Ke=De.prefixCls,Ye=De.height,Ve=De.itemHeight,xe=De.virtual,et=De.options,Ze=De.flattenOptions,Ae=De.multiple,We=De.searchValue,ie=De.onSelect,W=De.onToggleOpen,re=De.open,x=De.notFoundContent,T=De.onMouseEnter,O=V.useContext(Ne),N=O.checkable,be=O.checkedKeys,oe=O.halfCheckedKeys,Xe=O.treeExpandedKeys,ot=O.treeDefaultExpandAll,ut=O.treeDefaultExpandedKeys,st=O.onTreeExpand,kt=O.treeIcon,St=O.showTreeIcon,ct=O.switcherIcon,Ft=O.treeLine,Lt=O.treeNodeFilterProp,xt=O.loadData,wt=O.treeLoadedKeys,Tt=O.treeMotion,Bt=O.onTreeLoad,qt=V.useRef(),vt=Object(fe.a)(function(){return et},[re,et],function(lt,Ge){return Ge[0]&<[1]!==Ge[1]}),bn=Q(Ze),jt=Object(F.a)(bn,2),Zt=jt[0],pn=jt[1],en=we(Zt,pn),En=Object(F.a)(en,2),Pt=En[0],pt=En[1],on=V.useMemo(function(){return be.map(function(lt){var Ge=pt(lt);return Ge?Ge.key:null})},[be]),An=V.useMemo(function(){return N?{checked:on,halfChecked:oe}:null},[on,oe,N]);V.useEffect(function(){if(re&&!Ae&&on.length){var lt;(lt=qt.current)===null||lt===void 0||lt.scrollTo({key:on[0]})}},[re]);var Sn=String(We).toLowerCase(),Rt=function(Ge){return Sn?String(Ge[Lt]).toLowerCase().includes(Sn):!1},yn=V.useState(ut),un=Object(F.a)(yn,2),ei=un[0],Qe=un[1],_t=V.useState(null),Hn=Object(F.a)(_t,2),zn=Hn[0],Yn=Hn[1],Jn=V.useMemo(function(){return Xe?Object(_e.a)(Xe):We?zn:ei},[ei,zn,Sn,Xe]);V.useEffect(function(){We&&Yn(Ze.map(function(lt){return lt.key}))},[We]);var d=function(Ge){Qe(Ge),Yn(Ge),st&&st(Ge)},o=function(Ge){Ge.preventDefault()},a=function(Ge,gt){var ft=gt.node.key,Nt=Pt(ft,N?"checkbox":"select");Nt!==null&&ie(Nt.data.value,{selected:!be.includes(Nt.data.value)}),Ae||W(!1)},u=V.useState(null),h=Object(F.a)(u,2),c=h[0],te=h[1],$e=Pt(c);if(V.useImperativeHandle(je,function(){return{onKeyDown:function(Ge){var gt,ft=Ge.which;switch(ft){case z.a.UP:case z.a.DOWN:case z.a.LEFT:case z.a.RIGHT:(gt=qt.current)===null||gt===void 0||gt.onKeyDown(Ge);break;case z.a.ENTER:{$e!==null&&a(null,{node:{key:c},selected:!be.includes($e.data.value)});break}case z.a.ESC:W(!1)}},onKeyUp:function(){}}}),vt.length===0)return V.createElement("div",{role:"listbox",className:"".concat(Ke,"-empty"),onMouseDown:o},x);var it={};return wt&&(it.loadedKeys=wt),Jn&&(it.expandedKeys=Jn),V.createElement("div",{onMouseDown:o,onMouseEnter:T},$e&&re&&V.createElement("span",{style:Ce,"aria-live":"assertive"},$e.data.value),V.createElement(he.b,Object.assign({ref:qt,focusable:!1,prefixCls:"".concat(Ke,"-tree"),treeData:vt,height:Ye,itemHeight:Ve,virtual:xe,multiple:Ae,icon:kt,showIcon:St,switcherIcon:ct,showLine:Ft,loadData:We?null:xt,motion:Tt,checkable:N,checkStrictly:!0,checkedKeys:An,selectedKeys:N?[]:on,defaultExpandAll:ot},it,{onActiveChange:te,onSelect:a,onCheck:a,onExpand:d,onLoad:Bt,filterTreeNode:Rt})))},P=V.forwardRef(ce);P.displayName="OptionList";var le=P,$=function(){return null},_=$,me=b("Ff2n"),ee=b("Zm9Q");function L(pe){return Object(ee.a)(pe).map(function(De){if(!V.isValidElement(De)||!De.type)return null;var je=De.key,Ke=De.props,Ye=Ke.children,Ve=Ke.value,xe=Object(me.a)(Ke,["children","value"]),et=Object(q.a)({key:je,value:Ve},xe),Ze=L(Ye);return Ze.length&&(et.children=Ze),et}).filter(function(De){return De})}function U(pe){if(!pe)return pe;var De=Object(q.a)({},pe);return"props"in De||Object.defineProperty(De,"props",{get:function(){return Object(X.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),De}}),De}function ae(pe,De,je,Ke,Ye){var Ve=null,xe=null;function et(){function Ze(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ae.map(function(W,re){var x="".concat(We,"-").concat(re),T=je.includes(W.value),O=Ze(W.children||[],x,T),N=V.createElement(_,Object.assign({},W),O.map(function(oe){return oe.node}));if(De===W.value&&(Ve=N),T){var be={pos:x,node:N,children:O};return ie||xe.push(be),be}return null}).filter(function(W){return W})}xe||(xe=[],Ze(Ke),xe.sort(function(Ae,We){var ie=Ae.node.props.value,W=We.node.props.value,re=je.indexOf(ie),x=je.indexOf(W);return re-x}))}Object.defineProperty(pe,"triggerNode",{get:function(){return Object(X.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),et(),Ve}}),Object.defineProperty(pe,"allCheckedNodes",{get:function(){return Object(X.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),et(),Ye?xe:xe.map(function(Ae){var We=Ae.node;return We})}})}function K(pe){return Array.isArray(pe)?pe:pe!==void 0?[pe]:[]}function G(pe,De){var je=new Map;return De.forEach(function(Ke){var Ye=Ke.data;je.set(Ye.value,Ye)}),pe.map(function(Ke){return U(je.get(Ke))})}function m(pe,De){var je=G([pe],De)[0];return je?je.disabled:!1}function p(pe){return pe.disabled||pe.disableCheckbox||pe.checkable===!1}function A(pe){for(var De=pe.parent,je=0,Ke=De;Ke;)Ke=Ke.parent,je+=1;return je}function J(pe){function De(Ke){return(Ke||[]).map(function(Ye){var Ve=Ye.value,xe=Ye.key,et=Ye.children,Ze=Object(q.a)(Object(q.a)({},Ye),{},{key:"key"in Ye?xe:Ve});return et&&(Ze.children=De(et)),Ze})}var je=Object(Y.d)(De(pe),!0);return je.map(function(Ke){return{key:Ke.data.key,data:Ke.data,level:A(Ke)}})}function ve(pe){return function(De,je){var Ke=je[pe];return String(Ke).toLowerCase().includes(String(De).toLowerCase())}}function Re(pe,De,je){var Ke=je.optionFilterProp,Ye=je.filterOption;if(Ye===!1)return De;var Ve;typeof Ye=="function"?Ve=Ye:Ve=ve(Ke);function xe(et){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return et.map(function(Ae){var We=Ae.children,ie=Ze||Ve(pe,U(Ae)),W=xe(We||[],ie);return ie||W.length?Object(q.a)(Object(q.a)({},Ae),{},{children:W}):null}).filter(function(Ae){return Ae})}return xe(De)}function Se(pe,De,je,Ke){var Ye=new Map;return K(De).forEach(function(Ve){Ve&&Object(ye.a)(Ve)==="object"&&"value"in Ve&&Ye.set(Ve.value,Ve)}),pe.map(function(Ve){var xe={value:Ve},et=je(Ve,"select",!0),Ze=et?Ke(et.data):Ve;if(Ye.has(Ve)){var Ae=Ye.get(Ve);xe.label="label"in Ae?Ae.label:Ze,"halfChecked"in Ae&&(xe.halfChecked=Ae.halfChecked)}else xe.label=Ze;return xe})}function Te(pe,De){var je=new Set(pe);return je.add(De),Array.from(je)}function R(pe,De){var je=new Set(pe);return je.delete(De),Array.from(je)}function w(pe){var De=pe.searchPlaceholder,je=pe.treeCheckStrictly,Ke=pe.treeCheckable,Ye=pe.labelInValue,Ve=pe.value,xe=pe.multiple;Object(X.a)(!De,"`searchPlaceholder` has been removed."),je&&Ye===!1&&Object(X.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Ye||je)&&Object(X.a)(K(Ve).every(function(et){return et&&Object(ye.a)(et)==="object"&&"value"in et}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),je||xe||Ke?Object(X.a)(!Ve||Array.isArray(Ve),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(X.a)(!Array.isArray(Ve),"`value` should not be array when `TreeSelect` is single mode.")}var D=w,S=10;function k(pe,De){var je=De.id,Ke=De.pId,Ye=De.rootPId,Ve={},xe=[],et=pe.map(function(Ze){var Ae=Object(q.a)({},Ze),We=Ae[je];return Ve[We]=Ae,Ae.key=Ae.key||We,Ae});return et.forEach(function(Ze){var Ae=Ze[Ke],We=Ve[Ae];We&&(We.children=We.children||[],We.children.push(Ze)),(Ae===Ye||!We&&Ye===null)&&xe.push(Ze)}),xe}function v(pe,De){var je=0,Ke=new Set;function Ye(Ve){return(Ve||[]).map(function(xe){var et=xe.key,Ze=xe.value,Ae=xe.children,We=Object(me.a)(xe,["key","value","children"]),ie="value"in xe?Ze:et,W=Object(q.a)(Object(q.a)({},We),{},{key:et!=null?et:ie,value:ie,title:De(xe)});return"children"in xe&&(W.children=Ye(Ae)),W})}return Ye(pe)}function y(pe,De,je){var Ke=je.getLabelProp,Ye=je.simpleMode,Ve=V.useRef({});return pe?(Ve.current.formatTreeData=Ve.current.treeData===pe?Ve.current.formatTreeData:v(Ye?k(pe,Object(q.a)({id:"id",pId:"pId",rootPId:null},Ye!==!0?Ye:{})):pe,Ke),Ve.current.treeData=pe):Ve.current.formatTreeData=Ve.current.children===De?Ve.current.formatTreeData:v(L(De),Ke),Ve.current.formatTreeData}var E="SHOW_ALL",M="SHOW_PARENT",ue="SHOW_CHILD";function I(pe,De,je){var Ke=new Set(pe);return De===ue?pe.filter(function(Ye){var Ve=je[Ye];return!(Ve&&Ve.children&&Ve.children.every(function(xe){var et=xe.node;return p(et)||Ke.has(et.key)}))}):De===M?pe.filter(function(Ye){var Ve=je[Ye],xe=Ve?Ve.parent:null;return!(xe&&!p(xe.node)&&Ke.has(xe.node.key))}):pe}function ge(pe,De){var je=De.value,Ke=De.getEntityByValue,Ye=De.getEntityByKey,Ve=De.treeConduction,xe=De.showCheckedStrategy,et=De.conductKeyEntities,Ze=De.getLabelProp;return V.useMemo(function(){var Ae=pe;if(Ve){var We=I(pe.map(function(ie){var W=Ke(ie);return W?W.key:ie}),xe,et);Ae=We.map(function(ie){var W=Ye(ie);return W?W.data.value:ie})}return Se(Ae,je,Ke,Ze)},[pe,je,Ve,xe,Ke])}var Oe=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Ie=Object(se.a)({prefixCls:"rc-tree-select",components:{optionList:le},convertChildrenToData:function(){return null},flattenOptions:J,getLabeledValue:j.e,filterOptions:Re,isValueDisabled:m,findValueOption:G,omitDOMProps:function(De){var je=Object(q.a)({},De);return Oe.forEach(function(Ke){delete je[Ke]}),je}});Ie.displayName="Select";var ze=V.forwardRef(function(pe,De){var je=pe.multiple,Ke=pe.treeCheckable,Ye=pe.treeCheckStrictly,Ve=pe.showCheckedStrategy,xe=Ve===void 0?"SHOW_CHILD":Ve,et=pe.labelInValue,Ze=pe.loadData,Ae=pe.treeLoadedKeys,We=pe.treeNodeFilterProp,ie=We===void 0?"value":We,W=pe.treeNodeLabelProp,re=pe.treeDataSimpleMode,x=pe.treeData,T=pe.treeExpandedKeys,O=pe.treeDefaultExpandedKeys,N=pe.treeDefaultExpandAll,be=pe.children,oe=pe.treeIcon,Xe=pe.showTreeIcon,ot=pe.switcherIcon,ut=pe.treeLine,st=pe.treeMotion,kt=pe.filterTreeNode,St=pe.dropdownPopupAlign,ct=pe.onChange,Ft=pe.onTreeExpand,Lt=pe.onTreeLoad,xt=pe.onDropdownVisibleChange,wt=pe.onSelect,Tt=pe.onDeselect,Bt=Ke||Ye,qt=je||Bt,vt=Ke&&!Ye,bn=Ye||et,jt=V.useRef(null);V.useImperativeHandle(De,function(){return{focus:jt.current.focus,blur:jt.current.blur}});var Zt=function(ft){return x&&ft.label||ft.title},pn=function(ft){return W?ft[W]:Zt(ft)},en=y(x,be,{getLabelProp:Zt,simpleMode:re}),En=Object(V.useMemo)(function(){return J(en)},[en]),Pt=Q(En),pt=Object(F.a)(Pt,2),on=pt[0],An=pt[1],Sn=we(on,An),Rt=Object(F.a)(Sn,2),yn=Rt[0],un=Rt[1],ei=Object(V.useMemo)(function(){return vt?Object(Y.a)(en):{keyEntities:null}},[en,Ke,Ye]),Qe=ei.keyEntities,_t=Object(B.a)(pe.defaultValue,{value:pe.value}),Hn=Object(F.a)(_t,2),zn=Hn[0],Yn=Hn[1],Jn=function(ft){var Nt=[],cn=[];return ft.forEach(function(tn){un(tn)?cn.push(tn):Nt.push(tn)}),{missingRawValues:Nt,existRawValues:cn}},d=Object(V.useMemo)(function(){var gt=[],ft=[];if(K(zn).forEach(function(Vt){if(Vt&&Object(ye.a)(Vt)==="object"&&"value"in Vt)if(Vt.halfChecked&&Ye){var dn=un(Vt.value);gt.push(dn?dn.key:Vt.value)}else ft.push(Vt.value);else ft.push(Vt)}),vt){var Nt=Jn(ft),cn=Nt.missingRawValues,tn=Nt.existRawValues,$t=tn.map(function(Vt){return un(Vt).key}),Cn=Object(ke.a)($t,!0,Qe),Kn=Cn.checkedKeys,mn=Cn.halfCheckedKeys;return[[].concat(Object(_e.a)(cn),Object(_e.a)(Kn.map(function(Vt){return yn(Vt).data.value}))),mn]}return[ft,gt]},[zn,qt,bn,Ke,Ye]),o=Object(F.a)(d,2),a=o[0],u=o[1],h=ge(a,{treeConduction:vt,value:zn,showCheckedStrategy:xe,conductKeyEntities:Qe,getEntityByValue:un,getEntityByKey:yn,getLabelProp:pn}),c=function(ft,Nt,cn){if(Yn(qt?ft:ft[0]),ct){var tn=ft;if(vt&&xe!=="SHOW_ALL"){var $t=ft.map(function(xn){var jn=un(xn);return jn?jn.key:xn}),Cn=I($t,xe,Qe);tn=Cn.map(function(xn){var jn=yn(xn);return jn?jn.data.value:xn})}var Kn=Nt||{triggerValue:void 0,selected:void 0},mn=Kn.triggerValue,Vt=Kn.selected,dn=bn?Se(tn,zn,un,pn):tn;if(Ye){var Zn=u.map(function(xn){var jn=yn(xn);return jn?jn.data.value:xn}).filter(function(xn){return!tn.includes(xn)});dn=[].concat(Object(_e.a)(dn),Object(_e.a)(Se(Zn,zn,un,pn)))}var gn={preValue:h,triggerValue:mn},ci=!0;(Ye||cn==="selection"&&!Vt)&&(ci=!1),ae(gn,mn,ft,en,ci),Bt?gn.checked=Vt:gn.selected=Vt,ct(qt?dn:dn[0],bn?null:tn.map(function(xn){var jn=un(xn);return jn?pn(jn.data):null}),gn)}},te=function(ft,Nt,cn){var tn=ft;if(!qt)c([ft],{selected:!0,triggerValue:ft},cn);else{var $t=Te(a,ft);if(vt){var Cn=Jn($t),Kn=Cn.missingRawValues,mn=Cn.existRawValues,Vt=mn.map(function(gn){return un(gn).key}),dn=Object(ke.a)(Vt,!0,Qe),Zn=dn.checkedKeys;$t=[].concat(Object(_e.a)(Kn),Object(_e.a)(Zn.map(function(gn){return yn(gn).data.value})))}c($t,{selected:!0,triggerValue:ft},cn)}wt&&wt(tn,Nt)},$e=function(ft,Nt,cn){var tn=ft,$t=R(a,ft);if(vt){var Cn=Jn($t),Kn=Cn.missingRawValues,mn=Cn.existRawValues,Vt=mn.map(function(gn){return un(gn).key}),dn=Object(ke.a)(Vt,{checked:!1,halfCheckedKeys:u},Qe),Zn=dn.checkedKeys;$t=[].concat(Object(_e.a)(Kn),Object(_e.a)(Zn.map(function(gn){return yn(gn).data.value})))}c($t,{selected:!1,triggerValue:ft},cn),Tt&&Tt(tn,Nt)},it=function(){c([],null,"clear")},lt=V.useCallback(function(gt){if(xt){var ft={};Object.defineProperty(ft,"documentClickClose",{get:function(){return Object(X.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),xt(gt,ft)}},[xt]),Ge={optionLabelProp:null,optionFilterProp:ie,dropdownAlign:St,internalProps:{mark:de.a,onClear:it,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:te,onRawDeselect:$e}};return"filterTreeNode"in pe&&(Ge.filterOption=kt),V.createElement(Ne.Provider,{value:{checkable:Bt,loadData:Ze,treeLoadedKeys:Ae,onTreeLoad:Lt,checkedKeys:a,halfCheckedKeys:u,treeDefaultExpandAll:N,treeExpandedKeys:T,treeDefaultExpandedKeys:O,onTreeExpand:Ft,treeIcon:oe,treeMotion:st,showTreeIcon:Xe,switcherIcon:ot,treeLine:ut,treeNodeFilterProp:ie}},V.createElement(Ie,Object.assign({ref:jt,mode:qt?"multiple":null},pe,Ge,{value:h,labelInValue:!0,options:en,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:lt})))}),Be=function(pe){Object(Le.a)(je,pe);var De=Object(He.a)(je);function je(){var Ke;return Object(Z.a)(this,je),Ke=De.apply(this,arguments),Ke.selectRef=V.createRef(),Ke.focus=function(){Ke.selectRef.current.focus()},Ke.blur=function(){Ke.selectRef.current.blur()},Ke}return Object(Pe.a)(je,[{key:"render",value:function(){return V.createElement(ze,Object.assign({ref:this.selectRef},this.props))}}]),je}(V.Component);Be.TreeNode=_,Be.SHOW_ALL=E,Be.SHOW_PARENT=M,Be.SHOW_CHILD=ue;var Fe=Be,nt=qe.e=Fe},"8hTe":function(yt,qe,b){yt.exports={button:"button___1wy9m"}},"8pgt":function(yt,qe,b){yt.exports={flexRow:"flexRow___2kcn2",flexColumn:"flexColumn___2bS_0",formWrap:"formWrap___3t-wi",example:"example___2J2YZ",footerWrap:"footerWrap___3u6gg"}},"9Bee":function(yt,qe,b){"use strict";var Z=b("DYRE"),Pe=b("zeV3"),Le=b("+L6B"),He=b("2/Rp"),_e=b("k1fw"),ye=b("9og8"),F=b("tJVT"),q=b("WmNS"),V=b.n(q),se=b("q1tI"),j=b.n(se),Y=b("vg9a"),ke=b("DlQD"),de=b.n(ke),B=b("rUJ1");function X(d,o){var a=d.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(h){var c=h.match(/^\s+/);if(c===null)return h;var te=Object(F.a)(c,1),$e=te[0];return $e.length>=u.length?h.slice(u.length):h}).join(`
`)}var z=[],fe=[""],he=new de.a.Renderer,Ne=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ue(){z.length=0,fe=[""]}var we={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Q(d,o,a,u){if(o>=d.length||d[o].level<=a)return o;var h=d[o];u.push("- "+h.text+""),o++;var c=[];return o=Q(d,o,h.level,c),c.length>0&&(u.push("
"),c.forEach(function(te){u.push(te)}),u.push("
")),u.push(" "),o=Q(d,o,a,u),o}function Ce(){return Q(z,0,0,fe),fe.push("
"),fe.join("")}var ce={heading:function(o){var a=Ne.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],h=X(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var te=$(),$e=h;h=te,_[te]={type:"block",expression:$e}}return{type:"code",raw:u,lang:c,text:h}}}},P=/(?:\${2})([^\n`]+?)(?:\${2})/gi,le=0,$=function(){return"__special_katext_id_".concat(le++,"__")},_={};function me(){return _}function ee(){le=0,_={}}function L(d){return d=d.replace(P,function(o,a){var u=$();return _[u]={type:"inline",expression:a},u}),d}var U=he.listitem;he.listitem=function(d){return U(L(d))};var ae=he.paragraph;he.paragraph=function(d){return ae(L(d))};var K=he.tablecell;he.tablecell=function(d,o){return K(L(d),o)},he.code=function(d,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"".concat(d,"
"):'
').concat(a?d:Object(B.escape)(d,!0),`
`):''+(a?d:Object(B.escape)(d,!0))+"
"},he.heading=function(d,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return z.push({anchor:u,level:o,text:d}),"'+d+""},de.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),de.a.use({tokenizer:ce,renderer:he});var G=de.a,m=b("SJMd"),p=b("ulZh"),A=b.n(p),J=b("m3rI"),ve=b("Oy/b"),Re=b("p5ED"),Se=b("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 Te=function(d,o){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(a[h]=u[h])})(d,o)};function R(d,o){function a(){this.constructor=d}Te(d,o),d.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function w(d,o,a,u){return new(a||(a=Promise))(function(h,c){function te(lt){try{it(u.next(lt))}catch(Ge){c(Ge)}}function $e(lt){try{it(u.throw(lt))}catch(Ge){c(Ge)}}function it(lt){var Ge;lt.done?h(lt.value):(Ge=lt.value,Ge instanceof a?Ge:new a(function(gt){gt(Ge)})).then(te,$e)}it((u=u.apply(d,o||[])).next())})}function D(d,o){var a,u,h,c,te={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return c={next:$e(0),throw:$e(1),return:$e(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function $e(it){return function(lt){return function(Ge){if(a)throw new TypeError("Generator is already executing.");for(;te;)try{if(a=1,u&&(h=2&Ge[0]?u.return:Ge[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,Ge[1])).done)return h;switch(u=0,h&&(Ge=[2&Ge[0],h.value]),Ge[0]){case 0:case 1:h=Ge;break;case 4:return te.label++,{value:Ge[1],done:!1};case 5:te.label++,u=Ge[1],Ge=[0];continue;case 7:Ge=te.ops.pop(),te.trys.pop();continue;default:if(!(h=te.trys,(h=h.length>0&&h[h.length-1])||Ge[0]!==6&&Ge[0]!==2)){te=0;continue}if(Ge[0]===3&&(!h||Ge[1]>h[0]&&Ge[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(c){var te=document.createElement("div");te.className=""+a.toolbarButtonStyleClass.name,te.setAttribute("data-type-name",c.typeName),te.innerHTML=c.icon,te.addEventListener("click",function(){a.markerToolbarButtonClicked(te,c)}),a.buttons.push(te),a.markerButtons.push(te)}),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()},d.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},d.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},d.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},d.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},d.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},d.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)},d.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},d.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},d}(),Oe=function(){function d(o,a,u,h){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=h,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return d.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new I("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 I("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new I("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new I("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new I("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 I("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new I("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
padding: `+a+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new I("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new I("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;
`))},d.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},d.prototype.setPanelButtons=function(o){var a,u,h=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var te;c.uiStyleSettings=h.uiStyleSettings;var $e=document.createElement("div");$e.className=h.toolboxButtonStyleClass.name+" "+((te=h.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&te!==void 0?te:h.toolboxButtonStyleColorsClass.name),$e.innerHTML=c.icon,$e.title=c.title,$e.addEventListener("click",function(){h.panelButtonClick(c)}),h.panelButtons.push($e),h.buttonRow.appendChild($e)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},d.prototype.panelButtonClick=function(o){var a=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(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,te){var $e,it;c.className=a.toolboxButtonStyleClass.name+" "+(te===u?""+(($e=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&$e!==void 0?$e:a.toolboxActiveButtonStyleColorsClass.name):""+((it=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:a.toolboxButtonStyleColorsClass.name))})},d}(),Ie=function(d,o){this.title=d,this.icon=o},ze=function(d){function o(a,u,h,c){var te=d.call(this,a,c||'')||this;return te.colors=[],te.addTransparent=!1,te.colorBoxes=[],te.colors=u,te.currentColor=h,te.setCurrentColor=te.setCurrentColor.bind(te),te.getColorBox=te.getColorBox.bind(te),te}return R(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(h){var c=a.getColorBox(h);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,h=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-h,te=document.createElement("div");te.style.display="inline-block",te.style.boxSizing="content-box",te.style.width=c-2+"px",te.style.height=c-2+"px",te.style.padding="1px",te.style.marginRight="2px",te.style.marginBottom="2px",te.style.borderWidth="2px",te.style.borderStyle="solid",te.style.borderRadius=(c+2)/2+"px",te.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",te.addEventListener("click",function(){u.setCurrentColor(a,te)});var $e=document.createElement("div");return $e.style.display="inline-block",$e.style.width=c-2+"px",$e.style.height=c-2+"px",$e.style.backgroundColor=a,$e.style.borderRadius=c/2+"px",a==="transparent"&&($e.style.fill=this.uiStyleSettings.toolboxAccentColor,$e.innerHTML=``),te.appendChild($e),te},o.prototype.setCurrentColor=function(a,u){var h=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ie),Be=function(){function d(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(d.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(o){return!1},Object.defineProperty(d.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),d.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},d.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},d.prototype.pointerDown=function(o,a){},d.prototype.dblClick=function(o,a){},d.prototype.manipulate=function(o){},d.prototype.pointerUp=function(o){this.stateChanged()},d.prototype.dispose=function(){},d.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},d.prototype.getState=function(){return{typeName:d.typeName,state:this.state,notes:this.notes}},d.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},d.prototype.scale=function(o,a){},d.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},d.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},d.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)}},d.typeName="MarkerBase",d}(),Fe=function(){function d(){this.findGripByVisual=this.findGripByVisual.bind(this)}return d.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},d}(),nt=function(){function d(){this.GRIP_SIZE=10,this.visual=k.createGroup(),this.visual.appendChild(k.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(k.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d}(),pe=function(){function d(){}return d.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},d.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},d}(),De=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(k.createTransform()),c.setupControlBox(),c}return R(o,d),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=k.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!d.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var h=this.unrotatePoint(a);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 c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var te=this.container.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(te,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;d.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,h=this.manipulationStartWidth,c=this.manipulationStartTop,te=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.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+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,te=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:te=this.manipulationStartHeight+a.y-this.manipulationStartY}h>=0?(this.left=u,this.width=h):(this.left=u+h,this.width=-h),te>=0?(this.top=c,this.height=te):(this.top=c+te,this.height=-te),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),h=k.createPoint(a.x,a.y);return{x:(h=h.matrixTransform(u)).x,y:h.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var h=k.createPoint(a.x,a.y);return{x:(h=h.matrixTransform(u)).x,y:h.y}},o.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=k.createGroup();var a=k.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=k.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=k.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Fe,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var a=new nt;return a.visual.transform.baseVal.appendItem(k.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,h=u,c=(this.width+this.CB_DISTANCE)/2-a/2,te=(this.height+this.CB_DISTANCE)/2-a/2,$e=this.height+this.CB_DISTANCE-a/2,it=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,h),this.positionGrip(this.controlGrips.topCenter.visual,c,h),this.positionGrip(this.controlGrips.topRight.visual,it,h),this.positionGrip(this.controlGrips.centerLeft.visual,u,te),this.positionGrip(this.controlGrips.centerRight.visual,it,te),this.positionGrip(this.controlGrips.bottomLeft.visual,u,$e),this.positionGrip(this.controlGrips.bottomCenter.visual,c,$e),this.positionGrip(this.controlGrips.bottomRight.visual,it,$e),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,h-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,h){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,h),a.transform.baseVal.replaceItem(c,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:pe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:pe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){d.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(pe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(pe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u);var h=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:h.x*a,y:h.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Be),je=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return R(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=k.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){d.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&k.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&k.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&k.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&k.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},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(De),Ke=function(d){function o(a,u,h,c){var te=d.call(this,a,c||'')||this;return te.widths=[],te.widthBoxes=[],te.widths=u,te.currentWidth=h,te.setCurrentWidth=te.setCurrentWidth.bind(te),te}return R(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(h){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=h===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(h,c)}),u.appendChild(c);var te=document.createElement("div");te.innerText=h.toString(),te.style.marginRight="5px",c.appendChild(te);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.display="flex",$e.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=h+"px solid "+a.uiStyleSettings.toolboxColor,it.style.flexGrow="2",$e.appendChild(it),c.appendChild($e),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var h=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ie),Ye=function(d){function o(a,u,h,c){var te=d.call(this,a,c||'')||this;return te.styles=[],te.styleBoxes=[],te.styles=u,te.currentStyle=h,te.setCurrentStyle=te.setCurrentStyle.bind(te),te}return R(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(h){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=h===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(h,c)}),u.appendChild(c);var te=document.createElement("div");te.style.minHeight="20px",te.style.flexGrow="2",te.style.overflow="hidden";var $e=``;te.innerHTML=$e,c.appendChild(te),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var h=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ie),Ve=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.strokeColor=h.defaultColor,c.strokeWidth=h.defaultStrokeWidth,c.strokeDasharray=h.defaultStrokeDasharray,c.strokePanel=new ze("Line color",h.defaultColorSet,h.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ke("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ye("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return R(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='',o}(je),xe=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},et=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return R(o,d),o.prototype.ownsTarget=function(a){return!!d.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;d.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=k.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new nt;return a.visual.transform.baseVal.appendItem(k.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,h){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,h),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){d.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Be),Ze=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=h.defaultColor,c.strokeWidth=h.defaultStrokeWidth,c.strokeDasharray=h.defaultStrokeDasharray,c.strokePanel=new ze("Line color",h.defaultColorSet,h.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ke("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ye("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return R(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=k.createGroup(),this.selectorLine=k.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=k.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),k.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),k.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='',o}(et),Ae=function(d){function o(a,u,h,c){var te=d.call(this,a,c||'')||this;return te.fonts=[],te.fontBoxes=[],te.fonts=u,te.currentFont=h,te.setCurrentFont=te.setCurrentFont.bind(te),te}return R(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(h){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=h===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(h,c)}),u.appendChild(c);var te=document.createElement("div");te.style.display="flex",te.style.minHeight="20px",te.style.flexGrow="2",te.style.fontFamily=h,te.style.overflow="hidden";var $e=document.createElement("div");$e.style.whiteSpace="nowrap",$e.style.overflow="hidden",$e.style.textOverflow="ellipsis",$e.innerHTML="The quick brown fox jumps over the lazy dog",te.appendChild($e),c.appendChild(te),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var h=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ie),We=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=h.defaultColor,c.fontFamily=h.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new ze("Color",h.defaultColorSet,h.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new Ae("Font",h.defaultFontFamilies,h.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return R(o,d),o.prototype.ownsTarget=function(a){if(d.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(h){h===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=k.createGroup(),this.bgRectangle=k.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=k.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(k.createTransform()),this.textElement.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(k.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var h=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(h,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),h=0,c=0;return u.width>0&&u.height>0&&(h=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:h,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),h=this.getTextPosition(u);h.y-=a.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(a){d.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){d.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),d.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var h=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(h)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),h=this.textElement.getBBox(),c={x:h.width*a,y:h.height*a};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){d.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),d.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){d.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&k.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&k.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='',o}(De),ie=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=h.defaultColor,c.lineWidth=h.defaultStrokeWidth,c.pixelRatio=h.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new ze("Color",h.defaultColorSet,h.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Ke("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return R(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=k.createGroup(),this.drawingImage=k.createImage(),this.visual.appendChild(this.drawingImage);var a=k.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):d.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),k.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):d.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),d.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),d.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],h=u[0],c=u[1],te=u[2],$e=u[3],it=!1,lt=0;lt0&&(it=!0,lt$e&&($e=lt),Ge>te&&(te=Ge));if(it){this.left=h/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(te-h)/this.pixelRatio,this.height=($e-c)/this.pixelRatio;var gt=document.createElement("canvas");gt.width=te-h,gt.height=$e-c,gt.getContext("2d").putImageData(this.canvasContext.getImageData(h,c,te-h,$e-c),0,0),this.drawingImgUrl=gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){k.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),k.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),d.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='',o}(De),W=function(d){function o(a,u,h){var c=d.call(this,a,h||'')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return R(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var h=function($e){var it="both";switch($e){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var lt=document.createElement("div");if(lt.style.display="flex",lt.style.flexGrow="2",lt.style.alignItems="center",lt.style.justifyContent="space-between",lt.style.padding="5px",lt.style.borderWidth="2px",lt.style.borderStyle="solid",lt.style.borderColor=it===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",lt.addEventListener("click",function(){a.setCurrentType(it,lt)}),u.appendChild(lt),it==="both"||it==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=``,Ge.style.marginLeft="5px",lt.appendChild(Ge)}var gt=document.createElement("div");gt.style.display="flex",gt.style.alignItems="center",gt.style.minHeight="20px",gt.style.flexGrow="2";var ft=document.createElement("hr");if(ft.style.minWidth="20px",ft.style.border="0px",ft.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),ft.style.flexGrow="2",gt.appendChild(ft),lt.appendChild(gt),it==="both"||it==="end"){var Nt=document.createElement("div");Nt.style.display="flex",Nt.style.alignItems="center",Nt.style.minHeight="20px",Nt.innerHTML=``,Nt.style.marginRight="5px",lt.appendChild(Nt)}c.typeBoxes.push(lt)},c=this,te=0;te<4;te++)h(te);return u},o.prototype.setCurrentType=function(a,u){var h=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ie),re=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new W("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return R(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var h=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-h/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+h/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=k.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=k.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(k.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.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",k.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),k.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var h=this.arrow2.transform.baseVal.getItem(0);h.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(h,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='',o}(Ze),x=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.fillColor=h.defaultFillColor,c.strokeWidth=0,c.fillPanel=new ze("Color",h.defaultColorSet,h.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return R(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='',o}(je),T=function(d){function o(a,u,h,c){var te=d.call(this,a,c||'')||this;return te.opacities=[],te.opacityBoxes=[],te.opacities=u,te.currentOpacity=h,te.setCurrentOpacity=te.setCurrentOpacity.bind(te),te}return R(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(h){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=h===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(h,c)}),u.appendChild(c);var te=document.createElement("div");te.innerText=100*h+"%",c.appendChild(te),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var h=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?h.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ie),O=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=h.defaultHighlightColor,c.strokeWidth=0,c.opacity=h.defaultHighlightOpacity,c.fillPanel=new ze("Color",h.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new T("Opacity",h.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return R(o,d),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&k.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='',o}(x),N='',be=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=h.defaultStrokeColor,c.bgColor=h.defaultFillColor,c.fontFamily=h.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new ze("Text color",h.defaultColorSet,c.color,''),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new ze("Fill color",h.defaultColorSet,c.bgColor,N),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new Ae("Font",h.defaultFontFamilies,h.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new nt,c.tipGrip.visual.transform.baseVal.appendItem(k.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return R(o,d),o.prototype.ownsTarget=function(a){return d.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){k.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=k.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&d.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):d.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,d.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";d.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else d.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(k.setAttributes(this.bgRectangle,[["fill",a]]),k.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),h=this.height/5;a&&(this.tipPosition={x:u+h/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?c',o}(We),oe=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=h.defaultColor,c.strokeWidth=h.defaultStrokeWidth,c.strokeDasharray=h.defaultStrokeDasharray,c.fillColor=h.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new ze("Line color",S(h.defaultColorSet,["transparent"]),h.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new ze("Fill color",S(h.defaultColorSet,["transparent"]),c.fillColor,N),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Ke("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ye("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new T("Opacity",h.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return R(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=k.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),k.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){d.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&k.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&k.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&k.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&k.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&k.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='',o}(De),Xe=function(d){function o(a,u,h){return d.call(this,a,u,h)||this}return R(o,d),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=k.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(k.createTransform()),this.visual.appendChild(this.tip1),this.tip2=k.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(k.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(k.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()]]),k.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var h=this.tip2.transform.baseVal.getItem(0);h.setRotate(a+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 a=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='',o}(Ze),ot=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.strokePanel.colors=h.defaultColorSet,c.fillColor="transparent",c}return R(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='',o}(oe),ut=function(){function d(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),d.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))},d.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},d.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},d.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}},d.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},d}(),st=function(d){function o(a,u,h){var c=d.call(this,a,u,h)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=h.defaultColor,c.strokeWidth=h.defaultStrokeWidth,c.strokeDasharray=h.defaultStrokeDasharray,c.strokePanel=new ze("Line color",h.defaultColorSet,h.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Ke("Line width",h.defaultStrokeWidths,h.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ye("Line style",h.defaultStrokeDasharrays,h.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return R(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=k.createGroup(),this.selectorCurve=k.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=k.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),k.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),k.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),k.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){d.prototype.setupControlBox.call(this),this.curveControlLine1=k.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=k.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,d.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){d.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),d.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,d.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='',o}(et),kt=function(){function d(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(d.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),d.prototype.preventDefault=function(){this._defaultPrevented=!0},d}(),St=function(d){function o(a,u,h){var c=d.call(this,a,!1)||this;return c.dataUrl=u,c.state=h,c}return R(o,d),o}(kt),ct=function(d){function o(a,u,h){h===void 0&&(h=!1);var c=d.call(this,a,h)||this;return c.marker=u,c}return R(o,d),o}(kt),Ft=function(){function d(){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 d.prototype.addEventListener=function(o,a){this[o].push(a)},d.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},d}(),Lt=function(){function d(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 xe,this._isOpen=!1,this.undoRedoManager=new ut,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=d.instanceCounter++,this.styles=new M(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(d.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ve,ie,re,We,ot,oe,O,be,Xe,x,Ze,st]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ve,ie,re,We,oe,O,be]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ve,ie,re,We,O]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var h=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});h!==void 0&&a._availableMarkerTypes.push(h)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),v.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},d.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&E.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=E.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new kt(o))})},d.prototype.render=function(){return w(this,void 0,void 0,function(){var o;return D(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new y).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},d.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(h){var c=new kt(a,!0);h(c),c.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(h){return h(new kt(a))}),this.detachEvents(),this._isOpen=!1)}},d.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a',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()},d.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")},d.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"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.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 ge(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()},d.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())},d.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},d.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(h){var c=new ct(o,o._currentMarker,!0);h(c),c.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(h){return h(new ct(o,u))})}}},d.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(te){var $e=new ct(o,void 0,!0);te($e),$e.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(te){var $e=h.markers[te];h.setCurrentMarker(h.markers[te]),h._currentMarker.dispose(),h.markerImage.removeChild(h._currentMarker.container),h.markers.splice(h.markers.indexOf(h._currentMarker),1),h.eventListeners.markerdelete.forEach(function(it){return it(new ct(o,$e))})},h=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(d.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),d.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))},d.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)},d.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},d.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var h=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),h1&&this.panTo({x:o.clientX,y:o.clientY}))},d.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()},d.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},d.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},d.prototype.onWindowResize=function(){this.positionUI()},d.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()},d.prototype.addLicenseKey=function(o){v.addKey(o)},d.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},d.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},d.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(d.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),d.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new kt(o))}))},d.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new kt(o))}))},d.instanceCounter=0,d}();/* **********************************
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 xt=function(d,o){return(xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(a[h]=u[h])})(d,o)};function wt(d,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=d}xt(d,o),d.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Tt(d,o,a,u){return new(a||(a=Promise))(function(h,c){function te(lt){try{it(u.next(lt))}catch(Ge){c(Ge)}}function $e(lt){try{it(u.throw(lt))}catch(Ge){c(Ge)}}function it(lt){var Ge;lt.done?h(lt.value):(Ge=lt.value,Ge instanceof a?Ge:new a(function(gt){gt(Ge)})).then(te,$e)}it((u=u.apply(d,o||[])).next())})}function Bt(d,o){var a,u,h,c,te={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return c={next:$e(0),throw:$e(1),return:$e(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function $e(it){return function(lt){return function(Ge){if(a)throw new TypeError("Generator is already executing.");for(;te;)try{if(a=1,u&&(h=2&Ge[0]?u.return:Ge[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,Ge[1])).done)return h;switch(u=0,h&&(Ge=[2&Ge[0],h.value]),Ge[0]){case 0:case 1:h=Ge;break;case 4:return te.label++,{value:Ge[1],done:!1};case 5:te.label++,u=Ge[1],Ge=[0];continue;case 7:Ge=te.ops.pop(),te.trys.pop();continue;default:if(!(h=te.trys,(h=h.length>0&&h[h.length-1])||Ge[0]!==6&&Ge[0]!==2)){te=0;continue}if(Ge[0]===3&&(!h||Ge[1]>h[0]&&Ge[1]0&&a>0){var u=new on(o,a),h=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),te=document.createElementNS("http://www.w3.org/2000/svg","svg");te.setAttribute("xmlns","http://www.w3.org/2000/svg"),te.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(te);var $e=vt.createDefs();te.appendChild($e);var it=vt.createElement("clipPath",[["id","text-bg-clip"]]);$e.appendChild(it);var lt=vt.createPath(vt.getHollowRectanglePath((24-h)/2,(24-c)/2,h,c,(24-h)/2+2,(24-c)/2+2,h-4,c-4));te.appendChild(lt);var Ge=vt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(vt.createTSpan(o+":"+a)),te.appendChild(Ge);var gt=Ge.getBBox();vt.setAttributes(Ge,[["x",((24-gt.width)/2).toString()],["y",((24-gt.height)/2-gt.y).toString()]]);var ft=vt.createPath(vt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(gt.width))/2,(24-Math.ceil(gt.height))/2,Math.ceil(gt.width),Math.ceil(gt.height)));return it.appendChild(ft),vt.setAttributes(lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(te),te.outerHTML}return''},d}(),Sn=function(d){function o(a,u,h){var c=d.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=h,c}return wt(o,d),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Pt),Rt=function(){function d(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=vt.createGroup(),this.visual.appendChild(vt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(vt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return vt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},d}(),yn=function(){function d(o,a,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=a,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(d.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(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&vt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),d.prototype.open=function(){var o=this;this.cropShadeElement=vt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=vt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;athis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),vt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,te){var $e=a.y+u*(te+1);vt.setAttributes(c,[["x1",""+a.x],["y1",""+$e],["x2",""+(a.x+a.width)],["y2",""+$e]])});var h=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,te){var $e=a.x+h*(te+1);vt.setAttributes(c,[["x1",""+$e],["y1",""+a.y],["x2",""+$e],["y2",""+(a.y+a.height)]])}),vt.setAttributes(this.cropShadeElement,[["d",vt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},d.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)},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},d.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)},d.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},d.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},d.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},d.prototype.resize=function(o){var a=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:a.x+uthis.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=h,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=h}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},d.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),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=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},d.prototype.getRescaledRect=function(o,a,u,h,c,te){var $e=u/o,it=h/a;return{x:(c.x-te)*$e+te,y:(c.y-te)*it+te,width:c.width*$e,height:c.height*it}},d.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},d}(),un=function(){function d(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(d.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),d.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},d.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},d.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},d.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},d.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();vt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},d.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)}},d.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var h=u%5==0?this.height/3:this.height/6;a+="h4v"+-h+"h1v"+h}a+="v1H0Z",this.scaleShape=vt.createPath(a);var c=vt.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=vt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=vt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var te=vt.createTSpan("");return te.innerHTML="°",this.angleLabelElement.appendChild(te),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},d}(),ei=function(){function d(){this.naturalSize=!1,this.imageType="image/png"}return d.prototype.rasterize=function(o,a,u,h,c,te,$e){var it=this;return new Promise(function(lt){var Ge=document.createElement("canvas");Ge.width=o.width.baseVal.value-2*h,Ge.height=o.height.baseVal.value-2*h;var gt=1,ft=1;it.naturalSize===!0?(gt=a.naturalWidth/(o.width.baseVal.value-2*h)/te,ft=a.naturalHeight/(o.height.baseVal.value-2*h)/$e,Ge.width=a.naturalWidth/te,Ge.height=a.naturalHeight/$e):it.width!==void 0&&it.height!==void 0&&(gt=it.width/u.width,ft=it.height/u.height,Ge.width*=gt,Ge.height*=ft);var Nt=Ge.getContext("2d");Nt.translate(Ge.width/2,Ge.height/2),Nt.rotate(c*Math.PI/180),Nt.scale(te,$e),Nt.translate(-Ge.width/2,-Ge.height/2),Nt.drawImage(a,0,0,Ge.width,Ge.height);var cn=document.createElement("canvas");cn.width=u.width*gt,cn.height=u.height*ft,cn.getContext("2d").putImageData(Nt.getImageData((u.x-h)*gt,(u.y-h)*ft,u.width*gt,u.height*ft),0,0),lt(cn.toDataURL(it.imageType,it.imageQuality))})},d}(),Qe=function(){function d(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=d.instanceCounter++,this.styles=new bn(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(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.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(d.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(d.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.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}),d.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},d.prototype.show=function(){this.showUI(),this.open()},d.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},d.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},d.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},d.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},d.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},d.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))},d.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGINo+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},d.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},d.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new pn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new En;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(ft){var Nt=new Pt(An.getIcon(ft.horizontal,ft.vertical),ft.horizontal===0&&ft.vertical===0?"FREE":ft.horizontal+":"+ft.vertical);Nt.onClick=function(){return o.ratioButtonClicked(ft)},u.push(Nt)}),this.aspectRatioButton=new Sn(An.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var h=new Pt('',"Toggle grid");h.isActive=this.isGridVisible,h.onClick=function(){o.isGridVisible=!o.isGridVisible,h.isActive=o.isGridVisible},a.addButton(h);var c=new Pt('',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!qt.isLicensed){var te=new pt;this.topToolbar.addElementBlock(te);var $e=document.createElement("div");$e.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='',$e.appendChild(it),te.addElement($e)}var lt=new En;lt.minWidth=3*this.toolbarHeight+"px",lt.contentAlign="end",this.topToolbar.addButtonBlock(lt);var Ge=new Pt('',"OK");Ge.onClick=this.startRenderAndClose,lt.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var gt=new Pt('',"Close");gt.onClick=this.close,lt.addButton(gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},d.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new pn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new En;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Pt('',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var h=new Pt('',"Rotate right");h.onClick=this.rotateRightButtonClicked,a.addButton(h);var c=new pt;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new un("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(lt){o.rotateBy(lt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var te=new En;te.minWidth=2*this.toolbarHeight+"px",te.contentAlign="end",this.bottomToolbar.addButtonBlock(te);var $e=new Pt('',"Flip horizontal");$e.onClick=this.flipHorizontallyButtonClicked,te.addButton($e);var it=new Pt('',"Flip vertical");it.onClick=this.flipVerticallyButtonClicked,te.addButton(it)},d.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},d.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=An.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},d.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new on(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},d.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},d.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},d.prototype.onWindowResize=function(){this.positionUI()},d.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()},d.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)},d.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)},d.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},d.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},d.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},d.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},d.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},d.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},d.prototype.startRenderAndClose=function(){return Tt(this,void 0,void 0,function(){var o,a;return Bt(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(h){return h(o,a)}),this.close(!0),[2]}})})},d.prototype.render=function(){return Tt(this,void 0,void 0,function(){var o;return Bt(this,function(a){switch(a.label){case 0:return(o=new ei).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),vt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Zt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Zt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Zt("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 Zt("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 Zt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},d.instanceCounter=0,d}(),_t=b("8hTe"),Hn=b.n(_t),zn=/]*>/g;function Yn(d){var o=document.createElement("div");return o.innerHTML=d,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Jn=qe.a=function(d){var o=d.value,a=o===void 0?"":o,u=d.edit,h=u===void 0?!1:u,c=d.className,te=d.showTextOnly,$e=d.showLines,it=d.replaces,lt=d.zoomImg,Ge=d.hasMask,gt=d.style,ft=gt===void 0?{}:gt,Nt=d.stylesPrev,cn=Nt===void 0?{}:Nt,tn=String(a),$t=Object(se.useRef)(),Cn=Object(se.useRef)(),Kn=Object(se.useState)(""),mn=Object(F.a)(Kn,2),Vt=mn[0],dn=mn[1],Zn=Object(se.useState)("office"),gn=Object(F.a)(Zn,2),ci=gn[0],xn=gn[1],jn=function(){var Wt=new Qe(Cn.current);Wt.displayMode="popup",Wt.addRenderEventListener(function(){var kn=Object(ye.a)(V.a.mark(function It(hn){var zt;return V.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return $t.current.style.display="none",ln.next=3,Object(Se.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn}});case 3:zt=ln.sent,zt!=null&&zt.id&&it(Cn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 5:case"end":return ln.stop()}},It)}));return function(It){return kn.apply(this,arguments)}}()),Wt.show()},Gt=function(){var Wt=new Lt(Cn.current);Wt.settings.displayMode="popup",Wt.addEventListener("render",function(){var kn=Object(ye.a)(V.a.mark(function It(hn){var zt;return V.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if($t.current.style.display="none",!Cn.current){ln.next=6;break}return ln.next=4,Object(Se.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn.dataUrl}});case 4:zt=ln.sent,zt!=null&&zt.id&&it(Cn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 6:case"end":return ln.stop()}},It)}));return function(It){return kn.apply(this,arguments)}}()),Wt.show(),window.markerArea=Wt},Ct=Object(se.useMemo)(function(){try{var an=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Wt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,kn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;tn=tn.replace(an,"("+J.a.API_SERVER+"/api/attachments/").replace(Wt,'"'+J.a.API_SERVER+"/api/attachments/").replace(kn,'"'+J.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,`
`),tn=tn.replace(new RegExp("(?[TOC]
",Ce()),Ue()),It=It.replace(/(__special_katext_id_\d+__)/g,function(Gn,ln){var _n=hn[ln],bi=_n.type,ii=_n.expression;return Object(ve.renderToString)(Yn(ii)||"",{displayMode:bi==="block",throwOnError:!1,output:"html"})}),It=It.replace(/▁/g,"\u2581\u2581\u2581"),ee(),te){var zt=document.createElement("div");return zt.innerHTML=It,zt.innerText}return setTimeout(function(){return nn()},500),It},[tn]),at=Object(se.useRef)();we.WebkitLineClamp=$e,$e&&(ft=Object(_e.a)(Object(_e.a)({},ft),we));function vn(an){var Wt=an.target;if(Wt.tagName.toUpperCase()==="IMG"){if(lt){var kn=Wt.getAttribute("src");dn(kn),xn("image")}}else if(Wt.tagName.toUpperCase()==="A"){var It=Wt.getAttribute("href");if(It.indexOf("office")>-1)an.preventDefault(),dn(It),xn("office");else if(It.indexOf("application/pdf")>-1)an.preventDefault(),dn(It),xn("pdf");else if(It.indexOf("type=text")>-1)an.preventDefault(),dn(It),xn("html");else if(It.startsWith("#")){an.preventDefault();var hn=document.getElementById(It.replace("#",""));hn&&hn.scrollIntoView(!0)}}}var nn=function(){var Wt,kn=(Wt=at.current)===null||Wt===void 0?void 0:Wt.querySelectorAll("video");kn==null||kn.forEach(function(It){if(It.oncontextmenu=function(){return!1},It.src.indexOf(".m3u8")>-1&&!It.canPlayType("application/vnd.apple.mpegurl")){if(A.a.isSupported()){var hn=new A.a;hn.loadSource(It.src),hn.attachMedia(It)}}})};Object(se.useEffect)(function(){if(at.current&&Ct&&(Ct.match(zn)&&window.PR.prettyPrint()),at.current)return at.current.addEventListener("click",vn),function(){at.current.removeEventListener("click",vn),ee(),Ue()}},[Ct,at.current,vn]);var Vn=function(Wt){if(!h)return;Wt.target.nodeName==="IMG"?($t.current.style.display="flex",$t.current.style.width=Wt.target.clientWidth+"px",$t.current.style.height=Wt.target.clientHeight+"px",$t.current.style.top=Wt.target.offsetTop+"px",$t.current.style.left=Wt.target.offsetLeft+"px",Cn.current.src=Wt.target.getAttribute("src")):$t.current.style.display="none"};return j.a.createElement("div",{style:{position:"relative"}},j.a.createElement("div",{ref:at,style:Object(_e.a)({},ft),className:"".concat(c||""," markdown-body ").concat(Hn.a.mdBody),onMouseOver:Vn,dangerouslySetInnerHTML:{__html:Ct}}),j.a.createElement("div",{ref:$t,className:Hn.a.button},j.a.createElement(Pe.a,null,j.a.createElement(He.a,{onClick:function(){return jn()}},"\u88C1\u526A"),j.a.createElement(He.a,{onClick:function(){return Gt()}},"\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(Re.a,{close:!0,data:Vt,hasMask:Ge,type:Vt!=null&&Vt.length?ci:"",style:Object(_e.a)({},cn),onClose:function(){return dn("")}}))}},"9VGf":function(yt,qe,b){"use strict";b.d(qe,"a",function(){return Le});var Z=b("q1tI"),Pe=b.n(Z);function Le(He,_e){var ye=Object(Z.useRef)();Object(Z.useEffect)(function(){ye.current=He}),Object(Z.useEffect)(function(){function F(){ye.current()}if(_e!==null){var q=setInterval(F,_e);return function(){return clearInterval(q)}}},[_e])}},Bd2K:function(yt,qe,b){(function(Z){Z(b("VrN/"),b("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(V,se,j){if(j!=Z.Init&&j&&V.removeKeyMap("autoCloseTags"),!se)return;var Y={name:"autoCloseTags"};(typeof se!="object"||se.whenClosing!==!1)&&(Y["'/'"]=function(ke){return ye(ke)}),(typeof se!="object"||se.whenOpening!==!1)&&(Y["'>'"]=function(ke){return He(ke)}),V.addKeyMap(Y)});var Pe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Le=["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 He(V){if(V.getOption("disableInput"))return Z.Pass;for(var se=V.listSelections(),j=[],Y=V.getOption("autoCloseTags"),ke=0;kede.ch&&(he=he.slice(0,he.length-B.end+de.ch));var Q=he.toLowerCase();if(!he||B.type=="string"&&(B.end!=de.ch||!/[\"\']/.test(B.string.charAt(B.string.length-1))||B.string.length==1)||B.type=="tag"&&fe.close||B.string.indexOf("/")==de.ch-B.start-1||Ue&&F(Ue,Q)>-1||q(V,X.mode.xmlCurrentContext&&X.mode.xmlCurrentContext(z)||[],he,de,!0))return Z.Pass;var Ce=typeof Y=="object"&&Y.emptyTags;if(Ce&&F(Ce,he)>-1){j[ke]={text:"/>",newPos:Z.Pos(de.line,de.ch+2)};continue}var ce=we&&F(we,Q)>-1;j[ke]={indent:ce,text:">"+(ce?`
`:"")+""+he+">",newPos:ce?Z.Pos(de.line+1,0):Z.Pos(de.line,de.ch+1)}}for(var P=typeof Y=="object"&&Y.dontIndentOnAutoClose,ke=se.length-1;ke>=0;ke--){var le=j[ke];V.replaceRange(le.text,se[ke].head,se[ke].anchor,"+insert");var $=V.listSelections().slice(0);$[ke]={head:le.newPos,anchor:le.newPos},V.setSelections($),!P&&le.indent&&(V.indentLine(le.newPos.line,null,!0),V.indentLine(le.newPos.line+1,null,!0))}}function _e(V,se){for(var j=V.listSelections(),Y=[],ke=se?"/":"",de=V.getOption("autoCloseTags"),B=typeof de=="object"&&de.dontIndentOnSlash,X=0;X"&&(Ue+=">"),Y[X]=Ue}if(V.replaceSelections(Y),j=V.listSelections(),!B)for(var X=0;X=0&&se[z]==j;z--)++X;Y=B.to;for(var z=1;z0){for(var se=0;se1&&arguments[1]!==void 0?arguments[1]:"",se=[],j=0;jie.length)&&(W=ie.length);for(var re=0,x=new Array(W);re=ie.length?{done:!0}:{done:!1,value:ie[x++]}}}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 re=ie[Symbol.iterator](),re.next.bind(re)}function ye(ie,W){return W={exports:{}},ie(W,W.exports),W.exports}var F=ye(function(ie){function W(){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 re(x){ie.exports.defaults=x}ie.exports={defaults:W(),getDefaults:W,changeDefaults:re}}),q=F.defaults,V=F.getDefaults,se=F.changeDefaults,j=/[&<>"']/,Y=/[&<>"']/g,ke=/[<>"']|&(?!#?\w+;)/,de=/[<>"']|&(?!#?\w+;)/g,B={"&":"&","<":"<",">":">",'"':""","'":"'"},X=function(W){return B[W]};function z(ie,W){if(W){if(j.test(ie))return ie.replace(Y,X)}else if(ke.test(ie))return ie.replace(de,X);return ie}var fe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function he(ie){return ie.replace(fe,function(W,re){return re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""})}var Ne=/(^|[^\[])\^/g;function Ue(ie,W){ie=ie.source||ie,W=W||"";var re={replace:function(T,O){return O=O.source||O,O=O.replace(Ne,"$1"),ie=ie.replace(T,O),re},getRegex:function(){return new RegExp(ie,W)}};return re}var we=/[^\w:]/g,Q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ce(ie,W,re){if(ie){var x;try{x=decodeURIComponent(he(re)).replace(we,"").toLowerCase()}catch(T){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}W&&!Q.test(re)&&(re=_(W,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(T){return null}return re}var ce={},P=/^[^:]+:\/*[^/]*$/,le=/^([^:]+:)[\s\S]*$/,$=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(ie,W){ce[" "+ie]||(P.test(ie)?ce[" "+ie]=ie+"/":ce[" "+ie]=U(ie,"/",!0)),ie=ce[" "+ie];var re=ie.indexOf(":")===-1;return W.substring(0,2)==="//"?re?W:ie.replace(le,"$1")+W:W.charAt(0)==="/"?re?W:ie.replace($,"$1")+W:ie+W}var me={exec:function(){}};function ee(ie){for(var W=1,re,x;W=0&&be[Xe]==="\\";)oe=!oe;return oe?"|":" |"}),x=re.split(/ \|/),T=0;if(x.length>W)x.splice(W);else for(;x.length=x.length?T.slice(x.length):T}).join(`
`)}var Te=function(){function ie(re){this.options=re||m}var W=ie.prototype;return W.space=function(x){var T=this.rules.block.newline.exec(x);if(T)return T[0].length>1?{type:"space",raw:T[0]}:{raw:`
`}},W.code=function(x,T){var O=this.rules.block.code.exec(x);if(O){var N=T[T.length-1];if(N&&N.type==="paragraph")return{raw:O[0],text:O[0].trimRight()};var be=O[0].replace(/^ {4}/gm,"");return{type:"code",raw:O[0],codeBlockStyle:"indented",text:this.options.pedantic?be:p(be,`
`)}}},W.fences=function(x){var T=this.rules.block.fences.exec(x);if(T){var O=T[0],N=Se(O,T[3]||"");return{type:"code",raw:O,lang:T[2]?T[2].trim():T[2],text:N}}},W.heading=function(x){var T=this.rules.block.heading.exec(x);if(T)return{type:"heading",raw:T[0],depth:T[1].length,text:T[2]}},W.nptable=function(x){var T=this.rules.block.nptable.exec(x);if(T){var O={type:"table",header:A(T[1].replace(/^ *| *\| *$/g,"")),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:T[3]?T[3].replace(/\n$/,"").split(`
`):[],raw:T[0]};if(O.header.length===O.align.length){var N=O.align.length,be;for(be=0;be ?/gm,"");return{type:"blockquote",raw:T[0],text:O}}},W.list=function(x){var T=this.rules.block.list.exec(x);if(T){for(var O=T[0],N=T[2],be=N.length>1,oe=N[N.length-1]===")",Xe={type:"list",raw:O,ordered:be,start:be?+N.slice(0,-1):"",loose:!1,items:[]},ot=T[0].match(this.rules.block.item),ut=!1,st,kt,St,ct,Ft,Lt,xt,wt=ot.length,Tt=0;Tt1||this.options.smartLists&&St!==N)&&(ct=ot.slice(Tt+1).join(`
`),Xe.raw=Xe.raw.substring(0,Xe.raw.length-ct.length),Tt=wt-1)),Ft=ut||/\n\n(?!\s*$)/.test(st),Tt!==wt-1&&(ut=st.charAt(st.length-1)===`
`,Ft||(Ft=ut)),Ft&&(Xe.loose=!0),Lt=/^\[[ xX]\] /.test(st),xt=void 0,Lt&&(xt=st[1]!==" ",st=st.replace(/^\[[ xX]\] +/,"")),Xe.items.push({type:"list_item",raw:O,task:Lt,checked:xt,loose:Ft,text:st});return Xe}},W.html=function(x){var T=this.rules.block.html.exec(x);if(T)return{type:this.options.sanitize?"paragraph":"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):J(T[0]):T[0]}},W.def=function(x){var T=this.rules.block.def.exec(x);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var O=T[1].toLowerCase().replace(/\s+/g," ");return{tag:O,raw:T[0],href:T[2],title:T[3]}}},W.table=function(x){var T=this.rules.block.table.exec(x);if(T){var O={type:"table",header:A(T[1].replace(/^ *| *\| *$/g,"")),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:T[3]?T[3].replace(/\n$/,"").split(`
`):[]};if(O.header.length===O.align.length){O.raw=T[0];var N=O.align.length,be;for(be=0;be/i.test(N[0])&&(T=!1),!O&&/^<(pre|code|kbd|script)(\s|>)/i.test(N[0])?O=!0:O&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(N[0])&&(O=!1),{type:this.options.sanitize?"text":"html",raw:N[0],inLink:T,inRawBlock:O,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):J(N[0]):N[0]}},W.link=function(x){var T=this.rules.inline.link.exec(x);if(T){var O=ve(T[2],"()");if(O>-1){var N=T[0].indexOf("!")===0?5:4,be=N+T[1].length+O;T[2]=T[2].substring(0,O),T[0]=T[0].substring(0,be).trim(),T[3]=""}var oe=T[2],Xe="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(oe);ot?(oe=ot[1],Xe=ot[3]):Xe=""}else Xe=T[3]?T[3].slice(1,-1):"";oe=oe.trim().replace(/^<([\s\S]*)>$/,"$1");var ut=Re(T,{href:oe&&oe.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},T[0]);return ut}},W.reflink=function(x,T){var O;if((O=this.rules.inline.reflink.exec(x))||(O=this.rules.inline.nolink.exec(x))){var N=(O[2]||O[1]).replace(/\s+/g," ");if(N=T[N.toLowerCase()],!N||!N.href){var be=O[0].charAt(0);return{type:"text",raw:be,text:be}}var oe=Re(O,N,O[0]);return oe}},W.strong=function(x,T,O){O===void 0&&(O="");var N=this.rules.inline.strong.start.exec(x);if(N&&(!N[1]||N[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){T=T.slice(-1*x.length);var be=N[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var oe;(N=be.exec(T))!=null;)if(oe=this.rules.inline.strong.middle.exec(T.slice(0,N.index+3)),oe)return{type:"strong",raw:x.slice(0,oe[0].length),text:x.slice(2,oe[0].length-2)}}},W.em=function(x,T,O){O===void 0&&(O="");var N=this.rules.inline.em.start.exec(x);if(N&&(!N[1]||N[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){T=T.slice(-1*x.length);var be=N[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var oe;(N=be.exec(T))!=null;)if(oe=this.rules.inline.em.middle.exec(T.slice(0,N.index+2)),oe)return{type:"em",raw:x.slice(0,oe[0].length),text:x.slice(1,oe[0].length-1)}}},W.codespan=function(x){var T=this.rules.inline.code.exec(x);if(T){var O=T[2].replace(/\n/g," "),N=/[^ ]/.test(O),be=O.startsWith(" ")&&O.endsWith(" ");return N&&be&&(O=O.substring(1,O.length-1)),O=J(O,!0),{type:"codespan",raw:T[0],text:O}}},W.br=function(x){var T=this.rules.inline.br.exec(x);if(T)return{type:"br",raw:T[0]}},W.del=function(x){var T=this.rules.inline.del.exec(x);if(T)return{type:"del",raw:T[0],text:T[1]}},W.autolink=function(x,T){var O=this.rules.inline.autolink.exec(x);if(O){var N,be;return O[2]==="@"?(N=J(this.options.mangle?T(O[1]):O[1]),be="mailto:"+N):(N=J(O[1]),be=N),{type:"link",raw:O[0],text:N,href:be,tokens:[{type:"text",raw:N,text:N}]}}},W.url=function(x,T){var O;if(O=this.rules.inline.url.exec(x)){var N,be;if(O[2]==="@")N=J(this.options.mangle?T(O[0]):O[0]),be="mailto:"+N;else{var oe;do oe=O[0],O[0]=this.rules.inline._backpedal.exec(O[0])[0];while(oe!==O[0]);N=J(O[0]),O[1]==="www."?be="http://"+N:be=N}return{type:"link",raw:O[0],text:N,href:be,tokens:[{type:"text",raw:N,text:N}]}}},W.inlineText=function(x,T,O){var N=this.rules.inline.text.exec(x);if(N){var be;return T?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):J(N[0]):N[0]:be=J(this.options.smartypants?O(N[0]):N[0]),{type:"text",raw:N[0],text:be}}},ie}(),R=G.noopTest,w=G.edit,D=G.merge,S={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:R,table:R,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};S._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,S._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,S.def=w(S.def).replace("label",S._label).replace("title",S._title).getRegex(),S.bullet=/(?:[*+-]|\d{1,9}[.)])/,S.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,S.item=w(S.item,"gm").replace(/bull/g,S.bullet).getRegex(),S.list=w(S.list).replace(/bull/g,S.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+S.def.source+")").getRegex(),S._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",S._comment=//,S.html=w(S.html,"i").replace("comment",S._comment).replace("tag",S._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),S.paragraph=w(S._paragraph).replace("hr",S.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",S._tag).getRegex(),S.blockquote=w(S.blockquote).replace("paragraph",S.paragraph).getRegex(),S.normal=D({},S),S.gfm=D({},S.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*|$)"}),S.gfm.nptable=w(S.gfm.nptable).replace("hr",S.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",S._tag).getRegex(),S.gfm.table=w(S.gfm.table).replace("hr",S.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",S._tag).getRegex(),S.pedantic=D({},S.normal,{html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",S._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:R,paragraph:w(S.normal._paragraph).replace("hr",S.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",S.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var k={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:R,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:R,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",k.punctuation=w(k.punctuation).replace(/punctuation/g,k._punctuation).getRegex(),k._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",k._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",k.em.start=w(k.em.start).replace(/punctuation/g,k._punctuation).getRegex(),k.em.middle=w(k.em.middle).replace(/punctuation/g,k._punctuation).replace(/overlapSkip/g,k._overlapSkip).getRegex(),k.em.endAst=w(k.em.endAst,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.em.endUnd=w(k.em.endUnd,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.strong.start=w(k.strong.start).replace(/punctuation/g,k._punctuation).getRegex(),k.strong.middle=w(k.strong.middle).replace(/punctuation/g,k._punctuation).replace(/blockSkip/g,k._blockSkip).getRegex(),k.strong.endAst=w(k.strong.endAst,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.strong.endUnd=w(k.strong.endUnd,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.blockSkip=w(k._blockSkip,"g").getRegex(),k.overlapSkip=w(k._overlapSkip,"g").getRegex(),k._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,k._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,k._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])?)+(?![-_])/,k.autolink=w(k.autolink).replace("scheme",k._scheme).replace("email",k._email).getRegex(),k._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,k.tag=w(k.tag).replace("comment",S._comment).replace("attribute",k._attribute).getRegex(),k._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,k._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,k._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,k.link=w(k.link).replace("label",k._label).replace("href",k._href).replace("title",k._title).getRegex(),k.reflink=w(k.reflink).replace("label",k._label).getRegex(),k.reflinkSearch=w(k.reflinkSearch,"g").replace("reflink",k.reflink).replace("nolink",k.nolink).getRegex(),k.normal=D({},k),k.pedantic=D({},k.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:w(/^!?\[(label)\]\((.*?)\)/).replace("label",k._label).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",k._label).getRegex()}),k.gfm=D({},k.normal,{escape:w(k.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&&(x="x"+x.toString(16)),W+=""+x+";";return W}var ge=function(){function ie(re){this.tokens=[],this.tokens.links=Object.create(null),this.options=re||y,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:E.normal,inline:M.normal};this.options.pedantic?(x.block=E.pedantic,x.inline=M.pedantic):this.options.gfm&&(x.block=E.gfm,this.options.breaks?x.inline=M.breaks:x.inline=M.gfm),this.tokenizer.rules=x}ie.lex=function(x,T){var O=new ie(T);return O.lex(x)};var W=ie.prototype;return W.lex=function(x){return x=x.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(x,this.tokens,!0),this.inline(this.tokens),this.tokens},W.blockTokens=function(x,T,O){T===void 0&&(T=[]),O===void 0&&(O=!0),x=x.replace(/^ +$/gm,"");for(var N,be,oe,Xe;x;){if(N=this.tokenizer.space(x)){x=x.substring(N.raw.length),N.type&&T.push(N);continue}if(N=this.tokenizer.code(x,T)){x=x.substring(N.raw.length),N.type?T.push(N):(Xe=T[T.length-1],Xe.raw+=`
`+N.raw,Xe.text+=`
`+N.text);continue}if(N=this.tokenizer.fences(x)){x=x.substring(N.raw.length),T.push(N);continue}if(N=this.tokenizer.heading(x)){x=x.substring(N.raw.length),T.push(N);continue}if(N=this.tokenizer.nptable(x)){x=x.substring(N.raw.length),T.push(N);continue}if(N=this.tokenizer.hr(x)){x=x.substring(N.raw.length),T.push(N);continue}if(N=this.tokenizer.blockquote(x)){x=x.substring(N.raw.length),N.tokens=this.blockTokens(N.text,[],O),T.push(N);continue}if(N=this.tokenizer.list(x)){for(x=x.substring(N.raw.length),oe=N.items.length,be=0;be0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Xe))!=null;)ut.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Xe=Xe.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Xe))!=null;)Xe=Xe.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;x;){if(oe=this.tokenizer.escape(x)){x=x.substring(oe.raw.length),T.push(oe);continue}if(oe=this.tokenizer.tag(x,O,N)){x=x.substring(oe.raw.length),O=oe.inLink,N=oe.inRawBlock,T.push(oe);continue}if(oe=this.tokenizer.link(x)){x=x.substring(oe.raw.length),oe.type==="link"&&(oe.tokens=this.inlineTokens(oe.text,[],!0,N)),T.push(oe);continue}if(oe=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(oe.raw.length),oe.type==="link"&&(oe.tokens=this.inlineTokens(oe.text,[],!0,N)),T.push(oe);continue}if(oe=this.tokenizer.strong(x,Xe,be)){x=x.substring(oe.raw.length),oe.tokens=this.inlineTokens(oe.text,[],O,N),T.push(oe);continue}if(oe=this.tokenizer.em(x,Xe,be)){x=x.substring(oe.raw.length),oe.tokens=this.inlineTokens(oe.text,[],O,N),T.push(oe);continue}if(oe=this.tokenizer.codespan(x)){x=x.substring(oe.raw.length),T.push(oe);continue}if(oe=this.tokenizer.br(x)){x=x.substring(oe.raw.length),T.push(oe);continue}if(oe=this.tokenizer.del(x)){x=x.substring(oe.raw.length),oe.tokens=this.inlineTokens(oe.text,[],O,N),T.push(oe);continue}if(oe=this.tokenizer.autolink(x,I)){x=x.substring(oe.raw.length),T.push(oe);continue}if(!O&&(oe=this.tokenizer.url(x,I))){x=x.substring(oe.raw.length),T.push(oe);continue}if(oe=this.tokenizer.inlineText(x,N,ue)){x=x.substring(oe.raw.length),be=oe.raw.slice(-1),T.push(oe);continue}if(x){var st="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return T},Pe(ie,null,[{key:"rules",get:function(){return{block:E,inline:M}}}]),ie}(),Oe=F.defaults,Ie=G.cleanUrl,ze=G.escape,Be=function(){function ie(re){this.options=re||Oe}var W=ie.prototype;return W.code=function(x,T,O){var N=(T||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(x,N);be!=null&&be!==x&&(O=!0,x=be)}return N?''+(O?x:ze(x,!0))+`
`:""+(O?x:ze(x,!0))+`
`},W.blockquote=function(x){return`
`+x+`
`},W.html=function(x){return x},W.heading=function(x,T,O,N){return this.options.headerIds?"
`:""+x+"
`},W.hr=function(){return this.options.xhtml?`
`:`
`},W.list=function(x,T,O){var N=T?"ol":"ul",be=T&&O!==1?' start="'+O+'"':"";return"<"+N+be+`>
`+x+""+N+`>
`},W.listitem=function(x){return""+x+`
`},W.checkbox=function(x){return" "},W.paragraph=function(x){return""+x+`
`},W.table=function(x,T){return T&&(T=""+T+""),`
`},W.tablerow=function(x){return`
`+x+`
`},W.tablecell=function(x,T){var O=T.header?"th":"td",N=T.align?"<"+O+' align="'+T.align+'">':"<"+O+">";return N+x+""+O+`>
`},W.strong=function(x){return""+x+""},W.em=function(x){return""+x+""},W.codespan=function(x){return""+x+""},W.br=function(){return this.options.xhtml?"
":"
"},W.del=function(x){return""+x+""},W.link=function(x,T,O){if(x=Ie(this.options.sanitize,this.options.baseUrl,x),x===null)return O;var N='"+O+"",N},W.image=function(x,T,O){if(x=Ie(this.options.sanitize,this.options.baseUrl,x),x===null)return O;var N='
":">",N},W.text=function(x){return x},ie}(),Fe=function(){function ie(){}var W=ie.prototype;return W.strong=function(x){return x},W.em=function(x){return x},W.codespan=function(x){return x},W.del=function(x){return x},W.html=function(x){return x},W.text=function(x){return x},W.link=function(x,T,O){return""+O},W.image=function(x,T,O){return""+O},W.br=function(){return""},ie}(),nt=function(){function ie(){this.seen={}}var W=ie.prototype;return W.slug=function(x){var T=x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(T)){var O=T;do this.seen[O]++,T=O+"-"+this.seen[O];while(this.seen.hasOwnProperty(T))}return this.seen[T]=0,T},ie}(),pe=F.defaults,De=G.unescape,je=function(){function ie(re){this.options=re||pe,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fe,this.slugger=new nt}ie.parse=function(x,T){var O=new ie(T);return O.parse(x)};var W=ie.prototype;return W.parse=function(x,T){T===void 0&&(T=!0);var O="",N,be,oe,Xe,ot,ut,st,kt,St,ct,Ft,Lt,xt,wt,Tt,Bt,qt,vt,bn=x.length;for(N=0;N0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=vt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=vt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:vt}):wt+=vt),wt+=this.parse(Tt.tokens,xt),St+=this.renderer.listitem(wt,qt,Bt);O+=this.renderer.list(St,Ft,Lt);continue}case"html":{O+=this.renderer.html(ct.text);continue}case"paragraph":{O+=this.renderer.paragraph(this.parseInline(ct.tokens));continue}case"text":{for(St=ct.tokens?this.parseInline(ct.tokens):ct.text;N+1An error occurred:"+Ve(oe.message+"",!0)+"
";throw oe}}Ae.options=Ae.setOptions=function(ie){return Ke(Ae.defaults,ie),et(Ae.defaults),Ae},Ae.getDefaults=xe,Ae.defaults=Ze,Ae.use=function(ie){var W=Ke({},ie);if(ie.renderer&&function(){var x=Ae.defaults.renderer||new Be,T=function(be){var oe=x[be];x[be]=function(){for(var Xe=arguments.length,ot=new Array(Xe),ut=0;ut`,triples:"",explode:"[]{}"},Le=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(B,X,z){z&&z!=Z.Init&&(B.removeKeyMap(_e),B.state.closeBrackets=null),X&&(ye(He(X,"pairs")),B.state.closeBrackets=X,B.addKeyMap(_e))});function He(B,X){return X=="pairs"&&typeof B=="string"?B:typeof B=="object"&&B[X]!=null?B[X]:Pe[X]}var _e={Backspace:V,Enter:se};function ye(B){for(var X=0;X=0;he--){var Ue=fe[he].head;B.replaceRange("",Le(Ue.line,Ue.ch-1),Le(Ue.line,Ue.ch+1),"+delete")}}function se(B){var X=q(B),z=X&&He(X,"explode");if(!z||B.getOption("disableInput"))return Z.Pass;for(var fe=B.listSelections(),he=0;he0;return{anchor:new Le(B.anchor.line,B.anchor.ch+(X?-1:1)),head:new Le(B.head.line,B.head.ch+(X?1:-1))}}function Y(B,X){var z=q(B);if(!z||B.getOption("disableInput"))return Z.Pass;var fe=He(z,"pairs"),he=fe.indexOf(X);if(he==-1)return Z.Pass;for(var Ne=He(z,"closeBefore"),Ue=He(z,"triples"),we=fe.charAt(he+1)==X,Q=B.listSelections(),Ce=he%2==0,ce,P=0;P=0&&B.getRange($,Le($.line,$.ch+3))==X+X+X?_="skipThree":_="skip";else if(we&&$.ch>1&&Ue.indexOf(X)>=0&&B.getRange(Le($.line,$.ch-2),$)==X+X){if($.ch>2&&/\bstring/.test(B.getTokenTypeAt(Le($.line,$.ch-2))))return Z.Pass;_="addFour"}else if(we){var ee=$.ch==0?" ":B.getRange(Le($.line,$.ch-1),$);if(!Z.isWordChar(me)&&ee!=X&&!Z.isWordChar(ee))_="both";else return Z.Pass}else if(Ce&&(me.length===0||/\s/.test(me)||Ne.indexOf(me)>-1))_="both";else return Z.Pass;if(!ce)ce=_;else if(ce!=_)return Z.Pass}var L=he%2?fe.charAt(he-1):X,U=he%2?X:fe.charAt(he+1);B.operation(function(){if(ce=="skip")B.execCommand("goCharRight");else if(ce=="skipThree")for(var ae=0;ae<3;ae++)B.execCommand("goCharRight");else if(ce=="surround"){for(var K=B.getSelections(),ae=0;ae0&&(ve.percent=ve.loaded/ve.total*100),G.onProgress(ve)});var p=new FormData;G.data&&Object.keys(G.data).forEach(function(J){var ve=G.data[J];if(Array.isArray(ve)){ve.forEach(function(Re){p.append(J+"[]",Re)});return}p.append(J,G.data[J])}),G.file instanceof Blob?p.append(G.filename,G.file,G.file.name):p.append(G.filename,G.file),m.onerror=function(ve){G.onError(ve)},m.onload=function(){return m.status<200||m.status>=300?G.onError(_e(G,m),ye(m)):G.onSuccess(ye(m),m)},m.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in m&&(m.withCredentials=!0);var A=G.headers||{};return A["X-Requested-With"]!==null&&m.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(A).forEach(function(J){A[J]!==null&&m.setRequestHeader(J,A[J])}),m.send(p),{abort:function(){m.abort()}}}var q=+new Date,V=0;function se(){return"rc-upload-"+q+"-"+ ++V}function j(G,m){return G.indexOf(m,G.length-m.length)!==-1}var Y=function(G,m){if(G&&m){var p=Array.isArray(m)?m:m.split(","),A=G.name||"",J=G.type||"",ve=J.replace(/\/.*$/,"");return p.some(function(Re){var Se=Re.trim();return Se.charAt(0)==="."?j(A.toLowerCase(),Se.toLowerCase()):/\/\*$/.test(Se)?ve===Se.replace(/\/.*$/,""):J===Se})}return!0};function ke(G,m){var p=G.createReader(),A=[];function J(){p.readEntries(function(ve){var Re=Array.prototype.slice.apply(ve);A=A.concat(Re);var Se=!Re.length;Se?m(A):J()})}J()}var de=function(m,p,A){var J=function ve(Re,Se){Se=Se||"",Re.isFile?Re.file(function(Te){A(Te)&&(Re.fullPath&&!Te.webkitRelativePath&&(Object.defineProperties(Te,{webkitRelativePath:{writable:!0}}),Te.webkitRelativePath=Re.fullPath.replace(/^\//,""),Object.defineProperties(Te,{webkitRelativePath:{writable:!1}})),p([Te]))}):Re.isDirectory&&ke(Re,function(Te){Te.forEach(function(R){ve(R,""+Se+Re.name+"/")})})};m.forEach(function(ve){J(ve.webkitGetAsEntry())})},B=de,X=Object.assign||function(G){for(var m=1;m=0)continue;if(!Object.prototype.hasOwnProperty.call(G,A))continue;p[A]=G[A]}return p}function Ue(G,m){if(!(G instanceof m))throw new TypeError("Cannot call a class as a function")}function we(G,m){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:G}function Q(G,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);G.prototype=Object.create(m&&m.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(G,m):G.__proto__=m)}var Ce=function(m){return Object.keys(m).reduce(function(p,A){return(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-"||A==="role")&&(p[A]=m[A]),p},{})},ce=function(G){Q(m,G);function m(){var p,A,J,ve;Ue(this,m);for(var Re=arguments.length,Se=Array(Re),Te=0;Te1&&arguments[1]!==void 0?arguments[1]:1,re=Fe.length,x=0;x1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ce.a)(p).map(function(J,ve){if(!_e.isValidElement(J)||!J.type)return null;var Re=J.type.isSelectOptGroup,Se=J.key,Te=J.props,R=Te.children,w=Object(F.a)(Te,["children"]);return A||!Re?ce(J):Object(Q.a)(Object(Q.a)({key:"__RC_SELECT_GRP__".concat(Se===null?ve:Se,"__"),label:Se},w),{},{options:P(R)})}).filter(function(J){return J})}var le=b("2Qr1"),$=b("qNPg"),_=b("U8pU"),me=b("Kwbf"),ee=b("WKfj");function L(p){var A=p.mode,J=p.options,ve=p.children,Re=p.backfill,Se=p.allowClear,Te=p.placeholder,R=p.getInputElement,w=p.showSearch,D=p.onSearch,S=p.defaultOpen,k=p.autoFocus,v=p.labelInValue,y=p.value,E=p.inputValue,M=p.optionLabelProp,ue=A==="multiple"||A==="tags",I=w!==void 0?w:ue||A==="combobox",ge=J||P(ve);if(Object(me.a)(A!=="tags"||ge.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),A==="tags"||A==="combobox"){var Oe=ge.some(function(Be){return Be.options?Be.options.some(function(Fe){return typeof("value"in Fe?Fe.value:Fe.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(me.a)(!Oe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(me.a)(A!=="combobox"||!M,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(me.a)(A==="combobox"||!Re,"`backfill` only works with `combobox` mode."),Object(me.a)(A==="combobox"||!R,"`getInputElement` only work with `combobox` mode."),Object(me.b)(A!=="combobox"||!R||!Se||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),D&&!I&&A!=="combobox"&&A!=="tags"&&Object(me.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(me.b)(!S||k,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),y!=null){var Ie=Object(ee.d)(y);Object(me.a)(!v||Ie.every(function(Be){return Object(_.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(me.a)(!ue||Array.isArray(y),"`value` should be array when `mode` is `multiple` or `tags`")}if(ve){var ze=null;Object(Ce.a)(ve).some(function(Be){if(!_e.isValidElement(Be)||!Be.type)return!1;var Fe=Be.type;if(Fe.isSelectOption)return!1;if(Fe.isSelectOptGroup){var nt=Object(Ce.a)(Be.props.children).every(function(pe){return!_e.isValidElement(pe)||!Be.type||pe.type.isSelectOption?!0:(ze=pe.type,!1)});return!nt}return ze=Fe,!0}),ze&&Object(me.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ze.displayName||ze.name||ze,"`.")),Object(me.a)(E===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=L,ae=Object($.a)({prefixCls:"rc-select",components:{optionList:fe},convertChildrenToData:P,flattenOptions:le.d,getLabeledValue:le.e,filterOptions:le.b,isValueDisabled:le.g,findValueOption:le.c,warningProps:U,fillOptionsWithMissingValue:le.a}),K=function(p){Object(Le.a)(J,p);var A=Object(He.a)(J);function J(){var ve;return Object(Z.a)(this,J),ve=A.apply(this,arguments),ve.selectRef=_e.createRef(),ve.focus=function(){ve.selectRef.current.focus()},ve.blur=function(){ve.selectRef.current.blur()},ve}return Object(Pe.a)(J,[{key:"render",value:function(){return _e.createElement(ae,Object.assign({ref:this.selectRef},this.props))}}]),J}(_e.Component);K.Option=Ne,K.OptGroup=we;var G=K,m=qe.c=G},M8RZ:function(yt,qe,b){"use strict";b.d(qe,"a",function(){return V});var Z=b("fWQN"),Pe=b("mtLc"),Le=b("yKVA"),He=b("879j"),_e=b("q1tI"),ye=b.n(_e),F=b("i8i4"),q=b.n(F),V=function(se){Object(Le.a)(Y,se);var j=Object(He.a)(Y);function Y(ke){var de;Object(Z.a)(this,Y),de=j.call(this,ke);var B=window.document;return de.node=B.createElement("div"),B.body.appendChild(de.node),de}return Object(Pe.a)(Y,[{key:"render",value:function(){var de=this.props.children;return Object(F.createPortal)(de,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),Y}(ye.a.Component)},NvD2:function(yt,qe,b){"use strict";b.d(qe,"a",function(){return ye});var Z=b("Kwbf");function Pe(F,q){var V=new Set;return F.forEach(function(se){q.has(se)||V.add(se)}),V}function Le(F){var q=F||{},V=q.disabled,se=q.disableCheckbox,j=q.checkable;return!!(V||se)||j===!1}function He(F,q,V,se){for(var j=new Set(F),Y=new Set,ke=0;ke<=V;ke+=1){var de=q.get(ke)||new Set;de.forEach(function(fe){var he=fe.key,Ne=fe.node,Ue=fe.children,we=Ue===void 0?[]:Ue;j.has(he)&&!se(Ne)&&we.filter(function(Q){return!se(Q.node)}).forEach(function(Q){j.add(Q.key)})})}for(var B=new Set,X=V;X>=0;X-=1){var z=q.get(X)||new Set;z.forEach(function(fe){var he=fe.parent,Ne=fe.node;if(se(Ne)||!fe.parent||B.has(fe.parent.key))return;if(se(fe.parent.node)){B.add(he.key);return}var Ue=!0,we=!1;(he.children||[]).filter(function(Q){return!se(Q.node)}).forEach(function(Q){var Ce=Q.key,ce=j.has(Ce);Ue&&!ce&&(Ue=!1),!we&&(ce||Y.has(Ce))&&(we=!0)}),Ue&&j.add(he.key),we&&Y.add(he.key),B.add(he.key)})}return{checkedKeys:Array.from(j),halfCheckedKeys:Array.from(Pe(Y,j))}}function _e(F,q,V,se,j){for(var Y=new Set(F),ke=new Set(q),de=0;de<=se;de+=1){var B=V.get(de)||new Set;B.forEach(function(he){var Ne=he.key,Ue=he.node,we=he.children,Q=we===void 0?[]:we;!Y.has(Ne)&&!ke.has(Ne)&&!j(Ue)&&Q.filter(function(Ce){return!j(Ce.node)}).forEach(function(Ce){Y.delete(Ce.key)})})}ke=new Set;for(var X=new Set,z=se;z>=0;z-=1){var fe=V.get(z)||new Set;fe.forEach(function(he){var Ne=he.parent,Ue=he.node;if(j(Ue)||!he.parent||X.has(he.parent.key))return;if(j(he.parent.node)){X.add(Ne.key);return}var we=!0,Q=!1;(Ne.children||[]).filter(function(Ce){return!j(Ce.node)}).forEach(function(Ce){var ce=Ce.key,P=Y.has(ce);we&&!P&&(we=!1),!Q&&(P||ke.has(ce))&&(Q=!0)}),we||Y.delete(Ne.key),Q&&ke.add(Ne.key),X.add(Ne.key)})}return{checkedKeys:Array.from(Y),halfCheckedKeys:Array.from(Pe(ke,Y))}}function ye(F,q,V,se){var j=[],Y;se?Y=se:Y=Le;var ke=new Set(F.filter(function(z){var fe=!!V[z];return fe||j.push(z),fe})),de=new Map,B=0;Object.keys(V).forEach(function(z){var fe=V[z],he=fe.level,Ne=de.get(he);Ne||(Ne=new Set,de.set(he,Ne)),Ne.add(fe),B=Math.max(B,he)}),Object(Z.a)(!j.length,"Tree missing follow keys: ".concat(j.slice(0,100).map(function(z){return"'".concat(z,"'")}).join(", ")));var X;return q===!0?X=He(ke,de,B,Y):X=_e(ke,q.halfCheckedKeys,de,B,Y),X}},OLES:function(yt,qe,b){"use strict";var Z=b("U8pU"),Pe=b("VTBJ"),Le=b("Ff2n"),He=b("q1tI"),_e=b("uciX"),ye=b("7ixt"),F=function(ke){var de=ke.overlay,B=ke.prefixCls,X=ke.id,z=ke.overlayInnerStyle;return He.createElement("div",{className:"".concat(B,"-inner"),id:X,role:"tooltip",style:z},typeof de=="function"?de():de)},q=F,V=function(ke,de){var B=ke.overlayClassName,X=ke.trigger,z=X===void 0?["hover"]:X,fe=ke.mouseEnterDelay,he=fe===void 0?0:fe,Ne=ke.mouseLeaveDelay,Ue=Ne===void 0?.1:Ne,we=ke.overlayStyle,Q=ke.prefixCls,Ce=Q===void 0?"rc-tooltip":Q,ce=ke.children,P=ke.onVisibleChange,le=ke.afterVisibleChange,$=ke.transitionName,_=ke.animation,me=ke.placement,ee=me===void 0?"right":me,L=ke.align,U=L===void 0?{}:L,ae=ke.destroyTooltipOnHide,K=ae===void 0?!1:ae,G=ke.defaultVisible,m=ke.getTooltipContainer,p=ke.overlayInnerStyle,A=Object(Le.a)(ke,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),J=Object(He.useRef)(null);Object(He.useImperativeHandle)(de,function(){return J.current});var ve=Object(Pe.a)({},A);"visible"in ke&&(ve.popupVisible=ke.visible);var Re=function(){var D=ke.arrowContent,S=D===void 0?null:D,k=ke.overlay,v=ke.id;return[He.createElement("div",{className:"".concat(Ce,"-arrow"),key:"arrow"},S),He.createElement(q,{key:"content",prefixCls:Ce,id:v,overlay:k,overlayInnerStyle:p})]},Se=!1,Te=!1;if(typeof K=="boolean")Se=K;else if(K&&Object(Z.a)(K)==="object"){var R=K.keepParent;Se=R===!0,Te=R===!1}return He.createElement(_e.a,Object.assign({popupClassName:B,prefixCls:Ce,popup:Re,action:z,builtinPlacements:ye.a,popupPlacement:ee,ref:J,popupAlign:U,getPopupContainer:m,onPopupVisibleChange:P,afterPopupVisibleChange:le,popupTransitionName:$,popupAnimation:_,defaultPopupVisible:G,destroyPopupOnHide:Se,autoDestroy:Te,mouseLeaveDelay:Ue,popupStyle:we,mouseEnterDelay:he},ve),ce)},se=Object(He.forwardRef)(V),j=qe.a=se},OZM5:function(yt,qe,b){"use strict";b.d(qe,"b",function(){return se}),b.d(qe,"a",function(){return j}),b.d(qe,"k",function(){return Y}),b.d(qe,"h",function(){return ke}),b.d(qe,"i",function(){return de}),b.d(qe,"g",function(){return B}),b.d(qe,"c",function(){return X}),b.d(qe,"d",function(){return z}),b.d(qe,"j",function(){return Ne}),b.d(qe,"e",function(){return Ue}),b.d(qe,"f",function(){return we});var Z=b("KQm4"),Pe=b("U8pU"),Le=b("Ff2n"),He=b("q1tI"),_e=b.n(He),ye=b("Kwbf"),F=b("WaYH"),q=.25,V=2;function se(Q,Ce){var ce=Q.slice(),P=ce.indexOf(Ce);return P>=0&&ce.splice(P,1),ce}function j(Q,Ce){var ce=Q.slice();return ce.indexOf(Ce)===-1&&ce.push(Ce),ce}function Y(Q){return Q.split("-")}function ke(Q,Ce){return"".concat(Q,"-").concat(Ce)}function de(Q){return Q&&Q.type&&Q.type.isTreeNode}function B(Q,Ce){var ce=[Q],P=Ce[Q];function le(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];$.forEach(function(_){var me=_.key,ee=_.children;ce.push(me),le(ee)})}return le(P.children),ce}function X(Q,Ce){var ce=Q.clientY,P=Ce.selectHandle.getBoundingClientRect(),le=P.top,$=P.bottom,_=P.height,me=Math.max(_*q,V);return ce<=le+me?-1:ce>=$-me?1:0}function z(Q,Ce){if(!Q)return;var ce=Ce.multiple;return ce?Q.slice():Q.length?[Q[0]]:Q}var fe=function(Ce){return Ce};function he(Q,Ce){if(!Q)return[];var ce=Ce||{},P=ce.processProps,le=P===void 0?fe:P,$=Array.isArray(Q)?Q:[Q];return $.map(function(_){var me=_.children,ee=Object(Le.a)(_,["children"]),L=he(me,Ce);return _e.a.createElement(F.a,Object.assign({},le(ee)),L)})}function Ne(Q){if(!Q)return null;var Ce;if(Array.isArray(Q))Ce={checkedKeys:Q,halfCheckedKeys:void 0};else if(Object(Pe.a)(Q)==="object")Ce={checkedKeys:Q.checked||void 0,halfCheckedKeys:Q.halfChecked||void 0};else return Object(ye.a)(!1,"`checkedKeys` is not an array or an object"),null;return Ce}function Ue(Q,Ce){var ce=new Set;function P(le){if(ce.has(le))return;var $=Ce[le];if(!$)return;ce.add(le);var _=$.parent,me=$.node;if(me.disabled)return;_&&P(_.key)}return(Q||[]).forEach(function(le){P(le)}),Object(Z.a)(ce)}function we(Q){var Ce={};return Object.keys(Q).forEach(function(ce){(ce.startsWith("data-")||ce.startsWith("aria-"))&&(Ce[ce]=Q[ce])}),Ce}},Ot1p:function(yt,qe,b){"use strict";var Z=b("2qtc"),Pe=b("kLXV"),Le=b("rAM+"),He=b("miYZ"),_e=b("tsqr"),ye=b("9og8"),F=b("tJVT"),q=b("jrin"),V=b("WmNS"),se=b.n(V),j=b("q1tI"),Y=b.n(j),ke=b("VrN/"),de=b.n(ke),B=b("bdgK"),X=b("p77/"),z=b("Bd2K"),fe=b("ELLl"),he=b("19Vz"),Ne=b("lZu9"),Ue=b("+NIl"),we=b("kSUc"),Q=b("9Bee"),Ce=function(oe){var Xe=oe.value,ot=Xe===void 0?"":Xe,ut=oe.className,st=oe.showTextOnly,kt=oe.showLines,St=oe.style,ct=St===void 0?{}:St,Ft=Object(j.useMemo)(function(){return""},[ot]);return Y.a.createElement(Y.a.Fragment,null,Y.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ft}}))},ce=b("0Owb"),P=b("dejd"),le=b("C+DQ"),$=b("1vsH"),_=b("m3rI"),me=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function ee(oe){var Xe=oe.onActionCallback,ot=oe.title,ut=oe.icon,st=oe.actionName,kt=oe.className,St=kt===void 0?"":kt,ct=oe.children;function Ft(){Xe(st)}return Y.a.createElement("a",{title:ot,className:St,onClick:Ft},Y.a.createElement("i",{className:"md-iconfont ".concat(ut)}),ct)}var L=function(oe){var Xe=oe.watch,ot=oe.showNullButton,ut=oe.onActionCallback,st=oe.fullScreen,kt=oe.insertTemp,St=oe.hidetoolBar,ct=oe.uuid,Ft=oe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object($.D)("_educoder_session_login"),"&_educoder_session=").concat(Object($.D)("_educoder_session"),"&key=").concat(ct,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var Lt=[].concat(me,[{title:"".concat(Xe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Xe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return Y.a.createElement("ul",{className:"markdown-toolbar-container"},!St&&Lt.map(function(xt,wt){return Y.a.createElement("li",{key:wt},xt.actionName?Y.a.createElement(ee,Object(ce.a)({},xt,{onActionCallback:ut})):Y.a.createElement("span",{className:"v-line"}))}),ot?Y.a.createElement("li",null,Y.a.createElement(ee,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ut},Y.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&Y.a.createElement("li",null,Y.a.createElement(ee,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:ut},Y.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Y.a.createElement("li",{className:"btn-full-screen"},Y.a.createElement(ee,{icon:"".concat(st?"icon-shrink":"icon-enlarge"),title:st?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ut})))},U=b("M8RZ"),ae=b("+L6B"),K=b("2/Rp"),G=b("y8nQ"),m=b("Vl3Y"),p=b("5NDa"),A=b("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},ve=function(oe){var Xe=oe.callback,ot=oe.onCancel;function ut(st){Xe(st)}return Y.a.createElement(m.a,Object(ce.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut}),Y.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},Y.a.createElement(A.a,null)),Y.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},Y.a.createElement(A.a,null)),Y.a.createElement("div",{className:"flex-container flex-end"},Y.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Y.a.createElement(K.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},Re=b("7ahc"),Se=b("k1fw"),Te=b("HmJG"),R=b("BjJ7"),w=m.a.useForm,D={width:280,marginRight:10},S={labelCol:{span:5},wrapperCol:{span:19}},k=function(oe){var Xe=oe.callback,ot=oe.onCancel,ut=w(),st=Object(F.a)(ut,1),kt=st[0],St=Object(j.useRef)();function ct(xt){Xe(Object(Se.a)(Object(Se.a)({},xt),{},{name:St.current}))}function Ft(xt,wt){kt.setFieldsValue({src:"/api/attachments/".concat(xt.id,"?type=").concat(xt.content_type),type:wt.type})}function Lt(xt){var wt=xt.target.files[0];St.current=wt.name,y(wt,Ft)}return Y.a.createElement(m.a,Object(ce.a)({form:kt},S,{className:"upload-image-panel",onFinish:ct}),Y.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},Y.a.createElement("div",{className:"flex-container"},Y.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},Y.a.createElement(A.a,{style:D})),Y.a.createElement(v,{onFileChange:Lt}))),Y.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},Y.a.createElement(A.a,{style:{width:264}})),Y.a.createElement(m.a.Item,{style:{textAlign:"right"}},Y.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Y.a.createElement(K.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))};function v(oe){var Xe=oe.onFileChange;return Y.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",Y.a.createElement("input",{type:"file",onChange:Xe}))}function y(oe,Xe){if(!oe)throw new String("\u6CA1\u6709\u6587\u4EF6");var ot=new FormData;ot.append("editormd-image-file",oe),ot.append("file_param_name","editormd-image-file"),ot.append("byxhr","true");var ut=new window.XMLHttpRequest;ut.withCredentials=!0,ut.addEventListener("load",function(st){Xe(JSON.parse(st.target.responseText),oe)},!1),ut.addEventListener("error",function(st){console.error(st)},!1),ut.open("POST","".concat(R.a,"/api/attachments.json")),ut.send(ot)}var E=b("giR+"),M=b("fyUT"),ue=b("7Kak"),I=b("9yH6"),ge=I.a.Group,Oe={margin:"0 8px"},Ie=function(oe){var Xe=oe.callback,ot=oe.onCancel;function ut(st){Xe(st)}return Y.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},Y.a.createElement("div",{className:"flex-container"},Y.a.createElement("span",{style:Oe},"\u5355\u5143\u683C\u6570\uFF1A"),Y.a.createElement("span",{style:Oe},"\u884C\u6570"),Y.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},Y.a.createElement(M.a,null)),Y.a.createElement("span",{style:Oe},"\u5217\u6570"),Y.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},Y.a.createElement(M.a,null))),Y.a.createElement("div",{className:"flex-container",style:{marginTop:12}},Y.a.createElement("span",{style:Oe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),Y.a.createElement(m.a.Item,{name:"align"},Y.a.createElement(ge,null,Y.a.createElement(I.a,{value:"default"},Y.a.createElement("i",{className:"fa fa-align-justify"})),Y.a.createElement(I.a,{value:"left"},Y.a.createElement("i",{className:"fa fa-align-left"})),Y.a.createElement(I.a,{value:"center"},Y.a.createElement("i",{className:"fa fa-align-center"})),Y.a.createElement(I.a,{value:"right"},Y.a.createElement("i",{className:"fa fa-align-right"}))))),Y.a.createElement("div",{className:"flex-container flex-end"},Y.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Y.a.createElement(K.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},ze=b("ErOA"),Be=b("7Cbv"),Fe="link",nt="upload-image",pe="code-block",De="add-table",je="------------",Ke={default:je,left:":".concat(je),center:":".concat(je,":"),right:"".concat(je,":")},Ye=b("9VGf"),Ve,xe;function et(){}var Ze=0,Ae=1e4,We="\u2581",ie=`
**\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 W(oe){return/^\d+$/.test(oe)?"".concat(oe,"px"):oe}var re=navigator.platform.toUpperCase().indexOf("MAC")>=0,x=re?"Cmd":"Ctrl",T=["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=(Ve={},Object(q.a)(Ve,x+"-B","bold"),Object(q.a)(Ve,x+"-I","italic"),Ve),N=(xe={},Object(q.a)(xe,Fe,"\u6DFB\u52A0\u94FE\u63A5"),Object(q.a)(xe,pe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(q.a)(xe,nt,"\u6DFB\u52A0\u6587\u4EF6"),Object(q.a)(xe,De,"\u6DFB\u52A0\u8868\u683C"),xe),be=qe.a=function(oe){var Xe=oe.defaultValue,ot=Xe===void 0?"":Xe,ut=oe.onChange,st=oe.width,kt=st===void 0?"100%":st,St=oe.height,ct=St===void 0?400:St,Ft=oe.miniToolbar,Lt=Ft===void 0?!1:Ft,xt=oe.isFocus,wt=xt===void 0?!1:xt,Tt=oe.watch,Bt=oe.insertTemp,qt=oe.mode,vt=qt===void 0?"markdown":qt,bn=oe.id,jt=bn===void 0?"markdown-editor-id":bn,Zt=oe.showResizeBar,pn=Zt===void 0?!1:Zt,en=oe.noStorage,En=en===void 0?!1:en,Pt=oe.showNullButton,pt=Pt===void 0?!1:Pt,on=oe.hidetoolBar,An=on===void 0?!1:on,Sn=oe.fullScreen,Rt=Sn===void 0?!1:Sn,yn=oe.onBlur,un=oe.onCMBeforeChange,ei=oe.onFullScreen,Qe=oe.className,_t=Qe===void 0?"":Qe,Hn=oe.disablePaste,zn=Hn===void 0?!1:Hn,Yn=oe.placeholder,Jn=Yn===void 0?"":Yn,d=oe.values,o=d===void 0?"":d,a=Object(j.useState)(null),u=Object(F.a)(a,2),h=u[0],c=u[1],te=Object(j.useState)(ot),$e=Object(F.a)(te,2),it=$e[0],lt=$e[1],Ge=Object(j.useState)(Tt),gt=Object(F.a)(Ge,2),ft=gt[0],Nt=gt[1],cn=Object(j.useState)(Rt),tn=Object(F.a)(cn,2),$t=tn[0],Cn=tn[1],Kn=Object(j.useState)(""),mn=Object(F.a)(Kn,2),Vt=mn[0],dn=mn[1],Zn=Object(j.useState)(0),gn=Object(F.a)(Zn,2),ci=gn[0],xn=gn[1],jn=Object(j.useState)(ct),Gt=Object(F.a)(jn,2),Ct=Gt[0],at=Gt[1],vn=Object(j.useState)(!1),nn=Object(F.a)(vn,2),Vn=nn[0],an=nn[1],Wt=Object(j.useRef)(Object(Be.a)()),kn=Object(j.useRef)(!1),It=Object(j.useRef)(),hn=Object(j.useRef)(),zt=Object(j.useRef)(),Gn=Object(j.useRef)(),ln=Object(j.useRef)(),_n=function(){var Et=Object(ye.a)(se.a.mark(function Dt(){var At,Ht;return se.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Object(ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Wt.current}});case 2:Ht=rn.sent,Ht!=null&&(At=Ht.attachments)!==null&&At!==void 0&&At.length&&(console.log("cm:",h,hn),Ht.attachments.map(function(Xt){Xt.content_type.indexOf("image")>-1?h.replaceSelection(".concat(Xt.content_type,")")):Xt.content_type.indexOf("video")>-1?h.replaceSelection('')):Xt.content_type.indexOf("pdf")>-1?h.replaceSelection('').concat(Xt.name,"")):h.replaceSelection("[".concat(Xt.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}));case 4:case"end":return rn.stop()}},Dt)}));return function(){return Et.apply(this,arguments)}}();Object(j.useEffect)(function(){lt(o),h==null||h.setValue(o)},[o]),Object(j.useEffect)(function(){ei==null||ei($t)},[$t]),Object(j.useEffect)(function(){if(hn.current){var Et=de.a.fromTextArea(hn.current,{mode:vt,lineNumbers:!Lt,lineWrapping:!0,value:ot,autoCloseTags:!0,autoCloseBrackets:!0});wt&&Et.focus();function Dt(At,Ht){if(zn){Ht.preventDefault();return}var Yt=Ht.clipboardData;if(Yt){var rn=Yt.types.toString(),Xt=Yt.items;if(rn==="Files"||Yt.types.indexOf("Files")>-1){if(Ht.preventDefault(),vt=="stex")return;try{var Dn,ri=Xt[1];((Dn=Xt[0])===null||Dn===void 0?void 0:Dn.kind)==="file"&&(ri=Xt[0]);var Kt=ri.getAsFile(),Li=Kt.name.split(".").pop();y(Kt,function(Jt){if(Jt.id){var In,gi,vi;(Kt==null||((In=Kt.type)===null||In===void 0)?void 0:In.indexOf("image"))>-1?Et.replaceSelection(".concat(Jt.content_type,")")):(Kt==null||((gi=Kt.type)===null||gi===void 0)?void 0:gi.indexOf("video"))>-1?Et.replaceSelection('')):(Kt==null||((vi=Kt.type)===null||vi===void 0)?void 0:vi.indexOf("pdf"))>-1?Et.replaceSelection('').concat(Kt.name,"")):T.includes(Li)?Et.replaceSelection('').concat(Kt.name,"")):Et.replaceSelection("[".concat(Kt.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Jt.id,"?type=").concat(Jt.content_type,")"))}else(Jt==null?void 0:Jt.status)===401&&(document.location.href="/user/login")})}catch(Jt){_e.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Et.on("paste",Dt),Et.on("dragleave",function(At,Ht){zt.current.classList.remove("mouse-hover-md")}),Et.on("dragover",function(At,Ht){zt.current.classList.add("mouse-hover-md")}),Et.on("drop",function(At,Ht){zt.current.classList.add("mouse-hover-md");var Yt;if(Yt=Ht.dataTransfer.files,Yt.length>0){Ht.preventDefault(),Ht.stopPropagation();for(var rn=function(ri){var Kt=Yt[ri],Li=Kt.name.split(".").pop();y(Kt,function(Jt){if(Jt.id){var In,gi,vi;(Kt==null||((In=Kt.type)===null||In===void 0)?void 0:In.indexOf("image"))>-1?Et.replaceSelection(".concat(Jt.content_type,")")):(Kt==null||((gi=Kt.type)===null||gi===void 0)?void 0:gi.indexOf("video"))>-1?Et.replaceSelection('')):(Kt==null||((vi=Kt.type)===null||vi===void 0)?void 0:vi.indexOf("pdf"))>-1?Et.replaceSelection('').concat(Kt.name,"")):T.includes(Li)?Et.replaceSelection('').concat(Kt.name,"")):Et.replaceSelection("[".concat(Kt.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Jt.id,"?type=").concat(Jt.content_type,")"))}else(Jt==null?void 0:Jt.status)===401&&(document.location.href="/user/login")})},Xt=0;Xt0||Xt.target.offsetWidth>0)&&(bi(),h.setSize("100%","100%"),h.refresh())}}catch(Dn){Yt.e(Dn)}finally{Yt.f()}});return At.observe(hn.current.parentElement),At}if(h){var Dt=Et();return function(){Dt.unobserve(hn.current.parentElement)}}},[h,bi]),Object(j.useEffect)(function(){if(h){for(var Et=[],Dt=function(){var Xt=Ht[At];Yt=Object(F.a)(Xt,2);var Dn=Yt[0],ri=Yt[1],Kt=Object(q.a)({},Dn,function(){ii(ri)});Et.push(Kt),h.addKeyMap(Kt)},At=0,Ht=Object.entries(O);At0){var Et=new Date().getTime(),Dt=window.sessionStorage.getItem(jt);Et>=ci+Ae&&(!Dt||Dt!==it)&&(window.sessionStorage.setItem(jt,it),an(!0))}},Ae),Object(j.useEffect)(function(){Nt(Tt)},[h,Tt]),Object(j.useEffect)(function(){h&&(wt&&h.focus())},[h,wt]),Object(j.useEffect)(function(){if(ft&&h){var Et=h.getScrollerElement();function Dt(At){var Ht=At.target;if(ln.current){var Yt=Ht.scrollTop/Ht.scrollHeight;ln.current.scrollTop=ln.current.scrollHeight*Yt}}return Et.addEventListener("scroll",Dt),function(){Et.removeEventListener("scroll",Dt)}}},[h,ft]),Object(j.useEffect)(function(){if(h&&un){function Et(Dt,At){un(Dt,At)}return h.on("beforeChange",Et),function(){h.off("beforeChange",Et)}}},[h,un]),Object(j.useEffect)(function(){if(h&&yn){function Et(){yn(h.getValue())}return h.on("blur",Et),function(){h.off("blur",Et)}}},[h,yn]),Object(j.useEffect)(function(){if(h){function Et(Dt){var At=Dt.getValue();lt(At),xn(new Date().getTime()),Dt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ut&&ut(At)}return h.on("change",Et),function(){h.off("change",Et)}}},[h,ut]),Object(j.useEffect)(function(){h&&(ot==null?(h.setValue(""),lt("")):ot!==h.getValue()&&(h.setValue(ot),lt(ot),h.setCursor(h.lineCount(),0)))},[h,ot]);var ii=Object(j.useCallback)(function(Et){var Dt=h.getCursor(),At=h.getSelection(),Ht=At.split(`
`);switch(Et){case"bold":return h.replaceSelection("**"+At+"**"),At===""&&h.setCursor(Dt.line,Dt.ch+2),h.focus();case"italic":return h.replaceSelection("*"+At+"*"),At===""&&h.setCursor(Dt.line,Dt.ch+1),h.focus();case"code":return h.replaceSelection("`"+At+"`"),At===""&&h.setCursor(Dt.line,Dt.ch+1),h.focus();case"inline-latex":return h.replaceSelection("`$$"+At+"$$`"),At===""&&h.setCursor(Dt.line,Dt.ch+3),h.focus();case"latex":return h.replaceSelection("```latex\n"+At+"\n```"),h.setCursor(Dt.line+1,At.length+1),h.focus();case"line-break":return h.replaceSelection(`
`),h.focus();case"list-ul":return At===""?h.replaceSelection("- "+At):h.replaceSelection(Ht.map(function(Yt){return Yt===""?"":"- ".concat(Yt)}).join(`
`)),h.focus();case"list-ol":return At===""?h.replaceSelection("1. "+At):h.replaceSelection(Ht.map(function(Yt,rn){return Yt===""?"":"".concat(rn+1,". ").concat(Yt)}).join(`
`)),h.focus();case"add-null-ch":return At===""&&h.setCursor(Dt.line,Dt.ch+1),h.replaceSelection(We),h.focus();case"inster-template-1":return At===""&&h.setCursor(Dt.line,Dt.ch),h.replaceSelection(ie),h.focus();case"eraser":return h.setValue(""),h.focus();case"trigger-watch":return Nt(!ft),h.focus();case"trigger-full-screen":return Cn(!$t),h.focus();case Fe:dn(Fe);return;case pe:dn(pe);return;case nt:dn(nt);return;case De:dn(De);return;default:throw new Error}},[h,ft,$t]),di=Object(j.useCallback)(function(Et){dn("");switch(Vt){case Fe:var Dt=Et.title,At=Et.link;return h.replaceSelection("[".concat(Dt,"](").concat(At,")")),h.focus();case pe:var Ht=Et.language,Yt=Et.content;return h.replaceSelection(["```"+Ht,Yt,"```"].join(`
`)),h.focus();case nt:var rn=Et.src,Xt=Et.alt,Dn=Et.name;return rn.indexOf("type=image")>-1?h.replaceSelection(".concat(rn,' "').concat(Xt||"",'" )')):rn.indexOf("type=application/pdf")>-1?h.replaceSelection('').concat(Dn,"")):h.replaceSelection('').concat(Dn,"")),h.focus();case De:for(var ri=Et.row,Kt=Et.col,Li=Et.align,Jt=`
`,In=0;In300&&(Dn=300);var ri=ct+Dn+"px";at(ri)}}return Et.addEventListener("mousedown",Ht),document.addEventListener("mousemove",rn),document.addEventListener("mouseup",Yt),function(){Et.removeEventListener("mousedown",Ht),document.removeEventListener("mousemove",rn),document.removeEventListener("mouseup",Yt)}}},[h,Gn]),Object(j.useEffect)(function(){at(ct)},[ct]);var Ai=W(kt),yi=W(Ct),Ji={width:Ai,height:yi},Br=Object(j.useMemo)(function(){if(ci){var Et=new Date(ci),Dt=Et.getHours(),At=Et.getMinutes(),Ht=Et.getSeconds();return Dt=Dt<10?"0"+Dt:Dt,At=At<10?"0"+At:At,Ht=Ht<10?"0"+Ht:Ht,"".concat(Dt,":").concat(At,":").concat(Ht)}return 0},[ci]);function Fi(){window.sessionStorage.removeItem(jt),an(!1),xn(0)}function Jo(){an(!1),xn(0),h.setValue(window.sessionStorage.getItem(jt))}function co(Et,Dt){var At=h.getValue();At=At.replace(Et,Dt),lt(At),h==null||h.setValue(At)}return Y.a.createElement(j.Fragment,null,Y.a.createElement("div",{className:"markdown-editor-wrapper",ref:zt},Y.a.createElement("div",{className:"markdown-editor-container ".concat(_t," ").concat(ft?"on-preview":""," ").concat(Lt?"mini":""," ").concat($t?"full-screen":""),style:Ji},Y.a.createElement(L,{insertTemp:Bt,watch:ft,fullScreen:$t,showNullButton:pt,onActionCallback:ii,hidetoolBar:An,uuid:Wt.current,setOpenPhones:function(){kn.current=!0}}),Y.a.createElement("div",{className:"markdown-editor-body"},Y.a.createElement("div",{className:"codemirror-container"},Y.a.createElement("textarea",{ref:hn,placeholder:Jn})),ft?Y.a.createElement("div",{ref:ln,className:"preview-container"},vt==="stex"&&Y.a.createElement(Ce,{value:it}),vt!=="stex"&&Y.a.createElement(Q.a,{edit:!0,value:it,replaces:co})):null))),pn?Y.a.createElement("a",{ref:Gn,className:"editor-resize"}):null,Y.a.createElement(U.a,null,N[Vt]?Y.a.createElement(Pe.a,{centered:!0,title:N[Vt],visible:!0,onCancel:Ln,footer:null},pr):null))}},RxwV:function(yt,qe,b){"use strict";var Z=b("q1tI"),Pe=b("uciX"),Le=b("2W6z"),He=b.n(Le),_e=b("4IlW"),ye=b("uK0f"),F=b.n(ye);function q(w,D){if(w===D)return!0;if(!w||!D)return!1;var S=w.length;if(D.length!==S)return!1;for(var k=0;k0;(pe||y.isLeaf===!1)&&(Fe+=" ".concat(ue,"-menu-item-expand"),y.loading||(nt=Z.createElement("span",{className:"".concat(ue,"-menu-item-expand-icon")},ge))),I==="hover"&&(pe||y.isLeaf===!1)&&(Be={onMouseEnter:this.delayOnSelect.bind(this,Ie),onMouseLeave:this.delayOnSelect.bind(this),onClick:Ie}),this.isActiveOption(y,E)&&(Fe+=" ".concat(ue,"-menu-item-active"),Be.ref=this.saveMenuItem(E)),y.disabled&&(Fe+=" ".concat(ue,"-menu-item-disabled"));var De=null;y.loading&&(Fe+=" ".concat(ue,"-menu-item-loading"),De=Oe||null);var je="";return"title"in y?je=y.title:typeof y[this.getFieldName("label")]=="string"&&(je=y[this.getFieldName("label")]),Z.createElement("li",Object.assign({key:y[this.getFieldName("value")],className:Fe,title:je},Be,{role:"menuitem",onMouseDown:function(Ye){return Ye.preventDefault()}}),y[this.getFieldName("label")],nt,De)}},{key:"getActiveOptions",value:function(y){var E=this,M=this.props.options,ue=y||this.props.activeValue;return F()(M,function(I,ge){return I[E.getFieldName("value")]===ue[ge]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var y=this,E=this.props.options,M=this.getActiveOptions().map(function(ue){return ue[y.getFieldName("children")]}).filter(function(ue){return!!ue});return M.unshift(E),M}},{key:"delayOnSelect",value:function(y){for(var E=this,M=arguments.length,ue=new Array(M>1?M-1:0),I=1;I=0)continue;if(!Object.prototype.propertyIsEnumerable.call(w,k))continue;S[k]=w[k]}}return S}function P(w,D){if(w==null)return{};var S={},k=Object.keys(w),v,y;for(y=0;y=0)continue;S[v]=w[v]}return S}function le(w){return ee(w)||me(w)||_(w)||$()}function $(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(w,D){if(!w)return;if(typeof w=="string")return L(w,D);var S=Object.prototype.toString.call(w).slice(8,-1);if(S==="Object"&&w.constructor&&(S=w.constructor.name),S==="Map"||S==="Set")return Array.from(w);if(S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S))return L(w,D)}function me(w){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(w))return Array.from(w)}function ee(w){if(Array.isArray(w))return L(w)}function L(w,D){(D==null||D>w.length)&&(D=w.length);for(var S=0,k=new Array(D);S=Oe.length?0:ze):(ze-=1,ze=ze<0?Oe.length-1:ze):ze=0,I[ge]=Oe[ze][y.getFieldName("value")]}else if(M.keyCode===_e.a.LEFT||M.keyCode===_e.a.BACKSPACE)M.preventDefault(),I.splice(I.length-1,1);else if(M.keyCode===_e.a.RIGHT)M.preventDefault(),Oe[Ie]&&Oe[Ie][y.getFieldName("children")]&&I.push(Oe[Ie][y.getFieldName("children")][0][y.getFieldName("value")]);else if(M.keyCode===_e.a.ESC||M.keyCode===_e.a.TAB){y.setPopupVisible(!1);return}(!I||I.length===0)&&y.setPopupVisible(!1);var Be=y.getActiveOptions(I),Fe=Be[Be.length-1];y.handleMenuSelect(Fe,Be.length-1,M),y.props.onKeyDown&&y.props.onKeyDown(M)},y.saveTrigger=function(M){y.trigger=M};var E=[];return"value"in v?E=v.value||[]:"defaultValue"in v&&(E=v.defaultValue||[]),He()(!("filedNames"in v),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),y.state={popupVisible:v.popupVisible,activeValue:E,value:E,prevProps:v},y.defaultFieldNames={label:"label",value:"value",children:"children"},y}return K(k,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(y){var E=this.defaultFieldNames,M=this.props,ue=M.fieldNames,I=M.filedNames;return"filedNames"in this.props?I[y]||E[y]:ue[y]||E[y]}},{key:"getFieldNames",value:function(){var y=this.props,E=y.fieldNames,M=y.filedNames;return"filedNames"in this.props?M:E}},{key:"getCurrentLevelOptions",value:function(){var y=this,E=this.props.options,M=E===void 0?[]:E,ue=this.state.activeValue,I=ue===void 0?[]:ue,ge=F()(M,function(Oe,Ie){return Oe[y.getFieldName("value")]===I[Ie]},{childrenKeyName:this.getFieldName("children")});return ge[ge.length-2]?ge[ge.length-2][this.getFieldName("children")]:le(M).filter(function(Oe){return!Oe.disabled})}},{key:"getActiveOptions",value:function(y){var E=this;return F()(this.props.options||[],function(M,ue){return M[E.getFieldName("value")]===y[ue]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var y=this.props,E=y.prefixCls,M=y.transitionName,ue=y.popupClassName,I=y.options,ge=I===void 0?[]:I,Oe=y.disabled,Ie=y.builtinPlacements,ze=y.popupPlacement,Be=y.children,Fe=y.dropdownRender,nt=ce(y,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),pe=Z.createElement("div",null),De="";ge&&ge.length>0?pe=Z.createElement(Ue,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):De=" ".concat(E,"-menus-empty");var je=pe;return Fe&&(je=Fe(pe)),Z.createElement(Pe.a,Object.assign({ref:this.saveTrigger},nt,{popupPlacement:ze,builtinPlacements:Ie,popupTransitionName:M,action:Oe?[]:["click"],popupVisible:Oe?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(E,"-menus"),popupClassName:ue+De,popup:je}),Z.cloneElement(Be,{onKeyDown:this.handleKeyDown,tabIndex:Oe?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(y,E){var M=E.prevProps,ue=M===void 0?{}:M,I={prevProps:y};return"value"in y&&!q(ue.value,y.value)&&(I.value=y.value||[],"loadData"in y||(I.activeValue=y.value||[])),"popupVisible"in y&&(I.popupVisible=y.popupVisible),I}}]),k}(Z.Component);return w.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:Q,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},w}(),Te=Se,R=qe.a=Te},SJMd:function(yt,qe){/**
* @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 b,Z,Pe,Le=!1,He,_e;window.PR_SHOULD_USE_CONTINUATION=!0;var ye,F;(function(){var q=window,V=["break,continue,do,else,for,if,return,while"],se=[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=[se,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],Y=[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"],ke=[j,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],de=[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"],B="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",X=[j,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],z="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",fe=[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"],he=[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"],Ne=[V,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ue=[Y,de,ke,X,z,fe,he,Ne],we=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,Q="str",Ce="kwd",ce="com",P="typ",le="lit",$="pun",_="pln",me="tag",ee="dec",L="src",U="atn",ae="atv",K="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(I){for(var ge=0,Oe=!1,Ie=!1,ze=0,Be=I.length;ze122||(x<65||re>90||et.push([Math.max(65,re)|32,Math.min(x,90)|32]),x<97||re>122||et.push([Math.max(97,re)&~32,Math.min(x,122)&~32]))}}et.sort(function(be,oe){return be[0]-oe[0]||oe[1]-be[1]});for(var T=[],O=[],We=0;WeN[0]&&(N[1]+1>N[0]&&Ae.push("-"),Ae.push(De(N[1])))}return Ae.push("]"),Ae.join("")}function Ke(Ve){for(var xe=Ve.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")),et=xe.length,Ze=[],Ae=0,We=0;Ae=2&&re==="["?xe[Ae]=je(ie):re!=="\\"&&(xe[Ae]=ie.replace(/[a-zA-Z]/g,function(O){var N=O.charCodeAt(0);return"["+String.fromCharCode(N&~32,N|32)+"]"}))}return xe.join("")}for(var Ye=[],ze=0,Be=I.length;ze=0;)Oe[Ye.charAt(Ve)]=Ke;var xe=Ke[1],et=""+xe;pe.hasOwnProperty(et)||(nt.push(xe),pe[et]=null)}nt.push(/[\0-\uffff]/),Ie=m(nt)})();var ze=ge.length,Be=function(Fe){for(var nt=Fe.sourceCode,pe=Fe.basePos,De=Fe.sourceNode,je=[pe,_],Ke=0,Ye=nt.match(Ie)||[],Ve={},xe=0,et=Ye.length;xe=5&&Ae.substring(0,5)==="lang-",ie&&!(We&&typeof We[1]=="string")&&(ie=!1,Ae=L),ie||(Ve[Ze]=Ae)}var x=Ke;if(Ke+=Ze.length,!ie)je.push(pe+x,Ae);else{var T=We[1],O=Ze.indexOf(T),N=O+T.length;We[2]&&(N=Ze.length-We[2].length,O=N-T.length);var be=Ae.substring(5);A(De,pe+x,Ze.substring(0,O),Be,je),A(De,pe+x+O,T,k(be,T),je),A(De,pe+x+N,Ze.substring(N),Be,je)}}Fe.decorations=je};return Be}function Se(I){var ge=[],Oe=[];I.tripleQuotedStrings?ge.push([Q,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):I.multiLineStrings?ge.push([Q,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ge.push([Q,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),I.verbatimStrings&&Oe.push([Q,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ie=I.hashComments;Ie&&(I.cStyleComments?(Ie>1?ge.push([ce,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ge.push([ce,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Oe.push([Q,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ge.push([ce,/^#[^\r\n]*/,null,"#"])),I.cStyleComments&&(Oe.push([ce,/^\/\/[^\r\n]*/,null]),Oe.push([ce,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ze=I.regexLiterals;if(ze){var Be=ze>1?"":`
\r`,Fe=Be?".":"[\\S\\s]",nt="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+Fe+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+Fe+")*(?:\\x5D|$))+/";Oe.push(["lang-regex",RegExp("^"+G+"("+nt+")")])}var pe=I.types;pe&&Oe.push([P,pe]);var De=(""+I.keywords).replace(/^ | $/g,"");De.length&&Oe.push([Ce,new RegExp("^(?:"+De.replace(/[\s,]+/g,"|")+")\\b"),null]),ge.push([_,/^\s+/,null,` \r
\xA0`]);var je="^.[^\\s\\w.$@'\"`/\\\\]*";return I.regexLiterals&&(je+="(?!s*/)"),Oe.push([le,/^@[a-z_$][a-z_$@0-9]*/i,null],[P,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[le,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[$,new RegExp(je),null]),Re(ge,Oe)}var Te=Se({keywords:Ue,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function R(I,ge,Oe){for(var Ie=/(?:^|\s)nocode(?:\s|$)/,ze=/\r\n?|\n/,Be=I.ownerDocument,Fe=Be.createElement("li");I.firstChild;)Fe.appendChild(I.firstChild);var nt=[Fe];function pe(xe){var et=xe.nodeType;if(et==1&&!Ie.test(xe.className))if(xe.nodeName==="br")De(xe),xe.parentNode&&xe.parentNode.removeChild(xe);else for(var Ze=xe.firstChild;Ze;Ze=Ze.nextSibling)pe(Ze);else if((et==3||et==4)&&Oe){var Ae=xe.nodeValue,We=Ae.match(ze);if(We){var ie=Ae.substring(0,We.index);xe.nodeValue=ie;var W=Ae.substring(We.index+We[0].length);if(W){var re=xe.parentNode;re.insertBefore(Be.createTextNode(W),xe.nextSibling)}De(xe),ie||xe.parentNode.removeChild(xe)}}}function De(xe){for(;!xe.nextSibling;)if(xe=xe.parentNode,!xe)return;function et(We,ie){var W=ie?We.cloneNode(!1):We,re=We.parentNode;if(re){var x=et(re,1),T=We.nextSibling;x.appendChild(W);for(var O=T;O;O=T)T=O.nextSibling,x.appendChild(O)}return W}for(var Ze=et(xe.nextSibling,0),Ae;(Ae=Ze.parentNode)&&Ae.nodeType===1;)Ze=Ae;nt.push(Ze)}for(var je=0;je=re&&(pe+=2),Be>=x&&(Ke+=2)}}finally{Ae&&(Ae.style.display=We)}}var D={};function S(I,ge){for(var Oe=ge.length;--Oe>=0;){var Ie=ge[Oe];D.hasOwnProperty(Ie)?q.console&&console.warn("cannot override language handler %s",Ie):D[Ie]=I}}function k(I,ge){return I&&D.hasOwnProperty(I)||(I=/^\s*]*(?:>|$)/],[ce,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[$,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^