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

754 lines
757 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[181,7,8,17],{"+NIl":
/*!***************************************************!*\
!*** ./node_modules/codemirror/mode/stex/stex.js ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.defineMode("stex",(function(e,t){function n(e,t){e.cmdState.push(t)}function i(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function r(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};function a(e,t){e.f=t}function s(e,t){var r;if(e.match(/^\\[a-zA-Z@]+/)){var s=e.current().slice(1);return n(t,r=new(r=o.hasOwnProperty(s)?o[s]:o.DEFAULT)),a(t,c),r.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return a(t,(function(e,t){return l(e,t,"\\]")})),"keyword";if(e.match("\\("))return a(t,(function(e,t){return l(e,t,"\\)")})),"keyword";if(e.match("$$"))return a(t,(function(e,t){return l(e,t,"$$")})),"keyword";if(e.match("$"))return a(t,(function(e,t){return l(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(r=i(t))?(r.closeBracket(u),a(t,c),"bracket"):"error":"{"==u||"["==u?(n(t,r=new(r=o.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(r=function(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var i=t[n];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}(t)).name&&(r.argument=e.current()),r.styleIdentifier())}function l(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return a(t,s),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=e.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(e.skipToEnd(),"comment"):"error"}function c(e,t){var n=e.peek();return"{"==n||"["==n?(i(t).openBracket(n),e.eat(n),a(t,s),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(a(t,s),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),s(e,t))}return o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return l(e,t)}:s}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=s,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(n(/*! ../../lib/codemirror */"VrN/"))},"+RXH":
/*!*****************************************!*\
!*** ./src/assets/images/paper/shu.svg ***!
\*****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/shu.a39bf729.svg"},"+yhJ":
/*!******************************************!*\
!*** ./src/assets/images/paper/xixi.svg ***!
\******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/xixi.d492fb65.svg"},"0eGx":
/*!*******************************************!*\
!*** ./src/assets/images/paper/zhong.svg ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/zhong.c1924b73.svg"},"19Vz":
/*!**************************************************************!*\
!*** ./node_modules/codemirror/addon/display/placeholder.js ***!
\**************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){o(e)&&n(e)}function r(e){var i=e.getWrapperElement(),r=o(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(o,a,s){var l=s&&s!=e.Init;if(a&&!l)o.on("blur",i),o.on("change",r),o.on("swapDoc",r),e.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(e){setTimeout((function(){var i=!1,r=e.getInputField();"TEXTAREA"==r.nodeName?i=!r.value:1==e.lineCount()&&(i=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),i?n(e):t(e)}),20)}(o)}),r(o);else if(!a&&l){o.off("blur",i),o.off("change",r),o.off("swapDoc",r),e.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),t(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!o.hasFocus()&&i(o)}))}(n(/*! ../../lib/codemirror */"VrN/"))},"1eCo":
/*!*************************************************!*\
!*** ./node_modules/codemirror/mode/xml/xml.js ***!
\*************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";var t={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,r){var o,a,s=i.indentUnit,l={},c=r.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function h(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,i){for(var r;null!=(r=n.next());){if("<"==r)return i.tokenize=e(t+1),i.tokenize(n,i);if(">"==r){if(1==t){i.tokenize=h;break}return i.tokenize=e(t-1),i.tokenize(n,i)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n,i,r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=h,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=h,t.state=v,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=d;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=h;break}n.next()}return e}}function f(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",w):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,0,n)):(a="error",y)}function b(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(a="tag",x):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,0,n)):(a="error",C)}function x(e,t,n){return"endTag"!=e?(a="error",x):(m(n),v)}function C(e,t,n){return a="error",x(e,0,n)}function w(e,t,n){if("word"==e)return a="attribute",k;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(i)?g(n,i):(g(n,i),n.context=new f(n,i,r==n.indented)),v}return a="error",w}function k(e,t,n){return"equals"==e?S:(l.allowMissing||(a="error"),w(e,0,n))}function S(e,t,n){return"string"==e?E:"word"==e&&l.allowUnquoted?(a="string",w):(a="error",w(e,0,n))}function E(e,t,n){return"string"==e?E:w(e,0,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:v,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var a=l.contextGrabbers[r.tagName];if(!a||!a.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=w)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(/*! ../../lib/codemirror */"VrN/"))},"2sxD":
/*!*********************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/List/index.less?modules ***!
\*********************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB":
/*!****************************************!*\
!*** ./src/assets/images/paper/sc.svg ***!
\****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/sc.c1696770.svg"},"5MlY":
/*!****************************************!*\
!*** ./src/assets/images/paper/sm.svg ***!
\****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/sm.8ccb50bf.svg"},"6+eU":
/*!************************************************************!*\
!*** ./node_modules/rc-pagination/es/index.js + 4 modules ***!
\************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-pagination/es/locale/zh_CN.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var i=n("wx14"),r=n("rePB"),o=n("VTBJ"),a=n("1OyB"),s=n("vuIU"),l=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),p=n.n(d),f=function(e){var t,n="".concat(e.rootPrefixCls,"-item"),i=p()(n,"".concat(n,"-").concat(e.page),(t={},Object(r.a)(t,"".concat(n,"-active"),e.active),Object(r.a)(t,e.className,!!e.className),Object(r.a)(t,"".concat(n,"-disabled"),!e.page),t));return h.a.createElement("li",{title:e.showTitle?e.page:null,className:i,onClick:function(){e.onClick(e.page)},onKeyPress:function(t){e.onKeyPress(t,e.onClick,e.page)},tabIndex:"0"},e.itemRender(e.page,"page",h.a.createElement("a",{rel:"nofollow"},e.page)))},m=13,g=38,v=40,y=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(){var e;Object(a.a)(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={goInputText:""},e.buildOptionText=function(t){return"".concat(t," ").concat(e.props.locale.items_per_page)},e.changeSize=function(t){e.props.changeSize(Number(t))},e.handleChange=function(t){e.setState({goInputText:t.target.value})},e.handleBlur=function(t){var n=e.props,i=n.goButton,r=n.quickGo,o=n.rootPrefixCls,a=e.state.goInputText;i||""===a||t.relatedTarget&&(t.relatedTarget.className.indexOf("".concat(o,"-prev"))>=0||t.relatedTarget.className.indexOf("".concat(o,"-next"))>=0)||(e.setState({goInputText:""}),r(e.getValidValue()))},e.go=function(t){""!==e.state.goInputText&&(t.keyCode!==m&&"click"!==t.type||(e.setState({goInputText:""}),e.props.quickGo(e.getValidValue())))},e}return Object(s.a)(n,[{key:"getValidValue",value:function(){var e=this.state,t=e.goInputText,n=e.current;return!t||isNaN(t)?n:Number(t)}},{key:"getPageSizeOptions",value:function(){var e=this.props,t=e.pageSize,n=e.pageSizeOptions;return n.some((function(e){return e.toString()===t.toString()}))?n:n.concat([t.toString()]).sort((function(e,t){return(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pageSize,i=t.locale,r=t.rootPrefixCls,o=t.changeSize,a=t.quickGo,s=t.goButton,l=t.selectComponentClass,c=t.buildOptionText,u=t.selectPrefixCls,d=t.disabled,p=this.state.goInputText,f="".concat(r,"-options"),m=l,g=null,v=null,y=null;if(!o&&!a)return null;var b=this.getPageSizeOptions();if(o&&m){var x=b.map((function(t,n){return h.a.createElement(m.Option,{key:n,value:t.toString()},(c||e.buildOptionText)(t))}));g=h.a.createElement(m,{disabled:d,prefixCls:u,showSearch:!1,className:"".concat(f,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||b[0]).toString(),onChange:this.changeSize,getPopupContainer:function(e){return e.parentNode}},x)}return a&&(s&&(y="boolean"==typeof s?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:d,className:"".concat(f,"-quick-jumper-button")},i.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},s)),v=h.a.createElement("div",{className:"".concat(f,"-quick-jumper")},i.jump_to,h.a.createElement("input",{disabled:d,type:"text",value:p,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),i.page,y)),h.a.createElement("li",{className:"".concat(f)},g,v)}}]),n}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,x=n("N2Kk");function C(){}function w(e,t,n){var i=void 0===e?t.pageSize:e;return Math.floor((n.total-1)/i)+1}var k=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(e){var i;Object(a.a)(this,n),(i=t.call(this,e)).getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(w(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(e,t){var n=i.props.prefixCls,r=e||h.a.createElement("button",{type:"button","aria-label":t,className:"".concat(n,"-item-link")});return"function"==typeof e&&(r=h.a.createElement(e,Object(o.a)({},i.props))),r},i.savePaginationNode=function(e){i.paginationNode=e},i.isValid=function(e){return"number"==typeof(t=e)&&isFinite(t)&&Math.floor(t)===t&&e!==i.state.current;var t},i.shouldDisplayQuickJumper=function(){var e=i.props,t=e.showQuickJumper,n=e.pageSize;return!(e.total<=n)&&t},i.handleKeyDown=function(e){e.keyCode!==g&&e.keyCode!==v||e.preventDefault()},i.handleKeyUp=function(e){var t=i.getValidValue(e);t!==i.state.currentInputValue&&i.setState({currentInputValue:t}),e.keyCode===m?i.handleChange(t):e.keyCode===g?i.handleChange(t-1):e.keyCode===v&&i.handleChange(t+1)},i.changePageSize=function(e){var t=i.state.current,n=w(e,i.state,i.props);t=t>n?n:t,0===n&&(t=i.state.current),"number"==typeof e&&("pageSize"in i.props||i.setState({pageSize:e}),"current"in i.props||i.setState({current:t,currentInputValue:t})),i.props.onShowSizeChange(t,e),"onChange"in i.props&&i.props.onChange&&i.props.onChange(t,e)},i.handleChange=function(e){var t=i.props.disabled,n=e;if(i.isValid(n)&&!t){var r=w(void 0,i.state,i.props);n>r?n=r:n<1&&(n=1),"current"in i.props||i.setState({current:n,currentInputValue:n});var o=i.state.pageSize;return i.props.onChange(n,o),n}return i.state.current},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current<w(void 0,i.state,i.props)},i.runIfEnter=function(e,t){if("Enter"===e.key||13===e.charCode){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];t.apply(void 0,i)}},i.runIfEnterPrev=function(e){i.runIfEnter(e,i.prev)},i.runIfEnterNext=function(e){i.runIfEnter(e,i.next)},i.runIfEnterJumpPrev=function(e){i.runIfEnter(e,i.jumpPrev)},i.runIfEnterJumpNext=function(e){i.runIfEnter(e,i.jumpNext)},i.handleGoTO=function(e){e.keyCode!==m&&"click"!==e.type||i.handleChange(i.state.currentInputValue)};var r=e.onChange!==C;"current"in e&&!r&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var s=e.defaultCurrent;"current"in e&&(s=e.current);var l=e.defaultPageSize;return"pageSize"in e&&(l=e.pageSize),s=Math.min(s,w(l,void 0,e)),i.state={current:s,currentInputValue:s,pageSize:l},i}return Object(s.a)(n,[{key:"componentDidUpdate",value:function(e,t){var n=this.props.prefixCls;if(t.current!==this.state.current&&this.paginationNode){var i=this.paginationNode.querySelector(".".concat(n,"-item-").concat(t.current));i&&document.activeElement===i&&i.blur()}}},{key:"getValidValue",value:function(e){var t=e.target.value,n=w(void 0,this.state,this.props),i=this.state.currentInputValue;return""===t?t:isNaN(Number(t))?i:t>=n?n:Number(t)}},{key:"getShowSizeChanger",value:function(){var e=this.props,t=e.showSizeChanger,n=e.total,i=e.totalBoundaryShowSizeChanger;return void 0!==t?t:n>i}},{key:"renderPrev",value:function(e){var t=this.props,n=t.prevIcon,i=(0,t.itemRender)(e,"prev",this.getItemIcon(n,"prev page")),r=!this.hasPrev();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"renderNext",value:function(e){var t=this.props,n=t.nextIcon,i=(0,t.itemRender)(e,"next",this.getItemIcon(n,"next page")),r=!this.hasNext();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,o=t.className,a=t.style,s=t.disabled,l=t.hideOnSinglePage,c=t.total,d=t.locale,m=t.showQuickJumper,g=t.showLessItems,v=t.showTitle,y=t.showTotal,x=t.simple,C=t.itemRender,k=t.showPrevNextJumpers,S=t.jumpPrevIcon,E=t.jumpNextIcon,_=t.selectComponentClass,O=t.selectPrefixCls,N=t.pageSizeOptions,T=this.state,L=T.current,A=T.pageSize,M=T.currentInputValue;if(!0===l&&c<=A)return null;var j=w(void 0,this.state,this.props),D=[],P=null,I=null,R=null,B=null,z=null,F=m&&m.goButton,H=g?1:2,W=L-1>0?L-1:0,V=L+1<j?L+1:j,G=Object.keys(this.props).reduce((function(t,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)&&"role"!==n||(t[n]=e.props[n]),t}),{});if(x)return F&&(z="boolean"==typeof F?h.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},d.jump_to_confirm):h.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F),z=h.a.createElement("li",{title:v?"".concat(d.jump_to).concat(L,"/").concat(j):null,className:"".concat(n,"-simple-pager")},z)),h.a.createElement("ul",Object(i.a)({className:p()(n,"".concat(n,"-simple"),Object(r.a)({},"".concat(n,"-disabled"),s),o),style:a,ref:this.savePaginationNode},G),h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(W)),h.a.createElement("li",{title:v?"".concat(L,"/").concat(j):null,className:"".concat(n,"-simple-pager")},h.a.createElement("input",{type:"text",value:M,disabled:s,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),h.a.createElement("span",{className:"".concat(n,"-slash")},"/"),j),h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(V)),z);if(j<=3+2*H){var K={locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:v,itemRender:C};j||D.push(h.a.createElement(f,Object(i.a)({},K,{key:"noPager",page:j,className:"".concat(n,"-disabled")})));for(var U=1;U<=j;U+=1){var q=L===U;D.push(h.a.createElement(f,Object(i.a)({},K,{key:U,page:U,active:q})))}}else{var $=g?d.prev_3:d.prev_5,Y=g?d.next_3:d.next_5;k&&(P=h.a.createElement("li",{title:v?$:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(n,"-jump-prev"),Object(r.a)({},"".concat(n,"-jump-prev-custom-icon"),!!S))},C(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),I=h.a.createElement("li",{title:v?Y:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(n,"-jump-next"),Object(r.a)({},"".concat(n,"-jump-next-custom-icon"),!!E))},C(this.getJumpNextPage(),"jump-next",this.getItemIcon(E,"next page")))),B=h.a.createElement(f,{locale:d,last:!0,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:j,page:j,active:!1,showTitle:v,itemRender:C}),R=h.a.createElement(f,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:v,itemRender:C});var X=Math.max(1,L-H),Z=Math.min(L+H,j);L-1<=H&&(Z=1+2*H),j-L<=H&&(X=j-2*H);for(var J=X;J<=Z;J+=1){var Q=L===J;D.push(h.a.createElement(f,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:J,page:J,active:Q,showTitle:v,itemRender:C}))}L-1>=2*H&&3!==L&&(D[0]=Object(u.cloneElement)(D[0],{className:"".concat(n,"-item-after-jump-prev")}),D.unshift(P)),j-L>=2*H&&L!==j-2&&(D[D.length-1]=Object(u.cloneElement)(D[D.length-1],{className:"".concat(n,"-item-before-jump-next")}),D.push(I)),1!==X&&D.unshift(R),Z!==j&&D.push(B)}var ee=null;y&&(ee=h.a.createElement("li",{className:"".concat(n,"-total-text")},y(c,[0===c?0:(L-1)*A+1,L*A>c?c:L*A])));var te=!this.hasPrev()||!j,ne=!this.hasNext()||!j;return h.a.createElement("ul",Object(i.a)({className:p()(n,o,Object(r.a)({},"".concat(n,"-disabled"),s)),style:a,unselectable:"unselectable",ref:this.savePaginationNode},G),ee,h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),te)),"aria-disabled":te},this.renderPrev(W)),D,h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(V)),h.a.createElement(b,{disabled:s,locale:d,rootPrefixCls:n,selectComponentClass:_,selectPrefixCls:O,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:L,pageSize:A,pageSizeOptions:N,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:F}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};if("current"in e&&(n.current=e.current,e.current!==t.current&&(n.currentInputValue=n.current)),"pageSize"in e&&e.pageSize!==t.pageSize){var i=t.current,r=w(e.pageSize,t,e);i=i>r?r:i,"current"in e||(n.current=i,n.currentInputValue=i),n.pageSize=e.pageSize}return n}}]),n}(h.a.Component);k.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:C,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:C,locale:x.a,style:{},itemRender:function(e,t,n){return n},totalBoundaryShowSizeChanger:50};var S=k},"6K3P":
/*!********************************************!*\
!*** ./src/assets/images/paper/jinshi.svg ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/jinshi.9b74f304.svg"},"7Cbv":
/*!**************************************************************!*\
!*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=new Uint8Array(16);function o(){if(!i)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}var a=/^(?:[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;for(var s=function(e){return"string"==typeof e&&a.test(e)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};t.a=function(e,t,n){var i=(e=e||{}).random||(e.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return u(i)}},"7ahc":
/*!*************************************************************!*\
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
\*************************************************************/
/*! exports provided: default, MyCodeMirror */
/*! exports used: MyCodeMirror, default */function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),o=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),a=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! codemirror */"VrN/"),d=n.n(h),p=(n(/*! codemirror/lib/codemirror.css */"p77/"),n(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),f={labelCol:{span:4},wrapperCol:{span:20}},m={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"]};function g(e){var t=e.value,n=e.onChange,r=e.mode,o=e.options,a=void 0===o?{}:o,l=Object(c.useRef)(),h=Object(c.useState)(),p=Object(s.a)(h,2),f=p[0],m=p[1];return Object(c.useEffect)((function(){if(f){function e(e){var t=e.getValue();n&&n(t)}return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),Object(c.useEffect)((function(){f&&f.setOption("mode",r)}),[f,r]),Object(c.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||" ")}),300))}),[f,t]),Object(c.useEffect)((function(){if(l.current&&!f){var e=d.a.fromTextArea(l.current,Object(i.a)({mode:r,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},a));m(e)}}),[l.current,f]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}t.b=function(e){var t=e.callback,n=e.onCancel,i=Object(c.useState)("python"),h=Object(s.a)(i,2),d=h[0],v=h[1];return u.a.createElement(a.a,Object(r.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),u.a.createElement(a.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(e){v(m[e][1])}},Object.keys(m).map((function(e){return u.a.createElement(p,{key:e,value:e},m[e][0])})))),u.a.createElement(a.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(g,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(o.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(o.a,{type:"ghost",onClick:n},"取消")))}},"7ixt":
/*!**************************************************!*\
!*** ./node_modules/rc-tooltip/es/placements.js ***!
\**************************************************/
/*! exports provided: placements, default */
/*! exports used: placements */function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i={adjustX:1,adjustY:1},r=[0,0],o={left:{points:["cr","cl"],overflow:i,offset:[-4,0],targetOffset:r},right:{points:["cl","cr"],overflow:i,offset:[4,0],targetOffset:r},top:{points:["bc","tc"],overflow:i,offset:[0,-4],targetOffset:r},bottom:{points:["tc","bc"],overflow:i,offset:[0,4],targetOffset:r},topLeft:{points:["bl","tl"],overflow:i,offset:[0,-4],targetOffset:r},leftTop:{points:["tr","tl"],overflow:i,offset:[-4,0],targetOffset:r},topRight:{points:["br","tr"],overflow:i,offset:[0,-4],targetOffset:r},rightTop:{points:["tl","tr"],overflow:i,offset:[4,0],targetOffset:r},bottomRight:{points:["tr","br"],overflow:i,offset:[0,4],targetOffset:r},rightBottom:{points:["bl","br"],overflow:i,offset:[4,0],targetOffset:r},bottomLeft:{points:["tl","bl"],overflow:i,offset:[0,4],targetOffset:r},leftBottom:{points:["br","bl"],overflow:i,offset:[-4,0],targetOffset:r}}},"7qnI":
/*!********************************************************!*\
!*** ./src/components/Editor/NullChildEditor/index.js ***!
\********************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/tooltip/style */"5Dmo");var i=n(/*! antd/es/tooltip */"3S7+"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),l=(n(/*! antd/es/input/style */"5NDa"),n(/*! antd/es/input */"5rEg")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! ./index.less?modules */"O2Wb"),d=n.n(h),p=l.a.TextArea,f=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.index,r=t.onAnswerChange,o=t.addChildAnswer,a=t.exerciseIsPublish,s=t.answers,l=t.activeOptionErrorIndex,c=t.flex,h=void 0===c?"0 0 1000px":c;return u.a.createElement("div",{className:d.a.flex},u.a.createElement("div",{className:"".concat(d.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"答案(填空",n+1,"):"),u.a.createElement("div",{className:"".concat(d.a.flex," ").concat(d.a.flex1),style:{flexDirection:"column"}},s.map((function(t,c){var f="".concat(n,"-").concat(c);return u.a.createElement("div",{className:"".concat(d.a.flex," ").concat(d.a.flex1),key:c},u.a.createElement("div",{className:d.a.flex1,style:{flex:h}},u.a.createElement("div",null,u.a.createElement(p,{className:f===l?d.a.error:"",spellCheck:!1,rows:4,value:t||"",defaultValue:"请输入参考答案".concat(0==c?"":"(可选)"),onChange:function(e){return r(n,c,e.target.value)},style:{minHeight:95}}))),!a&&u.a.createElement(u.a.Fragment,null,0!=c&&u.a.createElement(i.a,{title:"删除"},u.a.createElement("i",{className:"".concat(d.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return e.props.deleteChildAnswer(n,c)},style:{float:"right"}})),0===c&&u.a.createElement(i.a,{title:"删除"},u.a.createElement("i",{className:"".concat(d.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return e.props.deleteChildAnswermain(n,c)},style:{float:"right"}})),u.a.createElement(i.a,{title:"新增参考答案"},u.a.createElement("i",{className:"".concat(d.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return o(n)},style:{float:"right",visibility:c==s.length-1?"":"hidden"}}))))}))))}}]),n}(c.Component);t.a=f},"815F":
/*!***************************************************!*\
!*** ./node_modules/rc-tree/es/utils/treeUtil.js ***!
\***************************************************/
/*! exports provided: getKey, warningWithoutKey, convertTreeToData, flattenTreeData, traverseDataNodes, convertDataToEntities, getTreeNodeProps, convertNodePropsToEventData */
/*! exports used: convertDataToEntities, convertNodePropsToEventData, convertTreeToData, flattenTreeData, getKey, getTreeNodeProps */function(e,t,n){"use strict";n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return m}));var i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=n(/*! rc-util/es/Children/toArray */"Zm9Q"),s=n(/*! rc-util/es/warning */"Kwbf"),l=n(/*! ../util */"OZM5");function c(e,t){return null!=e?e:t}function u(e){return function e(t){return Object(a.a)(t).map((function(t){if(!Object(l.i)(t))return Object(s.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,i=t.props,a=i.children,c=Object(o.a)(i,["children"]),u=Object(r.a)({key:n},c),h=e(a);return h.length&&(u.children=h),u})).filter((function(e){return e}))}(e)}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(!0===t?[]:t),o=[];function a(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map((function(u,h){var d=Object(l.h)(s?s.pos:"0",h),p=c(u.key,d),f=Object(r.a)(Object(r.a)({},u),{},{parent:s,pos:d,children:null,data:u,isStart:[].concat(Object(i.a)(s?s.isStart:[]),[0===h]),isEnd:[].concat(Object(i.a)(s?s.isEnd:[]),[h===e.length-1])});return o.push(f),!0===t||n.has(p)?f.children=a(u.children||[],f):f.children=[],f}))}return a(e),o}function d(e,t,n){var i;n?"string"==typeof n?i=function(e){return e[n]}:"function"==typeof n&&(i=function(e){return n(e)}):i=function(e,t){return c(e.key,t)},function n(r,o,a){var s=r?r.children:e,c=r?Object(l.h)(a.pos,o):"0";if(r){var u=i(r,c),h={node:r,index:o,pos:c,key:u,parentPos:a.node?a.pos:null,level:a.level+1};t(h)}s&&s.forEach((function(e,t){n(e,t,{node:r,pos:c,level:a?a.level+1:-1})}))}(null)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,i=t.processEntity,r=t.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,a={},s={},l={posEntities:a,keyEntities:s};return n&&(l=n(l)||l),d(e,(function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,u=e.parentPos,h={node:t,index:n,key:o,pos:r,level:e.level},d=c(o,r);a[r]=h,s[d]=h,h.parent=a[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),i&&i(h,l)}),o),r&&r(l),l}function f(e,t){var n=t.expandedKeys,i=t.selectedKeys,r=t.loadedKeys,o=t.loadingKeys,a=t.checkedKeys,s=t.halfCheckedKeys,l=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==i.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==o.indexOf(e),checked:-1!==a.indexOf(e),halfChecked:-1!==s.indexOf(e),pos:String(u?u.pos:""),dragOver:l===e&&0===c,dragOverGapTop:l===e&&-1===c,dragOverGapBottom:l===e&&1===c}}function m(e){var t=e.data,n=e.expanded,i=e.selected,o=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,u=e.dragOver,h=e.dragOverGapTop,d=e.dragOverGapBottom,p=e.pos,f=e.active,m=Object(r.a)(Object(r.a)({},t),{},{expanded:n,selected:i,checked:o,loaded:a,loading:l,halfChecked:c,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:p,active:f});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(s.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}},"8EBN":
/*!**********************************************!*\
!*** ./node_modules/codemirror/mode/meta.js ***!
\**********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.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 t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.mime==t)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==t)return i}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==t)return i}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.file&&i.file.test(t))return i}var r=t.lastIndexOf("."),o=r>-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==t)return i}}}(n(/*! ../lib/codemirror */"VrN/"))},"8hTe":
/*!******************************************************!*\
!*** ./src/components/RenderHtml/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={button:"button___1wy9m"}},"9Bee":
/*!*********************************************************!*\
!*** ./src/components/RenderHtml/index.tsx + 3 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/PreviewAll/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hls.js/dist/hls.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/katex/dist/katex.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/lib/marked.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/src/helpers.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n("DYRE");var i=n("zeV3"),r=(n("+L6B"),n("2/Rp")),o=n("k1fw"),a=n("9og8"),s=n("tJVT"),l=n("WmNS"),c=n.n(l),u=n("q1tI"),h=n.n(u),d=(n("vg9a"),n("DlQD")),p=n.n(d),f=n("rUJ1");var m=[],g=["<ul>"],v=new p.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){m.length=0,g=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(){return function e(t,n,i,r){if(n>=t.length||t[n].level<=i)return n;var o=t[n];r.push("<li><a href='#"+o.anchor+"'>"+o.text+"</a>");var a=[];return n=e(t,++n,o.level,a),a.length>0&&(r.push("<ul>"),a.forEach((function(e){r.push(e)})),r.push("</ul>")),r.push("</li>"),n=e(t,n,i,r)}(m,0,0,g),g.push("</ul>"),g.join("")}var w={heading:function(e){var t=y.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(s.a)(t,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||""),r=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(r)>=0){var o=E(),a=i;i=o,_[o]={type:"block",expression:a}}return{type:"code",raw:n,lang:r,text:i}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,E=function(){return"__special_katext_id_".concat(S++,"__")},_={};function O(){S=0,_={}}function N(e){return e=e.replace(k,(function(e,t){var n=E();return _[n]={type:"inline",expression:t},n}))}var T=v.listitem;v.listitem=function(e){return T(N(e))};var L=v.paragraph;v.paragraph=function(e){return L(N(e))};var A=v.tablecell;v.tablecell=function(e,t){return A(N(e),t)},v.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:Object(f.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:Object(f.escape)(e,!0))+"</code></pre>"},v.heading=function(e,t,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:i,level:t,text:e}),"<h"+t+' id="'+i+'">'+e+"</h"+t+">"},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:w,renderer:v});var M=p.a,j=(n("SJMd"),n("ulZh")),D=n.n(j),P=n("m3rI"),I=n("Oy/b"),R=n("p5ED"),B=n("ErOA"),z=function(e,t){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function F(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function H(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function W(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function V(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}var G=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n],o=r[0],a=r[1];e.setAttribute(o,a)}},e.createRect=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",t.toString()),r.setAttribute("height",n.toString()),i&&e.setAttributes(r,i),r},e.createLine=function(t,n,i,r,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",t.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",i.toString()),a.setAttribute("y2",r.toString()),o&&e.setAttributes(a,o),a},e.createPolygon=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",t),n&&e.setAttributes(i,n),i},e.createCircle=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(t/2).toString()),i.setAttribute("cy",(t/2).toString()),i.setAttribute("r",t.toString()),n&&e.setAttributes(i,n),i},e.createEllipse=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(t/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&e.setAttributes(r,i),r},e.createGroup=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(n,t),n},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,n,i,r,o,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",a.toString()]]),l.appendChild(s),l},e.createText=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),t&&e.setAttributes(n,t),n},e.createTSpan=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=t,n&&e.setAttributes(i,n),i},e.createImage=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(n,t),n},e.createPoint=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=e,n.y=t,n},e.createPath=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),n&&e.setAttributes(i,n),i},e}(),K=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),U=function(){function e(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return e.prototype.rasterize=function(e,t,n){var i=this;return new Promise((function(r){var o=void 0!==n?n:document.createElement("canvas");null===e&&(i.markersOnly=!0,i.naturalSize=!1);var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",t.width.baseVal.valueAsString),a.setAttribute("height",t.height.baseVal.valueAsString),a.setAttribute("viewBox","0 0 "+t.viewBox.baseVal.width.toString()+" "+t.viewBox.baseVal.height.toString()),a.innerHTML=t.innerHTML,!0===i.naturalSize?(a.width.baseVal.value=e.naturalWidth,a.height.baseVal.value=e.naturalHeight):void 0!==i.width&&void 0!==i.height&&(a.width.baseVal.value=i.width,a.height.baseVal.value=i.height),o.width=a.width.baseVal.value,o.height=a.height.baseVal.value;var s=a.outerHTML,l=o.getContext("2d");!0!==i.markersOnly&&l.drawImage(e,0,0,o.width,o.height);var c=window.URL,u=new Image(o.width,o.height);u.setAttribute("crossOrigin","anonymous");var h=new Blob([s],{type:"image/svg+xml"}),d=c.createObjectURL(h);u.onload=function(){l.drawImage(u,0,0),c.revokeObjectURL(d);var e=o.toDataURL(i.imageType,i.imageQuality);r(e)},u.src=d}))},e}(),q=function(){},$=function(){function e(e){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new Y("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Y("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Y("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new X("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new X("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),Y=function(e,t){this.selector=e,this.style=t},X=function(e,t){this.localName=e,this.style=t},Z=function(){function e(e,t,n,i,r){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=e,this.displayMode=t,this.markerItems=n,this.uiStyleSettings=i,this.styles=r,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return e.prototype.show=function(e){var t=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",this.uiContainer.appendChild(n),this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach((function(e){var n=document.createElement("div");n.className=""+t.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",e.typeName),n.innerHTML=e.icon,n.addEventListener("click",(function(){t.markerToolbarButtonClicked(n,e)})),t.buttons.push(n),t.markerButtons.push(n)})),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},e.prototype.addButtonClickListener=function(e){this.buttonClickListeners.push(e)},e.prototype.removeButtonClickListener=function(e){this.buttonClickListeners.indexOf(e)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(e),1)},e.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},e.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var e=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var t=0;t<this.markerButtons.length;t++)t<e||t===e&&this.markerButtons.length-1===e?this.markerButtonBlock.appendChild(this.markerButtons[t]):(t===e&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[t]))}},e.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},e.prototype.resetButtonStyles=function(){var e=this;this.buttons.forEach((function(t){t.className=t.className.replace(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name,"").trim(),t.className=t.className.replace(e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:e.toolbarActiveButtonStyleColorsClass.name,"").trim(),t.className+=" "+(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name)}))},e.prototype.addActionButton=function(e,t,n){var i=this,r=document.createElement("div");switch(r.className=""+this.toolbarButtonStyleClass.name,r.innerHTML=t,r.setAttribute("data-action",n),r.addEventListener("click",(function(){i.actionToolbarButtonClicked(r,n)})),n){case"select":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":r.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":r.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":r.style.fill=this.uiStyleSettings.closeButtonColor}e.appendChild(r),this.buttons.push(r)},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new X("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new X("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new X("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new X("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new X("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new X("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new X("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new X("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new Y("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Y("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},e.prototype.markerToolbarButtonClicked=function(e,t){this.setActiveButton(e),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("marker",t)})),this.markerButtonOverflowBlock.style.display="none"},e.prototype.actionToolbarButtonClicked=function(e,t){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("action",t)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},e.prototype.setActiveButton=function(e){this.resetButtonStyles(),e.className=e.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),e.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},e.prototype.setActiveMarkerButton=function(e){var t=this.markerButtons.find((function(t){return t.getAttribute("data-type-name")===e}));t&&this.setActiveButton(t)},e.prototype.setCurrentMarker=function(e){var t=this;this.currentMarker=e,this.buttons.filter((function(e){return/delete|notes/.test(e.getAttribute("data-action"))})).forEach((function(e){void 0===t.currentMarker?(e.style.fillOpacity="0.4",e.style.pointerEvents="none"):(e.style.fillOpacity="1",e.style.pointerEvents="all")}))},e}(),J=function(){function e(e,t,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=e,this.displayMode=t,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return e.prototype.addStyles=function(){var e;this.toolboxStyleClass=this.styles.addClass(new X("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new X("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new X("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new X("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new X("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new X("toolbox-panel-row_colors","\n background-color: "+(null!==(e=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==e?e:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new X("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new X("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new X("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new Y("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new Y("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},e.prototype.show=function(e){var t;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==t?t:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},e.prototype.setPanelButtons=function(e){var t,n,i=this;this.panels=e,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==t?t:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(e){var t;e.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(t=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==t?t:i.toolboxButtonStyleColorsClass.name),n.innerHTML=e.icon,n.title=e.title,n.addEventListener("click",(function(){i.panelButtonClick(e)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},e.prototype.panelButtonClick=function(e){var t=this,n=-1;if(e!==this.activePanel){n=this.panels.indexOf(e),this.panelRow.innerHTML="";var i=e.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=e}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===t.displayMode?t.panelRow.style.display="none":t.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(e,i){var r,o;e.className=t.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=t.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:t.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=t.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:t.toolboxButtonStyleColorsClass.name))}))},e}(),Q=function(e,t){this.title=e,this.icon=t},ee=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=e.getColorBox(n);t.appendChild(i),e.colorBoxes.push(i)})),t},t.prototype.getColorBox=function(e){var t=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=e===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentColor(e,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=e,o.style.borderRadius=i/2+"px","transparent"===e&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='<svg viewBox="0 0 24 24">\n <path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />\n </svg>'),r.appendChild(o),r},t.prototype.setCurrentColor=function(e,t){var n=this;this.currentColor=e,this.colorBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(e)},t}(Q),te=function(){function e(e,t,n){this._state="new",this._isSelected=!1,this._container=e,this._overlayContainer=t,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(e.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!1},Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},e.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},e.prototype.pointerDown=function(e,t){},e.prototype.dblClick=function(e,t){},e.prototype.manipulate=function(e){},e.prototype.pointerUp=function(e){this.stateChanged()},e.prototype.dispose=function(){},e.prototype.addMarkerVisualToContainer=function(e){this.container.childNodes.length>0?this.container.insertBefore(e,this.container.childNodes[0]):this.container.appendChild(e)},e.prototype.getState=function(){return{typeName:e.typeName,state:this.state,notes:this.notes}},e.prototype.restoreState=function(e){this._state=e.state,this.notes=e.notes},e.prototype.scale=function(e,t){},e.prototype.colorChanged=function(e){this.onColorChanged&&this.onColorChanged(e),this.stateChanged()},e.prototype.fillColorChanged=function(e){this.onFillColorChanged&&this.onFillColorChanged(e),this.stateChanged()},e.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var e=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),e.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(e)&&this.onStateChanged(this)}},e.typeName="MarkerBase",e}(),ne=function(){function e(){this.findGripByVisual=this.findGripByVisual.bind(this)}return e.prototype.findGripByVisual=function(e){return this.topLeft.ownsTarget(e)?this.topLeft:this.topCenter.ownsTarget(e)?this.topCenter:this.topRight.ownsTarget(e)?this.topRight:this.centerLeft.ownsTarget(e)?this.centerLeft:this.centerRight.ownsTarget(e)?this.centerRight:this.bottomLeft.ownsTarget(e)?this.bottomLeft:this.bottomCenter.ownsTarget(e)?this.bottomCenter:this.bottomRight.ownsTarget(e)?this.bottomRight:void 0},e}(),ie=function(){function e(){this.GRIP_SIZE=10,this.visual=G.createGroup(),this.visual.appendChild(G.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(G.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e}(),re=function(){function e(){}return e.toITransformMatrix=function(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}},e.toSVGMatrix=function(e,t){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e},e}(),oe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(G.createTransform()),r.setupControlBox(),r}return F(t,e),Object.defineProperty(t.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visual",{get:function(){return this._visual},set:function(e){this._visual=e;var t=G.createTransform();this._visual.transform.baseVal.appendItem(t)},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!!(void 0!==this.controlGrips.findGripByVisual(t)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.left=t.x,this.top=t.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(t);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(t),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},t.prototype.moveVisual=function(e){this.visual.style.transform="translate("+e.x+"px, "+e.y+"px)"},t.prototype.manipulate=function(e){var t=this.unrotatePoint(e);"creating"===this.state?this.resize(e):"move"===this.state?(this.left=this.manipulationStartLeft+(t.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(t.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(t):"rotate"===this.state&&this.rotate(e)},t.prototype.resize=function(e){var t=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:t=this.manipulationStartLeft+e.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-t;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+e.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+e.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+e.y-this.manipulationStartY}n>=0?(this.left=t,this.width=n):(this.left=t+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},t.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},t.prototype.rotate=function(e){if(Math.abs(e.x-this.centerX)>.1){var t=Math.sign(e.x-this.centerX);this.rotationAngle=180*Math.atan((e.y-this.centerY)/(e.x-this.centerX))/Math.PI+90*t,this.applyRotation()}},t.prototype.applyRotation=function(){var e=this.container.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(e,0)},t.prototype.rotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM(),n=G.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.unrotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM();t=t.inverse();var n=G.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=G.createGroup();var e=G.createTransform();e.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(e),this.container.appendChild(this.controlBox),this.controlRect=G.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=G.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 ne,this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){var e=this.controlBox.transform.baseVal.getItem(0);e.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(e,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},t.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},t.prototype.createGrip=function(){var e=new ie;return e.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.controlGrips.topLeft.GRIP_SIZE,t=-e/2,n=t,i=(this.width+this.CB_DISTANCE)/2-e/2,r=(this.height+this.CB_DISTANCE)/2-e/2,o=this.height+this.CB_DISTANCE-e/2,a=this.width+this.CB_DISTANCE-e/2;this.positionGrip(this.controlGrips.topLeft.visual,t,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,t,r),this.positionGrip(this.controlGrips.centerRight.visual,a,r),this.positionGrip(this.controlGrips.bottomLeft.visual,t,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.hideControlBox=function(){this.controlBox.style.display="none"},t.prototype.showControlBox=function(){this.controlBox.style.display=""},t.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:re.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:re.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*t,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*t,this.height=this.height*n,this.adjustControlBox()},t}(te),ae=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.title="Rectangle marker",t}(oe),se=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentWidth?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentWidth(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+e.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),i.appendChild(o),e.widthBoxes.push(i)})),t},t.prototype.setCurrentWidth=function(e,t){var n=this;this.currentWidth=e,this.widthBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},t}(Q),le=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.styles.length-5+"%",i.style.borderColor=n===e.currentStyle?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentStyle(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+e.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";r.innerHTML=o,i.appendChild(r),e.styleBoxes.push(i)})),t},t.prototype.setCurrentStyle=function(e,t){var n=this;this.currentStyle=e,this.styleBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},t}(Q),ce=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new ee("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="FrameMarker",t.title="Frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',t}(ae),ue=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},he=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return F(t,e),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!(!this.grip1.ownsTarget(t)&&!this.grip2.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartX=t.x,this.manipulationStartY=t.y,"new"===this.state&&(this.x1=t.x,this.y1=t.y,this.x2=t.x,this.y2=t.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&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(t),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},t.prototype.adjustVisual=function(){},t.prototype.manipulate=function(e){"creating"===this.state?this.resize(e):"move"===this.state?(this.x1=this.manipulationStartX1+e.x-this.manipulationStartX,this.y1=this.manipulationStartY1+e.y-this.manipulationStartY,this.x2=this.manipulationStartX2+e.x-this.manipulationStartX,this.y2=this.manipulationStartY2+e.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(e)},t.prototype.resize=function(e){switch(this.activeGrip){case this.grip1:this.x1=e.x,this.y1=e.y;break;case this.grip2:case void 0:this.x2=e.x,this.y2=e.y}this.adjustVisual(),this.adjustControlBox()},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=G.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){this.positionGrips()},t.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},t.prototype.createGrip=function(){var e=new ie;return e.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-e/2,this.y1-e/2),this.positionGrip(this.grip2.visual,this.x2-e/2,this.y2-e/2)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.x1=this.x1*t,this.y1=this.y1*n,this.x2=this.x2*t,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},t}(te),de=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new ee("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorLine&&t!==this.visibleLine)},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorLine=G.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},t.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()),G.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},t.typeName="LineMarker",t.title="Line marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',t}(he),pe=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.fonts.length-5+"%",i.style.borderColor=n===e.currentFont?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentFont(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),e.fontBoxes.push(i)})),t},t.prototype.setCurrentFont=function(e,t){var n=this;this.currentFont=e,this.fontBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},t}(Q),fe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="your text here",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new ee("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new pe("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return F(t,e),t.prototype.ownsTarget=function(t){if(e.prototype.ownsTarget.call(this,t)||t===this.visual||t===this.textElement||t===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(e){e===t&&(n=!0)})),n},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.bgRectangle=G.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=G.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.renderText=function(){var e=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(t){e.textElement.appendChild(G.createTSpan(""===t.trim()?" ":t.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},t.prototype.getTextScale=function(){var e=this.textElement.getBBox(),t=1;if(e.width>0&&e.height>0){var n=(1*this.width-this.width*this.padding*2/100)/e.width,i=(1*this.height-this.height*this.padding*2/100)/e.height;t=Math.min(n,i)}return t},t.prototype.getTextPosition=function(e){var t=this.textElement.getBBox(),n=0,i=0;return t.width>0&&t.height>0&&(n=(this.width-t.width*e)/2,i=this.height/2-t.height*e/2),{x:n,y:i}},t.prototype.sizeText=function(){var e=this.textElement.getBBox(),t=this.getTextScale(),n=this.getTextPosition(t);n.y-=e.y*t,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+t+", "+t+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(t,t))},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.isMoved=!0,this.setSize(),this.sizeText()},t.prototype.setSize=function(){e.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},t.prototype.pointerUp=function(t){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),e.prototype.pointerUp.call(this,t),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var t=Number.parseFloat(e.textEditor.style.fontSize);e.textEditor.clientWidth>=Number.parseInt(e.textEditor.style.maxWidth)&&t>.9;)t-=.1,e.textEditor.style.fontSize=Math.max(t,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(e){if(e.clipboardData){var t=e.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(t)),e.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){e.textEditDivClicked(e.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},t.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var e=this.getTextScale(),t=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*e,y:n.height*e};t.x-=i.x/2,t.y-=i.y/2,this.textEditor.style.top=t.y+"px",this.textEditor.style.left=t.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-t.x+"px",this.textEditor.style.fontSize=Math.max(16*e,12)+"px",this.textElement.style.display="none"}},t.prototype.textEditDivClicked=function(e){this.text=e.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},t.prototype.select=function(){e.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},t.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),e.prototype.deselect.call(this)},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setColor=function(e){this.textElement&&G.setAttributes(this.textElement,[["fill",e]]),this.color=e,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(e)},t.prototype.setFont=function(e){this.textElement&&G.setAttributes(this.textElement,[["font-family",e]]),this.fontFamily=e,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},t.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},t.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize(),this.sizeText(),this.positionTextEditor()},t.typeName="TextMarker",t.title="Text marker",t.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',t}(oe),me=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new ee("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.drawingImage)},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.drawingImage=G.createImage(),this.visual.appendChild(this.drawingImage);var e=G.createTransform();this.visual.transform.baseVal.appendItem(e),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(t.x,t.y),this.drawing=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.manipulate=function(t){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(t.x,t.y),this.canvasContext.stroke()):e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):e.prototype.pointerUp.call(this,t)},t.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)},t.prototype.select=function(){"creating"===this.state&&this.finishCreation(),e.prototype.select.call(this)},t.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),e.prototype.deselect.call(this)},t.prototype.finishCreation=function(){for(var e=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),t=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=t[0],i=t[1],r=t[2],o=t[3],a=!1,s=0;s<this.canvasElement.height;s++)for(var l=0;l<this.canvasElement.width;l++)e.data[s*this.canvasElement.width*4+4*l+3]>0&&(a=!0,s<i&&(i=s),l<n&&(n=l),s>o&&(o=s),l>r&&(r=l));if(a){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},t.prototype.setDrawingImage=function(){G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},t.prototype.setColor=function(e){this.color=e,this.colorChanged(e)},t.prototype.setLineWidth=function(e){this.lineWidth=e},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){this.createVisual(),e.prototype.restoreState.call(this,t),this.drawingImgUrl=t.drawingImgUrl,this.setDrawingImage()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setDrawingImage()},t.typeName="FreehandMarker",t.title="Freehand marker",t.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',t}(oe),ge=function(e){function t(t,n,i){var r=e.call(this,t,i||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){e.setCurrentType(r,o)})),t.appendChild(o),"both"===r||"start"===r){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',a.style.marginLeft="5px",o.appendChild(a)}var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",s.appendChild(l),o.appendChild(s),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return t},t.prototype.setCurrentType=function(e,t){var n=this;this.currentType=e,this.typeBoxes.forEach((function(e){e.style.borderColor=e===t?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},t}(Q),ve=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new ge("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.arrow1&&t!==this.arrow2)},t.prototype.getArrowPoints=function(e,t){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return e-n/2+","+(t+i/2)+" "+e+","+(t-i/2)+" "+(e+n/2)+","+(t+i/2)},t.prototype.createTips=function(){this.arrow1=G.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=G.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",G.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),G.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},t.prototype.setArrowType=function(e){this.arrowType=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},t.typeName="ArrowMarker",t.title="Arrow marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',t}(de),ye=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new ee("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return F(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="CoverMarker",t.title="Cover marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',t}(ae),be=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",t.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentOpacity?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentOpacity(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),e.opacityBoxes.push(i)})),t},t.prototype.setCurrentOpacity=function(e,t){var n=this;this.currentOpacity=e,this.opacityBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},t}(Q),xe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new ee("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new be("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return F(t,e),t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&G.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="HighlightMarker",t.title="Highlight marker",t.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',t}(ye),Ce='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',we=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new ee("Text color",i.defaultColorSet,r.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new ee("Fill color",i.defaultColorSet,r.bgColor,Ce),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new pe("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new ie,r.tipGrip.visual.transform.baseVal.appendItem(G.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return F(t,e),t.prototype.ownsTarget=function(t){return e.prototype.ownsTarget.call(this,t)||this.tipGrip.ownsTarget(t)||this.tip===t},t.prototype.createTip=function(){G.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=G.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},t.prototype.pointerDown=function(t,n){"new"===this.state&&e.prototype.pointerDown.call(this,t,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.pointerUp=function(t){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,e.prototype.pointerUp.call(this,t);else{var n="creating"===this.state;e.prototype.pointerUp.call(this,t),this.setTipPoints(n),this.positionTip()}},t.prototype.manipulate=function(t){if(this.tipMoving){var n=this.unrotatePoint(t);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else e.prototype.manipulate.call(this,t)},t.prototype.setBgColor=function(e){this.bgRectangle&&this.tip&&(G.setAttributes(this.bgRectangle,[["fill",e]]),G.setAttributes(this.tip,[["fill",e]])),this.bgColor=e,this.fillColorChanged(e)},t.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},t.prototype.setTipPoints=function(e){void 0===e&&(e=!1);var t=Math.min(this.height/2,15),n=this.height/5;e&&(this.tipPosition={x:t+n/2,y:this.height+20});var i=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:0},this.tipBase2Position={x:t+n,y:0}):(this.tipBase1Position={x:0,y:t},this.tipBase2Position={x:0,y:t+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:0},this.tipBase2Position={x:this.width-t,y:0}):(this.tipBase1Position={x:this.width,y:t},this.tipBase2Position={x:this.width,y:t+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?i<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:this.height},this.tipBase2Position={x:this.width-t,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-t-n},this.tipBase2Position={x:this.width,y:this.height-t}):i<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:this.height},this.tipBase2Position={x:t+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-t},this.tipBase2Position={x:0,y:this.height-t-n})},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.positionTip()},t.prototype.positionTip=function(){G.setAttributes(this.tip,[["points",this.getTipPoints()]]);var e=this.tipGrip.visual.transform.baseVal.getItem(0);e.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(e,0)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.positionTip(),e.prototype.select.call(this)},t.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,e.prototype.restoreState.call(this,t),this.createTip(),this.setTipPoints()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.tipPosition={x:this.tipPosition.x*t,y:this.tipPosition.y*n},this.positionTip()},t.typeName="CalloutMarker",t.title="Callout marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',t}(fe),ke=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.setOpacity=r.setOpacity.bind(r),r.createVisual=r.createVisual.bind(r),r.strokePanel=new ee("Line color",V(i.defaultColorSet,["transparent"]),i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new ee("Fill color",V(i.defaultColorSet,["transparent"]),r.fillColor,Ce),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new be("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),G.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&G.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.typeName="EllipseMarker",t.title="Ellipse marker",t.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',t}(oe),Se=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return F(t,e),Object.defineProperty(t.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.tip1&&t!==this.tip2)},t.prototype.createTips=function(){this.tip1=G.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(G.createTransform()),this.visual.appendChild(this.tip1),this.tip2=G.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(G.createTransform()),this.visual.appendChild(this.tip2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(G.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()]]),G.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 t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t),this.createTips(),this.adjustVisual()},t.typeName="MeasurementMarker",t.title="Measurement marker",t.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',t}(de),Ee=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return F(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="EllipseFrameMarker",t.title="Ellipse frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',t}(ke),_e=function(){function e(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),e.prototype.addUndoStep=function(e){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(e)||(this.undoStack.push(e),JSON.stringify(this.lastRedoStep)!==JSON.stringify(e)&&this.redoStack.splice(0,this.redoStack.length))},e.prototype.replaceLastUndoStep=function(e){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=e)},e.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();return void 0!==e&&this.redoStack.push(e),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},e.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},e}(),Oe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new ee("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorCurve&&t!==this.visibleCurve&&!this.curveGrip.ownsTarget(t))},t.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorCurve=G.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=t.x,this.curveY=t.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},t.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),G.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setupControlBox=function(){e.prototype.setupControlBox.call(this),this.curveControlLine1=G.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=G.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)},t.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,e.prototype.addControlGrips.call(this)},t.prototype.positionGrips=function(){e.prototype.positionGrips.call(this);var t=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-t/2,this.curveY-t/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()))},t.prototype.manipulate=function(t){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+t.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+t.y-this.manipulationStartY),e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){this.activeGrip===this.curveGrip&&(this.curveX=t.x,this.curveY=t.y),e.prototype.resize.call(this,t),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual()},t.prototype.scale=function(t,n){this.curveX=this.curveX*t,this.curveY=this.curveY*n,e.prototype.scale.call(this,t,n)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},t.typeName="CurveMarker",t.title="Curve marker",t.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',t}(he),Ne=function(){function e(e,t){void 0===t&&(t=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=e,this.cancelable=t}return Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this._defaultPrevented=!0},e}(),Te=function(e){function t(t,n,i){var r=e.call(this,t,!1)||this;return r.dataUrl=n,r.state=i,r}return F(t,e),t}(Ne),Le=function(e){function t(t,n,i){void 0===i&&(i=!1);var r=e.call(this,t,i)||this;return r.marker=n,r}return F(t,e),t}(Ne),Ae=function(){function e(){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 e.prototype.addEventListener=function(e,t){this[e].push(t)},e.prototype.removeEventListener=function(e,t){var n=this[e].indexOf(t);n>-1&&this[e].splice(n,1)},e}(),Me=function(){function e(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ue,this._isOpen=!1,this.undoRedoManager=new _e,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 Ae,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=e.instanceCounter++,this.styles=new $(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.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(e.prototype,"ALL_MARKER_TYPES",{get:function(){return[ce,me,ve,fe,Ee,ke,xe,we,Se,ye,de,Oe]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ce,me,ve,fe,ke,xe,we]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ce,me,ve,fe,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(e){var t=this;this._availableMarkerTypes.splice(0),e.forEach((function(e){if("string"==typeof e){var n=t.ALL_MARKER_TYPES.find((function(t){return t.typeName===e}));void 0!==n&&t._availableMarkerTypes.push(n)}else t._availableMarkerTypes.push(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){this._zoomLevel=e,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=this;void 0===this.styles.styleSheetRoot&&void 0!==q.styleSheetRoot&&(this.styles.styleSheetRoot=q.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(t){return t(new Ne(e))}))},e.prototype.render=function(){return H(this,void 0,void 0,(function(){var e;return W(this,(function(t){switch(t.label){case 0:return this.setCurrentMarker(),(e=new U).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.markersOnly=this.renderMarkersOnly,e.width=this.renderWidth,e.height=this.renderHeight,[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return t.sent(),[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,t.sent()]}}))}))},e.prototype.close=function(e){var t=this;if(void 0===e&&(e=!1),this.isOpen){var n=!1;e||this.eventListeners.beforeclose.forEach((function(e){var i=new Ne(t,!0);e(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(e){return e(new Ne(t))})),this.detachEvents(),this._isOpen=!1)}},e.prototype.addMarkersToToolbar=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this._availableMarkerTypes).push.apply(e,t)},e.prototype.addRenderEventListener=function(e){this.addEventListener("render",(function(t){e(t.dataUrl,t.state)}))},e.prototype.removeRenderEventListener=function(e){},e.prototype.addCloseEventListener=function(e){this.addEventListener("close",(function(){e()}))},e.prototype.removeCloseEventListener=function(e){},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return e.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupTargetResize=function(){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.editorCanvas.clientWidth/e>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*e:this.editorCanvas.clientWidth,n=t<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/e;this.resize(t,n)},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.resize=function(e,t){this._isResizing=!0;var n=e/this.imageWidth,i=t/this.imageHeight;this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(n,i),this._isResizing=!1},e.prototype.scaleMarkers=function(e,t){var n,i=this;this._currentMarker&&this._currentMarker instanceof fe?this._currentMarker.scale(e,t):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==i._currentMarker&&n.scale(e,t)})),void 0!==n&&this.setCurrentMarker(n)},e.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},e.prototype.setTopLeft=function(){var e=this.editingTarget.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left,this.top=e.top-t.top},e.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},e.prototype.addDefs=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.defs=G.createDefs(),this.addDefsToImage(),(e=this.defs).append.apply(e,t)},e.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},e.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},e.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},e.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},e.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},e.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},e.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},e.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var e=document.createElement("a");e.href="https://markerjs.com/",e.target="_blank",e.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',e.title="Powered by marker.js",e.style.display="grid",e.style.alignItems="center",e.style.justifyItems="center",e.style.padding="3px",e.style.width="20px",e.style.height="20px",this.logoUI.appendChild(e),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},e.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Z(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new J(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},e.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.removeMarker=function(e){this.markerImage.removeChild(e.container),this.markers.indexOf(e)>-1&&this.markers.splice(this.markers.indexOf(e),1),e.dispose()},e.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},e.prototype.toolbarButtonClicked=function(e,t){if("marker"===e&&void 0!==t)this.createNewMarker(t);else if("action"===e)switch(t){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},e.prototype.deleteSelectedMarker=function(){var e=this;if(void 0!==this._currentMarker){var t=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new Le(e,e._currentMarker,!0);n(i),i.defaultPrevented&&(t=!0)})),!t){var n=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(t){return t(new Le(e,n))}))}}},e.prototype.clear=function(){var e=this,t=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new Le(e,void 0,!0);n(i),i.defaultPrevented&&(t=!0)})),!t)){this.setCurrentMarker();for(var n=function(t){var n=i.markers[t];i.setCurrentMarker(i.markers[t]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(t){return t(new Le(e,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(e.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),e.prototype.showNotesEditor=function(){var e;void 0!==this._currentMarker&&(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=null!==(e=this._currentMarker.notes)&&void 0!==e?e:"",this.overlayContainer.appendChild(this.notesArea))},e.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},e.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},e.prototype.addUndoStep=function(){var e=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var t=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===t.width&&n.height===t.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(t),i<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(t){return t(new Ne(e))}))}else this.undoRedoManager.replaceLastUndoStep(t),this.eventListeners.statechange.forEach((function(t){return t(new Ne(e))}))}},e.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},e.prototype.undoStep=function(){var e=this,t=this.undoRedoManager.undo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new Ne(e))})))},e.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},e.prototype.redoStep=function(){var e=this,t=this.undoRedoManager.redo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new Ne(e))})))},e.prototype.stepZoom=function(){var e=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=e<this.zoomSteps.length-1?this.zoomSteps[e+1]:this.zoomSteps[0]},e.prototype.panTo=function(e){this.contentDiv.scrollBy({left:this.prevPanPoint.x-e.x,top:this.prevPanPoint.y-e.y}),this.prevPanPoint=e},e.prototype.startRenderAndClose=function(){return H(this,void 0,void 0,(function(){var e,t,n=this;return W(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return e=i.sent(),t=this.getState(),this.eventListeners.render.forEach((function(i){return i(new Te(n,e,t))})),this.close(!0),[2]}}))}))},e.prototype.getState=function(e){!0===e&&this.setCurrentMarker();var t={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(e){return t.markers.push(e.getState())})),t},e.prototype.restoreState=function(e){var t=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);e.markers.forEach((function(e){var n=t._availableMarkerTypes.find((function(t){return t.typeName===e.typeName}));if(void 0!==n){var i=t.addNewMarker(n);i.restoreState(e),t.markers.push(i)}})),e.width&&e.height&&(e.width!==this.imageWidth||e.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/e.width,this.imageHeight/e.height),this.eventListeners.restorestate.forEach((function(e){return e(new Ne(t))}))},e.prototype.addNewMarker=function(e){var t=G.createGroup();return this.markerImage.appendChild(t),new e(t,this.overlayContainer,this.settings)},e.prototype.createNewMarker=function(e){var t,n=this;(t="string"==typeof e?this._availableMarkerTypes.find((function(t){return t.typeName===e})):e)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(t),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(t.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(e){return e(new Le(n,n._currentMarker))})))},e.prototype.markerCreated=function(e){var t=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(e),this.setCurrentMarker(e),e instanceof me&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(me):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(e){return e(new Le(t,t._currentMarker))}))},e.prototype.colorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=e,this.settings.defaultStrokeColor=e)},e.prototype.fillColorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=e)},e.prototype.markerStateChanged=function(e){var t=this;this.eventListeners.markerchange.forEach((function(n){return n(new Le(t,e))}))},e.prototype.setCurrentMarker=function(e){var t=this;this._currentMarker!==e&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(e){return e(new Le(t,t._currentMarker))}))),this._currentMarker=e,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(e){return e(new Le(t,t._currentMarker))})))},e.prototype.onPointerDown=function(e){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==e.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t?(this.setCurrentMarker(t),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:e.clientX,y:e.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY))},e.prototype.onDblClick=function(e){if(this._isFocused||this.focus(),"select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t&&t!==this._currentMarker&&this.setCurrentMarker(t),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target):this.setCurrentMarker()}},e.prototype.onPointerMove=function(e){1!==this.touchPoints&&"touch"===e.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||e.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(e.clientX,e.clientY)):this.zoomLevel>1&&this.panTo({x:e.clientX,y:e.clientY}))},e.prototype.onPointerUp=function(e){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(e.clientX,e.clientY)),this.isDragging=!1,this.addUndoStep()},e.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},e.prototype.onKeyUp=function(e){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==e.key&&"Backspace"!==e.key||this.deleteSelectedMarker()},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.markerImage.getBoundingClientRect();return{x:(e-n.left)/this.zoomLevel,y:(t-n.top)/this.zoomLevel}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.addLicenseKey=function(e){K.addKey(e)},e.prototype.addEventListener=function(e,t){this.eventListeners.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventListeners.removeEventListener(e,t)},e.prototype.renderState=function(e){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(e),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),e.prototype.focus=function(){var e=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(t){return t(new Ne(e))})))},e.prototype.blur=function(){var e=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(t){return t(new Ne(e))})))},e.instanceCounter=0,e}(),je=function(e,t){return(je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};
/* **********************************
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.
***************************************************************************** */function De(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}je(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Pe(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function Ie(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var Re=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),Be=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n],o=r[0],a=r[1];e.setAttribute(o,a)}},e.createRect=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",t.toString()),r.setAttribute("height",n.toString()),i&&e.setAttributes(r,i),r},e.createLine=function(t,n,i,r,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",t.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",i.toString()),a.setAttribute("y2",r.toString()),o&&e.setAttributes(a,o),a},e.createPolygon=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",t),n&&e.setAttributes(i,n),i},e.createCircle=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(t/2).toString()),i.setAttribute("cy",(t/2).toString()),i.setAttribute("r",t.toString()),n&&e.setAttributes(i,n),i},e.createEllipse=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(t/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&e.setAttributes(r,i),r},e.createGroup=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(n,t),n},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,n,i,r,o,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",a.toString()]]),l.appendChild(s),l},e.createText=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),t&&e.setAttributes(n,t),n},e.createTSpan=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=t,n&&e.setAttributes(i,n),i},e.createImage=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(n,t),n},e.createPoint=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=e,n.y=t,n},e.createPath=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),n&&e.setAttributes(i,n),i},e.createElement=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg",t);return n&&e.setAttributes(i,n),i},e.getHollowRectanglePath=function(e,t,n,i,r,o,a,s){return"M"+e+","+t+"V"+(t+i)+"H"+(e+n)+"V"+t+"H"+r+"V"+o+"H"+(r+a)+"V"+(o+s)+"H"+r+"V"+t+"Z"},e}(),ze=function(){function e(e){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new Fe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new He("_fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new He("_fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),Fe=function(e,t){this.selector=e,this.style=t},He=function(e,t){this.localName=e,this.style=t},We=function(){function e(){this.blocks=[],this.display=""}return e.prototype.addButtonBlock=function(e){e.className=this.blockClassName,e.buttonClassName=this.buttonClassName,e.buttonColorsClassName=this.buttonColorsClassName,e.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(e)},e.prototype.addElementBlock=function(e){void 0===e.className&&(e.className=this.blockClassName),this.blocks.push(e)},e.prototype.getUI=function(){var e=document.createElement("div");return e.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,e.style.display=this.display,this.blocks.forEach((function(t){return e.appendChild(t.getUI())})),e},e}(),Ve=function(){function e(){}return e.prototype.getUI=function(){var e=document.createElement("div");if(e.className=this.className,void 0!==this.minWidth&&(e.style.minWidth=this.minWidth),void 0!==this.contentAlign)switch(this.contentAlign){case"start":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"end":e.style.justifyContent="flex-end"}return e.style.whiteSpace="nowrap",e},e}(),Ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t}return De(t,e),t.prototype.addButton=function(e){e.className=this.buttonClassName,e.colorsClassName=this.buttonColorsClassName,e.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(e)},t.prototype.getUI=function(){var t=e.prototype.getUI.call(this);return this.buttons.forEach((function(e){return t.appendChild(e.getUI())})),t},t}(Ve),Ke=function(){function e(e,t){this._isActive=!1,this._isHidden=!1,this._icon=e,this.title=t,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(e.prototype,"icon",{get:function(){return this._icon},set:function(e){this._icon=e,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){this._isActive=e,this.adjustClassName()},enumerable:!1,configurable:!0}),e.prototype.getUI=function(){var e=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",(function(){return e.onClick()})),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},e.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},e.prototype.hide=function(){this._isHidden=!0},e}(),Ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.elements=[],t}return De(t,e),t.prototype.addElement=function(e){this.elements.push(e)},t.prototype.getUI=function(){var t=e.prototype.getUI.call(this);return this.elements.forEach((function(e){return t.appendChild(e)})),t},t}(Ve),qe=function(){function e(e,t){this.horizontal=e,this.vertical=t}return Object.defineProperty(e.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),e.prototype.getVerticalLength=function(e){return e/this.ratio},e.prototype.getHorizontalLength=function(e){return e*this.ratio},e}(),$e=function(){function e(){}return e.getIcon=function(e,t){if(e>0&&t>0){var n=new qe(e,t),i=n.ratio>=1?20:n.getHorizontalLength(20),r=n.ratio<1?20:n.getVerticalLength(20),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(o);var a=Be.createDefs();o.appendChild(a);var s=Be.createElement("clipPath",[["id","text-bg-clip"]]);a.appendChild(s);var l=Be.createPath(Be.getHollowRectanglePath((24-i)/2,(24-r)/2,i,r,(24-i)/2+2,(24-r)/2+2,i-4,r-4));o.appendChild(l);var c=Be.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(Be.createTSpan(e+":"+t)),o.appendChild(c);var u=c.getBBox();Be.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=Be.createPath(Be.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(u.width))/2,(24-Math.ceil(u.height))/2,Math.ceil(u.width),Math.ceil(u.height)));return s.appendChild(h),Be.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(o),o.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},e}(),Ye=function(e){function t(t,n,i){var r=e.call(this,t,n)||this;return r.isDropdownOpen=!1,r.onClick=r.dropdownButtonClicked,r.dropdownButtons=i,r}return De(t,e),t.prototype.setupDropdown=function(){var e=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(t){t.className=e.className,t.colorsClassName=e.colorsClassName,e.dropdownBlock.appendChild(t.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},t.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},t.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},t.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},t.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},t.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},t}(Ke),Xe=function(){function e(e,t){this.GRIP_SIZE=10,this.color=e,this.fillColor=t,this.visual=Be.createGroup(),this.visual.appendChild(Be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Be.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e.prototype.setCenter=function(e,t){this.visual.childNodes.forEach((function(n){return Be.setAttributes(n,[["cx",e.toString()],["cy",t.toString()]])}))},e}(),Ze=function(){function e(e,t,n,i){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=e,this.canvasHeight=t,this.margin=n,this.container=i,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(e.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(e){this._aspectRatio=e,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.gridContainer&&Be.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(e){this._zoomFactor=e,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),e.prototype.open=function(){var e=this;this.cropShadeElement=Be.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Be.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var t=0;t<this.numberOfGridLines;t++)this.horizontalGridLines.push(Be.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Be.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach((function(t){return e.gridContainer.appendChild(t)})),this.verticalGridLines.forEach((function(t){return e.gridContainer.appendChild(t)})),this.cropRectElement=Be.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Xe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Xe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Xe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Xe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},e.prototype.setCropRectangle=function(e){this.cropRect=e;var t=Object.assign({},this.cropRect);1!==this.zoomFactor&&(t.width=this.cropRect.width*this.zoomFactor,t.height=this.cropRect.height*this.zoomFactor,t.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-t.width/2,t.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-t.height/2),Be.setAttributes(this.cropRectElement,[["x",t.x.toString()],["y",t.y.toString()],["width",t.width.toString()],["height",t.height.toString()]]);var n=t.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(e,i){var r=t.y+n*(i+1);Be.setAttributes(e,[["x1",""+t.x],["y1",""+r],["x2",""+(t.x+t.width)],["y2",""+r]])}));var i=t.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(e,n){var r=t.x+i*(n+1);Be.setAttributes(e,[["x1",""+r],["y1",""+t.y],["x2",""+r],["y2",""+(t.y+t.height)]])})),Be.setAttributes(this.cropShadeElement,[["d",Be.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,t.x,t.y,t.width,t.height)]]),this.topLeftGrip.setCenter(t.x,t.y),this.topRightGrip.setCenter(t.x+t.width,t.y),this.bottomLeftGrip.setCenter(t.x,t.y+t.height),this.bottomRightGrip.setCenter(t.x+t.width,t.y+t.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},e.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)},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.container.getBoundingClientRect();return{x:e-n.left+this.margin,y:t-n.top+this.margin}},e.prototype.onPointerDown=function(e){this.container.setPointerCapture(e.pointerId),this.previousPoint=this.clientToLocalCoordinates(e.clientX,e.clientY),this.cropRectElement===e.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(e.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(e.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(e.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(e.target)&&(this.activeGrip=this.bottomRightGrip)},e.prototype.onPointerMove=function(e){if(this.isMoving)this.move(this.clientToLocalCoordinates(e.clientX,e.clientY));else if(this.activeGrip){var t=this.clientToLocalCoordinates(e.clientX,e.clientY);this.resize(t)}e.preventDefault()},e.prototype.onPointerUp=function(e){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(e.pointerId)},e.prototype.move=function(e){var t=e.x-this.previousPoint.x,n=e.y-this.previousPoint.y;1!==this.zoomFactor&&(t=-t/this.zoomFactor,n=-n/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+t),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+n),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=e},e.prototype.resize=function(e){var t=Object.assign({},this.cropRect),n=e.x-this.previousPoint.x,i=e.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:t.x+n<this.margin&&(n=this.margin-t.x),t.x+=n,t.width=this.cropRect.x+this.cropRect.width-t.x;break;case this.bottomRightGrip:case this.topRightGrip:t.width+n>this.canvasWidth*this.zoomFactor&&(n=this.canvasWidth*this.zoomFactor-t.width),t.width+=n}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(t.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(n),t.height=this.aspectRatio.getVerticalLength(t.width)):(t.y+=i,t.height=this.cropRect.y+this.cropRect.height-t.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?t.height=this.aspectRatio.getVerticalLength(t.width):t.height+=i}t.width<10&&(t.x=this.cropRect.x,t.width=10),t.height<10&&(t.y=this.cropRect.y,t.height=10),this.previousPoint=e,t.x>=this.margin&&t.y>=this.margin&&t.x-this.margin+t.width<=this.canvasWidth&&t.y-this.margin+t.height<=this.canvasHeight&&(this.cropRect=t,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},e.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var e=this.cropRect.x+this.cropRect.width/2,t=this.cropRect.y+this.cropRect.height/2,n=this.aspectRatio.getHorizontalLength(this.cropRect.height),i=this.aspectRatio.getVerticalLength(this.cropRect.width);n/this.canvasWidth<i/this.canvasHeight?this.cropRect.width=n:this.cropRect.height=i,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=e-this.cropRect.width/2,this.cropRect.y=t-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)}},e.prototype.getRescaledRect=function(e,t,n,i,r,o){var a=n/e,s=i/t;return{x:(r.x-o)*a+o,y:(r.y-o)*s+o,width:r.width*a,height:r.height*s}},e.prototype.scaleCanvas=function(e,t){var n=this.getRescaledRect(this.canvasWidth,this.canvasHeight,e,t,this.cropRect,this.margin);this.canvasWidth=e,this.canvasHeight=t,this.onCropChange&&this.onCropChange(n),this.setCropRectangle(n)},e}(),Je=function(){function e(e){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=e,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(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),e.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},e.prototype.onPointerDown=function(e){this.controlContainer.setPointerCapture(e.pointerId),this.isDragging=!0,this.previousPoint={x:e.clientX,y:e.clientY}},e.prototype.onPointerMove=function(e){this.isDragging&&(this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.previousPoint.x=e.clientX)},e.prototype.onPointerUp=function(e){this.isDragging&&this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(e.pointerId)},e.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var e=this.angleLabelText.getBBox();Be.setAttributes(this.angleLabelElement,[["x",((this.width-e.width)/2).toString()],["y",(this.height/2).toString()]])}},e.prototype.positionScaleShape=function(){if(this.scaleShape){var e=this.scaleShape.transform.baseVal.getItem(0);e.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(e,0)}},e.prototype.getVisual=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",this.width+"px"),e.setAttribute("height",this.height+"px"),e.setAttribute("viewBox","0 0 "+this.width+" "+this.height),e.style.flexShrink="0",document.body.appendChild(e);for(var t="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,n=1;n<=this.width/5+10;n++){var i=n%5==0?this.height/3:this.height/6;t+="h4v"+-i+"h1v"+i}t+="v1H0Z",this.scaleShape=Be.createPath(t);var r=Be.createTransform();this.scaleShape.transform.baseVal.appendItem(r),e.appendChild(this.scaleShape),this.angleLabelElement=Be.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Be.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var o=Be.createTSpan("");return o.innerHTML="&deg;",this.angleLabelElement.appendChild(o),e.appendChild(this.angleLabelElement),document.body.removeChild(e),e},e}(),Qe=function(){function e(){this.naturalSize=!1,this.imageType="image/png"}return e.prototype.rasterize=function(e,t,n,i,r,o,a){var s=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=e.width.baseVal.value-2*i,c.height=e.height.baseVal.value-2*i;var u=1,h=1;!0===s.naturalSize?(u=t.naturalWidth/(e.width.baseVal.value-2*i)/o,h=t.naturalHeight/(e.height.baseVal.value-2*i)/a,c.width=t.naturalWidth/o,c.height=t.naturalHeight/a):void 0!==s.width&&void 0!==s.height&&(u=s.width/n.width,h=s.height/n.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(r*Math.PI/180),d.scale(o,a),d.translate(-c.width/2,-c.height/2),d.drawImage(t,0,0,c.width,c.height);var p=document.createElement("canvas");p.width=n.width*u,p.height=n.height*h,p.getContext("2d").putImageData(d.getImageData((n.x-i)*u,(n.y-i)*h,n.width*u,n.height*h),0,0),l(p.toDataURL(s.imageType,s.imageQuality))}))},e}(),et=function(){function e(t){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=e.instanceCounter++,this.styles=new ze(this.instanceNo),this.target=t,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(e){this._zoomToCropEnabled=e,e?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gridLines",{get:function(){return this._gridLines},set:function(e){this._gridLines=e,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(e){this._rotationAngle=e,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){var e;return null!==(e=this._aspectRatio)&&void 0!==e?e:this.aspectRatios[0]},set:function(e){this._aspectRatio=e},enumerable:!1,configurable:!0}),e.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(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},e.prototype.show=function(){this.showUI(),this.open()},e.prototype.close=function(e){void 0===e&&(e=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),e||this.closeEventListeners.forEach((function(e){return e()})),this._isOpen=!1)},e.prototype.addRenderEventListener=function(e){this.renderEventListeners.push(e)},e.prototype.removeRenderEventListener=function(e){this.renderEventListeners.indexOf(e)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(e),1)},e.prototype.addCloseEventListener=function(e){this.closeEventListeners.push(e)},e.prototype.removeCloseEventListener=function(e){this.closeEventListeners.indexOf(e)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(e),1)},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.contentDiv.clientWidth/e>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*e:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,n=t+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/e;this.resize(t,n)}},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Be.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},e.prototype.resize=function(e,t){this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px","popup"!==this.displayMode?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},e.prototype.setEditingTarget=function(){var e=document.createElement("canvas");e.width=this.target.naturalWidth,e.height=this.target.naturalHeight,e.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var t=e.toDataURL();Be.setAttributes(this.editingTarget,[["href",t]]),this.setEditingTargetSize()},e.prototype.setTopLeft=function(){var e=this.target.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left-this.CANVAS_MARGIN,this.top=e.top-t.top-this.CANVAS_MARGIN},e.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Be.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Be.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Be.createGroup(),this.editingTargetRotationScaleContainer=Be.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var e=Be.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(e);var t=Be.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(t),this.editingTargetContainer=Be.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},e.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},e.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Be.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ze(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},e.prototype.zoomToCrop=function(){if(this.cropRect){var e=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,t=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=e+"px "+t+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-e+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-t+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},e.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},e.prototype.cropRectChanged=function(e){this.cropRect=e,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},e.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch(this.addStyles(),"popup"===this.displayMode&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var e=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,t=this.target.offsetTop>e+this.CANVAS_MARGIN?this.target.offsetTop-(e+this.CANVAS_MARGIN):0;this.coverDiv.style.top=t+"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=void 0!==this.styles.settings.zIndex?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=void 0!==this.styles.settings.zIndex?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="popup"===this.displayMode?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,"popup"===this.displayMode&&(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","popup"===this.displayMode&&(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},e.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},e.prototype.addTopToolbar=function(){var e=this;this.topToolbar=new We,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 t=new Ge;t.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(t);var n=[];this.aspectRatios.forEach((function(t){var i=new Ke($e.getIcon(t.horizontal,t.vertical),0===t.horizontal&&0===t.vertical?"FREE":t.horizontal+":"+t.vertical);i.onClick=function(){return e.ratioButtonClicked(t)},n.push(i)})),this.aspectRatioButton=new Ye($e.getIcon(0,0),"Aspect ratio",n),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,t.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var i=new Ke('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");i.isActive=this.isGridVisible,i.onClick=function(){e.isGridVisible=!e.isGridVisible,i.isActive=e.isGridVisible},t.addButton(i);var r=new Ke('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(r.isActive=this.zoomToCropEnabled,r.onClick=function(){e.zoomToCropEnabled=!e.zoomToCropEnabled,r.isActive=e.zoomToCropEnabled},t.addButton(r),!Re.isLicensed){var o=new Ue;this.topToolbar.addElementBlock(o);var a=document.createElement("div");a.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var s=document.createElement("a");s.style.color="currentColor",s.href="https://markerjs.com/products/cropro",s.target="_blank",s.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',a.appendChild(s),o.addElement(a)}var l=new Ge;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Ke('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new Ke('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");u.onClick=this.close,l.addButton(u),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(u.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},e.prototype.addBottomToolbar=function(){var e=this;this.bottomToolbar=new We,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 t=new Ge;t.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(t);var n=new Ke('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");n.onClick=this.rotateLeftButtonClicked,t.addButton(n);var i=new Ke('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");i.onClick=this.rotateRightButtonClicked,t.addButton(i);var r=new Ue;r.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(r),this.straightener=new Je("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(t){e.rotateBy(t),e.straightener.angle=e.rotationAngle},r.addElement(this.straightener.getUI());var o=new Ge;o.minWidth=2*this.toolbarHeight+"px",o.contentAlign="end",this.bottomToolbar.addButtonBlock(o);var a=new Ke('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");a.onClick=this.flipHorizontallyButtonClicked,o.addButton(a);var s=new Ke('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");s.onClick=this.flipVerticallyButtonClicked,o.addButton(s)},e.prototype.ratioButtonClicked=function(e){this.aspectRatio=e,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},e.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=$e.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},e.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new qe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},e.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},e.prototype.restoreState=function(e){if(e){var t=this.cropLayer.getRescaledRect(e.width,e.height,this.imageWidth,this.imageHeight,e.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(t),this.cropRectChanged(t),this.flippedHorizontally=e.flippedHorizontally,this.flippedVertically=e.flippedVertically,this.applyFlip(),this.rotationAngle=e.rotationAngle,this.applyRotation()}},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.cropImage.getBoundingClientRect();return{x:e-n.left,y:t-n.top}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var e=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.rotateLeftButtonClicked=function(){var e=this.rotationAngle-90;this.rotationAngle%90!=0&&(e+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateRightButtonClicked=function(){var e=this.rotationAngle+90;this.rotationAngle%90!=0&&(e-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateTo=function(e){e=(e=e>180?e-360:e)<=-180?e+360:e,this.rotationAngle=e,this.applyRotation()},e.prototype.rotateBy=function(e){this.rotateTo((this.rotationAngle+e)%360)},e.prototype.applyRotation=function(){var e=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var t=this.editingTargetRotationContainer.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(t,0);var n=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/n.width,this.imageHeight/n.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=e},e.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},e.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},e.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},e.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,(function(){var e,t;return Ie(this,(function(n){switch(n.label){case 0:return[4,this.render()];case 1:return e=n.sent(),t=this.getState(),this.renderEventListeners.forEach((function(n){return n(e,t)})),this.close(!0),[2]}}))}))},e.prototype.render=function(){return Pe(this,void 0,void 0,(function(){var e;return Ie(this,(function(t){switch(t.label){case 0:return(e=new Qe).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.width=this.renderWidth,e.height=this.renderHeight,this.unzoomFromCrop(),Be.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,e.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 t.sent(),[4,e.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,t.sent()]}}))}))},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new He("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new He("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new He("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var e=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new He("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*e)+"px;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new He("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new He("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Fe("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Fe("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new He("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new He("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new He("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -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%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new He("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new He("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},e.instanceCounter=0,e}(),tt=n("8hTe"),nt=n.n(tt),it=/<pre[^>]*>/g;t.a=function(e){var t=e.value,n=void 0===t?"":t,l=e.edit,d=void 0!==l&&l,p=e.className,f=e.showTextOnly,m=e.showLines,g=e.replaces,v=e.zoomImg,y=e.hasMask,w=e.style,k=void 0===w?{}:w,S=e.stylesPrev,E=void 0===S?{}:S,N=String(n),T=Object(u.useRef)(),L=Object(u.useRef)(),A=Object(u.useState)(""),j=Object(s.a)(A,2),z=j[0],F=j[1],H=Object(u.useState)("office"),W=Object(s.a)(H,2),V=W[0],G=W[1],K=Object(u.useMemo)((function(){try{N=(N=N.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+P.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+P.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+P.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,"\n")).replace(new RegExp("(?<!\\n)\\n(?!\\n)","g")," \n")}catch(e){}var e=M(N),t=_;if(N.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",C()),b()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,n){var i=t[n],r=i.type,o=i.expression;return Object(I.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),O(),f){var n=document.createElement("div");return n.innerHTML=e,n.innerText}return setTimeout((function(){return $()}),500),e}),[N]),U=Object(u.useRef)();function q(e){var t=e.target;if("IMG"===t.tagName.toUpperCase()){if(v){var n=t.getAttribute("src");F(n),G("image")}}else if("A"===t.tagName.toUpperCase()){var i=t.getAttribute("href");if(i.indexOf("office")>-1)e.preventDefault(),F(i),G("office");else if(i.indexOf("application/pdf")>-1)e.preventDefault(),F(i),G("pdf");else if(i.indexOf("type=text")>-1)e.preventDefault(),F(i),G("html");else if(i.startsWith("#")){e.preventDefault();var r=document.getElementById(i.replace("#",""));r&&r.scrollIntoView(!0)}}}x.WebkitLineClamp=m,m&&(k=Object(o.a)(Object(o.a)({},k),x));var $=function(){var e,t=null===(e=U.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(D.a.isSupported()){var t=new D.a;t.loadSource(e.src),t.attachMedia(e)}}))};Object(u.useEffect)((function(){if(U.current&&K&&K.match(it)&&window.PR.prettyPrint(),U.current)return U.current.addEventListener("click",q),function(){U.current.removeEventListener("click",q),O(),b()}}),[K,U.current,q]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:U,style:Object(o.a)({},k),className:"".concat(p||""," markdown-body ").concat(nt.a.mdBody),onMouseOver:function(e){d&&("IMG"===e.target.nodeName?(T.current.style.display="flex",T.current.style.width=e.target.clientWidth+"px",T.current.style.height=e.target.clientHeight+"px",T.current.style.top=e.target.offsetTop+"px",T.current.style.left=e.target.offsetLeft+"px",L.current.src=e.target.getAttribute("src")):T.current.style.display="none")},dangerouslySetInnerHTML:{__html:K}}),h.a.createElement("div",{ref:T,className:nt.a.button},h.a.createElement(i.a,null,h.a.createElement(r.a,{onClick:function(){return(e=new et(L.current)).displayMode="popup",e.addRenderEventListener(function(){var e=Object(a.a)(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T.current.style.display="none",e.next=3,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t}});case 3:null!=(n=e.sent)&&n.id&&g(L.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),void e.show();var e}},"裁剪"),h.a.createElement(r.a,{onClick:function(){return(e=new Me(L.current)).settings.displayMode="popup",e.addEventListener("render",function(){var e=Object(a.a)(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T.current.style.display="none",!L.current){e.next=6;break}return e.next=4,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t.dataUrl}});case 4:null!=(n=e.sent)&&n.id&&g(L.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.show(),void(window.markerArea=e);var e}},"编辑"))),h.a.createElement("img",{ref:L,src:"https://ali-cdn.educoder.net/images/avatars/PortalImage/170?t=1659681136",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),h.a.createElement(R.a,{close:!0,data:z,hasMask:y,type:null!=z&&z.length?V:"",style:Object(o.a)({},E),onClose:function(){return F("")}}))}},"9VGf":
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! react */"q1tI");function r(e,t){var n=Object(i.useRef)();Object(i.useEffect)((function(){n.current=e})),Object(i.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},"A+k2":
/*!*************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/Tabs/index.less?modules ***!
\*************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:
/*!********************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closetag.js ***!
\********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){e.defineOption("autoCloseTags",!1,(function(a,s,l){if(l!=e.Init&&l&&a.removeKeyMap("autoCloseTags"),s){var c={name:"autoCloseTags"};"object"==typeof s&&!1===s.whenClosing||(c["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:i(t,!0)}(t)}),"object"==typeof s&&!1===s.whenOpening||(c["'>'"]=function(i){return function(i){if(i.getOption("disableInput"))return e.Pass;for(var a=i.listSelections(),s=[],l=i.getOption("autoCloseTags"),c=0;c<a.length;c++){if(!a[c].empty())return e.Pass;var u=a[c].head,h=i.getTokenAt(u),d=e.innerMode(i.getMode(),h.state),p=d.state,f=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(p),m=f&&f.name;if(!m)return e.Pass;var g="html"==d.mode.configuration,v="object"==typeof l&&l.dontCloseTags||g&&t,y="object"==typeof l&&l.indentTags||g&&n;h.end>u.ch&&(m=m.slice(0,m.length-h.end+u.ch));var b=m.toLowerCase();if(!m||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&f.close||h.string.indexOf("/")==u.ch-h.start-1||v&&r(v,b)>-1||o(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p)||[],m,u,!0))return e.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&r(x,m)>-1)s[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var C=y&&r(y,b)>-1;s[c]={indent:C,text:">"+(C?"\n\n":"")+"</"+m+">",newPos:C?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var w="object"==typeof l&&l.dontIndentOnAutoClose;for(c=a.length-1;c>=0;c--){var k=s[c];i.replaceRange(k.text,a[c].head,a[c].anchor,"+insert");var S=i.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!w&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}(i)}),a.addKeyMap(c)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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 i(t,n){for(var i=t.listSelections(),r=[],a=n?"/":"</",s=t.getOption("autoCloseTags"),l="object"==typeof s&&s.dontIndentOnSlash,c=0;c<i.length;c++){if(!i[c].empty())return e.Pass;var u=i[c].head,h=t.getTokenAt(u),d=e.innerMode(t.getMode(),h.state),p=d.state;if(n&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return e.Pass;var f,m="xml"!=d.mode.name&&"htmlmixed"==t.getMode().name;if(m&&"javascript"==d.mode.name)f=a+"script";else if(m&&"css"==d.mode.name)f=a+"style";else{var g=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p);if(!g||g.length&&o(t,g,g[g.length-1],u))return e.Pass;f=a+g[g.length-1]}">"!=t.getLine(u.line).charAt(h.end)&&(f+=">"),r[c]=f}if(t.replaceSelections(r),i=t.listSelections(),!l)for(c=0;c<i.length;c++)(c==i.length-1||i[c].head.line<i[c+1].head.line)&&t.indentLine(i[c].head.line)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;++n)if(e[n]==t)return n;return-1}function o(t,n,i,r,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),s=e.scanForClosingTag(t,r,null,a);if(!s||s.tag!=i)return!1;for(var l=o?1:0,c=n.length-1;c>=0&&n[c]==i;c--)++l;for(r=s.to,c=1;c<l;c++){var u=e.scanForClosingTag(t,r,null,a);if(!u||u.tag!=i)return!1;r=u.to}return!0}e.commands.closeTag=function(e){return i(e)}}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../fold/xml-fold */"osHv"))},BjJ7:
/*!*********************************!*\
!*** ./src/pages/tasks/util.js ***!
\*********************************/
/*! exports provided: isCompileOk, getTreeData, processTreeData, debounce, isProd, apiPref */
/*! exports used: apiPref, debounce, getTreeData, isCompileOk, processTreeData */function(e,t,n){"use strict";function i(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i<e.length;i++){var r=e[i],o=t?"".concat(t,"/").concat(r.name):"".concat(r.name);n.push({title:r.name,isLeaf:"tree"!==r.type,key:o})}return n}function o(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(r.key===t){r.children=n;break}r.children&&o(r.children,t,n)}return e}function a(e,t,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||e.apply(r,o)},s=n&&!i;clearTimeout(i),i=setTimeout(a,t),s&&e.apply(r,o)}}n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var s=n(/*! @/utils/env */"m3rI").a.API_SERVER},"C+DQ":
/*!*********************************************************!*\
!*** ./src/components/markdown-editor/css/iconfont.css ***!
\*********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},D1Df:
/*!************************************************!*\
!*** ./node_modules/qrcode.react/lib/index.js ***!
\************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function h(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?p(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=n(/*! react */"q1tI"),y=(n(/*! prop-types */"17x9"),n(/*! qr.js/lib/QRCode */"H38U")),b=n(/*! qr.js/lib/ErrorCorrectLevel */"aRTE");function x(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i<2048?(t+=String.fromCharCode(192|i>>6),t+=String.fromCharCode(128|63&i)):i<55296||i>=57344?(t+=String.fromCharCode(224|i>>12),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|63&i)):(n++,i=65536+((1023&i)<<10|1023&e.charCodeAt(n)),t+=String.fromCharCode(240|i>>18),t+=String.fromCharCode(128|i>>12&63),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|63&i))}return t}var C={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return e.forEach((function(e,i){var r=null;e.forEach((function(o,a){if(!o&&null!==r)return n.push("M".concat(r+t," ").concat(i+t,"h").concat(a-r,"v1H").concat(r+t,"z")),void(r=null);if(a!==e.length-1)o&&null===r&&(r=a);else{if(!o)return;null===r?n.push("M".concat(a+t,",").concat(i+t," h1v1H").concat(a+t,"z")):n.push("M".concat(r+t,",").concat(i+t," h").concat(a+1-r,"v1H").concat(r+t,"z"))}}))})),n.join("")}function k(e,t){return e.slice().map((function(e,n){return n<t.y||n>=t.y+t.h?e:e.map((function(e,n){return(n<t.x||n>=t.x+t.w)&&e}))}))}function S(e,t){var n=e.imageSettings,i=e.size,r=e.includeMargin;if(null==n)return null;var o=r?4:0,a=t.length+2*o,s=Math.floor(.1*i),l=a/i,c=(n.width||s)*l,u=(n.height||s)*l,h=null==n.x?t.length/2-c/2:n.x*l,d=null==n.y?t.length/2-u/2:n.y*l,p=null;if(n.excavate){var f=Math.floor(h),m=Math.floor(d);p={x:f,y:m,w:Math.ceil(c+h-f),h:Math.ceil(u+d-m)}}return{x:h,y:d,h:u,w:c,excavation:p}}var E=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}(),_=function(e){function t(){var e,n;l(this,t);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return g(p(n=h(this,(e=d(t)).call.apply(e,[this].concat(r)))),"_canvas",void 0),g(p(n),"_image",void 0),g(p(n),"state",{imgLoaded:!1}),g(p(n),"handleImageLoad",(function(){n.setState({imgLoaded:!0})})),n}return f(t,e),u(t,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var e=this.props,t=e.value,n=e.size,i=e.level,r=e.bgColor,o=e.fgColor,a=e.includeMargin,s=e.imageSettings,l=new y(-1,b[i]);if(l.addData(x(t)),l.make(),null!=this._canvas){var c=this._canvas,u=c.getContext("2d");if(!u)return;var h=l.modules;if(null===h)return;var d=a?4:0,p=h.length+2*d,f=S(this.props,h);null!=s&&null!=f&&null!=f.excavation&&(h=k(h,f.excavation));var m=window.devicePixelRatio||1;c.height=c.width=n*m;var g=n/p*m;u.scale(g,g),u.fillStyle=r,u.fillRect(0,0,p,p),u.fillStyle=o,E?u.fill(new Path2D(w(h,d))):h.forEach((function(e,t){e.forEach((function(e,n){e&&u.fillRect(n+d,t+d,1,1)}))})),this.state.imgLoaded&&this._image&&null!=f&&u.drawImage(this._image,f.x+d,f.y+d,f.w,f.h)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.size),i=(t.level,t.bgColor,t.fgColor,t.style),o=(t.includeMargin,t.imageSettings),l=s(t,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),c=a({height:n,width:n},i),u=null,h=o&&o.src;return null!=o&&null!=h&&(u=v.createElement("img",{src:h,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(t){return e._image=t}})),v.createElement(v.Fragment,null,v.createElement("canvas",r({style:c,height:n,width:n,ref:function(t){return e._canvas=t}},l)),u)}}]),t}(v.PureComponent);g(_,"defaultProps",C);var O=function(e){function t(){return l(this,t),h(this,d(t).apply(this,arguments))}return f(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.size,i=e.level,o=e.bgColor,a=e.fgColor,l=e.includeMargin,c=e.imageSettings,u=s(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),h=new y(-1,b[i]);h.addData(x(t)),h.make();var d=h.modules;if(null===d)return null;var p=l?4:0,f=d.length+2*p,m=S(this.props,d),g=null;null!=c&&null!=m&&(null!=m.excavation&&(d=k(d,m.excavation)),g=v.createElement("image",{xlinkHref:c.src,height:m.h,width:m.w,x:m.x+p,y:m.y+p,preserveAspectRatio:"none"}));var C=w(d,p);return v.createElement("svg",r({shapeRendering:"crispEdges",height:n,width:n,viewBox:"0 0 ".concat(f," ").concat(f)},u),v.createElement("path",{fill:o,d:"M0,0 h".concat(f,"v").concat(f,"H0z")}),v.createElement("path",{fill:a,d:C}),g)}}]),t}(v.PureComponent);g(O,"defaultProps",C);var N=function(e){var t=e.renderAs,n=s(e,["renderAs"]),i="svg"===t?O:_;return v.createElement(i,n)};N.defaultProps=a({renderAs:"canvas"},C),e.exports=N},DlQD:
/*!*******************************************!*\
!*** ./node_modules/marked/lib/marked.js ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function n(e,n){var i;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(i=function(e,n){if(e){if("string"==typeof e)return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){i&&(e=i);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=e[Symbol.iterator]()).next.bind(i)}var i=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){function t(){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}}e.exports={defaults:{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},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),r=(i.defaults,i.getDefaults,i.changeDefaults,/[&<>"']/),o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=function(e){return l[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var d=/(^|[^\[])\^/g,p=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},g=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(e,t){m[" "+e]||(g.test(e)?m[" "+e]=e+"/":m[" "+e]=x(e,"/",!0));var n=-1===(e=m[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(v,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(y,"$1")+t:e+t}function x(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r<i;){var o=e.charAt(i-r-1);if(o!==t||n){if(o===t||!n)break;r++}else r++}return e.substr(0,i-r)}var C=function(e,t){if(t){if(r.test(e))return e.replace(o,c)}else if(a.test(e))return e.replace(s,c);return e},w=h,k=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,i){return i=(i=i.source||i).replace(d,"$1"),e=e.replace(t,i),n},getRegex:function(){return new RegExp(e,t)}};return n},S=function(e,t,n){if(e){var i;try{i=decodeURIComponent(h(n)).replace(p,"").toLowerCase()}catch(e){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}t&&!f.test(n)&&(n=b(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},E={exec:function(){}},_=function(e){for(var t,n,i=1;i<arguments.length;i++)for(n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},O=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var i=!1,r=t;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},N=x,T=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,i=0,r=0;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&--i<0)return r;return-1},L=function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},A=i.defaults,M=N,j=O,D=C,P=T;function I(e,t,n){var i=t.href,r=t.title?D(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:o}:{type:"image",raw:n,href:i,title:r,text:D(o)}}var R=function(){function e(e){this.options=e||A}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var n=this.rules.block.code.exec(e);if(n){var i=t[t.length-1];if(i&&"paragraph"===i.type)return{raw:n[0],text:n[0].trimRight()};var r=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:M(r,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:j(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=j(n.cells[i],n.header.length);return n}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var n,i,r,o,a,s,l,c=t[0],u=t[2],h=u.length>1,d=")"===u[u.length-1],p={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},f=t[0].match(this.rules.block.item),m=!1,g=f.length,v=0;v<g;v++)c=n=f[v],i=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) */,"")).indexOf("\n ")&&(i-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+i+"}","gm"),"")),v!==g-1&&(r=this.rules.block.bullet.exec(f[v+1])[0],(h?1===r.length||!d&&")"===r[r.length-1]:r.length>1||this.options.smartLists&&r!==u)&&(o=f.slice(v+1).join("\n"),p.raw=p.raw.substring(0,p.raw.length-o.length),v=g-1)),a=m||/\n\n(?!\s*$)/.test(n),v!==g-1&&(m="\n"===n.charAt(n.length-1),a||(a=m)),a&&(p.loose=!0),l=void 0,(s=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),p.items.push({type:"list_item",raw:c,task:s,checked:l,loose:a,text:n});return p}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):D(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:j(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=j(n.cells[i].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e,t){var n=this.rules.block.text.exec(e);if(n){var i=t[t.length-1];return i&&"text"===i.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:D(t[1])}},t.tag=function(e,t,n){var i=this.rules.inline.tag.exec(e);if(i)return!t&&/^<a /i.test(i[0])?t=!0:t&&/^<\/a>/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=P(t[2],"()");if(n>-1){var i=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,i).trim(),t[3]=""}var r=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a?(r=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return I(t,{href:(r=r.trim().replace(/^<([\s\S]*)>$/,"$1"))?r.replace(this.rules.inline._escapes,"$1"):r,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return I(n,i,n[0])}},t.strong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.strong.start.exec(e);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var r,o="**"===i[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(i=o.exec(t));)if(r=this.rules.inline.strong.middle.exec(t.slice(0,i.index+3)))return{type:"strong",raw:e.slice(0,r[0].length),text:e.slice(2,r[0].length-2)}}},t.em=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.em.start.exec(e);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var r,o="*"===i[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(i=o.exec(t));)if(r=this.rules.inline.em.middle.exec(t.slice(0,i.index+2)))return{type:"em",raw:e.slice(0,r[0].length),text:e.slice(1,r[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=n.startsWith(" ")&&n.endsWith(" ");return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?t(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),B=E,z=k,F=_,H={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=z(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=z(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=z(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._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",H._comment=/<!--(?!-?>)[\s\S]*?-->/,H.html=z(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=z(H._paragraph).replace("hr",H.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",H._tag).getRegex(),H.blockquote=z(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=F({},H),H.gfm=F({},H.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*|$)"}),H.gfm.nptable=z(H.gfm.nptable).replace("hr",H.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",H._tag).getRegex(),H.gfm.table=z(H.gfm.table).replace("hr",H.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",H._tag).getRegex(),H.pedantic=F({},H.normal,{html:z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._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:B,paragraph:z(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var W={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};W.punctuation=z(W.punctuation).replace(/punctuation/g,W._punctuation).getRegex(),W._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",W._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",W.em.start=z(W.em.start).replace(/punctuation/g,W._punctuation).getRegex(),W.em.middle=z(W.em.middle).replace(/punctuation/g,W._punctuation).replace(/overlapSkip/g,W._overlapSkip).getRegex(),W.em.endAst=z(W.em.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.em.endUnd=z(W.em.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.start=z(W.strong.start).replace(/punctuation/g,W._punctuation).getRegex(),W.strong.middle=z(W.strong.middle).replace(/punctuation/g,W._punctuation).replace(/blockSkip/g,W._blockSkip).getRegex(),W.strong.endAst=z(W.strong.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.endUnd=z(W.strong.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.blockSkip=z(W._blockSkip,"g").getRegex(),W.overlapSkip=z(W._overlapSkip,"g").getRegex(),W._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,W._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,W._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])?)+(?![-_])/,W.autolink=z(W.autolink).replace("scheme",W._scheme).replace("email",W._email).getRegex(),W._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,W.tag=z(W.tag).replace("comment",H._comment).replace("attribute",W._attribute).getRegex(),W._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,W._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,W._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,W.link=z(W.link).replace("label",W._label).replace("href",W._href).replace("title",W._title).getRegex(),W.reflink=z(W.reflink).replace("label",W._label).getRegex(),W.reflinkSearch=z(W.reflinkSearch,"g").replace("reflink",W.reflink).replace("nolink",W.nolink).getRegex(),W.normal=F({},W),W.pedantic=F({},W.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:z(/^!?\[(label)\]\((.*?)\)/).replace("label",W._label).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W._label).getRegex()}),W.gfm=F({},W.normal,{escape:z(W.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),W.gfm.url=z(W.gfm.url,"i").replace("email",W.gfm._extended_email).getRegex(),W.breaks=F({},W.gfm,{br:z(W.br).replace("{2,}","*").getRegex(),text:z(W.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var V={block:H,inline:W},G=i.defaults,K=V.block,U=V.inline;function q(e){return e.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function $(e){var t,n,i="",r=e.length;for(t=0;t<r;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var Y=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G,this.options.tokenizer=this.options.tokenizer||new R,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:K.normal,inline:U.normal};this.options.pedantic?(t.block=K.pedantic,t.inline=U.pedantic):this.options.gfm&&(t.block=K.gfm,this.options.breaks?t.inline=U.breaks:t.inline=U.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)};var n,i,r,o=t.prototype;return o.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(e,t,n){var i,r,o,a;for(void 0===t&&(t=[]),void 0===n&&(n=!0),e=e.replace(/^ +$/gm,"");e;)if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),i.type&&t.push(i);else if(i=this.tokenizer.code(e,t))e=e.substring(i.raw.length),i.type?t.push(i):((a=t[t.length-1]).raw+="\n"+i.raw,a.text+="\n"+i.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.nptable(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);else if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),o=i.items.length,r=0;r<o;r++)i.items[r].tokens=this.blockTokens(i.items[r].text,[],!1);t.push(i)}else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(n&&(i=this.tokenizer.def(e)))e=e.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(n&&(i=this.tokenizer.paragraph(e)))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.text(e,t))e=e.substring(i.raw.length),i.type?t.push(i):((a=t[t.length-1]).raw+="\n"+i.raw,a.text+="\n"+i.text);else if(e){var s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return t},o.inline=function(e){var t,n,i,r,o,a,s=e.length;for(t=0;t<s;t++)switch((a=e[t]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},r=a.header.length,n=0;n<r;n++)a.tokens.header[n]=[],this.inlineTokens(a.header[n],a.tokens.header[n]);for(r=a.cells.length,n=0;n<r;n++)for(o=a.cells[n],a.tokens.cells[n]=[],i=0;i<o.length;i++)a.tokens.cells[n][i]=[],this.inlineTokens(o[i],a.tokens.cells[n][i]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(r=a.items.length,n=0;n<r;n++)this.inline(a.items[n].tokens)}return e},o.inlineTokens=function(e,t,n,i,r){var o;void 0===t&&(t=[]),void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===r&&(r="");var a,s=e;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(s));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,i))e=e.substring(o.raw.length),n=o.inLink,i=o.inRawBlock,t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),t.push(o);else if(o=this.tokenizer.strong(e,s,r))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);else if(o=this.tokenizer.em(e,s,r))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);else if(o=this.tokenizer.autolink(e,$))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,$))){if(o=this.tokenizer.inlineText(e,i,q))e=e.substring(o.raw.length),r=o.raw.slice(-1),t.push(o);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(o.raw.length),t.push(o);return t},n=t,r=[{key:"rules",get:function(){return{block:K,inline:U}}}],(i=null)&&e(n.prototype,i),r&&e(n,r),t}(),X=i.defaults,Z=S,J=C,Q=function(){function e(e){this.options=e||X}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return i?'<pre><code class="'+this.options.langPrefix+J(i,!0)+'">'+(n?e:J(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:J(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+i.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+i+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,n){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<a href="'+J(e)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>"},t.image=function(e,t,n){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return n;var i='<img src="'+e+'" alt="'+n+'"';return t&&(i+=' title="'+t+'"'),i+=this.options.xhtml?"/>":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ne=i.defaults,ie=w,re=function(){function e(e){this.options=e||ne,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,n){return new e(n).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,o,a,s,l,c,u,h,d,p,f,m,g,v,y,b,x="",C=e.length;for(n=0;n<C;n++)switch((h=e[n]).type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(h.tokens),h.depth,ie(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(c="",l="",o=h.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[i]),{header:!0,align:h.align[i]});for(c+=this.renderer.tablerow(l),u="",o=h.cells.length,i=0;i<o;i++){for(l="",a=(s=h.tokens.cells[i]).length,r=0;r<a;r++)l+=this.renderer.tablecell(this.parseInline(s[r]),{header:!1,align:h.align[r]});u+=this.renderer.tablerow(l)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(h.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(d=h.ordered,p=h.start,f=h.loose,o=h.items.length,u="",i=0;i<o;i++)v=(g=h.items[i]).checked,y=g.task,m="",g.task&&(b=this.renderer.checkbox(v),f?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,f),u+=this.renderer.listitem(m,y,v);x+=this.renderer.list(u,d,p);continue;case"html":x+=this.renderer.html(h.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1<C&&"text"===e[n+1].type;)u+="\n"+((h=e[++n]).tokens?this.parseInline(h.tokens):h.text);x+=t?this.renderer.paragraph(u):u;continue;default:var w='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(w);throw new Error(w)}return x},t.parseInline=function(e,t){t=t||this.renderer;var n,i,r="",o=e.length;for(n=0;n<o;n++)switch((i=e[n]).type){case"escape":r+=t.text(i.text);break;case"html":r+=t.html(i.text);break;case"link":r+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":r+=t.image(i.href,i.title,i.text);break;case"strong":r+=t.strong(this.parseInline(i.tokens,t));break;case"em":r+=t.em(this.parseInline(i.tokens,t));break;case"codespan":r+=t.codespan(i.text);break;case"br":r+=t.br();break;case"del":r+=t.del(this.parseInline(i.tokens,t));break;case"text":r+=t.text(i.text);break;default:var a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return r},e}(),oe=_,ae=L,se=C,le=i.getDefaults,ce=i.changeDefaults,ue=i.defaults;function he(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=oe({},he.defaults,t||{}),ae(t),n){var i,r=t.highlight;try{i=Y.lex(e,t)}catch(e){return n(e)}var o=function(e){var o;if(!e)try{o=re.parse(i,t)}catch(t){e=t}return t.highlight=r,e?n(e):n(null,o)};if(!r||r.length<3)return o();if(delete t.highlight,!i.length)return o();var a=0;return he.walkTokens(i,(function(e){"code"===e.type&&(a++,setTimeout((function(){r(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--a&&o()}))}),0))})),void(0===a&&o())}try{var s=Y.lex(e,t);return t.walkTokens&&he.walkTokens(s,t.walkTokens),re.parse(s,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+se(e.message+"",!0)+"</pre>";throw e}}return he.options=he.setOptions=function(e){return oe(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=oe({},e);if(e.renderer&&function(){var n=he.defaults.renderer||new Q,i=function(t){var i=n[t];n[t]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=e.renderer[t].apply(n,o);return!1===s&&(s=i.apply(n,o)),s}};for(var r in e.renderer)i(r);t.renderer=n}(),e.tokenizer&&function(){var n=he.defaults.tokenizer||new R,i=function(t){var i=n[t];n[t]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=e.tokenizer[t].apply(n,o);return!1===s&&(s=i.apply(n,o)),s}};for(var r in e.tokenizer)i(r);t.tokenizer=n}(),e.walkTokens){var n=he.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),n&&n(t)}}he.setOptions(t)},he.walkTokens=function(e,t){for(var i,r=n(e);!(i=r()).done;){var o=i.value;switch(t(o),o.type){case"table":for(var a,s=n(o.tokens.header);!(a=s()).done;){var l=a.value;he.walkTokens(l,t)}for(var c,u=n(o.tokens.cells);!(c=u()).done;)for(var h,d=n(c.value);!(h=d()).done;){var p=h.value;he.walkTokens(p,t)}break;case"list":he.walkTokens(o.items,t);break;default:o.tokens&&he.walkTokens(o.tokens,t)}}},he.Parser=re,he.parser=re.parse,he.Renderer=Q,he.TextRenderer=ee,he.Lexer=Y,he.lexer=Y.lex,he.Tokenizer=R,he.Slugger=te,he.parse=he,he}()},"Dvv+":
/*!************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/index.tsx + 4 modules ***!
\************************************************************************/
/*! exports provided: default */
/*! all exports used */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/CustomTree/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/ProCheckout/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/Tabs/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/AddTags/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/List/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/service/problemset.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/bi.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/median.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/shu.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/sren.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/te.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/wenhao.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/wenjian.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/xixi.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/checkbox/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/checkbox/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/skeleton/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/skeleton/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tree/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tree/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/lodash/lodash.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.r(t);n("cWXX");var i=n("/ezw"),r=(n("+L6B"),n("2/Rp")),o=(n("7Kak"),n("9yH6")),a=(n("giR+"),n("fyUT")),s=n("9og8"),l=n("k1fw"),c=(n("y8nQ"),n("Vl3Y")),u=n("tJVT"),h=(n("5NDa"),n("5rEg")),d=n("WmNS"),p=n.n(d),f=n("q1tI"),m=n.n(f),g=n("Ty5D"),v=n("9kvl"),y=n("m3fD"),b=n.n(y),x=n("A+k2"),C=n.n(x),w=function(e){var t=e.value,n=void 0===t?[]:t,i=e.onChange,r=e.className,o=void 0===r?"":r;return m.a.createElement("div",{className:"".concat(C.a.tabs," ").concat(o," ")},m.a.createElement("div",{onClick:function(){return i(0)},className:0===n?C.a.active:""},m.a.createElement("div",null,"1"),m.a.createElement("div",null,"录入信息")," "),m.a.createElement("div",{onClick:function(){return i(1)},className:1===n?C.a.active:""},m.a.createElement("div",null,"2"),m.a.createElement("div",null,"配置组卷")))},k=(n("2qtc"),n("kLXV")),S=(n("sRBo"),n("kaz8")),E=(n("5Dmo"),n("3S7+")),_=(n("miYZ"),n("tsqr")),O=n("oBTY"),N=n("IlMy"),T=n.n(N),L=n("WCUW"),A=n("QSKd"),M=n.n(A),j=n("Hfvn"),D=n.n(j),P=n("HPRh"),I=n.n(P),R=n("+RXH"),B=n.n(R),z=n("+yhJ"),F=n.n(z),H=n("RZ/O"),W=n.n(H),V=n("exQ7"),G=n.n(V),K=n("HG2Q"),U=n.n(K),q=n("k4n4"),$=n("eS0+"),Y=n("PpiC"),X=n("K5AI"),Z=n.n(X),J=n("LvDl"),Q=S.a.Group,ee=function(e){var t=e.value,n=void 0===t?[]:t,i=e.onChange,r=e.options,o=e.search,a=(Object(Y.a)(e,["value","onChange","options","search"]),m.a.useState(!1)),s=Object(u.a)(a,2),c=s[0],h=s[1];Object(f.useEffect)((function(){var e,t=null==r||null===(e=r.tag_disciplines)||void 0===e?void 0:e.map((function(e){return e.id})),i=null==n?void 0:n.filter((function(e){return t.includes(e)}));h(i.length===(null==t?void 0:t.length))}),[n]);console.log(r,"options");return 0!==(null==r?void 0:r.item_count)&&function(){var e,t=!1;o?null===(e=r.tag_disciplines)||void 0===e||e.forEach((function(e){var n;t||(t=(null===(n=e.name)||void 0===n?void 0:n.includes(o))&&0!==e.item_count)})):t=!0;return t}()?m.a.createElement("div",{className:Z.a.cInput},m.a.createElement("div",{className:Z.a.cl},m.a.createElement(S.a,{checked:c,onChange:function(e){var t,o=null==r||null===(t=r.tag_disciplines)||void 0===t?void 0:t.map((function(e){return e.id}));i(e.target.checked?Object(J.uniq)([].concat(Object(O.a)(n),Object(O.a)(o))):null==n?void 0:n.filter((function(e){return!o.includes(e)}))),h(e.target.checked)}},m.a.createElement("span",{className:Z.a.box},m.a.createElement("span",{className:"font14 c-light-primary"},m.a.createElement("span",{title:null==r?void 0:r.name,className:Z.a.box1}," ",null==r?void 0:r.name),m.a.createElement("span",null," ","(".concat(null==r?void 0:r.item_count,")"))),m.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),m.a.createElement("div",{className:Z.a.cr},m.a.createElement(Q,{options:function(){var e,t,n,i=(null==r?void 0:r.tag_disciplines)||[];o&&(i=null===(n=i)||void 0===n?void 0:n.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(o)})));return i=null===(t=i=null===(e=i)||void 0===e?void 0:e.map((function(e){return Object(l.a)(Object(l.a)({},e),{},{label:"".concat(e.name,"(".concat(null==e?void 0:e.item_count,")")),value:e.id})})))||void 0===t?void 0:t.filter((function(e){return 0!==e.item_count}))}(),value:n,onChange:function(e){var t,o,a=null==r||null===(t=r.tag_disciplines)||void 0===t?void 0:t.map((function(e){return e.id})),s=null==n?void 0:n.filter((function(e){return a.includes(e)})),l=Object(J.uniq)([].concat(Object(O.a)(n),Object(O.a)(e)));if(s.length>e.length){var c=Object(J.xor)(s,e);console.log(c,"newLevel"),l=l.filter((function(e){return!c.includes(e)}))}i(l),h(e.length===(null==r||null===(o=r.tag_disciplines)||void 0===o?void 0:o.length))}}))):m.a.createElement(m.a.Fragment,null)},te=n("ErOA"),ne=(n("ozfa"),n("MJZm")),ie=n("0Owb"),re=n("tmPe"),oe=n.n(re),ae=function(e){var t=e.value,n=e.onChange,i=e.defaultValue,r=e.treeData,o=void 0===r?[]:r,a=Object(Y.a)(e,["value","onChange","defaultValue","treeData"]);return m.a.createElement("div",{className:oe.a.customTree},m.a.createElement(ne.a,Object(ie.a)({multiple:!0,showIcon:!0,selectedKeys:t,defaultExpandedKeys:i,treeData:o,onSelect:n},a)))},se=n("sbIO"),le=h.a.Search,ce=function(e){var t,n=e.formValue,o=e.setFatherTabs,c=e.tabs,h=e.editData,d=e.dispatch,y=Object(g.i)().id,b=Object(f.useState)(["mine"]),x=Object(u.a)(b,2),C=x[0],N=x[1],A=Object(f.useState)(!0),j=Object(u.a)(A,2),P=j[0],R=j[1],z=Object(f.useState)(!1),H=Object(u.a)(z,2),V=H[0],K=H[1],Y=Object(f.useState)(!1),X=Object(u.a)(Y,2),Z=X[0],Q=X[1],ne=Object(f.useState)(0),ie=Object(u.a)(ne,2),re=ie[0],oe=ie[1],ce=Object(f.useState)(""),ue=Object(u.a)(ce,2),he=ue[0],de=ue[1],pe=Object(f.useState)(!1),fe=Object(u.a)(pe,2),me=fe[0],ge=fe[1],ve=Object(f.useState)(!1),ye=Object(u.a)(ve,2),be=ye[0],xe=ye[1],Ce=Object(f.useState)({}),we=Object(u.a)(Ce,2),ke=we[0],Se=we[1],Ee=Object(f.useState)([]),_e=Object(u.a)(Ee,2),Oe=_e[0],Ne=_e[1],Te=Object(f.useState)([]),Le=Object(u.a)(Te,2),Ae=Le[0],Me=Le[1],je=Object(f.useState)([]),De=Object(u.a)(je,2),Pe=De[0],Ie=De[1],Re=Object(f.useState)([]),Be=Object(u.a)(Re,2),ze=Be[0],Fe=Be[1],He=Object(f.useState)(null),We=Object(u.a)(He,2),Ve=We[0],Ge=We[1],Ke=Object(f.useRef)([]),Ue=Object(f.useState)(!1),qe=Object(u.a)(Ue,2),$e=qe[0],Ye=qe[1],Xe=Object(f.useState)([]),Ze=Object(u.a)(Xe,2),Je=Ze[0],Qe=Ze[1],et=Object(f.useState)([0]),tt=Object(u.a)(et,2),nt=tt[0],it=tt[1],rt=Object(f.useState)([]),ot=Object(u.a)(rt,2),at=ot[0],st=ot[1],lt=Object(f.useRef)([]),ct=Object(f.useState)(!1),ut=Object(u.a)(ct,2),ht=ut[0],dt=ut[1],pt=Object(f.useState)([]),ft=Object(u.a)(pt,2),mt=ft[0],gt=ft[1],vt=Object(f.useState)([]),yt=Object(u.a)(vt,2),bt=yt[0],xt=yt[1],Ct=Object(f.useRef)([]),wt=Object(f.useState)([]),kt=Object(u.a)(wt,2),St=kt[0],Et=kt[1],_t=Object(f.useState)(!1),Ot=Object(u.a)(_t,2),Nt=Ot[0],Tt=Ot[1],Lt=Object(f.useRef)([]),At=Object(f.useState)(0),Mt=Object(u.a)(At,2),jt=Mt[0],Dt=Mt[1],Pt=null==at?void 0:at.filter((function(e){return null==Je?void 0:Je.includes(e.id)})),It=null==bt?void 0:bt.filter((function(e){return null==mt?void 0:mt.includes(e.id)}));Object(f.useEffect)((function(){Wt()}),[]),Object(f.useEffect)((function(){return 1===c&&(d({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),d({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){d({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),d({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}}),[c]),Object(f.useEffect)((function(){y?h&&Vt():(Kt(C),Ut(),R(!1))}),[h]),Object(f.useEffect)((function(){he&&Ft()}),[he]);var Rt,Bt,zt,Ft=function(){var e=null;null==Ae||Ae.forEach((function(t){var n;null===(n=t.sub_disciplines)||void 0===n||n.forEach((function(n){var i;null===(i=n.tag_disciplines)||void 0===i||i.forEach((function(n){var i;(null===(i=n.name)||void 0===i?void 0:i.includes(he))&&0!==n.item_count&&!e&&(e=t.id)}))}))})),e&&Ge(e)},Ht=function(e){return null==e?void 0:e.map((function(e){return function e(t){var n=t.children,i=Array.isArray(n)&&n.length>0,r=null==t?void 0:t.group_id;return Lt.current.push({name:null==t?void 0:t.name,id:r,count:null==t?void 0:t.count}),{title:m.a.createElement("div",{title:null==t?void 0:t.name,className:T.a.name},null==t?void 0:t.name,"".concat(null==t?void 0:t.count,"")),value:r,name:null==t?void 0:t.name,key:r,count:null==t?void 0:t.count,id:r,icon:m.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:i?null==n?void 0:n.map((function(t){return e(t)})):[]}}(e)}))},Wt=function(){var e=Object(s.a)(p.a.mark((function e(){var t,n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(L.z)({});case 2:t=e.sent,Lt.current=[{id:0,name:"根目录",count:null==t?void 0:t.root_count}],null!=t&&t.data&&(n=[{title:m.a.createElement("div",{title:"根目录",className:T.a.name},"根目录","".concat((null==t?void 0:t.root_count)||0,"")),value:0,id:0,key:0,count:null==t?void 0:t.root_count,name:"根目录",icon:m.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Ht(t.data||[])}],st(Lt.current),Et(n));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Vt=function(){var e=Object(s.a)(p.a.mark((function e(){var t,n,i,r,o,a,s,c,u,d,f,m,g,v,y,b,x,C;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=null==h||null===(t=h.tag_disciplines)||void 0===t?void 0:t.map((function(e){return e.tag_discipline_id})),f=null==h||null===(n=h.groups)||void 0===n?void 0:n.map((function(e){return e.id})),m={source:null==h||null===(i=h.examination_bank)||void 0===i?void 0:i.source,group_ids:f,tag_discipline_ids:d,teach_group_ids:null==h?void 0:h.teach_group_ids},e.next=5,Object(te.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:m});case 5:if(-1!==(null==(g=e.sent)?void 0:g.status)){e.next=8;break}return e.abrupt("return");case 8:v=(v=null==g?void 0:g.filter((function(e){var t;return!(null==e||null===(t=e.item_banks)||void 0===t||!t.length)}))).map((function(e){return Object(l.a)(Object(l.a)({},e),{},{scoreTotal:0,score:0,questionTotal:0})})),v=null===(r=v)||void 0===r?void 0:r.map((function(e,t){var n,i,r;return Object(l.a)(Object(l.a)({},e),{},{score:(null==h||null===(n=h.score_settings)||void 0===n||null===(i=n.find((function(t){return t.item_type===(null==e?void 0:e.item_type)})))||void 0===i?void 0:i.score)||0,item_banks:null==e||null===(r=e.item_banks)||void 0===r?void 0:r.map((function(t){var n;return Object(l.a)(Object(l.a)({},t),{},{tag_disciplines:null==t||null===(n=t.tag_disciplines)||void 0===n?void 0:n.map((function(n){var i;return Object(l.a)(Object(l.a)({},n),{},{difficulties:null==n||null===(i=n.difficulties)||void 0===i?void 0:i.map((function(i){var r=null==h?void 0:h.contents.find((function(r){return r.item_type===e.item_type&&r.sub_discipline_id===t.sub_discipline_id&&r.tag_discipline_id===n.tag_discipline_id&&r.difficulty===i.difficulty}));return r?Object(l.a)(Object(l.a)({},i),{},{num:null==r?void 0:r.quanlity}):Object(l.a)({},i)}))})}))})}))})})),y=Yt(v),b=y.panel,x=y.score_num_item,v=null===(o=v)||void 0===o?void 0:o.map((function(e,t){var n,i=(null==b||null===(n=b[t])||void 0===n?void 0:n.reduce((function(e,t){return e+t}),0))||0;return Object(l.a)(Object(l.a)({},e),{},{scoreTotal:i*(x[t]||0),questionTotal:i})})),C=[],null==h||null===(a=h.sort_by_item_type)||void 0===a||a.forEach((function(e){var t=v.find((function(t){var n;return(null===(n=Jt.find((function(e){return e.type===(null==t?void 0:t.item_type)})))||void 0===n?void 0:n.name)===e}));C.push(t)})),C=Object(J.compact)(C),Kt(null==h||null===(s=h.examination_bank)||void 0===s?void 0:s.source),Ut(),N(null==h||null===(c=h.examination_bank)||void 0===c?void 0:c.source),Fe(d),Ke.current=d,Qe(f),gt((null==h?void 0:h.teach_group_ids)||[]),Dt(null==h||null===(u=h.groups)||void 0===u?void 0:u.map((function(e){return e.count})).reduce((function(e,t){return e+t}),0)),lt.current=f,it(null!=f&&f.length?f:[0]),Ne(Object(J.cloneDeep)(C)),R(!1);case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Gt=function(){var e=Object(s.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt,item_bank_quotes:re}),Ke.current=ze,ge(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Kt=function(){var e=Object(s.a)(p.a.mark((function e(t){var n,i,r,o,a,s;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(te.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:t}});case 2:r=e.sent,o=[],null==r||null===(n=r.disciplines)||void 0===n||n.forEach((function(e){var t;null==e||null===(t=e.sub_disciplines)||void 0===t||t.forEach((function(e){o=o.concat((null==e?void 0:e.tag_disciplines)||[])}))})),a=null,s=null==r||null===(i=r.disciplines)||void 0===i?void 0:i.map((function(e){var t,n=null==e||null===(t=e.sub_disciplines)||void 0===t?void 0:t.reduce((function(e,t){return e+t.item_count}),0);return a||0===n||(a=e.id),Object(l.a)(Object(l.a)({},e),{},{item_count:n})})),console.log(s,48767874),Me(s),Ie(o),Ge(a);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ut=function(){var e=Object(s.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(te.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:t=e.sent,xt((null==t?void 0:t.groups)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qt=function(){var e=Object(s.a)(p.a.mark((function e(t){var n,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R(!0),e.next=3,Object(te.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:t});case 3:n=e.sent,i=(i=null==n?void 0:n.filter((function(e){var t;return!(null==e||null===(t=e.item_banks)||void 0===t||!t.length)}))).map((function(e){return Object(l.a)(Object(l.a)({},e),{},{scoreTotal:0,score:0,questionTotal:0})})),Ne(i),R(!1);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$t=function(e){Fe(e)},Yt=function(e){var t={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return null==e||e.forEach((function(e,n){var i,r,o;t.panel.push([]),t.score_num_item.push(null==e?void 0:e.score),t.score_total.push(null==e?void 0:e.scoreTotal),null===(i=t.error_tips)||void 0===i||i.push({name:null===(r=Jt.find((function(t){return t.type===(null==e?void 0:e.item_type)})))||void 0===r?void 0:r.name,score:(null==e?void 0:e.score)||0,scoreTotal:null==e?void 0:e.scoreTotal,item_type:null==e?void 0:e.item_type}),null==e||null===(o=e.item_banks)||void 0===o||o.forEach((function(i){var r;null==i||null===(r=i.tag_disciplines)||void 0===r||r.forEach((function(r){var o;null==r||null===(o=r.difficulties)||void 0===o||o.forEach((function(o){o.num&&(t.panel[n].push(o.num),t.contents.push({difficulty:o.difficulty,item_type:e.item_type,items_count:o.num,sub_discipline_id:i.sub_discipline_id,tag_discipline_id:r.tag_discipline_id}))}))}))}))})),t},Xt=function(){var e=Object(s.a)(p.a.mark((function e(t){var i,r,o,a,s,c,u,d,f,m,g,y,b,x,w,k;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Je.length||ze.length||mt.length){e.next=3;break}return _.b.warn("必须选择考察范围或试题文件夹或教研团队的其中一项"),e.abrupt("return");case 3:i=[],r=[],o=Yt(Oe),a=0;case 7:if(!(a<o.error_tips.length)){e.next=23;break}if(u=null==o||null===(s=o.panel)||void 0===s||null===(c=s[a])||void 0===c?void 0:c.reduce((function(e,t){return e+t}),0),0!==o.error_tips[a].score||0===u){e.next=14;break}return(f=document.getElementById("".concat(null===(d=o.error_tips[a])||void 0===d?void 0:d.item_type,"_score"))).classList.add("customError"),f.scrollIntoView({block:"start",behavior:"smooth"}),e.abrupt("return");case 14:if(0===o.error_tips[a].score||0!==u){e.next=19;break}return(g=document.getElementById("".concat(null===(m=o.error_tips[a])||void 0===m?void 0:m.item_type,"_sum"))).classList.add("customError"),g.scrollIntoView({block:"start",behavior:"smooth"}),e.abrupt("return");case 19:0!==o.error_tips[a].score&&0!==u&&(null==i||i.push({item_type:null===(y=o.error_tips[a])||void 0===y?void 0:y.item_type,score:(null===(b=o.error_tips[a])||void 0===b?void 0:b.score)||0}),r.push(o.error_tips[a].name));case 20:a++,e.next=7;break;case 23:if(0!==i.length){e.next=26;break}return _.b.warn("不允许每个题型的总分和抽题数量都为0"),e.abrupt("return");case 26:if(K(!0),x=Object(l.a)({contents:o.contents,group_ids:Je,teach_group_ids:mt,score_settings:i,source:C,sub_discipline_id:0,sort_by_item_type:r,tag_discipline_ids:ze},n),!t){e.next=36;break}return w=Object(l.a)(Object(l.a)({},x),t),e.next=32,Object(te.a)("/api/examination_banks/save_question_list.json",{method:"post",body:w});case 32:return 0===e.sent.status&&_.b.success("保存成功"),K(!1),e.abrupt("return");case 36:if(k={},!h){e.next=43;break}return e.next=40,Object(te.a)("/api/examination_banks/".concat(null==h?void 0:h.id,"/update_random_exam.json"),{method:"post",body:x});case 40:k=e.sent,e.next=46;break;case 43:return e.next=45,Object(te.a)("/api/examination_banks/create_random_exam.json",{method:"post",body:x});case 45:k=e.sent;case 46:0===k.status&&(_.b.success("操作成功"),v.d.push("/paperlibrary?defaultActiveKey=0")),K(!1);case 48:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Zt=function(){var e=Object(s.a)(p.a.mark((function e(t,i){var r,o,a,s,c,u,h,d,f,m,g,v,y,b,x,w,k,S,E,O,N,T,L;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Je.length||ze.length||mt.length){e.next=3;break}return _.b.warn("必须选择考察范围或试题文件夹或教研团队的其中一项"),e.abrupt("return");case 3:r=[],o=[],a=Yt(Oe),s=0;case 7:if(!(s<a.error_tips.length)){e.next=23;break}if(h=null==a||null===(c=a.panel)||void 0===c||null===(u=c[s])||void 0===u?void 0:u.reduce((function(e,t){return e+t}),0),0!==a.error_tips[s].score||0===h){e.next=14;break}return(f=document.getElementById("".concat(null===(d=a.error_tips[s])||void 0===d?void 0:d.item_type,"_score"))).classList.add("customError"),f.scrollIntoView({block:"start",behavior:"smooth"}),e.abrupt("return");case 14:if(0===a.error_tips[s].score||0!==h){e.next=19;break}return(g=document.getElementById("".concat(null===(m=a.error_tips[s])||void 0===m?void 0:m.item_type,"_sum"))).classList.add("customError"),g.scrollIntoView({block:"start",behavior:"smooth"}),e.abrupt("return");case 19:0!==a.error_tips[s].score&&0!==h&&(null==r||r.push({item_type:null===(v=a.error_tips[s])||void 0===v?void 0:v.item_type,score:(null===(y=a.error_tips[s])||void 0===y?void 0:y.score)||0}),o.push(a.error_tips[s].name));case 20:s++,e.next=7;break;case 23:if(0!==r.length){e.next=26;break}return _.b.warn("不允许每个题型的总分和抽题数量都为0"),e.abrupt("return");case 26:if(Q(!0),b=Object(l.a)({contents:a.contents,group_ids:Je,teach_group_ids:mt,score_settings:r,sort_by_item_type:o,tag_discipline_ids:ze,source:C,sub_discipline_id:0},n),void 0===t||null!=t&&t.single_question_id){e.next=36;break}return b.seleted_item_bank_ids=null==t?void 0:t.seleted_item_bank_ids,e.next=32,Object(te.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:b});case 32:return null!=(x=e.sent)&&x.questions&&((k=Object(J.cloneDeep)(ke)).questionList=null==k||null===(w=k.questionList)||void 0===w?void 0:w.map((function(e){var t;return e.type===i.type?Object(l.a)(Object(l.a)({},e),{},{questions:(null==x||null===(t=x.questions)||void 0===t?void 0:t.questions)||[]}):e})),Se(k)),Q(!1),e.abrupt("return");case 36:if(null==t||void 0===t||!t.single_question_id){e.next=45;break}return b.seleted_item_bank_ids=null==t?void 0:t.seleted_item_bank_ids,b.single_question_id=null==t?void 0:t.single_question_id,e.next=41,Object(te.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:b});case 41:return(S=e.sent)&&((O=Object(J.cloneDeep)(ke)).questionList=null==O||null===(E=O.questionList)||void 0===E?void 0:E.map((function(e){if(e.type===i.type){var t,n,r=Object(J.cloneDeep)(null==e?void 0:e.questions);return r.splice(i.index,1,null==S||null===(t=S.questions)||void 0===t||null===(n=t.questions)||void 0===n?void 0:n[0]),console.log(null==e?void 0:e.questions,r,i.index,"new_questions"),Object(l.a)(Object(l.a)({},e),{},{questions:r})}return e})),Se(O)),Q(!1),e.abrupt("return");case 45:return e.next=47,Object(te.a)("/api/examination_banks/preview_random_questions.json",{method:"post",body:b});case 47:(N=e.sent).exam&&(T=tn(N),L=[],null==o||o.forEach((function(e){var t,n=null==T||null===(t=T.questionList)||void 0===t?void 0:t.find((function(t){var n;return(null===(n=Jt.find((function(e){return e.type===(null==t?void 0:t.type)})))||void 0===n?void 0:n.name)===e}));L.push(n)})),L=Object(J.compact)(L),T.questionList=L,Se(Object(l.a)({},T)),console.log(JSON.stringify(T)),xe(!0),document.body.scrollIntoView()),Q(!1);case 50:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Jt=[{type:"SINGLE",name:"单选题"},{type:"MULTIPLE",name:"多选题"},{type:"COMPLETION",name:"填空题"},{type:"JUDGMENT",name:"判断题"},{type:"SUBJECTIVE",name:"简答题"},{type:"PHOTOGRAPH",name:"拍照上传题"},{type:"FILEUPLOAD",name:"文件上传题"},{type:"PROGRAM",name:"编程题"},{type:"PRACTICAL",name:"实训题"},{type:"COMBINATION",name:"接龙题"}],Qt=function(e,t,n){return e[t]=e.splice(n,1,e[t])[0],e},en=function(){var e=Object(s.a)(p.a.mark((function e(t){var n,i,r,o;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Object(O.a)(C),C.includes(t)?r=r.filter((function(e){return e!==t})):r.push(t),0!==r.length){e.next=5;break}return _.b.warn("试题来源为必选项"),e.abrupt("return");case 5:null!==(n=r)&&void 0!==n&&n.includes("mine")||(Qe([]),lt.current=[]),null!==(i=r)&&void 0!==i&&i.includes("teach_groups")||(gt([]),Ct.current=[]),N(r),Kt(r),Fe([]),Ke.current=[],o={source:r,group_ids:lt.current,tag_discipline_ids:[],teach_group_ids:Ct.current},qt(o);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tn=function(e){var t={1:"一",2:"二",3:"三",4:"四",5:"五",6:"六",7:"七"};if(e){var n=e||{},i=n.exam,r=n.single_questions,o=n.multiple_questions,a=n.judgement_questions,s=n.program_questions,c=n.completion_questions,u=n.subjective_questions,h=n.practical_questions,d=n.combination_questions,p=n.photograph_questions,f=n.fileupload_questions,m=[Object(l.a)({type:"SINGLE",name:"单选题"},r),Object(l.a)({type:"MULTIPLE",name:"多选题"},o),Object(l.a)({type:"COMPLETION",name:"填空题"},c),Object(l.a)({type:"JUDGMENT",name:"判断题"},a),Object(l.a)({type:"SUBJECTIVE",name:"简答题"},u),Object(l.a)({type:"PHOTOGRAPH",name:"拍照上传题"},p),Object(l.a)({type:"FILEUPLOAD",name:"文件上传题"},f),Object(l.a)({type:"PROGRAM",name:"编程题"},s),Object(l.a)({type:"PRACTICAL",name:"实训题"},h),Object(l.a)({type:"COMBINATION",name:"接龙题"},d)],g=[],v=0,y=0,b=m.filter((function(e){return e.questions_count>0})).map((function(e,n){var i;return null===(i=e.questions)||void 0===i||i.forEach((function(e){g.push(e.id),v+=e.score,y+=1})),Object(l.a)(Object(l.a)({},e),{number:t[n+1]})}));return{all_questions_count:y,all_score:v,questionList:b,ids:g,exam:i}}},nn=null==Ae||null===(t=Ae.find((function(e){return e.id===Ve})))||void 0===t?void 0:t.sub_disciplines,rn=function(){for(var e=null==Pe?void 0:Pe.filter((function(e){return null==ze?void 0:ze.includes(e.id)})),t=Object(O.a)(e),n=0,i=[],r=0;r<t.length;r++){for(var o="",a=0;a<i.length;a++)if(i[a][0].parent_name==t[r].parent_name){n=1,o=a;break}if(1==n)i[o].push(t[r]),n=0;else if(0==n){var s=new Array;s.push(t[r]),i.push(s)}}return i}();return be?m.a.createElement(se.a,{loading:V,submit:Xt,goBack:function(){return xe(!1)},data:ke,onTypeScore:function(e){var t,n,i=Object(J.cloneDeep)(ke),r=Object(J.cloneDeep)(Oe);i.questionList=null==i||null===(t=i.questionList)||void 0===t?void 0:t.map((function(t){return t.type===e.type?Object(l.a)(Object(l.a)({},t),{},{questions_score:e.scoreTotal}):t})),r=null===(n=r)||void 0===n?void 0:n.map((function(t){return t.item_type===e.type?Object(l.a)(Object(l.a)({},t),{},{score:e.score,scoreTotal:e.scoreTotal}):t})),Ne(r),Se(i),console.log(e,ke,Oe)},onExchange:Zt}):m.a.createElement("section",{className:T.a.wrap,style:{display:c?"flex":"none"}},m.a.createElement("div",{id:"id_left",className:T.a.left,onMouseEnter:function(e){document.getElementById("id_left").style.overflowY="auto"},onMouseLeave:function(e){document.getElementById("id_left").style.overflowY="hidden"}},m.a.createElement(i.a,{loading:P,active:!0,paragraph:{rows:5}},Oe.map((function(e,t){var n;return m.a.createElement("div",{className:T.a.list,key:t},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,null===(n=Jt.find((function(t){return t.type===(null==e?void 0:e.item_type)})))||void 0===n?void 0:n.name)),m.a.createElement("aside",null,m.a.createElement("div",null,"共",m.a.createElement("span",{className:T.a.b},e.questionTotal),"题",m.a.createElement("span",{className:T.a.l},"|"),"共",m.a.createElement("span",{className:T.a.r},e.scoreTotal),"分"),m.a.createElement("div",null,t>0?m.a.createElement(E.a,{getPopupContainer:function(e){return document.getElementById("id_left")},title:"上移"},m.a.createElement("span",{onClick:function(){return e=t,n=[],(i=Object(J.cloneDeep)(Oe)).length>1&&0!==e&&(n=Qt(i,e,e-1)),void Ne(n);var e,n,i},className:"mb20",style:{transform:"rotate(270deg)"}},m.a.createElement("i",{className:"icon-jiantou1"}))):m.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}},m.a.createElement("i",{className:"icon-jiantou1"})),t<Oe.length-1?m.a.createElement(E.a,{getPopupContainer:function(e){return document.getElementById("id_left")},title:"下移"},m.a.createElement("span",{onClick:function(){return e=t,n=[],(i=Object(J.cloneDeep)(Oe)).length>1&&e!==i.length-1&&(n=Qt(i,e,e+1)),void Ne(n);var e,n,i},style:{transform:"rotate(90deg)"}},m.a.createElement("i",{className:"icon-jiantou1"}))):m.a.createElement("span",{style:{transform:"rotate(90deg)",cursor:"not-allowed"}},m.a.createElement("i",{className:"icon-jiantou1"})))))}))),(Rt=Yt(Oe),Bt=Rt.panel,zt=(zt=Rt.score_total).reduce((function(e,t){return e+t}),0),Bt=Object(J.flatten)(Bt).reduce((function(e,t){return e+t}),0),m.a.createElement("div",{className:T.a.total},m.a.createElement("div",null,m.a.createElement("img",{src:F.a}),m.a.createElement("span",null,"题数(道)"),m.a.createElement("aside",null,Bt)),m.a.createElement("aside",null),m.a.createElement("div",null,m.a.createElement("img",{src:W.a}),m.a.createElement("span",null,"总分(分)"),m.a.createElement("aside",null,zt))))),m.a.createElement("div",{className:T.a.right},m.a.createElement(w,{className:T.a.tabs,value:1,onChange:function(){return o(0)}}),m.a.createElement("section",{className:T.a.topWarp},m.a.createElement("div",{className:T.a.title},m.a.createElement("b",null),m.a.createElement("span",null,"抽题组卷"),m.a.createElement("div",null,"STEP2")),m.a.createElement("div",{className:T.a.source},m.a.createElement("b",null,"*"),m.a.createElement("span",null,"试题来源"),m.a.createElement("aside",null,m.a.createElement("div",{onClick:function(){return en("mine")}},m.a.createElement(S.a,{checked:null==C?void 0:C.includes("mine")}),m.a.createElement("span",{style:{color:null!=C&&C.includes("mine")?"#007DFE":"#666666"}},"仅我创建的")),m.a.createElement("div",{className:"mb20",onClick:function(){return en("teach_groups")}},m.a.createElement(S.a,{checked:null==C?void 0:C.includes("teach_groups")}),m.a.createElement("span",{style:{color:null!=C&&C.includes("teach_groups")?"#007DFE":"#666666"}},"教研共享")),m.a.createElement("div",{onClick:function(){return en("public")}},m.a.createElement(S.a,{checked:null==C?void 0:C.includes("public")}),m.a.createElement("span",{style:{color:null!=C&&C.includes("public")?"#007DFE":"#666666"}},"公共题库"))),m.a.createElement("aside",null,(null==C?void 0:C.includes("mine"))&&m.a.createElement("div",{style:{marginBottom:14},className:T.a.folder,onClick:function(){Tt(!0),Ye(!0),lt.current=Je,Dt((null==Pt?void 0:Pt.map((function(e){return e.count})).reduce((function(e,t){return e+t}),0))||0)}},m.a.createElement("img",{src:D.a}),m.a.createElement("span",null,"选择试题文件夹"),m.a.createElement(E.a,{title:"选中项仅包括该文件夹下的试题,不包括子文件夹,且系统取您选中的文件夹和考查范围中的试题的并集作为随机对象。"},m.a.createElement("img",{src:M.a}))),(null==C?void 0:C.includes("teach_groups"))&&m.a.createElement("div",{className:T.a.folder,onClick:function(){dt(!0),Ct.current=mt}},m.a.createElement("img",{src:G.a}),m.a.createElement("span",null,"选择教研团队")))),m.a.createElement("div",{className:T.a.times},m.a.createElement("b",null,"*"),m.a.createElement("span",null,"题目使用次数"),m.a.createElement("div",{className:T.a.maxTimesInputWrapper},"不超过",m.a.createElement(a.a,{className:T.a.maxTimesInput,value:re,onChange:function(e){if("number"==typeof e){if(oe(e),!Je.length&&!ze.length&&!mt.length)return;qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt,item_bank_quotes:e}),Ke.current=ze}},min:0,precision:0}),"次")),(null==C?void 0:C.includes("mine"))&&m.a.createElement("div",{className:T.a.choice},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,"已选文件夹")),m.a.createElement(q.a,{type:2,value:Pt,onChange:function(e){var t=Je.filter((function(t){return t!==e}));qt({source:C,group_ids:t,tag_discipline_ids:ze,teach_group_ids:mt}),Qe(t),lt.current=t}})),(null==C?void 0:C.includes("teach_groups"))&&m.a.createElement("div",{className:T.a.choice},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,"已选教研团队")),m.a.createElement(q.a,{icon:U.a,type:2,value:It,onChange:function(e){var t=mt.filter((function(t){return t!==e}));qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:t}),gt(t),Ct.current=t}})),m.a.createElement("div",{className:T.a.range},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,"考察范围")),m.a.createElement("div",{onClick:function(){null!==Ve?(Ke.current=ze,ge(!0)):_.b.warn("考察范围没有知识点可以选择")},className:T.a.btn},m.a.createElement("img",{src:I.a})," 选择范围"),m.a.createElement("div",{className:T.a.name},m.a.createElement("b",{className:T.a.num}),m.a.createElement("span",null,"已选知识点")),m.a.createElement("div",{className:T.a.knWarp},null==rn?void 0:rn.map((function(e,t){return m.a.createElement(m.a.Fragment,{key:t},m.a.createElement("div",{className:T.a.kn},m.a.createElement("span",null,t+1)," ",m.a.createElement("span",null,null==e?void 0:e[0].parent_name)),m.a.createElement(q.a,{type:1,value:null==e?void 0:e.filter((function(e){return!!e.item_count})),onChange:function(e){var t=ze.filter((function(t){return t!==e}));qt({source:C,group_ids:Je,tag_discipline_ids:t,teach_group_ids:mt}),Fe(t),Ke.current=t}}))}))))),m.a.createElement(i.a,{loading:P,active:!0,paragraph:{rows:5}},Oe.map((function(e,t){return m.a.createElement($.a,{key:t,value:e,onChange:function(e){return function(e,t){var n,i,r=Object(J.cloneDeep)(Oe);r[t]=e;var o=Yt([r[t]]),a=null==o||null===(n=o.panel)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.reduce((function(e,t){return e+t}),0);r[t].questionTotal=a,Ne(r);var s=document.getElementsByClassName("customError");null==s||s.forEach((function(e){var t;null==e||null===(t=e.classList)||void 0===t||t.remove("customError")}))}(e,t)}})})),m.a.createElement("div",{className:T.a.btns},m.a.createElement(r.a,{onClick:function(){o(0),document.body.scrollIntoView()}},"上一步"),m.a.createElement(r.a,{loading:V,onClick:function(){return Xt()}},"提交"),m.a.createElement(r.a,{loading:Z,onClick:function(){return Zt()},type:"primary"},"预览")))),m.a.createElement(k.a,{centered:!0,closable:!1,destroyOnClose:!0,className:T.a.modal,visible:me,title:null,width:"1200px",onOk:Gt,onCancel:function(){Fe(Ke.current),ge(!1),de("")}},m.a.createElement("div",{className:T.a.modalBody},m.a.createElement("div",{className:T.a.left},m.a.createElement("div",{className:T.a.title},m.a.createElement("img",{src:B.a}),m.a.createElement("span",null,"章节分布")),m.a.createElement("div",{className:T.a.l},null==Ae?void 0:Ae.map((function(e){var t,n=!1;he?null===(t=e.sub_disciplines)||void 0===t||t.forEach((function(e){var t;null===(t=e.tag_disciplines)||void 0===t||t.forEach((function(e){var t;n||(n=(null===(t=e.name)||void 0===t?void 0:t.includes(he))&&0!==e.item_count)}))})):n=!0;return m.a.createElement(m.a.Fragment,{key:e.id},!!e.item_count&&n&&m.a.createElement("div",{onClick:function(){return Ge(e.id)},className:"".concat(T.a.name," ").concat(e.id===Ve?T.a.active:"")},m.a.createElement("b",null),m.a.createElement("span",null,e.name)))})))),m.a.createElement("div",{className:T.a.right},m.a.createElement("div",{className:T.a.inputWarp},m.a.createElement(le,{onChange:function(e){return de(e.target.value)},placeholder:"请输入知识点",value:he})),m.a.createElement("div",{className:T.a.l},null==nn?void 0:nn.map((function(e,t){var n,i=Object(l.a)(Object(l.a)({},e),{},{tag_disciplines:null==e||null===(n=e.tag_disciplines)||void 0===n?void 0:n.filter((function(e){return 0!==e.item_count}))});return m.a.createElement(ee,{search:he,onChange:$t,key:e.id,value:ze,options:i})})))))),m.a.createElement(k.a,{centered:!0,title:"选择文件夹",visible:$e,width:718,destroyOnClose:!0,onCancel:function(){Qe(lt.current),Ye(!1),Dt(0)},footer:m.a.createElement("div",{style:{display:"flex",alignItems:"center"}},m.a.createElement("span",{style:{flex:"1",textAlign:"left"}},"已选",Je.length||0,"个文件夹,共(",jt||0,")道题"),m.a.createElement(r.a,{onClick:function(){Qe(lt.current),Dt(0),Ye(!1)}},"取消"),m.a.createElement(r.a,{type:"primary",onClick:function(){qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt}),lt.current=Je,Ye(!1)}},"确认"))},m.a.createElement("aside",{className:T.a.exportModal},Nt&&m.a.createElement(ae,{treeData:St,defaultValue:nt,value:Je,onChange:function(e,t){var n;Dt(null===(n=t.selectedNodes)||void 0===n?void 0:n.map((function(e){return e.count})).reduce((function(e,t){return e+t}),0)),Qe(e)}}))),m.a.createElement(k.a,{centered:!0,title:"选择教研团队",visible:ht,width:718,destroyOnClose:!0,onCancel:function(){gt(Ct.current),dt(!1)},onOk:function(){qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt}),Ct.current=mt,dt(!1)}},m.a.createElement("aside",{className:T.a.teachModal},m.a.createElement("div",{className:T.a.head},m.a.createElement("div",{className:T.a.li}),m.a.createElement("div",{className:T.a.li},"团队名称"),m.a.createElement("div",{className:T.a.li},"共享题目数量")),m.a.createElement("div",{className:T.a.wraps},null==bt?void 0:bt.map((function(e){return m.a.createElement("div",{key:e.id,className:T.a.body},m.a.createElement("div",{className:T.a.li},m.a.createElement(S.a,{onChange:function(){var t=e.id,n=Object(O.a)(mt);mt.includes(t)?n=n.filter((function(e){return e!==t})):n.push(t),gt(n)},checked:null==mt?void 0:mt.includes(e.id)})),m.a.createElement("div",{title:e.name,className:T.a.li},e.name),m.a.createElement("div",{className:T.a.li},e.item_bank_count))}))))))},ue=h.a.TextArea;t.default=Object(v.a)((function(e){return{paperlibrary:e.paperlibrary,user:e.user,globalSetting:e.globalSetting}}))((function(e){e.paperlibrary,e.user,e.globalSetting;var t=e.dispatch,n=Object(f.useState)(0),d=Object(u.a)(n,2),y=d[0],x=d[1],C=c.a.useForm(),k=Object(u.a)(C,1)[0],S=Object(f.useState)({}),E=Object(u.a)(S,2),_=E[0],O=E[1],N=Object(f.useState)(!0),T=Object(u.a)(N,2),L=T[0],A=T[1],M=Object(f.useState)(null),j=Object(u.a)(M,2),D=j[0],P=j[1],I=Object(g.i)().id;console.log(I,"editId"),Object(f.useEffect)((function(){return t({type:"globalSetting/footerToggle",payload:!1}),function(){t({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(f.useEffect)((function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}}),[]);Object(f.useEffect)((function(){I?R():A(!1)}),[I]);var R=function(){var e=Object(s.a)(p.a.mark((function e(){var t,n,i,r,o,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(te.a)("/api/examination_banks/".concat(I,"/edit_random_exam.json"),{method:"get",params:{}});case 2:null!=(t=e.sent)&&t.examination_bank&&(a={difficulty:null==t||null===(n=t.examination_bank)||void 0===n?void 0:n.difficulty,exam_notes:null==t||null===(i=t.examination_bank)||void 0===i?void 0:i.exam_notes,name:null==t||null===(r=t.examination_bank)||void 0===r?void 0:r.name,time:null==t||null===(o=t.examination_bank)||void 0===o?void 0:o.time},A(!1),O(Object(l.a)({},a)),k.setFieldsValue(Object(l.a)({},a)),P(Object(l.a)(Object(l.a)({},t),{},{id:I})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=Object(s.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t){e.next=3;break}return x(t),e.abrupt("return");case 3:return e.next=5,k.validateFields();case 5:x(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("section",{className:b.a.wrap},m.a.createElement(i.a,{loading:L,active:!0,paragraph:{rows:5}},m.a.createElement("div",{className:b.a.crumbs},m.a.createElement("b",null),m.a.createElement("span",{className:"current",onClick:function(){return v.d.push("/")}},"首页>"),m.a.createElement("span",{className:"current",onClick:function(){return v.d.push("/paperlibrary")}},"试卷与作业>"),m.a.createElement("span",{style:{color:"#bebebe"}},"随机试卷与作业")),0===y&&m.a.createElement(w,{value:y,onChange:B}),0===y&&m.a.createElement("section",{className:b.a.oneWrap},m.a.createElement("div",{className:b.a.title},m.a.createElement("b",null),m.a.createElement("span",null,"基本信息"),m.a.createElement("div",null,"STEP1")," "),m.a.createElement(c.a,{className:b.a.formWrap,form:k,layout:"horizontal",onValuesChange:function(e){O(Object(l.a)({},k.getFieldsValue()))}},m.a.createElement(c.a.Item,{label:"名称",name:"name",rules:[{required:!0,message:"名称不能为空"},{pattern:/^(?!(\s+$))/,message:"输入框不能全为空格"}]},m.a.createElement(h.a,{className:b.a.in,bordered:!1,placeholder:"请输入名称最多60个字",maxLength:60})),m.a.createElement("div",{style:{position:"relative"}},m.a.createElement(c.a.Item,{label:"完成时长限制:",name:"time",rules:[{required:!0,message:"时长不能为空"}]},m.a.createElement(a.a,{min:1,parser:function(e){var t=parseInt(e);return Object(J.isNaN)(t)?"":t},max:9999,placeholder:"请输入时长",style:{width:190}})),m.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"分钟")),m.a.createElement(c.a.Item,{label:"难度",name:"difficulty",rules:[{required:!0,message:"请选择难度"}]},m.a.createElement(o.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},m.a.createElement(o.a.Button,{className:b.a.rb,value:1},"简单"),m.a.createElement(o.a.Button,{className:b.a.rb,value:2},"适中"),m.a.createElement(o.a.Button,{className:b.a.rb,value:3},"困难"))),m.a.createElement(c.a.Item,{label:"须知",name:"exam_notes"},m.a.createElement(ue,{rows:4,maxLength:300}))),m.a.createElement("div",{className:b.a.btns},m.a.createElement(r.a,{className:"mr40",onClick:function(){return v.d.push("/paperlibrary")}},"返回"),m.a.createElement(r.a,{type:"primary",onClick:Object(s.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.validateFields();case 2:x(1);case 3:case"end":return e.stop()}}),e)})))},"下一步"))),m.a.createElement(ce,{tabs:y,dispatch:t,editData:D,setFatherTabs:x,formValue:_})))}))},"E/GV":
/*!*************************************************!*\
!*** ./src/assets/images/paper/swenjianjia.svg ***!
\*************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/swenjianjia.1640bf70.svg"},ELLl:
/*!*************************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closebrackets.js ***!
\*************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(r),t.state.closeBrackets=null),n&&(o(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(r))}));var r={Backspace:function(t){var r=s(t);if(!r||t.getOption("disableInput"))return e.Pass;for(var o=i(r,"pairs"),a=t.listSelections(),c=0;c<a.length;c++){if(!a[c].empty())return e.Pass;var u=l(t,a[c].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(c=a.length-1;c>=0;c--){var h=a[c].head;t.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(t){var n=s(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return e.Pass;var c=l(t,o[a].head);if(!c||r.indexOf(c)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),o=t.listSelections();for(var n=0;n<o.length;n++){var i=o[n].head.line;t.indentLine(i,null,!0),t.indentLine(i+1,null,!0)}}))}};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),i="'"+n+"'";r[i]||(r[i]=a(n))}}function a(t){return function(r){return function(t,r){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=i(o,"pairs"),l=a.indexOf(r);if(-1==l)return e.Pass;for(var u,h=i(o,"closeBefore"),d=i(o,"triples"),p=a.charAt(l+1)==r,f=t.listSelections(),m=l%2==0,g=0;g<f.length;g++){var v,y=f[g],b=y.head,x=t.getRange(b,n(b.line,b.ch+1));if(m&&!y.empty())v="surround";else if(!p&&m||x!=r)if(p&&b.ch>1&&d.indexOf(r)>=0&&t.getRange(n(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;v="addFour"}else if(p){var C=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(x)||C==r||e.isWordChar(C))return e.Pass;v="both"}else{if(!m||!(0===x.length||/\s/.test(x)||h.indexOf(x)>-1))return e.Pass;v="both"}else v=p&&c(t,b)?"both":d.indexOf(r)>=0&&t.getRange(b,n(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(u){if(u!=v)return e.Pass}else u=v}var w=l%2?a.charAt(l-1):r,k=l%2?r:a.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var i=0;i<3;i++)t.execCommand("goCharRight");else if("surround"==u){var r=t.getSelections();for(i=0;i<r.length;i++)r[i]=w+r[i]+k;for(t.replaceSelections(r,"around"),r=t.listSelections().slice(),i=0;i<r.length;i++)r[i]=(o=r[i],a=void 0,a=e.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});t.setSelections(r)}else"both"==u?(t.replaceSelection(w+k,null),t.triggerElectric(w+k),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(w+w+w+w,"before"),t.execCommand("goCharRight"));var o,a}))}(r,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var i=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==i.length?i:null}function c(e,t){var i=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(i.type)&&i.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(/*! ../../lib/codemirror */"VrN/"))},FTkQ:
/*!***********************************************!*\
!*** ./src/assets/images/icons/tagDelete.png ***!
\***********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx:
/*!********************************************!*\
!*** ./node_modules/shallowequal/index.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<o.length;l++){var c=o[l];if(!s(c))return!1;var u=e[c],h=t[c];if(!1===(r=n?n.call(i,u,h,c):void 0)||void 0===r&&u!==h)return!1}return!0}},H38U:
/*!******************************************!*\
!*** ./node_modules/qr.js/lib/QRCode.js ***!
\******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var i=n(/*! ./8BitByte */"f4xo"),r=n(/*! ./RSBlock */"rcnY"),o=n(/*! ./BitBuffer */"wU8J"),a=n(/*! ./util */"Iq15"),s=n(/*! ./Polynomial */"dWSS");function l(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var c=l.prototype;c.addData=function(e){var t=new i(e);this.dataList.push(t),this.dataCache=null},c.isDark=function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},c.getModuleCount=function(){return this.moduleCount},c.make=function(){if(this.typeNumber<1){var e=1;for(e=1;e<40;e++){for(var t=r.getRSBlocks(e,this.errorCorrectLevel),n=new o,i=0,s=0;s<t.length;s++)i+=t[s].dataCount;for(s=0;s<this.dataList.length;s++){var l=this.dataList[s];n.put(l.mode,4),n.put(l.getLength(),a.getLengthInBits(l.mode,e)),l.write(n)}if(n.getLengthInBits()<=8*i)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())},c.makeImpl=function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},c.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+n][t+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},c.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=a.getLostPoint(this);(0==n||e>i)&&(e=i,t=n)}return t},c.createMovieClip=function(e,t,n){var i=e.createEmptyMovieClip(t,n);this.make();for(var r=0;r<this.modules.length;r++)for(var o=1*r,a=0;a<this.modules[r].length;a++){var s=1*a;this.modules[r][a]&&(i.beginFill(0,100),i.moveTo(s,o),i.lineTo(s+1,o),i.lineTo(s+1,o+1),i.lineTo(s,o+1),i.endFill())}return i},c.setupTimingPattern=function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},c.setupPositionAdjustPattern=function(){for(var e=a.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var i=e[t],r=e[n];if(null==this.modules[i][r])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[i+o][r+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},c.setupTypeNumber=function(e){for(var t=a.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var i=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;n<18;n++){i=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}},c.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,i=a.getBCHTypeInfo(n),r=0;r<15;r++){var o=!e&&1==(i>>r&1);r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(r=0;r<15;r++){o=!e&&1==(i>>r&1);r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!e},c.mapData=function(e,t){for(var n=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var l=0;l<2;l++)if(null==this.modules[i][s-l]){var c=!1;o<e.length&&(c=1==(e[o]>>>r&1)),a.getMask(t,i,s-l)&&(c=!c),this.modules[i][s-l]=c,-1==--r&&(o++,r=7)}if((i+=n)<0||this.moduleCount<=i){i-=n,n=-n;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(e,t,n){for(var i=r.getRSBlocks(e,t),s=new o,c=0;c<n.length;c++){var u=n[c];s.put(u.mode,4),s.put(u.getLength(),a.getLengthInBits(u.mode,e)),u.write(s)}var h=0;for(c=0;c<i.length;c++)h+=i[c].dataCount;if(s.getLengthInBits()>8*h)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*h+")");for(s.getLengthInBits()+4<=8*h&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*h||(s.put(l.PAD0,8),s.getLengthInBits()>=8*h));)s.put(l.PAD1,8);return l.createBytes(s,i)},l.createBytes=function(e,t){for(var n=0,i=0,r=0,o=new Array(t.length),l=new Array(t.length),c=0;c<t.length;c++){var u=t[c].dataCount,h=t[c].totalCount-u;i=Math.max(i,u),r=Math.max(r,h),o[c]=new Array(u);for(var d=0;d<o[c].length;d++)o[c][d]=255&e.buffer[d+n];n+=u;var p=a.getErrorCorrectPolynomial(h),f=new s(o[c],p.getLength()-1).mod(p);l[c]=new Array(p.getLength()-1);for(d=0;d<l[c].length;d++){var m=d+f.getLength()-l[c].length;l[c][d]=m>=0?f.get(m):0}}var g=0;for(d=0;d<t.length;d++)g+=t[d].totalCount;var v=new Array(g),y=0;for(d=0;d<i;d++)for(c=0;c<t.length;c++)d<o[c].length&&(v[y++]=o[c][d]);for(d=0;d<r;d++)for(c=0;c<t.length;c++)d<l[c].length&&(v[y++]=l[c][d]);return v},e.exports=l},HG2Q:
/*!******************************************!*\
!*** ./src/assets/images/paper/sren.svg ***!
\******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/sren.1cbce50b.svg"},HPRh:
/*!********************************************!*\
!*** ./src/assets/images/paper/median.svg ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/median.766cb706.svg"},Hfvn:
/*!*********************************************!*\
!*** ./src/assets/images/paper/wenjian.svg ***!
\*********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/wenjian.ea3b4170.svg"},HmJG:
/*!****************************************************************!*\
!*** ./src/components/markdown-editor/upload-image/index.less ***!
\****************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},IlMy:
/*!****************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/index.less?modules ***!
\****************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___1Rd7-",flex_space_between:"flex_space_between___1qdJI",flex_box_vertical_center:"flex_box_vertical_center___3PScB",flex_box_center_end:"flex_box_center_end___gmzWk",flex_box_column:"flex_box_column___qhFY7",wrap:"wrap___2CDxR",left:"left___21M_k",list:"list___ahv58",name:"name___3cBep",b:"b___1CRFh",r:"r___2F_9I",l:"l___3XCXI",total:"total___2VTdV",topWarp:"topWarp___y9feY",right:"right___U2Z5M",tabs:"tabs___3eZK5",title:"title___3iKxF",source:"source___3rkh5",folder:"folder___AxGOK",times:"times___3x9Ch",maxTimesInputWrapper:"maxTimesInputWrapper___36-0E",maxTimesInput:"maxTimesInput___2O-54",choice:"choice___1AdWh",range:"range___23nFr",btn:"btn___1QiCj",knWarp:"knWarp___3eQQ5",kn:"kn___1OLj0",btns:"btns___26z5C",modalBody:"modalBody___1b2lK",active:"active___kELz6",inputWarp:"inputWarp___1leis",modal:"modal___1Ehn0",exportModal:"exportModal___1Vsj-",teachModal:"teachModal___CwfeZ",head:"head___2_Y6a",wraps:"wraps___3-f7m",body:"body___2Jb5Z"}},Iq15:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/util.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var i=n(/*! ./mode */"nVVt"),r=n(/*! ./Polynomial */"dWSS"),o=n(/*! ./math */"dQei"),a=0,s=1,l=2,c=3,u=4,h=5,d=6,p=7,f={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;f.getBCHDigit(t)-f.getBCHDigit(f.G15)>=0;)t^=f.G15<<f.getBCHDigit(t)-f.getBCHDigit(f.G15);return(e<<10|t)^f.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;f.getBCHDigit(t)-f.getBCHDigit(f.G18)>=0;)t^=f.G18<<f.getBCHDigit(t)-f.getBCHDigit(f.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return f.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case a:return(t+n)%2==0;case s:return t%2==0;case l:return n%3==0;case c:return(t+n)%3==0;case u:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case h:return t*n%2+t*n%3==0;case d:return(t*n%2+t*n%3)%2==0;case p:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new r([1],0),n=0;n<e;n++)t=t.multiply(new r([1,o.gexp(n)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case i.MODE_NUMBER:return 10;case i.MODE_ALPHA_NUM:return 9;case i.MODE_8BIT_BYTE:case i.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case i.MODE_NUMBER:return 12;case i.MODE_ALPHA_NUM:return 11;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case i.MODE_NUMBER:return 14;case i.MODE_ALPHA_NUM:return 13;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,i=0;i<t;i++)for(var r=0;r<t;r++){for(var o=0,a=e.isDark(i,r),s=-1;s<=1;s++)if(!(i+s<0||t<=i+s))for(var l=-1;l<=1;l++)r+l<0||t<=r+l||0==s&&0==l||a==e.isDark(i+s,r+l)&&o++;o>5&&(n+=3+o-5)}for(i=0;i<t-1;i++)for(r=0;r<t-1;r++){var c=0;e.isDark(i,r)&&c++,e.isDark(i+1,r)&&c++,e.isDark(i,r+1)&&c++,e.isDark(i+1,r+1)&&c++,0!=c&&4!=c||(n+=3)}for(i=0;i<t;i++)for(r=0;r<t-6;r++)e.isDark(i,r)&&!e.isDark(i,r+1)&&e.isDark(i,r+2)&&e.isDark(i,r+3)&&e.isDark(i,r+4)&&!e.isDark(i,r+5)&&e.isDark(i,r+6)&&(n+=40);for(r=0;r<t;r++)for(i=0;i<t-6;i++)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);var u=0;for(r=0;r<t;r++)for(i=0;i<t;i++)e.isDark(i,r)&&u++;return n+=10*(Math.abs(100*u/t/t-50)/5)}};e.exports=f},K5AI:
/*!****************************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/ProCheckout/index.less?modules ***!
\****************************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={cInput:"cInput___2BJRi",cl:"cl___AbKoK",box:"box___3gRA9",box1:"box1___S3u_s",cr:"cr___16yEi"}},LdHM:
/*!********************************************************!*\
!*** ./node_modules/rc-select/es/index.js + 6 modules ***!
\********************************************************/
/*! exports provided: Option, OptGroup, default */
/*! exports used: OptGroup, Option, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/TransBtn.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/generate.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/commonUtil.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/valueUtil.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMemo.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/pickAttrs.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.d(t,"b",(function(){return C})),n.d(t,"a",(function(){return k}));var i=n("1OyB"),r=n("vuIU"),o=n("Ji7U"),a=n("LK+K"),s=n("q1tI"),l=n("rePB"),c=n("Ff2n"),u=n("ODXe"),h=n("4IlW"),d=n("bX4T"),p=n("YrtM"),f=n("TSYQ"),m=n.n(f),g=n("+nKL"),v=n("8OUc"),y=s.forwardRef((function(e,t){var n=e.prefixCls,i=e.id,r=e.flattenOptions,o=e.childrenAsData,a=e.values,f=e.searchValue,y=e.multiple,b=e.defaultActiveFirstOption,x=e.height,C=e.itemHeight,w=e.notFoundContent,k=e.open,S=e.menuItemSelectedIcon,E=e.virtual,_=e.onSelect,O=e.onToggleOpen,N=e.onActiveValue,T=e.onScroll,L=e.onMouseEnter,A="".concat(n,"-item"),M=Object(p.a)((function(){return r}),[k,r],(function(e,t){return t[0]&&e[1]!==t[1]})),j=s.useRef(null),D=function(e){e.preventDefault()},P=function(e){j.current&&j.current.scrollTo({index:e})},I=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=M.length,i=0;i<n;i+=1){var r=(e+i*t+n)%n,o=M[r],a=o.group,s=o.data;if(!a&&!s.disabled)return r}return-1},R=s.useState((function(){return I(0)})),B=Object(u.a)(R,2),z=B[0],F=B[1],H=function(e){F(e);var t=M[e];t?N(t.data.value,e):N(null,-1)};s.useEffect((function(){H(!1!==b?I(0):-1)}),[M.length,f]),s.useEffect((function(){var e=setTimeout((function(){if(!y&&k&&1===a.size){var e=Array.from(a)[0],t=M.findIndex((function(t){return t.data.value===e}));H(t),P(t)}}));return function(){return clearTimeout(e)}}),[k]);var W=function(e){void 0!==e&&_(e,{selected:!a.has(e)}),y||O(!1)};if(s.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case h.a.UP:case h.a.DOWN:var n=0;if(t===h.a.UP?n=-1:t===h.a.DOWN&&(n=1),0!==n){var i=I(z+n,n);P(i),H(i)}break;case h.a.ENTER:var r=M[z];r&&!r.data.disabled?W(r.data.value):W(void 0),k&&e.preventDefault();break;case h.a.ESC:O(!1)}},onKeyUp:function(){},scrollTo:function(e){P(e)}}})),0===M.length)return s.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(A,"-empty"),onMouseDown:D},w);function V(e){var t=M[e];if(!t)return null;var n=t.data||{},r=n.value,l=n.label,c=n.children,u=Object(d.a)(n,!0),h=o?c:l;return t?s.createElement("div",Object.assign({"aria-label":"string"==typeof h?h:null},u,{key:e,role:"option",id:"".concat(i,"_list_").concat(e),"aria-selected":a.has(r)}),r):null}return s.createElement(s.Fragment,null,s.createElement("div",{role:"listbox",id:"".concat(i,"_list"),style:{height:0,width:0,overflow:"hidden"}},V(z-1),V(z),V(z+1)),s.createElement(g.a,{itemKey:"key",ref:j,data:M,height:x,itemHeight:C,fullHeight:!1,onMouseDown:D,onScroll:T,virtual:E,onMouseEnter:L},(function(e,t){var n,i=e.group,r=e.groupOption,u=e.data,h=u.label,d=u.key;if(i)return s.createElement("div",{className:m()(A,"".concat(A,"-group"))},void 0!==h?h:d);var p=u.disabled,f=u.value,g=u.title,y=u.children,b=u.style,x=u.className,C=Object(c.a)(u,["disabled","value","title","children","style","className"]),w=a.has(f),k="".concat(A,"-option"),E=m()(A,k,x,(n={},Object(l.a)(n,"".concat(k,"-grouped"),r),Object(l.a)(n,"".concat(k,"-active"),z===t&&!p),Object(l.a)(n,"".concat(k,"-disabled"),p),Object(l.a)(n,"".concat(k,"-selected"),w),n)),_=o?y:h,O=!S||"function"==typeof S||w;return s.createElement("div",Object.assign({},C,{"aria-selected":w,className:E,title:g,onMouseMove:function(){z===t||p||H(t)},onClick:function(){p||W(f)},style:b}),s.createElement("div",{className:"".concat(k,"-content")},_||f),s.isValidElement(S)||w,O&&s.createElement(v.a,{className:"".concat(A,"-option-state"),customizeIcon:S,customizeIconProps:{isSelected:w}},w?"✓":null))})))}));y.displayName="OptionList";var b=y,x=function(){return null};x.isSelectOption=!0;var C=x,w=function(){return null};w.isSelectOptGroup=!0;var k=w,S=n("VTBJ"),E=n("Zm9Q");function _(e){var t=e.key,n=e.props,i=n.children,r=n.value,o=Object(c.a)(n,["children","value"]);return Object(S.a)({key:t,value:void 0!==r?r:t,children:i},o)}function O(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(E.a)(e).map((function(e,n){if(!s.isValidElement(e)||!e.type)return null;var i=e.type.isSelectOptGroup,r=e.key,o=e.props,a=o.children,l=Object(c.a)(o,["children"]);return t||!i?_(e):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===r?n:r,"__"),label:r},l),{},{options:O(a)})})).filter((function(e){return e}))}var N=n("2Qr1"),T=n("qNPg"),L=n("U8pU"),A=n("Kwbf"),M=n("WKfj");var j=function(e){var t=e.mode,n=e.options,i=e.children,r=e.backfill,o=e.allowClear,a=e.placeholder,l=e.getInputElement,c=e.showSearch,u=e.onSearch,h=e.defaultOpen,d=e.autoFocus,p=e.labelInValue,f=e.value,m=e.inputValue,g=e.optionLabelProp,v="multiple"===t||"tags"===t,y=void 0!==c?c:v||"combobox"===t,b=n||O(i);if(Object(A.a)("tags"!==t||b.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var x=b.some((function(e){return e.options?e.options.some((function(e){return"number"==typeof("value"in e?e.value:e.key)})):"number"==typeof("value"in e?e.value:e.key)}));Object(A.a)(!x,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)("combobox"!==t||!g,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)("combobox"===t||!r,"`backfill` only works with `combobox` mode."),Object(A.a)("combobox"===t||!l,"`getInputElement` only work with `combobox` mode."),Object(A.b)("combobox"!==t||!l||!o||!a,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==t&&"tags"!==t&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=f){var C=Object(M.d)(f);Object(A.a)(!p||C.every((function(e){return"object"===Object(L.a)(e)&&("key"in e||"value"in e)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!v||Array.isArray(f),"`value` should be array when `mode` is `multiple` or `tags`")}if(i){var w=null;Object(E.a)(i).some((function(e){if(!s.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(E.a)(e.props.children).every((function(t){return!(s.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(w=t.type,!1)})):(w=t,!0))})),w&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(w.displayName||w.name||w,"`.")),Object(A.a)(void 0===m,"`inputValue` is deprecated, please use `searchValue` instead.")}},D=Object(T.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:N.d,getLabeledValue:N.e,filterOptions:N.b,isValueDisabled:N.g,findValueOption:N.c,warningProps:j,fillOptionsWithMissingValue:N.a}),P=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).selectRef=s.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(r.a)(n,[{key:"render",value:function(){return s.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),n}(s.Component);P.Option=C,P.OptGroup=k;var I=P;t.c=I},M8RZ:
/*!**********************************!*\
!*** ./src/components/modal.tsx ***!
\**********************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! react-dom */"i8i4"),u=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e){var r;Object(i.a)(this,n),r=t.call(this,e);var o=window.document;return r.node=o.createElement("div"),o.body.appendChild(r.node),r}return Object(r.a)(n,[{key:"render",value:function(){var e=this.props.children;return Object(c.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(l.a.Component)},NvD2:
/*!******************************************************!*\
!*** ./node_modules/rc-tree/es/utils/conductUtil.js ***!
\******************************************************/
/*! exports provided: isCheckDisabled, conductCheck */
/*! exports used: conductCheck */function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(/*! rc-util/es/warning */"Kwbf");function r(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function o(e){var t=e||{},n=t.disabled,i=t.disableCheckbox,r=t.checkable;return!(!n&&!i)||!1===r}function a(e,t,n,a){var s,l=[];s=a||o;var c=new Set(e.filter((function(e){var t=!!n[e];return t||l.push(e),t}))),u=new Map,h=0;return Object.keys(n).forEach((function(e){var t=n[e],i=t.level,r=u.get(i);r||(r=new Set,u.set(i,r)),r.add(t),h=Math.max(h,i)})),Object(i.a)(!l.length,"Tree missing follow keys: ".concat(l.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),!0===t?function(e,t,n,i){for(var o=new Set(e),a=new Set,s=0;s<=n;s+=1){(t.get(s)||new Set).forEach((function(e){var t=e.key,n=e.node,r=e.children,a=void 0===r?[]:r;o.has(t)&&!i(n)&&a.filter((function(e){return!i(e.node)})).forEach((function(e){o.add(e.key)}))}))}for(var l=new Set,c=n;c>=0;c-=1){(t.get(c)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!i(n)&&e.parent&&!l.has(e.parent.key))if(i(e.parent.node))l.add(t.key);else{var r=!0,s=!1;(t.children||[]).filter((function(e){return!i(e.node)})).forEach((function(e){var t=e.key,n=o.has(t);r&&!n&&(r=!1),s||!n&&!a.has(t)||(s=!0)})),r&&o.add(t.key),s&&a.add(t.key),l.add(t.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(r(a,o))}}(c,u,h,s):function(e,t,n,i,o){for(var a=new Set(e),s=new Set(t),l=0;l<=i;l+=1){(n.get(l)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,r=void 0===i?[]:i;a.has(t)||s.has(t)||o(n)||r.filter((function(e){return!o(e.node)})).forEach((function(e){a.delete(e.key)}))}))}s=new Set;for(var c=new Set,u=i;u>=0;u-=1){(n.get(u)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!o(n)&&e.parent&&!c.has(e.parent.key))if(o(e.parent.node))c.add(t.key);else{var i=!0,r=!1;(t.children||[]).filter((function(e){return!o(e.node)})).forEach((function(e){var t=e.key,n=a.has(t);i&&!n&&(i=!1),r||!n&&!s.has(t)||(r=!0)})),i||a.delete(t.key),r&&s.add(t.key),c.add(t.key)}}))}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(r(s,a))}}(c,t.halfCheckedKeys,u,h,s)}},O2Wb:
/*!******************************************************************!*\
!*** ./src/components/Editor/NullChildEditor/index.less?modules ***!
\******************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:
/*!*********************************************************!*\
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var i=n("U8pU"),r=n("VTBJ"),o=n("Ff2n"),a=n("q1tI"),s=n("uciX"),l=n("7ixt"),c=function(e){var t=e.overlay,n=e.prefixCls,i=e.id,r=e.overlayInnerStyle;return a.createElement("div",{className:"".concat(n,"-inner"),id:i,role:"tooltip",style:r},"function"==typeof t?t():t)},u=Object(a.forwardRef)((function(e,t){var n=e.overlayClassName,u=e.trigger,h=void 0===u?["hover"]:u,d=e.mouseEnterDelay,p=void 0===d?0:d,f=e.mouseLeaveDelay,m=void 0===f?.1:f,g=e.overlayStyle,v=e.prefixCls,y=void 0===v?"rc-tooltip":v,b=e.children,x=e.onVisibleChange,C=e.afterVisibleChange,w=e.transitionName,k=e.animation,S=e.placement,E=void 0===S?"right":S,_=e.align,O=void 0===_?{}:_,N=e.destroyTooltipOnHide,T=void 0!==N&&N,L=e.defaultVisible,A=e.getTooltipContainer,M=e.overlayInnerStyle,j=Object(o.a)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),D=Object(a.useRef)(null);Object(a.useImperativeHandle)(t,(function(){return D.current}));var P=Object(r.a)({},j);"visible"in e&&(P.popupVisible=e.visible);var I=!1,R=!1;if("boolean"==typeof T)I=T;else if(T&&"object"===Object(i.a)(T)){var B=T.keepParent;I=!0===B,R=!1===B}return a.createElement(s.a,Object.assign({popupClassName:n,prefixCls:y,popup:function(){var t=e.arrowContent,n=void 0===t?null:t,i=e.overlay,r=e.id;return[a.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},n),a.createElement(c,{key:"content",prefixCls:y,id:r,overlay:i,overlayInnerStyle:M})]},action:h,builtinPlacements:l.a,popupPlacement:E,ref:D,popupAlign:O,getPopupContainer:A,onPopupVisibleChange:x,afterPopupVisibleChange:C,popupTransitionName:w,popupAnimation:k,defaultPopupVisible:L,destroyPopupOnHide:I,autoDestroy:R,mouseLeaveDelay:m,popupStyle:g,mouseEnterDelay:p},P),b)}));t.a=u},OZM5:
/*!*****************************************!*\
!*** ./node_modules/rc-tree/es/util.js ***!
\*****************************************/
/*! exports provided: arrDel, arrAdd, posToArr, getPosition, isTreeNode, getDragNodesKeys, calcDropPosition, calcSelectedKeys, convertDataToTree, parseCheckedKeys, conductExpandParent, getDataAndAria */
/*! exports used: arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDataAndAria, getDragNodesKeys, getPosition, isTreeNode, parseCheckedKeys, posToArr */function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"g",(function(){return h})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"j",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return g}));var i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),r=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),o=(n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),n(/*! react */"q1tI"),n(/*! rc-util/es/warning */"Kwbf"));n(/*! ./TreeNode */"WaYH");function a(e,t){var n=e.slice(),i=n.indexOf(t);return i>=0&&n.splice(i,1),n}function s(e,t){var n=e.slice();return-1===n.indexOf(t)&&n.push(t),n}function l(e){return e.split("-")}function c(e,t){return"".concat(e,"-").concat(t)}function u(e){return e&&e.type&&e.type.isTreeNode}function h(e,t){var n=[e];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){var i=t.key,r=t.children;n.push(i),e(r)}))}(t[e].children),n}function d(e,t){var n=e.clientY,i=t.selectHandle.getBoundingClientRect(),r=i.top,o=i.bottom,a=i.height,s=Math.max(.25*a,2);return n<=r+s?-1:n>=o-s?1:0}function p(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function f(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==Object(r.a)(e))return Object(o.a)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function m(e,t){var n=new Set;return(e||[]).forEach((function(e){!function e(i){if(!n.has(i)){var r=t[i];if(r){n.add(i);var o=r.parent;r.node.disabled||o&&e(o.key)}}}(e)})),Object(i.a)(n)}function g(e){var t={};return Object.keys(e).forEach((function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=e[n])})),t}},Ot1p:
/*!**************************************************************!*\
!*** ./src/components/markdown-editor/index.tsx + 6 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/qrcode.react/lib/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/uuid/dist/esm-browser/v4.js */function(e,t,n){"use strict";n("2qtc");var i=n("kLXV"),r=n("rAM+"),o=(n("miYZ"),n("tsqr")),a=n("9og8"),s=n("tJVT"),l=n("jrin"),c=n("WmNS"),u=n.n(c),h=n("q1tI"),d=n.n(h),p=n("VrN/"),f=n.n(p),m=n("bdgK"),g=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("+NIl"),n("kSUc"),n("9Bee")),v=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,Object(h.useMemo)((function(){return""}),[n]));return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:i}}))},y=(n("Q9mQ"),n("diRs")),b=n("0Owb"),x=(n("dejd"),n("C+DQ"),n("D1Df")),C=n.n(x),w=n("1vsH"),k=n("m3rI"),S=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function E(e){var t=e.onActionCallback,n=e.title,i=e.icon,r=e.actionName,o=e.className,a=void 0===o?"":o,s=e.children;return d.a.createElement("a",{title:n,className:a,onClick:function(){t(r)}},d.a.createElement("i",{className:"md-iconfont ".concat(i)}),s)}var _=function(e){var t=e.watch,n=e.showNullButton,i=e.onActionCallback,r=e.fullScreen,o=e.insertTemp,a=e.hidetoolBar,s=e.uuid,l=e.setOpenPhones,c=Object(w.E)("_educoder_session_login"),u=Object(w.E)("_educoder_session"),h=[].concat(S,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!a&&h.map((function(e,t){return d.a.createElement("li",{key:t},e.actionName?d.a.createElement(E,Object(b.a)({},e,{onActionCallback:i})):d.a.createElement("span",{className:"v-line"}))})),n?d.a.createElement("li",null,d.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:i},d.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,o&&d.a.createElement("li",null,d.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(o),onActionCallback:i},d.a.createElement("span",{className:"fill-tip"},"插入模板"))),d.a.createElement("li",null,d.a.createElement(y.a,{title:"打开手机扫一扫",content:d.a.createElement("div",null,d.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(k.a.API_SERVER)),d.a.createElement(C.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(k.a.API_SERVER)}))},d.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return l(!0)}},"手机上传文件"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(E,{icon:"".concat(r?"icon-shrink":"icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:i})))},O=n("M8RZ"),N=(n("+L6B"),n("2/Rp")),T=(n("y8nQ"),n("Vl3Y")),L=(n("5NDa"),n("5rEg")),A={labelCol:{span:4},wrapperCol:{span:20}},M=function(e){var t=e.callback,n=e.onCancel;return d.a.createElement(T.a,Object(b.a)({},A,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),d.a.createElement(T.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},d.a.createElement(L.a,null)),d.a.createElement(T.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},d.a.createElement(L.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))},j=n("7ahc"),D=n("k1fw"),P=(n("HmJG"),n("BjJ7")),I=T.a.useForm,R={width:280,marginRight:10},B={labelCol:{span:5},wrapperCol:{span:19}},z=function(e){var t=e.callback,n=e.onCancel,i=I(),r=Object(s.a)(i,1)[0],o=Object(h.useRef)();function a(e,t){r.setFieldsValue({src:"/api/attachments/".concat(e.id,"?type=").concat(e.content_type),type:t.type})}return d.a.createElement(T.a,Object(b.a)({form:r},B,{className:"upload-image-panel",onFinish:function(e){t(Object(D.a)(Object(D.a)({},e),{},{name:o.current}))}}),d.a.createElement(T.a.Item,{label:"文件地址",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(T.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},d.a.createElement(L.a,{style:R})),d.a.createElement(F,{onFileChange:function(e){var t=e.target.files[0];o.current=t.name,H(t,a)}}))),d.a.createElement(T.a.Item,{label:"文件描述",name:"alt"},d.a.createElement(L.a,{style:{width:264}})),d.a.createElement(T.a.Item,{style:{textAlign:"right"}},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))};function F(e){var t=e.onFileChange;return d.a.createElement("a",{className:"upload-button"},"本地上传",d.a.createElement("input",{type:"file",onChange:t}))}function H(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(P.a,"/api/attachments.json")),i.send(n)}n("giR+");var W,V,G=n("fyUT"),K=(n("7Kak"),n("9yH6")),U=K.a.Group,q={margin:"0 8px"},$=function(e){var t=e.callback,n=e.onCancel;return d.a.createElement(T.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:q},"单元格数:"),d.a.createElement("span",{style:q},"行数"),d.a.createElement(T.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},d.a.createElement(G.a,null)),d.a.createElement("span",{style:q},"列数"),d.a.createElement(T.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},d.a.createElement(G.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:q},"对齐方式:"),d.a.createElement(T.a.Item,{name:"align"},d.a.createElement(U,null,d.a.createElement(K.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(K.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(K.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(K.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))},Y=n("ErOA"),X=n("7Cbv"),Z="------------",J={default:Z,left:":".concat(Z),center:":".concat(Z,":"),right:"".concat(Z,":")},Q=n("9VGf");function ee(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var te=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ne=["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"],ie=(W={},Object(l.a)(W,te+"-B","bold"),Object(l.a)(W,te+"-I","italic"),W),re=(V={},Object(l.a)(V,"link","添加链接"),Object(l.a)(V,"code-block","添加代码块"),Object(l.a)(V,"upload-image","添加文件"),Object(l.a)(V,"add-table","添加表格"),V);t.a=function(e){var t=e.defaultValue,n=void 0===t?"":t,c=e.onChange,p=e.width,y=void 0===p?"100%":p,b=e.height,x=void 0===b?400:b,C=e.miniToolbar,w=void 0!==C&&C,S=e.isFocus,E=void 0!==S&&S,N=e.watch,T=e.insertTemp,L=e.mode,A=void 0===L?"markdown":L,D=e.id,P=void 0===D?"markdown-editor-id":D,I=e.showResizeBar,R=void 0!==I&&I,B=e.noStorage,F=void 0!==B&&B,W=e.showNullButton,V=void 0!==W&&W,G=e.hidetoolBar,K=void 0!==G&&G,U=e.fullScreen,q=void 0!==U&&U,Z=e.onBlur,te=e.onCMBeforeChange,oe=e.onFullScreen,ae=e.className,se=void 0===ae?"":ae,le=e.disablePaste,ce=void 0!==le&&le,ue=e.placeholder,he=void 0===ue?"":ue,de=e.values,pe=void 0===de?"":de,fe=Object(h.useState)(null),me=Object(s.a)(fe,2),ge=me[0],ve=me[1],ye=Object(h.useState)(n),be=Object(s.a)(ye,2),xe=be[0],Ce=be[1],we=Object(h.useState)(N),ke=Object(s.a)(we,2),Se=ke[0],Ee=ke[1],_e=Object(h.useState)(q),Oe=Object(s.a)(_e,2),Ne=Oe[0],Te=Oe[1],Le=Object(h.useState)(""),Ae=Object(s.a)(Le,2),Me=Ae[0],je=Ae[1],De=Object(h.useState)(0),Pe=Object(s.a)(De,2),Ie=Pe[0],Re=Pe[1],Be=Object(h.useState)(x),ze=Object(s.a)(Be,2),Fe=ze[0],He=ze[1],We=Object(h.useState)(!1),Ve=Object(s.a)(We,2),Ge=(Ve[0],Ve[1]),Ke=Object(h.useRef)(Object(X.a)()),Ue=Object(h.useRef)(!1),qe=Object(h.useRef)(),$e=Object(h.useRef)(),Ye=Object(h.useRef)(),Xe=Object(h.useRef)(),Ze=Object(h.useRef)(),Je=function(){var e=Object(a.a)(u.a.mark((function e(){var t,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Y.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ke.current}});case 2:null!=(n=e.sent)&&null!==(t=n.attachments)&&void 0!==t&&t.length&&(console.log("cm:",ge,$e),n.attachments.map((function(e){e.content_type.indexOf("image")>-1?ge.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):e.content_type.indexOf("video")>-1?ge.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):e.content_type.indexOf("pdf")>-1?ge.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):ge.replaceSelection("[".concat(e.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")"))})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(h.useEffect)((function(){Ce(pe),null==ge||ge.setValue(pe)}),[pe]),Object(h.useEffect)((function(){null==oe||oe(Ne)}),[Ne]),Object(h.useEffect)((function(){if($e.current){var e=f.a.fromTextArea($e.current,{mode:A,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,n){if(!ce){var i=n.clipboardData;if(i){var r=i.types.toString(),a=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==A)return;try{var s,l=a[1];"file"===(null===(s=a[0])||void 0===s?void 0:s.kind)&&(l=a[0]);var c=l.getAsFile(),u=c.name.split(".").pop();H(c,(function(t){var n,i,r;t.id?(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(c.type,'&disposition=inline" target="_blank">').concat(c.name,"</a>")):ne.includes(u)?e.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(c.name,"</a>")):e.replaceSelection("[".concat(c.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))}catch(n){o.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()}return E&&e.focus(),e.on("paste",t),e.on("dragleave",(function(e,t){Ye.current.classList.remove("mouse-hover-md")})),e.on("dragover",(function(e,t){Ye.current.classList.add("mouse-hover-md")})),e.on("drop",(function(t,n){var i;if(Ye.current.classList.add("mouse-hover-md"),(i=n.dataTransfer.files).length>0){n.preventDefault(),n.stopPropagation();for(var r=function(t){var n=i[t],r=n.name.split(".").pop();H(n,(function(t){var i,o,a;t.id?(null==n||null===(i=n.type)||void 0===i?void 0:i.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==n||null===(o=n.type)||void 0===o?void 0:o.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==n||null===(a=n.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(n.type,'&disposition=inline" target="_blank">').concat(n.name,"</a>")):ne.includes(r)?e.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(n.name,"</a>")):e.replaceSelection("[".concat(n.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))},o=0;o<i.length;o++)r(o)}})),ve(e),function(){e.off("paste",t)}}}),[]);var Qe=Object(h.useCallback)((function(){Ye.current}),[Fe,Ye,Ne]);Object(h.useEffect)((function(){if(ge){var e=function(){var e=new m.default((function(e){var t,n=Object(r.a)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(Qe(),ge.setSize("100%","100%"),ge.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe($e.current.parentElement),e}();return function(){e.unobserve($e.current.parentElement)}}}),[ge,Qe]),Object(h.useEffect)((function(){if(ge){for(var e=[],t=function(){var t=i[n],r=(o=Object(s.a)(t,2))[0],a=o[1],c=Object(l.a)({},r,(function(){et(a)}));e.push(c),ge.addKeyMap(c)},n=0,i=Object.entries(ie);n<i.length;n++){var o;t()}return qe.current=setInterval((function(){Ue.current&&Je()}),4e3),function(){clearInterval(qe.current);var t,n=Object(r.a)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;ge.removeKeyMap(i)}}catch(e){n.e(e)}finally{n.f()}}}}),[ge]),Object(h.useEffect)((function(){q!==Ne&&Te(q)}),[q]),Object(Q.a)((function(){if(!F&&Ie>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Ie+1e4&&(!t||t!==xe)&&(window.sessionStorage.setItem(P,xe),Ge(!0))}}),1e4),Object(h.useEffect)((function(){Ee(N)}),[ge,N]),Object(h.useEffect)((function(){ge&&E&&ge.focus()}),[ge,E]),Object(h.useEffect)((function(){if(Se&&ge){var e=ge.getScrollerElement();function t(e){var t=e.target;if(Ze.current){var n=t.scrollTop/t.scrollHeight;Ze.current.scrollTop=Ze.current.scrollHeight*n}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[ge,Se]),Object(h.useEffect)((function(){if(ge&&te){function e(e,t){te(e,t)}return ge.on("beforeChange",e),function(){ge.off("beforeChange",e)}}}),[ge,te]),Object(h.useEffect)((function(){if(ge&&Z){function e(){Z(ge.getValue())}return ge.on("blur",e),function(){ge.off("blur",e)}}}),[ge,Z]),Object(h.useEffect)((function(){if(ge){function e(e){var t=e.getValue();Ce(t),Re((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(t)}return ge.on("change",e),function(){ge.off("change",e)}}}),[ge,c]),Object(h.useEffect)((function(){ge&&(null==n?(ge.setValue(""),Ce("")):n!==ge.getValue()&&(ge.setValue(n),Ce(n),ge.setCursor(ge.lineCount(),0)))}),[ge,n]);var et=Object(h.useCallback)((function(e){var t=ge.getCursor(),n=ge.getSelection(),i=n.split("\n");switch(e){case"bold":return ge.replaceSelection("**"+n+"**"),""===n&&ge.setCursor(t.line,t.ch+2),ge.focus();case"italic":return ge.replaceSelection("*"+n+"*"),""===n&&ge.setCursor(t.line,t.ch+1),ge.focus();case"code":return ge.replaceSelection("`"+n+"`"),""===n&&ge.setCursor(t.line,t.ch+1),ge.focus();case"inline-latex":return ge.replaceSelection("`$$"+n+"$$`"),""===n&&ge.setCursor(t.line,t.ch+3),ge.focus();case"latex":return ge.replaceSelection("```latex\n"+n+"\n```"),ge.setCursor(t.line+1,n.length+1),ge.focus();case"line-break":return ge.replaceSelection("<br/>\n"),ge.focus();case"list-ul":return""===n?ge.replaceSelection("- "+n):ge.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),ge.focus();case"list-ol":return""===n?ge.replaceSelection("1. "+n):ge.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),ge.focus();case"add-null-ch":return""===n&&ge.setCursor(t.line,t.ch+1),ge.replaceSelection("▁"),ge.focus();case"inster-template-1":return""===n&&ge.setCursor(t.line,t.ch),ge.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),ge.focus();case"eraser":return ge.setValue(""),ge.focus();case"trigger-watch":return Ee(!Se),ge.focus();case"trigger-full-screen":return Te(!Ne),ge.focus();case"link":return void je("link");case"code-block":return void je("code-block");case"upload-image":return void je("upload-image");case"add-table":return void je("add-table");default:throw new Error}}),[ge,Se,Ne]),tt=Object(h.useCallback)((function(e){switch(je(""),Me){case"link":var t=e.title,n=e.link;return ge.replaceSelection("[".concat(t,"](").concat(n,")")),ge.focus();case"code-block":var i=e.language,r=e.content;return ge.replaceSelection(["```"+i,r,"```"].join("\n")),ge.focus();case"upload-image":var o=e.src,a=e.alt,s=e.name;return o.indexOf("type=image")>-1?ge.replaceSelection("![ ".concat(a||""," ]( ").concat(o,' "').concat(a||"",'" )')):o.indexOf("type=application/pdf")>-1?ge.replaceSelection('<a href="'.concat(o,'&disposition=inline" target="_blank">').concat(s,"</a>")):ge.replaceSelection('<a href="'.concat(o,'" target="_blank">').concat(s,"</a>")),ge.focus();case"add-table":for(var l=e.row,c=e.col,u=e.align,h="\n",d=0;d<l;d++){for(var p=[],f=[],m=0;m<c;m++)1===d&&f.push(J[u]),p.push(" ");1===d&&(h+="| ".concat(f.join(" | ")," |\n")),h+="| ".concat(p.join(1===c?"":" | ")," |\n")}return ge.replaceSelection(h+"\n"),ge.focus();default:throw new Error}}),[ge,Me]),nt=Object(h.useMemo)((function(){switch(Me){case"link":return d.a.createElement(M,{callback:tt,onCancel:it});case"code-block":return d.a.createElement(j.b,{callback:tt,onCancel:it});case"upload-image":return d.a.createElement(z,{callback:tt,onCancel:it});case"add-table":return d.a.createElement($,{callback:tt,onCancel:it});default:return null}}),[Me]);function it(){je("")}Object(h.useEffect)((function(){if(Xe.current){var e=Xe.current,t=!1,n=0;function i(e){t=!0,n=e.pageY}function r(){t=!1}function o(e){if(t){var i=e.pageY-n;i<0&&(i=0),i>300&&(i=300),He(x+i+"px")}}return e.addEventListener("mousedown",i),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),function(){e.removeEventListener("mousedown",i),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)}}}),[ge,Xe]),Object(h.useEffect)((function(){He(x)}),[x]);var rt={width:ee(y),height:ee(Fe)};Object(h.useMemo)((function(){if(Ie){var e=new Date(Ie),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Ie]);return d.a.createElement(h.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ye},d.a.createElement("div",{className:"markdown-editor-container ".concat(se," ").concat(Se?"on-preview":""," ").concat(w?"mini":""," ").concat(Ne?"full-screen":""),style:rt},d.a.createElement(_,{insertTemp:T,watch:Se,fullScreen:Ne,showNullButton:V,onActionCallback:et,hidetoolBar:K,uuid:Ke.current,setOpenPhones:function(){Ue.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:$e,placeholder:he})),Se?d.a.createElement("div",{ref:Ze,className:"preview-container"},"stex"===A&&d.a.createElement(v,{value:xe}),"stex"!==A&&d.a.createElement(g.a,{edit:!0,value:xe,replaces:function(e,t){var n=ge.getValue();n=n.replace(e,t),Ce(n),null==ge||ge.setValue(n)}})):null))),R?d.a.createElement("a",{ref:Xe,className:"editor-resize"}):null,d.a.createElement(O.a,null,re[Me]?d.a.createElement(i.a,{centered:!0,title:re[Me],visible:!0,onCancel:it,footer:null},nt):null))}},PGNT:
/*!********************************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/editor.less?modules ***!
\********************************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE:
/*!********************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.less?modules ***!
\********************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},QSKd:
/*!********************************************!*\
!*** ./src/assets/images/paper/wenhao.svg ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/wenhao.50b63ac4.svg"},"RZ/O":
/*!****************************************!*\
!*** ./src/assets/images/paper/bi.svg ***!
\****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/bi.9c9b0364.svg"},SJMd:
/*!****************************************************!*\
!*** ./node_modules/code-prettify/src/prettify.js ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var e=window,t=["break,continue,do,else,for,if,return,while"],n=[[t,"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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],i=[n,"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"],r=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[n,"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"],a=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="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",l=[t,"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"],c=[t,"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"],u=[t,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(e,t,n,i,r){if(n){var o={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:t,decorations:null};i(o),r.push.apply(r,o.decorations)}}var p=/\S/;function f(e){for(var t=void 0,n=e.firstChild;n;n=n.nextSibling){var i=n.nodeType;t=1===i?t?e:n:3===i&&p.test(n.nodeValue)?e:t}return t===e?void 0:t}function m(e,t){var n,i={};!function(){for(var r=e.concat(t),o=[],a={},s=0,l=r.length;s<l;++s){var c=r[s],u=c[3];if(u)for(var h=u.length;--h>=0;)i[u.charAt(h)]=c;var d=c[1],p=""+d;a.hasOwnProperty(p)||(o.push(d),a[p]=null)}o.push(/[\0-\uffff]/),n=function(e){for(var t=0,n=!1,i=!1,r=0,o=e.length;r<o;++r){if((d=e[r]).ignoreCase)i=!0;else if(/[a-z]/i.test(d.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0,i=!1;break}}var a={b:8,t:9,n:10,v:11,f:12,r:13};function s(e){var t=e.charCodeAt(0);if(92!==t)return t;var n=e.charAt(1);return(t=a[n])||("0"<=n&&n<="7"?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1))}function l(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return"\\"===t||"-"===t||"]"===t||"^"===t?"\\"+t:t}function c(e){var t=e.substring(1,e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),n=[],i="^"===t[0],r=["["];i&&r.push("^");for(var o=i?1:0,a=t.length;o<a;++o){var c=t[o];if(/\\[bdsw]/i.test(c))r.push(c);else{var u,h=s(c);o+2<a&&"-"===t[o+1]?(u=s(t[o+2]),o+=2):u=h,n.push([h,u]),u<65||h>122||(u<65||h>90||n.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||n.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}n.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var d=[],p=[];for(o=0;o<n.length;++o){(f=n[o])[0]<=p[1]+1?p[1]=Math.max(p[1],f[1]):d.push(p=f)}for(o=0;o<d.length;++o){var f=d[o];r.push(l(f[0])),f[1]>f[0]&&(f[1]+1>f[0]&&r.push("-"),r.push(l(f[1])))}return r.push("]"),r.join("")}function u(e){for(var i=e.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")),r=i.length,o=[],a=0,s=0;a<r;++a){if("("===(h=i[a]))++s;else if("\\"===h.charAt(0)){(u=+h.substring(1))&&(u<=s?o[u]=-1:i[a]=l(u))}}for(a=1;a<o.length;++a)-1===o[a]&&(o[a]=++t);for(a=0,s=0;a<r;++a){if("("===(h=i[a]))o[++s]||(i[a]="(?:");else if("\\"===h.charAt(0)){var u;(u=+h.substring(1))&&u<=s&&(i[a]="\\"+o[u])}}for(a=0;a<r;++a)"^"===i[a]&&"^"!==i[a+1]&&(i[a]="");if(e.ignoreCase&&n)for(a=0;a<r;++a){var h,d=(h=i[a]).charAt(0);h.length>=2&&"["===d?i[a]=c(h):"\\"!==d&&(i[a]=h.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return i.join("")}var h=[];for(r=0,o=e.length;r<o;++r){var d;if((d=e[r]).global||d.multiline)throw new Error(""+d);h.push("(?:"+u(d)+")")}return new RegExp(h.join("|"),i?"gi":"g")}(o)}();var r=t.length,o=function(e){for(var a=e.sourceCode,s=e.basePos,l=e.sourceNode,c=[s,"pln"],u=0,h=a.match(n)||[],p={},f=0,m=h.length;f<m;++f){var g,v=h[f],y=p[v],b=void 0;if("string"==typeof y)g=!1;else{var x=i[v.charAt(0)];if(x)b=v.match(x[1]),y=x[0];else{for(var w=0;w<r;++w)if(x=t[w],b=v.match(x[1])){y=x[0];break}b||(y="pln")}!(g=y.length>=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(g=!1,y="src"),g||(p[v]=y)}var k=u;if(u+=v.length,g){var S=b[1],E=v.indexOf(S),_=E+S.length;b[2]&&(E=(_=v.length-b[2].length)-S.length);var O=y.substring(5);d(l,s+k,v.substring(0,E),o,c),d(l,s+k+E,S,C(O,S),c),d(l,s+k+_,v.substring(_),o,c)}else c.push(s+k,y)}e.decorations=c};return o}function g(e){var t=[],n=[];e.tripleQuotedStrings?t.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&n.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var i=e.hashComments;i&&(e.cStyleComments?(i>1?t.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var r=e.regexLiterals;if(r){var o=r>1?"":"\n\r",a=o?".":"[\\S\\s]",s="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+a+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+a+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+s+")")])}var l=e.types;l&&n.push(["typ",l]);var c=(""+e.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(u+="(?!s*/)"),n.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),m(t,n)}var v=g({keywords:[i,o,r,a,s,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(e,t,n){for(var i=/(?:^|\s)nocode(?:\s|$)/,r=/\r\n?|\n/,o=e.ownerDocument,a=o.createElement("li");e.firstChild;)a.appendChild(e.firstChild);var s=[a];function l(e){var t=e.nodeType;if(1!=t||i.test(e.className)){if((3==t||4==t)&&n){var a=e.nodeValue,s=a.match(r);if(s){var u=a.substring(0,s.index);e.nodeValue=u;var h=a.substring(s.index+s[0].length);if(h)e.parentNode.insertBefore(o.createTextNode(h),e.nextSibling);c(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)c(e),e.parentNode&&e.parentNode.removeChild(e);else for(var d=e.firstChild;d;d=d.nextSibling)l(d)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,n=function e(t,n){var i=n?t.cloneNode(!1):t,r=t.parentNode;if(r){var o=e(r,1),a=t.nextSibling;o.appendChild(i);for(var s=a;s;s=a)a=s.nextSibling,o.appendChild(s)}return i}(e.nextSibling,0);(t=n.parentNode)&&1===t.nodeType;)n=t;s.push(n)}for(var u=0;u<s.length;++u)l(s[u]);t===(0|t)&&s[0].setAttribute("value",t);var h=o.createElement("ol");h.className="linenums";for(var d=Math.max(0,t-1|0)||0,p=(u=0,s.length);u<p;++u)(a=s[u]).className="L"+(u+d)%10,a.firstChild||a.appendChild(o.createTextNode(" ")),h.appendChild(a);e.appendChild(h)}var b={};function x(t,n){for(var i=n.length;--i>=0;){var r=n[i];b.hasOwnProperty(r)?e.console&&console.warn("cannot override language handler %s",r):b[r]=t}}function C(e,t){return e&&b.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),b[e]}function w(t){var n,i,r,o,a,s,l,c=t.langExtension;try{var u=(n=t.sourceNode,i=t.pre,r=/(?:^|\s)nocode(?:\s|$)/,o=[],a=0,s=[],l=0,function e(t){var n=t.nodeType;if(1==n){if(r.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)e(c);var u=t.nodeName.toLowerCase();"br"!==u&&"li"!==u||(o[l]="\n",s[l<<1]=a++,s[l++<<1|1]=t)}else if(3==n||4==n){var h=t.nodeValue;h.length&&(h=i?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),o[l]=h,s[l<<1]=a,a+=h.length,s[l++<<1|1]=t)}}(n),{sourceCode:o.join("").replace(/\n$/,""),spans:s}),h=u.sourceCode;t.sourceCode=h,t.spans=u.spans,t.basePos=0,C(c,h)(t),function(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var n,i,r=/\n/g,o=e.sourceCode,a=o.length,s=0,l=e.spans,c=l.length,u=0,h=e.decorations,d=h.length,p=0;for(h[d]=a,i=n=0;i<d;)h[i]!==h[i+2]?(h[n++]=h[i++],h[n++]=h[i++]):i+=2;for(d=n,i=n=0;i<d;){for(var f=h[i],m=h[i+1],g=i+2;g+2<=d&&h[g+1]===m;)g+=2;h[n++]=f,h[n++]=m,i=g}d=h.length=n;var v=e.sourceNode,y="";v&&(y=v.style.display,v.style.display="none");try{for(;u<c;){l[u];var b,x=l[u+2]||a,C=h[p+2]||a,w=(g=Math.min(x,C),l[u+1]);if(1!==w.nodeType&&(b=o.substring(s,g))){t&&(b=b.replace(r,"\r")),w.nodeValue=b;var k=w.ownerDocument,S=k.createElement("span");S.className=h[p+1];var E=w.parentNode;E.replaceChild(S,w),S.appendChild(w),s<x&&(l[u+1]=w=k.createTextNode(o.substring(g,x)),E.insertBefore(w,S.nextSibling))}(s=g)>=x&&(u+=2),s>=C&&(p+=2)}}finally{v&&(v.style.display=y)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function k(e,t,n){var i=n||!1,r=t||null,o=document.createElement("div");return o.innerHTML="<pre>"+e+"</pre>",o=o.firstChild,i&&y(o,i,!0),w({langExtension:r,numberLines:i,sourceNode:o,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),o.innerHTML}function S(t,n){var i=n||document.body,r=i.ownerDocument||document;function o(e){return i.getElementsByTagName(e)}for(var a=[o("pre"),o("code"),o("xmp")],s=[],l=0;l<a.length;++l)for(var c=0,u=a[l].length;c<u;++c)s.push(a[l][c]);a=null;var h=Date;h.now||(h={now:function(){return+new Date}});var d=0,p=/\blang(?:uage)?-([\w.]+)(?!\S)/,m=/\bprettyprint\b/,g=/\bprettyprinted\b/,v=/pre|xmp/i,b=/^code$/i,x=/^(?:pre|code|xmp)$/i,C={};!function n(){for(var i=e.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;d<s.length&&h.now()<i;d++){for(var o=s[d],a=C,l=o;l=l.previousSibling;){var c=l.nodeType,u=(7===c||8===c)&&l.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(l.nodeValue))break;if(u){a={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(e,t,n){a[t]=n}));break}}var k=o.className;if((a!==C||m.test(k))&&!g.test(k)){for(var S=!1,E=o.parentNode;E;E=E.parentNode){var _=E.tagName;if(x.test(_)&&E.className&&m.test(E.className)){S=!0;break}}if(!S){o.className+=" prettyprinted";var O,N,T=a.lang;if(!T)!(T=k.match(p))&&(O=f(o))&&b.test(O.tagName)&&(T=O.className.match(p)),T&&(T=T[1]);if(v.test(o.tagName))N=1;else{var L=o.currentStyle,A=r.defaultView,M=L?L.whiteSpace:A&&A.getComputedStyle?A.getComputedStyle(o,null).getPropertyValue("white-space"):0;N=M&&"pre"===M.substring(0,3)}var j=a.linenums;(j="true"===j||+j)||(j=!!(j=k.match(/\blinenums\b(?::(\d+))?/))&&(!j[1]||!j[1].length||+j[1])),j&&y(o,j,N),w({langExtension:T,sourceNode:o,numberLines:j,pre:N,sourceCode:null,basePos:null,spans:null,decorations:null})}}}d<s.length?e.setTimeout(n,250):"function"==typeof t&&t()}()}x(v,["default-code"]),x(m([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),x(m([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),x(m([],[["atv",/^[\s\S]+/]]),["uq.val"]),x(g({keywords:i,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),x(g({keywords:"null,true,false"}),["json"]),x(g({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),x(g({keywords:r,cStyleComments:!0}),["java"]),x(g({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),x(g({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),x(g({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),x(g({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),x(g({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),x(g({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),x(m([],[["str",/^[\s\S]+/]]),["regex"]);var E=e.PR={createSimpleLexer:m,registerLangHandler:x,sourceDecorator:g,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:k,prettyPrint:S},_=e.define;"function"==typeof _&&_.amd&&_("google-code-prettify",[],(function(){return E}))}()},"VrN/":
/*!***************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.js ***!
\***************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||r||o,s=a&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,l=!0);var w=y&&(c||h&&(null==C||C<12.11)),k=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,_=function(e,t){var n=e.className,i=S(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return O(e).appendChild(t)}function T(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)r.appendChild(t[o]);return r}function L(e,t,n,i){var r=T(e,t,n,i);return r.setAttribute("role","presentation"),r}function A(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function M(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function D(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!S(n[i]).test(t)&&(t+=" "+n[i]);return t}E=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var P=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,n){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===n&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function B(e,t,n,i,r){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,a=r||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function F(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var H={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},V={origin:"*mouse"},G={origin:"+move"};function K(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var a=o-i;if(o==e.length||r+a>=t)return i+Math.min(a,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var U=[""];function q(e){for(;U.length<=e;)U.push($(U)+" ");return U[e]}function $(e){return e[e.length-1]}function Y(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function X(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(X.prototype=e,n=new X),t&&R(t,n),n}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&ne.test(e)}function re(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}var ae=null;function se(e,t,n){var i;ae=null;for(var r=0;r<e.length;++r){var o=e[r];if(o.from<t&&o.to>t)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ae=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ae=r)}return null!=i?i:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,r=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,h=[],d=0;d<u;++d)h.push((c=a.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var p=0,f=l;p<u;++p){var m=h[p];"m"==m?h[p]=f:f=m}for(var g=0,v=l;g<u;++g){var y=h[g];"1"==y&&"r"==v?h[g]="n":n.test(y)&&(v=y,"r"==y&&(h[g]="R"))}for(var b=1,x=h[0];b<u-1;++b){var C=h[b];"+"==C&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=C||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=C}for(var w=0;w<u;++w){var k=h[w];if(","==k)h[w]="N";else if("%"==k){var S=void 0;for(S=w+1;S<u&&"%"==h[S];++S);for(var E=w&&"!"==h[w-1]||S<u&&"1"==h[S]?"1":"N",_=w;_<S;++_)h[_]=E;w=S-1}}for(var O=0,N=l;O<u;++O){var T=h[O];"L"==N&&"1"==T?h[O]="L":n.test(T)&&(N=T)}for(var L=0;L<u;++L)if(t.test(h[L])){var A=void 0;for(A=L+1;A<u&&t.test(h[A]);++A);for(var M="L"==(L?h[L-1]:l),j=M==("L"==(A<u?h[A]:l))?M?"L":"R":l,D=L;D<A;++D)h[D]=j;L=A-1}for(var P,I=[],R=0;R<u;)if(i.test(h[R])){var B=R;for(++R;R<u&&i.test(h[R]);++R);I.push(new o(0,B,R))}else{var z=R,F=I.length,H="rtl"==s?1:0;for(++R;R<u&&"L"!=h[R];++R);for(var W=z;W<R;)if(r.test(h[W])){z<W&&(I.splice(F,0,new o(1,z,W)),F+=H);var V=W;for(++W;W<R&&r.test(h[W]);++W);I.splice(F,0,new o(2,V,W)),F+=H,z=W}else++W;z<R&&I.splice(F,0,new o(1,z,R))}return"ltr"==s&&(1==I[0].level&&(P=a.match(/^\s+/))&&(I[0].from=P[0].length,I.unshift(new o(0,0,P[0].length))),1==$(I).level&&(P=a.match(/\s+$/))&&($(I).to-=P[0].length,I.push(new o(0,u-P[0].length,u)))),"rtl"==s?I.reverse():I}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var ue=[],he=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ue).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function pe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var o=F(r,n);o>-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function fe(e,t){var n=de(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,n||t.type,e,t),Ce(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==F(n,t[i])&&n.push(t[i])}function ve(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function we(e){be(e),xe(e)}function ke(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Ee,_e,Oe=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Ee){var t=T("span","");N(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ee?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=_e)return _e;var t=N(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),i=E(t,1,2).getBoundingClientRect();return O(e),!(!n||n.left==n.right)&&(_e=i.right-n.right<3)}var Le,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Me=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},je="oncopy"in(Le=T("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),De=null,Pe={},Ie={};function Re(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function Be(e){if("string"==typeof e&&Ie.hasOwnProperty(e))e=Ie[e];else if(e&&"string"==typeof e.name&&Ie.hasOwnProperty(e.name)){var t=Ie[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Be(t);var n=Pe[t.name];if(!n)return ze(e,"text/plain");var i=n(e,t);if(Fe.hasOwnProperty(t.name)){var r=Fe[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var Fe={};function He(e,t){R(t,Fe.hasOwnProperty(e)?Fe[e]:Fe[e]={})}function We(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ve(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ge(e,t,n){return!e.startState||e.startState(t,n)}var Ke=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ue(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t<o){n=r;break}t-=o}return n.lines[t]}function qe(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;r==n.line&&(o=o.slice(0,n.ch)),r==t.line&&(o=o.slice(t.ch)),i.push(o),++r})),i}function $e(e,t,n){var i=[];return e.iter(t,n,(function(e){i.push(e.text)})),i}function Ye(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Xe(e){if(null==e.parent)return null;for(var t=e.parent,n=F(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function Ze(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],o=r.height;if(t<o){e=r;continue e}t-=o,n+=r.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function Je(e,t){return t>=e.first&&t<e.first+e.size}function Qe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function it(e){return et(e.line,e.ch)}function rt(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ue(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ue(e,t.line).text.length)}function lt(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=st(e,t[i]);return n}Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ke.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ke.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.match=function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,i){var r=[e.state.modeGen],o={};xt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var a=n.state,s=function(i){n.baseTokens=r;var s=e.state.overlays[i],l=1,c=0;n.state=!0,xt(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(s.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:r,classes:o.bgClass||o.textClass?o:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=pt(e,Xe(t)),r=t.text.length>e.options.maxHighlightLength&&We(e.doc.mode,i.state),o=ht(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new ut(i,!0,t);var o=function(e,t,n){for(var i,r,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Ue(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ct?c.lookAhead:0)<=o.modeFrontier))return s;var u=B(l.text,null,e.options.tabSize);(null==r||i>u)&&(r=s-1,i=u)}return r}(e,t,n),a=o>i.first&&Ue(i,o-1).stateAfter,s=a?ut.fromSaved(i,a,o):new ut(i,Ge(i.mode),o);return i.iter(o,t,(function(n){ft(e,n.text,s);var i=s.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?s.save():null,s.nextLine()})),n&&(i.modeFrontier=s.line),s}function ft(e,t,n,i){var r=e.doc.mode,o=new Ke(t,e.options.tabSize,n);for(o.start=o.pos=i||0,""==t&&mt(r,n.state);!o.eol();)gt(r,o,n.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ve(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=Ve(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,We(e.mode,t.state),n,t.lookAhead):new ut(e,We(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?We(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,i){var r,o,a=e.doc,s=a.mode,l=Ue(a,(t=st(a,t)).line),c=pt(e,t.line,n),u=new Ke(l.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,r=gt(s,u,c.state),i&&o.push(new vt(u,r,We(a.mode,c.state)));return i?o:new vt(u,r,c.state)}function bt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function xt(e,t,n,i,r,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,h=new Ke(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,i.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,a&&ft(e,t,i,h.pos),h.pos=t.length,l=null):l=bt(gt(n,h,i.state,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<h.start;)r(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;){var f=Math.min(h.pos,c+5e3);r(f,u),c=f}}var Ct=!1,wt=!1;function kt(e,t,n){this.marker=e,this.from=t,this.to=n}function St(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function Et(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function _t(e,t){if(t.full)return null;var n=Je(e,t.from.line)&&Ue(e,t.from.line).markedSpans,i=Je(e,t.to.line)&&Ue(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,o=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new kt(a,o.from,s?null:o.to))}}return i}(n,r,a),l=function(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new kt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return i}(i,o,a),c=1==t.text.length,u=$(t.text).length+(c?r:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var p=St(l,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=r}}if(l)for(var f=0;f<l.length;++f){var m=l[f];null!=m.to&&(m.to+=u),null==m.from?St(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Ot(s)),l&&l!=s&&(l=Ot(l));var g=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new kt(s[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function Ot(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Lt(e){return e.inclusiveLeft?-1:0}function At(e){return e.inclusiveRight?1:0}function Mt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),o=tt(i.from,r.from)||Lt(e)-Lt(t);if(o)return-o;var a=tt(i.to,r.to)||At(e)-At(t);return a||t.id-e.id}function jt(e,t){var n,i=wt&&e.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(t?r.from:r.to)&&(!n||Mt(n,r.marker)<0)&&(n=r.marker);return n}function Dt(e){return jt(e,!0)}function Pt(e){return jt(e,!1)}function It(e,t){var n,i=wt&&e.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Mt(n,o.marker)<0)&&(n=o.marker)}return n}function Rt(e,t,n,i,r){var o=Ue(e,t),a=wt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,n)||Lt(l.marker)-Lt(r),h=tt(c.to,i)||At(l.marker)-At(r);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(c.from,i)<=0:tt(c.from,i)<0)))return!0}}}function Bt(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=Ue(e,t),i=Bt(n);return n==i?t:Xe(i)}function Ft(e,t){if(t>e.lastLine())return t;var n,i=Ue(e,t);if(!Ht(e,i))return t;for(;n=Pt(i);)i=n.find(1,!0).line;return Xe(i)+1}function Ht(e,t){var n=wt&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&Wt(e,t,i))return!0}}function Wt(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return Wt(e,i.line,St(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,o=0;o<t.markedSpans.length;++o)if((r=t.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&Wt(e,t,r))return!0}function Vt(e){for(var t=0,n=(e=Bt(e)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Gt(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=Dt(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=Pt(i);){var o=t.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function Kt(e){var t=e.display,n=e.doc;t.maxLine=Ue(n,n.first),t.maxLineLength=Gt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Gt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Ut=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Nt(e)}Ut.prototype.lineNo=function(){return Xe(this)},ye(Ut);var $t={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:$t;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=L("span",null,null,l?"padding-right: .1px":null),i={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,a=void 0;i.pos=0,i.addToken=Qt,Te(e.display.measure)&&(a=ce(o,e.doc.direction))&&(i.addToken=en(i.addToken,a)),i.map=[],nn(o,i,dt(e,o,t!=e.display.externalMeasured&&Xe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=D(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=D(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ne(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=i.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=D(i.pre.className,i.textClass||"")),i}function Jt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,i,r,o,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var o=e.charAt(r);" "!=o||!n||r!=e.length-1&&32!=e.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){c=document.createDocumentFragment();for(var p=0;;){h.lastIndex=p;var f=h.exec(t),m=f?f.index-p:t.length-p;if(m){var g=document.createTextNode(u.slice(p,p+m));a&&s<9?c.appendChild(T("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!f)break;p+=m+1;var v=void 0;if("\t"==f[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(T("span",q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==f[0]||"\n"==f[0]?((v=c.appendChild(T("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),a&&s<9?c.appendChild(T("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||i||r||d||o||l){var x=n||"";i&&(x+=i),r&&(x+=r);var C=T("span",[c],x,o);if(l)for(var w in l)l.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&C.setAttribute(w,l[w]);return e.content.appendChild(C)}e.content.appendChild(c)}}function en(e,t){return function(n,i,r,o,a,s,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+i.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>c&&h.from<=c);d++);if(h.to>=u)return e(n,i,r,o,a,s,l);e(n,i.slice(0,h.to-c),r,o,null,s,l),o=null,i=i.slice(h.to-c),c=h.to}}}function tn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var a,s,l,c,u,h,d,p=r.length,f=0,m=1,g="",v=0;;){if(v==f){l=c=u=s="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;x<i.length;++x){var C=i[x],w=C.marker;if("bookmark"==w.type&&C.from==f&&w.widgetNode)y.push(w);else if(C.from<=f&&(null==C.to||C.to>f||w.collapsed&&C.to==f&&C.from==f)){if(null!=C.to&&C.to!=f&&v>C.to&&(v=C.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&C.from==f&&(u+=" "+w.startStyle),w.endStyle&&C.to==v&&(b||(b=[])).push(w.endStyle,C.to),w.title&&((d||(d={})).title=w.title),w.attributes)for(var k in w.attributes)(d||(d={}))[k]=w.attributes[k];w.collapsed&&(!h||Mt(h.marker,w)<0)&&(h=C)}else C.from>f&&v>C.from&&(v=C.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!h||h.from==f)for(var E=0;E<y.length;++E)tn(t,0,y[E]);if(h&&(h.from||0)==f){if(tn(t,(null==h.to?p+1:h.to)-f,h.marker,null==h.from),null==h.to)return;h.to==f&&(h=!1)}}if(f>=p)break;for(var _=Math.min(p,v);;){if(g){var O=f+g.length;if(!h){var N=O>_?g.slice(0,_-f):g;t.addToken(t,N,a?a+l:l,u,f+N.length==v?c:"",s,d)}if(O>=_){g=g.slice(_-f),f=_;break}f=O,u=""}g=r.slice(o,o=n[m++]),a=Xt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,r.slice(o,o=n[T]),Xt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Pt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Xe($(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ht(e,t)}function on(e,t,n){for(var i,r=[],o=t;o<n;o=i){var a=new rn(e.doc,Ue(e.doc,o),o);i=o+a.size,r.push(a)}return r}var an=null,sn=null;function ln(e,t){var n=de(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);an?i=an.delayedCallbacks:sn?i=sn:(i=sn=[],setTimeout(cn,0));for(var o=function(e){i.push((function(){return n[e].apply(null,r)}))},a=0;a<n.length;++a)o(a)}}function cn(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?pn(e,t):"gutter"==o?mn(e,t,n,i):"class"==o?fn(e,t):"widget"==o&&gn(e,t,i)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function pn(e,t){var n=t.text.className,i=dn(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,fn(e,t)):n&&(t.text.className=n)}function fn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=hn(t);t.background=i.insertBefore(T("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?hn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=hn(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=hn(t),s=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(T("div",Qe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var i=S("CodeMirror-linewidget"),r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);yn(e,t,n)}function vn(e,t,n,i){var r=dn(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),fn(e,t),mn(e,t,n,i),yn(e,t,i),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)bn(e,t.rest[i],t,n,!1)}function bn(e,t,n,i,r){if(t.widgets)for(var o=hn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),xn(l,c,n,i),e.display.input.setUneditable(c),r&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),ln(l,"redraw")}}function xn(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function Cn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function wn(e,t){for(var n=ke(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function kn(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function En(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function _n(e){return 50-e.display.nativeBarWidth}function On(e){return e.display.scroller.clientWidth-_n(e)-e.display.barWidth}function Nn(e){return e.display.scroller.clientHeight-_n(e)-e.display.barHeight}function Tn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var r=0;r<e.rest.length;r++)if(Xe(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ln(e,t,n,i){return jn(e,Mn(e,t),n,i)}function An(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ui(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Mn(e,t){var n=Xe(t),i=An(e,n);i&&!i.text?i=null:i&&i.changes&&(un(e,i,n,oi(e)),e.curOp.forceUpdate=!0),i||(i=function(e,t){var n=Xe(t=Bt(t)),i=e.display.externalMeasured=new rn(e.doc,t,n);i.lineN=n;var r=i.built=Zt(e,i);return i.text=r.pre,N(e.display.lineMeasure,r.pre),i}(e,t));var r=Tn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function jn(e,t,n,i,r){t.before&&(n=-1);var o,l=n+(i||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var i=e.options.lineWrapping,r=i&&On(e);if(!t.measure.heights||i&&t.measure.width!=r){var o=t.measure.heights=[];if(i){t.measure.width=r;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,i){var r,o=In(t.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&ie(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+u));)++u;if((r=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Rn(E(l,c,u).getClientRects(),i)).left||r.right||0==c)break;u=c,c-=1,h="right"}a&&s<11&&(r=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=De)return De;var t=N(e,T("span","x")),n=t.getBoundingClientRect(),i=E(t,0,1).getBoundingClientRect();return De=Math.abs(n.left-i.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,r))}else{var p;c>0&&(h=i="right"),r=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+ri(e.display),top:f.top,bottom:f.bottom}:Pn}for(var m=r.top-t.rect.top,g=r.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,C=y[b],w={left:("right"==h?r.right:r.left)-t.rect.left,right:("left"==h?r.left:r.right)-t.rect.left,top:x,bottom:C};return r.left||r.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=m,w.rbottom=g),w}(e,t,n,i)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var Dn,Pn={left:0,right:0,top:0,bottom:0};function In(e,t,n){for(var i,r,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(r=0,o=1,a="left"):t<l?o=1+(r=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(r=(o=l-s)-1,t>=l&&(a="right")),null!=r){if(i=e[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],a="left";if("right"==n&&r==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],a="right";break}return{node:i,start:r,end:o,collapse:a,coverStart:s,coverEnd:l}}function Rn(e,t){var n=Pn;if("left"==t)for(var i=0;i<e.length&&(n=e[i]).left==n.right;i++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function Bn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function zn(e){e.display.externalMeasure=null,O(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Bn(e.display.view[t])}function Fn(e){zn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Hn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Wn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Vn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Cn(e.widgets[n]));return t}function Gn(e,t,n,i,r){if(!r){var o=Vn(t);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var a=Vt(t);if("local"==i?a+=kn(e.display):a-=e.display.viewOffset,"page"==i||"window"==i){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==i?0:Wn());var l=s.left+("window"==i?0:Hn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Kn(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=Hn(),r-=Wn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:r-a.top}}function Un(e,t,n,i,r){return i||(i=Ue(e.doc,t.line)),Gn(e,i,Ln(e,i,t.ch,r),n)}function qn(e,t,n,i,r,o){function a(t,a){var s=jn(e,r,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Gn(e,i,s,n)}i=i||Ue(e.doc,t.line),r||(r=Mn(e,i));var s=ce(i,e.doc.direction),l=t.ch,c=t.sticky;if(l>=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var h=se(s,l,c),d=ae,p=u(l,h,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function $n(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ri(e.display)*t.ch);var i=Ue(e.doc,t.line),r=Vt(i)+kn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Yn(e,t,n,i,r){var o=et(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Xn(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Yn(i.first,0,null,-1,-1);var r=Ze(i,n),o=i.first+i.size-1;if(r>o)return Yn(i.first+i.size-1,Ue(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ue(i,r);;){var s=ei(e,a,r,t,n),l=It(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=Ue(i,r=c.line)}}function Zn(e,t,n,i){i-=Vn(t);var r=t.text.length,o=oe((function(t){return jn(e,n,t-1).bottom<=i}),r,0);return{begin:o,end:r=oe((function(t){return jn(e,n,t).top>i}),o,r)}}function Jn(e,t,n,i){return n||(n=Mn(e,t)),Zn(e,t,n,Gn(e,t,jn(e,n,i),"line").top)}function Qn(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function ei(e,t,n,i,r){r-=Vt(t);var o=Mn(e,t),a=Vn(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?ni:ti)(e,t,n,o,u,i,r);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,p,f=null,m=null,g=oe((function(t){var n=jn(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=t,m=n),!0)}),s,l),v=!1;if(m){var y=i-m.left<m.right-i,b=y==c;g=f+(b?0:1),p=b?"after":"before",d=y?m.left:m.right}else{c||g!=l&&g!=s||g++,p=0==g?"after":g==t.text.length?"before":jn(e,o,g-(c?1:0)).bottom+a<=r==c?"after":"before";var x=qn(e,et(n,g,p),"line",t,o);d=x.left,v=r<x.top?-1:r>=x.bottom?1:0}return Yn(n,g=re(t.text,g,1),p,v,i-d)}function ti(e,t,n,i,r,o,a){var s=oe((function(s){var l=r[s],c=1!=l.level;return Qn(qn(e,et(n,c?l.to:l.from,c?"before":"after"),"line",t,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=qn(e,et(n,c?l.from:l.to,c?"after":"before"),"line",t,i);Qn(u,o,a,!0)&&u.top>a&&(l=r[s-1])}return l}function ni(e,t,n,i,r,o,a){var s=Zn(e,t,i,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<r.length;d++){var p=r[d];if(!(p.from>=c||p.to<=l)){var f=jn(e,i,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=f<o?o-f+1e9:f-o;(!u||h>m)&&(u=p,h=m)}}return u||(u=r[r.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function ii(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(T("br"));Dn.appendChild(document.createTextNode("x"))}N(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),O(e.measure),n||1}function ri(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");N(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function oi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:ai(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ai(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function si(e){var t=ii(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/ri(e.display)-3);return function(r){if(Ht(e.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a<r.widgets.length;a++)r.widgets[a].height&&(o+=r.widgets[a].height);return n?o+(Math.ceil(r.text.length/i)||1)*t:o+t}}function li(e){var t=e.doc,n=si(e);t.iter((function(e){var t=n(e);t!=e.height&&Ye(e,t)}))}function ci(e,t,n,i){var r=e.display;if(!n&&"true"==ke(t).getAttribute("cm-not-content"))return null;var o,a,s=r.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=Xn(e,o,a);if(i&&c.xRel>0&&(l=Ue(e.doc,c.line).text).length==c.ch){var u=B(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((o-En(e.display).left)/ri(e.display))-u))}return c}function ui(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function hi(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)wt&&zt(e.doc,t)<r.viewTo&&pi(e);else if(n<=r.viewFrom)wt&&Ft(e.doc,n+i)>r.viewFrom?pi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)pi(e);else if(t<=r.viewFrom){var o=fi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):pi(e)}else if(n>=r.viewTo){var a=fi(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):pi(e)}else{var s=fi(e,t,t,-1),l=fi(e,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):pi(e)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(r.externalMeasured=null))}function di(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[ui(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==F(a,n)&&a.push(n)}}}function pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fi(e,t,n,i){var r,o=ui(e,t),a=e.display.view;if(!wt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(i>0){if(o==a.length-1)return null;r=s+a[o].size-t,o++}else r=s-t;t+=r,n+=r}for(;zt(e.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];r.hidden||r.node&&!r.changes||++n}return n}function gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vi(e,t){void 0===t&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&yi(e,s.head,r),l||xi(e,s,o)}}return i}function yi(e,t,n){var i=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(T("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function bi(e,t){return e.top-t.top||e.left-t.left}function xi(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),a=En(e.display),s=a.left,l=Math.max(i.sizerWidth,On(e)-i.sizer.offsetLeft)-a.right,c="ltr"==r.direction;function u(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(i-t)+"px"))}function h(t,n,i){var o,a,h=Ue(r,t),d=h.text.length;function p(n,i){return Un(e,et(t,n),"div",h,i)}function f(t,n,i){var r=Jn(e,h,null,t),o="ltr"==n==("after"==i)?"left":"right";return p("after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1),o)[o]}var m=ce(h,r.direction);return function(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}(m,n||0,null==i?d:i,(function(e,t,r,h){var g="ltr"==r,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),b=null==n&&0==e,x=null==i&&t==d,C=0==h,w=!m||h==m.length-1;if(y.top-v.top<=3){var k=(c?x:b)&&w,S=(c?b:x)&&C?s:(g?v:y).left,E=k?l:(g?y:v).right;u(S,v.top,E-S,v.bottom)}else{var _,O,N,T;g?(_=c&&b&&C?s:v.left,O=c?l:f(e,r,"before"),N=c?s:f(t,r,"after"),T=c&&x&&w?l:y.right):(_=c?f(e,r,"before"):s,O=!c&&b&&C?l:v.right,N=!c&&x&&w?s:y.left,T=c?f(t,r,"after"):l),u(_,v.top,O-_,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(N,y.top,T-N,y.bottom)}(!o||bi(v,o)<0)&&(o=v),bi(y,o)<0&&(o=y),(!a||bi(v,a)<0)&&(a=v),bi(y,a)<0&&(a=y)})),{start:o,end:a}}var d=t.from(),p=t.to();if(d.line==p.line)h(d.line,d.ch,p.ch);else{var f=Ue(r,d.line),m=Ue(r,p.line),g=Bt(f)==Bt(m),v=h(d.line,d.ch,g?f.text.length+1:null).end,y=h(p.line,g?0:null,p.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function Ci(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Ei(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function wi(e){e.state.focused||(e.display.input.focus(),Si(e))}function ki(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ei(e))}),100)}function Si(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ci(e))}function Ei(e,t){e.state.delayingBlurEvent||(e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function _i(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],o=e.options.lineWrapping,l=void 0,c=0;if(!r.hidden){if(a&&s<8){var u=r.node.offsetTop+r.node.offsetHeight;l=u-n,n=u}else{var h=r.node.getBoundingClientRect();l=h.bottom-h.top,!o&&r.text.firstChild&&(c=r.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=r.line.height-l;if((d>.005||d<-.005)&&(Ye(r.line,l),Oi(r.line),r.rest))for(var p=0;p<r.rest.length;p++)Oi(r.rest[p]);if(c>e.display.sizerWidth){var f=Math.ceil(c/ri(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function Oi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function Ni(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-kn(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=Ze(t,i),a=Ze(t,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=Ze(t,Vt(Ue(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=Ze(t,Vt(Ue(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Ti(e,t){var n=e.display,i=ii(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Nn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sn(n),l=t.top<i,c=t.bottom>s-i;if(t.top<r)a.scrollTop=l?0:t.top;else if(t.bottom>r+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=r&&(a.scrollTop=u)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,p=On(e)-n.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left+h-(f?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function Li(e,t){null!=t&&(ji(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ai(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mi(e,t,n){null==t&&null==n||ji(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ji(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Di(e,$n(e,t.from),$n(e,t.to),t.margin))}function Di(e,t,n,i){var r=Ti(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Mi(e,r.scrollLeft,r.scrollTop)}function Pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||lr(e,{top:t}),Ii(e,t,!0),n&&lr(e),ir(e,100))}function Ii(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ri(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Bi(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+_n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zi=function(e,t,n){this.cm=n;var i=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),he(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),he(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},zi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zi.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},zi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},zi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fi=function(){};function Hi(e,t){t||(t=Bi(e));var n=e.display.barWidth,i=e.display.barHeight;Wi(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&_i(e),Wi(e,Bi(e)),n=e.display.barWidth,i=e.display.barHeight}function Wi(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Fi.prototype.update=function(){return{bottom:0,right:0}},Fi.prototype.setScrollLeft=function(){},Fi.prototype.setScrollTop=function(){},Fi.prototype.clear=function(){};var Vi={native:zi,null:Fi};function Gi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Ri(e,t):Pi(e,t)}),e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Ki=0;function Ui(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ki},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qi(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)$i(t[n]);for(var i=0;i<t.length;i++)Yi(t[i]);for(var r=0;r<t.length;r++)Xi(t[r]);for(var o=0;o<t.length;o++)Zi(t[o]);for(var a=0;a<t.length;a++)Ji(t[a])}(e)}))}function $i(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=_n(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=_n(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Kt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yi(e){e.updatedDisplay=e.mustUpdate&&ar(e.cm,e.update)}function Xi(e){var t=e.cm,n=t.display;e.updatedDisplay&&_i(t),e.barMeasure=Bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ln(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+_n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-On(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ri(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Hi(t,e.barMeasure),e.updatedDisplay&&ur(t,e.barMeasure),e.selectionChanged&&Ci(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&wi(e.cm)}function Ji(e){var t=e.cm,n=t.display,i=t.doc;e.updatedDisplay&&sr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Ii(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Ri(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var o=T("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-kn(e.display))+"px;\n height: "+(t.bottom-t.top+_n(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=qn(e,t),l=n&&n!=t?qn(e,n):s,c=Ti(e,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),u=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(Pi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Ri(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return r}(t,st(i,e.scrollToPos.from),st(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var a=0;a<r.length;++a)r[a].lines.length||fe(r[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&fe(o[s],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qi(e,t){if(e.curOp)return t();Ui(e);try{return t()}finally{qi(e)}}function er(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ui(e);try{return t.apply(e,arguments)}finally{qi(e)}}}function tr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ui(this);try{return e.apply(this,arguments)}finally{qi(this)}}}function nr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ui(t);try{return e.apply(this,arguments)}finally{qi(t)}}}function ir(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(rr,e))}function rr(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=pt(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?We(t.mode,i.state):null,l=ht(e,o,i,!0);s&&(i.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&ft(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return ir(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Qi(e,(function(){for(var t=0;t<r.length;t++)di(e,r[t],"text")}))}}var or=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Ni(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=On(e),this.force=n,this.dims=oi(e),this.events=[]};function ar(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return pi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(e))return!1;dr(e)&&(pi(e),t.dims=oi(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),wt&&(o=zt(e.doc,o),a=Ft(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=on(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=on(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ui(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(on(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,ui(e,n)))),i.viewTo=n}(e,o,a),n.viewOffset=Vt(Ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mi(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=M();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&A(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=i.view,u=i.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=s(a);var p=r&&null!=t&&t<=u&&d.lineNumber;d.changes&&(F(d.changes,"gutter")>-1&&(p=!1),un(e,d,u,n)),p&&(O(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),a=d.node.nextSibling}else{var f=vn(e,d,u,n);o.insertBefore(f,a)}u+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=M()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ir(e,400)),n.updateLineNumbers=null,!0}function sr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=On(e))i&&(t.visible=Ni(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Nn(e),n.top)}),t.visible=Ni(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ar(e,t))break;_i(e);var r=Bi(e);gi(e),Hi(e,r),ur(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function lr(e,t){var n=new or(e,t);if(ar(e,n)){_i(e),sr(e,n);var i=Bi(e);gi(e),Hi(e,i),ur(e,i),n.finish()}}function cr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ur(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+_n(e)+"px"}function hr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=ai(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function dr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Qe(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,a=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",cr(e.display),!0}return!1}function pr(e,t){for(var n=[],i=!1,r=0;r<e.length;r++){var o=e[r],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;i=!0}n.push({className:o,style:a})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function fr(e){var t=e.gutters,n=e.gutterSpecs;O(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,a=r.style,s=t.appendChild(T("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",cr(e)}function mr(e){fr(e.display),hi(e),hr(e)}function gr(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=L("div",null,"CodeMirror-code"),o.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=T("div",null,"CodeMirror-cursors"),o.measure=T("div",null,"CodeMirror-measure"),o.lineMeasure=T("div",null,"CodeMirror-measure"),o.lineSpace=L("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=L("div",[o.lineSpace],"CodeMirror-lines");o.mover=T("div",[c],null,"position: relative"),o.sizer=T("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=T("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=T("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=T("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pr(r.gutters,r.lineNumbers),fr(o),i.init(o)}or.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},or.prototype.finish=function(){for(var e=0;e<this.events.length;e++)fe.apply(null,this.events[e])};var vr=0,yr=null;function br(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xr(e){var t=br(e);return t.x*=yr,t.y*=yr,t}function Cr(e,t){var i=br(t),r=i.x,o=i.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||o&&u){if(o&&y&&l)e:for(var d=t.target,p=a.view;d!=s;d=d.parentNode)for(var f=0;f<p.length;f++)if(p[f].node==d){e.display.currentWheelTarget=d;break e}if(r&&!n&&!h&&null!=yr)return o&&u&&Pi(e,Math.max(0,s.scrollTop+o*yr)),Ri(e,Math.max(0,s.scrollLeft+r*yr)),(!o||o&&u)&&be(t),void(a.wheelStartX=null);if(o&&null!=yr){var m=o*yr,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),lr(e,{top:g,bottom:v})}vr<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=r,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(yr=(yr*vr+n)/(vr+1),++vr)}}),200)):(a.wheelDX+=r,a.wheelDY+=o))}}a?yr=-.53:n?yr=15:u?yr=-.7:d&&(yr=-1/3);var wr=function(e,t){this.ranges=e,this.primIndex=t};wr.prototype.primary=function(){return this.ranges[this.primIndex]},wr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=e.ranges[t];if(!nt(n.anchor,i.anchor)||!nt(n.head,i.head))return!1}return!0},wr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new kr(it(this.ranges[t].anchor),it(this.ranges[t].head));return new wr(e,this.primIndex)},wr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wr.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(tt(t,i.from())>=0&&tt(e,i.to())<=0)return n}return-1};var kr=function(e,t){this.anchor=e,this.head=t};function Sr(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=F(t,r);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=tt(s.to(),a.from());if(i&&!a.empty()?l>0:l>=0){var c=ot(s.from(),a.from()),u=rt(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new kr(h?u:c,h?c:u))}}return new wr(t,n)}function Er(e,t){return new wr([new kr(e,t||e)],0)}function _r(e){return e.text?et(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Or(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return _r(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=_r(t).ch-t.to.ch),et(n,i)}function Nr(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new kr(Or(r.anchor,t),Or(r.head,t)))}return Sr(e.cm,n,e.sel.primIndex)}function Tr(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Lr(e){e.doc.mode=ze(e.options,e.doc.modeOption),Ar(e)}function Ar(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ir(e,100),e.state.modeGen++,e.curOp&&hi(e)}function Mr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function jr(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){!function(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),Tt(e,n);var r=i?i(e):1;r!=e.height&&Ye(e,r)}(e,n,r,i),ln(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Ut(c[o],r(o),i));return n}var s=t.from,l=t.to,c=t.text,u=Ue(e,s.line),h=Ue(e,l.line),d=$(c),p=r(c.length-1),f=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Mr(e,t)){var m=a(0,c.length-1);o(h,h.text,p),f&&e.remove(s.line,f),m.length&&e.insert(s.line,m)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),p);else{var g=a(1,c.length-1);g.push(new Ut(d+u.text.slice(l.ch),p,i)),o(u,u.text.slice(0,s.ch)+c[0],r(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+h.text.slice(l.ch),r(0)),e.remove(s.line+1,f);else{o(u,u.text.slice(0,s.ch)+c[0],r(0)),o(h,d+h.text.slice(l.ch),p);var v=a(1,c.length-1);f>1&&e.remove(s.line+1,f-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function Dr(e,t,n){!function e(i,r,o){if(i.linked)for(var a=0;a<i.linked.length;++a){var s=i.linked[a];if(s.doc!=r){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,i,l))}}}(e,null,!0)}function Pr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,li(e),Lr(e),Ir(e),e.options.lineWrapping||Kt(e),e.options.mode=t.modeOption,hi(e)}function Ir(e){("rtl"==e.doc.direction?j:_)(e.display.lineDiv,"CodeMirror-rtl")}function Rr(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Br(e,t){var n={from:it(t.from),to:_r(t),text:qe(e,t.from,t.to)};return Vr(e,n,t.from.line,t.to.line+1),Dr(e,(function(e){return Vr(e,n,t.from.line,t.to.line+1)}),!0),n}function zr(e){for(;e.length&&$(e).ranges;)e.pop()}function Fr(e,t,n,i){var r=e.history;r.undone.length=0;var o,a,s=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(zr(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(r,r.lastOp==i)))a=$(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=_r(t):o.changes.push(Br(e,t));else{var l=$(r.done);for(l&&l.ranges||Wr(e.sel,r.done),o={changes:[Br(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,a||fe(e,"historyAdded")}function Hr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,$(r.done),t))?r.done[r.done.length-1]=t:Wr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&zr(r.undone)}function Wr(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vr(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Gr(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Kr(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(Gr(n[r]));return i}(e,t),i=_t(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],a=i[r];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[r]=a)}return n}function Ur(e,t,n){for(var i=[],r=0;r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?wr.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&F(t,Number(u[1]))>-1&&($(s)[h]=c[h],delete c[h])}}}return i}function qr(e,t,n,i){if(i){var r=e.anchor;if(n){var o=tt(t,r)<0;o!=tt(n,r)<0?(r=t,t=n):o!=tt(t,n)<0&&(t=n)}return new kr(r,t)}return new kr(n||t,t)}function $r(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Qr(e,new wr([qr(e.sel.primary(),t,n,r)],0),i)}function Yr(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=qr(e.sel.ranges[o],t[o],null,r);Qr(e,Sr(e.cm,i,e.sel.primIndex),n)}function Xr(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Qr(e,Sr(e.cm,r,e.sel.primIndex),i)}function Zr(e,t,n,i){Qr(e,Er(t,n),i)}function Jr(e,t,n){var i=e.history.done,r=$(i);r&&r.ranges?(i[i.length-1]=t,eo(e,t,n)):Qr(e,t,n)}function Qr(e,t,n){eo(e,t,n),Hr(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new kr(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return fe(e,"beforeSelectionChange",e,i),e.cm&&fe(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Sr(e.cm,i.ranges,i.ranges.length-1):t}(e,t,n));var i=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,io(e,t,i,!0)),n&&!1===n.scroll||!e.cm||Ai(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),ln(e,"cursorActivity",e))}function no(e){to(e,io(e,e.sel,null,!1))}function io(e,t,n,i){for(var r,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=oo(e,a.anchor,s&&s.anchor,n,i),c=oo(e,a.head,s&&s.head,n,i);(r||l!=a.anchor||c!=a.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new kr(l,c))}return r?Sr(e.cm,r,t.primIndex):t}function ro(e,t,n,i,r){var o=Ue(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(r&&(fe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?u:c)&&(h=ao(e,h,-i,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=tt(h,n))&&(i<0?d<0:d>0))return ro(e,h,t,i,r)}var p=l.find(i<0?-1:1);return(i<0?c:u)&&(p=ao(e,p,i,p.line==t.line?o:null)),p?ro(e,p,t,i,r):null}}return t}function oo(e,t,n,i,r){var o=i||1,a=ro(e,t,n,o,r)||!r&&ro(e,t,n,o,!0)||ro(e,t,n,-o,r)||!r&&ro(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(i||Ue(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function so(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),W)}function lo(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(t,n,r,o){t&&(i.from=st(e,t)),n&&(i.to=st(e,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),fe(e,"beforeChange",e,i),e.cm&&fe(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function co(e,t,n){if(e.cm){if(!e.cm.curOp)return er(e.cm,co)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=lo(e,t,!0))){var i=Ct&&!n&&function(e,t,n){var i=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||i&&-1!=F(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:t,to:n}],o=0;o<i.length;++o)for(var a=i[o],s=a.find(0),l=0;l<r.length;++l){var c=r[l];if(!(tt(c.to,s.from)<0||tt(c.from,s.to)>0)){var u=[l,1],h=tt(c.from,s.from),d=tt(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)uo(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Nr(e,t);Fr(e,t,n,e.cm?e.cm.curOp.id:NaN),fo(e,t,n,_t(e,t));var i=[];Dr(e,(function(e,n){n||-1!=F(i,e.history)||(yo(e.history,t),i.push(e.history)),fo(e,t,null,_t(e,t))}))}}function ho(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(r=s[c],n?!r.ranges||r.equals(e.sel):r.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=s.pop()).ranges){if(i)return void s.push(r);break}if(Wr(r,l),n&&!r.equals(e.sel))return void Qr(e,r,{clearRedo:!1});a=r}var u=[];Wr(a,l),l.push({changes:u,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var h=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),d=function(n){var i=r.changes[n];if(i.origin=t,h&&!lo(e,i,!1))return s.length=0,{};u.push(Br(e,i));var o=n?Nr(e,i):$(s);fo(e,i,o,Kr(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:_r(i)});var a=[];Dr(e,(function(e,t){t||-1!=F(a,e.history)||(yo(e.history,i),a.push(e.history)),fo(e,i,null,Kr(e,i))}))},p=r.changes.length-1;p>=0;--p){var f=d(p);if(f)return f.v}}}}function po(e,t){if(0!=t&&(e.first+=t,e.sel=new wr(Y(e.sel.ranges,(function(e){return new kr(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)di(e.cm,i,"gutter")}}function fo(e,t,n,i){if(e.cm&&!e.cm.curOp)return er(e.cm,fo)(e,t,n,i);if(t.to.line<e.first)po(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);po(e,r),t={from:et(e.first,0),to:et(t.to.line+r,t.to.ch),text:[$(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ue(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Nr(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=Xe(Bt(Ue(i,o.line))),i.iter(l,a.line+1,(function(e){if(e==r.maxLine)return s=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ge(e),jr(i,t,n,si(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,(function(e){var t=Gt(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,i=t-1;i>n;i--){var r=Ue(e,i).stateAfter;if(r&&(!(r instanceof ct)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(i,o.line),ir(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?hi(e):o.line!=a.line||1!=t.text.length||Mr(e.doc,t)?hi(e,o.line,a.line+1,c):di(e,o.line,"text");var u=ve(e,"changes"),h=ve(e,"change");if(h||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&ln(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,i):jr(e,t,i),eo(e,n,W),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n,i,r){var o;i||(i=n),tt(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),co(e,{from:n,to:i,text:t,origin:r})}function go(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r],a=!0;if(o.ranges){o.copied||((o=e[r]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)go(o.ranges[s].anchor,t,n,i),go(o.ranges[s].head,t,n,i)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=et(c.from.line+i,c.from.ch),c.to=et(c.to.line+i,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,r+1),r=0)}}}function yo(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;vo(e.done,n,i,r),vo(e.undone,n,i,r)}function bo(e,t,n,i){var r=t,o=t;return"number"==typeof t?o=Ue(e,at(e,t)):r=Xe(t),null==r?null:(i(o,r)&&e.cm&&di(e.cm,r,n),o)}function xo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function Co(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}kr.prototype.from=function(){return ot(this.anchor,this.head)},kr.prototype.to=function(){return rt(this.anchor,this.head)},kr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,qt(r),ln(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}},Co.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),a=i.height;if(i.removeInner(e,o),this.height-=a-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var s=[];this.collapse(s),this.children=[new xo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<=o){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var a=r.lines.length%25+25,s=a;s<r.lines.length;){var l=new xo(r.lines.slice(s,s+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Co(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=F(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new Co(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<o){var a=Math.min(t,o-e);if(r.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var wo=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};function ko(e,t,n){Vt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Li(e,n)}wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=Xe(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var o=Cn(this);Ye(n,Math.max(0,n.height-o)),e&&(Qi(e,(function(){ko(e,n,-o),di(e,i,"widget")})),ln(e,"lineWidgetCleared",e,this,i))}},wo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Cn(this)-t;r&&(Ht(this.doc,i)||Ye(i,i.height+r),n&&Qi(n,(function(){n.curOp.forceUpdate=!0,ko(n,i,r),ln(n,"lineWidgetChanged",n,e,Xe(i))})))},ye(wo);var So=0,Eo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++So};function _o(e,t,n,i,r){if(i&&i.shared)return function(e,t,n,i,r){(i=R(i)).shared=!1;var o=[_o(e,t,n,i,r)],a=o[0],s=i.widgetNode;return Dr(e,(function(e){s&&(i.widgetNode=s.cloneNode(!0)),o.push(_o(e,st(e,t),st(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=$(o)})),new Oo(o,a)}(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return er(e.cm,_o)(e,t,n,i,r);var o=new Eo(e,r),a=tt(t,n);if(i&&R(i,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Rt(e,t.line,t,n,o)||t.line!=n.line&&Rt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");wt=!0}o.addToHistory&&Fr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Bt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ye(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new kt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ht(e,t)&&Ye(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ct=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)hi(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)di(c,u,"text");o.atomic&&no(c.doc),ln(c,"markerAdded",c,o)}return o}Eo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ui(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=St(a.markedSpans,this);e&&!this.collapsed?di(e,Xe(a),"text"):e&&(null!=s.to&&(r=Xe(a)),null!=s.from&&(i=Xe(a))),a.markedSpans=Et(a.markedSpans,s),null==s.from&&this.collapsed&&!Ht(this.doc,a)&&e&&Ye(a,ii(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Bt(this.lines[l]),u=Gt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&hi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,i,r),t&&qi(e),this.parent&&this.parent.clear()}},Eo.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],a=St(o.markedSpans,this);if(null!=a.from&&(n=et(t?o:Xe(o),a.from),-1==e))return n;if(null!=a.to&&(i=et(t?o:Xe(o),a.to),1==e))return i}return n&&{from:n,to:i}},Eo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;t&&i&&Qi(i,(function(){var r=t.line,o=Xe(t.line),a=An(i,o);if(a&&(Bn(a),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Ht(n.doc,r)&&null!=n.height){var s=n.height;n.height=null;var l=Cn(n)-s;l&&Ye(r,r.height+l)}ln(i,"markerChanged",i,e)}))},Eo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=F(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Eo.prototype.detachLine=function(e){if(this.lines.splice(F(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Eo);var Oo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function No(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function To(e){for(var t=function(t){var n=e[t],i=[n.primary.doc];Dr(n.primary.doc,(function(e){return i.push(e)}));for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==F(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<e.length;n++)t(n)}Oo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},Oo.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Oo);var Lo=0,Ao=function(e,t,n,i,r){if(!(this instanceof Ao))return new Ao(e,t,n,i,r);null==n&&(n=0),Co.call(this,[new xo([new Ut("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=Er(o),this.history=new Rr(null),this.id=++Lo,this.modeOption=t,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),jr(this,{from:o,to:o,text:e}),Qr(this,Er(o),W)};Ao.prototype=Z(Co.prototype,{constructor:Ao,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=$e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:nr((function(e){var t=et(this.first,0),n=this.first+this.size-1;co(this,{from:t,to:et(n,Ue(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Mi(this.cm,0,0),Qr(this,Er(t),W)})),replaceRange:function(e,t,n,i){mo(this,e,t=st(this,t),n=n?st(this,n):t,i)},getRange:function(e,t,n){var i=qe(this,st(this,e),st(this,t));return!1===n?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Je(this,e))return Ue(this,e)},getLineNumber:function(e){return Xe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ue(this,e)),Bt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:nr((function(e,t,n){Zr(this,st(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:nr((function(e,t,n){Zr(this,st(this,e),st(this,t||e),n)})),extendSelection:nr((function(e,t,n){$r(this,st(this,e),t&&st(this,t),n)})),extendSelections:nr((function(e,t){Yr(this,lt(this,e),t)})),extendSelectionsBy:nr((function(e,t){Yr(this,lt(this,Y(this.sel.ranges,e)),t)})),setSelections:nr((function(e,t,n){if(e.length){for(var i=[],r=0;r<e.length;r++)i[r]=new kr(st(this,e[r].anchor),st(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Qr(this,Sr(this.cm,i,t),n)}})),addSelection:nr((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new kr(st(this,e),st(this,t||e))),Qr(this,Sr(this.cm,i,i.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=qe(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=qe(this,n[i].from(),n[i].to());!1!==e&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:nr((function(e,t,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var a=r.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var i=[],r=et(e.first,0),o=r,a=0;a<t.length;a++){var s=t[a],l=Tr(s.from,r,o),c=Tr(_r(s),r,o);if(r=s.to,o=c,"around"==n){var u=e.sel.ranges[a],h=tt(u.head,u.anchor)<0;i[a]=new kr(h?c:l,h?l:c)}else i[a]=new kr(l,l)}return new wr(i,e.sel.primIndex)}(this,i,t),l=i.length-1;l>=0;l--)co(this,i[l]);s?Jr(this,s):this.cm&&Ai(this.cm)})),undo:nr((function(){ho(this,"undo")})),redo:nr((function(){ho(this,"redo")})),undoSelection:nr((function(){ho(this,"undo",!0)})),redoSelection:nr((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Rr(this.history.maxGeneration),Dr(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ur(this.history.done),undone:Ur(this.history.undone)}},setHistory:function(e){var t=this.history=new Rr(this.history.maxGeneration);t.done=Ur(e.done.slice(0),null,!0),t.undone=Ur(e.undone.slice(0),null,!0)},setGutterMarker:nr((function(e,t,n){return bo(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&te(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:nr((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Je(this,e))return null;if(t=e,!(e=Ue(this,e)))return null}else if(null==(t=Xe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:nr((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(S(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:nr((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var o=r.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[i]=r.slice(0,o.index)+(o.index&&a!=r.length?" ":"")+r.slice(a)||null}return!0}))})),addLineWidget:nr((function(e,t,n){return function(e,t,n,i){var r=new wo(e,n,i),o=e.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!Ht(e,t)){var i=Vt(t)<e.scrollTop;Ye(t,t.height+Cn(r)),i&&Li(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&ln(o,"lineWidgetAdded",o,r,"number"==typeof t?t:Xe(t)),r}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return _o(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return _o(this,e=st(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ue(this,(e=st(this,e)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&r==e.line&&e.ch>=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)})),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var o=r.text.length+i;if(o>e)return t=e,!0;e-=o,++n})),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ao($e(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var i=new Ao($e(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),o=e.clipPos(r.from),a=e.clipPos(r.to);if(tt(o,a)){var s=_o(e,o,a,i.primary,i.primary.type);i.markers.push(s),s.parent=i}}}(i,No(this)),i},unlinkDoc:function(e){if(e instanceof Oa&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),To(No(this));break}if(e.history==this.history){var n=[e.id];Dr(e,(function(e){return n.push(e.id)}),!0),e.history=new Rr(null),e.history.done=Ur(this.history.done,n),e.history.undone=Ur(this.history.undone,n)}},iterLinkedDocs:function(e){Dr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ae(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:nr((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Qi(t=this.cm,(function(){Ir(t),hi(t)})))}))}),Ao.prototype.eachLine=Ao.prototype.iter;var Mo=0;function jo(e){var t=this;if(Do(t),!me(t,e)&&!wn(t.display,e)){be(e),a&&(Mo=+new Date);var n=ci(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),s=0,l=function(){++s==r&&er(t,(function(){var e={from:n=st(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};co(t.doc,e),Jr(t.doc,Er(st(t.doc,n),st(t.doc,_r(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==F(t.options.allowDropFileTypes,e.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},i.readAsText(e)}},u=0;u<i.length;u++)c(i[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,Er(n,n)),d)for(var p=0;p<d.length;++p)mo(t.doc,"",d[p].anchor,d[p].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Do(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Po(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Io=!1;function Ro(){var e;Io||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Po(Bo)}),100))})),he(window,"blur",(function(){return Po(Ei)})),Io=!0)}function Bo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var zo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Fo=0;Fo<10;Fo++)zo[Fo+48]=zo[Fo+96]=String(Fo);for(var Ho=65;Ho<=90;Ho++)zo[Ho]=String.fromCharCode(Ho);for(var Wo=1;Wo<=12;Wo++)zo[Wo+111]=zo[Wo+63235]="F"+Wo;var Vo={};function Go(e){var t,n,i,r,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ko(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete e[n];continue}for(var r=Y(n.split(" "),Go),o=0;o<r.length;o++){var a=void 0,s=void 0;o==r.length-1?(s=r.join(" "),a=i):(s=r.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Uo(e,t,n,i){var r=(t=Xo(t)).call?t.call(e,i):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Uo(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var a=Uo(e,t.fallthrough[o],n,i);if(a)return a}}}function qo(e){var t="string"==typeof e?e:zo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $o(e,t,n){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Yo(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=zo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),$o(n,e,t))}function Xo(e){return"string"==typeof e?Vo[e]:e}function Zo(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&&tt(o.from,$(i).to)<=0;){var a=i.pop();if(tt(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Qi(e,(function(){for(var t=i.length-1;t>=0;t--)mo(e.doc,"",i[t].from,i[t].to,"+delete");Ai(e)}))}function Jo(e,t,n){var i=re(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Qo(e,t,n){var i=Jo(e,t.ch,n);return null==i?null:new et(t.line,i,n<0?"after":"before")}function ea(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=ce(n,t.doc.direction);if(o){var a,s=r<0?$(o):o[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Mn(t,n);a=r<0?n.text.length-1:0;var u=jn(t,c,a).top;a=oe((function(e){return jn(t,c,e).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Jo(n,a,1))}else a=r<0?s.to:s.from;return new et(i,a,l)}}return new et(i,r<0?n.text.length:0,r<0?"before":"after")}Vo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vo.default=y?Vo.macDefault:Vo.pcDefault;var ta={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=Ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zo(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Zo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ia(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ue(e.doc,t),i=function(e){for(var t;t=Pt(e);)e=t.find(1,!0).line;return e}(n);return i!=n&&(t=Xe(i)),ea(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),G)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),G)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?ia(e,t.head):i}),G)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),a=B(e.getLine(o.line),o.ch,i);t.push(q(i-a%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qi(e,(function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++)if(t[i].empty()){var r=t[i].head,o=Ue(e.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new et(r.line,r.ch-1)),r.ch>0)r=new et(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),et(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var a=Ue(e.doc,r.line-1).text;a&&(r=new et(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(r.line-1,a.length-1),r,"+transpose"))}n.push(new kr(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Ai(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ue(e.doc,t),i=Bt(n);return i!=n&&(t=Xe(i)),ea(!0,e,i,t,1)}function ia(e,t){var n=na(e,t.line),i=Ue(e.doc,n.line),r=ce(i,e.doc.direction);if(!r||0==r[0].level){var o=Math.max(n.ch,i.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,a?0:o,n.sticky)}return n}function ra(e,t,n){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=H}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}var oa=new z;function aa(e,t,n,i){var r=e.state.keySeq;if(r){if(qo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:oa.set(50,(function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,r+" "+t,n,i))return!0}return sa(e,t,n,i)}function sa(e,t,n,i){var r=function(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=Uo(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&Uo(t,e.options.extraKeys,n,e)||Uo(t,e.options.keyMap,n,e)}(e,t,i);return"multi"==r&&(e.state.keySeq=t),"handled"==r&&ln(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(be(n),Ci(e)),!!r}function la(e,t){var n=Yo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return ra(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ra(e,t)})):aa(e,n,t,(function(t){return ra(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=M(),me(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var r=la(t,e);h&&(ca=r?i:null,r||88!=i||je||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(_(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}j(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n)}(t)}}function ha(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||wn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(h&&n==ca)return ca=null,void be(e);if(!h||e.which&&!(e.which<10)||!la(t,e)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return ra(e,t,!0)}))}(t,e,r)||t.display.input.onKeyPress(e))}}}var pa,fa,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ga(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,wn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var i=ci(t,e),r=Se(e),o=i?function(e,t){var n=+new Date;return fa&&fa.compare(n,e,t)?(pa=fa=null,"triple"):pa&&pa.compare(n,e,t)?(fa=new ma(n,e,t),pa=null,"double"):(pa=new ma(n,e,t),fa=null,"single")}(i,r):"single";window.focus(),1==r&&t.state.selectingText&&t.state.selectingText(e),i&&function(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),aa(e,$o(o=(1==t?"Left":2==t?"Middle":"Right")+o,r),r,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,n)!=H}finally{e.state.suppressEdits=!1}return i}))}(t,r,i,o,e)||(1==r?i?function(e,t,n,i){a?setTimeout(I(wi,e),0):e.curOp.focus=M();var r,o=function(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(null==r.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}(e,n,i),c=e.doc.sel;e.options.dragDrop&&Oe&&!e.isReadOnly()&&"single"==n&&(r=c.contains(t))>-1&&(tt((r=c.ranges[r]).from(),t)<0||t.xRel>0)&&(tt(r.to(),t)>0||t.xRel<0)?function(e,t,n,i){var r=e.display,o=!1,c=er(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,pe(r.wrapper.ownerDocument,"mouseup",c),pe(r.wrapper.ownerDocument,"mousemove",u),pe(r.scroller,"dragstart",h),pe(r.scroller,"drop",c),o||(be(t),i.addNew||$r(e.doc,n,null,null,i.extend),l&&!d||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),he(r.wrapper.ownerDocument,"mouseup",c),he(r.wrapper.ownerDocument,"mousemove",u),he(r.scroller,"dragstart",h),he(r.scroller,"drop",c),ki(e),setTimeout((function(){return r.input.focus()}),20)}(e,i,t,o):function(e,t,n,i){var r=e.display,o=e.doc;be(t);var a,s,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new kr(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new kr(n,n)),n=ci(e,t,!0,!0),s=-1;else{var u=va(e,n,i.unit);a=i.extend?qr(a,u.anchor,u.head,i.extend):u}i.addNew?-1==s?(s=c.length,Qr(o,Sr(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==i.unit&&!i.extend?(Qr(o,Sr(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Xr(o,s,a,V):(s=0,Qr(o,new wr([a],0),V),l=o.sel);var h=n;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],c=e.options.tabSize,u=B(Ue(o,n.line).text,n.ch,c),d=B(Ue(o,t.line).text,t.ch,c),p=Math.min(u,d),f=Math.max(u,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ue(o,m).text,y=K(v,p,c);p==f?r.push(new kr(et(m,y),et(m,y))):v.length>y&&r.push(new kr(et(m,y),et(m,K(v,f,c))))}r.length||r.push(new kr(n,n)),Qr(o,Sr(e,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,C=va(e,t,i.unit),w=x.anchor;tt(C.anchor,w)>0?(b=C.head,w=ot(x.from(),C.anchor)):(b=C.anchor,w=rt(x.to(),C.head));var k=l.ranges.slice(0);k[s]=function(e,t){var n=t.anchor,i=t.head,r=Ue(e.doc,n.line);if(0==tt(n,i)&&n.sticky==i.sticky)return t;var o=ce(r);if(!o)return t;var a=se(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(o,i.ch,i.sticky),h=u-a||(i.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],p=l==(1==d.level),f=p?d.from:d.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?t:new kr(new et(n.line,f,m),i)}(e,new kr(st(o,w),b)),Qr(o,Sr(e,k,s),V)}}var p=r.wrapper.getBoundingClientRect(),f=0;function m(t){e.state.selectingText=!1,f=1/0,t&&(be(t),r.input.focus()),pe(r.wrapper.ownerDocument,"mousemove",g),pe(r.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=er(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var a=++f,s=ci(e,n,!0,"rectangle"==i.unit);if(s)if(0!=tt(s,h)){e.curOp.focus=M(),d(s);var l=Ni(r,o);(s.line>=l.to||s.line<l.from)&&setTimeout(er(e,(function(){f==a&&t(n)})),150)}else{var c=n.clientY<p.top?-20:n.clientY>p.bottom?20:0;c&&setTimeout(er(e,(function(){f==a&&(r.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),v=er(e,m);e.state.selectingText=v,he(r.wrapper.ownerDocument,"mousemove",g),he(r.wrapper.ownerDocument,"mouseup",v)}(e,i,t,o)}(t,i,o,e):ke(e)==n.scroller&&be(e):2==r?(i&&$r(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(k?t.display.input.onContextMenu(e):ki(t)))}}function va(e,t,n){if("char"==n)return new kr(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new kr(et(t.line,0),st(e.doc,et(t.line+1,0)));var i=n(e,t);return new kr(i.from,i.to)}function ya(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=r)return fe(e,n,e,Ze(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function xa(e,t){wn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ca(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var wa={toString:function(){return"CodeMirror.Init"}},ka={},Sa={};function Ea(e,t,n){if(!t!=!(n&&n!=wa)){var i=e.display.dragFunctions,r=t?he:pe;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function _a(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Kt(e)),li(e),hi(e),Fn(e),setTimeout((function(){return Hi(e)}),100)}function Oa(e,t){var n=this;if(!(this instanceof Oa))return new Oa(e,t);this.options=t=t?R(t):{},R(ka,t,!1);var i=t.value;"string"==typeof i?i=new Ao(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new Oa.inputStyles[t.inputStyle](this),o=this.display=new gr(e,i,r,t);for(var c in o.wrapper.CodeMirror=this,Ca(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",er(e,ga)),he(t.scroller,"dblclick",a&&s<11?er(e,(function(t){if(!me(e,t)){var n=ci(e,t);if(n&&!ba(e,t)&&!wn(e.display,t)){be(t);var i=e.findWordAt(n);$r(e.doc,i.anchor,i.head)}}})):function(t){return me(e,t)||be(t)}),he(t.scroller,"contextmenu",(function(t){return xa(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xa(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}he(t.scroller,"touchstart",(function(r){if(!me(e,r)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(r)&&!ba(e,r)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!wn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!i.prev||o(i,i.prev)?new kr(s,s):!i.prev.prev||o(i,i.prev.prev)?e.findWordAt(s):new kr(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}r()})),he(t.scroller,"touchcancel",r),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Pi(e,t.scroller.scrollTop),Ri(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return Cr(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return Cr(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||we(t)},over:function(t){me(e,t)||(function(e,t){var n=ci(e,t);if(n){var i=document.createDocumentFragment();yi(e,n,i),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,i)}}(e,t),we(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Mo<100))we(t);else if(!me(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:er(e,jo),leave:function(t){me(e,t)||Do(e)}};var l=t.input.getField();he(l,"keyup",(function(t){return ha.call(e,t)})),he(l,"keydown",er(e,ua)),he(l,"keypress",er(e,da)),he(l,"focus",(function(t){return Si(e,t)})),he(l,"blur",(function(t){return Ei(e,t)}))}(this),Ro(),Ui(this),this.curOp.forceUpdate=!0,Pr(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Si(n)}),20):Ei(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](this,t[c],wa);dr(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Na.length;++u)Na[u](this);qi(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Oa.defaults=ka,Oa.optionHandlers=Sa;var Na=[];function Ta(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=pt(e,t).state:n="prev");var a=e.options.tabSize,s=Ue(o,t),l=B(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(r,s.text.slice(u.length),s.text))==H||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?B(Ue(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,h+="\t";if(d<c&&(h+=q(c-d)),h!=u)return mo(o,h,et(t,0),et(t,u.length),"+input"),s.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var m=o.sel.ranges[f];if(m.head.line==t&&m.head.ch<u.length){var g=et(t,u.length);Xr(o,f,new kr(g,g));break}}}Oa.defineInitHook=function(e){return Na.push(e)};var La=null;function Aa(e){La=e}function Ma(e,t,n,i,r){var o=e.doc;e.display.shift=!1,i||(i=o.sel);var a=+new Date-200,s="paste"==r||e.state.pasteIncoming>a,l=Ae(t),c=null;if(s&&i.ranges.length>1)if(La&&La.text.join("\n")==t){if(i.ranges.length%La.text.length==0){c=[];for(var u=0;u<La.text.length;u++)c.push(o.splitLines(La.text[u]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=Y(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var p=i.ranges[d],f=p.from(),m=p.to();p.empty()&&(n&&n>0?f=et(f.line,f.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min(Ue(o,m.line).text.length,m.ch+$(l).length)):s&&La&&La.lineWise&&La.text.join("\n")==l.join("\n")&&(f=m=et(f.line,0)));var g={from:f,to:m,text:c?c[d%c.length]:l,origin:r||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};co(e.doc,g),ln(e,"inputRead",e,g)}t&&!s&&Da(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ja(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qi(t,(function(){return Ma(t,n,0,null,"paste")})),!0}function Da(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Ta(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ue(e.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Ta(e,r.head.line,"smart"));a&&ln(e,"electricInput",e,r.head.line)}}}function Pa(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,o={anchor:et(r,0),head:et(r+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Ia(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ra(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ia(e),t}function Ba(e,t,n,i,r){var o=t,a=n,s=Ue(e,t.line),l=r&&"rtl"==e.direction?-n:n;function c(o){var a,c;if("codepoint"==i){var u=s.text.charCodeAt(t.ch+(i>0?0:-1));a=isNaN(u)?null:new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?function(e,t,n,i){var r=ce(t,e.doc.direction);if(!r)return Qo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=se(r,n.ch,n.sticky),a=r[o];if("ltr"==e.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from<n.ch))return Qo(t,n,i);var s,l=function(e,n){return Jo(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Mn(e,t),Jn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var h=1==a.level==i<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=h?"before":"after";return new et(n.line,d,p)}}var f=function(e,t,i){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<r.length;e+=t){var a=r[e],s=t>0==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),i.begin<=c&&c<i.end)return o(c,s)}},m=f(o+i,i,u);if(m)return m;var g=i>0?u.end:l(u.begin,-1);return null==g||i>0&&g==t.text.length||!(m=f(i>0?0:r.length-1,i,c(g)))?null:m}(e.cm,s,t,n):Qo(s,t,n);if(null==a){if(o||(c=t.line+l)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ue(e,c))))return!1;t=ea(r,e.cm,s,t.line,l)}else t=a;return!0}if("char"==i||"codepoint"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var u=null,h="group"==i,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var f=s.text.charAt(t.ch)||"\n",m=ee(f,d)?"w":h&&"\n"==f?"n":!h||/\s/.test(f)?null:"p";if(!h||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var g=oo(e,t,o,a,!0);return nt(o,g)&&(g.hitSide=!0),g}function za(e,t,n,i){var r,o,a=e.doc,s=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ii(e.display),3);r=(n>0?t.bottom:t.top)+n*c}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Fa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ha(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var i=Ue(e.doc,t.line),r=Tn(n,i,t.line),o=ce(i,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var s=In(r.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Wa(e,t){return t&&(e.bad=!0),e}function Va(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return Wa(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var o=e.display.view[r];if(o.node==i)return Ga(o,t,n)}}function Ga(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!A(i,t))return Wa(et(Xe(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var o=e.rest?$(e.rest):e.line;return Wa(et(Xe(o),o.text.length),r)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,i){for(var r=-1;r<(c?c.length:0);r++)for(var o=r<0?l.map:c[r],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=Xe(r<0?e.line:e.rest[r]),h=o[a]+i;return(i<0||s!=t)&&(h=o[a+(i?1:0)]),et(u,h)}}}var h=u(a,s,n);if(h)return Wa(h,r);for(var d=s.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return Wa(et(h.line,h.ch-p),r);p+=d.textContent.length}for(var f=s.previousSibling,m=n;f;f=f.previousSibling){if(h=u(f,f.firstChild,-1))return Wa(et(h.line,h.ch+m),r);m+=f.textContent.length}}Fa.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!me(i,e)){if(i.somethingSelected())Aa({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Pa(i);Aa({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,W),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=La.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ra(),l=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),l.value=La.text.join("\n");var c=document.activeElement;P(l),setTimeout((function(){i.display.lineSpace.removeChild(s),c.focus(),c==r&&n.showPrimarySelection()}),50)}}Ia(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),he(r,"paste",(function(e){!o(e)||me(i,e)||ja(e,i)||s<=11&&setTimeout(er(i,(function(){return t.updateFromDOM()})),20)})),he(r,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(r,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(r,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(r,"touchstart",(function(){return n.forceCompositionEnd()})),he(r,"input",(function(){t.composing||t.readFromDOMSoon()})),he(r,"copy",a),he(r,"cut",a)},Fa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Fa.prototype.prepareSelection=function(){var e=vi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Fa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Va(t,e.anchorNode,e.anchorOffset),s=Va(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(ot(a,s),r)||0!=tt(rt(a,s),o)){var l=t.display.view,c=r.line>=t.display.viewFrom&&Ha(t,r)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Ha(t,o);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,f=e.rangeCount&&e.getRangeAt(0);try{p=E(c.node,c.offset,u.offset,u.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),f&&null==e.anchorNode?e.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Fa.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Fa.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},Fa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},Fa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fa.prototype.blur=function(){this.div.blur()},Fa.prototype.getField=function(){return this.div},Fa.prototype.supportsTouch=function(){return!0},Fa.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qi(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Fa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Va(t,e.anchorNode,e.anchorOffset),i=Va(t,e.focusNode,e.focusOffset);n&&i&&Qi(t,(function(){Qr(t.doc,Er(n,i),W),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},Fa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=et(a.line-1,Ue(i.doc,a.line-1).length)),s.ch==Ue(i.doc,s.line).text.length&&s.line<i.lastLine()&&(s=et(s.line+1,0)),a.line<r.viewFrom||s.line>r.viewTo-1)return!1;a.line==r.viewFrom||0==(e=ui(i,a.line))?(t=Xe(r.view[0].line),n=r.view[0].node):(t=Xe(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,c,u=ui(i,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=Xe(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(function(e,t,n,i,r){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(et(i,0),et(r+1,0),(g=+d,function(e){return e.id==g}));return void(p.length&&(o=p[0].find(0))&&u(qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&c();for(var m=0;m<t.childNodes.length;m++)h(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),f&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;h(t),t!=n;)t=t.nextSibling,l=!1;return o}(i,n,c,t,l)),d=qe(i.doc,et(t,0),et(l,Ue(i.doc,l).text.length));h.length>1&&d.length>1;)if($(h)==$(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var p=0,f=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=$(h),b=$(d),x=Math.min(y.length-(1==h.length?p:0),b.length-(1==d.length?p:0));f<x&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)++f;if(1==h.length&&1==d.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)p--,f++;h[h.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");var C=et(t,p),w=et(l,d.length?$(d).length-f:0);return h.length>1||h[0]||tt(C,w)?(mo(i.doc,h,C,w,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Fa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qi(this.cm,(function(){return hi(e.cm)}))},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0;var Ka=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Ka.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!me(i,e)){if(i.somethingSelected())Aa({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Pa(i);Aa({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,W):(n.prevInput="",r.value=t.text.join("\n"),P(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),he(r,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(r,"paste",(function(e){me(i,e)||ja(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),he(r,"cut",o),he(r,"copy",o),he(e.scroller,"paste",(function(t){if(!wn(e,t)&&!me(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){wn(e,t)||be(t)})),he(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),he(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ka.prototype.createField=function(e){this.wrapper=Ra(),this.textarea=this.wrapper.firstChild},Ka.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ka.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=vi(e);if(e.options.moveInputWithCursor){var r=qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},Ka.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ka.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ka.prototype.getField=function(){return this.textarea},Ka.prototype.supportsTouch=function(){return!1},Ka.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ka.prototype.blur=function(){this.textarea.blur()},Ka.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ka.prototype.receivedFocus=function(){this.slowPoll()},Ka.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ka.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Ka.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Me(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l<c&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Qi(t,(function(){Ma(t,r.slice(l),i.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ka.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ka.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ka.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ci(n,e),c=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&er(n,Qr)(n.doc,Er(o),W);var u,d=r.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),i.input.focus(),l&&window.scrollTo(null,u),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&g(),k){we(e);var m=function(){pe(window,"mouseup",m),setTimeout(v,20)};he(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var e=n.somethingSelected(),o=""+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,r.style.cssText=d,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==t.prevInput?er(n,so)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Ka.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ka.prototype.setUneditable=function(){},Ka.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=wa&&r(e,t,n)}:r)}e.defineOption=n,e.Init=wa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Lr(e)}),!0),n("indentUnit",2,Lr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ar(e),Fn(e),hi(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(et(i,o))}i++}));for(var r=n.length-1;r>=0;r--)mo(e.doc,t,n[r],et(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=wa&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ca(e),mr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Xo(t),r=n!=wa&&Xo(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,_a,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=pr(t,e.options.lineNumbers),mr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ai(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Hi(e)}),!0),n("scrollbarStyle","native",(function(e){Gi(e),Hi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pr(e.options.gutters,t),mr(e)}),!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",(function(e){return e}),mr,!0),n("showCursorWhenSelecting",!1,gi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Ei(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ea),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gi,!0),n("singleCursorHeightPerLine",!0,gi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ar,!0),n("addModeClass",!1,Ar,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ar,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Oa),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&er(this,t[e])(this,n,r),fe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:tr((function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)}(this.state.overlays,{mode:i,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,hi(this)})),removeOverlay:tr((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void hi(this)}})),indentLine:tr((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Je(this.doc,e)&&Ta(this,e,t,n)})),indentSelection:tr((function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(Ta(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&Ai(this));else{var o=r.from(),a=r.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Ta(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[i].from().ch>0&&Xr(this.doc,i,new kr(o,c[i].to()),W)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=dt(this,Ue(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}i=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!n.hasOwnProperty(t))return i;var r=n[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&i.push(r[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=r[o[t][a]];s&&i.push(s)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var c=r._global[l];c.pred(o,this)&&-1==F(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(e,t){var n=this.doc;return pt(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return qn(this,null==e?n.head:"object"==typeof e?st(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Un(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Xn(this,(e=Kn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Kn(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var i,r=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,r=!0),i=Ue(this.doc,e)}else i=e;return Gn(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-Vt(i):0)},defaultTextHeight:function(){return ii(this.display)},defaultCharWidth:function(){return ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o,a,s,l=this.display,c=(e=qn(this,st(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)c=e.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==r?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?u=0:"middle"==r&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Ti(o,a)).scrollTop&&Pi(o,s.scrollTop),null!=s.scrollLeft&&Ri(o,s.scrollLeft))},triggerOnKeyDown:tr(ua),triggerOnKeyPress:tr(da),triggerOnKeyUp:ha,triggerOnMouseDown:tr(ga),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:tr((function(e){Da(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=st(this.doc,e),a=0;a<t&&!(o=Ba(this.doc,o,r,n,i)).hitSide;++a);return o},moveH:tr((function(e,t){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Ba(n.doc,i.head,e,t,n.options.rtlMoveVisually):e<0?i.from():i.to()}),G)})),deleteH:tr((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Zo(this,(function(n){var r=Ba(i,n.head,e,t,!1);return e<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1,o=i;t<0&&(r=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var l=qn(this,a,"div");if(null==o?o=l.left:l.left=o,(a=za(this,l,r,n)).hitSide)break}return a},moveV:tr((function(e,t){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=qn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),r.push(s.left);var l=za(n,s,e,t);return"page"==t&&a==i.sel.primary()&&Li(n,Un(n,l,"div").top-s.top),l}),G),r.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=r[a]})),findWordAt:function(e){var t=Ue(this.doc,e.line).text,n=e.ch,i=e.ch;if(t){var r=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!n?++i:--n;for(var o=t.charAt(n),a=ee(o,r)?function(e){return ee(e,r)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&a(t.charAt(n-1));)--n;for(;i<t.length&&a(t.charAt(i));)++i}return new kr(et(e.line,n),et(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),fe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:tr((function(e,t){Mi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-_n(this)-this.display.barHeight,width:e.scrollWidth-_n(this)-this.display.barWidth,clientHeight:Nn(this),clientWidth:On(this)}},scrollIntoView:tr((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){ji(e),e.curOp.scrollToPos=t}(this,e):Di(this,e.from,e.to,e.margin)})),setSize:tr((function(e,t){var n=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&zn(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){di(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,fe(this,"refresh",this)})),operation:function(e){return Qi(this,e)},startOperation:function(){return Ui(this)},endOperation:function(){return qi(this)},refresh:tr((function(){var e=this.display.cachedTextHeight;hi(this),this.curOp.forceUpdate=!0,Fn(this),Mi(this,this.doc.scrollLeft,this.doc.scrollTop),cr(this.display),(null==e||Math.abs(e-ii(this.display))>.5||this.options.lineWrapping)&&li(this),fe(this,"refresh",this)})),swapDoc:tr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pr(this,e),Fn(this),this.display.input.reset(),Mi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}(Oa);var Ua="iter insert remove copy getEditor constructor".split(" ");for(var qa in Ao.prototype)Ao.prototype.hasOwnProperty(qa)&&F(Ua,qa)<0&&(Oa.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ao.prototype[qa]));return ye(Ao),Oa.inputStyles={textarea:Ka,contenteditable:Fa},Oa.defineMode=function(e){Oa.defaults.mode||"null"==e||(Oa.defaults.mode=e),Re.apply(this,arguments)},Oa.defineMIME=function(e,t){Ie[e]=t},Oa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(e,t){Oa.prototype[e]=t},Oa.defineDocExtension=function(e,t){Ao.prototype[e]=t},Oa.fromTextArea=function(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=M();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=s.getValue()}var r;if(e.form&&(he(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var s=Oa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=pe,e.on=he,e.wheelEventPixels=xr,e.Doc=Ao,e.splitLines=Ae,e.countColumn=B,e.findColumn=K,e.isWordChar=Q,e.Pass=H,e.signal=fe,e.Line=Ut,e.changeEnd=_r,e.scrollbarModel=Vi,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=Ie,e.resolveMode=Be,e.getMode=ze,e.modeExtensions=Fe,e.extendMode=He,e.copyState=We,e.startState=Ge,e.innerMode=Ve,e.commands=ta,e.keyMap=Vo,e.keyName=Yo,e.isModifierKey=qo,e.lookupKey=Uo,e.normalizeKeyMap=Ko,e.StringStream=Ke,e.SharedTextMarker=Oo,e.TextMarker=Eo,e.LineWidget=wo,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=we,e.addClass=j,e.contains=A,e.rmClass=_,e.keyNames=zo}(Oa),Oa.version="5.58.2",Oa}()},WaYH:
/*!*********************************************************!*\
!*** ./node_modules/rc-tree/es/TreeNode.js + 1 modules ***!
\*********************************************************/
/*! exports provided: InternalTreeNode, default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/contextTypes.js because of ./node_modules/rc-tree/es/Tree.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/util.js because of ./node_modules/antd/es/table/hooks/useSelection.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/treeUtil.js because of ./node_modules/antd/es/table/hooks/useSelection.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var i=n("rePB"),r=n("Ff2n"),o=n("VTBJ"),a=n("1OyB"),s=n("vuIU"),l=n("JX7q"),c=n("Ji7U"),u=n("LK+K"),h=n("q1tI"),d=n("TSYQ"),p=n.n(d),f=n("sboe"),m=n("OZM5"),g=function(e){var t=e.prefixCls,n=e.level,r=e.isStart,o=e.isEnd;if(!n)return null;for(var a="".concat(t,"-indent-unit"),s=[],l=0;l<n;l+=1){var c;s.push(h.createElement("span",{key:l,className:p()(a,(c={},Object(i.a)(c,"".concat(a,"-start"),r[l+1]),Object(i.a)(c,"".concat(a,"-end"),o[l+1]),Object(i.a)(c,"".concat(a,"-end-first-level"),!l&&o[0]),c))}))}return h.createElement("span",{"aria-hidden":"true",className:"".concat(t,"-indent")},s)},v=n("815F"),y=function(e){Object(c.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={dragNodeHighlight:!1},e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,Object(v.b)(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,Object(v.b)(e.props))},e.onSelect=function(t){if(!e.isDisabled()){var n=e.props.context.onNodeSelect;t.preventDefault(),n(t,Object(v.b)(e.props))}},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,i=n.disableCheckbox,r=n.checked,o=e.props.context.onNodeCheck;if(e.isCheckable()&&!i){t.preventDefault();var a=!r;o(t,Object(v.b)(e.props),a)}}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,Object(v.b)(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,Object(v.b)(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,Object(v.b)(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,Object(l.a)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,Object(l.a)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,Object(l.a)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,Object(l.a)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,Object(l.a)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,Object(l.a)(e))},e.onExpand=function(t){(0,e.props.context.onNodeExpand)(t,Object(v.b)(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?"open":"close"},e.hasChildren=function(){var t=e.props.eventKey;return!!((e.props.context.keyEntities[t]||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,i=t.loaded,r=e.props.context.loadData,o=e.hasChildren();return!1!==n&&(n||!r&&!o||r&&i&&!o)},e.isDisabled=function(){var t=e.props.disabled;return!(!e.props.context.disabled&&!t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!(!n||!1===t)&&n},e.syncLoadData=function(t){var n=t.expanded,i=t.loading,r=t.loaded,o=e.props.context,a=o.loadData,s=o.onNodeLoad;i||a&&n&&!e.isLeaf()&&(e.hasChildren()||r||s(Object(v.b)(e.props)))},e.renderSwitcher=function(){var t=e.props,n=t.expanded,i=t.switcherIcon,r=e.props.context,a=r.prefixCls,s=r.switcherIcon,l=i||s;if(e.isLeaf())return h.createElement("span",{className:p()("".concat(a,"-switcher"),"".concat(a,"-switcher-noop"))},"function"==typeof l?l(Object(o.a)(Object(o.a)({},e.props),{},{isLeaf:!0})):l);var c=p()("".concat(a,"-switcher"),"".concat(a,"-switcher_").concat(n?"open":"close"));return h.createElement("span",{onClick:e.onExpand,className:c},"function"==typeof l?l(Object(o.a)(Object(o.a)({},e.props),{},{isLeaf:!1})):l)},e.renderCheckbox=function(){var t=e.props,n=t.checked,i=t.halfChecked,r=t.disableCheckbox,o=e.props.context.prefixCls,a=e.isDisabled(),s=e.isCheckable();if(!s)return null;var l="boolean"!=typeof s?s:null;return h.createElement("span",{className:p()("".concat(o,"-checkbox"),n&&"".concat(o,"-checkbox-checked"),!n&&i&&"".concat(o,"-checkbox-indeterminate"),(a||r)&&"".concat(o,"-checkbox-disabled")),onClick:e.onCheck},l)},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return h.createElement("span",{className:p()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,i=e.state.dragNodeHighlight,r=e.props,o=r.title,a=r.selected,s=r.icon,l=r.loading,c=r.data,u=e.props.context,d=u.prefixCls,f=u.showIcon,m=u.icon,g=u.draggable,v=u.loadData,y=u.titleRender,b=e.isDisabled(),x="".concat(d,"-node-content-wrapper");if(f){var C=s||m;t=C?h.createElement("span",{className:p()("".concat(d,"-iconEle"),"".concat(d,"-icon__customize"))},"function"==typeof C?C(e.props):C):e.renderIcon()}else v&&l&&(t=e.renderIcon());n="function"==typeof o?o(c):y?y(c):o;var w=h.createElement("span",{className:"".concat(d,"-title")},n);return h.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof o?o:"",className:p()("".concat(x),"".concat(x,"-").concat(e.getNodeState()||"normal"),!b&&(a||i)&&"".concat(d,"-node-selected"),!b&&g&&"draggable"),draggable:!b&&g||void 0,"aria-grabbed":!b&&g||void 0,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick,onDragStart:g?e.onDragStart:void 0},t,w)},e}return Object(s.a)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,o=t.className,a=t.style,s=t.dragOver,l=t.dragOverGapTop,c=t.dragOverGapBottom,u=t.isLeaf,d=t.isStart,f=t.isEnd,y=t.expanded,b=t.selected,x=t.checked,C=t.halfChecked,w=t.loading,k=t.domRef,S=t.active,E=t.onMouseMove,_=Object(r.a)(t,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),O=this.props.context,N=O.prefixCls,T=O.filterTreeNode,L=O.draggable,A=O.keyEntities,M=this.isDisabled(),j=Object(m.f)(_),D=(A[n]||{}).level,P=f[f.length-1];return h.createElement("div",Object.assign({ref:k,className:p()(o,"".concat(N,"-treenode"),(e={},Object(i.a)(e,"".concat(N,"-treenode-disabled"),M),Object(i.a)(e,"".concat(N,"-treenode-switcher-").concat(y?"open":"close"),!u),Object(i.a)(e,"".concat(N,"-treenode-checkbox-checked"),x),Object(i.a)(e,"".concat(N,"-treenode-checkbox-indeterminate"),C),Object(i.a)(e,"".concat(N,"-treenode-selected"),b),Object(i.a)(e,"".concat(N,"-treenode-loading"),w),Object(i.a)(e,"".concat(N,"-treenode-active"),S),Object(i.a)(e,"".concat(N,"-treenode-leaf-last"),P),Object(i.a)(e,"drag-over",!M&&s),Object(i.a)(e,"drag-over-gap-top",!M&&l),Object(i.a)(e,"drag-over-gap-bottom",!M&&c),Object(i.a)(e,"filter-node",T&&T(Object(v.b)(this.props))),e)),style:a,onDragEnter:L?this.onDragEnter:void 0,onDragOver:L?this.onDragOver:void 0,onDragLeave:L?this.onDragLeave:void 0,onDrop:L?this.onDrop:void 0,onDragEnd:L?this.onDragEnd:void 0,onMouseMove:E},j),h.createElement(g,{prefixCls:N,level:D,isStart:d,isEnd:f}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(h.Component),b=function(e){return h.createElement(f.a.Consumer,null,(function(t){return h.createElement(y,Object.assign({},e,{context:t}))}))};b.displayName="TreeNode",b.defaultProps={title:"---"},b.isTreeNode=1;t.a=b},Y1PL:
/*!**********************************************************!*\
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
\**********************************************************/
/*! exports provided: ResizableTextArea, default */
/*! all exports used */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.r(t),n.d(t,"ResizableTextArea",(function(){return j}));var i=n("wx14"),r=n("1OyB"),o=n("vuIU"),a=n("Ji7U"),s=n("LK+K"),l=n("q1tI"),c=n("VTBJ"),u=n("rePB"),h=n("Zm9Q"),d=(n("Kwbf"),n("c+Xe")),p=n("m+aA"),f=n("bdgK"),m=new Map;var g=new f.default((function(e){e.forEach((function(e){var t,n=e.target;null===(t=m.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))}));var v=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(l.Component),y=l.createContext(null);function b(e){var t=e.children,n=e.disabled,i=l.useRef(null),r=l.useRef(null),o=l.useContext(y),a=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),s=l.isValidElement(t)&&Object(d.c)(t),u=s?t.ref:null,h=l.useMemo((function(){return Object(d.a)(u,i)}),[u,i]),f=l.useRef(e);f.current=e;var b=l.useCallback((function(e){var t=f.current,n=t.onResize,i=t.data,r=e.getBoundingClientRect(),s=r.width,l=r.height,u=e.offsetWidth,h=e.offsetHeight,d=Math.floor(s),p=Math.floor(l);if(a.current.width!==d||a.current.height!==p||a.current.offsetWidth!==u||a.current.offsetHeight!==h){var m={width:d,height:p,offsetWidth:u,offsetHeight:h};a.current=m;var g=u===Math.round(s)?s:u,v=h===Math.round(l)?l:h,y=Object(c.a)(Object(c.a)({},m),{},{offsetWidth:g,offsetHeight:v});null==o||o(y,e,i),n&&Promise.resolve().then((function(){n(y,e)}))}}),[]);return l.useEffect((function(){var e,t,o=Object(p.a)(i.current)||Object(p.a)(r.current);return o&&!n&&(e=o,t=b,m.has(e)||(m.set(e,new Set),g.observe(e)),m.get(e).add(t)),function(){return function(e,t){m.has(e)&&(m.get(e).delete(t),m.get(e).size||(g.unobserve(e),m.delete(e)))}(o,b)}}),[i.current,n]),l.createElement(v,{ref:r},s?l.cloneElement(t,{ref:h}):t)}function x(e){var t=e.children;return Object(h.a)(t).map((function(t,n){var r=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return l.createElement(b,Object(i.a)({},e,{key:r}),t)}))}x.Collection=function(e){var t=e.children,n=e.onBatchResize,i=l.useRef(0),r=l.useRef([]),o=l.useContext(y),a=l.useCallback((function(e,t,a){i.current+=1;var s=i.current;r.current.push({size:e,element:t,data:a}),Promise.resolve().then((function(){s===i.current&&(null==n||n(r.current),r.current=[])})),null==o||o(e,t,a)}),[n,o]);return l.createElement(y.Provider,{value:a},t)};var C,w=x,k=n("bT9E"),S=n("TSYQ"),E=n.n(S),_="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",O=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={};function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&N[n])return N[n];var i=window.getComputedStyle(e),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),a=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),s=O.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),l={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:r};return t&&n&&(N[n]=l),l}var L,A=n("Gytx"),M=n.n(A);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(L||(L={}));var j=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var o;return Object(r.a)(this,n),(o=t.call(this,e)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,i=n.autoSize,r=n.onResize;t===L.NONE&&("function"==typeof r&&r(e),i&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;C||((C=document.createElement("textarea")).setAttribute("tab-index","-1"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C)),e.getAttribute("wrap")?C.setAttribute("wrap",e.getAttribute("wrap")):C.removeAttribute("wrap");var r=T(e,t),o=r.paddingSize,a=r.borderSize,s=r.boxSizing,l=r.sizingStyle;C.setAttribute("style","".concat(l,";").concat(_)),C.value=e.value||e.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=C.scrollHeight;if("border-box"===s?d+=a:"content-box"===s&&(d-=o),null!==n||null!==i){C.value=" ";var p=C.scrollHeight-o;null!==n&&(u=p*n,"border-box"===s&&(u=u+o+a),d=Math.max(u,d)),null!==i&&(h=p*i,"border-box"===s&&(h=h+o+a),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:i,resizeStatus:L.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var e=o.props,t=e.prefixCls,n=void 0===t?"rc-textarea":t,r=e.autoSize,a=e.onResize,s=e.className,h=e.disabled,d=o.state,p=d.textareaStyles,f=d.resizeStatus,m=Object(k.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),g=E()(n,s,Object(u.a)({},"".concat(n,"-disabled"),h));"value"in m&&(m.value=m.value||"");var v=Object(c.a)(Object(c.a)(Object(c.a)({},o.props.style),p),f===L.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(w,{onResize:o.handleResize,disabled:!(r||a)},l.createElement("textarea",Object(i.a)({},m,{className:g,style:v,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:L.NONE},o}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&M()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),D=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var i;Object(r.a)(this,n),(i=t.call(this,e)).resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(e){i.resizableTextArea=e},i.handleChange=function(e){var t=i.props.onChange;i.setValue(e.target.value,(function(){i.resizableTextArea.resizeTextarea()})),t&&t(e)},i.handleKeyDown=function(e){var t=i.props,n=t.onPressEnter,r=t.onKeyDown;13===e.keyCode&&n&&n(e),r&&r(e)};var o=void 0===e.value||null===e.value?e.defaultValue:e.value;return i.state={value:o},i}return Object(o.a)(n,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(j,Object(i.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),n}(l.Component);t.default=D},YBdh:
/*!*******************************************!*\
!*** ./src/assets/images/paper/xiren.svg ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/xiren.a6554bc1.svg"},ZW9T:
/*!************************************************************!*\
!*** ./src/components/monaco-editor/index.jsx + 1 modules ***!
\************************************************************/
/*! exports provided: getLanguageByMirrorName, default, DiffEditor */
/*! exports used: DiffEditor, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var i=n("k1fw"),r=(n("miYZ"),n("tsqr")),o=n("rAM+"),a=n("tJVT"),s=n("PpiC"),l=n("q1tI"),c=n.n(l),u=n("bdgK");function h(e,t,n,r,o){var a=t.getWordUntilPosition(n),s={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},l=r.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}));return o.map((function(e){l.push(Object(i.a)(Object(i.a)({},e),{},{range:s}))})),l}n("LvDl");function d(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function p(){}var f={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=f[e[n]];if(i)return i}return t[0]}return f[t]||t}var g=null;t.b=function(e){var t=e.width,f=void 0===t?"100%":t,v=e.height,y=void 0===v?"100%":v,b=e.value,x=e.language,C=void 0===x?"javascript":x,w=e.style,k=void 0===w?{}:w,S=e.options,E=void 0===S?{}:S,_=e.overrideServices,O=void 0===_?{}:_,N=e.theme,T=void 0===N?"vs-dark":N,L=e.onEditBlur,A=e.onSave,M=e.autoHeight,j=void 0!==M&&M,D=e.forbidCopy,P=void 0!==D&&D,I=e.onChange,R=void 0===I?p:I,B=e.editorDidMount,z=void 0===B?p:B,F=e.onFocus,H=void 0===F?p:F,W=e.filename,V=void 0===W?"educoder.txt":W,G=(Object(s.a)(e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Object(l.useRef)()),K=Object(l.useRef)({}),U=Object(l.useRef)(),q=Object(l.useRef)(!1),$=Object(l.useRef)(),Y=Object(l.useState)(!1),X=Object(a.a)(Y,2),Z=X[0],J=X[1];function Q(){r.b.warn(decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"))}function ee(){var e=K.current.instance;if(e){var t=e.getSelection(),n=K.current.pastePos||{},i=new g.Range(n.startLineNumber||t.endLineNumber,n.startColumn||t.endColumn,n.endLineNumber||t.endLineNumber,n.endColumn||t.endColumn);setTimeout((function(){e.executeEdits("",[{range:i,text:""}])}),300)}}function te(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),A())}Object(l.useEffect)((function(){U.current&&clearTimeout(U.current),U.current=setTimeout((function(){!function(){var e=K.current.instance;if(null!=b&&e&&Z){var t=e.getModel();t&&b!==t.getValue()&&(!0,t.setValue(b),e.layout(),!1)}}()}),500)}),[b,Z,K.current]);var ne=function(){if(j&&K.current.instance){var e=K.current.instance.getContentHeight();ue(e<y?y:e)}else ue(y)};function ie(e,t){var n,i,r=window.URL||window.webkitURL||window,o=new Blob([t]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=r.createObjectURL(o),a.download=e,n=a,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}Object(l.useEffect)((function(){ne()}),[ne]),Object(l.useEffect)((function(){G.current&&!Z&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){try{g=e,K.current.instance=g.editor.create(G.current,{value:b,language:m(C),theme:T,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},O);var t=K.current.instance;if(z(t,g),setTimeout((function(){ne(),K.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ie(V||"educoder.txt",t.getValue())}})}),500),K.current.subscription=t.onDidChangeModelContent((function(e){q.current?clearTimeout($.current):(ne(),R(t.getValue(),e)),$.current=setTimeout((function(){q.current=!1}),500)})),window.Monaco||function(e){var t={label:"ifelse",kind:e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},n=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(i,r){return{suggestions:h(e,i,r,n,[t])}}});var i=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(t,n){var r=[{label:"print",kind:e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,t,n,i,r)}}});var r=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(n,i){var o=[t,{label:"main",kind:e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {","\t$0","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,n,i,r,o)}}})}(g),P&&(t.addCommand(g.KeyMod.CtrlCmd|g.KeyMod.Shift|g.KeyCode.KEY_V,(function(){return Q(),null})),t.addCommand(g.KeyMod.CtrlCmd|g.KeyCode.KEY_C,(function(){return Q(),null}))),window.Monaco=g,L&&t.onDidBlurEditorWidget((function(){L(t.getValue())})),H&&t.onDidFocusEditorText((function(){H(t.getValue())})),P){t.addCommand(g.KeyMod.CtrlCmd|g.KeyCode.KEY_V,(function(){return Q(),null})),t.onDidPaste((function(e){K.current.pastePos=e}));try{window.addEventListener("paste",ee)}catch(e){}}var n=function(){var e;return G.current&&(e=new u.default((function(e){var t,n=Object(o.a)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&K.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(G.current),e}();return J(!0),function(){var e=K.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),K.current.subscription&&K.current.subscription.dispose(),P&&window.removeEventListener("paste",ee),n.unobserve(G.current)}}catch(e){}}))}),[]),Object(l.useEffect)((function(){if(K.current.instance&&Z)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[A,Z]),Object(l.useEffect)((function(){var e=K.current.instance;if(e&&Z){var t=m(C);g.editor.setModelLanguage(e.getModel(),t),console.log("language:",C,e.getModel(),t)}}),[C,Z]),Object(l.useEffect)((function(){K.current.instance&&Z&&g.editor.setTheme(T)}),[T,Z]),Object(l.useEffect)((function(){var e=K.current.instance;e&&Z&&(e.updateOptions(Object(i.a)({},E)),setTimeout((function(){e.getModel().updateOptions(Object(i.a)({},E))}),200))}),[JSON.stringify(E),Z]),Object(l.useEffect)((function(){var e=K.current.instance;e&&Z&&e.layout()}),[f,y,Z]);var re=Object(l.useState)(d(f)),oe=Object(a.a)(re,2),ae=oe[0],se=(oe[1],Object(l.useState)(d(y))),le=Object(a.a)(se,2),ce=le[0],ue=le[1],he=Object(i.a)(Object(i.a)({},k),{},{width:ae,height:ce});return c.a.createElement("div",{className:"my-monaco-editor",ref:G,style:he})};function v(e){var t=e.width,r=void 0===t?"100%":t,s=e.height,h=void 0===s?"100%":s,p=e.original,f=e.modified,m=e.language,v=e.options,y=void 0===v?{}:v,b=Object(l.useRef)(),x=Object(l.useState)(null),C=Object(a.a)(x,2),w=C[0],k=C[1];Object(l.useEffect)((function(){b.current&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){var t=(g=e).editor.createDiffEditor(b.current,Object(i.a)(Object(i.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},y),{},{wordWrap:!0}));k(t);var n=function(e){var t;return b.current&&(t=new u.default((function(t){var n,i=Object(o.a)(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&e.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(b.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(b.current)}}))}),[]),Object(l.useEffect)((function(){w&&w.setModel({original:g.editor.createModel(p,m),modified:g.editor.createModel(f,m)})}),[p,f,m,w]);var S={width:d(r),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:b,style:S})}},ZpRC:
/*!*************************************************************************!*\
!*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***!
\*************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";function i(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function r(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return r(n.overflowY,t)||r(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function a(e,t,n,i,r,o,a,s){return o<e&&a>t||o>e&&a<t?0:o<=e&&s<=n||a>=t&&s>=n?o-e-i:a>t&&s<n||o<e&&s>n?a-t+r:0}var s=function(e,t){var n=window,r=t.scrollMode,s=t.block,l=t.inline,c=t.boundary,u=t.skipOverflowHiddenElements,h="function"==typeof c?c:function(e){return e!==c};if(!i(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,p=[],f=e;i(f)&&h(f);){if((f=f.parentElement)===d){p.push(f);break}null!=f&&f===document.body&&o(f)&&!o(document.documentElement)||null!=f&&o(f,u)&&p.push(f)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),x=b.height,C=b.width,w=b.top,k=b.right,S=b.bottom,E=b.left,_="start"===s||"nearest"===s?w:"end"===s?S:w+x/2,O="center"===l?E+C/2:"end"===l?k:E,N=[],T=0;T<p.length;T++){var L=p[T],A=L.getBoundingClientRect(),M=A.height,j=A.width,D=A.top,P=A.right,I=A.bottom,R=A.left;if("if-needed"===r&&w>=0&&E>=0&&S<=g&&k<=m&&w>=D&&S<=I&&E>=R&&k<=P)return N;var B=getComputedStyle(L),z=parseInt(B.borderLeftWidth,10),F=parseInt(B.borderTopWidth,10),H=parseInt(B.borderRightWidth,10),W=parseInt(B.borderBottomWidth,10),V=0,G=0,K="offsetWidth"in L?L.offsetWidth-L.clientWidth-z-H:0,U="offsetHeight"in L?L.offsetHeight-L.clientHeight-F-W:0;if(d===L)V="start"===s?_:"end"===s?_-g:"nearest"===s?a(y,y+g,g,F,W,y+_,y+_+x,x):_-g/2,G="start"===l?O:"center"===l?O-m/2:"end"===l?O-m:a(v,v+m,m,z,H,v+O,v+O+C,C),V=Math.max(0,V+y),G=Math.max(0,G+v);else{V="start"===s?_-D-F:"end"===s?_-I+W+U:"nearest"===s?a(D,I,M,F,W+U,_,_+x,x):_-(D+M/2)+U/2,G="start"===l?O-R-z:"center"===l?O-(R+j/2)+K/2:"end"===l?O-P+H+K:a(R,P,j,z,H+K,O,O+C,C);var q=L.scrollLeft,$=L.scrollTop;_+=$-(V=Math.max(0,Math.min($+V,L.scrollHeight-M+U))),O+=q-(G=Math.max(0,Math.min(q+G,L.scrollWidth-j+K)))}N.push({el:L,top:V,left:G})}return N};function l(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:s(e,t));if(!n){var i=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var i=e.el,r=e.top,o=e.left;i.scroll&&n?i.scroll({top:r,left:o,behavior:t}):(i.scrollTop=r,i.scrollLeft=o)}))}(s(e,i),i.behavior)}}},aRTE:
/*!*****************************************************!*\
!*** ./node_modules/qr.js/lib/ErrorCorrectLevel.js ***!
\*****************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports={L:1,M:0,Q:3,H:2}},bT9E:
/*!*****************************************!*\
!*** ./node_modules/rc-util/es/omit.js ***!
\*****************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function r(e,t){var n=Object(i.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}},c5Ni:
/*!******************************************************!*\
!*** ./node_modules/codemirror/theme/blackboard.css ***!
\******************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},dQei:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/math.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){for(var n={glog:function(e){if(e<1)throw new Error("glog("+e+")");return n.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return n.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},i=0;i<8;i++)n.EXP_TABLE[i]=1<<i;for(i=8;i<256;i++)n.EXP_TABLE[i]=n.EXP_TABLE[i-4]^n.EXP_TABLE[i-5]^n.EXP_TABLE[i-6]^n.EXP_TABLE[i-8];for(i=0;i<255;i++)n.LOG_TABLE[n.EXP_TABLE[i]]=i;e.exports=n},dWSS:
/*!**********************************************!*\
!*** ./node_modules/qr.js/lib/Polynomial.js ***!
\**********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var i=n(/*! ./math */"dQei");function r(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var i=0;i<e.length-n;i++)this.num[i]=e[i+n]}r.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),n=0;n<this.getLength();n++)for(var o=0;o<e.getLength();o++)t[n+o]^=i.gexp(i.glog(this.get(n))+i.glog(e.get(o)));return new r(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=i.glog(this.get(0))-i.glog(e.get(0)),n=new Array(this.getLength()),o=0;o<this.getLength();o++)n[o]=this.get(o);for(o=0;o<e.getLength();o++)n[o]^=i.gexp(i.glog(e.get(o))+t);return new r(n,0).mod(e)}},e.exports=r},dejd:
/*!***********************************************************!*\
!*** ./src/components/markdown-editor/toolbar/index.less ***!
\***********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},dmUQ:
/*!**************************************************************!*\
!*** ./node_modules/rc-input-number/es/index.js + 1 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var i=n("Ff2n"),r=n("rePB"),o=n("1OyB"),a=n("vuIU"),s=n("Ji7U"),l=n("md7G"),c=n("foSv"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),p=n.n(d),f=n("4IlW");function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Object(c.a)(e);if(t){var r=Object(c.a)(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Object(l.a)(this,n)}}function y(){}function b(e){e.preventDefault()}var x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(e){return null!=e},w=function(e,t){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},k=function(e){Object(s.a)(n,e);var t=v(n);function n(e){var i;Object(o.a)(this,n),(i=t.call(this,e)).onKeyDown=function(e){var t=i.props,n=t.onKeyDown,r=t.onPressEnter;if(e.keyCode===f.a.UP){var o=i.getRatio(e);i.up(e,o,null),i.stop()}else if(e.keyCode===f.a.DOWN){var a=i.getRatio(e);i.down(e,a,null),i.stop()}else e.keyCode===f.a.ENTER&&r&&r(e);if(i.recordCursorPosition(),i.lastKeyCode=e.keyCode,n){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];n.apply(void 0,[e].concat(l))}},i.onKeyUp=function(e){var t=i.props.onKeyUp;if(i.stop(),i.recordCursorPosition(),t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[e].concat(r))}},i.onChange=function(e){var t=i.props.onChange;i.state.focused&&(i.inputting=!0),i.rawInput=i.props.parser(i.getValueFromEvent(e)),i.setState({inputValue:i.rawInput}),t(i.toNumber(i.rawInput))},i.onMouseUp=function(){var e=i.props.onMouseUp;i.recordCursorPosition(),e&&e.apply(void 0,arguments)},i.onFocus=function(){var e;i.setState({focused:!0}),(e=i.props).onFocus.apply(e,arguments)},i.onBlur=function(){var e=i.props.onBlur;i.inputting=!1,i.setState({focused:!1});var t=i.getCurrentValidValue(i.state.inputValue),n=i.setValue(t,y);if(e){var r=i.input.value,o=i.getInputDisplayValue({focus:!1,value:n});i.input.value=o?Number(o):o,e.apply(void 0,arguments),i.input.value=r}},i.getRatio=function(e){var t=1;return e.metaKey||e.ctrlKey?t=.1:e.shiftKey&&(t=10),t},i.getFullNum=function(e){return isNaN(e)?e:/e/i.test(String(e))?Number(e).toFixed(18).replace(/\.?0+$/,""):e},i.getPrecision=function(e){if(C(i.props.precision))return i.props.precision;var t=String(e);if(t.indexOf("e-")>=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n},i.getInputDisplayValue=function(e){var t,n=e||i.state,r=n.focused,o=n.inputValue,a=n.value;null==(t=r?o:i.toPrecisionAsStep(a))&&(t="");var s=i.formatWrapper(t);return C(i.props.decimalSeparator)&&(s=s.toString().replace(".",i.props.decimalSeparator)),s},i.recordCursorPosition=function(){try{i.cursorStart=i.input.selectionStart,i.cursorEnd=i.input.selectionEnd,i.currentValue=i.input.value,i.cursorBefore=i.input.value.substring(0,i.cursorStart),i.cursorAfter=i.input.value.substring(i.cursorEnd)}catch(e){}},i.restoreByAfter=function(e){if(void 0===e)return!1;var t=i.input.value,n=t.lastIndexOf(e);if(-1===n)return!1;var r=i.cursorBefore.length;return i.lastKeyCode===f.a.DELETE&&i.cursorBefore.charAt(r-1)===e[0]?(i.fixCaret(r,r),!0):n+e.length===t.length&&(i.fixCaret(n,n),!0)},i.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,n){var r=e.substring(n);return i.restoreByAfter(r)}))},i.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},i.stop=function(){i.autoStepTimer&&clearTimeout(i.autoStepTimer)},i.down=function(e,t,n){i.pressingUpOrDown=!0,i.step("down",e,t,n)},i.up=function(e,t,n){i.pressingUpOrDown=!0,i.step("up",e,t,n)},i.saveInput=function(e){i.input=e};var r=e.value;void 0===r&&(r=e.defaultValue),i.state={focused:e.autoFocus};var a=i.getValidValue(i.toNumber(r));return i.state=g(g({},i.state),{},{inputValue:i.toPrecisionAsStep(a),value:a}),i}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.value,i=t.onChange,r=t.max,o=t.min,a=this.state.focused;if(e){if(!w(e.value,n)||!w(e.max,r)||!w(e.min,o)){var s,l=a?n:this.getValidValue(n);s=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:s})}var c="value"in this.props?n:this.state.value;"max"in this.props&&e.max!==r&&"number"==typeof c&&c>r&&i&&i(r),"min"in this.props&&e.min!==o&&"number"==typeof c&&c<o&&i&&i(o)}try{if(void 0!==this.cursorStart&&this.state.focused)if(this.partRestoreByAfter(this.cursorAfter)||this.state.value===this.props.value){if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1)}}else{var u=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?u=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(u=this.cursorStart):u=this.input.value.length,this.fixCaret(u,u)}}catch(e){}this.lastKeyCode=null,this.pressingUpOrDown&&this.props.focusOnUpDown&&this.state.focused&&document.activeElement!==this.input&&this.focus()}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(e){var t=e;return t=""===t?"":this.isNotCompleteNumber(parseFloat(t))?this.state.value:this.getValidValue(t),this.toNumber(t)}},{key:"getValueFromEvent",value:function(e){var t=e.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(t=t.replace(this.props.decimalSeparator,".")),t}},{key:"getValidValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.min,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,i=parseFloat(e);return isNaN(i)?e:(i<t&&(i=t),i>n&&(i=n),i)}},{key:"setValue",value:function(e,t){var n=this.props.precision,i=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),r=this.state.value,o=void 0===r?null:r,a=this.state.inputValue,s=void 0===a?null:a,l="number"==typeof i?i.toFixed(n):"".concat(i),c=i!==o||l!=="".concat(s);return"value"in this.props?(s=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:s},t)):this.setState({value:i,inputValue:this.toPrecisionAsStep(e)},t),c&&this.props.onChange(i),i}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,i=n.precision,r=n.step;if(C(i))return i;var o=this.getPrecision(t),a=this.getPrecision(r),s=this.getPrecision(e);return e?Math.max(s,o+a):o+a}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(e,t);return Math.pow(10,n)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(e){return this.props.formatter?this.props.formatter(e):e}},{key:"toPrecisionAsStep",value:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)}},{key:"toNumber",value:function(e){var t=this.props.precision,n=this.state.focused,i=e&&e.length>16&&n;return this.isNotCompleteNumber(e)||i?e:C(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var n=this.props.step,i=this.getPrecisionFactor(e,t),r=Math.abs(this.getMaxPrecision(e,t)),o=((i*e+i*n*t)/i).toFixed(r);return this.toNumber(o)}},{key:"downStep",value:function(e,t){var n=this.props.step,i=this.getPrecisionFactor(e,t),r=Math.abs(this.getMaxPrecision(e,t)),o=((i*e-i*n*t)/i).toFixed(r);return this.toNumber(o)}},{key:"step",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;this.stop(),t&&(t.persist(),t.preventDefault());var o=this.props;if(!o.disabled){var a=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(a)){var s=this["".concat(e,"Step")](a,i),l=s>o.max||s<o.min;s>o.max?s=o.max:s<o.min&&(s=o.min),this.setValue(s,null),this.setState({focused:!0},(function(){n.pressingUpOrDown=!1})),l||(this.autoStepTimer=setTimeout((function(){n[e](t,i,!0)}),r?200:600))}}}},{key:"fixCaret",value:function(e,t){if(void 0!==e&&void 0!==t&&this.input&&this.input.value)try{var n=this.input.selectionStart,i=this.input.selectionEnd;e===n&&t===i||this.input.setSelectionRange(e,t)}catch(e){}}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,o=t.disabled,a=t.readOnly,s=t.useTouch,l=t.autoComplete,c=t.upHandler,u=t.downHandler,d=t.className,f=t.max,m=t.min,g=t.style,v=t.title,x=t.onMouseEnter,C=t.onMouseLeave,w=t.onMouseOver,k=t.onMouseOut,S=t.required,E=t.onClick,_=t.tabIndex,O=t.type,N=t.placeholder,T=t.id,L=t.inputMode,A=t.pattern,M=t.step,j=t.maxLength,D=t.autoFocus,P=t.name,I=t.onPaste,R=t.onInput,B=Object(i.a)(t,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),z=this.state,F=z.value,H=z.focused,W=p()(n,(e={},Object(r.a)(e,d,!!d),Object(r.a)(e,"".concat(n,"-disabled"),o),Object(r.a)(e,"".concat(n,"-focused"),H),e)),V={};Object.keys(B).forEach((function(e){"data-"!==e.substr(0,5)&&"aria-"!==e.substr(0,5)&&"role"!==e||(V[e]=B[e])}));var G=!a&&!o,K=this.getInputDisplayValue(null),U=(F||0===F)&&(isNaN(F)||Number(F)>=f)||o||a,q=(F||0===F)&&(isNaN(F)||Number(F)<=m)||o||a,$=p()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(r.a)({},"".concat(n,"-handler-up-disabled"),U)),Y=p()("".concat(n,"-handler"),"".concat(n,"-handler-down"),Object(r.a)({},"".concat(n,"-handler-down-disabled"),q)),X=s?{onTouchStart:U?y:this.up,onTouchEnd:this.stop}:{onMouseDown:U?y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=s?{onTouchStart:q?y:this.down,onTouchEnd:this.stop}:{onMouseDown:q?y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:W,style:g,title:v,onMouseEnter:x,onMouseLeave:C,onMouseOver:w,onMouseOut:k,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(n,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Increase Value","aria-disabled":U,className:$}),c||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-up-inner"),onClick:b})),h.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:Y}),u||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-down-inner"),onClick:b}))),h.a.createElement("div",{className:"".concat(n,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":F,required:S,type:O,placeholder:N,onPaste:I,onClick:E,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:_,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:G?this.onKeyDown:y,onKeyUp:G?this.onKeyUp:y,autoFocus:D,maxLength:j,readOnly:a,disabled:o,max:f,min:m,step:M,name:P,title:v,id:T,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(K),pattern:A,inputMode:L,onInput:R},V))))}}]),n}(h.a.Component);k.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:y,onKeyDown:y,onPressEnter:y,onFocus:y,onBlur:y,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var S=k;t.a=S},"e+RI":
/*!************************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/AddTags/index.less?modules ***!
\************************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":
/*!************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/List/index.tsx ***!
\************************************************************************************/
/*! exports provided: ListGroup, default */
/*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/input-number/style */"giR+");var i=n(/*! antd/es/input-number */"fyUT"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */"PpiC"),a=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! ./index.less?modules */"2sxD"),u=n.n(c),h=n(/*! @/assets/images/paper/sc.svg */"51dB"),d=n.n(h),p=n(/*! @/assets/images/paper/sm.svg */"5MlY"),f=n.n(p),m=n(/*! @/assets/images/paper/up.svg */"lnNo"),g=n.n(m),v=n(/*! @/assets/images/paper/xiren.svg */"YBdh"),y=n.n(v),b=n(/*! lodash */"LvDl"),x=n(/*! classnames */"TSYQ"),C=n.n(x),w=(a.a.Option,function(e){var t=parseInt(e);return Object(b.isNaN)(t)?0:t}),k=function(e){var t,n,a=e.index,c=e.value,h=void 0===c?[]:c,d=e.onChange,p=e.type,f=e.disabled,m=void 0!==f&&f,v=e.expansion,y=void 0===v||v,x=(Object(o.a)(e,["index","value","onChange","type","disabled","expansion"]),Object(s.useState)(!0)),C=Object(r.a)(x,2),k=C[0],S=C[1],E=function(e,t){var n=Object(b.cloneDeep)(h);n.difficulties[t].num=e,console.log(n,444),d(n)};return console.log("---111-",h),l.a.createElement("div",{className:u.a.ListGroup,style:{borderWidth:a?1:0}},l.a.createElement("div",{className:u.a.a},a+1),l.a.createElement("div",{"data-type":"width",className:u.a.b},null==h?void 0:h.name),l.a.createElement("div",{className:u.a.c},null==h||null===(t=h.difficulties)||void 0===t?void 0:t.map((function(e,t){return l.a.createElement("div",{key:t,style:{display:k?"flex":t?"none":"flex"},className:u.a.c1},l.a.createElement("span",{style:{color:"#777777",marginRight:5}},"难度"),1===e.difficulty&&l.a.createElement("span",{className:u.a.radio},"简单"),2===e.difficulty&&l.a.createElement("span",{className:u.a.radio},"适中"),3===e.difficulty&&l.a.createElement("span",{className:u.a.radio},"困难"),l.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"抽题数量"),0===a&&0===t?l.a.createElement("div",{id:"".concat(p,"_sum")},l.a.createElement(i.a,{disabled:m,parser:w,onChange:function(e){return E(e,t)},min:0,max:null==e?void 0:e.count,value:(null==e?void 0:e.num)||0,style:{width:66}}),l.a.createElement("span",{style:{display:"none"}},"请输入数量")):l.a.createElement(i.a,{disabled:m,parser:w,onChange:function(e){return E(e,t)},min:0,max:null==e?void 0:e.count,value:(null==e?void 0:e.num)||0,style:{width:66}}),l.a.createElement("span",{style:{marginLeft:5}},"/",null==e?void 0:e.count))}))),l.a.createElement("div",{style:{display:1!==(null==h||null===(n=h.difficulties)||void 0===n?void 0:n.length)&&y?"block":"none"},onClick:function(){return S(!k)},className:u.a.d},k?"收起":"展开",l.a.createElement("img",{style:{marginTop:-2,transform:k?"rotate(0deg)":"rotate(180deg)"},src:g.a,className:"ml5"})))};t.a=function(e){var t,n,a=e.value,c=void 0===a?[]:a,h=e.onChange,p=e.listClassName,m=e.disabled,v=void 0!==m&&m,x=e.expansion,S=void 0===x||x,E=(Object(o.a)(e,["value","onChange","listClassName","disabled","expansion"]),Object(s.useState)(!0)),_=Object(r.a)(E,2),O=_[0],N=_[1],T=function(e){var t,n=e.score||0,i=[];return null==e||null===(t=e.item_banks)||void 0===t||t.forEach((function(e){var t;null==e||null===(t=e.tag_disciplines)||void 0===t||t.forEach((function(e){var t;null==e||null===(t=e.difficulties)||void 0===t||t.forEach((function(e){e.num&&i.push(e.num)}))}))})),i.reduce((function(e,t){return e+t}),0)*n},L=function(e,t,n){var i=Object(b.cloneDeep)(c);i.item_banks[t].tag_disciplines[n]=e;var r=T(i);i.scoreTotal=r,console.log(i,"newValue"),h(i)};return l.a.createElement("div",{className:C()(u.a.list,p)},l.a.createElement("div",{className:u.a.head},l.a.createElement("div",{className:u.a.name},l.a.createElement("b",null),l.a.createElement("span",null,null===(t=[{type:"SINGLE",name:"单选题"},{type:"MULTIPLE",name:"多选题"},{type:"COMPLETION",name:"填空题"},{type:"JUDGMENT",name:"判断题"},{type:"SUBJECTIVE",name:"简答题"},{type:"PROGRAM",name:"编程题"},{type:"PRACTICAL",name:"实训题"},{type:"PHOTOGRAPH",name:"拍照上传题"},{type:"FILEUPLOAD",name:"文件上传题"},{type:"COMBINATION",name:"接龙题"}].find((function(e){return e.type===(null==c?void 0:c.item_type)})))||void 0===t?void 0:t.name)),l.a.createElement("div",{className:u.a.right},S&&l.a.createElement("div",{onClick:function(){return N(!O)},className:"current c-light-primary mb10"},O?"收起":"展开",l.a.createElement("img",{style:{marginTop:-2,transform:O?"rotate(0deg)":"rotate(180deg)"},src:g.a,className:"ml5"})),l.a.createElement("div",null,l.a.createElement("img",{src:d.a}),l.a.createElement("span",{className:"ml10 mr20"},"总分",c.scoreTotal,"分"),l.a.createElement("img",{className:"mr10",src:f.a}),l.a.createElement("span",null,"COMBINATION"===(null==c?void 0:c.item_type)?"每小题":"每题"),l.a.createElement("div",{id:"".concat(null==c?void 0:c.item_type,"_score")},l.a.createElement(i.a,{disabled:v,parser:w,min:0,onChange:function(e){var t=Object(b.cloneDeep)(c);t.score=e;var n=T(t);t.scoreTotal=n,h(t)},value:c.score,style:{margin:"0 5px"}}),l.a.createElement("span",{style:{display:"none"}},"请输入每题分数")),l.a.createElement("span",null,"分")))),l.a.createElement("div",{className:u.a.body,style:{display:O?"block":"none"}},null==c||null===(n=c.item_banks)||void 0===n?void 0:n.map((function(e,t){var n;return l.a.createElement(l.a.Fragment,{key:t},l.a.createElement("div",{className:u.a.top},l.a.createElement("img",{src:y.a}),l.a.createElement("span",null,"课程/章节"),l.a.createElement("b",null),l.a.createElement("aside",null,null==e?void 0:e.disciplines,"/",null==e?void 0:e.sub_discipline)),l.a.createElement("div",{className:u.a.bottom},l.a.createElement("div",{className:u.a.l},"知识点"),l.a.createElement("div",{className:u.a.r},null==e||null===(n=e.tag_disciplines)||void 0===n?void 0:n.map((function(e,n){return l.a.createElement(k,{expansion:S,disabled:v,type:null==c?void 0:c.item_type,key:"".concat(t,"-").concat(n),value:e,index:n,onChange:function(e){return L(e,t,n)}})})))))}))))}},exQ7:
/*!****************************************!*\
!*** ./src/assets/images/paper/te.svg ***!
\****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/te.6f9c0684.svg"},f4xo:
/*!********************************************!*\
!*** ./node_modules/qr.js/lib/8BitByte.js ***!
\********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var i=n(/*! ./mode */"nVVt");function r(e){this.mode=i.MODE_8BIT_BYTE,this.data=e}r.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}},e.exports=r},fAei:
/*!******************************************************!*\
!*** ./node_modules/rc-tree/es/index.js + 4 modules ***!
\******************************************************/
/*! exports provided: TreeNode, default */
/*! exports used: TreeNode, default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-motion/es/index.js (<- Module is referenced from these modules with unsupported syntax: ./node_modules/antd/lib/button/LoadingIcon.js (referenced with cjs require)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/TreeNode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/contextTypes.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/util.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/conductUtil.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/treeUtil.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.d(t,"a",(function(){return w.a}));var i=n("rePB"),r=n("VTBJ"),o=n("KQm4"),a=n("1OyB"),s=n("vuIU"),l=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),h=n("4IlW"),d=n("Kwbf"),p=n("TSYQ"),f=n.n(p),m=n("sboe"),g=n("OZM5"),v=n("815F"),y=n("ODXe"),b=n("Ff2n"),x=n("+nKL"),C=n("8XRh"),w=n("WaYH"),k=function(e,t){var n=e.className,i=e.style,r=e.motion,o=e.motionNodes,a=e.motionType,s=e.onMotionStart,l=e.onMotionEnd,c=e.active,h=e.treeNodeRequiredProps,d=Object(b.a)(e,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),p=u.useState(!0),g=Object(y.a)(p,2),x=g[0],k=g[1],S=u.useContext(m.a).prefixCls,E=u.useRef(!1),_=function(){E.current||l(),E.current=!0};return Object(u.useEffect)((function(){o&&"hide"===a&&x&&k(!1)}),[o]),Object(u.useEffect)((function(){return o&&s(),function(){o&&_()}}),[]),o?u.createElement(C.default,Object.assign({ref:t,visible:x},r,{motionAppear:"show"===a,onAppearEnd:_,onLeaveEnd:_}),(function(e,t){var n=e.className,i=e.style;return u.createElement("div",{ref:t,className:f()("".concat(S,"-treenode-motion"),n),style:i},o.map((function(e){var t=e.data,n=t.key,i=Object(b.a)(t,["key"]),r=e.isStart,o=e.isEnd;delete i.children;var a=Object(v.f)(n,h);return u.createElement(w.a,Object.assign({},i,a,{active:c,data:e.data,key:n,isStart:r,isEnd:o}))})))})):u.createElement(w.a,Object.assign({domRef:t,className:n,style:i},d,{active:c}))};k.displayName="MotionTreeNode";var S=u.forwardRef(k);function E(e,t,n){var i=e.findIndex((function(e){return e.data.key===n})),r=e[i+1],o=t.findIndex((function(e){return e.data.key===n}));if(r){var a=t.findIndex((function(e){return e.data.key===r.data.key}));return t.slice(o+1,a)}return t.slice(o+1)}var _={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},O=function(){},N="RC_TREE_MOTION_".concat(Math.random()),T={key:N},L={key:N,level:0,index:0,pos:"0",node:T},A={parent:null,children:[],pos:L.pos,data:T,isStart:[],isEnd:[]};function M(e,t,n,i){return!1!==t&&n?e.slice(0,Math.ceil(n/i)+1):e}function j(e){var t=e.data.key,n=e.pos;return Object(v.e)(t,n)}var D=u.forwardRef((function(e,t){var n=e.prefixCls,i=e.data,r=(e.selectable,e.checkable,e.expandedKeys),o=e.selectedKeys,a=e.checkedKeys,s=e.loadedKeys,l=e.loadingKeys,c=e.halfCheckedKeys,h=e.keyEntities,d=e.disabled,p=e.dragging,f=e.dragOverNodeKey,m=e.dropPosition,g=e.motion,C=e.height,w=e.itemHeight,k=e.virtual,T=e.focusable,L=e.activeItem,D=e.focused,P=e.tabIndex,I=e.onKeyDown,R=e.onFocus,B=e.onBlur,z=e.onActiveChange,F=e.onListChangeStart,H=e.onListChangeEnd,W=Object(b.a)(e,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),V=u.useRef(null);u.useImperativeHandle(t,(function(){return{scrollTo:function(e){V.current.scrollTo(e)}}}));var G=u.useState(r),K=Object(y.a)(G,2),U=K[0],q=K[1],$=u.useState(i),Y=Object(y.a)($,2),X=Y[0],Z=Y[1],J=u.useState(i),Q=Object(y.a)(J,2),ee=Q[0],te=Q[1],ne=u.useState([]),ie=Object(y.a)(ne,2),re=ie[0],oe=ie[1],ae=u.useState(null),se=Object(y.a)(ae,2),le=se[0],ce=se[1];function ue(){Z(i),te(i),oe([]),ce(null),H()}u.useEffect((function(){q(r);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,i=t.length;if(1!==Math.abs(n-i))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach((function(e){n.set(e,!0)}));var i=t.filter((function(e){return!n.has(e)}));return 1===i.length?i[0]:null}return n<i?{add:!0,key:r(e,t)}:{add:!1,key:r(t,e)}}(U,r);if(null!==e.key)if(e.add){var t=X.findIndex((function(t){return t.data.key===e.key})),n=M(E(X,i,e.key),k,C,w),o=X.slice();o.splice(t+1,0,A),te(o),oe(n),ce("show")}else{var a=i.findIndex((function(t){return t.data.key===e.key})),s=M(E(i,X,e.key),k,C,w),l=i.slice();l.splice(a+1,0,A),te(l),oe(s),ce("hide")}else X!==i&&(Z(i),te(i))}),[r,i]),u.useEffect((function(){p||ue()}),[p]);var he=g?ee:i,de={expandedKeys:r,selectedKeys:o,loadedKeys:s,loadingKeys:l,checkedKeys:a,halfCheckedKeys:c,dragOverNodeKey:f,dropPosition:m,keyEntities:h};return u.createElement(u.Fragment,null,D&&L&&u.createElement("span",{style:_,"aria-live":"assertive"},function(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}(L)),u.createElement("div",{role:"tree"},u.createElement("input",{style:_,disabled:!1===T||d,tabIndex:!1!==T?P:null,onKeyDown:I,onFocus:R,onBlur:B,value:"",onChange:O})),u.createElement(x.a,Object.assign({},W,{data:he,itemKey:j,height:C,fullHeight:!1,virtual:k,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:V}),(function(e){var t=e.pos,n=e.data,i=n.key,r=Object(b.a)(n,["key"]),o=e.isStart,a=e.isEnd,s=Object(v.e)(i,t);delete r.children;var l=Object(v.f)(s,de);return u.createElement(S,Object.assign({},r,l,{active:L&&i===L.data.key,pos:t,data:e.data,isStart:o,isEnd:a,motion:g,motionNodes:i===N?re:null,motionType:le,onMotionStart:F,onMotionEnd:ue,treeNodeRequiredProps:de,onMouseMove:function(){z(null)}}))})))}));D.displayName="NodeList";var P=D,I=n("NvD2"),R=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).destroyed=!1,e.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},e.listRef=u.createRef(),e.onNodeDragStart=function(t,n){var i=e.state,r=i.expandedKeys,o=i.keyEntities,a=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n;var l=Object(g.b)(r,s);e.setState({dragging:!0,dragNodesKeys:Object(g.g)(s,o)}),e.setExpandedKeys(l),a&&a({event:t,node:Object(v.b)(n.props)})},e.onNodeDragEnter=function(t,n){var i=e.state,r=i.expandedKeys,a=i.keyEntities,s=i.dragNodesKeys,l=e.props.onDragEnter,c=n.props,u=c.pos,h=c.eventKey;if(e.dragNode&&-1===s.indexOf(h)){var d=Object(g.c)(t,n);e.dragNode.props.eventKey!==h||0!==d?setTimeout((function(){e.setState({dragOverNodeKey:h,dropPosition:d}),e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach((function(t){clearTimeout(e.delayedDragEnterLogic[t])})),e.delayedDragEnterLogic[u]=window.setTimeout((function(){if(e.state.dragging){var i=Object(o.a)(r),s=a[h];s&&(s.children||[]).length&&(i=Object(g.a)(r,h)),"expandedKeys"in e.props||e.setExpandedKeys(i),l&&l({event:t,node:Object(v.b)(n.props),expandedKeys:i})}}),400)}),0):e.setState({dragOverNodeKey:"",dropPosition:null})}},e.onNodeDragOver=function(t,n){var i=e.state.dragNodesKeys,r=e.props.onDragOver,o=n.props.eventKey;if(-1===i.indexOf(o)){if(e.dragNode&&o===e.state.dragOverNodeKey){var a=Object(g.c)(t,n);if(a===e.state.dropPosition)return;e.setState({dropPosition:a})}r&&r({event:t,node:Object(v.b)(n.props)})}},e.onNodeDragLeave=function(t,n){var i=e.props.onDragLeave;e.setState({dragOverNodeKey:""}),i&&i({event:t,node:Object(v.b)(n.props)})},e.onNodeDragEnd=function(t,n){var i=e.props.onDragEnd;e.setState({dragOverNodeKey:""}),e.cleanDragState(),i&&i({event:t,node:Object(v.b)(n.props)}),e.dragNode=null},e.onNodeDrop=function(t,n){var i=e.state,r=i.dragNodesKeys,o=void 0===r?[]:r,a=i.dropPosition,s=e.props.onDrop,l=n.props,c=l.eventKey,u=l.pos;if(e.setState({dragOverNodeKey:""}),e.cleanDragState(),-1===o.indexOf(c)){var h=Object(g.k)(u),p={event:t,node:Object(v.b)(n.props),dragNode:e.dragNode?Object(v.b)(e.dragNode.props):null,dragNodesKeys:o.slice(),dropPosition:a+Number(h[h.length-1]),dropToGap:!1};0!==a&&(p.dropToGap=!0),s&&s(p),e.dragNode=null}else Object(d.a)(!1,"Can not drop to dragNode(include it's children node)")},e.cleanDragState=function(){e.state.dragging&&e.setState({dragging:!1})},e.onNodeClick=function(t,n){var i=e.props.onClick;i&&i(t,n)},e.onNodeDoubleClick=function(t,n){var i=e.props.onDoubleClick;i&&i(t,n)},e.onNodeSelect=function(t,n){var i=e.state.selectedKeys,r=e.state.keyEntities,o=e.props,a=o.onSelect,s=o.multiple,l=n.selected,c=n.key,u=!l,h=(i=u?s?Object(g.a)(i,c):[c]:Object(g.b)(i,c)).map((function(e){var t=r[e];return t?t.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:i}),a&&a(i,{event:"select",selected:u,node:n,selectedNodes:h,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,i){var r,a=e.state,s=a.keyEntities,l=a.checkedKeys,c=a.halfCheckedKeys,u=e.props,h=u.checkStrictly,d=u.onCheck,p=n.key,f={event:"check",node:n,checked:i,nativeEvent:t.nativeEvent};if(h){var m=i?Object(g.a)(l,p):Object(g.b)(l,p);r={checked:m,halfChecked:Object(g.b)(c,p)},f.checkedNodes=m.map((function(e){return s[e]})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:m})}else{var v=Object(I.a)([].concat(Object(o.a)(l),[p]),!0,s),y=v.checkedKeys,b=v.halfCheckedKeys;if(!i){var x=new Set(y);x.delete(p);var C=Object(I.a)(Array.from(x),{checked:!1,halfCheckedKeys:b},s);y=C.checkedKeys,b=C.halfCheckedKeys}r=y,f.checkedNodes=[],f.checkedNodesPositions=[],f.halfCheckedKeys=b,y.forEach((function(e){var t=s[e];if(t){var n=t.node,i=t.pos;f.checkedNodes.push(n),f.checkedNodesPositions.push({node:n,pos:i})}})),e.setUncontrolledState({checkedKeys:y},!1,{halfCheckedKeys:b})}d&&d(r,f)},e.onNodeLoad=function(t){return new Promise((function(n){e.setState((function(i){var r=i.loadedKeys,o=void 0===r?[]:r,a=i.loadingKeys,s=void 0===a?[]:a,l=e.props,c=l.loadData,u=l.onLoad,h=t.key;return c&&-1===o.indexOf(h)&&-1===s.indexOf(h)?(c(t).then((function(){var i=e.state,r=i.loadedKeys,o=i.loadingKeys,a=Object(g.a)(r,h),s=Object(g.b)(o,h);u&&u(a,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:a}),e.setState({loadingKeys:s}),n()})),{loadingKeys:Object(g.a)(s,h)}):{}}))}))},e.onNodeMouseEnter=function(t,n){var i=e.props.onMouseEnter;i&&i({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var i=e.props.onMouseLeave;i&&i({event:t,node:n})},e.onNodeContextMenu=function(t,n){var i=e.props.onRightClick;i&&(t.preventDefault(),i({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0}),t&&t.apply(void 0,arguments)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null),t&&t.apply(void 0,arguments)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state.treeData,i=Object(v.d)(n,t);e.setUncontrolledState({expandedKeys:t,flattenNodes:i},!0)},e.onNodeExpand=function(t,n){var i=e.state.expandedKeys,r=e.state.listChanging,o=e.props,a=o.onExpand,s=o.loadData,l=n.key,c=n.expanded;if(!r){var u=i.indexOf(l),h=!c;if(Object(d.a)(c&&-1!==u||!c&&-1===u,"Expand state not sync with index check"),i=h?Object(g.a)(i,l):Object(g.b)(i,l),e.setExpandedKeys(i),a&&a(i,{node:n,expanded:h,nativeEvent:t.nativeEvent}),h&&s){var p=e.onNodeLoad(n);p&&p.then((function(){var t=Object(v.d)(e.state.treeData,i);e.setUncontrolledState({flattenNodes:t})}))}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout((function(){e.setUncontrolledState({listChanging:!1})}))},e.onActiveChange=function(t){var n=e.state.activeKey,i=e.props.onActiveChange;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t}),i&&i(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,i=t.flattenNodes;return null===n?null:i.find((function(e){return e.data.key===n}))||null},e.offsetActiveKey=function(t){var n=e.state,i=n.flattenNodes,r=n.activeKey,o=i.findIndex((function(e){return e.data.key===r}));-1===o&&t<0&&(o=i.length);var a=i[o=(o+t+i.length)%i.length];if(a){var s=a.data.key;e.onActiveChange(s)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,i=n.activeKey,o=n.expandedKeys,a=n.checkedKeys,s=e.props,l=s.onKeyDown,c=s.checkable,u=s.selectable;switch(t.which){case h.a.UP:e.offsetActiveKey(-1),t.preventDefault();break;case h.a.DOWN:e.offsetActiveKey(1),t.preventDefault()}var d=e.getActiveItem();if(d&&d.data){var p=e.getTreeNodeRequiredProps(),f=!1===d.data.isLeaf||!!(d.data.children||[]).length,m=Object(v.b)(Object(r.a)(Object(r.a)({},Object(v.f)(i,p)),{},{data:d.data,active:!0}));switch(t.which){case h.a.LEFT:f&&o.includes(i)?e.onNodeExpand({},m):d.parent&&e.onActiveChange(d.parent.data.key),t.preventDefault();break;case h.a.RIGHT:f&&!o.includes(i)?e.onNodeExpand({},m):d.children&&d.children.length&&e.onActiveChange(d.children[0].data.key),t.preventDefault();break;case h.a.ENTER:case h.a.SPACE:!c||m.disabled||!1===m.checkable||m.disableCheckbox?c||!u||m.disabled||!1===m.selectable||e.onNodeSelect({},m):e.onNodeCheck({},m,!a.includes(i))}}l&&l(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,s={};Object.keys(t).forEach((function(n){n in e.props?a=!1:(o=!0,s[n]=t[n])})),!o||n&&!a||e.setState(Object(r.a)(Object(r.a)({},s),i))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return Object(s.a)(n,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var e,t=this.state,n=t.focused,r=t.flattenNodes,o=t.keyEntities,a=t.dragging,s=t.activeKey,l=this.props,c=l.prefixCls,h=l.className,d=l.style,p=l.showLine,v=l.focusable,y=l.tabIndex,b=void 0===y?0:y,x=l.selectable,C=l.showIcon,w=l.icon,k=l.switcherIcon,S=l.draggable,E=l.checkable,_=l.checkStrictly,O=l.disabled,N=l.motion,T=l.loadData,L=l.filterTreeNode,A=l.height,M=l.itemHeight,j=l.virtual,D=l.titleRender,I=l.onContextMenu,R=Object(g.f)(this.props);return u.createElement(m.a.Provider,{value:{prefixCls:c,selectable:x,showIcon:C,icon:w,switcherIcon:k,draggable:S,checkable:E,checkStrictly:_,disabled:O,keyEntities:o,loadData:T,filterTreeNode:L,titleRender:D,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},u.createElement("div",{className:f()(c,h,(e={},Object(i.a)(e,"".concat(c,"-show-line"),p),Object(i.a)(e,"".concat(c,"-focused"),n),Object(i.a)(e,"".concat(c,"-active-focused"),null!==s),e))},u.createElement(P,Object.assign({ref:this.listRef,prefixCls:c,style:d,data:r,disabled:O,selectable:x,checkable:!!E,motion:N,dragging:a,height:A,itemHeight:M,virtual:j,focusable:v,focused:n,tabIndex:b,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:I},this.getTreeNodeRequiredProps(),R))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o=t.prevProps,a={prevProps:e};function s(t){return!o&&t in e||o&&o[t]!==e[t]}if(s("treeData")?n=e.treeData:s("children")&&(Object(d.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=Object(v.c)(e.children)),n){a.treeData=n;var l=Object(v.a)(n);a.keyEntities=Object(r.a)(Object(i.a)({},N,L),l.keyEntities)}var c,u=a.keyEntities||t.keyEntities;if(s("expandedKeys")||o&&s("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?Object(g.e)(e.expandedKeys,u):e.expandedKeys;else if(!o&&e.defaultExpandAll){var h=Object(r.a)({},u);delete h[N],a.expandedKeys=Object.keys(h).map((function(e){return h[e].key}))}else!o&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?Object(g.e)(e.defaultExpandedKeys,u):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var p=Object(v.d)(n||t.treeData,a.expandedKeys||t.expandedKeys);a.flattenNodes=p}if((e.selectable&&(s("selectedKeys")?a.selectedKeys=Object(g.d)(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(a.selectedKeys=Object(g.d)(e.defaultSelectedKeys,e))),e.checkable)&&(s("checkedKeys")?c=Object(g.j)(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?c=Object(g.j)(e.defaultCheckedKeys)||{}:n&&(c=Object(g.j)(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),c)){var f=c,m=f.checkedKeys,y=void 0===m?[]:m,b=f.halfCheckedKeys,x=void 0===b?[]:b;if(!e.checkStrictly){var C=Object(I.a)(y,!0,u);y=C.checkedKeys,x=C.halfCheckedKeys}a.checkedKeys=y,a.halfCheckedKeys=x}return s("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(u.Component);R.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},R.TreeNode=w.a;var B=R;t.b=B},k4n4:
/*!***************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/AddTags/index.tsx ***!
\***************************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),r=n(/*! react */"q1tI"),o=n.n(r),a=n(/*! ./index.less?modules */"e+RI"),s=n.n(a),l=n(/*! @/assets/images/icons/tagDelete.png */"FTkQ"),c=n.n(l),u=n(/*! @/assets/images/paper/swenjianjia.svg */"E/GV"),h=n.n(u);t.a=function(e){var t=e.type,n=void 0===t?1:t,a=e.value,l=void 0===a?[]:a,u=e.onChange,d=e.disabled,p=void 0!==d&&d,f=e.icon,m=Object(r.useState)(),g=Object(i.a)(m,2),v=(g[0],g[1],function(e){u(e)});return 1===n?o.a.createElement("div",null,null==l?void 0:l.map((function(e,t){return o.a.createElement("div",{key:t,className:p?"".concat(s.a.btn," ").concat(s.a.btnDisabled):s.a.btn},o.a.createElement("span",{className:s.a.s1},e.name),o.a.createElement("img",{src:c.a,className:s.a.s2,onClick:function(){return v(e.id)}}))}))):o.a.createElement("div",null,null==l?void 0:l.map((function(e,t){return o.a.createElement("div",{key:t,className:s.a.btn2},o.a.createElement("span",{className:s.a.s1},o.a.createElement("img",{src:f||h.a}),e.name),o.a.createElement("img",{src:c.a,className:s.a.s2,onClick:function(){return v(e.id)}}))})))}},kSUc:
/*!***************************************************!*\
!*** ./src/components/markdown-editor/index.less ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},kqOp:
/*!***********************************************!*\
!*** ./src/components/Editor/NullMDEditor.js ***!
\***********************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),l=n(/*! react */"q1tI"),c=n.n(l),u=n(/*! ../markdown-editor */"Ot1p"),h=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(r.a)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).getChCountBeforeCursor=function(e,t){for(var n=t.line,i=0,r=0;r<n;r++)i+=e.getLine(r).split("▁").length-1;return i+=e.getLine(n).substring(0,t.ch).split("▁").length-1},e.onCMBeforeChange=function(t,n){var i=t.getRange(n.from,n.to),r=0;if(n.text.forEach((function(e){r+=e.split("▁").length-1})),i&&-1!=i.indexOf("▁")){var o=i.split("▁").length-1,a=e.getChCountBeforeCursor(t,n.from);console.log("删除".concat(o,"个, 之前有").concat(a,"个,新增").concat(r,"个")),e.props.deleteEmptyDisabled?n.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(a,o,r)}else if(r){var s=e.getChCountBeforeCursor(t,n.from);console.log("新增".concat(r,"个,之前有").concat(s,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(s,0,r)}},e}return Object(o.a)(n,[{key:"render",value:function(){return c.a.createElement(u.a,Object(i.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),n}(l.Component)},lZu9:
/*!***********************************************************!*\
!*** ./node_modules/codemirror/mode/markdown/markdown.js ***!
\***********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.defineMode("markdown",(function(t,n){var i=e.getMode(t,"text/html"),r="null"==i.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var a in o)o.hasOwnProperty(a)&&n.tokenTypeOverrides[a]&&(o[a]=n.tokenTypeOverrides[a]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==x){var n=r;if(!n){var o=e.innerMode(i,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=S,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(i,r){var a,d=i.column()===r.indentation,m=!(a=r.prevLine.stream)||!/\S/.test(a.string),v=r.indentedCode,y=r.prevLine.hr,b=!1!==r.list,x=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var k=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,b)){for(r.list=null;k<r.listStack[r.listStack.length-1];)r.listStack.pop(),r.listStack.length?r.indentation=r.listStack[r.listStack.length-1]:r.list=!1;!1!==r.list&&(r.indentationDiff=k-r.listStack[r.listStack.length-1])}var S=!(m||y||r.prevLine.header||b&&v||r.prevLine.fencedCodeEnd),E=(!1===r.list||y||m)&&r.indentation<=x&&i.match(s),_=null;if(r.indentationDiff>=4&&(v||r.prevLine.fencedCodeEnd||r.prevLine.header||m))return i.skipToEnd(),r.indentedCode=!0,o.code;if(i.eatSpace())return null;if(d&&r.indentation<=x&&(_=i.match(u))&&_[1].length<=6)return r.quote=0,r.header=_[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,w(r);if(r.indentation<=x&&i.eat(">"))return r.quote=d?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),i.eatSpace(),w(r);if(!E&&!r.setext&&d&&r.indentation<=x&&(_=i.match(l))){var O=_[1]?"ol":"ul";return r.indentation=k+i.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&i.match(c,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+O]),w(r)}return d&&r.indentation<=x&&(_=i.match(p,!0))?(r.quote=0,r.fencedEndRE=new RegExp(_[1]+"+ *$"),r.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}(_[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=C,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,w(r)):r.setext||!(S&&b||r.quote||!1!==r.list||r.code||E||f.test(i.string))&&(_=i.lookAhead(1))&&(_=_.match(h))?(r.setext?(r.header=r.setext,r.setext=0,i.skipToEnd(),n.highlightFormatting&&(r.formatting="header")):(r.header="="==_[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,w(r)):E?(i.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):"["===i.peek()?g(i,r,N):g(i,r,r.inline)}function x(t,n){var o=i.token(t,n.htmlState);if(!r){var a=e.innerMode(i,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=S,n.block=b,n.htmlState=null)}return o}function C(e,t){var i,r=t.listStack[t.listStack.length-1]||0,a=t.indentation<r,s=r+3;return t.fencedEndRE&&t.indentation<=s&&(a||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),a||(i=w(t)),t.localMode=t.localState=null,t.block=b,t.f=S,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,a?v(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function w(e){var t=[];if(e.formatting){t.push(o.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(o.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(o.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function k(e,t){if(e.match(d,!0))return w(t)}function S(t,r){var a=r.text(t,r);if(void 0!==a)return a;if(r.list)return r.list=null,w(r);if(r.taskList)return" "===t.match(c,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,w(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),w(r);var s=t.next();if(r.linkTitle){r.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return o.linkHref}if("`"===s){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var p=w(r);return r.code=0,p}return r.formatting=h,w(r)}return r.code=d,w(r)}if(r.code)return w(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var f=w(r),g=o.formatting+"-escape";return f?f+" "+g:g}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("["===s&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("]"===s&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var f=w(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=_,f}if("["===s&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),w(r);if("]"===s&&r.linkText){n.highlightFormatting&&(r.formatting="link");var f=w(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?_:S,f}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link"),(f=w(r))?f+=" ":f="",f+o.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link"),(f=w(r))?f+=" ":f="",f+o.linkEmail;if(n.xml&&"<"===s&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var b=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),v(t,r,x)}if(n.xml&&"<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===s||"_"===s){for(var C=1,k=1==t.pos?" ":t.string.charAt(t.pos-2);C<3&&t.eat(s);)C++;var O=t.peek()||" ",N=!/\s/.test(O)&&(!m.test(O)||/\s/.test(k)||m.test(k)),T=!/\s/.test(k)&&(!m.test(k)||/\s/.test(O)||m.test(O)),L=null,A=null;if(C%2&&(r.em||!N||"*"!==s&&T&&!m.test(k)?r.em!=s||!T||"*"!==s&&N&&!m.test(O)||(L=!1):L=!0),C>1&&(r.strong||!N||"*"!==s&&T&&!m.test(k)?r.strong!=s||!T||"*"!==s&&N&&!m.test(O)||(A=!1):A=!0),null!=A||null!=L)return n.highlightFormatting&&(r.formatting=null==L?"strong":null==A?"em":"strong em"),!0===L&&(r.em=s),!0===A&&(r.strong=s),p=w(r),!1===L&&(r.em=!1),!1===A&&(r.strong=!1),p}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return w(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),p=w(r),r.strikethrough=!1,p;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),w(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return w(r);t.backUp(2)}if(n.emoji&&":"===s&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var M=w(r);return r.emoji=!1,M}return" "===s&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),w(r)}function E(e,t){if(">"===e.next()){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link");var i=w(t);return i?i+=" ":i="",i+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function _(e,t){if(e.eatSpace())return null;var i,r=e.next();return"("===r||"["===r?(t.f=t.inline=(i="("===r?")":"]",function(e,t){if(e.next()===i){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link-string");var r=w(t);return t.linkHref=!1,r}return e.match(O[i]),t.linkHref=!0,w(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,w(t)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=T,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,w(t)):g(e,t,S)}function T(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=L,n.highlightFormatting&&(t.formatting="link");var i=w(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function L(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=S,o.linkHref+" url")}var A={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:S,text:k,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=x)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==x?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:A}},indent:function(t,n,r){return t.block==x&&i.indent?i.indent(t.htmlState,n,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},blankLine:y,getType:w,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return A}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../xml/xml */"1eCo"),n(/*! ../meta */"8EBN"))},lnNo:
/*!****************************************!*\
!*** ./src/assets/images/paper/up.svg ***!
\****************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/up.69f3b3fd.svg"},m3fD:
/*!*********************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/index.less?modules ***!
\*********************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___1w3aZ",flex_space_between:"flex_space_between___26eB1",flex_box_vertical_center:"flex_box_vertical_center___LffUi",flex_box_center_end:"flex_box_center_end___2AiD3",flex_box_column:"flex_box_column___hZDm1",wrap:"wrap___3Du1e",btns:"btns___35pkF",crumbs:"crumbs___3CPsi",oneWrap:"oneWrap___3F99r",title:"title___2n1na",formWrap:"formWrap___3CHwR",rb:"rb___19sZ1"}},nVVt:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/mode.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}},osHv:
/*!********************************************************!*\
!*** ./node_modules/codemirror/addon/fold/xml-fold.js ***!
\********************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t){return e.line-t.line||e.ch-t.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,n,i){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function a(e,n){var i=e.cm.getTokenTypeAt(t(e.line,n));return i&&/\btag\b/.test(i)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(s(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var i=[];;){var r,o=h(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(r=c(e)))return;if("selfClose"!=r)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:t(a,s),to:t(e.line,e.ch)}}else i.push(o[2])}}function f(e,n){for(var i=[];;){var r=d(e);if(!r)return;if("selfClose"!=r){var o=e.line,a=e.ch,s=u(e);if(!s)return;if(s[1])i.push(s[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==s[2]){i.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:t(e.line,e.ch),to:t(o,a)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,i){for(var r=new o(e,i.line,0);;){var a=h(r);if(!a||r.line!=i.line)return;var s=c(r);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(r.line,r.ch),u=p(r,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,i,r){var a=new o(e,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&t(a.line,a.ch),h=s&&u(a);if(s&&h&&!(n(a,i)>0)){var d={from:t(a.line,a.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:f(a,h[2]),close:d,at:"close"}:{open:d,close:p(a=new o(e,l.line,l.ch,r),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,i){for(var r=new o(e,t.line,t.ch,n);;){var a=f(r,i);if(!a)break;var s=p(new o(e,t.line,t.ch,n),a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,i){return p(new o(e,t.line,t.ch,i?{from:0,to:i}:null),n)}}(n(/*! ../../lib/codemirror */"VrN/"))},p5ED:
/*!*********************************************!*\
!*** ./src/components/PreviewAll/index.tsx ***!
\*********************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/button/style */"+L6B");var i=n(/*! antd/es/button */"2/Rp"),r=(n(/*! antd/es/tooltip/style */"5Dmo"),n(/*! antd/es/tooltip */"3S7+")),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! ./index.less?modules */"vHTk"),u=n.n(c),h=n(/*! @ant-design/icons */"yEEn"),d=n(/*! @/components/monaco-editor */"ZW9T"),p=n(/*! @/utils/util */"1vsH");t.a=function(e){var t=e.name,n=e.data,c=(e.theme,e.type),f=e.filename,m=e.monacoEditor,g=e.className,v=e.style,y=e.close,b=e.onClose,x=e.hasMask,C=Object(s.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),w=Object(a.a)(C,2),k=(w[0],w[1],Object(s.useState)("")),S=Object(a.a)(k,2),E=(S[0],S[1]),_=Object(s.useRef)();f&&(m.filename=f),Object(s.useEffect)((function(){var e,t,n=null===(e=document.cookie)||void 0===e||null===(t=e.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==n||n.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&E(t[1])}))}),[]);var O=function(){n.startsWith("http")||n.startsWith("/")?N():Object(p.x)(f||"educoder",n,f)},N=function(){Object(p.v)(f||t,n)};return console.log("data:",n,"fileanme:",f," name:",t),l.a.createElement("div",{style:Object(o.a)({},v||{}),className:"".concat(x&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},y&&l.a.createElement("div",{className:u.a.close,ref:_},l.a.createElement(r.a,{title:"点击下载此文件",getPopupContainer:function(){return _.current}},l.a.createElement("span",{onClick:N},l.a.createElement("i",{className:"icon-quxiaozhiding"}))),l.a.createElement(r.a,{title:"关闭",getPopupContainer:function(){return _.current}},l.a.createElement("span",{className:"",onClick:b},l.a.createElement("i",{className:"icon-guanbi1"})))),l.a.createElement("div",{className:"".concat(u.a[g]," ").concat(g," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&l.a.createElement(d.b,m)),"audio"===c&&l.a.createElement("audio",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),"video"===c&&l.a.createElement(l.a.Fragment,null,null!=n&&n.startsWith("/")?l.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):l.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),"html"===c&&l.a.createElement("iframe",{src:n+"&disposition=inline"}),"pdf"===c&&l.a.createElement("embed",{className:u.a.embed,src:n}),"pdfeditor"===c&&l.a.createElement("div",null,l.a.createElement("iframe",{src:"https://a1office.co/solutions/editor/pdf-editor/查重文档1-8839d79b81e8bda0d298ca058913ab88.pdf"}),l.a.createElement("div",{style:{position:"absolute",left:"1px",top:"1px",width:180,height:60,background:"#f9f9f9"}})),"image"===c&&l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),"other"===c&&l.a.createElement("div",null,l.a.createElement(i.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载")),("download"===c||"office"===c)&&l.a.createElement(i.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载"))}},"p77/":
/*!****************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.css ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},"rAM+":
/*!*******************************************************************************************************************!*\
!*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***!
\*******************************************************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(i.a)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},rUJ1:
/*!********************************************!*\
!*** ./node_modules/marked/src/helpers.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: escape */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){const n=/[&<>"']/,i=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=e=>a[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const p={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(e,t){p[" "+e]||(f.test(e)?p[" "+e]=e+"/":p[" "+e]=y(e,"/",!0));const n=-1===(e=p[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(g,"$1")+t:e+t}function y(e,t,n){const i=e.length;if(0===i)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o!==t||n){if(o===t||!n)break;r++}else r++}return e.substr(0,i-r)}e.exports={escape:function(e,t){if(t){if(n.test(e))return e.replace(i,s)}else if(r.test(e))return e.replace(o,s);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,i)=>(i=(i=i.source||i).replace(u,"$1"),e=e.replace(t,i),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(c(n)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!d.test(n)&&(n=v(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:v,noopTest:{exec:function(){}},merge:function(e){let t,n,i=1;for(;i<arguments.length;i++)for(n in t=arguments[i],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},splitCells:function(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let i=!1,r=t;for(;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/);let i=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},rtrim:y,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}}},rcnY:
/*!*******************************************!*\
!*** ./node_modules/qr.js/lib/RSBlock.js ***!
\*******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var i=n(/*! ./ErrorCorrectLevel */"aRTE");function r(e,t){this.totalCount=e,this.dataCount=t}r.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r.getRSBlocks=function(e,t){var n=r.getRsBlockTable(e,t);if(null==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var i=n.length/3,o=new Array,a=0;a<i;a++)for(var s=n[3*a+0],l=n[3*a+1],c=n[3*a+2],u=0;u<s;u++)o.push(new r(l,c));return o},r.getRsBlockTable=function(e,t){switch(t){case i.L:return r.RS_BLOCK_TABLE[4*(e-1)+0];case i.M:return r.RS_BLOCK_TABLE[4*(e-1)+1];case i.Q:return r.RS_BLOCK_TABLE[4*(e-1)+2];case i.H:return r.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},e.exports=r},sbIO:
/*!***********************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx + 6 modules ***!
\***********************************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/editor.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/Editor/NullChildEditor/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/Editor/NullMDEditor.js */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/bi.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/jinshi.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/xixi.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/zhong.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/checkbox/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/checkbox/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/divider/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/divider/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/pagination/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/pagination/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/lodash/lodash.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n("DjyN");var i=n("NUBc"),r=(n("5Dmo"),n("3S7+")),o=(n("/zsF"),n("PArb")),a=(n("Q9mQ"),n("diRs")),s=(n("+L6B"),n("2/Rp")),l=(n("7Kak"),n("9yH6")),c=(n("5NDa"),n("5rEg")),u=(n("miYZ"),n("tsqr")),h=n("9og8"),d=(n("giR+"),n("fyUT")),p=(n("2qtc"),n("kLXV")),f=n("tJVT"),m=n("WmNS"),g=n.n(m),v=n("q1tI"),y=n.n(v),b=n("PsQE"),x=n.n(b),C=n("0eGx"),w=n.n(C),k=n("9Bee"),S=n("Ty5D"),E=n("9kvl"),_=n("ErOA"),O=n("+yhJ"),N=n.n(O),T=n("RZ/O"),L=n.n(T),A=n("LvDl"),M=n("6K3P"),j=n.n(M),D=(n("sRBo"),n("kaz8")),P=n("oBTY"),I=n("PpiC"),R=n("Ot1p"),B=n("kqOp"),z=n("7qnI"),F=n("1vsH"),H=n("PGNT"),W=n.n(H),V=function(e,t){e.globalSetting,e.loading,e.dispatch;var n=e.isEdit,i=e.editData,r=(Object(I.a)(e,["globalSetting","loading","dispatch","isEdit","editData"]),Object(v.useState)("")),o=Object(f.a)(r,2),a=o[0],s=o[1],l=Object(v.useState)(""),c=Object(f.a)(l,2),h=c[0],d=c[1],m=Object(v.useState)([]),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),k=w[0],S=w[1],E=Object(v.useState)(),_=Object(f.a)(E,2),O=_[0],N=_[1],T=Object(v.useState)(!1),L=Object(f.a)(T,2),A=L[0],M=L[1];Object(v.useEffect)((function(){i&&n&&(s(null==i?void 0:i.name),d(null==i?void 0:i.analysis),N(null==i?void 0:i.is_ordered),M(!0))}),[i]),Object(v.useEffect)((function(){if(A){var e=null==i?void 0:i.standard_answer.map((function(e){return e.answer_text}));x(e),M(!1)}}),[A]),Object(v.useImperativeHandle)(t,(function(){return{onSave:j,Clear:H}}));var j=function(){var e=[],t=!1;return a?(b.forEach((function(n,i){e.push({position:i+1,answer_text:[]}),n.forEach((function(n,r){e[i].answer_text.push(n),n&&Object(F.bb)(n,1e4)||(S("".concat(i,"-").concat(r)),u.b.info(n?"答案不能超过10000字符":"答案:不能为空"),t=!0)}))})),!t&&((null==e?void 0:e.length)>20?(u.b.warn("填空题标准答案不能为空/不能超过20个"),!1):{name:a,analysis:h,standard_answers:e,is_ordered:O})):(u.b.info("请您输入题干"),!1)},H=function(){s(""),d(""),x([]),N(!1)},V=function(e,t,n){S("");var i=b.slice();i[e][t]=n,x(i)},G=function(e){var t=b.slice();t[e]=[].concat(Object(P.a)(t[e]),[""]),x(t)},K=function(e,t){var n=b.slice();if(!n[e][t])return n[e]=n[e].filter((function(e,n){return n!==t})),void x(n);p.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){n[e]=n[e].filter((function(e,n){return n!==t})),x(n)}})},U=function(e){p.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){var t=b.slice();t=b.filter((function(t,n){return e!==n})),x(t)}})};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement("div",null,y.a.createElement(B.a,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:a,onChange:function(e){return s(e)},showNullButton:!0,onPlaceholderChange:function(e,t,n){var i=b.slice();if(t&&i.splice(e,t),n)for(var r=0;r<n;r++)i.splice(e+r,0,[""]);x(i)}})),y.a.createElement("div",{className:"mt20"},b.map((function(e,t){return y.a.createElement(z.a,{key:t,answers:e,index:t,flex:1,is_md:!0,activeOptionErrorIndex:k,onAnswerChange:V,addChildAnswer:G,deleteChildAnswer:K,deleteChildAnswermain:U})}))),y.a.createElement("div",{className:"mt20"},b.length>1&&y.a.createElement("span",null,y.a.createElement(D.a,{checked:O,onChange:function(e){return N(e.target.checked)},className:"".concat(W.a.color333," font14")},"多个填空的答案有顺序要求"),y.a.createElement("span",{className:"".concat(W.a.color999," font12")},"(选中,每个填空的答案顺序必须与参考答案一致)"))),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:h,onChange:function(e){return d(e)}}))},G=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(V)),K=function(e,t){e.globalSetting,e.loading;var n=e.editData,i=(e.dispatch,e.onRef,e.isEdit),r=(Object(I.a)(e,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),Object(v.useState)()),o=Object(f.a)(r,2),a=o[0],s=o[1],c=Object(v.useState)(""),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)(""),g=Object(f.a)(m,2),b=g[0],x=g[1];Object(v.useEffect)((function(){if(n&&i){p(null==n?void 0:n.name),x(null==n?void 0:n.analysis);var e=null==n?void 0:n.choices.find((function(e){return e.is_answer}));s("正确"===e.choice_text?"0":"1")}}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:C,Clear:w}}));var C=function(){return d?a?{name:d,choices:[{choice_text:"正确",is_answer:"0"===a?1:0},{choice_text:"错误",is_answer:"1"===a?1:0}],analysis:b}:(u.b.info("请先点击选择本选择题的正确选项"),!1):(u.b.info("请您输入题干"),!1)},w=function(){p(""),x(""),s("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:d,onChange:function(e){return p(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),y.a.createElement(l.a.Group,{buttonStyle:"solid",value:a,onChange:function(e){return s(e.target.value)}},y.a.createElement(l.a.Button,{value:"0",className:"".concat(W.a.radio," mr40")},"正确"),y.a.createElement(l.a.Button,{value:"1",className:W.a.radio},"错误")),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:b,onChange:function(e){return x(e)}}))},U=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(K)),q=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$=function(e,t){var n=e.editData,i=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),o=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)([])),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)(),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)([]),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),S=w[0],E=w[1],_=Object(v.useState)(""),O=Object(f.a)(_,2),N=O[0],T=O[1];Object(v.useEffect)((function(){l(["","","",""])}),[]),Object(v.useEffect)((function(){if(n&&i){E(null==n?void 0:n.name),T(null==n?void 0:n.analysis),l(null==n?void 0:n.choices.map((function(e){return e.choice_text})));var e=[];null==n||n.choices.map((function(t,n){t.is_answer&&e.push(n)})),x(e)}}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:L,Clear:A}}));var L=function(){if(!S)return u.b.info("请您输入题干"),!1;var e=s.findIndex((function(e){return!e}));if(e>-1)return u.b.info("请先输入 ".concat(q[e]," 选项的内容")),!1;if(!b.length)return u.b.info("请设置本题的正确答案点击选项A/B...即可完成设置"),!1;if(b.length<2)return u.b.info("多选题最小正确选项为2个"),!1;var t=s.map((function(e,t){return{choice_text:e,is_answer:b.includes(t)?1:0}}));return{name:S,choices:t,analysis:N}},A=function(){l(["","","",""]),E(""),T(""),x("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(e){return E(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),s.map((function(e,t){return y.a.createElement("div",{className:W.a.choiceWrap,key:t},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(b.includes(t)?W.a.activeAnswer:""),onClick:function(){b.includes(t)?x(b.filter((function(e){return e!==t}))):x([].concat(Object(P.a)(b),[t]))}},q[t])),y.a.createElement("div",{className:W.a.editorWrap},d===t?y.a.createElement(R.a,{id:"single-question-option-".concat(t),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){s[t]=e,l(s)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return p(t)}},y.a.createElement(k.a,{value:e}))),t>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){l(s.filter((function(e,n){return n!==t}))),b.includes(t)?x(b.filter((function(e){return e!==t}))):x([].concat(Object(P.a)(b),[t]))}})),t<7&&t===s.length-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return l([].concat(Object(P.a)(s),[""]))}})))})),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:N,onChange:function(e){return T(e)}}))},Y=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)($)),X=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Z=function(e,t){var n=e.editData,i=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),o=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)([])),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)(),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)(),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),S=w[0],E=w[1],_=Object(v.useState)(""),O=Object(f.a)(_,2),N=O[0],T=O[1];Object(v.useEffect)((function(){l(["","","",""])}),[]),Object(v.useEffect)((function(){n&&i&&(E(null==n?void 0:n.name),T(null==n?void 0:n.analysis),l(null==n?void 0:n.choices.map((function(e){return e.choice_text}))),x(null==n?void 0:n.choices.findIndex((function(e){return e.is_answer}))))}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:L,Clear:A}}));var L=function(){if(!S)return u.b.info("请您输入题干"),!1;var e=s.findIndex((function(e){return!e}));if(e>-1)return u.b.info("请先输入 ".concat(X[e]," 选项的内容")),!1;if(console.log("activeAnswer: ",b),"number"!=typeof b)return u.b.info("请设置本题的正确答案点击选项A/B...即可完成设置"),!1;var t=s.map((function(e,t){return{choice_text:e,is_answer:b===t?1:0}}));return{name:S,choices:t,analysis:N}},A=function(){l(["","","",""]),E(""),T(""),x("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(e){return E(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),s.map((function(e,t){return y.a.createElement("div",{className:W.a.choiceWrap,key:t},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(b===t?W.a.activeAnswer:""),onClick:function(){return x(t)}},X[t])),y.a.createElement("div",{className:W.a.editorWrap},d===t?y.a.createElement(R.a,{id:"single-question-option-".concat(t),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){s[t]=e,l(s)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return p(t)}},y.a.createElement(k.a,{value:e}))),t>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){l(s.filter((function(e,n){return n!==t}))),t===b&&x(null)}})),t<7&&t===s.length-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return l([].concat(Object(P.a)(s),[""]))}})))})),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:N,onChange:function(e){return T(e)}}))},J=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(Z)),Q=function(e,t){var n=e.editData,i=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),r=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)("")),o=Object(f.a)(r,2),a=o[0],s=o[1],l=Object(v.useState)(""),c=Object(f.a)(l,2),h=c[0],d=c[1],p=Object(v.useState)(""),m=Object(f.a)(p,2),g=m[0],b=m[1];Object(v.useEffect)((function(){var e;n&&i&&(s(null==n?void 0:n.name),d(null==n?void 0:n.analysis),b(null==n||null===(e=n.answer_texts)||void 0===e?void 0:e[0]))}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:x,Clear:C}}));var x=function(){return a?g?{name:a,answer_texts:[g],analysis:h}:(u.b.info("请您输入参考答案"),!1):(u.b.info("请您输入题干"),!1)},C=function(){s(""),d(""),b("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:a,onChange:function(e){return s(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"参考答案:")),y.a.createElement(R.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:g,onChange:function(e){return b(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:h,onChange:function(e){return d(e)}}))},ee=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(Q)),te=n("k1fw"),ne=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ie=function(e,t){e.globalSetting,e.loading,e.dispatch;var n=e.editData,i=(e.onRef,e.isEdit),o=(Object(I.a)(e,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),Object(v.useState)("")),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)([]),h=Object(f.a)(c,2),d=h[0],p=h[1];console.log(d),Object(v.useEffect)((function(){var e;if(n&&i){l(null==n?void 0:n.name);var t=null==n||null===(e=n.sub_item_banks)||void 0===e?void 0:e.map((function(e){var t,n,i;return Object(te.a)(Object(te.a)({},e),{},{id:e.id,open:!1,qusList:null==e||null===(t=e.choices)||void 0===t?void 0:t.map((function(e){return e.choice_text})),activeQusEditor:null,qusAnswer:null===(n=[null==e||null===(i=e.choices)||void 0===i?void 0:i.findIndex((function(e){return e.is_answer}))])||void 0===n?void 0:n.filter((function(e){return-1!==e}))})}));p(t)}}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:m,Clear:g}}));var m=function(){if(!s)return u.b.info("请您输入题干"),!1;if(0===d.length)return u.b.info("请您添加小题"),!1;for(var e=0;e<d.length;e++){var t,n=d[e];if(null==n||!n.name)return u.b.info("请您输入第".concat(e+1,"小题题干")),!1;var i=null==n||null===(t=n.qusList)||void 0===t?void 0:t.findIndex((function(e){return!e}));if(i>-1)return u.b.info("请先输入第".concat(e+1,"小题").concat(ne[i],"选项的内容")),!1;if(null==n||!n.qusAnswer.length)return u.b.info("请设置第".concat(e+1,"小题的正确答案点击选项A/B...即可完成设置")),!1}var r=d.map((function(e){return{id:e.id>1?e.id:null,name:e.name,item_type:e.item_type,analysis:e.analysis,choices:e.qusList.map((function(t,n){return{choice_text:t,is_answer:e.qusAnswer[0]===n?1:0}}))}}));return{name:s,sub_item_banks:r}},g=function(){l(""),p([])},b=function(e,t,n){var i,r=Object(A.cloneDeep)(d);("open"===e&&(r[t].open=!r[t].open),"delete"===e&&r.splice(t,1),"value"===e&&(r[t].name=n),"answer"===e&&(r[t].qusAnswer=[n]),"edit"===e&&(r[t].activeQusEditor=n),"details"===e&&(r[t].qusList[r[t].activeQusEditor]=n),"addQus"===e&&(r[t].qusList=r[t].qusList.concat("")),"deleteQus"===e)&&(r[t].qusList=r[t].qusList.filter((function(e,t){return t!==n})),r[t].qusAnswer=null===(i=r[t].qusAnswer)||void 0===i?void 0:i.filter((function(e){return e!==n})));"analysis"===e&&(r[t].analysis=n),p(r)};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:s,onChange:function(e){return l(e)}}),null==d?void 0:d.map((function(e,t){var n;return y.a.createElement("div",{className:W.a.fold,key:e.id},y.a.createElement("div",{onClick:function(){return b("open",t)},className:W.a.head},y.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:e.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),y.a.createElement("span",null,"第",t+1,"小题(单选题)"),y.a.createElement("b",{style:{visibility:"hidden"},onClick:function(e){e.stopPropagation(),b("delete",t)},className:"iconfont icon-shanchu8"})),y.a.createElement("div",{className:"mb10",style:{display:e.open?"block":"none"}},y.a.createElement(R.a,{watch:!0,height:155,placeholder:"请您输入题干",defaultValue:null==e?void 0:e.name,onChange:function(e){return b("value",t,e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),null==e||null===(n=e.qusList)||void 0===n?void 0:n.map((function(n,i){var o,a;return y.a.createElement("div",{className:W.a.choiceWrap,key:i},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(null!=e&&null!==(o=e.qusAnswer)&&void 0!==o&&o.includes(i)?W.a.activeAnswer:""),onClick:function(){return b("answer",t,i)}},ne[i])),y.a.createElement("div",{className:W.a.editorWrap},(null==e?void 0:e.activeQusEditor)===i?y.a.createElement(R.a,{id:"single-question-option-".concat(i),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:n,onChange:function(e){return b("details",t,e)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return b("edit",t,i)}},y.a.createElement(k.a,{value:n}))),i>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b("deleteQus",t,i)}})),i<7&&i===(null==e||null===(a=e.qusList)||void 0===a?void 0:a.length)-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return b("addQus",t)}})))})),y.a.createElement("p",{className:"mb10 mt10"},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:e.analysis,onChange:function(e){return b("analysis",t,e)}})))})))},re=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(ie));t.a=function(e){var t,n,m,b,C,O,T,M,D=e.data,P=e.submit,I=e.goBack,R=e.loading,B=e.onTypeScore,z=e.editPreview,F=void 0!==z&&z,H=e.onSkipExamination,W=e.selectValue,V=e.onExchange,K=Object(v.useRef)(),q=Object(v.useRef)(Object(A.debounce)((function(){return le()}),100,{leading:!0,trailing:!0})),$=Object(v.useState)(null),X=Object(f.a)($,2),Z=X[0],Q=X[1],te=Object(v.useState)(!1),ne=Object(f.a)(te,2),ie=ne[0],oe=ne[1],ae=Object(S.i)();Object(v.useEffect)((function(){return window.addEventListener("scroll",null==q?void 0:q.current),function(){window.removeEventListener("scroll",null==q?void 0:q.current)}}),[]),Object(v.useEffect)((function(){oe(!0)}),[]),Object(v.useEffect)((function(){var e,t,n,i,r=null===(e=document.getElementById("examName"))||void 0===e||null===(t=e.getElementsByClassName("ant-pagination-options-quick-jumper"))||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.childNodes)||void 0===i?void 0:i[2];r&&(r.nodeValue="份")}),[D]);var se=function(e){var t=parseInt(e);return isNaN(t)?"":t};var le=function(){var e,t,n,i,r=document.getElementById("preview_btns"),o=document.getElementById("preview_btns_else");n=0,i=0,document.body&&(n=document.body.scrollTop),document.documentElement&&(i=document.documentElement.scrollTop),(n-i>0?n:i)+("CSS1Compat"==document.compatMode?document.documentElement.clientHeight:document.body.clientHeight)>=(e=0,t=0,document.body&&(e=document.body.scrollHeight),document.documentElement&&(t=document.documentElement.scrollHeight),(e-t>0?e:t)-68)?(r.style.visibility="hidden",o.style.visibility="visible"):(r.style.visibility="visible",o.style.visibility="hidden")},ce=["容易","简单","适中","困难"],ue=function(e){var t;return y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",null==e||null===(t=e.answer_texts)||void 0===t?void 0:t[0]),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==e?void 0:e.discipline_name,"/").concat(null==e?void 0:e.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name)))},he=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],de=function(e){console.log(e,"key"),H(e-1)},pe=function(){return y.a.createElement(y.a.Fragment,null,y.a.createElement(a.a,{color:"#55575D",overlayClassName:x.a.popover,visible:ie,getPopupContainer:function(e){return null==e?void 0:e.parentNode},content:"如您对此份试题满意,可将此份试题保存为固定试卷"},y.a.createElement(s.a,{onMouseEnter:function(){return oe(!0)},onMouseLeave:function(){return oe(!1)},onClick:function(){var e,t;t="",p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"保存试卷",content:y.a.createElement("div",{className:x.a.modalColumn},y.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},y.a.createElement("img",{style:{marginRight:5},src:j.a}),"保存后单独生成一份人工组卷类型的固定试卷。"),y.a.createElement("div",{className:x.a.modalRow,style:{marginTop:20}},y.a.createElement("sup",{className:x.a.sup},"*"),y.a.createElement("span",{style:{flexShrink:0}},"试卷名称:"),y.a.createElement(c.a,{placeholder:"请输入试卷名称",min:0,maxLength:60,defaultValue:t,onChange:function(e){t=e.target.value}}))),okText:"确认",cancelText:"取消",onOk:(e=Object(h.a)(g.a.mark((function e(){var n,i,r,o,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return u.b.warn("试卷名称不能为空"),e.abrupt("return",Promise.reject());case 3:return i=[],r=[],o=[],null==D||null===(n=D.questionList)||void 0===n||n.forEach((function(e){var t;null===(t=e.questions)||void 0===t||t.forEach((function(t){i.push(t.id),r.push(e.questions_score/e.questions_count),"COMBINATION"===e.type&&o.push({id:t.id,sub_item_bank_ids:t.sub_item_banks.map((function(e){return e.id}))})}))})),console.log("-----",o),a={item_bank_ids:i,item_bank_scores:r,name:t,combination_item_banks:o},e.next=11,P(a);case 11:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})}},"保存")),y.a.createElement(s.a,{onClick:function(){document.body.scrollIntoView(),I()}},"返回"),y.a.createElement(s.a,{loading:R,onClick:function(){return P()},type:"primary"},"提交"))},fe=function(){var e;return y.a.createElement(y.a.Fragment,null,y.a.createElement(s.a,{onClick:I},"返回"),W>0&&y.a.createElement(s.a,{onClick:function(){return de(W)},type:"primary"},"上一份"),W<(null==D||null===(e=D.exam)||void 0===e?void 0:e.total_num)-1&&y.a.createElement(s.a,{onClick:function(){return de(W+2)}},"下一份"))},me=function(){var e=Object(h.a)(g.a.mark((function e(t,n){var i,r,o,a,s,l,c,h,d,p;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=K.current)||void 0===i?void 0:i.onSave();case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return");case 5:return o={question_score:n.score,analysis:r.analysis},console.log(r,"editorData"),"SINGLE"!==t&&"MULTIPLE"!==t&&"JUDGMENT"!==t||(s=[],l=[],o.question_type="JUDGMENT"===t?2:1,o.question_title=null==r?void 0:r.name,null==r||null===(a=r.choices)||void 0===a||a.forEach((function(e,t){s.push(e.choice_text),null!=e&&e.is_answer&&l.push(t+1)})),o.question_choices=s,o.standard_answers=l),"COMPLETION"===t&&(o.is_ordered=r.is_ordered,o.question_title=null==r?void 0:r.name,o.question_type=3,h=[],null==r||null===(c=r.standard_answers)||void 0===c||c.forEach((function(e,t){h.push({choice_id:e.position,answer_text:e.answer_text})})),o.standard_answers=h),"SUBJECTIVE"===t&&(o.question_title=null==r?void 0:r.name,o.question_type=3,o.standard_answers=null==r?void 0:r.answer_texts),"COMBINATION"===t&&(o.question_title=null==r?void 0:r.name,o.question_type=7,o.sub_questions=null==r||null===(d=r.sub_item_banks)||void 0===d?void 0:d.map((function(e,t){return{id:e.id,question_title:e.name,question_type:1,question_choices:e.choices.map((function(e){return e.choice_text})),standard_answers:[e.choices.findIndex((function(e){return e.is_answer}))+1],analysis:e.analysis}})),delete o.analysis),e.next=13,Object(_.a)("/api/exercise_questions/".concat(n.id,".json"),{method:"put",body:o});case 13:0===(null==(p=e.sent)?void 0:p.status)&&(u.b.success("编辑成功"),de(W+1)),Q(null);case 16:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();console.log(function(){for(var e=[],t=0;t<(null==D||null===(n=D.exam)||void 0===n?void 0:n.total_num);t++){var n;e.push({})}return e}(),"data");var ge=null==D||null===(t=D.questionList)||void 0===t?void 0:t.reduce((function(e,t){return e+t.questions_score}),0),ve=F&&1!==(null==D||null===(n=D.exam)||void 0===n?void 0:n.exercise_status);return y.a.createElement("section",{className:x.a.wrap},y.a.createElement("div",{id:"id_left_preview",className:x.a.left,onMouseEnter:function(e){document.getElementById("id_left_preview").style.overflowY="auto"},onMouseLeave:function(e){document.getElementById("id_left_preview").style.overflowY="hidden"}},y.a.createElement("div",{className:x.a.title},y.a.createElement("div",null,y.a.createElement("b",null),y.a.createElement("span",null,"答题卡"))),y.a.createElement("div",{className:x.a.total},y.a.createElement("div",null,y.a.createElement("img",{src:N.a}),y.a.createElement("span",null,"题数(道)"),y.a.createElement("aside",null,null==D?void 0:D.all_questions_count)),y.a.createElement("div",{className:"mr30 ml30"},y.a.createElement("img",{src:L.a}),y.a.createElement("span",null,"总分(分)"),y.a.createElement("aside",null,ge)),y.a.createElement("div",null,y.a.createElement("img",{src:w.a}),y.a.createElement("span",null,"时长(分)"),y.a.createElement("aside",null,null==D||null===(m=D.exam)||void 0===m?void 0:m.time))),null==D||null===(b=D.questionList)||void 0===b?void 0:b.map((function(e,t){var n;return y.a.createElement("div",{className:x.a.list,key:t},y.a.createElement("div",{className:x.a.name},y.a.createElement("b",null),y.a.createElement("span",null,e.name)),y.a.createElement("aside",null,y.a.createElement("div",null,"共",y.a.createElement("span",{className:x.a.b},e.questions_count),"题 ",y.a.createElement("span",{className:x.a.l},"|"),"共",y.a.createElement("span",{className:x.a.r},e.questions_score),"分"),y.a.createElement("div",{className:x.a.answerSheet},null==e||null===(n=e.questions)||void 0===n?void 0:n.map((function(e,t){return y.a.createElement("div",{onClick:function(){var t="Anchor_".concat(e.id),n=document.getElementById(t);n&&setTimeout((function(){return n.scrollIntoView({block:"center",behavior:"smooth"})}))},key:e.id,className:x.a.tag},t+1)})))))}))),y.a.createElement("div",{className:x.a.right},y.a.createElement("div",{className:x.a.examName,id:"examName"},y.a.createElement("div",{className:x.a.name},y.a.createElement(r.a,{title:null==D||null===(C=D.exam)||void 0===C?void 0:C.name,getPopupContainer:function(e){return e.parentNode}},y.a.createElement("span",{className:x.a.t},null==D||null===(O=D.exam)||void 0===O?void 0:O.name))),F?y.a.createElement(i.a,{showTotal:function(e){return y.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"共计",y.a.createElement("span",{className:"c-light-primary"},e),"份试卷")},total:null==D||null===(T=D.exam)||void 0===T?void 0:T.total_num,pageSize:1,current:W+1,showSizeChanger:!1,onChange:de,showQuickJumper:!0,hideOnSinglePage:!1}):y.a.createElement(s.a,{onClick:function(){var e,t=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换预览中的所有试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(e=Object(h.a)(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.update({cancelButtonProps:{disabled:!0}}),e.next=3,V();case 3:t.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成整张试题");case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},type:"primary"},"随机更换")),y.a.createElement("div",{className:x.a.topWarp},null==D||null===(M=D.questionList)||void 0===M?void 0:M.map((function(e,t){var n,i;return y.a.createElement(y.a.Fragment,{key:t},y.a.createElement("div",{className:x.a.head,style:0===t?{border:0,marginTop:-16}:{}},y.a.createElement("div",{className:x.a.name},y.a.createElement("b",null),y.a.createElement("span",null,e.name)),y.a.createElement("div",{className:x.a.so},"共",y.a.createElement("span",{className:x.a.b},e.questions_count," "),"题 ","COMBINATION"===e.type&&"(包含".concat(null==e||null===(n=e.questions)||void 0===n?void 0:n.map((function(e){var t;return null==e||null===(t=e.sub_item_banks)||void 0===t?void 0:t.length})).reduce((function(e,t){return e+t})),"小题)"),y.a.createElement("span",{className:x.a.l},"|"),"共",y.a.createElement("span",{className:x.a.r},e.questions_score),"分"),!F&&y.a.createElement("div",{className:x.a.btn},y.a.createElement(s.a,{onClick:function(){!function(e){console.log("---",e);var t=[];e.questions.map((function(e){return null==e?void 0:e.sub_item_banks.map((function(e){t.push(e)}))}));var n,i=0;i="COMBINATION"===e.type?e.questions_score/t.length:e.questions_score/e.questions_count,p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"分数设置",content:y.a.createElement("div",{className:x.a.modalColumn},y.a.createElement("div",{className:x.a.modalRow,style:{justifyContent:"flex-start"}},y.a.createElement("sup",{className:x.a.sup},"*"),y.a.createElement("span",null,null==e?void 0:e.name,"COMBINATION"===(null==e?void 0:e.type)&&"中的每小题",""),y.a.createElement(d.a,{min:1,parser:se,defaultValue:i,onChange:function(e){i=e}}),y.a.createElement("span",{className:"ml5"},"分/题"))),okText:"确认",cancelText:"取消",onOk:(n=Object(h.a)(g.a.mark((function n(){var r,o;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i){n.next=3;break}return u.b.warn("分数不能为空或为0"),n.abrupt("return",Promise.reject());case 3:"COMBINATION"===e.type?(r={type:null==e?void 0:e.type,score:i,scoreTotal:i*(null==t?void 0:t.length)},B(r)):(o={type:null==e?void 0:e.type,score:i,scoreTotal:i*e.questions_count},B(o));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}(e)},type:"primary",ghost:!0,className:"mr20"},"设置得分"),y.a.createElement(s.a,{onClick:function(){return r=null===(n=(t=e).questions)||void 0===n?void 0:n.map((function(e){return e.id})),o=t.name,void(a=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换".concat(o,"中的所有试题吗?"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(i=Object(h.a)(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.update({cancelButtonProps:{disabled:!0}}),e.next=3,V({seleted_item_bank_ids:r},{type:t.type});case 3:a.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成".concat(o,"试题"));case 5:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})}));var t,n,i,r,o,a},type:"primary",ghost:!0},"随机更换"))),null==e||null===(i=e.questions)||void 0===i?void 0:i.map((function(t,n){return Z===t.id?y.a.createElement("div",{id:"Anchor_".concat(t.id),className:x.a.content,style:{padding:0,marginTop:10},key:t.id},y.a.createElement("div",{style:{float:"right",marginTop:-6}},y.a.createElement(s.a,{onClick:function(){return Q(null)},className:"mr20",type:"primary",ghost:!0},"取消"),y.a.createElement(s.a,{onClick:function(){return me(null==e?void 0:e.type,t)},type:"primary"},"保存")),function(e,t){if(console.log(e,222),"SINGLE"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(J,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("MULTIPLE"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(Y,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("JUDGMENT"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(U,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("COMPLETION"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(G,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("SUBJECTIVE"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(ee,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("COMBINATION"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(re,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));var n;"PROGRAM"===t&&E.d.push("/problems/".concat(null==e||null===(n=e.program_attr)||void 0===n?void 0:n.identifier,"/edit?type=exercises&express_id=").concat(ae.categoryId,"&question_id=").concat(null==e?void 0:e.id,"&score=").concat(null==e?void 0:e.score,"&callback_url=").concat(location.pathname,"&select=").concat(W,"&exercise=true"))}(t,e.type)):y.a.createElement("div",{id:"Anchor_".concat(t.id),className:x.a.content,key:t.id},y.a.createElement("div",{className:x.a.titleWrap},y.a.createElement(k.a,{style:{paddingRight:10},className:x.a.titleHtml,value:n+1+"、"+"".concat("combination"===(null==t?void 0:t.item_type)?"(题干)":"")+t.name}),F&&y.a.createElement(s.a,{disabled:ve,onClick:function(){Z?u.b.warn("先保存或取消当前正在编辑的试题"):Q(t.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"编辑"),y.a.createElement(s.a,{disabled:ve,onClick:function(){return function(e,t,n,i){var r,o,a=null===(r=i.questions)||void 0===r?void 0:r.map((function(e){return e.id})),s="default",c=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:y.a.createElement("div",null,y.a.createElement("p",null,"系统按以下规则为您更换该试题"),y.a.createElement("div",null,y.a.createElement("span",null,"使用频度:"),y.a.createElement(l.a.Group,{defaultValue:s,onChange:function(e){s=e.target.value}},y.a.createElement(l.a,{value:"default"},"不设定"),y.a.createElement(l.a,{value:"high"},"使用次数高"),y.a.createElement(l.a,{value:"low"},"使用次数低")))),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(o=Object(h.a)(g.a.mark((function i(){return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return c.update({cancelButtonProps:{disabled:!0}}),i.next=3,V({single_question_id:e,seleted_item_bank_ids:a,type:s},{type:t,index:n});case 3:c.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成试题");case 5:case"end":return i.stop()}}),i)}))),function(){return o.apply(this,arguments)})})}(t.id,e.type,n,e)},type:"primary",ghost:!0},"换一题")),("SINGLE"===e.type||"JUDGMENT"===e.type||"MULTIPLE"===e.type)&&(c=t,f=[],y.a.createElement(y.a.Fragment,null,y.a.createElement("aside",{className:x.a.single},null==c||null===(d=c.choices)||void 0===d?void 0:d.map((function(e,t){return e.is_answer&&f.push(he[t]),y.a.createElement("ul",{key:t},y.a.createElement("li",null,he[t],"、"),y.a.createElement("li",null,y.a.createElement(k.a,{value:e.choice_text})))}))),y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",f.join(""),y.a.createElement("span",{className:"ml30"},"难度:",ce[c.difficulty])),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:c.analysis?c.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==c?void 0:c.discipline_name,"/").concat(null==c?void 0:c.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==c?void 0:c.tag_discipline_name))))),"COMPLETION"===e.type&&function(e){var t,n=null==e||null===(t=e.standard_answer)||void 0===t?void 0:t.map((function(e){var t;return"答案(填空".concat(e.position,"").concat(null==e||null===(t=e.answer_text)||void 0===t?void 0:t.join("、"))}));return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",n),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==e?void 0:e.discipline_name,"/").concat(null==e?void 0:e.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name))))}(t),"SUBJECTIVE"===e.type&&ue(t),"FILEUPLOAD"===e.type&&ue(t),"PHOTOGRAPH"===e.type&&ue(t),"PROGRAM"===e.type&&function(e){var t;return y.a.createElement("div",{className:x.a.analysis},y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"预期输出:"),y.a.createElement(k.a,{value:null==e||null===(t=e.program_attr)||void 0===t?void 0:t.description})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==e?void 0:e.discipline_name,"/").concat(null==e?void 0:e.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name)))}(t),"COMBINATION"===e.type&&(i=t,r=n,y.a.createElement("div",null,null==i||null===(a=i.sub_item_banks)||void 0===a?void 0:a.map((function(e,t){var n,o=[];return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},r+1+"."+(t+1),"(单选题)",e.name),y.a.createElement("aside",{className:x.a.single},null==e||null===(n=e.choices)||void 0===n?void 0:n.map((function(e,t){return e.is_answer&&o.push(he[t]),y.a.createElement("ul",{key:t},y.a.createElement("li",null,he[t],"、"),y.a.createElement("li",null,y.a.createElement(k.a,{value:e.choice_text})))}))),y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",o.join(""),y.a.createElement("span",{className:"ml30"},"难度:",ce[e.difficulty])),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==i?void 0:i.discipline_name,"/").concat(null==i?void 0:i.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==i?void 0:i.tag_discipline_name))))})))),y.a.createElement("div",null));var i,r,a,c,d,f})))}))),y.a.createElement("div",{className:x.a.btnsElse,id:"preview_btns_else"},F?fe():pe()),y.a.createElement("div",{className:x.a.btnsWrap,id:"preview_btns"},y.a.createElement("div",{className:x.a.btns},F?fe():pe()))))}},sboe:
/*!*************************************************!*\
!*** ./node_modules/rc-tree/es/contextTypes.js ***!
\*************************************************/
/*! exports provided: TreeContext */
/*! exports used: TreeContext */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! react */"q1tI"),r=i.createContext(null)},tmPe:
/*!***************************************************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/CustomTree/index.less?modules ***!
\***************************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___ivyUy",flex_space_between:"flex_space_between___1h8Qq",flex_box_vertical_center:"flex_box_vertical_center___3eC95",flex_box_center_end:"flex_box_center_end___nrhvX",flex_box_column:"flex_box_column___2po4_",customTree:"customTree___1LpRW",name:"name___17ZTs"}},vHTk:
/*!******************************************************!*\
!*** ./src/components/PreviewAll/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:
/*!*********************************************!*\
!*** ./node_modules/qr.js/lib/BitBuffer.js ***!
\*********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){function n(){this.buffer=new Array,this.length=0}n.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=n}}]);