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__Pr...

414 lines
438 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([[177,7,8],{"+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 r(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function i(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 a={};function o(e,t){e.f=t}function l(e,t){var i;if(e.match(/^\\[a-zA-Z@]+/)){var l=e.current().slice(1);return n(t,i=new(i=a.hasOwnProperty(l)?a[l]:a.DEFAULT)),o(t,c),i.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return o(t,(function(e,t){return s(e,t,"\\]")})),"keyword";if(e.match("\\("))return o(t,(function(e,t){return s(e,t,"\\)")})),"keyword";if(e.match("$$"))return o(t,(function(e,t){return s(e,t,"$$")})),"keyword";if(e.match("$"))return o(t,(function(e,t){return s(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(i=r(t))?(i.closeBracket(u),o(t,c),"bracket"):"error":"{"==u||"["==u?(n(t,i=new(i=a.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(i=function(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var r=t[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}(t)).name&&(i.argument=e.current()),i.styleIdentifier())}function s(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return o(t,l),"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 r=e.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(e.skipToEnd(),"comment"):"error"}function c(e,t){var n=e.peek();return"{"==n||"["==n?(r(t).openBracket(n),e.eat(n),o(t,l),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(o(t,l),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),l(e,t))}return a.importmodule=i("importmodule","tag",["string","builtin"]),a.documentclass=i("documentclass","tag",["","atom"]),a.usepackage=i("usepackage","tag",["atom"]),a.begin=i("begin","tag",["atom"]),a.end=i("end","tag",["atom"]),a.label=i("label","tag",["atom"]),a.ref=i("ref","tag",["atom"]),a.eqref=i("eqref","tag",["atom"]),a.cite=i("cite","tag",["atom"]),a.bibitem=i("bibitem","tag",["atom"]),a.Bibitem=i("Bibitem","tag",["atom"]),a.RBibitem=i("RBibitem","tag",["atom"]),a.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 s(e,t)}:l}},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=l,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(n(/*! ../../lib/codemirror */"VrN/"))},"+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 r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){a(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=a(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function a(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(a,o,l){var s=l&&l!=e.Init;if(o&&!s)a.on("blur",r),a.on("change",i),a.on("swapDoc",i),e.on(a.getInputField(),"compositionupdate",a.state.placeholderCompose=function(){!function(e){setTimeout((function(){var r=!1,i=e.getInputField();"TEXTAREA"==i.nodeName?r=!i.value:1==e.lineCount()&&(r=!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)),r?n(e):t(e)}),20)}(a)}),i(a);else if(!o&&s){a.off("blur",r),a.off("change",i),a.off("swapDoc",i),e.off(a.getInputField(),"compositionupdate",a.state.placeholderCompose),t(a);var c=a.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}o&&!a.hasFocus()&&r(a)}))}(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(r,i){var a,o,l=r.indentUnit,s={},c=i.htmlMode?t:n;for(var u in c)s[u]=c[u];for(var u in i)s[u]=i[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?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,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){if(1==t){r.tokenize=d;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(a=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(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 f(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,a=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return a="equals",null;if("<"==i){t.tokenize=d,t.state=v,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(s.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,!s.contextGrabbers.hasOwnProperty(n)||!s.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),b):"closeTag"==e?y:v}function b(e,t,n){return"word"==e?(n.tagName=t.current(),o="tag",k):s.allowMissingTagName&&"endTag"==e?(o="tag bracket",k(e,0,n)):(o="error",b)}function y(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&s.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r||!1===s.matchClosing?(o="tag",x):(o="tag error",w)}return s.allowMissingTagName&&"endTag"==e?(o="tag bracket",x(e,0,n)):(o="error",w)}function x(e,t,n){return"endTag"!=e?(o="error",x):(m(n),v)}function w(e,t,n){return o="error",x(e,0,n)}function k(e,t,n){if("word"==e)return o="attribute",C;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new h(n,r,i==n.indented)),v}return o="error",k}function C(e,t,n){return"equals"==e?S:(s.allowMissing||(o="error"),k(e,0,n))}function S(e,t,n){return"string"==e?E:"word"==e&&s.allowUnquoted?(o="string",k):(o="error",k(e,0,n))}function E(e,t,n){return"string"==e?E:k(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,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;a=null;var n=t.tokenize(e,t);return(n||a)&&"comment"!=n&&(o=null,t.state=t.state(a||n,e,t),o&&(n="error"==o?n+" error":o)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;i;){if(i.tagName==a[2]){i=i.prev;break}if(!s.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(a)for(;i;){var o=s.contextGrabbers[i.tagName];if(!o||!o.hasOwnProperty(a[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=k)},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/"))},"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 r=n("wx14"),i=n("rePB"),a=n("VTBJ"),o=n("1OyB"),l=n("vuIU"),s=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),d=n.n(u),f=n("TSYQ"),p=n.n(f),h=function(e){var t,n="".concat(e.rootPrefixCls,"-item"),r=p()(n,"".concat(n,"-").concat(e.page),(t={},Object(i.a)(t,"".concat(n,"-active"),e.active),Object(i.a)(t,e.className,!!e.className),Object(i.a)(t,"".concat(n,"-disabled"),!e.page),t));return d.a.createElement("li",{title:e.showTitle?e.page:null,className:r,onClick:function(){e.onClick(e.page)},onKeyPress:function(t){e.onKeyPress(t,e.onClick,e.page)},tabIndex:"0"},e.itemRender(e.page,"page",d.a.createElement("a",{rel:"nofollow"},e.page)))},m=13,g=38,v=40,b=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;Object(o.a)(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).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,r=n.goButton,i=n.quickGo,a=n.rootPrefixCls,o=e.state.goInputText;r||""===o||t.relatedTarget&&(t.relatedTarget.className.indexOf("".concat(a,"-prev"))>=0||t.relatedTarget.className.indexOf("".concat(a,"-next"))>=0)||(e.setState({goInputText:""}),i(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(l.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,r=t.locale,i=t.rootPrefixCls,a=t.changeSize,o=t.quickGo,l=t.goButton,s=t.selectComponentClass,c=t.buildOptionText,u=t.selectPrefixCls,f=t.disabled,p=this.state.goInputText,h="".concat(i,"-options"),m=s,g=null,v=null,b=null;if(!a&&!o)return null;var y=this.getPageSizeOptions();if(a&&m){var x=y.map((function(t,n){return d.a.createElement(m.Option,{key:n,value:t.toString()},(c||e.buildOptionText)(t))}));g=d.a.createElement(m,{disabled:f,prefixCls:u,showSearch:!1,className:"".concat(h,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||y[0]).toString(),onChange:this.changeSize,getPopupContainer:function(e){return e.parentNode}},x)}return o&&(l&&(b="boolean"==typeof l?d.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:f,className:"".concat(h,"-quick-jumper-button")},r.jump_to_confirm):d.a.createElement("span",{onClick:this.go,onKeyUp:this.go},l)),v=d.a.createElement("div",{className:"".concat(h,"-quick-jumper")},r.jump_to,d.a.createElement("input",{disabled:f,type:"text",value:p,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),r.page,b)),d.a.createElement("li",{className:"".concat(h)},g,v)}}]),n}(d.a.Component);b.defaultProps={pageSizeOptions:["10","20","50","100"]};var y=b,x=n("N2Kk");function w(){}function k(e,t,n){var r=void 0===e?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var C=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(o.a)(this,n),(r=t.call(this,e)).getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(k(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(e,t){var n=r.props.prefixCls,i=e||d.a.createElement("button",{type:"button","aria-label":t,className:"".concat(n,"-item-link")});return"function"==typeof e&&(i=d.a.createElement(e,Object(a.a)({},r.props))),i},r.savePaginationNode=function(e){r.paginationNode=e},r.isValid=function(e){return"number"==typeof(t=e)&&isFinite(t)&&Math.floor(t)===t&&e!==r.state.current;var t},r.shouldDisplayQuickJumper=function(){var e=r.props,t=e.showQuickJumper,n=e.pageSize;return!(e.total<=n)&&t},r.handleKeyDown=function(e){e.keyCode!==g&&e.keyCode!==v||e.preventDefault()},r.handleKeyUp=function(e){var t=r.getValidValue(e);t!==r.state.currentInputValue&&r.setState({currentInputValue:t}),e.keyCode===m?r.handleChange(t):e.keyCode===g?r.handleChange(t-1):e.keyCode===v&&r.handleChange(t+1)},r.changePageSize=function(e){var t=r.state.current,n=k(e,r.state,r.props);t=t>n?n:t,0===n&&(t=r.state.current),"number"==typeof e&&("pageSize"in r.props||r.setState({pageSize:e}),"current"in r.props||r.setState({current:t,currentInputValue:t})),r.props.onShowSizeChange(t,e),"onChange"in r.props&&r.props.onChange&&r.props.onChange(t,e)},r.handleChange=function(e){var t=r.props.disabled,n=e;if(r.isValid(n)&&!t){var i=k(void 0,r.state,r.props);n>i?n=i:n<1&&(n=1),"current"in r.props||r.setState({current:n,currentInputValue:n});var a=r.state.pageSize;return r.props.onChange(n,a),n}return r.state.current},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current<k(void 0,r.state,r.props)},r.runIfEnter=function(e,t){if("Enter"===e.key||13===e.charCode){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];t.apply(void 0,r)}},r.runIfEnterPrev=function(e){r.runIfEnter(e,r.prev)},r.runIfEnterNext=function(e){r.runIfEnter(e,r.next)},r.runIfEnterJumpPrev=function(e){r.runIfEnter(e,r.jumpPrev)},r.runIfEnterJumpNext=function(e){r.runIfEnter(e,r.jumpNext)},r.handleGoTO=function(e){e.keyCode!==m&&"click"!==e.type||r.handleChange(r.state.currentInputValue)};var i=e.onChange!==w;"current"in e&&!i&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var l=e.defaultCurrent;"current"in e&&(l=e.current);var s=e.defaultPageSize;return"pageSize"in e&&(s=e.pageSize),l=Math.min(l,k(s,void 0,e)),r.state={current:l,currentInputValue:l,pageSize:s},r}return Object(l.a)(n,[{key:"componentDidUpdate",value:function(e,t){var n=this.props.prefixCls;if(t.current!==this.state.current&&this.paginationNode){var r=this.paginationNode.querySelector(".".concat(n,"-item-").concat(t.current));r&&document.activeElement===r&&r.blur()}}},{key:"getValidValue",value:function(e){var t=e.target.value,n=k(void 0,this.state,this.props),r=this.state.currentInputValue;return""===t?t:isNaN(Number(t))?r:t>=n?n:Number(t)}},{key:"getShowSizeChanger",value:function(){var e=this.props,t=e.showSizeChanger,n=e.total,r=e.totalBoundaryShowSizeChanger;return void 0!==t?t:n>r}},{key:"renderPrev",value:function(e){var t=this.props,n=t.prevIcon,r=(0,t.itemRender)(e,"prev",this.getItemIcon(n,"prev page")),i=!this.hasPrev();return Object(u.isValidElement)(r)?Object(u.cloneElement)(r,{disabled:i}):r}},{key:"renderNext",value:function(e){var t=this.props,n=t.nextIcon,r=(0,t.itemRender)(e,"next",this.getItemIcon(n,"next page")),i=!this.hasNext();return Object(u.isValidElement)(r)?Object(u.cloneElement)(r,{disabled:i}):r}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,a=t.className,o=t.style,l=t.disabled,s=t.hideOnSinglePage,c=t.total,f=t.locale,m=t.showQuickJumper,g=t.showLessItems,v=t.showTitle,b=t.showTotal,x=t.simple,w=t.itemRender,C=t.showPrevNextJumpers,S=t.jumpPrevIcon,E=t.jumpNextIcon,O=t.selectComponentClass,N=t.selectPrefixCls,T=t.pageSizeOptions,_=this.state,L=_.current,j=_.pageSize,A=_.currentInputValue;if(!0===s&&c<=j)return null;var M=k(void 0,this.state,this.props),D=[],I=null,P=null,F=null,R=null,z=null,B=m&&m.goButton,W=g?1:2,q=L-1>0?L-1:0,H=L+1<M?L+1:M,V=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 B&&(z="boolean"==typeof B?d.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},f.jump_to_confirm):d.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},B),z=d.a.createElement("li",{title:v?"".concat(f.jump_to).concat(L,"/").concat(M):null,className:"".concat(n,"-simple-pager")},z)),d.a.createElement("ul",Object(r.a)({className:p()(n,"".concat(n,"-simple"),Object(i.a)({},"".concat(n,"-disabled"),l),a),style:o,ref:this.savePaginationNode},V),d.a.createElement("li",{title:v?f.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(n,"-prev"),Object(i.a)({},"".concat(n,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(q)),d.a.createElement("li",{title:v?"".concat(L,"/").concat(M):null,className:"".concat(n,"-simple-pager")},d.a.createElement("input",{type:"text",value:A,disabled:l,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),d.a.createElement("span",{className:"".concat(n,"-slash")},"/"),M),d.a.createElement("li",{title:v?f.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(n,"-next"),Object(i.a)({},"".concat(n,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(H)),z);if(M<=3+2*W){var U={locale:f,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:v,itemRender:w};M||D.push(d.a.createElement(h,Object(r.a)({},U,{key:"noPager",page:M,className:"".concat(n,"-disabled")})));for(var $=1;$<=M;$+=1){var K=L===$;D.push(d.a.createElement(h,Object(r.a)({},U,{key:$,page:$,active:K})))}}else{var G=g?f.prev_3:f.prev_5,J=g?f.next_3:f.next_5;C&&(I=d.a.createElement("li",{title:v?G:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(n,"-jump-prev"),Object(i.a)({},"".concat(n,"-jump-prev-custom-icon"),!!S))},w(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),P=d.a.createElement("li",{title:v?J:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(n,"-jump-next"),Object(i.a)({},"".concat(n,"-jump-next-custom-icon"),!!E))},w(this.getJumpNextPage(),"jump-next",this.getItemIcon(E,"next page")))),R=d.a.createElement(h,{locale:f,last:!0,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:M,page:M,active:!1,showTitle:v,itemRender:w}),F=d.a.createElement(h,{locale:f,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:v,itemRender:w});var Z=Math.max(1,L-W),X=Math.min(L+W,M);L-1<=W&&(X=1+2*W),M-L<=W&&(Z=M-2*W);for(var Y=Z;Y<=X;Y+=1){var Q=L===Y;D.push(d.a.createElement(h,{locale:f,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Y,page:Y,active:Q,showTitle:v,itemRender:w}))}L-1>=2*W&&3!==L&&(D[0]=Object(u.cloneElement)(D[0],{className:"".concat(n,"-item-after-jump-prev")}),D.unshift(I)),M-L>=2*W&&L!==M-2&&(D[D.length-1]=Object(u.cloneElement)(D[D.length-1],{className:"".concat(n,"-item-before-jump-next")}),D.push(P)),1!==Z&&D.unshift(F),X!==M&&D.push(R)}var ee=null;b&&(ee=d.a.createElement("li",{className:"".concat(n,"-total-text")},b(c,[0===c?0:(L-1)*j+1,L*j>c?c:L*j])));var te=!this.hasPrev()||!M,ne=!this.hasNext()||!M;return d.a.createElement("ul",Object(r.a)({className:p()(n,a,Object(i.a)({},"".concat(n,"-disabled"),l)),style:o,unselectable:"unselectable",ref:this.savePaginationNode},V),ee,d.a.createElement("li",{title:v?f.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(n,"-prev"),Object(i.a)({},"".concat(n,"-disabled"),te)),"aria-disabled":te},this.renderPrev(q)),D,d.a.createElement("li",{title:v?f.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(n,"-next"),Object(i.a)({},"".concat(n,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(H)),d.a.createElement(y,{disabled:l,locale:f,rootPrefixCls:n,selectComponentClass:O,selectPrefixCls:N,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:L,pageSize:j,pageSizeOptions:T,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:B}))}}],[{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 r=t.current,i=k(e.pageSize,t,e);r=r>i?i:r,"current"in e||(n.current=r,n.currentInputValue=r),n.pageSize=e.pageSize}return n}}]),n}(d.a.Component);C.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:w,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:w,locale:x.a,style:{},itemRender:function(e,t,n){return n},totalBoundaryShowSizeChanger:50};var S=C},"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"},"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 r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),a=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),o=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),l=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),c=n(/*! react */"q1tI"),u=n.n(c),d=n(/*! codemirror */"VrN/"),f=n.n(d),p=(n(/*! codemirror/lib/codemirror.css */"p77/"),n(/*! codemirror/theme/blackboard.css */"c5Ni"),s.a.Option),h={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,i=e.mode,a=e.options,o=void 0===a?{}:a,s=Object(c.useRef)(),d=Object(c.useState)(),p=Object(l.a)(d,2),h=p[0],m=p[1];return Object(c.useEffect)((function(){if(h){function e(e){var t=e.getValue();n&&n(t)}return h.on("change",e),function(){h.off("change",e)}}}),[h,n]),Object(c.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),Object(c.useEffect)((function(){h&&(t===h.getValue()&&""!==t||setTimeout((function(){h.setValue(t||" ")}),300))}),[h,t]),Object(c.useEffect)((function(){if(s.current&&!h){var e=f.a.fromTextArea(s.current,Object(r.a)({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},o));m(e)}}),[s.current,h]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:s}))}t.b=function(e){var t=e.callback,n=e.onCancel,r=Object(c.useState)("python"),d=Object(l.a)(r,2),f=d[0],v=d[1];return u.a.createElement(o.a,Object(i.a)({},h,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),u.a.createElement(o.a.Item,{label:"代码语言",name:"language"},u.a.createElement(s.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(o.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(g,{mode:f})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(a.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(a.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 a}));var r={adjustX:1,adjustY:1},i=[0,0],a={left:{points:["cr","cl"],overflow:r,offset:[-4,0],targetOffset:i},right:{points:["cl","cr"],overflow:r,offset:[4,0],targetOffset:i},top:{points:["bc","tc"],overflow:r,offset:[0,-4],targetOffset:i},bottom:{points:["tc","bc"],overflow:r,offset:[0,4],targetOffset:i},topLeft:{points:["bl","tl"],overflow:r,offset:[0,-4],targetOffset:i},leftTop:{points:["tr","tl"],overflow:r,offset:[-4,0],targetOffset:i},topRight:{points:["br","tr"],overflow:r,offset:[0,-4],targetOffset:i},rightTop:{points:["tl","tr"],overflow:r,offset:[4,0],targetOffset:i},bottomRight:{points:["tr","br"],overflow:r,offset:[0,4],targetOffset:i},rightBottom:{points:["bl","br"],overflow:r,offset:[4,0],targetOffset:i},bottomLeft:{points:["tl","bl"],overflow:r,offset:[0,4],targetOffset:i},leftBottom:{points:["br","bl"],overflow:r,offset:[-4,0],targetOffset:i}}},"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 r=n(/*! antd/es/tooltip */"3S7+"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),a=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"),l=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),s=(n(/*! antd/es/input/style */"5NDa"),n(/*! antd/es/input */"5rEg")),c=n(/*! react */"q1tI"),u=n.n(c),d=n(/*! ./index.less?modules */"O2Wb"),f=n.n(d),p=s.a.TextArea,h=function(e){Object(o.a)(n,e);var t=Object(l.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.index,i=t.onAnswerChange,a=t.addChildAnswer,o=t.exerciseIsPublish,l=t.answers,s=t.activeOptionErrorIndex,c=t.flex,d=void 0===c?"0 0 1000px":c;return u.a.createElement("div",{className:f.a.flex},u.a.createElement("div",{className:"".concat(f.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"答案(填空",n+1,"):"),u.a.createElement("div",{className:"".concat(f.a.flex," ").concat(f.a.flex1),style:{flexDirection:"column"}},l.map((function(t,c){var h="".concat(n,"-").concat(c);return u.a.createElement("div",{className:"".concat(f.a.flex," ").concat(f.a.flex1),key:c},u.a.createElement("div",{className:f.a.flex1,style:{flex:d}},u.a.createElement("div",null,u.a.createElement(p,{className:h===s?f.a.error:"",spellCheck:!1,rows:4,value:t||"",defaultValue:"请输入参考答案".concat(0==c?"":"(可选)"),onChange:function(e){return i(n,c,e.target.value)},style:{minHeight:95}}))),!o&&u.a.createElement(u.a.Fragment,null,0!=c&&u.a.createElement(r.a,{title:"删除"},u.a.createElement("i",{className:"".concat(f.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return e.props.deleteChildAnswer(n,c)},style:{float:"right"}})),0===c&&u.a.createElement(r.a,{title:"删除"},u.a.createElement("i",{className:"".concat(f.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return e.props.deleteChildAnswermain(n,c)},style:{float:"right"}})),u.a.createElement(r.a,{title:"新增参考答案"},u.a.createElement("i",{className:"".concat(f.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return a(n)},style:{float:"right",visibility:c==l.length-1?"":"hidden"}}))))}))))}}]),n}(c.Component);t.a=h},"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 r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}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 r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),a=i>-1&&t.substring(i+1,t.length);if(a)return e.findModeByExtension(a)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}(n(/*! ../lib/codemirror */"VrN/"))},"9Bee":
/*!*********************************************************!*\
!*** ./src/components/RenderHtml/index.tsx + 1 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! 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 ./src/components/PreviewAll/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! 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";var r=n("k1fw"),i=n("tJVT"),a=n("q1tI"),o=n.n(a),l=(n("vg9a"),n("DlQD")),s=n.n(l),c=n("rUJ1");var u=[],d=["<ul>"],f=new s.a.Renderer,p=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function h(){u.length=0,d=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(){return function e(t,n,r,i){if(n>=t.length||t[n].level<=r)return n;var a=t[n];i.push("<li><a href='#"+a.anchor+"'>"+a.text+"</a>");var o=[];return n=e(t,++n,a.level,o),o.length>0&&(i.push("<ul>"),o.forEach((function(e){i.push(e)})),i.push("</ul>")),i.push("</li>"),n=e(t,n,r,i)}(u,0,0,d),d.push("</ul>"),d.join("")}var v={heading:function(e){var t=p.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],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(i.a)(t,1)[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||""),a=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(a)>=0){var o=x(),l=r;r=o,w[o]={type:"block",expression:l}}return{type:"code",raw:n,lang:a,text:r}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,x=function(){return"__special_katext_id_".concat(y++,"__")},w={};function k(){y=0,w={}}function C(e){return e=e.replace(b,(function(e,t){var n=x();return w[n]={type:"inline",expression:t},n}))}var S=f.listitem;f.listitem=function(e){return S(C(e))};var E=f.paragraph;f.paragraph=function(e){return E(C(e))};var O=f.tablecell;f.tablecell=function(e,t){return O(C(e),t)},f.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:Object(c.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:Object(c.escape)(e,!0))+"</code></pre>"},f.heading=function(e,t,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},s.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),s.a.use({tokenizer:v,renderer:f});var N=s.a,T=(n("SJMd"),n("ulZh")),_=n.n(T),L=n("m3rI"),j=n("Oy/b"),A=n("p5ED"),M=/<pre[^>]*>/g;t.a=function(e){var t=e.value,n=void 0===t?"":t,l=e.className,s=e.showTextOnly,c=e.showLines,u=e.style,d=void 0===u?{}:u,f=e.stylesPrev,p=void 0===f?{}:f,v=String(n),b=Object(a.useState)(""),y=Object(i.a)(b,2),x=y[0],C=y[1],S=Object(a.useMemo)((function(){try{v=(v=v.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+L.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+L.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+L.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=N(v),t=w;if(v.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",g()),h()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,n){var r=t[n],i=r.type,a=r.expression;return Object(j.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(a)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),k(),s){var n=document.createElement("div");return n.innerHTML=e,n.innerText}return setTimeout((function(){return T()}),500),e}),[v]),E=Object(a.useRef)();function O(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),C(n);else if(n.startsWith("#")){e.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}m.WebkitLineClamp=c,c&&(d=Object(r.a)(Object(r.a)({},d),m));var T=function(){var e,t=null===(e=E.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(_.a.isSupported()){var t=new _.a;t.loadSource(e.src),t.attachMedia(e)}}))};return Object(a.useEffect)((function(){if(E.current&&S&&S.match(M)&&window.PR.prettyPrint(),E.current)return E.current.addEventListener("click",O),function(){E.current.removeEventListener("click",O),k(),h()}}),[S,E.current,O]),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{ref:E,style:Object(r.a)({},d),className:"".concat(l||""," markdown-body "),dangerouslySetInnerHTML:{__html:S}}),o.a.createElement(A.a,{close:!0,data:x,type:null!=x&&x.length?"office":"",style:Object(r.a)({},p),onClose:function(){return C("")}}))}},"9VGf":
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(/*! react */"q1tI");function i(e,t){var n=Object(r.useRef)();Object(r.useEffect)((function(){n.current=e})),Object(r.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},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(o,l,s){if(s!=e.Init&&s&&o.removeKeyMap("autoCloseTags"),l){var c={name:"autoCloseTags"};"object"==typeof l&&!1===l.whenClosing||(c["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}(t)}),"object"==typeof l&&!1===l.whenOpening||(c["'>'"]=function(r){return function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),l=[],s=r.getOption("autoCloseTags"),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var u=o[c].head,d=r.getTokenAt(u),f=e.innerMode(r.getMode(),d.state),p=f.state,h=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(p),m=h&&h.name;if(!m)return e.Pass;var g="html"==f.mode.configuration,v="object"==typeof s&&s.dontCloseTags||g&&t,b="object"==typeof s&&s.indentTags||g&&n;d.end>u.ch&&(m=m.slice(0,m.length-d.end+u.ch));var y=m.toLowerCase();if(!m||"string"==d.type&&(d.end!=u.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&h.close||d.string.indexOf("/")==u.ch-d.start-1||v&&i(v,y)>-1||a(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(p)||[],m,u,!0))return e.Pass;var x="object"==typeof s&&s.emptyTags;if(x&&i(x,m)>-1)l[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var w=b&&i(b,y)>-1;l[c]={indent:w,text:">"+(w?"\n\n":"")+"</"+m+">",newPos:w?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var k="object"==typeof s&&s.dontIndentOnAutoClose;for(c=o.length-1;c>=0;c--){var C=l[c];r.replaceRange(C.text,o[c].head,o[c].anchor,"+insert");var S=r.listSelections().slice(0);S[c]={head:C.newPos,anchor:C.newPos},r.setSelections(S),!k&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}(r)}),o.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 r(t,n){for(var r=t.listSelections(),i=[],o=n?"/":"</",l=t.getOption("autoCloseTags"),s="object"==typeof l&&l.dontIndentOnSlash,c=0;c<r.length;c++){if(!r[c].empty())return e.Pass;var u=r[c].head,d=t.getTokenAt(u),f=e.innerMode(t.getMode(),d.state),p=f.state;if(n&&("string"==d.type||"<"!=d.string.charAt(0)||d.start!=u.ch-1))return e.Pass;var h,m="xml"!=f.mode.name&&"htmlmixed"==t.getMode().name;if(m&&"javascript"==f.mode.name)h=o+"script";else if(m&&"css"==f.mode.name)h=o+"style";else{var g=f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(p);if(!g||g.length&&a(t,g,g[g.length-1],u))return e.Pass;h=o+g[g.length-1]}">"!=t.getLine(u.line).charAt(d.end)&&(h+=">"),i[c]=h}if(t.replaceSelections(i),r=t.listSelections(),!s)for(c=0;c<r.length;c++)(c==r.length-1||r[c].head.line<r[c+1].head.line)&&t.indentLine(r[c].head.line)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function a(t,n,r,i,a){if(!e.scanForClosingTag)return!1;var o=Math.min(t.lastLine()+1,i.line+500),l=e.scanForClosingTag(t,i,null,o);if(!l||l.tag!=r)return!1;for(var s=a?1:0,c=n.length-1;c>=0&&n[c]==r;c--)++s;for(i=l.to,c=1;c<s;c++){var u=e.scanForClosingTag(t,i,null,o);if(!u||u.tag!=r)return!1;i=u.to}return!0}e.commands.closeTag=function(e){return r(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 r(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 i(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],r=0;r<e.length;r++){var i=e[r],a=t?"".concat(t,"/").concat(i.name):"".concat(i.name);n.push({title:i.name,isLeaf:"tree"!==i.type,key:a})}return n}function a(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.key===t){i.children=n;break}i.children&&a(i.children,t,n)}return e}function o(e,t,n){var r;return function(){var i=this,a=arguments,o=function(){r=null,n||e.apply(i,a)},l=n&&!r;clearTimeout(r),r=setTimeout(o,t),l&&e.apply(i,a)}}n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return l}));var l=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){},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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}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(r=e[Symbol.iterator]()).next.bind(r)}var r=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}}})),i=(r.defaults,r.getDefaults,r.changeDefaults,/[&<>"']/),a=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=function(e){return s[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(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 f=/(^|[^\[])\^/g,p=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},g=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(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(b,"$1")+t:e+t}function x(e,t,n){var r=e.length;if(0===r)return"";for(var i=0;i<r;){var a=e.charAt(r-i-1);if(a!==t||n){if(a===t||!n)break;i++}else i++}return e.substr(0,r-i)}var w=function(e,t){if(t){if(i.test(e))return e.replace(a,c)}else if(o.test(e))return e.replace(l,c);return e},k=d,C=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,r){return r=(r=r.source||r).replace(f,"$1"),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n},S=function(e,t,n){if(e){var r;try{r=decodeURIComponent(d(n)).replace(p,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!h.test(n)&&(n=y(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},E={exec:function(){}},O=function(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},N=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var r=!1,i=t;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},T=x,_=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,r=0,i=0;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&--r<0)return i;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")},j=r.defaults,A=T,M=N,D=w,I=_;function P(e,t,n){var r=t.href,i=t.title?D(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:i,text:a}:{type:"image",raw:n,href:r,title:i,text:D(a)}}var F=function(){function e(e){this.options=e||j}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 r=t[t.length-1];if(r&&"paragraph"===r.type)return{raw:n[0],text:n[0].trimRight()};var i=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:A(i,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}},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:M(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 r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=M(n.cells[r],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,r,i,a,o,l,s,c=t[0],u=t[2],d=u.length>1,f=")"===u[u.length-1],p={type:"list",raw:c,ordered:d,start:d?+u.slice(0,-1):"",loose:!1,items:[]},h=t[0].match(this.rules.block.item),m=!1,g=h.length,v=0;v<g;v++)c=n=h[v],r=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) */,"")).indexOf("\n ")&&(r-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+r+"}","gm"),"")),v!==g-1&&(i=this.rules.block.bullet.exec(h[v+1])[0],(d?1===i.length||!f&&")"===i[i.length-1]:i.length>1||this.options.smartLists&&i!==u)&&(a=h.slice(v+1).join("\n"),p.raw=p.raw.substring(0,p.raw.length-a.length),v=g-1)),o=m||/\n\n(?!\s*$)/.test(n),v!==g-1&&(m="\n"===n.charAt(n.length-1),o||(o=m)),o&&(p.loose=!0),s=void 0,(l=/^\[[ xX]\] /.test(n))&&(s=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),p.items.push({type:"list_item",raw:c,task:l,checked:s,loose:o,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:M(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 r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=M(n.cells[r].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 r=t[t.length-1];return r&&"text"===r.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 r=this.rules.inline.tag.exec(e);if(r)return!t&&/^<a /i.test(r[0])?t=!0:t&&/^<\/a>/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=I(t[2],"()");if(n>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,r).trim(),t[3]=""}var i=t[2],a="";if(this.options.pedantic){var o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);o?(i=o[1],a=o[3]):a=""}else a=t[3]?t[3].slice(1,-1):"";return P(t,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:a?a.replace(this.rules.inline._escapes,"$1"):a},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 r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return P(n,r,n[0])}},t.strong=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,a="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(a.lastIndex=0;null!=(r=a.exec(t));)if(i=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,i[0].length),text:e.slice(2,i[0].length-2)}}},t.em=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,a="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(a.lastIndex=0;null!=(r=a.exec(t));)if(i=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,i[0].length),text:e.slice(1,i[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=n.startsWith(" ")&&n.endsWith(" ");return r&&i&&(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,r,i=this.rules.inline.autolink.exec(e);if(i)return r="@"===i[2]?"mailto:"+(n=D(this.options.mangle?t(i[1]):i[1])):n=D(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if("@"===n[2])i="mailto:"+(r=D(this.options.mangle?t(n[0]):n[0]));else{var a;do{a=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(a!==n[0]);r=D(n[0]),i="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}},t.inlineText=function(e,t,n){var r,i=this.rules.inline.text.exec(e);if(i)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]:D(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}},e}(),R=E,z=C,B=O,W={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:R,table:R,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?'|\([^()]*\))/};W.def=z(W.def).replace("label",W._label).replace("title",W._title).getRegex(),W.bullet=/(?:[*+-]|\d{1,9}[.)])/,W.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,W.item=z(W.item,"gm").replace(/bull/g,W.bullet).getRegex(),W.list=z(W.list).replace(/bull/g,W.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+W.def.source+")").getRegex(),W._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",W._comment=/<!--(?!-?>)[\s\S]*?-->/,W.html=z(W.html,"i").replace("comment",W._comment).replace("tag",W._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),W.paragraph=z(W._paragraph).replace("hr",W.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",W._tag).getRegex(),W.blockquote=z(W.blockquote).replace("paragraph",W.paragraph).getRegex(),W.normal=B({},W),W.gfm=B({},W.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*|$)"}),W.gfm.nptable=z(W.gfm.nptable).replace("hr",W.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",W._tag).getRegex(),W.gfm.table=z(W.gfm.table).replace("hr",W.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",W._tag).getRegex(),W.pedantic=B({},W.normal,{html:z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",W._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:R,paragraph:z(W.normal._paragraph).replace("hr",W.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",W.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:R,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:R,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};q.punctuation=z(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",q.em.start=z(q.em.start).replace(/punctuation/g,q._punctuation).getRegex(),q.em.middle=z(q.em.middle).replace(/punctuation/g,q._punctuation).replace(/overlapSkip/g,q._overlapSkip).getRegex(),q.em.endAst=z(q.em.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.em.endUnd=z(q.em.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.start=z(q.strong.start).replace(/punctuation/g,q._punctuation).getRegex(),q.strong.middle=z(q.strong.middle).replace(/punctuation/g,q._punctuation).replace(/blockSkip/g,q._blockSkip).getRegex(),q.strong.endAst=z(q.strong.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.endUnd=z(q.strong.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=z(q._blockSkip,"g").getRegex(),q.overlapSkip=z(q._overlapSkip,"g").getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=z(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=z(q.tag).replace("comment",W._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=z(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=z(q.reflink).replace("label",q._label).getRegex(),q.reflinkSearch=z(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=B({},q),q.pedantic=B({},q.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",q._label).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=B({},q.normal,{escape:z(q.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),q.gfm.url=z(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=B({},q.gfm,{br:z(q.br).replace("{2,}","*").getRegex(),text:z(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var H={block:W,inline:q},V=r.defaults,U=H.block,$=H.inline;function K(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 G(e){var t,n,r="",i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var J=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||V,this.options.tokenizer=this.options.tokenizer||new F,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:U.normal,inline:$.normal};this.options.pedantic?(t.block=U.pedantic,t.inline=$.pedantic):this.options.gfm&&(t.block=U.gfm,this.options.breaks?t.inline=$.breaks:t.inline=$.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)};var n,r,i,a=t.prototype;return a.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},a.blockTokens=function(e,t,n){var r,i,a,o;for(void 0===t&&(t=[]),void 0===n&&(n=!0),e=e.replace(/^ +$/gm,"");e;)if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((o=t[t.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),a=r.items.length,i=0;i<a;i++)r.items[i].tokens=this.blockTokens(r.items[i].text,[],!1);t.push(r)}else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(n&&(r=this.tokenizer.def(e)))e=e.substring(r.raw.length),this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else if(n&&(r=this.tokenizer.paragraph(e)))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.text(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((o=t[t.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(e){var l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}return t},a.inline=function(e){var t,n,r,i,a,o,l=e.length;for(t=0;t<l;t++)switch((o=e[t]).type){case"paragraph":case"text":case"heading":o.tokens=[],this.inlineTokens(o.text,o.tokens);break;case"table":for(o.tokens={header:[],cells:[]},i=o.header.length,n=0;n<i;n++)o.tokens.header[n]=[],this.inlineTokens(o.header[n],o.tokens.header[n]);for(i=o.cells.length,n=0;n<i;n++)for(a=o.cells[n],o.tokens.cells[n]=[],r=0;r<a.length;r++)o.tokens.cells[n][r]=[],this.inlineTokens(a[r],o.tokens.cells[n][r]);break;case"blockquote":this.inline(o.tokens);break;case"list":for(i=o.items.length,n=0;n<i;n++)this.inline(o.items[n].tokens)}return e},a.inlineTokens=function(e,t,n,r,i){var a;void 0===t&&(t=[]),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i="");var o,l=e;if(this.tokens.links){var s=Object.keys(this.tokens.links);if(s.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)s.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(a=this.tokenizer.escape(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.tag(e,n,r))e=e.substring(a.raw.length),n=a.inLink,r=a.inRawBlock,t.push(a);else if(a=this.tokenizer.link(e))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),t.push(a);else if(a=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),t.push(a);else if(a=this.tokenizer.strong(e,l,i))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.em(e,l,i))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.codespan(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.br(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.del(e))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.autolink(e,G))e=e.substring(a.raw.length),t.push(a);else if(n||!(a=this.tokenizer.url(e,G))){if(a=this.tokenizer.inlineText(e,r,K))e=e.substring(a.raw.length),i=a.raw.slice(-1),t.push(a);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(a.raw.length),t.push(a);return t},n=t,i=[{key:"rules",get:function(){return{block:U,inline:$}}}],(r=null)&&e(n.prototype,r),i&&e(n,i),t}(),Z=r.defaults,X=S,Y=w,Q=function(){function e(e){this.options=e||Z}var t=e.prototype;return t.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'<pre><code class="'+this.options.langPrefix+Y(r,!0)+'">'+(n?e:Y(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Y(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,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.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 r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\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=X(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+Y(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"},t.image=function(e,t,n){if(null===(e=X(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=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=r.defaults,re=k,ie=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,r,i,a,o,l,s,c,u,d,f,p,h,m,g,v,b,y,x="",w=e.length;for(n=0;n<w;n++)switch((d=e[n]).type){case"space":continue;case"hr":x+=this.renderer.hr();continue;case"heading":x+=this.renderer.heading(this.parseInline(d.tokens),d.depth,re(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":x+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",s="",a=d.header.length,r=0;r<a;r++)s+=this.renderer.tablecell(this.parseInline(d.tokens.header[r]),{header:!0,align:d.align[r]});for(c+=this.renderer.tablerow(s),u="",a=d.cells.length,r=0;r<a;r++){for(s="",o=(l=d.tokens.cells[r]).length,i=0;i<o;i++)s+=this.renderer.tablecell(this.parseInline(l[i]),{header:!1,align:d.align[i]});u+=this.renderer.tablerow(s)}x+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(d.tokens),x+=this.renderer.blockquote(u);continue;case"list":for(f=d.ordered,p=d.start,h=d.loose,a=d.items.length,u="",r=0;r<a;r++)v=(g=d.items[r]).checked,b=g.task,m="",g.task&&(y=this.renderer.checkbox(v),h?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=y+" "+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=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):m+=y),m+=this.parse(g.tokens,h),u+=this.renderer.listitem(m,b,v);x+=this.renderer.list(u,f,p);continue;case"html":x+=this.renderer.html(d.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(u=d.tokens?this.parseInline(d.tokens):d.text;n+1<w&&"text"===e[n+1].type;)u+="\n"+((d=e[++n]).tokens?this.parseInline(d.tokens):d.text);x+=t?this.renderer.paragraph(u):u;continue;default:var k='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void console.error(k);throw new Error(k)}return x},t.parseInline=function(e,t){t=t||this.renderer;var n,r,i="",a=e.length;for(n=0;n<a;n++)switch((r=e[n]).type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:var o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(o);throw new Error(o)}return i},e}(),ae=O,oe=L,le=w,se=r.getDefaults,ce=r.changeDefaults,ue=r.defaults;function de(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=ae({},de.defaults,t||{}),oe(t),n){var r,i=t.highlight;try{r=J.lex(e,t)}catch(e){return n(e)}var a=function(e){var a;if(!e)try{a=ie.parse(r,t)}catch(t){e=t}return t.highlight=i,e?n(e):n(null,a)};if(!i||i.length<3)return a();if(delete t.highlight,!r.length)return a();var o=0;return de.walkTokens(r,(function(e){"code"===e.type&&(o++,setTimeout((function(){i(e.text,e.lang,(function(t,n){if(t)return a(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--o&&a()}))}),0))})),void(0===o&&a())}try{var l=J.lex(e,t);return t.walkTokens&&de.walkTokens(l,t.walkTokens),ie.parse(l,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+le(e.message+"",!0)+"</pre>";throw e}}return de.options=de.setOptions=function(e){return ae(de.defaults,e),ce(de.defaults),de},de.getDefaults=se,de.defaults=ue,de.use=function(e){var t=ae({},e);if(e.renderer&&function(){var n=de.defaults.renderer||new Q,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var l=e.renderer[t].apply(n,a);return!1===l&&(l=r.apply(n,a)),l}};for(var i in e.renderer)r(i);t.renderer=n}(),e.tokenizer&&function(){var n=de.defaults.tokenizer||new F,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var l=e.tokenizer[t].apply(n,a);return!1===l&&(l=r.apply(n,a)),l}};for(var i in e.tokenizer)r(i);t.tokenizer=n}(),e.walkTokens){var n=de.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),n&&n(t)}}de.setOptions(t)},de.walkTokens=function(e,t){for(var r,i=n(e);!(r=i()).done;){var a=r.value;switch(t(a),a.type){case"table":for(var o,l=n(a.tokens.header);!(o=l()).done;){var s=o.value;de.walkTokens(s,t)}for(var c,u=n(a.tokens.cells);!(c=u()).done;)for(var d,f=n(c.value);!(d=f()).done;){var p=d.value;de.walkTokens(p,t)}break;case"list":de.walkTokens(a.items,t);break;default:a.tokens&&de.walkTokens(a.tokens,t)}}},de.Parser=ie,de.parser=ie.parse,de.Renderer=Q,de.TextRenderer=ee,de.Lexer=J,de.lexer=J.lex,de.Tokenizer=F,de.Slugger=te,de.parse=de,de}()},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 r(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,o){o&&o!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(a(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=l(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var a=r(i,"pairs"),o=t.listSelections(),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var u=s(t,o[c].head);if(!u||a.indexOf(u)%2!=0)return e.Pass}for(c=o.length-1;c>=0;c--){var d=o[c].head;t.replaceRange("",n(d.line,d.ch-1),n(d.line,d.ch+1),"+delete")}},Enter:function(t){var n=l(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var a=t.listSelections(),o=0;o<a.length;o++){if(!a[o].empty())return e.Pass;var c=s(t,a[o].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),a=t.listSelections();for(var n=0;n<a.length;n++){var r=a[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}};function a(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=o(n))}}function o(t){return function(i){return function(t,i){var a=l(t);if(!a||t.getOption("disableInput"))return e.Pass;var o=r(a,"pairs"),s=o.indexOf(i);if(-1==s)return e.Pass;for(var u,d=r(a,"closeBefore"),f=r(a,"triples"),p=o.charAt(s+1)==i,h=t.listSelections(),m=s%2==0,g=0;g<h.length;g++){var v,b=h[g],y=b.head,x=t.getRange(y,n(y.line,y.ch+1));if(m&&!b.empty())v="surround";else if(!p&&m||x!=i)if(p&&y.ch>1&&f.indexOf(i)>=0&&t.getRange(n(y.line,y.ch-2),y)==i+i){if(y.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(y.line,y.ch-2))))return e.Pass;v="addFour"}else if(p){var w=0==y.ch?" ":t.getRange(n(y.line,y.ch-1),y);if(e.isWordChar(x)||w==i||e.isWordChar(w))return e.Pass;v="both"}else{if(!m||!(0===x.length||/\s/.test(x)||d.indexOf(x)>-1))return e.Pass;v="both"}else v=p&&c(t,y)?"both":f.indexOf(i)>=0&&t.getRange(y,n(y.line,y.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=v)return e.Pass}else u=v}var k=s%2?o.charAt(s-1):i,C=s%2?i:o.charAt(s+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==u){var i=t.getSelections();for(r=0;r<i.length;r++)i[r]=k+i[r]+C;for(t.replaceSelections(i,"around"),i=t.listSelections().slice(),r=0;r<i.length;r++)i[r]=(a=i[r],o=void 0,o=e.cmpPos(a.anchor,a.head)>0,{anchor:new n(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new n(a.head.line,a.head.ch+(o?1:-1))});t.setSelections(i)}else"both"==u?(t.replaceSelection(k+C,null),t.triggerElectric(k+C),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(k+k+k+k,"before"),t.execCommand("goCharRight"));var a,o}))}(i,t)}}function l(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function s(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function c(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}a(t.pairs+"`")}(n(/*! ../../lib/codemirror */"VrN/"))},FIWC:
/*!**********************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/PreviewEdit/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___gdHkq",flex_space_between:"flex_space_between___lk_Gv",flex_box_vertical_center:"flex_box_vertical_center___2WNVo",flex_box_center_end:"flex_box_center_end___13O11",flex_box_column:"flex_box_column___kMb8L",wrap:"wrap___1y6rg",crumbs:"crumbs___1vKDo"}},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,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),s=0;s<a.length;s++){var c=a[s];if(!l(c))return!1;var u=e[c],d=t[c];if(!1===(i=n?n.call(r,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},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){},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 w})),n.d(t,"a",(function(){return C}));var r=n("1OyB"),i=n("vuIU"),a=n("Ji7U"),o=n("LK+K"),l=n("q1tI"),s=n("rePB"),c=n("Ff2n"),u=n("ODXe"),d=n("4IlW"),f=n("bX4T"),p=n("YrtM"),h=n("TSYQ"),m=n.n(h),g=n("+nKL"),v=n("8OUc"),b=l.forwardRef((function(e,t){var n=e.prefixCls,r=e.id,i=e.flattenOptions,a=e.childrenAsData,o=e.values,h=e.searchValue,b=e.multiple,y=e.defaultActiveFirstOption,x=e.height,w=e.itemHeight,k=e.notFoundContent,C=e.open,S=e.menuItemSelectedIcon,E=e.virtual,O=e.onSelect,N=e.onToggleOpen,T=e.onActiveValue,_=e.onScroll,L=e.onMouseEnter,j="".concat(n,"-item"),A=Object(p.a)((function(){return i}),[C,i],(function(e,t){return t[0]&&e[1]!==t[1]})),M=l.useRef(null),D=function(e){e.preventDefault()},I=function(e){M.current&&M.current.scrollTo({index:e})},P=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=A.length,r=0;r<n;r+=1){var i=(e+r*t+n)%n,a=A[i],o=a.group,l=a.data;if(!o&&!l.disabled)return i}return-1},F=l.useState((function(){return P(0)})),R=Object(u.a)(F,2),z=R[0],B=R[1],W=function(e){B(e);var t=A[e];t?T(t.data.value,e):T(null,-1)};l.useEffect((function(){W(!1!==y?P(0):-1)}),[A.length,h]),l.useEffect((function(){var e=setTimeout((function(){if(!b&&C&&1===o.size){var e=Array.from(o)[0],t=A.findIndex((function(t){return t.data.value===e}));W(t),I(t)}}));return function(){return clearTimeout(e)}}),[C]);var q=function(e){void 0!==e&&O(e,{selected:!o.has(e)}),b||N(!1)};if(l.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case d.a.UP:case d.a.DOWN:var n=0;if(t===d.a.UP?n=-1:t===d.a.DOWN&&(n=1),0!==n){var r=P(z+n,n);I(r),W(r)}break;case d.a.ENTER:var i=A[z];i&&!i.data.disabled?q(i.data.value):q(void 0),C&&e.preventDefault();break;case d.a.ESC:N(!1)}},onKeyUp:function(){},scrollTo:function(e){I(e)}}})),0===A.length)return l.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(j,"-empty"),onMouseDown:D},k);function H(e){var t=A[e];if(!t)return null;var n=t.data||{},i=n.value,s=n.label,c=n.children,u=Object(f.a)(n,!0),d=a?c:s;return t?l.createElement("div",Object.assign({"aria-label":"string"==typeof d?d:null},u,{key:e,role:"option",id:"".concat(r,"_list_").concat(e),"aria-selected":o.has(i)}),i):null}return l.createElement(l.Fragment,null,l.createElement("div",{role:"listbox",id:"".concat(r,"_list"),style:{height:0,width:0,overflow:"hidden"}},H(z-1),H(z),H(z+1)),l.createElement(g.a,{itemKey:"key",ref:M,data:A,height:x,itemHeight:w,fullHeight:!1,onMouseDown:D,onScroll:_,virtual:E,onMouseEnter:L},(function(e,t){var n,r=e.group,i=e.groupOption,u=e.data,d=u.label,f=u.key;if(r)return l.createElement("div",{className:m()(j,"".concat(j,"-group"))},void 0!==d?d:f);var p=u.disabled,h=u.value,g=u.title,b=u.children,y=u.style,x=u.className,w=Object(c.a)(u,["disabled","value","title","children","style","className"]),k=o.has(h),C="".concat(j,"-option"),E=m()(j,C,x,(n={},Object(s.a)(n,"".concat(C,"-grouped"),i),Object(s.a)(n,"".concat(C,"-active"),z===t&&!p),Object(s.a)(n,"".concat(C,"-disabled"),p),Object(s.a)(n,"".concat(C,"-selected"),k),n)),O=a?b:d,N=!S||"function"==typeof S||k;return l.createElement("div",Object.assign({},w,{"aria-selected":k,className:E,title:g,onMouseMove:function(){z===t||p||W(t)},onClick:function(){p||q(h)},style:y}),l.createElement("div",{className:"".concat(C,"-content")},O||h),l.isValidElement(S)||k,N&&l.createElement(v.a,{className:"".concat(j,"-option-state"),customizeIcon:S,customizeIconProps:{isSelected:k}},k?"✓":null))})))}));b.displayName="OptionList";var y=b,x=function(){return null};x.isSelectOption=!0;var w=x,k=function(){return null};k.isSelectOptGroup=!0;var C=k,S=n("VTBJ"),E=n("Zm9Q");function O(e){var t=e.key,n=e.props,r=n.children,i=n.value,a=Object(c.a)(n,["children","value"]);return Object(S.a)({key:t,value:void 0!==i?i:t,children:r},a)}function N(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(E.a)(e).map((function(e,n){if(!l.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,i=e.key,a=e.props,o=a.children,s=Object(c.a)(a,["children"]);return t||!r?O(e):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===i?n:i,"__"),label:i},s),{},{options:N(o)})})).filter((function(e){return e}))}var T=n("2Qr1"),_=n("qNPg"),L=n("U8pU"),j=n("Kwbf"),A=n("WKfj");var M=function(e){var t=e.mode,n=e.options,r=e.children,i=e.backfill,a=e.allowClear,o=e.placeholder,s=e.getInputElement,c=e.showSearch,u=e.onSearch,d=e.defaultOpen,f=e.autoFocus,p=e.labelInValue,h=e.value,m=e.inputValue,g=e.optionLabelProp,v="multiple"===t||"tags"===t,b=void 0!==c?c:v||"combobox"===t,y=n||N(r);if(Object(j.a)("tags"!==t||y.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=y.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(j.a)(!x,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(j.a)("combobox"!==t||!g,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(j.a)("combobox"===t||!i,"`backfill` only works with `combobox` mode."),Object(j.a)("combobox"===t||!s,"`getInputElement` only work with `combobox` mode."),Object(j.b)("combobox"!==t||!s||!a||!o,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!b&&"combobox"!==t&&"tags"!==t&&Object(j.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(j.b)(!d||f,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=h){var w=Object(A.d)(h);Object(j.a)(!p||w.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(j.a)(!v||Array.isArray(h),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var k=null;Object(E.a)(r).some((function(e){if(!l.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!(l.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(k=t.type,!1)})):(k=t,!0))})),k&&Object(j.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(k.displayName||k.name||k,"`.")),Object(j.a)(void 0===m,"`inputValue` is deprecated, please use `searchValue` instead.")}},D=Object(_.a)({prefixCls:"rc-select",components:{optionList:y},convertChildrenToData:N,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:M,fillOptionsWithMissingValue:T.a}),I=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).selectRef=l.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(i.a)(n,[{key:"render",value:function(){return l.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),n}(l.Component);I.Option=w,I.OptGroup=C;var P=I;t.c=P},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 r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),i=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"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),l=n(/*! react */"q1tI"),s=n.n(l),c=n(/*! react-dom */"i8i4"),u=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(e){var i;Object(r.a)(this,n),i=t.call(this,e);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return Object(i.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}(s.a.Component)},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 r=n("U8pU"),i=n("VTBJ"),a=n("Ff2n"),o=n("q1tI"),l=n("uciX"),s=n("7ixt"),c=function(e){var t=e.overlay,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle;return o.createElement("div",{className:"".concat(n,"-inner"),id:r,role:"tooltip",style:i},"function"==typeof t?t():t)},u=Object(o.forwardRef)((function(e,t){var n=e.overlayClassName,u=e.trigger,d=void 0===u?["hover"]:u,f=e.mouseEnterDelay,p=void 0===f?0:f,h=e.mouseLeaveDelay,m=void 0===h?.1:h,g=e.overlayStyle,v=e.prefixCls,b=void 0===v?"rc-tooltip":v,y=e.children,x=e.onVisibleChange,w=e.afterVisibleChange,k=e.transitionName,C=e.animation,S=e.placement,E=void 0===S?"right":S,O=e.align,N=void 0===O?{}:O,T=e.destroyTooltipOnHide,_=void 0!==T&&T,L=e.defaultVisible,j=e.getTooltipContainer,A=e.overlayInnerStyle,M=Object(a.a)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),D=Object(o.useRef)(null);Object(o.useImperativeHandle)(t,(function(){return D.current}));var I=Object(i.a)({},M);"visible"in e&&(I.popupVisible=e.visible);var P=!1,F=!1;if("boolean"==typeof _)P=_;else if(_&&"object"===Object(r.a)(_)){var R=_.keepParent;P=!0===R,F=!1===R}return o.createElement(l.a,Object.assign({popupClassName:n,prefixCls:b,popup:function(){var t=e.arrowContent,n=void 0===t?null:t,r=e.overlay,i=e.id;return[o.createElement("div",{className:"".concat(b,"-arrow"),key:"arrow"},n),o.createElement(c,{key:"content",prefixCls:b,id:i,overlay:r,overlayInnerStyle:A})]},action:d,builtinPlacements:s.a,popupPlacement:E,ref:D,popupAlign:N,getPopupContainer:j,onPopupVisibleChange:x,afterPopupVisibleChange:w,popupTransitionName:k,popupAnimation:C,defaultPopupVisible:L,destroyPopupOnHide:P,autoDestroy:F,mouseLeaveDelay:m,popupStyle:g,mouseEnterDelay:p},I),y)}));t.a=u},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/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/slicedToArray.js */
/*! 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 ./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/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/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("2qtc");var r=n("kLXV"),i=n("rAM+"),a=(n("miYZ"),n("tsqr")),o=n("tJVT"),l=n("jrin"),s=n("q1tI"),c=n.n(s),u=n("VrN/"),d=n.n(u),f=n("bdgK"),p=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("+NIl"),n("kSUc"),n("9Bee")),h=function(e){var t=e.value,n=void 0===t?"":t,r=(e.className,e.showTextOnly,e.showLines,e.style,Object(s.useMemo)((function(){return""}),[n]));return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))},m=n("0Owb"),g=(n("dejd"),n("C+DQ"),[{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 v(e){var t=e.onActionCallback,n=e.title,r=e.icon,i=e.actionName,a=e.className,o=void 0===a?"":a,l=e.children;return c.a.createElement("a",{title:n,className:o,onClick:function(){t(i)}},c.a.createElement("i",{className:"md-iconfont ".concat(r)}),l)}var b=function(e){var t=e.watch,n=e.showNullButton,r=e.onActionCallback,i=e.fullScreen,a=e.insertTemp,o=e.hidetoolBar,l=[].concat(g,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return c.a.createElement("ul",{className:"markdown-toolbar-container"},!o&&l.map((function(e,t){return c.a.createElement("li",{key:t},e.actionName?c.a.createElement(v,Object(m.a)({},e,{onActionCallback:r})):c.a.createElement("span",{className:"v-line"}))})),n?c.a.createElement("li",null,c.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r},c.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,a&&c.a.createElement("li",null,c.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r},c.a.createElement("span",{className:"fill-tip"},"插入模板"))),c.a.createElement("li",{className:"btn-full-screen"},c.a.createElement(v,{icon:"".concat(i?"icon-shrink":"icon-enlarge"),title:i?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})))},y=n("M8RZ"),x=(n("+L6B"),n("2/Rp")),w=(n("y8nQ"),n("Vl3Y")),k=(n("5NDa"),n("5rEg")),C={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var t=e.callback,n=e.onCancel;return c.a.createElement(w.a,Object(m.a)({},C,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),c.a.createElement(w.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},c.a.createElement(k.a,null)),c.a.createElement(w.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},c.a.createElement(k.a,null)),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(x.a,{type:"ghost",onClick:n},"取消")))},E=n("7ahc"),O=(n("HmJG"),n("BjJ7")),N=w.a.useForm,T={width:280,marginRight:10},_={labelCol:{span:5},wrapperCol:{span:19}},L=function(e){var t=e.callback,n=e.onCancel,r=N(),i=Object(o.a)(r,1)[0];function a(e,t){i.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type})}return c.a.createElement(w.a,Object(m.a)({form:i},_,{className:"upload-image-panel",onFinish:function(e){t(e)}}),c.a.createElement(w.a.Item,{label:"图片地址",required:!0},c.a.createElement("div",{className:"flex-container"},c.a.createElement(w.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}]},c.a.createElement(k.a,{style:T})),c.a.createElement(j,{onFileChange:function(e){A(e.target.files[0],a)}}))),c.a.createElement(w.a.Item,{label:"图片描述",name:"alt",rules:[{required:!0,message:"请输入图片描述"}]},c.a.createElement(k.a,{style:{width:264}})),c.a.createElement(w.a.Item,{style:{textAlign:"right"}},c.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(x.a,{type:"ghost",onClick:n},"取消")))};function j(e){var t=e.onFileChange;return c.a.createElement("a",{className:"upload-button"},"本地上传",c.a.createElement("input",{type:"file",onChange:t}))}function A(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 r=new window.XMLHttpRequest;r.withCredentials=!0,r.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),r.addEventListener("error",(function(e){console.error(e)}),!1),r.open("POST","".concat(O.a,"/api/attachments.json")),r.send(n)}n("giR+");var M,D,I=n("fyUT"),P=(n("7Kak"),n("9yH6")),F=P.a.Group,R={margin:"0 8px"},z=function(e){var t=e.callback,n=e.onCancel;return c.a.createElement(w.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},c.a.createElement("div",{className:"flex-container"},c.a.createElement("span",{style:R},"单元格数:"),c.a.createElement("span",{style:R},"行数"),c.a.createElement(w.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},c.a.createElement(I.a,null)),c.a.createElement("span",{style:R},"列数"),c.a.createElement(w.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},c.a.createElement(I.a,null))),c.a.createElement("div",{className:"flex-container",style:{marginTop:12}},c.a.createElement("span",{style:R},"对齐方式:"),c.a.createElement(w.a.Item,{name:"align"},c.a.createElement(F,null,c.a.createElement(P.a,{value:"default"},c.a.createElement("i",{className:"fa fa-align-justify"})),c.a.createElement(P.a,{value:"left"},c.a.createElement("i",{className:"fa fa-align-left"})),c.a.createElement(P.a,{value:"center"},c.a.createElement("i",{className:"fa fa-align-center"})),c.a.createElement(P.a,{value:"right"},c.a.createElement("i",{className:"fa fa-align-right"}))))),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(x.a,{type:"ghost",onClick:n},"取消")))},B=n("m3rI"),W="------------",q={default:W,left:":".concat(W),center:":".concat(W,":"),right:"".concat(W,":")},H=n("9VGf");function V(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var U=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",$=(M={},Object(l.a)(M,U+"-B","bold"),Object(l.a)(M,U+"-I","italic"),M),K=(D={},Object(l.a)(D,"link","添加链接"),Object(l.a)(D,"code-block","添加代码块"),Object(l.a)(D,"upload-image","添加图片"),Object(l.a)(D,"add-table","添加表格"),D);t.a=function(e){var t=e.defaultValue,n=void 0===t?"":t,u=e.onChange,m=e.width,g=void 0===m?"100%":m,v=e.height,x=void 0===v?400:v,w=e.miniToolbar,k=void 0!==w&&w,C=e.isFocus,O=void 0!==C&&C,N=e.watch,T=e.insertTemp,_=e.mode,j=void 0===_?"markdown":_,M=e.id,D=void 0===M?"markdown-editor-id":M,I=e.showResizeBar,P=void 0!==I&&I,F=e.noStorage,R=void 0!==F&&F,W=e.showNullButton,U=void 0!==W&&W,G=e.hidetoolBar,J=void 0!==G&&G,Z=e.fullScreen,X=void 0!==Z&&Z,Y=e.onBlur,Q=e.onCMBeforeChange,ee=e.onFullScreen,te=e.className,ne=void 0===te?"":te,re=e.disablePaste,ie=void 0!==re&&re,ae=e.placeholder,oe=void 0===ae?"":ae,le=e.values,se=void 0===le?"":le,ce=Object(s.useState)(null),ue=Object(o.a)(ce,2),de=ue[0],fe=ue[1],pe=Object(s.useState)(n),he=Object(o.a)(pe,2),me=he[0],ge=he[1],ve=Object(s.useState)(N),be=Object(o.a)(ve,2),ye=be[0],xe=be[1],we=Object(s.useState)(X),ke=Object(o.a)(we,2),Ce=ke[0],Se=ke[1],Ee=Object(s.useState)(""),Oe=Object(o.a)(Ee,2),Ne=Oe[0],Te=Oe[1],_e=Object(s.useState)(0),Le=Object(o.a)(_e,2),je=Le[0],Ae=Le[1],Me=Object(s.useState)(x),De=Object(o.a)(Me,2),Ie=De[0],Pe=De[1],Fe=Object(s.useState)(!1),Re=Object(o.a)(Fe,2),ze=(Re[0],Re[1]),Be=Object(s.useRef)(),We=Object(s.useRef)(),qe=Object(s.useRef)(),He=Object(s.useRef)();Object(s.useEffect)((function(){ge(se),null==de||de.setValue(se)}),[se]),Object(s.useEffect)((function(){null==ee||ee(Ce)}),[Ce]),Object(s.useEffect)((function(){if(Be.current){var e=d.a.fromTextArea(Be.current,{mode:j,lineNumbers:!k,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,n){if(!ie){var r=n.clipboardData;if(r){var i=r.types.toString(),o=r.items,l=["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"];if("Files"===i||r.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==j)return;try{var s,c=o[1];"file"===(null===(s=o[0])||void 0===s?void 0:s.kind)&&(c=o[0]);var u=c.getAsFile(),d=u.name.split(".").pop();A(u,(function(t){var n,r,i;t.id?(null==u||null===(n=u.type)||void 0===n?void 0:n.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==u||null===(r=u.type)||void 0===r?void 0:r.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(B.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==u||null===(i=u.type)||void 0===i?void 0:i.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(u.type,'&disposition=inline" target="_blank">').concat(u.name,"</a>")):l.includes(d)?e.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(u.name,"</a>")):e.replaceSelection("[".concat(u.name,"](").concat(B.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){a.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()}return O&&e.focus(),e.on("paste",t),fe(e),function(){e.off("paste",t)}}}),[]);var Ve=Object(s.useCallback)((function(){We.current}),[Ie,We,Ce]);Object(s.useEffect)((function(){if(de){var e=function(){var e=new f.default((function(e){var t,n=Object(i.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&(Ve(),de.setSize("100%","100%"),de.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(Be.current.parentElement),e}();return function(){e.unobserve(Be.current.parentElement)}}}),[de,Ve]),Object(s.useEffect)((function(){if(de){for(var e=[],t=function(){var t=r[n],i=(a=Object(o.a)(t,2))[0],s=a[1],c=Object(l.a)({},i,(function(){Ue(s)}));e.push(c),de.addKeyMap(c)},n=0,r=Object.entries($);n<r.length;n++){var a;t()}return function(){var t,n=Object(i.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;de.removeKeyMap(r)}}catch(e){n.e(e)}finally{n.f()}}}}),[de]),Object(s.useEffect)((function(){X!==Ce&&Se(X)}),[X]),Object(H.a)((function(){if(!R&&je>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(D);e>=je+1e4&&(!t||t!==me)&&(window.sessionStorage.setItem(D,me),ze(!0))}}),1e4),Object(s.useEffect)((function(){xe(N)}),[de,N]),Object(s.useEffect)((function(){de&&O&&de.focus()}),[de,O]),Object(s.useEffect)((function(){if(ye&&de){var e=de.getScrollerElement();function t(e){var t=e.target;if(He.current){var n=t.scrollTop/t.scrollHeight;He.current.scrollTop=He.current.scrollHeight*n}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[de,ye]),Object(s.useEffect)((function(){if(de&&Q){function e(e,t){Q(e,t)}return de.on("beforeChange",e),function(){de.off("beforeChange",e)}}}),[de,Q]),Object(s.useEffect)((function(){if(de&&Y){function e(){Y(de.getValue())}return de.on("blur",e),function(){de.off("blur",e)}}}),[de,Y]),Object(s.useEffect)((function(){if(de){function e(e){var t=e.getValue();ge(t),Ae((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),u&&u(t)}return de.on("change",e),function(){de.off("change",e)}}}),[de,u]),Object(s.useEffect)((function(){de&&(null==n?(de.setValue(""),ge("")):n!==de.getValue()&&(de.setValue(n),ge(n),de.setCursor(de.lineCount(),0)))}),[de,n]);var Ue=Object(s.useCallback)((function(e){var t=de.getCursor(),n=de.getSelection(),r=n.split("\n");switch(e){case"bold":return de.replaceSelection("**"+n+"**"),""===n&&de.setCursor(t.line,t.ch+2),de.focus();case"italic":return de.replaceSelection("*"+n+"*"),""===n&&de.setCursor(t.line,t.ch+1),de.focus();case"code":return de.replaceSelection("`"+n+"`"),""===n&&de.setCursor(t.line,t.ch+1),de.focus();case"inline-latex":return de.replaceSelection("`$$"+n+"$$`"),""===n&&de.setCursor(t.line,t.ch+3),de.focus();case"latex":return de.replaceSelection("```latex\n"+n+"\n```"),de.setCursor(t.line+1,n.length+1),de.focus();case"line-break":return de.replaceSelection("<br/>\n"),de.focus();case"list-ul":return""===n?de.replaceSelection("- "+n):de.replaceSelection(r.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),de.focus();case"list-ol":return""===n?de.replaceSelection("1. "+n):de.replaceSelection(r.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),de.focus();case"add-null-ch":return""===n&&de.setCursor(t.line,t.ch+1),de.replaceSelection("▁"),de.focus();case"inster-template-1":return""===n&&de.setCursor(t.line,t.ch),de.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),de.focus();case"eraser":return de.setValue(""),de.focus();case"trigger-watch":return xe(!ye),de.focus();case"trigger-full-screen":return Se(!Ce),de.focus();case"link":return void Te("link");case"code-block":return void Te("code-block");case"upload-image":return void Te("upload-image");case"add-table":return void Te("add-table");default:throw new Error}}),[de,ye,Ce]),$e=Object(s.useCallback)((function(e){switch(Te(""),Ne){case"link":var t=e.title,n=e.link;return de.replaceSelection("[".concat(t,"](").concat(n,")")),de.focus();case"code-block":var r=e.language,i=e.content;return de.replaceSelection(["```"+r,i,"```"].join("\n")),de.focus();case"upload-image":var a=e.src,o=e.alt;return de.replaceSelection("![ ".concat(o," ]( ").concat(a,' "').concat(o,'" )')),de.focus();case"add-table":for(var l=e.row,s=e.col,c=e.align,u="\n",d=0;d<l;d++){for(var f=[],p=[],h=0;h<s;h++)1===d&&p.push(q[c]),f.push(" ");1===d&&(u+="| ".concat(p.join(" | ")," |\n")),u+="| ".concat(f.join(1===s?"":" | ")," |\n")}return de.replaceSelection(u+"\n"),de.focus();default:throw new Error}}),[de,Ne]),Ke=Object(s.useMemo)((function(){switch(Ne){case"link":return c.a.createElement(S,{callback:$e,onCancel:Ge});case"code-block":return c.a.createElement(E.b,{callback:$e,onCancel:Ge});case"upload-image":return c.a.createElement(L,{callback:$e,onCancel:Ge});case"add-table":return c.a.createElement(z,{callback:$e,onCancel:Ge});default:return null}}),[Ne]);function Ge(){Te("")}Object(s.useEffect)((function(){if(qe.current){var e=qe.current,t=!1,n=0;function r(e){t=!0,n=e.pageY}function i(){t=!1}function a(e){if(t){var r=e.pageY-n;r<0&&(r=0),r>300&&(r=300),Pe(x+r+"px")}}return e.addEventListener("mousedown",r),document.addEventListener("mousemove",a),document.addEventListener("mouseup",i),function(){e.removeEventListener("mousedown",r),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)}}}),[de,qe]),Object(s.useEffect)((function(){Pe(x)}),[x]);var Je={width:V(g),height:V(Ie)};Object(s.useMemo)((function(){if(je){var e=new Date(je),t=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return n=n<10?"0"+n:n,r=r<10?"0"+r:r,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(r)}return 0}),[je]);return c.a.createElement(s.Fragment,null,c.a.createElement("div",{className:"markdown-editor-wrapper",ref:We},c.a.createElement("div",{className:"markdown-editor-container ".concat(ne," ").concat(ye?"on-preview":""," ").concat(k?"mini":""," ").concat(Ce?"full-screen":""),style:Je},c.a.createElement(b,{insertTemp:T,watch:ye,fullScreen:Ce,showNullButton:U,onActionCallback:Ue,hidetoolBar:J}),c.a.createElement("div",{className:"markdown-editor-body"},c.a.createElement("div",{className:"codemirror-container"},c.a.createElement("textarea",{ref:Be,placeholder:oe})),ye?c.a.createElement("div",{ref:He,className:"preview-container"},"stex"===j&&c.a.createElement(h,{value:me}),"stex"!==j&&c.a.createElement(p.a,{value:me})):null))),P?c.a.createElement("a",{ref:qe,className:"editor-resize"}):null,c.a.createElement(y.a,null,K[Ne]?c.a.createElement(r.a,{centered:!0,title:K[Ne],visible:!0,onCancel:Ge,footer:null},Ke):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"}},"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"],r=[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"],i=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[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"],o=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",s=[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"],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function f(e,t,n,r,i){if(n){var a={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:t,decorations:null};r(a),i.push.apply(i,a.decorations)}}var p=/\S/;function h(e){for(var t=void 0,n=e.firstChild;n;n=n.nextSibling){var r=n.nodeType;t=1===r?t?e:n:3===r&&p.test(n.nodeValue)?e:t}return t===e?void 0:t}function m(e,t){var n,r={};!function(){for(var i=e.concat(t),a=[],o={},l=0,s=i.length;l<s;++l){var c=i[l],u=c[3];if(u)for(var d=u.length;--d>=0;)r[u.charAt(d)]=c;var f=c[1],p=""+f;o.hasOwnProperty(p)||(a.push(f),o[p]=null)}a.push(/[\0-\uffff]/),n=function(e){for(var t=0,n=!1,r=!1,i=0,a=e.length;i<a;++i){if((f=e[i]).ignoreCase)r=!0;else if(/[a-z]/i.test(f.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0,r=!1;break}}var o={b:8,t:9,n:10,v:11,f:12,r:13};function l(e){var t=e.charCodeAt(0);if(92!==t)return t;var n=e.charAt(1);return(t=o[n])||("0"<=n&&n<="7"?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1))}function s(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=[],r="^"===t[0],i=["["];r&&i.push("^");for(var a=r?1:0,o=t.length;a<o;++a){var c=t[a];if(/\\[bdsw]/i.test(c))i.push(c);else{var u,d=l(c);a+2<o&&"-"===t[a+1]?(u=l(t[a+2]),a+=2):u=d,n.push([d,u]),u<65||d>122||(u<65||d>90||n.push([32|Math.max(65,d),32|Math.min(u,90)]),u<97||d>122||n.push([-33&Math.max(97,d),-33&Math.min(u,122)]))}}n.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var f=[],p=[];for(a=0;a<n.length;++a){(h=n[a])[0]<=p[1]+1?p[1]=Math.max(p[1],h[1]):f.push(p=h)}for(a=0;a<f.length;++a){var h=f[a];i.push(s(h[0])),h[1]>h[0]&&(h[1]+1>h[0]&&i.push("-"),i.push(s(h[1])))}return i.push("]"),i.join("")}function u(e){for(var r=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")),i=r.length,a=[],o=0,l=0;o<i;++o){if("("===(d=r[o]))++l;else if("\\"===d.charAt(0)){(u=+d.substring(1))&&(u<=l?a[u]=-1:r[o]=s(u))}}for(o=1;o<a.length;++o)-1===a[o]&&(a[o]=++t);for(o=0,l=0;o<i;++o){if("("===(d=r[o]))a[++l]||(r[o]="(?:");else if("\\"===d.charAt(0)){var u;(u=+d.substring(1))&&u<=l&&(r[o]="\\"+a[u])}}for(o=0;o<i;++o)"^"===r[o]&&"^"!==r[o+1]&&(r[o]="");if(e.ignoreCase&&n)for(o=0;o<i;++o){var d,f=(d=r[o]).charAt(0);d.length>=2&&"["===f?r[o]=c(d):"\\"!==f&&(r[o]=d.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return r.join("")}var d=[];for(i=0,a=e.length;i<a;++i){var f;if((f=e[i]).global||f.multiline)throw new Error(""+f);d.push("(?:"+u(f)+")")}return new RegExp(d.join("|"),r?"gi":"g")}(a)}();var i=t.length,a=function(e){for(var o=e.sourceCode,l=e.basePos,s=e.sourceNode,c=[l,"pln"],u=0,d=o.match(n)||[],p={},h=0,m=d.length;h<m;++h){var g,v=d[h],b=p[v],y=void 0;if("string"==typeof b)g=!1;else{var x=r[v.charAt(0)];if(x)y=v.match(x[1]),b=x[0];else{for(var k=0;k<i;++k)if(x=t[k],y=v.match(x[1])){b=x[0];break}y||(b="pln")}!(g=b.length>=5&&"lang-"===b.substring(0,5))||y&&"string"==typeof y[1]||(g=!1,b="src"),g||(p[v]=b)}var C=u;if(u+=v.length,g){var S=y[1],E=v.indexOf(S),O=E+S.length;y[2]&&(E=(O=v.length-y[2].length)-S.length);var N=b.substring(5);f(s,l+C,v.substring(0,E),a,c),f(s,l+C+E,S,w(N,S),c),f(s,l+C+O,v.substring(O),a,c)}else c.push(l+C,b)}e.decorations=c};return a}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 r=e.hashComments;r&&(e.cStyleComments?(r>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 i=e.regexLiterals;if(i){var a=i>1?"":"\n\r",o=a?".":"[\\S\\s]",l="/(?=[^/*"+a+"])(?:[^/\\x5B\\x5C"+a+"]|\\x5C"+o+"|\\x5B(?:[^\\x5C\\x5D"+a+"]|\\x5C"+o+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+l+")")])}var s=e.types;s&&n.push(["typ",s]);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:[r,a,i,o,l,s,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function b(e,t,n){for(var r=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,a=e.ownerDocument,o=a.createElement("li");e.firstChild;)o.appendChild(e.firstChild);var l=[o];function s(e){var t=e.nodeType;if(1!=t||r.test(e.className)){if((3==t||4==t)&&n){var o=e.nodeValue,l=o.match(i);if(l){var u=o.substring(0,l.index);e.nodeValue=u;var d=o.substring(l.index+l[0].length);if(d)e.parentNode.insertBefore(a.createTextNode(d),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 f=e.firstChild;f;f=f.nextSibling)s(f)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,n=function e(t,n){var r=n?t.cloneNode(!1):t,i=t.parentNode;if(i){var a=e(i,1),o=t.nextSibling;a.appendChild(r);for(var l=o;l;l=o)o=l.nextSibling,a.appendChild(l)}return r}(e.nextSibling,0);(t=n.parentNode)&&1===t.nodeType;)n=t;l.push(n)}for(var u=0;u<l.length;++u)s(l[u]);t===(0|t)&&l[0].setAttribute("value",t);var d=a.createElement("ol");d.className="linenums";for(var f=Math.max(0,t-1|0)||0,p=(u=0,l.length);u<p;++u)(o=l[u]).className="L"+(u+f)%10,o.firstChild||o.appendChild(a.createTextNode(" ")),d.appendChild(o);e.appendChild(d)}var y={};function x(t,n){for(var r=n.length;--r>=0;){var i=n[r];y.hasOwnProperty(i)?e.console&&console.warn("cannot override language handler %s",i):y[i]=t}}function w(e,t){return e&&y.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),y[e]}function k(t){var n,r,i,a,o,l,s,c=t.langExtension;try{var u=(n=t.sourceNode,r=t.pre,i=/(?:^|\s)nocode(?:\s|$)/,a=[],o=0,l=[],s=0,function e(t){var n=t.nodeType;if(1==n){if(i.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)e(c);var u=t.nodeName.toLowerCase();"br"!==u&&"li"!==u||(a[s]="\n",l[s<<1]=o++,l[s++<<1|1]=t)}else if(3==n||4==n){var d=t.nodeValue;d.length&&(d=r?d.replace(/\r\n?/g,"\n"):d.replace(/[ \t\r\n]+/g," "),a[s]=d,l[s<<1]=o,o+=d.length,l[s++<<1|1]=t)}}(n),{sourceCode:a.join("").replace(/\n$/,""),spans:l}),d=u.sourceCode;t.sourceCode=d,t.spans=u.spans,t.basePos=0,w(c,d)(t),function(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var n,r,i=/\n/g,a=e.sourceCode,o=a.length,l=0,s=e.spans,c=s.length,u=0,d=e.decorations,f=d.length,p=0;for(d[f]=o,r=n=0;r<f;)d[r]!==d[r+2]?(d[n++]=d[r++],d[n++]=d[r++]):r+=2;for(f=n,r=n=0;r<f;){for(var h=d[r],m=d[r+1],g=r+2;g+2<=f&&d[g+1]===m;)g+=2;d[n++]=h,d[n++]=m,r=g}f=d.length=n;var v=e.sourceNode,b="";v&&(b=v.style.display,v.style.display="none");try{for(;u<c;){s[u];var y,x=s[u+2]||o,w=d[p+2]||o,k=(g=Math.min(x,w),s[u+1]);if(1!==k.nodeType&&(y=a.substring(l,g))){t&&(y=y.replace(i,"\r")),k.nodeValue=y;var C=k.ownerDocument,S=C.createElement("span");S.className=d[p+1];var E=k.parentNode;E.replaceChild(S,k),S.appendChild(k),l<x&&(s[u+1]=k=C.createTextNode(a.substring(g,x)),E.insertBefore(k,S.nextSibling))}(l=g)>=x&&(u+=2),l>=w&&(p+=2)}}finally{v&&(v.style.display=b)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function C(e,t,n){var r=n||!1,i=t||null,a=document.createElement("div");return a.innerHTML="<pre>"+e+"</pre>",a=a.firstChild,r&&b(a,r,!0),k({langExtension:i,numberLines:r,sourceNode:a,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),a.innerHTML}function S(t,n){var r=n||document.body,i=r.ownerDocument||document;function a(e){return r.getElementsByTagName(e)}for(var o=[a("pre"),a("code"),a("xmp")],l=[],s=0;s<o.length;++s)for(var c=0,u=o[s].length;c<u;++c)l.push(o[s][c]);o=null;var d=Date;d.now||(d={now:function(){return+new Date}});var f=0,p=/\blang(?:uage)?-([\w.]+)(?!\S)/,m=/\bprettyprint\b/,g=/\bprettyprinted\b/,v=/pre|xmp/i,y=/^code$/i,x=/^(?:pre|code|xmp)$/i,w={};!function n(){for(var r=e.PR_SHOULD_USE_CONTINUATION?d.now()+250:1/0;f<l.length&&d.now()<r;f++){for(var a=l[f],o=w,s=a;s=s.previousSibling;){var c=s.nodeType,u=(7===c||8===c)&&s.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(s.nodeValue))break;if(u){o={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(e,t,n){o[t]=n}));break}}var C=a.className;if((o!==w||m.test(C))&&!g.test(C)){for(var S=!1,E=a.parentNode;E;E=E.parentNode){var O=E.tagName;if(x.test(O)&&E.className&&m.test(E.className)){S=!0;break}}if(!S){a.className+=" prettyprinted";var N,T,_=o.lang;if(!_)!(_=C.match(p))&&(N=h(a))&&y.test(N.tagName)&&(_=N.className.match(p)),_&&(_=_[1]);if(v.test(a.tagName))T=1;else{var L=a.currentStyle,j=i.defaultView,A=L?L.whiteSpace:j&&j.getComputedStyle?j.getComputedStyle(a,null).getPropertyValue("white-space"):0;T=A&&"pre"===A.substring(0,3)}var M=o.linenums;(M="true"===M||+M)||(M=!!(M=C.match(/\blinenums\b(?::(\d+))?/))&&(!M[1]||!M[1].length||+M[1])),M&&b(a,M,T),k({langExtension:_,sourceNode:a,numberLines:M,pre:T,sourceCode:null,basePos:null,spans:null,decorations:null})}}}f<l.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:r,hashComments:!0,cStyleComments:!0,types:d}),["c","cc","cpp","cxx","cyc","m"]),x(g({keywords:"null,true,false"}),["json"]),x(g({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:d}),["cs"]),x(g({keywords:i,cStyleComments:!0}),["java"]),x(g({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),x(g({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),x(g({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),x(g({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),x(g({keywords:o,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:C,prettyPrint:S},O=e.define;"function"==typeof O&&O.amd&&O("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),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,l=o&&(r?document.documentMode||6:+(a||i)[1]),s=!a&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=!a&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),y=/\bCrOS\b/.test(e),x=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,s=!0);var k=b&&(c||d&&(null==w||w<12.11)),C=n||o&&l>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,O=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function N(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return N(e).appendChild(t)}function _(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function L(e,t,n,r){var i=_(e,t,n,r);return i.setAttribute("role","presentation"),i}function j(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 A(){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 M(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function D(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}E=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var I=function(e){e.select()};function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function R(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var a=r||0,o=i||0;;){var l=e.indexOf("\t",a);if(l<0||l>=t)return o+(t-a);o+=l-a,o+=n-o%n,a=l+1}}m?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(I=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function B(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 W={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},H={origin:"*mouse"},V={origin:"+move"};function U(e,t,n){for(var r=0,i=0;;){var a=e.indexOf("\t",r);-1==a&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,r=a+1,(i+=n-i%n)>=t)return r}}var $=[""];function K(e){for(;$.length<=e;)$.push(G($)+" ");return $[e]}function G(e){return e[e.length-1]}function J(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Z(){}function X(e,t){var n;return Object.create?n=Object.create(e):(Z.prototype=e,n=new Z),t&&F(t,n),n}var Y=/[\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()||Y.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 re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}var oe=null;function le(e,t,n){var r;oe=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&"before"==n?r=i:oe=i),a.from==t&&(a.from!=a.to&&"before"!=n?r=i:oe=i)}return null!=r?r:oe}var se=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function a(e,t,n){this.level=e,this.from=t,this.to=n}return function(o,l){var s="ltr"==l?"L":"R";if(0==o.length||"ltr"==l&&!e.test(o))return!1;for(var c,u=o.length,d=[],f=0;f<u;++f)d.push((c=o.charCodeAt(f))<=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,h=s;p<u;++p){var m=d[p];"m"==m?d[p]=h:h=m}for(var g=0,v=s;g<u;++g){var b=d[g];"1"==b&&"r"==v?d[g]="n":n.test(b)&&(v=b,"r"==b&&(d[g]="R"))}for(var y=1,x=d[0];y<u-1;++y){var w=d[y];"+"==w&&"1"==x&&"1"==d[y+1]?d[y]="1":","!=w||x!=d[y+1]||"1"!=x&&"n"!=x||(d[y]=x),x=w}for(var k=0;k<u;++k){var C=d[k];if(","==C)d[k]="N";else if("%"==C){var S=void 0;for(S=k+1;S<u&&"%"==d[S];++S);for(var E=k&&"!"==d[k-1]||S<u&&"1"==d[S]?"1":"N",O=k;O<S;++O)d[O]=E;k=S-1}}for(var N=0,T=s;N<u;++N){var _=d[N];"L"==T&&"1"==_?d[N]="L":n.test(_)&&(T=_)}for(var L=0;L<u;++L)if(t.test(d[L])){var j=void 0;for(j=L+1;j<u&&t.test(d[j]);++j);for(var A="L"==(L?d[L-1]:s),M=A==("L"==(j<u?d[j]:s))?A?"L":"R":s,D=L;D<j;++D)d[D]=M;L=j-1}for(var I,P=[],F=0;F<u;)if(r.test(d[F])){var R=F;for(++F;F<u&&r.test(d[F]);++F);P.push(new a(0,R,F))}else{var z=F,B=P.length,W="rtl"==l?1:0;for(++F;F<u&&"L"!=d[F];++F);for(var q=z;q<F;)if(i.test(d[q])){z<q&&(P.splice(B,0,new a(1,z,q)),B+=W);var H=q;for(++q;q<F&&i.test(d[q]);++q);P.splice(B,0,new a(2,H,q)),B+=W,z=q}else++q;z<F&&P.splice(B,0,new a(1,z,F))}return"ltr"==l&&(1==P[0].level&&(I=o.match(/^\s+/))&&(P[0].from=I[0].length,P.unshift(new a(0,0,I[0].length))),1==G(P).level&&(I=o.match(/\s+$/))&&(G(P).to-=I[0].length,P.push(new a(0,u-I[0].length,u)))),"rtl"==l?P.reverse():P}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=se(e.text,t)),n}var ue=[],de=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ue).concat(n)}};function fe(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 r=e._handlers,i=r&&r[t];if(i){var a=B(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function he(e,t){var n=fe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,n||t.type,e,t),we(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==B(n,t[r])&&n.push(t[r])}function ve(e,t){return fe(e,t).length>0}function be(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ke(e){ye(e),xe(e)}function Ce(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)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ee,Oe,Ne=function(){if(o&&l<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}();function Te(e){if(null==Ee){var t=_("span","");T(e,_("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&l<8))}var n=Ee?_("span",""):_("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function _e(e){if(null!=Oe)return Oe;var t=T(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return N(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var Le,je=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var a=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),o=a.indexOf("\r");-1!=o?(n.push(a.slice(0,o)),t+=o+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ae=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)},Me="oncopy"in(Le=_("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),De=null,Ie={},Pe={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ie[e]=t}function Re(e){if("string"==typeof e&&Pe.hasOwnProperty(e))e=Pe[e];else if(e&&"string"==typeof e.name&&Pe.hasOwnProperty(e.name)){var t=Pe[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Re("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Re("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Re(t);var n=Ie[t.name];if(!n)return ze(e,"text/plain");var r=n(e,t);if(Be.hasOwnProperty(t.name)){var i=Be[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var Be={};function We(e,t){F(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function He(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 Ve(e,t,n){return!e.startState||e.startState(t,n)}var Ue=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 $e(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 r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function Ke(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i})),r}function Ge(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Je(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ze(e){if(null==e.parent)return null;for(var t=e.parent,n=B(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Xe(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue e}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var l=e.lines[o].height;if(t<l)break;t-=l}return n+o}function Ye(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 rt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function at(e,t){return tt(e,t)<0?e:t}function ot(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function lt(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,$e(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,$e(e,t.line).text.length)}function st(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=lt(e,t[r]);return n}Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.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},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.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,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function dt(e,t,n,r){var i=[e.state.modeGen],a={};xt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),a,r);for(var o=n.state,l=function(r){n.baseTokens=i;var l=e.state.overlays[r],s=1,c=0;n.state=!0,xt(e,t.text,l.mode,n,(function(e,t){for(var n=s;c<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var a=i[n+1];i[n+1]=(a?a+" ":"")+"overlay "+t}}),a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function ft(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=pt(e,Ze(t)),i=t.text.length>e.options.maxHighlightLength&&qe(e.doc.mode,r.state),a=dt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.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 r=e.doc,i=e.display;if(!r.mode.startState)return new ut(r,!0,t);var a=function(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>o;--l){if(l<=a.first)return a.first;var s=$e(a,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof ct?c.lookAhead:0)<=a.modeFrontier))return l;var u=R(s.text,null,e.options.tabSize);(null==i||r>u)&&(i=l-1,r=u)}return i}(e,t,n),o=a>r.first&&$e(r,a-1).stateAfter,l=o?ut.fromSaved(r,o,a):new ut(r,Ve(r.mode),a);return r.iter(a,t,(function(n){ht(e,n.text,l);var r=l.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?l.save():null,l.nextLine()})),n&&(r.modeFrontier=l.line),l}function ht(e,t,n,r){var i=e.doc.mode,a=new Ue(t,e.options.tabSize,n);for(a.start=a.pos=r||0,""==t&&mt(i,n.state);!a.eol();)gt(i,a,n.state),a.start=a.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=He(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=He(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}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,qe(e.mode,t.state),n,t.lookAhead):new ut(e,qe(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?qe(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 bt(e,t,n,r){var i,a,o=e.doc,l=o.mode,s=$e(o,(t=lt(o,t)).line),c=pt(e,t.line,n),u=new Ue(s.text,e.options.tabSize,c);for(r&&(a=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=gt(l,u,c.state),r&&a.push(new vt(u,i,qe(o.mode,c.state)));return r?a:new vt(u,i,c.state)}function yt(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 r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function xt(e,t,n,r,i,a,o){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Ue(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&yt(mt(n,r.state),a);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,o&&ht(e,t,r,d.pos),d.pos=t.length,s=null):s=yt(gt(n,d,r.state,f),a),f){var p=f[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);i(h,u),c=h}}var wt=!1,kt=!1;function Ct(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 r=e[n];if(r.marker==t)return r}}function Et(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ot(e,t){if(t.full)return null;var n=Ye(e,t.from.line)&&$e(e,t.from.line).markedSpans,r=Ye(e,t.to.line)&&$e(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=0==tt(t.from,t.to),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&"bookmark"==o.type&&(!n||!a.marker.insertLeft)){var l=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new Ct(o,a.from,l?null:a.to))}}return r}(n,i,o),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(null==a.to||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&"bookmark"==o.type&&(!n||a.marker.insertLeft)){var l=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new Ct(o,l?null:a.from-t,null==a.to?null:a.to-t))}}return r}(r,a,o),c=1==t.text.length,u=G(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var p=St(s,f.marker);p?c&&(f.to=null==p.to?null:p.to+u):f.to=i}}if(s)for(var h=0;h<s.length;++h){var m=s[h];null!=m.to&&(m.to+=u),null==m.from?St(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m)):(m.from+=u,c&&(l||(l=[])).push(m))}l&&(l=Nt(l)),s&&s!=l&&(s=Nt(s));var g=[l];if(!c){var v,b=t.text.length-2;if(b>0&&l)for(var y=0;y<l.length;++y)null==l[y].to&&(v||(v=[])).push(new Ct(l[y].marker,null,null));for(var x=0;x<b;++x)g.push(v);g.push(s)}return g}function Nt(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 Tt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function _t(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 jt(e){return e.inclusiveRight?1:0}function At(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),a=tt(r.from,i.from)||Lt(e)-Lt(t);if(a)return-a;var o=tt(r.to,i.to)||jt(e)-jt(t);return o||t.id-e.id}function Mt(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=void 0,a=0;a<r.length;++a)(i=r[a]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||At(n,i.marker)<0)&&(n=i.marker);return n}function Dt(e){return Mt(e,!0)}function It(e){return Mt(e,!1)}function Pt(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(null==a.from||a.from<t)&&(null==a.to||a.to>t)&&(!n||At(n,a.marker)<0)&&(n=a.marker)}return n}function Ft(e,t,n,r,i){var a=$e(e,t),o=kt&&a.markedSpans;if(o)for(var l=0;l<o.length;++l){var s=o[l];if(s.marker.collapsed){var c=s.marker.find(0),u=tt(c.from,n)||Lt(s.marker)-Lt(i),d=tt(c.to,r)||jt(s.marker)-jt(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Rt(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=$e(e,t),r=Rt(n);return n==r?t:Ze(r)}function Bt(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!Wt(e,r))return t;for(;n=It(r);)r=n.find(1,!0).line;return Ze(r)+1}function Wt(e,t){var n=kt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&qt(e,t,r))return!0}}function qt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return qt(e,r.line,St(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if((i=t.markedSpans[a]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&qt(e,t,i))return!0}function Ht(e){for(var t=0,n=(e=Rt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;a=(n=a).parent)for(var o=0;o<a.children.length;++o){var l=a.children[o];if(l==n)break;t+=l.height}return t}function Vt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Dt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=It(r);){var a=t.find(0,!0);n-=r.text.length-a.from.ch,n+=(r=a.to.line).text.length-a.to.ch}return n}function Ut(e){var t=e.display,n=e.doc;t.maxLine=$e(n,n.first),t.maxLineLength=Vt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Vt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var $t=function(e,t,n){this.text=e,_t(this,t),this.height=n?n(this):1};function Kt(e){e.parent=null,Tt(e)}$t.prototype.lineNo=function(){return Ze(this)},be($t);var Gt={},Jt={};function Zt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Jt:Gt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=L("span",null,null,s?"padding-right: .1px":null),r={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Qt,_e(e.display.measure)&&(o=ce(a,e.doc.direction))&&(r.addToken=en(r.addToken,o)),r.map=[],nn(a,r,ft(e,a,t!=e.display.externalMeasured&&Ze(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=D(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=D(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Te(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function Yt(e){var 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,r,i,a,s){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);" "!=a||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(a=" "),r+=a,n=" "==a}return r}(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){c=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var g=document.createTextNode(u.slice(p,p+m));o&&l<9?c.appendChild(_("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var v=void 0;if("\t"==h[0]){var b=e.cm.options.tabSize,y=b-e.col%b;(v=c.appendChild(_("span",K(y),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==h[0]||"\n"==h[0]?((v=c.appendChild(_("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),o&&l<9?c.appendChild(_("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),o&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||f||a||s){var x=n||"";r&&(x+=r),i&&(x+=i);var w=_("span",[c],x,a);if(s)for(var k in s)s.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&w.setAttribute(k,s[k]);return e.content.appendChild(w)}e.content.appendChild(c)}}function en(e,t){return function(n,r,i,a,o,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>c&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,a,o,l,s);e(n,r.slice(0,d.to-c),i,a,null,l,s),a=null,r=r.slice(d.to-c),c=d.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(r)for(var o,l,s,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=l="",f=null,d=null,v=1/0;for(var b=[],y=void 0,x=0;x<r.length;++x){var w=r[x],k=w.marker;if("bookmark"==k.type&&w.from==h&&k.widgetNode)b.push(k);else if(w.from<=h&&(null==w.to||w.to>h||k.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==h&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var C in k.attributes)(f||(f={}))[C]=k.attributes[C];k.collapsed&&(!d||At(d.marker,k)<0)&&(d=w)}else w.from>h&&v>w.from&&(v=w.from)}if(y)for(var S=0;S<y.length;S+=2)y[S+1]==v&&(c+=" "+y[S]);if(!d||d.from==h)for(var E=0;E<b.length;++E)tn(t,0,b[E]);if(d&&(d.from||0)==h){if(tn(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=p)break;for(var O=Math.min(p,v);;){if(g){var N=h+g.length;if(!d){var T=N>O?g.slice(0,O-h):g;t.addToken(t,T,o?o+s:s,u,h+T.length==v?c:"",l,f)}if(N>=O){g=g.slice(O-h),h=O;break}h=N,u=""}g=i.slice(a,a=n[m++]),o=Zt(n[m++],t.cm.options)}}else for(var _=1;_<n.length;_+=2)t.addToken(t,i.slice(a,a=n[_]),Zt(n[_+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=It(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ze(G(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function an(e,t,n){for(var r,i=[],a=t;a<n;a=r){var o=new rn(e.doc,$e(e.doc,a),a);r=a+o.size,i.push(o)}return i}var on=null,ln=null;function sn(e,t){var n=fe(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);on?r=on.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(cn,0));for(var a=function(e){r.push((function(){return n[e].apply(null,i)}))},o=0;o<n.length;++o)a(o)}}function cn(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];"text"==a?pn(e,t):"gutter"==a?mn(e,t,n,r):"class"==a?hn(e,t):"widget"==a&&gn(e,t,r)}t.changes=null}function dn(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&l<8&&(e.node.style.zIndex=2)),e.node}function fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Xt(e,t)}function pn(e,t){var n=t.text.className,r=fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,hn(e,t)):n&&(t.text.className=n)}function hn(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 r=dn(t);t.background=r.insertBefore(_("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dn(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,r){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 i=dn(t);t.gutterBackground=_("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=dn(t),l=t.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||a&&a["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(_("div",Qe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=a.hasOwnProperty(c)&&a[c];u&&l.appendChild(_("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=S("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);bn(e,t,n)}function vn(e,t,n,r){var i=fn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),hn(e,t),mn(e,t,n,r),bn(e,t,r),t.node}function bn(e,t,n){if(yn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)yn(e,t.rest[r],t,n,!1)}function yn(e,t,n,r,i){if(t.widgets)for(var a=dn(n),o=0,l=t.widgets;o<l.length;++o){var s=l[o],c=_("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),xn(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?a.insertBefore(c,n.gutter||n.text):a.appendChild(c),sn(s,"redraw")}}function xn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!j(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;"),T(t.display.measure,_("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t){for(var n=Ce(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 Cn(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=T(e.measure,_("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function On(e){return 50-e.display.nativeBarWidth}function Nn(e){return e.display.scroller.clientWidth-On(e)-e.display.barWidth}function Tn(e){return e.display.scroller.clientHeight-On(e)-e.display.barHeight}function _n(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Ze(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ln(e,t,n,r){return Mn(e,An(e,t),n,r)}function jn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function An(e,t){var n=Ze(t),r=jn(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,ar(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Ze(t=Rt(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Xt(e,r);return r.text=i.pre,T(e.display.lineMeasure,i.pre),r}(e,t));var i=_n(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Mn(e,t,n,r,i){t.before&&(n=-1);var a,s=n+(r||"");return t.cache.hasOwnProperty(s)?a=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Nn(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),l=0;l<o.length-1;l++){var s=o[l],c=o[l+1];Math.abs(s.bottom-c.bottom)>2&&a.push((s.bottom+c.top)/2-n.top)}}a.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(a=function(e,t,n,r){var i,a=Pn(t.map,n,r),s=a.node,c=a.start,u=a.end,d=a.collapse;if(3==s.nodeType){for(var f=0;f<4;f++){for(;c&&re(t.line.text.charAt(a.coverStart+c));)--c;for(;a.coverStart+u<a.coverEnd&&re(t.line.text.charAt(a.coverStart+u));)++u;if((i=o&&l<9&&0==c&&u==a.coverEnd-a.coverStart?s.parentNode.getBoundingClientRect():Fn(E(s,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,d="right"}o&&l<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=De)return De;var t=T(e,_("span","x")),n=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return De=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var p;c>0&&(d=r="right"),i=e.options.lineWrapping&&(p=s.getClientRects()).length>1?p["right"==r?p.length-1:0]:s.getBoundingClientRect()}if(o&&l<9&&!c&&(!i||!i.left&&!i.right)){var h=s.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+ir(e.display),top:h.top,bottom:h.bottom}:In}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var x=y?b[y-1]:0,w=b[y],k={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:x,bottom:w};return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=m,k.rbottom=g),k}(e,t,n,r)).bogus||(t.cache[s]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Dn,In={left:0,right:0,top:0,bottom:0};function Pn(e,t,n){for(var r,i,a,o,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,a=1,o="left"):t<s?a=1+(i=t-l):(c==e.length-3||t==s&&e[c+3]>t)&&(i=(a=s-l)-1,t>=s&&(o="right")),null!=i){if(r=e[c+2],l==s&&n==(r.insertLeft?"left":"right")&&(o=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],o="left";if("right"==n&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],o="right";break}return{node:r,start:i,end:a,collapse:o,coverStart:l,coverEnd:s}}function Fn(e,t){var n=In;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Rn(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,N(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Rn(e.display.view[t])}function Bn(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 Wn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function qn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function Vn(e,t,n,r,i){if(!i){var a=Hn(t);n.top+=a,n.bottom+=a}if("line"==r)return n;r||(r="local");var o=Ht(t);if("local"==r?o+=Cn(e.display):o-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();o+=l.top+("window"==r?0:qn());var s=l.left+("window"==r?0:Wn());n.left+=s,n.right+=s}return n.top+=o,n.bottom+=o,n}function Un(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Wn(),i-=qn();else if("local"==n||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function $n(e,t,n,r,i){return r||(r=$e(e.doc,t.line)),Vn(e,r,Ln(e,r,t.ch,i),n)}function Kn(e,t,n,r,i,a){function o(t,o){var l=Mn(e,i,t,o?"right":"left",a);return o?l.left=l.right:l.right=l.left,Vn(e,r,l,n)}r=r||$e(e.doc,t.line),i||(i=An(e,r));var l=ce(r,e.doc.direction),s=t.ch,c=t.sticky;if(s>=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return o("before"==c?s-1:s,"before"==c);function u(e,t,n){return o(n?e-1:e,1==l[t].level!=n)}var d=le(l,s,c),f=oe,p=u(s,d,"before"==c);return null!=f&&(p.other=u(s,f,"before"!=c)),p}function Gn(e,t){var n=0;t=lt(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=$e(e.doc,t.line),i=Ht(r)+Cn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Jn(e,t,n,r,i){var a=et(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Zn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Jn(r.first,0,null,-1,-1);var i=Xe(r,n),a=r.first+r.size-1;if(i>a)return Jn(r.first+r.size-1,$e(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=$e(r,i);;){var l=er(e,o,i,t,n),s=Pt(o,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;o=$e(r,i=c.line)}}function Xn(e,t,n,r){r-=Hn(t);var i=t.text.length,a=ae((function(t){return Mn(e,n,t-1).bottom<=r}),i,0);return{begin:a,end:i=ae((function(t){return Mn(e,n,t).top>r}),a,i)}}function Yn(e,t,n,r){return n||(n=An(e,t)),Xn(e,t,n,Vn(e,t,Mn(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Ht(t);var a=An(e,t),o=Hn(t),l=0,s=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?nr:tr)(e,t,n,a,u,r,i);l=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var f,p,h=null,m=null,g=ae((function(t){var n=Mn(e,a,t);return n.top+=o,n.bottom+=o,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),l,s),v=!1;if(m){var b=r-m.left<m.right-r,y=b==c;g=h+(y?0:1),p=y?"after":"before",f=b?m.left:m.right}else{c||g!=s&&g!=l||g++,p=0==g?"after":g==t.text.length?"before":Mn(e,a,g-(c?1:0)).bottom+o<=i==c?"after":"before";var x=Kn(e,et(n,g,p),"line",t,a);f=x.left,v=i<x.top?-1:i>=x.bottom?1:0}return Jn(n,g=ie(t.text,g,1),p,v,r-f)}function tr(e,t,n,r,i,a,o){var l=ae((function(l){var s=i[l],c=1!=s.level;return Qn(Kn(e,et(n,c?s.to:s.from,c?"before":"after"),"line",t,r),a,o,!0)}),0,i.length-1),s=i[l];if(l>0){var c=1!=s.level,u=Kn(e,et(n,c?s.from:s.to,c?"after":"before"),"line",t,r);Qn(u,a,o,!0)&&u.top>o&&(s=i[l-1])}return s}function nr(e,t,n,r,i,a,o){var l=Xn(e,t,r,o),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=c||p.to<=s)){var h=Mn(e,r,1!=p.level?Math.min(c,p.to)-1:Math.max(s,p.from)).right,m=h<a?a-h+1e9:h-a;(!u||d>m)&&(u=p,d=m)}}return u||(u=i[i.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(_("br"));Dn.appendChild(document.createTextNode("x"))}T(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),N(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),n=_("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ar(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var l=e.display.gutterSpecs[o].className;n[l]=a.offsetLeft+a.clientLeft+i,r[l]=a.clientWidth}return{fixedPos:or(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function or(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Wt(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function sr(e){var t=e.doc,n=lr(e);t.iter((function(e){var t=n(e);t!=e.height&&Je(e,t)}))}function cr(e,t,n,r){var i=e.display;if(!n&&"true"==Ce(t).getAttribute("cm-not-content"))return null;var a,o,l=i.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left,o=t.clientY-l.top}catch(e){return null}var s,c=Zn(e,a,o);if(r&&c.xRel>0&&(s=$e(e.doc,c.line).text).length==c.ch){var u=R(s,s.length,e.options.tabSize)-s.length;c=et(c.line,Math.max(0,Math.round((a-En(e.display).left)/ir(e.display))-u))}return c}function ur(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function dr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)kt&&zt(e.doc,t)<i.viewTo&&pr(e);else if(n<=i.viewFrom)kt&&Bt(e.doc,n+r)>i.viewFrom?pr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)pr(e);else if(t<=i.viewFrom){var a=hr(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):pr(e)}else if(n>=i.viewTo){var o=hr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):pr(e)}else{var l=hr(e,t,t,-1),s=hr(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(an(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):pr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function fr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[ur(e,t)];if(null!=a.node){var o=a.changes||(a.changes=[]);-1==B(o,n)&&o.push(n)}}}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,n,r){var i,a=ur(e,t),o=e.display.view;if(!kt||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(var l=e.display.viewFrom,s=0;s<a;s++)l+=o[s].size;if(l!=t){if(r>0){if(a==o.length-1)return null;i=l+o[a].size-t,a++}else i=l-t;t+=i,n+=i}for(;zt(e.doc,n)!=n;){if(a==(r<0?0:o.length-1))return null;n+=r*o[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(t||o!=n.sel.primIndex){var l=n.sel.ranges[o];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&br(e,l.head,i),s||xr(e,l,a)}}return r}function br(e,t,n){var r=Kn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(_("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var a=n.appendChild(_("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function yr(e,t){return e.top-t.top||e.left-t.left}function xr(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=En(e.display),l=o.left,s=Math.max(r.sizerWidth,Nn(e)-r.sizer.offsetLeft)-o.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var a,o,d=$e(i,t),f=d.text.length;function p(n,r){return $n(e,et(t,n),"div",d,r)}function h(t,n,r){var i=Yn(e,d,null,t),a="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),a)[a]}var m=ce(d,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),1==o.level?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,(function(e,t,i,d){var g="ltr"==i,v=p(e,g?"left":"right"),b=p(t-1,g?"right":"left"),y=null==n&&0==e,x=null==r&&t==f,w=0==d,k=!m||d==m.length-1;if(b.top-v.top<=3){var C=(c?x:y)&&k,S=(c?y:x)&&w?l:(g?v:b).left,E=C?s:(g?b:v).right;u(S,v.top,E-S,v.bottom)}else{var O,N,T,_;g?(O=c&&y&&w?l:v.left,N=c?s:h(e,i,"before"),T=c?l:h(t,i,"after"),_=c&&x&&k?s:b.right):(O=c?h(e,i,"before"):l,N=!c&&y&&w?s:v.right,T=!c&&x&&k?l:b.left,_=c?h(t,i,"after"):s),u(O,v.top,N-O,v.bottom),v.bottom<b.top&&u(l,v.bottom,null,b.top),u(T,b.top,_-T,b.bottom)}(!a||yr(v,a)<0)&&(a=v),yr(b,a)<0&&(a=b),(!o||yr(v,o)<0)&&(o=v),yr(b,o)<0&&(o=b)})),{start:a,end:o}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var h=$e(i,f.line),m=$e(i,p.line),g=Rt(h)==Rt(m),v=d(f.line,f.ch,g?h.text.length+1:null).end,b=d(p.line,g?0:null,p.ch).start;g&&(v.top<b.top-2?(u(v.right,v.top,null,v.bottom),u(l,b.top,b.left,b.bottom)):u(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&u(l,v.bottom,null,b.top)}n.appendChild(a)}function wr(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()||Er(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function kr(e){e.state.focused||(e.display.input.focus(),Sr(e))}function Cr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wr(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,O(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Or(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],a=e.options.lineWrapping,s=void 0,c=0;if(!i.hidden){if(o&&l<8){var u=i.node.offsetTop+i.node.offsetHeight;s=u-n,n=u}else{var d=i.node.getBoundingClientRect();s=d.bottom-d.top,!a&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-s;if((f>.005||f<-.005)&&(Je(i.line,s),Nr(i.line),i.rest))for(var p=0;p<i.rest.length;p++)Nr(i.rest[p]);if(c>e.display.sizerWidth){var h=Math.ceil(c/ir(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Nr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Tr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Cn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,a=Xe(t,r),o=Xe(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<a?(a=l,o=Xe(t,Ht($e(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(a=Xe(t,Ht($e(t,s))-e.wrapper.clientHeight),o=s)}return{from:a,to:Math.max(o,a+1)}}function _r(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,a=Tn(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+Sn(n),s=t.top<r,c=t.bottom>l-r;if(t.top<i)o.scrollTop=s?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(c?l:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Nn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(h?0:10)-p),o}function Lr(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function jr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ar(e,t,n){null==t&&null==n||Mr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Mr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Dr(e,Gn(e,t.from),Gn(e,t.to),t.margin))}function Dr(e,t,n,r){var i=_r(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Ar(e,i.scrollLeft,i.scrollTop)}function Ir(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),Pr(e,t,!0),n&&si(e),ri(e,100))}function Pr(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 Fr(e,t,n,r){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)&&!r||(e.doc.scrollLeft=t,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Rr(e){var t=e.display,n=t.gutters.offsetWidth,r=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:r,scrollHeight:r+On(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zr=function(e,t,n){this.cm=n;var r=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var e=b&&!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},zr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Br=function(){};function Wr(e,t){t||(t=Rr(e));var n=e.display.barWidth,r=e.display.barHeight;qr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Or(e),qr(e,Rr(e)),n=e.display.barWidth,r=e.display.barHeight}function qr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Br.prototype.update=function(){return{bottom:0,right:0}},Br.prototype.setScrollLeft=function(){},Br.prototype.setScrollTop=function(){},Br.prototype.clear=function(){};var Hr={native:zr,null:Br};function Vr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(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?Fr(e,t):Ir(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}var Ur=0;function $r(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:++Ur},t=e.curOp,on?on.ops.push(t):t.ownsGroup=on={ops:[t],delayedCallbacks:[]}}function Kr(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 r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{on=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++)Gr(t[n]);for(var r=0;r<t.length;r++)Jr(t[r]);for(var i=0;i<t.length;i++)Zr(t[i]);for(var a=0;a<t.length;a++)Xr(t[a]);for(var o=0;o<t.length;o++)Yr(t[o])}(e)}))}function Gr(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=On(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=On(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Ut(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 ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jr(e){e.updatedDisplay=e.mustUpdate&&oi(e.cm,e.update)}function Zr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Or(t),e.barMeasure=Rr(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+On(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Nn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==A();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wr(t,e.barMeasure),e.updatedDisplay&&ui(t,e.barMeasure),e.selectionChanged&&wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&kr(e.cm)}function Yr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&li(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Fr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var a=_("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+On(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}(t,function(e,t,n,r){var i;null==r&&(r=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 a=0;a<5;a++){var o=!1,l=Kn(e,t),s=n&&n!=t?Kn(e,n):l,c=_r(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Ir(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=c.scrollLeft&&(Fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}(t,lt(r,e.scrollToPos.from),lt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||he(i[o],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&he(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qr(e,t){if(e.curOp)return t();$r(e);try{return t()}finally{Kr(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);$r(e);try{return t.apply(e,arguments)}finally{Kr(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);$r(this);try{return e.apply(this,arguments)}finally{Kr(this)}}}function ni(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);$r(t);try{return e.apply(this,arguments)}finally{Kr(t)}}}function ri(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(a){if(r.line>=e.display.viewFrom){var o=a.styles,l=a.text.length>e.options.maxHighlightLength?qe(t.mode,r.state):null,s=dt(e,a,r,!0);l&&(r.state=l),a.styles=s.styles;var c=a.styleClasses,u=s.classes;u?a.styleClasses=u:c&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&ht(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qr(e,(function(){for(var t=0;t<i.length;t++)fr(e,i[t],"text")}))}}var ai=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Tr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Nn(e),this.force=n,this.dims=ar(e),this.events=[]};function oi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return pr(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==mr(e))return!1;fi(e)&&(pr(e),t.dims=ar(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),kt&&(a=zt(e.doc,a),o=Bt(e.doc,o));var l=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(an(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n}(e,a,o),n.viewOffset=Ht($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mr(e);if(!l&&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=A();if(!t||!j(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&j(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function l(t){var n=t.nextSibling;return s&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var f=c[d];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;o!=f.node;)o=l(o);var p=i&&null!=t&&t<=u&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(p=!1),un(e,f,u,n)),p&&(N(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),o=f.node.nextSibling}else{var h=vn(e,f,u,n);a.insertBefore(h,o)}u+=f.size}for(;o;)o=l(o)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=A()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&j(document.body,e.anchorNode)&&j(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),N(n.cursorDiv),N(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Nn(e))r&&(t.visible=Tr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Tn(e),n.top)}),t.visible=Tr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!oi(e,t))break;Or(e);var i=Rr(e);gr(e),Wr(e,i),ui(e,i),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 si(e,t){var n=new ai(e,t);if(oi(e,n)){Or(e),li(e,n);var r=Rr(e);gr(e),Wr(e,r),ui(e,r),n.finish()}}function ci(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ui(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+On(e)+"px"}function di(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=or(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var l=n[o].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function fi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Qe(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(_("div",[_("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ci(e.display),!0}return!1}function pi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if("string"!=typeof a&&(o=a.style,a=a.className),"CodeMirror-linenumbers"==a){if(!t)continue;r=!0}n.push({className:a,style:o})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function hi(e){var t=e.gutters,n=e.gutterSpecs;N(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,l=t.appendChild(_("div",null,"CodeMirror-gutter "+a));o&&(l.style.cssText=o),"CodeMirror-linenumbers"==a&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ci(e)}function mi(e){hi(e.display),dr(e),di(e)}function gi(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=L("div",null,"CodeMirror-code"),a.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=_("div",null,"CodeMirror-cursors"),a.measure=_("div",null,"CodeMirror-measure"),a.lineMeasure=_("div",null,"CodeMirror-measure"),a.lineSpace=L("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var c=L("div",[a.lineSpace],"CodeMirror-lines");a.mover=_("div",[c],null,"position: relative"),a.sizer=_("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=_("div",null,null,"position: absolute; height: 50px; width: 1px;"),a.gutters=_("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=_("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=_("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),o&&l<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),s||n&&v||(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=pi(i.gutters,i.lineNumbers),hi(a),r.init(a)}ai.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var vi=0,bi=null;function yi(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 xi(e){var t=yi(e);return t.x*=bi,t.y*=bi,t}function wi(e,t){var r=yi(t),i=r.x,a=r.y,o=e.display,l=o.scroller,c=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(i&&c||a&&u){if(a&&b&&s)e:for(var f=t.target,p=o.view;f!=l;f=f.parentNode)for(var h=0;h<p.length;h++)if(p[h].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=bi)return a&&u&&Ir(e,Math.max(0,l.scrollTop+a*bi)),Fr(e,Math.max(0,l.scrollLeft+i*bi)),(!a||a&&u)&&ye(t),void(o.wheelStartX=null);if(a&&null!=bi){var m=a*bi,g=e.doc.scrollTop,v=g+o.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),si(e,{top:g,bottom:v})}vi<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=i,o.wheelDY=a,setTimeout((function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(bi=(bi*vi+n)/(vi+1),++vi)}}),200)):(o.wheelDX+=i,o.wheelDY+=a))}}o?bi=-.53:n?bi=15:u?bi=-.7:f&&(bi=-1/3);var ki=function(e,t){this.ranges=e,this.primIndex=t};ki.prototype.primary=function(){return this.ranges[this.primIndex]},ki.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],r=e.ranges[t];if(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},ki.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ci(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new ki(e,this.primIndex)},ki.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ki.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var Ci=function(e,t){this.anchor=e,this.head=t};function Si(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=B(t,i);for(var a=1;a<t.length;a++){var o=t[a],l=t[a-1],s=tt(l.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var c=at(l.from(),o.from()),u=it(l.to(),o.to()),d=l.empty()?o.from()==o.head:l.from()==l.head;a<=n&&--n,t.splice(--a,2,new Ci(d?u:c,d?c:u))}}return new ki(t,n)}function Ei(e,t){return new ki([new Ci(e,t||e)],0)}function Oi(e){return e.text?et(e.from.line+e.text.length-1,G(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ni(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Oi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Oi(t).ch-t.to.ch),et(n,r)}function Ti(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ci(Ni(i.anchor,t),Ni(i.head,t)))}return Si(e.cm,n,e.sel.primIndex)}function _i(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 Li(e){e.doc.mode=ze(e.options,e.doc.modeOption),ji(e)}function ji(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,ri(e,100),e.state.modeGen++,e.curOp&&dr(e)}function Ai(e,t){return 0==t.from.ch&&0==t.to.ch&&""==G(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mi(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Tt(e),_t(e,n);var i=r?r(e):1;i!=e.height&&Je(e,i)}(e,n,i,r),sn(e,"change",e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new $t(c[a],i(a),r));return n}var l=t.from,s=t.to,c=t.text,u=$e(e,l.line),d=$e(e,s.line),f=G(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,o(0,c.length)),e.remove(c.length,e.size-c.length);else if(Ai(e,t)){var m=o(0,c.length-1);a(d,d.text,p),h&&e.remove(l.line,h),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)a(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),p);else{var g=o(1,c.length-1);g.push(new $t(f+u.text.slice(s.ch),p,r)),a(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,g)}else if(1==c.length)a(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{a(u,u.text.slice(0,l.ch)+c[0],i(0)),a(d,f+d.text.slice(s.ch),p);var v=o(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,v)}sn(e,"change",e,t)}function Di(e,t,n){!function e(r,i,a){if(r.linked)for(var o=0;o<r.linked.length;++o){var l=r.linked[o];if(l.doc!=i){var s=a&&l.sharedHist;n&&!s||(t(l.doc,s),e(l.doc,r,s))}}}(e,null,!0)}function Ii(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,sr(e),Li(e),Pi(e),e.options.lineWrapping||Ut(e),e.options.mode=t.modeOption,dr(e)}function Pi(e){("rtl"==e.doc.direction?M:O)(e.display.lineDiv,"CodeMirror-rtl")}function Fi(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 Ri(e,t){var n={from:rt(t.from),to:Oi(t),text:Ke(e,t.from,t.to)};return Hi(e,n,t.from.line,t.to.line+1),Di(e,(function(e){return Hi(e,n,t.from.line,t.to.line+1)}),!0),n}function zi(e){for(;e.length&&G(e).ranges;)e.pop()}function Bi(e,t,n,r){var i=e.history;i.undone.length=0;var a,o,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=function(e,t){return t?(zi(e.done),G(e.done)):e.done.length&&!G(e.done).ranges?G(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),G(e.done)):void 0}(i,i.lastOp==r)))o=G(a.changes),0==tt(t.from,t.to)&&0==tt(t.from,o.to)?o.to=Oi(t):a.changes.push(Ri(e,t));else{var s=G(i.done);for(s&&s.ranges||qi(e.sel,i.done),a={changes:[Ri(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,o||he(e,"historyAdded")}function Wi(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,a,G(i.done),t))?i.done[i.done.length-1]=t:qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&!1!==r.clearRedo&&zi(i.undone)}function qi(e,t){var n=G(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Hi(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=n.markedSpans),++a}))}function Vi(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 Ui(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Vi(n[i]));return r}(e,t),r=Ot(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)e:for(var l=0;l<o.length;++l){for(var s=o[l],c=0;c<a.length;++c)if(a[c].marker==s.marker)continue e;a.push(s)}else o&&(n[i]=o)}return n}function $i(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges)r.push(n?ki.prototype.deepCopy.call(a):a);else{var o=a.changes,l=[];r.push({changes:l});for(var s=0;s<o.length;++s){var c=o[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(G(l)[d]=c[d],delete c[d])}}}return r}function Ki(e,t,n,r){if(r){var i=e.anchor;if(n){var a=tt(t,i)<0;a!=tt(n,i)<0?(i=t,t=n):a!=tt(t,n)<0&&(t=n)}return new Ci(i,t)}return new Ci(n||t,t)}function Gi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qi(e,new ki([Ki(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Ki(e.sel.ranges[a],t[a],null,i);Qi(e,Si(e.cm,r,e.sel.primIndex),n)}function Zi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qi(e,Si(e.cm,i,e.sel.primIndex),r)}function Xi(e,t,n,r){Qi(e,Ei(t,n),r)}function Yi(e,t,n){var r=e.history.done,i=G(r);i&&i.ranges?(r[r.length-1]=t,ea(e,t,n)):Qi(e,t,n)}function Qi(e,t,n){ea(e,t,n),Wi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ea(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Ci(lt(e,t[n].anchor),lt(e,t[n].head))},origin:n&&n.origin};return he(e,"beforeSelectionChange",e,r),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Si(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ta(e,ra(e,t,r,!0)),n&&!1===n.scroll||!e.cm||jr(e.cm)}function ta(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),sn(e,"cursorActivity",e))}function na(e){ta(e,ra(e,e.sel,null,!1))}function ra(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],s=aa(e,o.anchor,l&&l.anchor,n,r),c=aa(e,o.head,l&&l.head,n,r);(i||s!=o.anchor||c!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Ci(s,c))}return i?Si(e.cm,i,t.primIndex):t}function ia(e,t,n,r,i){var a=$e(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var l=a.markedSpans[o],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(i&&(he(s,"beforeCursorEnter"),s.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),f=void 0;if((r<0?u:c)&&(d=oa(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=tt(d,n))&&(r<0?f<0:f>0))return ia(e,d,t,r,i)}var p=s.find(r<0?-1:1);return(r<0?c:u)&&(p=oa(e,p,r,p.line==t.line?a:null)),p?ia(e,p,t,r,i):null}}return t}function aa(e,t,n,r,i){var a=r||1,o=ia(e,t,n,a,i)||!i&&ia(e,t,n,a,!0)||ia(e,t,n,-a,i)||!i&&ia(e,t,n,-a,!0);return o||(e.cantEdit=!0,et(e.first,0))}function oa(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?lt(e,et(t.line-1)):null:n>0&&t.ch==(r||$e(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 la(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),q)}function sa(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=lt(e,t)),n&&(r.to=lt(e,n)),i&&(r.text=i),void 0!==a&&(r.origin=a)}),he(e,"beforeChange",e,r),e.cm&&he(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ca(e,t,n){if(e.cm){if(!e.cm.curOp)return ei(e.cm,ca)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=sa(e,t,!0))){var r=wt&&!n&&function(e,t,n){var r=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||r&&-1!=B(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],l=o.find(0),s=0;s<i.length;++s){var c=i[s];if(!(tt(c.to,l.from)<0||tt(c.from,l.to)>0)){var u=[s,1],d=tt(c.from,l.from),f=tt(c.to,l.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ua(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ua(e,t)}}function ua(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ti(e,t);Bi(e,t,n,e.cm?e.cm.curOp.id:NaN),pa(e,t,n,Ot(e,t));var r=[];Di(e,(function(e,n){n||-1!=B(r,e.history)||(va(e.history,t),r.push(e.history)),pa(e,t,null,Ot(e,t))}))}}function da(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,a=e.history,o=e.sel,l="undo"==t?a.done:a.undone,s="undo"==t?a.undone:a.done,c=0;c<l.length&&(i=l[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=l.length){for(a.lastOrigin=a.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(r)return void l.push(i);break}if(qi(i,s),n&&!i.equals(e.sel))return void Qi(e,i,{clearRedo:!1});o=i}var u=[];qi(o,s),s.push({changes:u,generation:a.generation}),a.generation=i.generation||++a.maxGeneration;for(var d=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!sa(e,r,!1))return l.length=0,{};u.push(Ri(e,r));var a=n?Ti(e,r):G(l);pa(e,r,a,Ui(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Oi(r)});var o=[];Di(e,(function(e,t){t||-1!=B(o,e.history)||(va(e.history,r),o.push(e.history)),pa(e,r,null,Ui(e,r))}))},p=i.changes.length-1;p>=0;--p){var h=f(p);if(h)return h.v}}}}function fa(e,t){if(0!=t&&(e.first+=t,e.sel=new ki(J(e.sel.ranges,(function(e){return new Ci(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)fr(e.cm,r,"gutter")}}function pa(e,t,n,r){if(e.cm&&!e.cm.curOp)return ei(e.cm,pa)(e,t,n,r);if(t.to.line<e.first)fa(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 i=t.text.length-1-(e.first-t.from.line);fa(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[G(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:et(a,$e(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ke(e,t.from,t.to),n||(n=Ti(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,l=!1,s=a.line;e.options.lineWrapping||(s=Ze(Rt($e(r,a.line))),r.iter(s,o.line+1,(function(e){if(e==i.maxLine)return l=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Mi(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(s,a.line+t.text.length,(function(e){var t=Vt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=$e(e,r).stateAfter;if(i&&(!(i instanceof ct)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,a.line),ri(e,400);var c=t.text.length-(o.line-a.line)-1;t.full?dr(e):a.line!=o.line||1!=t.text.length||Ai(e.doc,t)?dr(e,a.line,o.line+1,c):fr(e,a.line,"text");var u=ve(e,"changes"),d=ve(e,"change");if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&sn(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,r):Mi(e,t,r),ea(e,n,q),e.cantEdit&&aa(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function ha(e,t,n,r,i){var a;r||(r=n),tt(r,n)<0&&(n=(a=[r,n])[0],r=a[1]),"string"==typeof t&&(t=e.splitLines(t)),ca(e,{from:n,to:r,text:t,origin:i})}function ma(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ga(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||((a=e[i]=a.deepCopy()).copied=!0);for(var l=0;l<a.ranges.length;l++)ma(a.ranges[l].anchor,t,n,r),ma(a.ranges[l].head,t,n,r)}else{for(var s=0;s<a.changes.length;++s){var c=a.changes[s];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}}function va(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;ga(e.done,n,r,i),ga(e.undone,n,r,i)}function ba(e,t,n,r){var i=t,a=t;return"number"==typeof t?a=$e(e,ot(e,t)):i=Ze(t),null==i?null:(r(a,i)&&e.cm&&fr(e.cm,i,n),a)}function ya(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 xa(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Ci.prototype.from=function(){return at(this.anchor,this.head)},Ci.prototype.to=function(){return it(this.anchor,this.head)},Ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ya.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Kt(i),sn(i,"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 r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},xa.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),0==(t-=a))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ya))){var l=[];this.collapse(l),this.children=[new ya(l)],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 r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,l=o;l<i.lines.length;){var s=new ya(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new xa(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=B(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new xa(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if(0==(t-=o))break;e=0}else e-=a}}};var wa=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function ka(e,t,n){Ht(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Lr(e,n)}wa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ze(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=wn(this);Je(n,Math.max(0,n.height-a)),e&&(Qr(e,(function(){ka(e,n,-a),fr(e,r,"widget")})),sn(e,"lineWidgetCleared",e,this,r))}},wa.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=wn(this)-t;i&&(Wt(this.doc,r)||Je(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,ka(n,r,i),sn(n,"lineWidgetChanged",n,e,Ze(r))})))},be(wa);var Ca=0,Sa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ca};function Ea(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=F(r)).shared=!1;var a=[Ea(e,t,n,r,i)],o=a[0],l=r.widgetNode;return Di(e,(function(e){l&&(r.widgetNode=l.cloneNode(!0)),a.push(Ea(e,lt(e,t),lt(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;o=G(a)})),new Oa(a,o)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,Ea)(e,t,n,r,i);var a=new Sa(e,i),o=tt(t,n);if(r&&F(r,a,!1),o>0||0==o&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=L("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ft(e,t.line,t,n,a)||t.line!=n.line&&Ft(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");kt=!0}a.addToHistory&&Bi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(e){c&&a.collapsed&&!c.options.lineWrapping&&Rt(e)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&Je(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Ct(a,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s})),a.collapsed&&e.iter(t.line,n.line+1,(function(t){Wt(e,t)&&Je(t,0)})),a.clearOnEnter&&de(a,"beforeCursorEnter",(function(){return a.clear()})),a.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Ca,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)dr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)fr(c,u,"text");a.atomic&&na(c.doc),sn(c,"markerAdded",c,a)}return a}Sa.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&$r(e),ve(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],l=St(o.markedSpans,this);e&&!this.collapsed?fr(e,Ze(o),"text"):e&&(null!=l.to&&(i=Ze(o)),null!=l.from&&(r=Ze(o))),o.markedSpans=Et(o.markedSpans,l),null==l.from&&this.collapsed&&!Wt(this.doc,o)&&e&&Je(o,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Rt(this.lines[s]),u=Vt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&na(e.doc)),e&&sn(e,"markerCleared",e,this,r,i),t&&Kr(e),this.parent&&this.parent.clear()}},Sa.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var a=this.lines[i],o=St(a.markedSpans,this);if(null!=o.from&&(n=et(t?a:Ze(a),o.from),-1==e))return n;if(null!=o.to&&(r=et(t?a:Ze(a),o.to),1==e))return r}return n&&{from:n,to:r}},Sa.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Qr(r,(function(){var i=t.line,a=Ze(t.line),o=jn(r,a);if(o&&(Rn(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Wt(n.doc,i)&&null!=n.height){var l=n.height;n.height=null;var s=wn(n)-l;s&&Je(i,i.height+s)}sn(r,"markerChanged",r,e)}))},Sa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Sa.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(Sa);var Oa=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Na(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ta(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Di(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var a=n.markers[i];-1==B(r,a.doc)&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}Oa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sn(this,"clear")}},Oa.prototype.find=function(e,t){return this.primary.find(e,t)},be(Oa);var _a=0,La=function(e,t,n,r,i){if(!(this instanceof La))return new La(e,t,n,r,i);null==n&&(n=0),xa.call(this,[new ya([new $t("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=et(n,0);this.sel=Ei(a),this.history=new Fi(null),this.id=++_a,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mi(this,{from:a,to:a,text:e}),Qi(this,Ei(a),q)};La.prototype=X(xa.prototype,{constructor:La,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,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ge(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ni((function(e){var t=et(this.first,0),n=this.first+this.size-1;ca(this,{from:t,to:et(n,$e(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ar(this.cm,0,0),Qi(this,Ei(t),q)})),replaceRange:function(e,t,n,r){ha(this,e,t=lt(this,t),n=n?lt(this,n):t,r)},getRange:function(e,t,n){var r=Ke(this,lt(this,e),lt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ye(this,e))return $e(this,e)},getLineNumber:function(e){return Ze(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=$e(this,e)),Rt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(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:ni((function(e,t,n){Xi(this,lt(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:ni((function(e,t,n){Xi(this,lt(this,e),lt(this,t||e),n)})),extendSelection:ni((function(e,t,n){Gi(this,lt(this,e),t&&lt(this,t),n)})),extendSelections:ni((function(e,t){Ji(this,st(this,e),t)})),extendSelectionsBy:ni((function(e,t){Ji(this,st(this,J(this.sel.ranges,e)),t)})),setSelections:ni((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Ci(lt(this,e[i].anchor),lt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Qi(this,Si(this.cm,r,t),n)}})),addSelection:ni((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ci(lt(this,e),lt(this,t||e))),Qi(this,Si(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Ke(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Ke(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ni((function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var l=t&&"end"!=t&&function(e,t,n){for(var r=[],i=et(e.first,0),a=i,o=0;o<t.length;o++){var l=t[o],s=_i(l.from,i,a),c=_i(Oi(l),i,a);if(i=l.to,a=c,"around"==n){var u=e.sel.ranges[o],d=tt(u.head,u.anchor)<0;r[o]=new Ci(d?c:s,d?s:c)}else r[o]=new Ci(s,s)}return new ki(r,e.sel.primIndex)}(this,r,t),s=r.length-1;s>=0;s--)ca(this,r[s]);l?Yi(this,l):this.cm&&jr(this.cm)})),undo:ni((function(){da(this,"undo")})),redo:ni((function(){da(this,"redo")})),undoSelection:ni((function(){da(this,"undo",!0)})),redoSelection:ni((function(){da(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,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Fi(this.history.maxGeneration),Di(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:$i(this.history.done),undone:$i(this.history.undone)}},setHistory:function(e){var t=this.history=new Fi(this.history.maxGeneration);t.done=$i(e.done.slice(0),null,!0),t.undone=$i(e.undone.slice(0),null,!0)},setGutterMarker:ni((function(e,t,n){return ba(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ni((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ba(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(!Ye(this,e))return null;if(t=e,!(e=$e(this,e)))return null}else if(null==(t=Ze(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:ni((function(e,t,n){return ba(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ni((function(e,t,n){return ba(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var a=i.match(S(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(a.index&&o!=i.length?" ":"")+i.slice(o)||null}return!0}))})),addLineWidget:ni((function(e,t,n){return function(e,t,n,r){var i=new wa(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ba(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!Wt(e,t)){var r=Ht(t)<e.scrollTop;Je(t,t.height+wn(i)),r&&Lr(a,i.height),a.curOp.forceUpdate=!0}return!0})),a&&sn(a,"lineWidgetAdded",a,i,"number"==typeof t?t:Ze(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ea(this,lt(this,e),lt(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 Ea(this,e=lt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=$e(this,(e=lt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=lt(this,e),t=lt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(a){var o=a.markedSpans;if(o)for(var l=0;l<o.length;l++){var s=o[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n})),lt(this,et(n,t))},indexFromPos:function(e){var t=(e=lt(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 La(Ge(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 r=new La(Ge(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(tt(a,o)){var l=Ea(e,a,o,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}(r,Na(this)),r},unlinkDoc:function(e){if(e instanceof No&&(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),Ta(Na(this));break}if(e.history==this.history){var n=[e.id];Di(e,(function(e){return n.push(e.id)}),!0),e.history=new Fi(null),e.history.done=$i(this.history.done,n),e.history.undone=$i(this.history.undone,n)}},iterLinkedDocs:function(e){Di(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):je(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Qr(t=this.cm,(function(){Pi(t),dr(t)})))}))}),La.prototype.eachLine=La.prototype.iter;var ja=0;function Aa(e){var t=this;if(Ma(t),!me(t,e)&&!kn(t.display,e)){ye(e),o&&(ja=+new Date);var n=cr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),l=0,s=function(){++l==i&&ei(t,(function(){var e={from:n=lt(t.doc,n),to:n,text:t.doc.splitLines(a.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ca(t.doc,e),Yi(t.doc,Ei(lt(t.doc,n),lt(t.doc,Oi(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(a[n]=e),s()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[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 d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),ea(t.doc,Ei(n,n)),f)for(var p=0;p<f.length;++p)ha(t.doc,"",f[p].anchor,f[p].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ma(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Da(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Ia=!1;function Pa(){var e;Ia||(de(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Da(Fa)}),100))})),de(window,"blur",(function(){return Da(Er)})),Ia=!0)}function Fa(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ra={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"},za=0;za<10;za++)Ra[za+48]=Ra[za+96]=String(za);for(var Ba=65;Ba<=90;Ba++)Ra[Ba]=String.fromCharCode(Ba);for(var Wa=1;Wa<=12;Wa++)Ra[Wa+111]=Ra[Wa+63235]="F"+Wa;var qa={};function Ha(e){var t,n,r,i,a=e.split(/-(?!$)/);e=a[a.length-1];for(var o=0;o<a.length-1;o++){var l=a[o];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Va(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=J(n.split(" "),Ha),a=0;a<i.length;a++){var o=void 0,l=void 0;a==i.length-1?(l=i.join(" "),o=r):(l=i.slice(0,a+1).join(" "),o="...");var s=t[l];if(s){if(s!=o)throw new Error("Inconsistent bindings for "+l)}else t[l]=o}delete e[n]}for(var c in t)e[c]=t[c];return e}function Ua(e,t,n,r){var i=(t=Ja(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ua(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=Ua(e,t.fallthrough[a],n,r);if(o)return o}}}function $a(e){var t="string"==typeof e?e:Ra[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ka(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Ga(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Ra[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ka(n,e,t))}function Ja(e){return"string"==typeof e?qa[e]:e}function Za(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&tt(a.from,G(r).to)<=0;){var o=r.pop();if(tt(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Qr(e,(function(){for(var t=r.length-1;t>=0;t--)ha(e.doc,"",r[t].from,r[t].to,"+delete");jr(e)}))}function Xa(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ya(e,t,n){var r=Xa(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function Qa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var a=ce(n,t.doc.direction);if(a){var o,l=i<0?G(a):a[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var c=An(t,n);o=i<0?n.text.length-1:0;var u=Mn(t,c,o).top;o=ae((function(e){return Mn(t,c,e).top==u}),i<0==(1==l.level)?l.from:l.to-1,o),"before"==s&&(o=Xa(n,o,1))}else o=i<0?l.to:l.from;return new et(r,o,s)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}qa.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"},qa.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"},qa.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"},qa.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"]},qa.default=b?qa.macDefault:qa.pcDefault;var eo={selectAll:la,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Za(e,(function(t){if(t.empty()){var n=$e(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 Za(e,(function(t){return{from:et(t.from().line,0),to:lt(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Za(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Za(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 Za(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},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 to(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return no(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=$e(e.doc,t),r=function(e){for(var t;t=It(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Ze(r)),Qa(!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")}),V)},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")}),V)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?no(e,t.head):r}),V)},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(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=R(e.getLine(a.line),a.ch,r);t.push(K(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=$e(e.doc,i.line).text;if(a)if(i.ch==a.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=$e(e.doc,i.line-1).text;o&&(i=new et(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),et(i.line-1,o.length-1),i,"+transpose"))}n.push(new Ci(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(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 r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);jr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function to(e,t){var n=$e(e.doc,t),r=Rt(n);return r!=n&&(t=Ze(r)),Qa(!0,e,r,t,1)}function no(e,t){var n=to(e,t.line),r=$e(e.doc,n.line),i=ce(r,e.doc.direction);if(!i||0==i[0].level){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return et(n.line,o?0:a,n.sticky)}return n}function ro(e,t,n){if("string"==typeof t&&!(t=eo[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=W}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var io=new z;function ao(e,t,n,r){var i=e.state.keySeq;if(i){if($a(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:io.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),oo(e,i+" "+t,n,r))return!0}return oo(e,t,n,r)}function oo(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ua(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ua(t,e.options.extraKeys,n,e)||Ua(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(ye(n),wr(e)),!!i}function lo(e,t){var n=Ga(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ao(e,"Shift-"+n,t,(function(t){return ro(e,t,!0)}))||ao(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ro(e,t)})):ao(e,n,t,(function(t){return ro(e,t)})))}var so=null;function co(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=A(),me(t,e)))){o&&l<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=lo(t,e);d&&(so=i?r:null,i||88!=r||Me||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(O(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}M(t,"CodeMirror-crosshair"),de(document,"keyup",n),de(document,"mouseover",n)}(t)}}function uo(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function fo(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||kn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==so)return so=null,void ye(e);if(!d||e.which&&!(e.which<10)||!lo(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return ao(e,"'"+n+"'",t,(function(t){return ro(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var po,ho,mo=function(e,t,n){this.time=e,this.pos=t,this.button=n};function go(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,kn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!yo(t,e)){var r=cr(t,e),i=Se(e),a=r?function(e,t){var n=+new Date;return ho&&ho.compare(n,e,t)?(po=ho=null,"triple"):po&&po.compare(n,e,t)?(ho=new mo(n,e,t),po=null,"double"):(po=new mo(n,e,t),ho=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var a="Click";return"double"==r?a="Double"+a:"triple"==r&&(a="Triple"+a),ao(e,Ka(a=(1==t?"Left":2==t?"Middle":"Right")+a,i),i,(function(t){if("string"==typeof t&&(t=eo[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=W}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,a,e)||(1==i?r?function(e,t,n,r){o?setTimeout(P(kr,e),0):e.curOp.focus=A();var i,a=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var a=y?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(i=c.contains(t))>-1&&(tt((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,a=!1,c=ei(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",c),pe(i.wrapper.ownerDocument,"mousemove",u),pe(i.scroller,"dragstart",d),pe(i.scroller,"drop",c),a||(ye(t),r.addNew||Gi(e.doc,n,null,null,r.extend),s&&!f||o&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),de(i.wrapper.ownerDocument,"mouseup",c),de(i.wrapper.ownerDocument,"mousemove",u),de(i.scroller,"dragstart",d),de(i.scroller,"drop",c),Cr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,a):function(e,t,n,r){var i=e.display,a=e.doc;ye(t);var o,l,s=a.sel,c=s.ranges;if(r.addNew&&!r.extend?(l=a.sel.contains(n),o=l>-1?c[l]:new Ci(n,n)):(o=a.sel.primary(),l=a.sel.primIndex),"rectangle"==r.unit)r.addNew||(o=new Ci(n,n)),n=cr(e,t,!0,!0),l=-1;else{var u=vo(e,n,r.unit);o=r.extend?Ki(o,u.anchor,u.head,r.extend):u}r.addNew?-1==l?(l=c.length,Qi(a,Si(e,c.concat([o]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Qi(a,Si(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=a.sel):Zi(a,l,o,H):(l=0,Qi(a,new ki([o],0),H),s=a.sel);var d=n;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=R($e(a,n.line).text,n.ch,c),f=R($e(a,t.line).text,t.ch,c),p=Math.min(u,f),h=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=$e(a,m).text,b=U(v,p,c);p==h?i.push(new Ci(et(m,b),et(m,b))):v.length>b&&i.push(new Ci(et(m,b),et(m,U(v,h,c))))}i.length||i.push(new Ci(n,n)),Qi(a,Si(e,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,x=o,w=vo(e,t,r.unit),k=x.anchor;tt(w.anchor,k)>0?(y=w.head,k=at(x.from(),w.anchor)):(y=w.anchor,k=it(x.to(),w.head));var C=s.ranges.slice(0);C[l]=function(e,t){var n=t.anchor,r=t.head,i=$e(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var a=ce(i);if(!a)return t;var o=le(a,n.ch,n.sticky),l=a[o];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,c=o+(l.from==n.ch==(1!=l.level)?0:1);if(0==c||c==a.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=le(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(1==l.level?-1:1);s=u==c-1||u==c?d<0:d>0}var f=a[c+(s?-1:0)],p=s==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new Ci(new et(n.line,h,m),r)}(e,new Ci(lt(a,k),y)),Qi(a,Si(e,C,l),H)}}var p=i.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,t&&(ye(t),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",g),pe(i.wrapper.ownerDocument,"mouseup",v),a.history.lastSelOrigin=null}var g=ei(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var o=++h,l=cr(e,n,!0,"rectangle"==r.unit);if(l)if(0!=tt(l,d)){e.curOp.focus=A(),f(l);var s=Tr(i,a);(l.line>=s.to||l.line<s.from)&&setTimeout(ei(e,(function(){h==o&&t(n)})),150)}else{var c=n.clientY<p.top?-20:n.clientY>p.bottom?20:0;c&&setTimeout(ei(e,(function(){h==o&&(i.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),v=ei(e,m);e.state.selectingText=v,de(i.wrapper.ownerDocument,"mousemove",g),de(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,a)}(t,r,a,e):Ce(e)==n.scroller&&ye(e):2==i?(r&&Gi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?t.display.input.onContextMenu(e):Cr(t)))}}function vo(e,t,n){if("char"==n)return new Ci(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Ci(et(t.line,0),lt(e.doc,et(t.line+1,0)));var r=n(e,t);return new Ci(r.from,r.to)}function bo(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ye(t);var o=e.display,l=o.lineDiv.getBoundingClientRect();if(a>l.bottom||!ve(e,n))return we(t);a-=l.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=o.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return he(e,n,e,Xe(e.doc,a),e.display.gutterSpecs[s].className,t),we(t)}}function yo(e,t){return bo(e,t,"gutterClick",!0)}function xo(e,t){kn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&bo(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function wo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Bn(e)}mo.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var ko={toString:function(){return"CodeMirror.Init"}},Co={},So={};function Eo(e,t,n){if(!t!=!(n&&n!=ko)){var r=e.display.dragFunctions,i=t?de:pe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Oo(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),Ut(e)),sr(e),dr(e),Bn(e),setTimeout((function(){return Wr(e)}),100)}function No(e,t){var n=this;if(!(this instanceof No))return new No(e,t);this.options=t=t?F(t):{},F(Co,t,!1);var r=t.value;"string"==typeof r?r=new La(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new No.inputStyles[t.inputStyle](this),a=this.display=new gi(e,r,i,t);for(var c in a.wrapper.CodeMirror=this,wo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vr(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&&a.input.focus(),o&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",ei(e,go)),de(t.scroller,"dblclick",o&&l<11?ei(e,(function(t){if(!me(e,t)){var n=cr(e,t);if(n&&!yo(e,t)&&!kn(e.display,t)){ye(t);var r=e.findWordAt(n);Gi(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||ye(t)}),de(t.scroller,"contextmenu",(function(t){return xo(e,t)})),de(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xo(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}de(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!yo(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!r.prev||a(r,r.prev)?new Ci(l,l):!r.prev.prev||a(r,r.prev.prev)?e.findWordAt(l):new Ci(et(l.line,0),lt(e.doc,et(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ye(n)}i()})),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ir(e,t.scroller.scrollTop),Fr(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return wi(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return wi(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||ke(t)},over:function(t){me(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();br(e,n,r),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}}(e,t),ke(t))},start:function(t){return function(e,t){if(o&&(!e.state.draggingText||+new Date-ja<100))ke(t);else if(!me(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=_("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Aa),leave:function(t){me(e,t)||Ma(e)}};var s=t.input.getField();de(s,"keyup",(function(t){return uo.call(e,t)})),de(s,"keydown",ei(e,co)),de(s,"keypress",ei(e,fo)),de(s,"focus",(function(t){return Sr(e,t)})),de(s,"blur",(function(t){return Er(e,t)}))}(this),Pa(),$r(this),this.curOp.forceUpdate=!0,Ii(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):Er(this),So)So.hasOwnProperty(c)&&So[c](this,t[c],ko);fi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<To.length;++u)To[u](this);Kr(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}No.defaults=Co,No.optionHandlers=So;var To=[];function _o(e,t,n,r){var i,a=e.doc;null==n&&(n="add"),"smart"==n&&(a.mode.indent?i=pt(e,t).state:n="prev");var o=e.options.tabSize,l=$e(a,t),s=R(l.text,null,o);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((c=a.mode.indent(i,l.text.slice(u.length),l.text))==W||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>a.first?R($e(a,t-1).text,null,o):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/o);p;--p)f+=o,d+="\t";if(f<c&&(d+=K(c-f)),d!=u)return ha(a,d,et(t,0),et(t,u.length),"+input"),l.stateAfter=null,!0;for(var h=0;h<a.sel.ranges.length;h++){var m=a.sel.ranges[h];if(m.head.line==t&&m.head.ch<u.length){var g=et(t,u.length);Zi(a,h,new Ci(g,g));break}}}No.defineInitHook=function(e){return To.push(e)};var Lo=null;function jo(e){Lo=e}function Ao(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var o=+new Date-200,l="paste"==i||e.state.pasteIncoming>o,s=je(t),c=null;if(l&&r.ranges.length>1)if(Lo&&Lo.text.join("\n")==t){if(r.ranges.length%Lo.text.length==0){c=[];for(var u=0;u<Lo.text.length;u++)c.push(a.splitLines(Lo.text[u]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=J(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=et(h.line,h.ch-n):e.state.overwrite&&!l?m=et(m.line,Math.min($e(a,m.line).text.length,m.ch+G(s).length)):l&&Lo&&Lo.lineWise&&Lo.text.join("\n")==s.join("\n")&&(h=m=et(h.line,0)));var g={from:h,to:m,text:c?c[f%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>o?"cut":"+input")};ca(e.doc,g),sn(e,"inputRead",e,g)}t&&!l&&Do(e,t),jr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Mo(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Ao(t,n,0,null,"paste")})),!0}function Do(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var l=0;l<a.electricChars.length;l++)if(t.indexOf(a.electricChars.charAt(l))>-1){o=_o(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test($e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=_o(e,i.head.line,"smart"));o&&sn(e,"electricInput",e,i.head.line)}}}function Io(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:et(i,0),head:et(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Po(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Fo(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Po(e),t}function Ro(e,t,n,r,i){var a=t,o=n,l=$e(e,t.line),s=i&&"rtl"==e.direction?-n:n;function c(a){var o,c;if("codepoint"==r){var u=l.text.charCodeAt(t.ch+(r>0?0:-1));o=isNaN(u)?null:new et(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else o=i?function(e,t,n,r){var i=ce(t,e.doc.direction);if(!i)return Ya(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=le(i,n.ch,n.sticky),o=i[a];if("ltr"==e.doc.direction&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return Ya(t,n,r);var l,s=function(e,n){return Xa(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(l=l||An(e,t),Yn(e,t,l,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==o.level){var d=1==o.level==r<0,f=s(n,d?1:-1);if(null!=f&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?"before":"after";return new et(n.line,f,p)}}var h=function(e,t,r){for(var a=function(e,t){return t?new et(n.line,s(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<i.length;e+=t){var o=i[e],l=t>0==(1!=o.level),c=l?r.begin:s(r.end,-1);if(o.from<=c&&c<o.to)return a(c,l);if(c=l?o.from:s(o.to,-1),r.begin<=c&&c<r.end)return a(c,l)}},m=h(a+r,r,u);if(m)return m;var g=r>0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,l,t,n):Ya(l,t,n);if(null==o){if(a||(c=t.line+s)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(l=$e(e,c))))return!1;t=Qa(i,e.cm,l,t.line,s)}else t=o;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var h=l.text.charAt(t.ch)||"\n",m=ee(h,f)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||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=aa(e,t,a,o,!0);return nt(a,g)&&(g.hitSide=!0),g}function zo(e,t,n,r){var i,a,o=e.doc,l=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(a=Zn(e,l,i)).outside;){if(n<0?i<=0:i>=o.height){a.hitSide=!0;break}i+=5*n}return a}var Bo=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 Wo(e,t){var n=jn(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),i=_n(n,r,t.line),a=ce(r,e.doc.direction),o="left";a&&(o=le(a,t.ch)%2?"right":"left");var l=Pn(i.map,t.ch,o);return l.offset="right"==l.collapse?l.end:l.start,l}function qo(e,t){return t&&(e.bad=!0),e}function Ho(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return qo(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return Vo(a,t,n)}}function Vo(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!j(r,t))return qo(et(Ze(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?G(e.rest):e.line;return qo(et(Ze(a),a.text.length),i)}var o=3==t.nodeType?t:null,l=t;for(o||1!=t.childNodes.length||3!=t.firstChild.nodeType||(o=t.firstChild,n&&(n=o.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,c=s.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var a=i<0?s.map:c[i],o=0;o<a.length;o+=3){var l=a[o+2];if(l==t||l==n){var u=Ze(i<0?e.line:e.rest[i]),d=a[o]+r;return(r<0||l!=t)&&(d=a[o+(r?1:0)]),et(u,d)}}}var d=u(o,l,n);if(d)return qo(d,i);for(var f=l.nextSibling,p=o?o.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0))return qo(et(d.line,d.ch-p),i);p+=f.textContent.length}for(var h=l.previousSibling,m=n;h;h=h.previousSibling){if(d=u(h,h.firstChild,-1))return qo(et(d.line,d.ch+m),i);m+=h.textContent.length}}Bo.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function a(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function o(e){if(a(e)&&!me(r,e)){if(r.somethingSelected())jo({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Io(r);jo({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,q),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Lo.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var l=Fo(),s=l.firstChild;r.display.lineSpace.insertBefore(l,r.display.lineSpace.firstChild),s.value=Lo.text.join("\n");var c=document.activeElement;I(s),setTimeout((function(){r.display.lineSpace.removeChild(l),c.focus(),c==i&&n.showPrimarySelection()}),50)}}Po(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),de(i,"paste",(function(e){!a(e)||me(r,e)||Mo(e,r)||l<=11&&setTimeout(ei(r,(function(){return t.updateFromDOM()})),20)})),de(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),de(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),de(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),de(i,"touchstart",(function(){return n.forceCompositionEnd()})),de(i,"input",(function(){t.composing||t.readFromDOMSoon()})),de(i,"copy",o),de(i,"cut",o)},Bo.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Bo.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Bo.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Bo.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Bo.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line<t.display.viewFrom)e.removeAllRanges();else{var o=Ho(t,e.anchorNode,e.anchorOffset),l=Ho(t,e.focusNode,e.focusOffset);if(!o||o.bad||!l||l.bad||0!=tt(at(o,l),i)||0!=tt(it(o,l),a)){var s=t.display.view,c=i.line>=t.display.viewFrom&&Wo(t,i)||{node:s[0].measure.map[2],offset:0},u=a.line<t.display.viewTo&&Wo(t,a);if(!u){var d=s[s.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(c&&u){var p,h=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)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Bo.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)},Bo.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Bo.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Bo.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return j(this.div,t)},Bo.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Bo.prototype.blur=function(){this.div.blur()},Bo.prototype.getField=function(){return this.div},Bo.prototype.supportsTouch=function(){return!0},Bo.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qr(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))}))},Bo.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Bo.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=Ho(t,e.anchorNode,e.anchorOffset),r=Ho(t,e.focusNode,e.focusOffset);n&&r&&Qr(t,(function(){Qi(t.doc,Ei(n,r),q),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Bo.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,a=r.doc.sel.primary(),o=a.from(),l=a.to();if(0==o.ch&&o.line>r.firstLine()&&(o=et(o.line-1,$e(r.doc,o.line-1).length)),l.ch==$e(r.doc,l.line).text.length&&l.line<r.lastLine()&&(l=et(l.line+1,0)),o.line<i.viewFrom||l.line>i.viewTo-1)return!1;o.line==i.viewFrom||0==(e=ur(r,o.line))?(t=Ze(i.view[0].line),n=i.view[0].node):(t=Ze(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,c,u=ur(r,l.line);if(u==i.view.length-1?(s=i.viewTo-1,c=i.lineDiv.lastChild):(s=Ze(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var a="",o=!1,l=e.doc.lineSeparator(),s=!1;function c(){o&&(a+=l,s&&(a+=l),o=s=!1)}function u(e){e&&(c(),a+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var a,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(et(r,0),et(i+1,0),(g=+f,function(e){return e.id==g}));return void(p.length&&(a=p[0].find(0))&&u(Ke(e.doc,a.from,a.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var m=0;m<t.childNodes.length;m++)d(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),h&&(o=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;d(t),t!=n;)t=t.nextSibling,s=!1;return a}(r,n,c,t,s)),f=Ke(r.doc,et(t,0),et(s,$e(r.doc,s).text.length));d.length>1&&f.length>1;)if(G(d)==G(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var b=G(d),y=G(f),x=Math.min(b.length-(1==d.length?p:0),y.length-(1==f.length?p:0));h<x&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)++h;if(1==d.length&&1==f.length&&t==o.line)for(;p&&p>o.ch&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)p--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var w=et(t,p),k=et(s,f.length?G(f).length-h:0);return d.length>1||d[0]||tt(w,k)?(ha(r.doc,d,w,k,"+input"),!0):void 0},Bo.prototype.ensurePolled=function(){this.forceCompositionEnd()},Bo.prototype.reset=function(){this.forceCompositionEnd()},Bo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Bo.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))},Bo.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return dr(e.cm)}))},Bo.prototype.setUneditable=function(e){e.contentEditable="false"},Bo.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Ao)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Bo.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Bo.prototype.onContextMenu=function(){},Bo.prototype.resetPosition=function(){},Bo.prototype.needsContentAttribute=!0;var Uo=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Uo.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function a(e){if(!me(r,e)){if(r.somethingSelected())jo({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Io(r);jo({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,q):(n.prevInput="",i.value=t.text.join("\n"),I(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),de(i,"input",(function(){o&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(i,"paste",(function(e){me(r,e)||Mo(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(i,"cut",a),de(i,"copy",a),de(e.scroller,"paste",(function(t){if(!kn(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var a=new Event("paste");a.clipboardData=t.clipboardData,i.dispatchEvent(a)}})),de(e.lineSpace,"selectstart",(function(t){kn(e,t)||ye(t)})),de(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),de(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Uo.prototype.createField=function(e){this.wrapper=Fo(),this.textarea=this.wrapper.firstChild},Uo.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Uo.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=Kn(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},Uo.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Uo.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&&I(this.textarea),o&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",o&&l>=9&&(this.hasSelection=null))}},Uo.prototype.getField=function(){return this.textarea},Uo.prototype.supportsTouch=function(){return!1},Uo.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},Uo.prototype.blur=function(){this.textarea.blur()},Uo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Uo.prototype.receivedFocus=function(){this.slowPoll()},Uo.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Uo.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))}))},Uo.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ae(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(o&&l>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(8203!=a||r||(r=""),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(r.length,i.length);s<c&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return Qr(t,(function(){Ao(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Uo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Uo.prototype.onKeyPress=function(){o&&l>=9&&(this.hasSelection=null),this.fastPoll()},Uo.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=cr(n,e),c=r.scroller.scrollTop;if(a&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(a)&&ei(n,Qi)(n.doc,Ei(a),q);var u,f=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),r.input.focus(),s&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),o&&l>=9&&g(),C){ke(e);var m=function(){pe(window,"mouseup",m),setTimeout(v,20)};de(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),a=""+(e?i.value:"");i.value="⇚",i.value=a,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,o&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!o||o&&l<9)&&g();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?ei(n,la)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}},Uo.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Uo.prototype.setUneditable=function(){},Uo.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=ko&&i(e,t,n)}:i)}e.defineOption=n,e.Init=ko,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Li(e)}),!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){ji(e),Bn(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(-1==a)break;i=a+t.length,n.push(et(r,a))}r++}));for(var i=n.length-1;i>=0;i--)ha(e.doc,t,n[i],et(n[i].line,n[i].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!=ko&&e.refresh()})),n("specialCharPlaceholder",Yt,(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){wo(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ja(t),i=n!=ko&&Ja(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Oo,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=pi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?or(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Wr(e)}),!0),n("scrollbarStyle","native",(function(e){Vr(e),Wr(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=pi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Er(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,Eo),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ji,!0),n("addModeClass",!1,ji,!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,ji,!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)}(No),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 r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),he(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"](Ja(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:ti((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,dr(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void dr(this)}})),indentLine:ti((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ye(this.doc,e)&&_o(this,e,t,n)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(_o(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&jr(this));else{var a=i.from(),o=i.to(),l=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var s=l;s<n;++s)_o(this,s,e);var c=this.doc.sel.ranges;0==a.ch&&t.length==c.length&&c[r].from().ch>0&&Zi(this.doc,r,new Ci(a,c[r].to()),q)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,n=ft(this,$e(this.doc,e.line)),r=0,i=(n.length-1)/2,a=e.ch;if(0==a)t=n[2];else for(;;){var o=r+i>>1;if((o?n[2*o-1]:0)>=a)i=o;else{if(!(n[2*o+1]<a)){t=n[2*o+2];break}r=o+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-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 r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],a=this.getModeAt(e);if("string"==typeof a[t])i[a[t]]&&r.push(i[a[t]]);else if(a[t])for(var o=0;o<a[t].length;o++){var l=i[a[t][o]];l&&r.push(l)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var s=0;s<i._global.length;s++){var c=i._global[s];c.pred(a,this)&&-1==B(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return pt(this,(e=ot(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Kn(this,null==e?n.head:"object"==typeof e?lt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return $n(this,lt(this.doc,e),t||"page")},coordsChar:function(e,t){return Zn(this,(e=Un(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Un(this,{top:e,left:0},t||"page").top,Xe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var a=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>a&&(e=a,i=!0),r=$e(this.doc,e)}else r=e;return Vn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ht(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a,o,l,s=this.display,c=(e=Kn(this,lt(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(a=this,o={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(l=_r(a,o)).scrollTop&&Ir(a,l.scrollTop),null!=l.scrollLeft&&Fr(a,l.scrollLeft))},triggerOnKeyDown:ti(co),triggerOnKeyPress:ti(fo),triggerOnKeyUp:uo,triggerOnMouseDown:ti(go),execCommand:function(e){if(eo.hasOwnProperty(e))return eo[e].call(null,this)},triggerElectric:ti((function(e){Do(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=lt(this.doc,e),o=0;o<t&&!(a=Ro(this.doc,a,i,n,r)).hitSide;++o);return a},moveH:ti((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ro(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:ti((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Za(this,(function(n){var i=Ro(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,a=r;t<0&&(i=-1,t=-t);for(var o=lt(this.doc,e),l=0;l<t;++l){var s=Kn(this,o,"div");if(null==a?a=s.left:s.left=a,(o=zo(this,s,i,n)).hitSide)break}return o},moveV:ti((function(e,t){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(o){if(a)return e<0?o.from():o.to();var l=Kn(n,o.head,"div");null!=o.goalColumn&&(l.left=o.goalColumn),i.push(l.left);var s=zo(n,l,e,t);return"page"==t&&o==r.sel.primary()&&Lr(n,$n(n,s,"div").top-l.top),s}),V),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]})),findWordAt:function(e){var t=$e(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var a=t.charAt(n),o=ee(a,i)?function(e){return ee(e,i)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&o(t.charAt(n-1));)--n;for(;r<t.length&&o(t.charAt(r));)++r}return new Ci(et(e.line,n),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?M(this.display.cursorDiv,"CodeMirror-overwrite"):O(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==A()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Ar(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-On(this)-this.display.barHeight,width:e.scrollWidth-On(this)-this.display.barWidth,clientHeight:Tn(this),clientWidth:Nn(this)}},scrollIntoView:ti((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){Mr(e),e.curOp.scrollToPos=t}(this,e):Dr(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&zn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){fr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Qr(this,e)},startOperation:function(){return $r(this)},endOperation:function(){return Kr(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,Bn(this),Ar(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&sr(this),he(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ii(this,e),Bn(this),this.display.input.reset(),Ar(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(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}},be(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}(No);var $o="iter insert remove copy getEditor constructor".split(" ");for(var Ko in La.prototype)La.prototype.hasOwnProperty(Ko)&&B($o,Ko)<0&&(No.prototype[Ko]=function(e){return function(){return e.apply(this.doc,arguments)}}(La.prototype[Ko]));return be(La),No.inputStyles={textarea:Uo,contenteditable:Bo},No.defineMode=function(e){No.defaults.mode||"null"==e||(No.defaults.mode=e),Fe.apply(this,arguments)},No.defineMIME=function(e,t){Pe[e]=t},No.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),No.defineMIME("text/plain","null"),No.defineExtension=function(e,t){No.prototype[e]=t},No.defineDocExtension=function(e,t){La.prototype[e]=t},No.fromTextArea=function(e,t){if((t=t?F(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=A();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=No((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},function(e){e.off=pe,e.on=de,e.wheelEventPixels=xi,e.Doc=La,e.splitLines=je,e.countColumn=R,e.findColumn=U,e.isWordChar=Q,e.Pass=W,e.signal=he,e.Line=$t,e.changeEnd=Oi,e.scrollbarModel=Hr,e.Pos=et,e.cmpPos=tt,e.modes=Ie,e.mimeModes=Pe,e.resolveMode=Re,e.getMode=ze,e.modeExtensions=Be,e.extendMode=We,e.copyState=qe,e.startState=Ve,e.innerMode=He,e.commands=eo,e.keyMap=qa,e.keyName=Ga,e.isModifierKey=$a,e.lookupKey=Ua,e.normalizeKeyMap=Va,e.StringStream=Ue,e.SharedTextMarker=Oa,e.TextMarker=Sa,e.LineWidget=wa,e.e_preventDefault=ye,e.e_stopPropagation=xe,e.e_stop=ke,e.addClass=M,e.contains=j,e.rmClass=O,e.keyNames=Ra}(No),No.version="5.58.2",No}()},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 M}));var r=n("wx14"),i=n("1OyB"),a=n("vuIU"),o=n("Ji7U"),l=n("LK+K"),s=n("q1tI"),c=n("VTBJ"),u=n("rePB"),d=n("Zm9Q"),f=(n("Kwbf"),n("c+Xe")),p=n("m+aA"),h=n("bdgK"),m=new Map;var g=new h.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(o.a)(n,e);var t=Object(l.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),b=s.createContext(null);function y(e){var t=e.children,n=e.disabled,r=s.useRef(null),i=s.useRef(null),a=s.useContext(b),o=s.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),l=s.isValidElement(t)&&Object(f.c)(t),u=l?t.ref:null,d=s.useMemo((function(){return Object(f.a)(u,r)}),[u,r]),h=s.useRef(e);h.current=e;var y=s.useCallback((function(e){var t=h.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),l=i.width,s=i.height,u=e.offsetWidth,d=e.offsetHeight,f=Math.floor(l),p=Math.floor(s);if(o.current.width!==f||o.current.height!==p||o.current.offsetWidth!==u||o.current.offsetHeight!==d){var m={width:f,height:p,offsetWidth:u,offsetHeight:d};o.current=m;var g=u===Math.round(l)?l:u,v=d===Math.round(s)?s:d,b=Object(c.a)(Object(c.a)({},m),{},{offsetWidth:g,offsetHeight:v});null==a||a(b,e,r),n&&Promise.resolve().then((function(){n(b,e)}))}}),[]);return s.useEffect((function(){var e,t,a=Object(p.a)(r.current)||Object(p.a)(i.current);return a&&!n&&(e=a,t=y,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)))}(a,y)}}),[r.current,n]),s.createElement(v,{ref:i},l?s.cloneElement(t,{ref:d}):t)}function x(e){var t=e.children;return Object(d.a)(t).map((function(t,n){var i=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return s.createElement(y,Object(r.a)({},e,{key:i}),t)}))}x.Collection=function(e){var t=e.children,n=e.onBatchResize,r=s.useRef(0),i=s.useRef([]),a=s.useContext(b),o=s.useCallback((function(e,t,o){r.current+=1;var l=r.current;i.current.push({size:e,element:t,data:o}),Promise.resolve().then((function(){l===r.current&&(null==n||n(i.current),i.current=[])})),null==a||a(e,t,o)}),[n,a]);return s.createElement(b.Provider,{value:o},t)};var w,k=x,C=n("bT9E"),S=n("TSYQ"),E=n.n(S),O="\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",N=["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"],T={};function _(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&&T[n])return T[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l=N.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),s={sizingStyle:l,paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(T[n]=s),s}var L,j=n("Gytx"),A=n.n(j);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(L||(L={}));var M=function(e){Object(o.a)(n,e);var t=Object(l.a)(n);function n(e){var a;return Object(i.a)(this,n),(a=t.call(this,e)).nextFrameActionId=void 0,a.resizeFrameId=void 0,a.textArea=void 0,a.saveTextArea=function(e){a.textArea=e},a.handleResize=function(e){var t=a.state.resizeStatus,n=a.props,r=n.autoSize,i=n.onResize;t===L.NONE&&("function"==typeof i&&i(e),r&&a.resizeOnNextFrame())},a.resizeOnNextFrame=function(){cancelAnimationFrame(a.nextFrameActionId),a.nextFrameActionId=requestAnimationFrame(a.resizeTextarea)},a.resizeTextarea=function(){var e=a.props.autoSize;if(e&&a.textArea){var t=e.minRows,n=e.maxRows,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;w||((w=document.createElement("textarea")).setAttribute("tab-index","-1"),w.setAttribute("aria-hidden","true"),document.body.appendChild(w)),e.getAttribute("wrap")?w.setAttribute("wrap",e.getAttribute("wrap")):w.removeAttribute("wrap");var i=_(e,t),a=i.paddingSize,o=i.borderSize,l=i.boxSizing,s=i.sizingStyle;w.setAttribute("style","".concat(s,";").concat(O)),w.value=e.value||e.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,f=w.scrollHeight;if("border-box"===l?f+=o:"content-box"===l&&(f-=a),null!==n||null!==r){w.value=" ";var p=w.scrollHeight-a;null!==n&&(u=p*n,"border-box"===l&&(u=u+a+o),f=Math.max(u,f)),null!==r&&(d=p*r,"border-box"===l&&(d=d+a+o),c=f>d?"":"hidden",f=Math.min(d,f))}return{height:f,minHeight:u,maxHeight:d,overflowY:c,resize:"none"}}(a.textArea,!1,t,n);a.setState({textareaStyles:r,resizeStatus:L.RESIZING},(function(){cancelAnimationFrame(a.resizeFrameId),a.resizeFrameId=requestAnimationFrame((function(){a.setState({resizeStatus:L.RESIZED},(function(){a.resizeFrameId=requestAnimationFrame((function(){a.setState({resizeStatus:L.NONE}),a.fixFirefoxAutoScroll()}))}))}))}))}},a.renderTextArea=function(){var e=a.props,t=e.prefixCls,n=void 0===t?"rc-textarea":t,i=e.autoSize,o=e.onResize,l=e.className,d=e.disabled,f=a.state,p=f.textareaStyles,h=f.resizeStatus,m=Object(C.a)(a.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),g=E()(n,l,Object(u.a)({},"".concat(n,"-disabled"),d));"value"in m&&(m.value=m.value||"");var v=Object(c.a)(Object(c.a)(Object(c.a)({},a.props.style),p),h===L.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return s.createElement(k,{onResize:a.handleResize,disabled:!(i||o)},s.createElement("textarea",Object(r.a)({},m,{className:g,style:v,ref:a.saveTextArea})))},a.state={textareaStyles:{},resizeStatus:L.NONE},a}return Object(a.a)(n,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&A()(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}(s.Component),D=function(e){Object(o.a)(n,e);var t=Object(l.a)(n);function n(e){var r;Object(i.a)(this,n),(r=t.call(this,e)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(e){r.resizableTextArea=e},r.handleChange=function(e){var t=r.props.onChange;r.setValue(e.target.value,(function(){r.resizableTextArea.resizeTextarea()})),t&&t(e)},r.handleKeyDown=function(e){var t=r.props,n=t.onPressEnter,i=t.onKeyDown;13===e.keyCode&&n&&n(e),i&&i(e)};var a=void 0===e.value||null===e.value?e.defaultValue:e.value;return r.state={value:a},r}return Object(a.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 s.createElement(M,Object(r.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}(s.Component);t.default=D},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 r=n("k1fw"),i=(n("miYZ"),n("tsqr")),a=n("rAM+"),o=n("tJVT"),l=n("PpiC"),s=n("q1tI"),c=n.n(s),u=n("bdgK");function d(e,t,n,i,a){var o=t.getWordUntilPosition(n),l={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},s=i.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:l}}));return a.map((function(e){s.push(Object(r.a)(Object(r.a)({},e),{},{range:l}))})),s}n("LvDl");function f(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function p(){}var h={"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 r=h[e[n]];if(r)return r}return t[0]}return h[t]||t}var g=null;t.b=function(e){var t=e.width,h=void 0===t?"100%":t,v=e.height,b=void 0===v?"100%":v,y=e.value,x=e.language,w=void 0===x?"javascript":x,k=e.style,C=void 0===k?{}:k,S=e.options,E=void 0===S?{}:S,O=e.overrideServices,N=void 0===O?{}:O,T=e.theme,_=void 0===T?"vs-dark":T,L=e.onEditBlur,j=e.onSave,A=e.autoHeight,M=void 0!==A&&A,D=e.forbidCopy,I=void 0!==D&&D,P=e.onChange,F=void 0===P?p:P,R=e.editorDidMount,z=void 0===R?p:R,B=e.onFocus,W=void 0===B?p:B,q=e.filename,H=void 0===q?"educoder.txt":q,V=(Object(l.a)(e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Object(s.useRef)()),U=Object(s.useRef)({}),$=Object(s.useRef)(),K=Object(s.useRef)(!1),G=Object(s.useRef)(),J=Object(s.useState)(!1),Z=Object(o.a)(J,2),X=Z[0],Y=Z[1];function Q(){i.b.warn(decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"))}function ee(){var e=U.current.instance;if(e){var t=e.getSelection(),n=U.current.pastePos||{},r=new g.Range(n.startLineNumber||t.endLineNumber,n.startColumn||t.endColumn,n.endLineNumber||t.endLineNumber,n.endColumn||t.endColumn);setTimeout((function(){e.executeEdits("",[{range:r,text:""}])}),300)}}function te(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),j())}Object(s.useEffect)((function(){$.current&&clearTimeout($.current),$.current=setTimeout((function(){!function(){var e=U.current.instance;if(null!=y&&e&&X){var t=e.getModel();t&&y!==t.getValue()&&(!0,t.setValue(y),e.layout(),!1)}}()}),500)}),[y,X,U.current]);var ne=function(){if(M&&U.current.instance){var e=U.current.instance.getContentHeight();ue(e<b?b:e)}else ue(b)};function re(e,t){var n,r,i=window.URL||window.webkitURL||window,a=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=i.createObjectURL(a),o.download=e,n=o,(r=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)}Object(s.useEffect)((function(){ne()}),[ne]),Object(s.useEffect)((function(){V.current&&!X&&n.e(/*! import() | monaco-editor */26).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){try{g=e,U.current.instance=g.editor.create(V.current,{value:y,language:m(w),theme:_,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},N);var t=U.current.instance;if(z(t,g),setTimeout((function(){ne(),U.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){re(H||"educoder.txt",t.getValue())}})}),500),U.current.subscription=t.onDidChangeModelContent((function(e){K.current?clearTimeout(G.current):(ne(),F(t.getValue(),e)),G.current=setTimeout((function(){K.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(r,i){return{suggestions:d(e,r,i,n,[t])}}});var r=["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 i=[{label:"print",kind:e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:d(e,t,n,r,i)}}});var i=["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,r){var a=[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:d(e,n,r,i,a)}}})}(g),I&&(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())})),W&&t.onDidFocusEditorText((function(){W(t.getValue())})),I){t.addCommand(g.KeyMod.CtrlCmd|g.KeyCode.KEY_V,(function(){return Q(),null})),t.onDidPaste((function(e){U.current.pastePos=e}));try{window.addEventListener("paste",ee)}catch(e){}}var n=function(){var e;return V.current&&(e=new u.default((function(e){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&U.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(V.current),e}();return Y(!0),function(){var e=U.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),U.current.subscription&&U.current.subscription.dispose(),I&&window.removeEventListener("paste",ee),n.unobserve(V.current)}}catch(e){}}))}),[]),Object(s.useEffect)((function(){if(U.current.instance&&X)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[j,X]),Object(s.useEffect)((function(){var e=U.current.instance;if(e&&X){var t=m(w);g.editor.setModelLanguage(e.getModel(),t),console.log("language:",w,e.getModel(),t)}}),[w,X]),Object(s.useEffect)((function(){U.current.instance&&X&&g.editor.setTheme(_)}),[_,X]),Object(s.useEffect)((function(){var e=U.current.instance;e&&X&&(e.updateOptions(Object(r.a)({},E)),setTimeout((function(){e.getModel().updateOptions(Object(r.a)({},E))}),200))}),[JSON.stringify(E),X]),Object(s.useEffect)((function(){var e=U.current.instance;e&&X&&e.layout()}),[h,b,X]);var ie=Object(s.useState)(f(h)),ae=Object(o.a)(ie,2),oe=ae[0],le=(ae[1],Object(s.useState)(f(b))),se=Object(o.a)(le,2),ce=se[0],ue=se[1],de=Object(r.a)(Object(r.a)({},C),{},{width:oe,height:ce});return c.a.createElement("div",{className:"my-monaco-editor",ref:V,style:de})};function v(e){var t=e.width,i=void 0===t?"100%":t,l=e.height,d=void 0===l?"100%":l,p=e.original,h=e.modified,m=e.language,v=e.options,b=void 0===v?{}:v,y=Object(s.useRef)(),x=Object(s.useState)(null),w=Object(o.a)(x,2),k=w[0],C=w[1];Object(s.useEffect)((function(){y.current&&n.e(/*! import() | monaco-editor */26).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(y.current,Object(r.a)(Object(r.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},b),{},{wordWrap:!0}));C(t);var n=function(e){var t;return y.current&&(t=new u.default((function(t){var n,r=Object(a.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&e.layout()}}catch(e){r.e(e)}finally{r.f()}}))).observe(y.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(y.current)}}))}),[]),Object(s.useEffect)((function(){k&&k.setModel({original:g.editor.createModel(p,m),modified:g.editor.createModel(h,m)})}),[p,h,m,k]);var S={width:f(i),height:f(d)};return c.a.createElement("div",{className:"my-diff-editor",ref:y,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 r(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function i(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function a(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return i(n.overflowY,t)||i(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 o(e,t,n,r,i,a,o,l){return a<e&&o>t||a>e&&o<t?0:a<=e&&l<=n||o>=t&&l>=n?a-e-r:o>t&&l<n||a<e&&l>n?o-t+i:0}var l=function(e,t){var n=window,i=t.scrollMode,l=t.block,s=t.inline,c=t.boundary,u=t.skipOverflowHiddenElements,d="function"==typeof c?c:function(e){return e!==c};if(!r(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,p=[],h=e;r(h)&&d(h);){if((h=h.parentElement)===f){p.push(h);break}null!=h&&h===document.body&&a(h)&&!a(document.documentElement)||null!=h&&a(h,u)&&p.push(h)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),x=y.height,w=y.width,k=y.top,C=y.right,S=y.bottom,E=y.left,O="start"===l||"nearest"===l?k:"end"===l?S:k+x/2,N="center"===s?E+w/2:"end"===s?C:E,T=[],_=0;_<p.length;_++){var L=p[_],j=L.getBoundingClientRect(),A=j.height,M=j.width,D=j.top,I=j.right,P=j.bottom,F=j.left;if("if-needed"===i&&k>=0&&E>=0&&S<=g&&C<=m&&k>=D&&S<=P&&E>=F&&C<=I)return T;var R=getComputedStyle(L),z=parseInt(R.borderLeftWidth,10),B=parseInt(R.borderTopWidth,10),W=parseInt(R.borderRightWidth,10),q=parseInt(R.borderBottomWidth,10),H=0,V=0,U="offsetWidth"in L?L.offsetWidth-L.clientWidth-z-W:0,$="offsetHeight"in L?L.offsetHeight-L.clientHeight-B-q:0;if(f===L)H="start"===l?O:"end"===l?O-g:"nearest"===l?o(b,b+g,g,B,q,b+O,b+O+x,x):O-g/2,V="start"===s?N:"center"===s?N-m/2:"end"===s?N-m:o(v,v+m,m,z,W,v+N,v+N+w,w),H=Math.max(0,H+b),V=Math.max(0,V+v);else{H="start"===l?O-D-B:"end"===l?O-P+q+$:"nearest"===l?o(D,P,A,B,q+$,O,O+x,x):O-(D+A/2)+$/2,V="start"===s?N-F-z:"center"===s?N-(F+M/2)+U/2:"end"===s?N-I+W+U:o(F,I,M,z,W+U,N,N+w,w);var K=L.scrollLeft,G=L.scrollTop;O+=G-(H=Math.max(0,Math.min(G+H,L.scrollHeight-A+$))),N+=K-(V=Math.max(0,Math.min(K+V,L.scrollWidth-M+U)))}T.push({el:L,top:H,left:V})}return T};function s(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(s(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:l(e,t));if(!n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:s(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 r=e.el,i=e.top,a=e.left;r.scroll&&n?r.scroll({top:i,left:a,behavior:t}):(r.scrollTop=i,r.scrollLeft=a)}))}(l(e,r),r.behavior)}}},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 i}));var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function i(e,t){var n=Object(r.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){},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 r=n("Ff2n"),i=n("rePB"),a=n("1OyB"),o=n("vuIU"),l=n("Ji7U"),s=n("md7G"),c=n("foSv"),u=n("q1tI"),d=n.n(u),f=n("TSYQ"),p=n.n(f),h=n("4IlW");function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}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(i.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,r=Object(c.a)(e);if(t){var i=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}function b(){}function y(e){e.preventDefault()}var x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(e){return null!=e},k=function(e,t){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},C=function(e){Object(l.a)(n,e);var t=v(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).onKeyDown=function(e){var t=r.props,n=t.onKeyDown,i=t.onPressEnter;if(e.keyCode===h.a.UP){var a=r.getRatio(e);r.up(e,a,null),r.stop()}else if(e.keyCode===h.a.DOWN){var o=r.getRatio(e);r.down(e,o,null),r.stop()}else e.keyCode===h.a.ENTER&&i&&i(e);if(r.recordCursorPosition(),r.lastKeyCode=e.keyCode,n){for(var l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];n.apply(void 0,[e].concat(s))}},r.onKeyUp=function(e){var t=r.props.onKeyUp;if(r.stop(),r.recordCursorPosition(),t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];t.apply(void 0,[e].concat(i))}},r.onChange=function(e){var t=r.props.onChange;r.state.focused&&(r.inputting=!0),r.rawInput=r.props.parser(r.getValueFromEvent(e)),r.setState({inputValue:r.rawInput}),t(r.toNumber(r.rawInput))},r.onMouseUp=function(){var e=r.props.onMouseUp;r.recordCursorPosition(),e&&e.apply(void 0,arguments)},r.onFocus=function(){var e;r.setState({focused:!0}),(e=r.props).onFocus.apply(e,arguments)},r.onBlur=function(){var e=r.props.onBlur;r.inputting=!1,r.setState({focused:!1});var t=r.getCurrentValidValue(r.state.inputValue),n=r.setValue(t,b);if(e){var i=r.input.value,a=r.getInputDisplayValue({focus:!1,value:n});r.input.value=a?Number(a):a,e.apply(void 0,arguments),r.input.value=i}},r.getRatio=function(e){var t=1;return e.metaKey||e.ctrlKey?t=.1:e.shiftKey&&(t=10),t},r.getFullNum=function(e){return isNaN(e)?e:/e/i.test(String(e))?Number(e).toFixed(18).replace(/\.?0+$/,""):e},r.getPrecision=function(e){if(w(r.props.precision))return r.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},r.getInputDisplayValue=function(e){var t,n=e||r.state,i=n.focused,a=n.inputValue,o=n.value;null==(t=i?a:r.toPrecisionAsStep(o))&&(t="");var l=r.formatWrapper(t);return w(r.props.decimalSeparator)&&(l=l.toString().replace(".",r.props.decimalSeparator)),l},r.recordCursorPosition=function(){try{r.cursorStart=r.input.selectionStart,r.cursorEnd=r.input.selectionEnd,r.currentValue=r.input.value,r.cursorBefore=r.input.value.substring(0,r.cursorStart),r.cursorAfter=r.input.value.substring(r.cursorEnd)}catch(e){}},r.restoreByAfter=function(e){if(void 0===e)return!1;var t=r.input.value,n=t.lastIndexOf(e);if(-1===n)return!1;var i=r.cursorBefore.length;return r.lastKeyCode===h.a.DELETE&&r.cursorBefore.charAt(i-1)===e[0]?(r.fixCaret(i,i),!0):n+e.length===t.length&&(r.fixCaret(n,n),!0)},r.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,n){var i=e.substring(n);return r.restoreByAfter(i)}))},r.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},r.stop=function(){r.autoStepTimer&&clearTimeout(r.autoStepTimer)},r.down=function(e,t,n){r.pressingUpOrDown=!0,r.step("down",e,t,n)},r.up=function(e,t,n){r.pressingUpOrDown=!0,r.step("up",e,t,n)},r.saveInput=function(e){r.input=e};var i=e.value;void 0===i&&(i=e.defaultValue),r.state={focused:e.autoFocus};var o=r.getValidValue(r.toNumber(i));return r.state=g(g({},r.state),{},{inputValue:r.toPrecisionAsStep(o),value:o}),r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.value,r=t.onChange,i=t.max,a=t.min,o=this.state.focused;if(e){if(!k(e.value,n)||!k(e.max,i)||!k(e.min,a)){var l,s=o?n:this.getValidValue(n);l=this.pressingUpOrDown?s:this.inputting?this.rawInput:this.toPrecisionAsStep(s),this.setState({value:s,inputValue:l})}var c="value"in this.props?n:this.state.value;"max"in this.props&&e.max!==i&&"number"==typeof c&&c>i&&r&&r(i),"min"in this.props&&e.min!==a&&"number"==typeof c&&c<a&&r&&r(a)}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 h.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case h.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1)}}else{var u=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===h.a.BACKSPACE?u=this.cursorStart-1:this.lastKeyCode===h.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 w(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,r=parseFloat(e);return isNaN(r)?e:(r<t&&(r=t),r>n&&(r=n),r)}},{key:"setValue",value:function(e,t){var n=this.props.precision,r=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),i=this.state.value,a=void 0===i?null:i,o=this.state.inputValue,l=void 0===o?null:o,s="number"==typeof r?r.toFixed(n):"".concat(r),c=r!==a||s!=="".concat(l);return"value"in this.props?(l=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:l},t)):this.setState({value:r,inputValue:this.toPrecisionAsStep(e)},t),c&&this.props.onChange(r),r}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,r=n.precision,i=n.step;if(w(r))return r;var a=this.getPrecision(t),o=this.getPrecision(i),l=this.getPrecision(e);return e?Math.max(l,a+o):a+o}},{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,r=e&&e.length>16&&n;return this.isNotCompleteNumber(e)||r?e:w(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,r=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),a=((r*e+r*n*t)/r).toFixed(i);return this.toNumber(a)}},{key:"downStep",value:function(e,t){var n=this.props.step,r=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),a=((r*e-r*n*t)/r).toFixed(i);return this.toNumber(a)}},{key:"step",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;this.stop(),t&&(t.persist(),t.preventDefault());var a=this.props;if(!a.disabled){var o=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(o)){var l=this["".concat(e,"Step")](o,r),s=l>a.max||l<a.min;l>a.max?l=a.max:l<a.min&&(l=a.min),this.setValue(l,null),this.setState({focused:!0},(function(){n.pressingUpOrDown=!1})),s||(this.autoStepTimer=setTimeout((function(){n[e](t,r,!0)}),i?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,r=this.input.selectionEnd;e===n&&t===r||this.input.setSelectionRange(e,t)}catch(e){}}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,a=t.disabled,o=t.readOnly,l=t.useTouch,s=t.autoComplete,c=t.upHandler,u=t.downHandler,f=t.className,h=t.max,m=t.min,g=t.style,v=t.title,x=t.onMouseEnter,w=t.onMouseLeave,k=t.onMouseOver,C=t.onMouseOut,S=t.required,E=t.onClick,O=t.tabIndex,N=t.type,T=t.placeholder,_=t.id,L=t.inputMode,j=t.pattern,A=t.step,M=t.maxLength,D=t.autoFocus,I=t.name,P=t.onPaste,F=t.onInput,R=Object(r.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,B=z.value,W=z.focused,q=p()(n,(e={},Object(i.a)(e,f,!!f),Object(i.a)(e,"".concat(n,"-disabled"),a),Object(i.a)(e,"".concat(n,"-focused"),W),e)),H={};Object.keys(R).forEach((function(e){"data-"!==e.substr(0,5)&&"aria-"!==e.substr(0,5)&&"role"!==e||(H[e]=R[e])}));var V=!o&&!a,U=this.getInputDisplayValue(null),$=(B||0===B)&&(isNaN(B)||Number(B)>=h)||a||o,K=(B||0===B)&&(isNaN(B)||Number(B)<=m)||a||o,G=p()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(i.a)({},"".concat(n,"-handler-up-disabled"),$)),J=p()("".concat(n,"-handler"),"".concat(n,"-handler-down"),Object(i.a)({},"".concat(n,"-handler-down-disabled"),K)),Z=l?{onTouchStart:$?b:this.up,onTouchEnd:this.stop}:{onMouseDown:$?b:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},X=l?{onTouchStart:K?b:this.down,onTouchEnd:this.stop}:{onMouseDown:K?b:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return d.a.createElement("div",{className:q,style:g,title:v,onMouseEnter:x,onMouseLeave:w,onMouseOver:k,onMouseOut:C,onFocus:function(){return null},onBlur:function(){return null}},d.a.createElement("div",{className:"".concat(n,"-handler-wrap")},d.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Increase Value","aria-disabled":$,className:G}),c||d.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-up-inner"),onClick:y})),d.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Decrease Value","aria-disabled":K,className:J}),u||d.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-down-inner"),onClick:y}))),d.a.createElement("div",{className:"".concat(n,"-input-wrap")},d.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":m,"aria-valuemax":h,"aria-valuenow":B,required:S,type:N,placeholder:T,onPaste:P,onClick:E,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:O,autoComplete:s,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:V?this.onKeyDown:b,onKeyUp:V?this.onKeyUp:b,autoFocus:D,maxLength:M,readOnly:o,disabled:a,max:h,min:m,step:A,name:I,title:v,id:_,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(U),pattern:j,inputMode:L,onInput:F},H))))}}]),n}(d.a.Component);C.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:b,onKeyDown:b,onPressEnter:b,onFocus:b,onBlur:b,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var S=C;t.a=S},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 d}));var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),a=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"),l=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),s=n(/*! react */"q1tI"),c=n.n(s),u=n(/*! ../markdown-editor */"Ot1p"),d=function(e){Object(o.a)(n,e);var t=Object(l.a)(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).getChCountBeforeCursor=function(e,t){for(var n=t.line,r=0,i=0;i<n;i++)r+=e.getLine(i).split("▁").length-1;return r+=e.getLine(n).substring(0,t.ch).split("▁").length-1},e.onCMBeforeChange=function(t,n){var r=t.getRange(n.from,n.to),i=0;if(n.text.forEach((function(e){i+=e.split("▁").length-1})),r&&-1!=r.indexOf("▁")){var a=r.split("▁").length-1,o=e.getChCountBeforeCursor(t,n.from);console.log("删除".concat(a,"个, 之前有").concat(o,"个,新增").concat(i,"个")),e.props.deleteEmptyDisabled?n.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(o,a,i)}else if(i){var l=e.getChCountBeforeCursor(t,n.from);console.log("新增".concat(i,"个,之前有").concat(l,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(l,0,i)}},e}return Object(a.a)(n,[{key:"render",value:function(){return c.a.createElement(u.a,Object(r.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),n}(s.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 r=e.getMode(t,"text/html"),i="null"==r.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 a={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 o in a)a.hasOwnProperty(o)&&n.tokenTypeOverrides[o]&&(a[o]=n.tokenTypeOverrides[o]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,s=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\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 b(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=i;if(!n){var a=e.innerMode(r,t.htmlState);n="xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText}n&&(t.f=S,t.block=y,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function y(r,i){var o,f=r.column()===i.indentation,m=!(o=i.prevLine.stream)||!/\S/.test(o.string),v=i.indentedCode,b=i.prevLine.hr,y=!1!==i.list,x=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var C=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,y)){for(i.list=null;C<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=C-i.listStack[i.listStack.length-1])}var S=!(m||b||i.prevLine.header||y&&v||i.prevLine.fencedCodeEnd),E=(!1===i.list||b||m)&&i.indentation<=x&&r.match(l),O=null;if(i.indentationDiff>=4&&(v||i.prevLine.fencedCodeEnd||i.prevLine.header||m))return r.skipToEnd(),i.indentedCode=!0,a.code;if(r.eatSpace())return null;if(f&&i.indentation<=x&&(O=r.match(u))&&O[1].length<=6)return i.quote=0,i.header=O[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,k(i);if(i.indentation<=x&&r.eat(">"))return i.quote=f?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),r.eatSpace(),k(i);if(!E&&!i.setext&&f&&i.indentation<=x&&(O=r.match(s))){var N=O[1]?"ol":"ul";return i.indentation=C+r.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,n.taskLists&&r.match(c,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+N]),k(i)}return f&&i.indentation<=x&&(O=r.match(p,!0))?(i.quote=0,i.fencedEndRE=new RegExp(O[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}(O[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=w,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,k(i)):i.setext||!(S&&y||i.quote||!1!==i.list||i.code||E||h.test(r.string))&&(O=r.lookAhead(1))&&(O=O.match(d))?(i.setext?(i.header=i.setext,i.setext=0,r.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==O[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,k(i)):E?(r.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===r.peek()?g(r,i,T):g(r,i,i.inline)}function x(t,n){var a=r.token(t,n.htmlState);if(!i){var o=e.innerMode(r,n.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=S,n.block=y,n.htmlState=null)}return a}function w(e,t){var r,i=t.listStack[t.listStack.length-1]||0,o=t.indentation<i,l=i+3;return t.fencedEndRE&&t.indentation<=l&&(o||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),o||(r=k(t)),t.localMode=t.localState=null,t.block=y,t.f=S,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?v(e,t,t.block):r):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function k(e){var t=[];if(e.formatting){t.push(a.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(a.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(a.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.formatting+"-"+e.formatting[r]+"-"+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(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.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 C(e,t){if(e.match(f,!0))return k(t)}function S(t,i){var o=i.text(t,i);if(void 0!==o)return o;if(i.list)return i.list=null,k(i);if(i.taskList)return" "===t.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,k(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),k(i);var l=t.next();if(i.linkTitle){i.linkTitle=!1;var s=l;"("===l&&(s=")");var u="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(t.match(new RegExp(u),!0))return a.linkHref}if("`"===l){var d=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var f=t.current().length;if(0!=i.code||i.quote&&1!=f){if(f==i.code){var p=k(i);return i.code=0,p}return i.formatting=d,k(i)}return i.code=f,k(i)}if(i.code)return k(i);if("\\"===l&&(t.next(),n.highlightFormatting)){var h=k(i),g=a.formatting+"-escape";return h?h+" "+g:g}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),k(i);if("["===l&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),k(i);if("]"===l&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");var h=k(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=O,h}if("["===l&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,n.highlightFormatting&&(i.formatting="link")),k(i);if("]"===l&&i.linkText){n.highlightFormatting&&(i.formatting="link");var h=k(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?O:S,h}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=E,n.highlightFormatting&&(i.formatting="link"),(h=k(i))?h+=" ":h="",h+a.linkInline;if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=E,n.highlightFormatting&&(i.formatting="link"),(h=k(i))?h+=" ":h="",h+a.linkEmail;if(n.xml&&"<"===l&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var y=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),v(t,i,x)}if(n.xml&&"<"===l&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===l||"_"===l){for(var w=1,C=1==t.pos?" ":t.string.charAt(t.pos-2);w<3&&t.eat(l);)w++;var N=t.peek()||" ",T=!/\s/.test(N)&&(!m.test(N)||/\s/.test(C)||m.test(C)),_=!/\s/.test(C)&&(!m.test(C)||/\s/.test(N)||m.test(N)),L=null,j=null;if(w%2&&(i.em||!T||"*"!==l&&_&&!m.test(C)?i.em!=l||!_||"*"!==l&&T&&!m.test(N)||(L=!1):L=!0),w>1&&(i.strong||!T||"*"!==l&&_&&!m.test(C)?i.strong!=l||!_||"*"!==l&&T&&!m.test(N)||(j=!1):j=!0),null!=j||null!=L)return n.highlightFormatting&&(i.formatting=null==L?"strong":null==j?"em":"strong em"),!0===L&&(i.em=l),!0===j&&(i.strong=l),p=k(i),!1===L&&(i.em=!1),!1===j&&(i.strong=!1),p}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return k(i);t.backUp(1)}if(n.strikethrough)if("~"===l&&t.eatWhile(l)){if(i.strikethrough)return n.highlightFormatting&&(i.formatting="strikethrough"),p=k(i),i.strikethrough=!1,p;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),k(i)}else if(" "===l&&t.match(/^~~/,!0)){if(" "===t.peek())return k(i);t.backUp(2)}if(n.emoji&&":"===l&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,n.highlightFormatting&&(i.formatting="emoji");var A=k(i);return i.emoji=!1,A}return" "===l&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),k(i)}function E(e,t){if(">"===e.next()){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link");var r=k(t);return r?r+=" ":r="",r+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function O(e,t){if(e.eatSpace())return null;var r,i=e.next();return"("===i||"["===i?(t.f=t.inline=(r="("===i?")":"]",function(e,t){if(e.next()===r){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link-string");var i=k(t);return t.linkHref=!1,i}return e.match(N[r]),t.linkHref=!0,k(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,k(t)):"error"}var N={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=_,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,k(t)):g(e,t,S)}function _(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=L,n.highlightFormatting&&(t.formatting="link");var r=k(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),a.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,a.linkHref+" url")}var j={startState:function(){return{f:y,prevLine:{stream:null},thisLine:{stream:null},block:y,htmlState:null,indentation:0,inline:S,text:C,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(r,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 b(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:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:j}},indent:function(t,n,i){return t.block==x&&r.indent?r.indent(t.htmlState,n,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,i):e.Pass},blankLine:b,getType:k,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../xml/xml */"1eCo"),n(/*! ../meta */"8EBN"))},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 r="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",i=new RegExp("<(/?)(["+r+"]["+r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function a(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function o(e,n){var r=e.cm.getTokenTypeAt(t(e.line,n));return r&&/\btag\b/.test(r)}function l(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function s(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(l(e))continue;return}if(o(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"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(s(e))continue;return}if(o(e,t+1)){i.lastIndex=t,e.ch=t;var n=i.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function d(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(l(e))continue;return}if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(o(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var r=[];;){var i,a=d(e),o=e.line,l=e.ch-(a?a[0].length:0);if(!a||!(i=c(e)))return;if("selfClose"!=i)if(a[1]){for(var s=r.length-1;s>=0;--s)if(r[s]==a[2]){r.length=s;break}if(s<0&&(!n||n==a[2]))return{tag:a[2],from:t(o,l),to:t(e.line,e.ch)}}else r.push(a[2])}}function h(e,n){for(var r=[];;){var i=f(e);if(!i)return;if("selfClose"!=i){var a=e.line,o=e.ch,l=u(e);if(!l)return;if(l[1])r.push(l[2]);else{for(var s=r.length-1;s>=0;--s)if(r[s]==l[2]){r.length=s;break}if(s<0&&(!n||n==l[2]))return{tag:l[2],from:t(e.line,e.ch),to:t(a,o)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,r){for(var i=new a(e,r.line,0);;){var o=d(i);if(!o||i.line!=r.line)return;var l=c(i);if(!l)return;if(!o[1]&&"selfClose"!=l){var s=t(i.line,i.ch),u=p(i,o[2]);return u&&n(u.from,s)>0?{from:s,to:u.from}:null}}})),e.findMatchingTag=function(e,r,i){var o=new a(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=c(o),s=l&&t(o.line,o.ch),d=l&&u(o);if(l&&d&&!(n(o,r)>0)){var f={from:t(o.line,o.ch),to:s,tag:d[2]};return"selfClose"==l?{open:f,close:null,at:"open"}:d[1]?{open:h(o,d[2]),close:f,at:"close"}:{open:f,close:p(o=new a(e,s.line,s.ch,i),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,r){for(var i=new a(e,t.line,t.ch,n);;){var o=h(i,r);if(!o)break;var l=p(new a(e,t.line,t.ch,n),o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,n,r){return p(new a(e,t.line,t.ch,r?{from:0,to:r}: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 r=n(/*! antd/es/button */"2/Rp"),i=(n(/*! antd/es/tooltip/style */"5Dmo"),n(/*! antd/es/tooltip */"3S7+")),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=n(/*! react */"q1tI"),s=n.n(l),c=n(/*! ./index.less?modules */"vHTk"),u=n.n(c),d=n(/*! @ant-design/icons */"yEEn"),f=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),h=e.filename,m=e.monacoEditor,g=e.className,v=e.style,b=e.close,y=e.onClose,x=e.hasMask,w=Object(l.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),k=Object(o.a)(w,2),C=(k[0],k[1],Object(l.useState)("")),S=Object(o.a)(C,2),E=(S[0],S[1]),O=Object(l.useRef)();h&&(m.filename=h),Object(l.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 N=function(){n.startsWith("http")||n.startsWith("/")?T():Object(p.x)(h||"educoder",n,h)},T=function(){Object(p.v)(h||t,n)};return console.log("data:",n,"fileanme:",h," name:",t),s.a.createElement("div",{style:Object(a.a)({},v||{}),className:"".concat(x&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},b&&s.a.createElement("div",{className:u.a.close,ref:O},s.a.createElement(i.a,{title:"点击下载此文件",getPopupContainer:function(){return O.current}},s.a.createElement("span",{onClick:T},s.a.createElement("i",{className:"icon-quxiaozhiding"}))),s.a.createElement(i.a,{title:"关闭",getPopupContainer:function(){return O.current}},s.a.createElement("span",{className:"",onClick:y},s.a.createElement("i",{className:"icon-guanbi1"})))),s.a.createElement("div",{className:"".concat(u.a[g]," ").concat(g," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&s.a.createElement(f.b,m)),"audio"===c&&s.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&&s.a.createElement(s.a.Fragment,null,null!=n&&n.startsWith("/")?s.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):s.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),"pdf"===c&&s.a.createElement("embed",{className:u.a.embed,src:n}),"image"===c&&s.a.createElement(s.a.Fragment,null,s.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&&s.a.createElement("div",null,s.a.createElement(r.a,{type:"primary",size:"large",onClick:N},s.a.createElement(d.a,null),"点击下载")),("download"===c||"office"===c)&&s.a.createElement(r.a,{type:"primary",size:"large",onClick:N},s.a.createElement(d.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 i}));var r=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function i(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}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 o,l=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw o}}}}},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=/[&<>"']/,r=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=e=>o[e];const s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(s,(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 d=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const p={},h=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(e,t){p[" "+e]||(h.test(e)?p[" "+e]=e+"/":p[" "+e]=b(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 b(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const a=e.charAt(r-i-1);if(a!==t||n){if(a===t||!n)break;i++}else i++}return e.substr(0,r-i)}e.exports={escape:function(e,t){if(t){if(n.test(e))return e.replace(r,l)}else if(i.test(e))return e.replace(a,l);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(u,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(c(n)).replace(d,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!f.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,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],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 r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:b,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;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")}}},sDPU:
/*!*************************************************************!*\
!*** ./src/pages/Paperlibrary/Random/PreviewEdit/index.tsx ***!
\*************************************************************/
/*! exports provided: default */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */function(e,t,n){"use strict";n.r(t);n(/*! antd/es/skeleton/style */"cWXX");var r=n(/*! antd/es/skeleton */"/ezw"),i=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/asyncToGenerator */"9og8"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */"WmNS"),s=n.n(l),c=n(/*! react */"q1tI"),u=n.n(c),d=n(/*! umi */"Ty5D"),f=n(/*! umi */"9kvl"),p=n(/*! ./index.less?modules */"FIWC"),h=n.n(p),m=n(/*! @/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview */"sbIO"),g=n(/*! @/utils/fetch */"ErOA"),v=n(/*! lodash */"LvDl");t.default=Object(f.a)((function(e){return{paperlibrary:e.paperlibrary,user:e.user,globalSetting:e.globalSetting}}))((function(e){e.paperlibrary;var t,n,l,p,b=e.user,y=(e.globalSetting,e.dispatch),x=e.location,w=(null==x||null===(t=x.query)||void 0===t?void 0:t.select)||0,k=Object(c.useState)(!1),C=Object(o.a)(k,2),S=C[0],E=(C[1],Object(c.useState)(!0)),O=Object(o.a)(E,2),N=O[0],T=O[1],_=Object(c.useState)(Number(w)),L=Object(o.a)(_,2),j=L[0],A=L[1],M=Object(c.useState)({}),D=Object(o.a)(M,2),I=D[0],P=D[1],F=Object(d.i)(),R=b.userInfo;Object(c.useEffect)((function(){return y({type:"globalSetting/footerToggle",payload:!1}),function(){y({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(c.useEffect)((function(){return y({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),y({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){y({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),y({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}}),[]),Object(c.useEffect)((function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}}),[]),Object(c.useEffect)((function(){z(j)}),[]);var z=function(){var e=Object(a.a)(s.a.mark((function e(){var t,n,r=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:0,console.log(F),e.next=4,Object(g.a)("/api/exercises/".concat(F.categoryId,"/preview_random_exercise.json"),{method:"get",params:{num:t}});case 4:n=e.sent,T(!1),P(B(n));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(e){var t={1:"一",2:"二",3:"三",4:"四",5:"五",6:"六",7:"七"};if(e){var n=e||{},r=n.exam,a=n.single_questions,o=n.multiple_questions,l=n.judgement_questions,s=n.program_questions,c=n.completion_questions,u=n.subjective_questions,d=n.practical_questions,f=n.combination_questions,p=[Object(i.a)({type:"SINGLE",name:"单选题"},a),Object(i.a)({type:"MULTIPLE",name:"多选题"},o),Object(i.a)({type:"COMPLETION",name:"填空题"},c),Object(i.a)({type:"JUDGMENT",name:"判断题"},l),Object(i.a)({type:"SUBJECTIVE",name:"简答题"},u),Object(i.a)({type:"PROGRAM",name:"编程题"},s),Object(i.a)({type:"PRACTICAL",name:"实训题"},d),Object(i.a)({type:"COMBINATION",name:"组合题"},f)],h=[],m=0,g=0,v=p.filter((function(e){return e.questions_count>0})).map((function(e,n){var r;return null===(r=e.questions)||void 0===r||r.forEach((function(e){h.push(e.id),m+=e.score,g+=1})),Object(i.a)(Object(i.a)({},e),{number:t[n+1]})}));return{all_questions_count:g,all_score:m,questionList:v,ids:h,exam:r}}},W=function(){var e=Object(a.a)(s.a.mark((function e(t,n){var r,a,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(g.a)("/api/exercises/".concat(F.categoryId,"/toggle_random_question.json"),{method:"post",body:{question_id:null==t?void 0:t.single_question_id}});case 2:null!=(r=e.sent)&&r.question&&((o=Object(v.cloneDeep)(I)).questionList=null==o||null===(a=o.questionList)||void 0===a?void 0:a.map((function(e){if(e.type===n.type){var t=Object(v.cloneDeep)(null==e?void 0:e.questions);return t.splice(n.index,1,null==r?void 0:r.question),Object(i.a)(Object(i.a)({},e),{},{questions:t})}return e})),P(o));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),q=function(){var e=Object(a.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:document.body.scrollIntoView(),z(t),A(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return console.log(Object(d.h)(),"location333"),u.a.createElement("section",{className:h.a.wrap},u.a.createElement(r.a,{loading:N,active:!0,paragraph:{rows:5}},(null===(n=Object(d.h)())||void 0===n||null===(l=n.pathname)||void 0===l?void 0:l.includes("preview"))&&u.a.createElement("div",{className:h.a.crumbs},u.a.createElement("b",null),u.a.createElement("span",{className:"current",onClick:function(){return f.d.push("/classrooms/".concat(F.coursesId,"/exercise"))}},"".concat(null==R||null===(p=R.course)||void 0===p?void 0:p.course_name,">")),u.a.createElement("span",{className:"current",onClick:function(){return f.d.push("/classrooms/".concat(F.coursesId,"/exercise"))}},"试卷列表>"),u.a.createElement("span",{style:{color:"#bebebe"}},"预览")),u.a.createElement(m.a,{loading:S,submit:function(){alert("保存")},goBack:function(){f.d.push("/classrooms/".concat(F.coursesId,"/exercise"))},data:I,selectValue:j,editPreview:!0,onExchange:W,onSkipExamination:q})))}))},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 r=n("NUBc"),i=(n("5Dmo"),n("3S7+")),a=(n("/zsF"),n("PArb")),o=(n("Q9mQ"),n("diRs")),l=(n("+L6B"),n("2/Rp")),s=(n("5NDa"),n("5rEg")),c=(n("miYZ"),n("tsqr")),u=n("9og8"),d=(n("giR+"),n("fyUT")),f=(n("2qtc"),n("kLXV")),p=n("tJVT"),h=n("WmNS"),m=n.n(h),g=n("q1tI"),v=n.n(g),b=n("PsQE"),y=n.n(b),x=n("0eGx"),w=n.n(x),k=n("9Bee"),C=n("Ty5D"),S=n("9kvl"),E=n("ErOA"),O=n("+yhJ"),N=n.n(O),T=n("RZ/O"),_=n.n(T),L=n("LvDl"),j=n("6K3P"),A=n.n(j),M=(n("sRBo"),n("kaz8")),D=n("oBTY"),I=n("PpiC"),P=n("Ot1p"),F=n("kqOp"),R=n("7qnI"),z=n("1vsH"),B=n("PGNT"),W=n.n(B),q=function(e,t){e.globalSetting,e.loading,e.dispatch;var n=e.isEdit,r=e.editData,i=(Object(I.a)(e,["globalSetting","loading","dispatch","isEdit","editData"]),Object(g.useState)("")),a=Object(p.a)(i,2),o=a[0],l=a[1],s=Object(g.useState)(""),u=Object(p.a)(s,2),d=u[0],h=u[1],m=Object(g.useState)([]),b=Object(p.a)(m,2),y=b[0],x=b[1],w=Object(g.useState)(""),k=Object(p.a)(w,2),C=k[0],S=k[1],E=Object(g.useState)(),O=Object(p.a)(E,2),N=O[0],T=O[1],_=Object(g.useState)(!1),L=Object(p.a)(_,2),j=L[0],A=L[1];Object(g.useEffect)((function(){r&&n&&(l(null==r?void 0:r.name),h(null==r?void 0:r.analysis),T(null==r?void 0:r.is_ordered),A(!0))}),[r]),Object(g.useEffect)((function(){if(j){var e=null==r?void 0:r.standard_answer.map((function(e){return e.answer_text}));x(e),A(!1)}}),[j]),Object(g.useImperativeHandle)(t,(function(){return{onSave:B,Clear:q}}));var B=function(){var e=[],t=!1;return o?(y.forEach((function(n,r){e.push({position:r+1,answer_text:[]}),n.forEach((function(n,i){e[r].answer_text.push(n),n&&Object(z.bb)(n,1e4)||(S("".concat(r,"-").concat(i)),c.b.info(n?"答案不能超过10000字符":"答案:不能为空"),t=!0)}))})),!t&&((null==e?void 0:e.length)>20?(c.b.warn("填空题标准答案不能为空/不能超过20个"),!1):{name:o,analysis:d,standard_answers:e,is_ordered:N})):(c.b.info("请您输入题干"),!1)},q=function(){l(""),h(""),x([]),T(!1)},H=function(e,t,n){S("");var r=y.slice();r[e][t]=n,x(r)},V=function(e){var t=y.slice();t[e]=[].concat(Object(D.a)(t[e]),[""]),x(t)},U=function(e,t){var n=y.slice();if(!n[e][t])return n[e]=n[e].filter((function(e,n){return n!==t})),void x(n);f.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)}})},$=function(e){f.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){var t=y.slice();t=y.filter((function(t,n){return e!==n})),x(t)}})};return v.a.createElement("section",{className:W.a.wrap},v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"题干:")),v.a.createElement("div",null,v.a.createElement(F.a,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:o,onChange:function(e){return l(e)},showNullButton:!0,onPlaceholderChange:function(e,t,n){var r=y.slice();if(t&&r.splice(e,t),n)for(var i=0;i<n;i++)r.splice(e+i,0,[""]);x(r)}})),v.a.createElement("div",{className:"mt20"},y.map((function(e,t){return v.a.createElement(R.a,{key:t,answers:e,index:t,flex:1,is_md:!0,activeOptionErrorIndex:C,onAnswerChange:H,addChildAnswer:V,deleteChildAnswer:U,deleteChildAnswermain:$})}))),v.a.createElement("div",{className:"mt20"},y.length>1&&v.a.createElement("span",null,v.a.createElement(M.a,{checked:N,onChange:function(e){return T(e.target.checked)},className:"".concat(W.a.color333," font14")},"多个填空的答案有顺序要求"),v.a.createElement("span",{className:"".concat(W.a.color999," font12")},"(选中,每个填空的答案顺序必须与参考答案一致)"))),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.title},"题目解析:")),v.a.createElement(P.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:d,onChange:function(e){return h(e)}}))},H=Object(S.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(g.forwardRef)(q)),V=(n("7Kak"),n("9yH6")),U=function(e,t){e.globalSetting,e.loading;var n=e.editData,r=(e.dispatch,e.onRef,e.isEdit),i=(Object(I.a)(e,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),Object(g.useState)()),a=Object(p.a)(i,2),o=a[0],l=a[1],s=Object(g.useState)(""),u=Object(p.a)(s,2),d=u[0],f=u[1],h=Object(g.useState)(""),m=Object(p.a)(h,2),b=m[0],y=m[1];Object(g.useEffect)((function(){if(n&&r){f(null==n?void 0:n.name),y(null==n?void 0:n.analysis);var e=null==n?void 0:n.choices.find((function(e){return e.is_answer}));l("正确"===e.choice_text?"0":"1")}}),[n]),Object(g.useImperativeHandle)(t,(function(){return{onSave:x,Clear:w}}));var x=function(){return d?o?{name:d,choices:[{choice_text:"正确",is_answer:"0"===o?1:0},{choice_text:"错误",is_answer:"1"===o?1:0}],analysis:b}:(c.b.info("请先点击选择本选择题的正确选项"),!1):(c.b.info("请您输入题干"),!1)},w=function(){f(""),y(""),l("")};return v.a.createElement("section",{className:W.a.wrap},v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"题干:")),v.a.createElement(P.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:d,onChange:function(e){return f(e)}}),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"答案选项:",v.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),v.a.createElement(V.a.Group,{buttonStyle:"solid",value:o,onChange:function(e){return l(e.target.value)}},v.a.createElement(V.a.Button,{value:"0",className:"".concat(W.a.radio," mr40")},"正确"),v.a.createElement(V.a.Button,{value:"1",className:W.a.radio},"错误")),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.title},"题目解析:")),v.a.createElement(P.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:b,onChange:function(e){return y(e)}}))},$=Object(S.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(g.forwardRef)(U)),K=["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"],G=function(e,t){var n=e.editData,r=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),a=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(g.useState)([])),o=Object(p.a)(a,2),l=o[0],s=o[1],u=Object(g.useState)(),d=Object(p.a)(u,2),f=d[0],h=d[1],m=Object(g.useState)([]),b=Object(p.a)(m,2),y=b[0],x=b[1],w=Object(g.useState)(""),C=Object(p.a)(w,2),S=C[0],E=C[1],O=Object(g.useState)(""),N=Object(p.a)(O,2),T=N[0],_=N[1];Object(g.useEffect)((function(){s(["","","",""])}),[]),Object(g.useEffect)((function(){if(n&&r){E(null==n?void 0:n.name),_(null==n?void 0:n.analysis),s(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(g.useImperativeHandle)(t,(function(){return{onSave:L,Clear:j}}));var L=function(){if(!S)return c.b.info("请您输入题干"),!1;var e=l.findIndex((function(e){return!e}));if(e>-1)return c.b.info("请先输入 ".concat(K[e]," 选项的内容")),!1;if(!y.length)return c.b.info("请设置本题的正确答案点击选项A/B...即可完成设置"),!1;if(y.length<2)return c.b.info("多选题最小正确选项为2个"),!1;var t=l.map((function(e,t){return{choice_text:e,is_answer:y.includes(t)?1:0}}));return{name:S,choices:t,analysis:T}},j=function(){s(["","","",""]),E(""),_(""),x("")};return v.a.createElement("section",{className:W.a.wrap},v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"题干:")),v.a.createElement(P.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(e){return E(e)}}),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"答案选项:",v.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),l.map((function(e,t){return v.a.createElement("div",{className:W.a.choiceWrap,key:t},v.a.createElement(i.a,{title:"点击设置为标准答案",placement:"left"},v.a.createElement("div",{className:"".concat(W.a.answer," ").concat(y.includes(t)?W.a.activeAnswer:""),onClick:function(){y.includes(t)?x(y.filter((function(e){return e!==t}))):x([].concat(Object(D.a)(y),[t]))}},K[t])),v.a.createElement("div",{className:W.a.editorWrap},f===t?v.a.createElement(P.a,{id:"single-question-option-".concat(t),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){l[t]=e,s(l)}}):v.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return h(t)}},v.a.createElement(k.a,{value:e}))),t>1&&v.a.createElement(i.a,{title:"删除"},v.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){s(l.filter((function(e,n){return n!==t}))),y.includes(t)?x(y.filter((function(e){return e!==t}))):x([].concat(Object(D.a)(y),[t]))}})),t<7&&t===l.length-1&&v.a.createElement(i.a,{title:"新增参考答案"},v.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return s([].concat(Object(D.a)(l),[""]))}})))})),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.title},"题目解析:")),v.a.createElement(P.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:T,onChange:function(e){return _(e)}}))},J=Object(S.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(g.forwardRef)(G)),Z=["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"],X=function(e,t){var n=e.editData,r=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),a=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(g.useState)([])),o=Object(p.a)(a,2),l=o[0],s=o[1],u=Object(g.useState)(),d=Object(p.a)(u,2),f=d[0],h=d[1],m=Object(g.useState)(),b=Object(p.a)(m,2),y=b[0],x=b[1],w=Object(g.useState)(""),C=Object(p.a)(w,2),S=C[0],E=C[1],O=Object(g.useState)(""),N=Object(p.a)(O,2),T=N[0],_=N[1];Object(g.useEffect)((function(){s(["","","",""])}),[]),Object(g.useEffect)((function(){n&&r&&(E(null==n?void 0:n.name),_(null==n?void 0:n.analysis),s(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(g.useImperativeHandle)(t,(function(){return{onSave:L,Clear:j}}));var L=function(){if(!S)return c.b.info("请您输入题干"),!1;var e=l.findIndex((function(e){return!e}));if(e>-1)return c.b.info("请先输入 ".concat(Z[e]," 选项的内容")),!1;if(console.log("activeAnswer: ",y),"number"!=typeof y)return c.b.info("请设置本题的正确答案点击选项A/B...即可完成设置"),!1;var t=l.map((function(e,t){return{choice_text:e,is_answer:y===t?1:0}}));return{name:S,choices:t,analysis:T}},j=function(){s(["","","",""]),E(""),_(""),x("")};return v.a.createElement("section",{className:W.a.wrap},v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"题干:")),v.a.createElement(P.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(e){return E(e)}}),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"答案选项:",v.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),l.map((function(e,t){return v.a.createElement("div",{className:W.a.choiceWrap,key:t},v.a.createElement(i.a,{title:"点击设置为标准答案",placement:"left"},v.a.createElement("div",{className:"".concat(W.a.answer," ").concat(y===t?W.a.activeAnswer:""),onClick:function(){return x(t)}},Z[t])),v.a.createElement("div",{className:W.a.editorWrap},f===t?v.a.createElement(P.a,{id:"single-question-option-".concat(t),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){l[t]=e,s(l)}}):v.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return h(t)}},v.a.createElement(k.a,{value:e}))),t>1&&v.a.createElement(i.a,{title:"删除"},v.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){s(l.filter((function(e,n){return n!==t}))),t===y&&x(null)}})),t<7&&t===l.length-1&&v.a.createElement(i.a,{title:"新增参考答案"},v.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return s([].concat(Object(D.a)(l),[""]))}})))})),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.title},"题目解析:")),v.a.createElement(P.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:T,onChange:function(e){return _(e)}}))},Y=Object(S.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(g.forwardRef)(X)),Q=function(e,t){var n=e.editData,r=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),i=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(g.useState)("")),a=Object(p.a)(i,2),o=a[0],l=a[1],s=Object(g.useState)(""),u=Object(p.a)(s,2),d=u[0],f=u[1],h=Object(g.useState)(""),m=Object(p.a)(h,2),b=m[0],y=m[1];Object(g.useEffect)((function(){var e;n&&r&&(l(null==n?void 0:n.name),f(null==n?void 0:n.analysis),y(null==n||null===(e=n.answer_texts)||void 0===e?void 0:e[0]))}),[n]),Object(g.useImperativeHandle)(t,(function(){return{onSave:x,Clear:w}}));var x=function(){return o?b?{name:o,answer_texts:[b],analysis:d}:(c.b.info("请您输入参考答案"),!1):(c.b.info("请您输入题干"),!1)},w=function(){l(""),f(""),y("")};return v.a.createElement("section",{className:W.a.wrap},v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"题干:")),v.a.createElement(P.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:o,onChange:function(e){return l(e)}}),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.title},"参考答案:")),v.a.createElement(P.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:b,onChange:function(e){return y(e)}}),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.title},"题目解析:")),v.a.createElement(P.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:d,onChange:function(e){return f(e)}}))},ee=Object(S.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(g.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"],re=function(e,t){e.globalSetting,e.loading,e.dispatch;var n=e.editData,r=(e.onRef,e.isEdit),a=(Object(I.a)(e,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),Object(g.useState)("")),o=Object(p.a)(a,2),l=o[0],s=o[1],u=Object(g.useState)([]),d=Object(p.a)(u,2),f=d[0],h=d[1];console.log(f),Object(g.useEffect)((function(){var e;if(n&&r){s(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,r;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===(r=e.choices)||void 0===r?void 0:r.findIndex((function(e){return e.is_answer}))])||void 0===n?void 0:n.filter((function(e){return-1!==e}))})}));h(t)}}),[n]),Object(g.useImperativeHandle)(t,(function(){return{onSave:m,Clear:b}}));var m=function(){if(!l)return c.b.info("请您输入题干"),!1;if(0===f.length)return c.b.info("请您添加小题"),!1;for(var e=0;e<f.length;e++){var t,n=f[e];if(null==n||!n.name)return c.b.info("请您输入第".concat(e+1,"小题题干")),!1;var r=null==n||null===(t=n.qusList)||void 0===t?void 0:t.findIndex((function(e){return!e}));if(r>-1)return c.b.info("请先输入第".concat(e+1,"小题").concat(ne[r],"选项的内容")),!1;if(null==n||!n.qusAnswer.length)return c.b.info("请设置第".concat(e+1,"小题的正确答案点击选项A/B...即可完成设置")),!1}var i=f.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:l,sub_item_banks:i}},b=function(){s(""),h([])},y=function(e,t,n){var r,i=Object(L.cloneDeep)(f);("open"===e&&(i[t].open=!i[t].open),"delete"===e&&i.splice(t,1),"value"===e&&(i[t].name=n),"answer"===e&&(i[t].qusAnswer=[n]),"edit"===e&&(i[t].activeQusEditor=n),"details"===e&&(i[t].qusList[i[t].activeQusEditor]=n),"addQus"===e&&(i[t].qusList=i[t].qusList.concat("")),"deleteQus"===e)&&(i[t].qusList=i[t].qusList.filter((function(e,t){return t!==n})),i[t].qusAnswer=null===(r=i[t].qusAnswer)||void 0===r?void 0:r.filter((function(e){return e!==n})));"analysis"===e&&(i[t].analysis=n),h(i)};return v.a.createElement("section",{className:W.a.wrap},v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"题干:")),v.a.createElement(P.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:l,onChange:function(e){return s(e)}}),null==f?void 0:f.map((function(e,t){var n;return v.a.createElement("div",{className:W.a.fold,key:e.id},v.a.createElement("div",{onClick:function(){return y("open",t)},className:W.a.head},v.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:e.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),v.a.createElement("span",null,"第",t+1,"小题(单选题)"),v.a.createElement("b",{style:{visibility:"hidden"},onClick:function(e){e.stopPropagation(),y("delete",t)},className:"iconfont icon-shanchu8"})),v.a.createElement("div",{className:"mb10",style:{display:e.open?"block":"none"}},v.a.createElement(P.a,{watch:!0,height:155,placeholder:"请您输入题干",defaultValue:null==e?void 0:e.name,onChange:function(e){return y("value",t,e)}}),v.a.createElement("p",{className:W.a.titleWrap},v.a.createElement("span",{className:W.a.required},"*"),v.a.createElement("span",{className:W.a.title},"答案选项:",v.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),null==e||null===(n=e.qusList)||void 0===n?void 0:n.map((function(n,r){var a,o;return v.a.createElement("div",{className:W.a.choiceWrap,key:r},v.a.createElement(i.a,{title:"点击设置为标准答案",placement:"left"},v.a.createElement("div",{className:"".concat(W.a.answer," ").concat(null!=e&&null!==(a=e.qusAnswer)&&void 0!==a&&a.includes(r)?W.a.activeAnswer:""),onClick:function(){return y("answer",t,r)}},ne[r])),v.a.createElement("div",{className:W.a.editorWrap},(null==e?void 0:e.activeQusEditor)===r?v.a.createElement(P.a,{id:"single-question-option-".concat(r),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:n,onChange:function(e){return y("details",t,e)}}):v.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return y("edit",t,r)}},v.a.createElement(k.a,{value:n}))),r>1&&v.a.createElement(i.a,{title:"删除"},v.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return y("deleteQus",t,r)}})),r<7&&r===(null==e||null===(o=e.qusList)||void 0===o?void 0:o.length)-1&&v.a.createElement(i.a,{title:"新增参考答案"},v.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return y("addQus",t)}})))})),v.a.createElement("p",{className:"mb10 mt10"},v.a.createElement("span",{className:W.a.title},"题目解析:")),v.a.createElement(P.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:e.analysis,onChange:function(e){return y("analysis",t,e)}})))})))},ie=Object(S.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(g.forwardRef)(re));t.a=function(e){var t,n,h,b,x,O,T,j,M=e.data,D=e.submit,I=e.goBack,P=e.loading,F=e.onTypeScore,R=e.editPreview,z=void 0!==R&&R,B=e.onSkipExamination,W=e.selectValue,q=e.onExchange,V=Object(g.useRef)(),U=Object(g.useRef)(Object(L.debounce)((function(){return le()}),100,{leading:!0,trailing:!0})),K=Object(g.useState)(null),G=Object(p.a)(K,2),Z=G[0],X=G[1],Q=Object(g.useState)(!1),te=Object(p.a)(Q,2),ne=te[0],re=te[1],ae=Object(C.i)();Object(g.useEffect)((function(){return window.addEventListener("scroll",null==U?void 0:U.current),function(){window.removeEventListener("scroll",null==U?void 0:U.current)}}),[]),Object(g.useEffect)((function(){re(!0)}),[]),Object(g.useEffect)((function(){var e,t,n,r,i=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===(r=n.childNodes)||void 0===r?void 0:r[2];i&&(i.nodeValue="份")}),[M]);var oe=function(e){var t=parseInt(e);return isNaN(t)?"":t};var le=function(){var e,t,n,r,i=document.getElementById("preview_btns"),a=document.getElementById("preview_btns_else");n=0,r=0,document.body&&(n=document.body.scrollTop),document.documentElement&&(r=document.documentElement.scrollTop),(n-r>0?n:r)+("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)?(i.style.visibility="hidden",a.style.visibility="visible"):(i.style.visibility="visible",a.style.visibility="hidden")},se=["容易","简单","适中","困难"],ce=["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"],ue=function(e){console.log(e,"key"),B(e-1)},de=function(){return v.a.createElement(v.a.Fragment,null,v.a.createElement(o.a,{color:"#55575D",overlayClassName:y.a.popover,visible:ne,getPopupContainer:function(e){return null==e?void 0:e.parentNode},content:"如您对此份试题满意,可将此份试题保存为固定试卷"},v.a.createElement(l.a,{onMouseEnter:function(){return re(!0)},onMouseLeave:function(){return re(!1)},onClick:function(){var e,t;t="",f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"保存试卷",content:v.a.createElement("div",{className:y.a.modalColumn},v.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},v.a.createElement("img",{style:{marginRight:5},src:A.a}),"保存后单独生成一份人工组卷类型的固定试卷。"),v.a.createElement("div",{className:y.a.modalRow,style:{marginTop:20}},v.a.createElement("sup",{className:y.a.sup},"*"),v.a.createElement("span",{style:{flexShrink:0}},"试卷名称:"),v.a.createElement(s.a,{placeholder:"请输入试卷名称",min:0,maxLength:60,defaultValue:t,onChange:function(e){t=e.target.value}}))),okText:"确认",cancelText:"取消",onOk:(e=Object(u.a)(m.a.mark((function e(){var n,r,i,a,o;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return c.b.warn("试卷名称不能为空"),e.abrupt("return",Promise.reject());case 3:return r=[],i=[],a=[],null==M||null===(n=M.questionList)||void 0===n||n.forEach((function(e){var t;null===(t=e.questions)||void 0===t||t.forEach((function(t){r.push(t.id),i.push(e.questions_score/e.questions_count),"COMBINATION"===e.type&&a.push({id:t.id,sub_item_bank_ids:t.sub_item_banks.map((function(e){return e.id}))})}))})),console.log("-----",a),o={item_bank_ids:r,item_bank_scores:i,name:t,combination_item_banks:a},e.next=11,D(o);case 11:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})}},"保存")),v.a.createElement(l.a,{onClick:function(){document.body.scrollIntoView(),I()}},"返回"),v.a.createElement(l.a,{loading:P,onClick:function(){return D()},type:"primary"},"提交"))},fe=function(){var e;return v.a.createElement(v.a.Fragment,null,v.a.createElement(l.a,{onClick:I},"返回"),W>0&&v.a.createElement(l.a,{onClick:function(){return ue(W)},type:"primary"},"上一份"),W<(null==M||null===(e=M.exam)||void 0===e?void 0:e.total_num)-1&&v.a.createElement(l.a,{onClick:function(){return ue(W+2)}},"下一份"))},pe=function(){var e=Object(u.a)(m.a.mark((function e(t,n){var r,i,a,o,l,s,u,d,f,p;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(r=V.current)||void 0===r?void 0:r.onSave();case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return");case 5:return a={question_score:n.score,analysis:i.analysis},console.log(i,"editorData"),"SINGLE"!==t&&"MULTIPLE"!==t&&"JUDGMENT"!==t||(l=[],s=[],a.question_type="JUDGMENT"===t?2:1,a.question_title=null==i?void 0:i.name,null==i||null===(o=i.choices)||void 0===o||o.forEach((function(e,t){l.push(e.choice_text),null!=e&&e.is_answer&&s.push(t+1)})),a.question_choices=l,a.standard_answers=s),"COMPLETION"===t&&(a.is_ordered=i.is_ordered,a.question_title=null==i?void 0:i.name,a.question_type=3,d=[],null==i||null===(u=i.standard_answers)||void 0===u||u.forEach((function(e,t){d.push({choice_id:e.position,answer_text:e.answer_text})})),a.standard_answers=d),"SUBJECTIVE"===t&&(a.question_title=null==i?void 0:i.name,a.question_type=3,a.standard_answers=null==i?void 0:i.answer_texts),"COMBINATION"===t&&(a.question_title=null==i?void 0:i.name,a.question_type=7,a.sub_questions=null==i||null===(f=i.sub_item_banks)||void 0===f?void 0:f.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 a.analysis),e.next=13,Object(E.a)("/api/exercise_questions/".concat(n.id,".json"),{method:"put",body:a});case 13:0===(null==(p=e.sent)?void 0:p.status)&&(c.b.success("编辑成功"),ue(W+1)),X(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==M||null===(n=M.exam)||void 0===n?void 0:n.total_num);t++){var n;e.push({})}return e}(),"data");var he=null==M||null===(t=M.questionList)||void 0===t?void 0:t.reduce((function(e,t){return e+t.questions_score}),0),me=z&&1!==(null==M||null===(n=M.exam)||void 0===n?void 0:n.exercise_status);return v.a.createElement("section",{className:y.a.wrap},v.a.createElement("div",{id:"id_left_preview",className:y.a.left,onMouseEnter:function(e){document.getElementById("id_left_preview").style.overflowY="auto"},onMouseLeave:function(e){document.getElementById("id_left_preview").style.overflowY="hidden"}},v.a.createElement("div",{className:y.a.title},v.a.createElement("div",null,v.a.createElement("b",null),v.a.createElement("span",null,"答题卡"))),v.a.createElement("div",{className:y.a.total},v.a.createElement("div",null,v.a.createElement("img",{src:N.a}),v.a.createElement("span",null,"题数(道)"),v.a.createElement("aside",null,null==M?void 0:M.all_questions_count)),v.a.createElement("div",{className:"mr30 ml30"},v.a.createElement("img",{src:_.a}),v.a.createElement("span",null,"总分(分)"),v.a.createElement("aside",null,he)),v.a.createElement("div",null,v.a.createElement("img",{src:w.a}),v.a.createElement("span",null,"时长(分)"),v.a.createElement("aside",null,null==M||null===(h=M.exam)||void 0===h?void 0:h.time))),null==M||null===(b=M.questionList)||void 0===b?void 0:b.map((function(e,t){var n;return v.a.createElement("div",{className:y.a.list,key:t},v.a.createElement("div",{className:y.a.name},v.a.createElement("b",null),v.a.createElement("span",null,e.name)),v.a.createElement("aside",null,v.a.createElement("div",null,"共",v.a.createElement("span",{className:y.a.b},e.questions_count),"题 ",v.a.createElement("span",{className:y.a.l},"|"),"共",v.a.createElement("span",{className:y.a.r},e.questions_score),"分"),v.a.createElement("div",{className:y.a.answerSheet},null==e||null===(n=e.questions)||void 0===n?void 0:n.map((function(e,t){return v.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:y.a.tag},t+1)})))))}))),v.a.createElement("div",{className:y.a.right},v.a.createElement("div",{className:y.a.examName,id:"examName"},v.a.createElement("div",{className:y.a.name},v.a.createElement(i.a,{title:null==M||null===(x=M.exam)||void 0===x?void 0:x.name,getPopupContainer:function(e){return e.parentNode}},v.a.createElement("span",{className:y.a.t},null==M||null===(O=M.exam)||void 0===O?void 0:O.name))),z?v.a.createElement(r.a,{showTotal:function(e){return v.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"共计",v.a.createElement("span",{className:"c-light-primary"},e),"份试卷")},total:null==M||null===(T=M.exam)||void 0===T?void 0:T.total_num,pageSize:1,current:W+1,showSizeChanger:!1,onChange:ue,showQuickJumper:!0,hideOnSinglePage:!1}):v.a.createElement(l.a,{onClick:function(){var e,t=f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换预览中的所有试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(e=Object(u.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.update({cancelButtonProps:{disabled:!0}}),e.next=3,q();case 3:t.update({cancelButtonProps:{disabled:!1}}),c.b.success("已重新随机生成整张试题");case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},type:"primary"},"随机更换")),v.a.createElement("div",{className:y.a.topWarp},null==M||null===(j=M.questionList)||void 0===j?void 0:j.map((function(e,t){var n,r;return v.a.createElement(v.a.Fragment,{key:t},v.a.createElement("div",{className:y.a.head,style:0===t?{border:0,marginTop:-16}:{}},v.a.createElement("div",{className:y.a.name},v.a.createElement("b",null),v.a.createElement("span",null,e.name)),v.a.createElement("div",{className:y.a.so},"共",v.a.createElement("span",{className:y.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})),"小题)"),v.a.createElement("span",{className:y.a.l},"|"),"共",v.a.createElement("span",{className:y.a.r},e.questions_score),"分"),!z&&v.a.createElement("div",{className:y.a.btn},v.a.createElement(l.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,r=0;r="COMBINATION"===e.type?e.questions_score/t.length:e.questions_score/e.questions_count,f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"分数设置",content:v.a.createElement("div",{className:y.a.modalColumn},v.a.createElement("div",{className:y.a.modalRow,style:{justifyContent:"flex-start"}},v.a.createElement("sup",{className:y.a.sup},"*"),v.a.createElement("span",null,null==e?void 0:e.name,"COMBINATION"===(null==e?void 0:e.type)&&"中的每小题",""),v.a.createElement(d.a,{min:1,parser:oe,defaultValue:r,onChange:function(e){r=e}}),v.a.createElement("span",{className:"ml5"},"分/题"))),okText:"确认",cancelText:"取消",onOk:(n=Object(u.a)(m.a.mark((function n(){var i,a;return m.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r){n.next=3;break}return c.b.warn("分数不能为空或为0"),n.abrupt("return",Promise.reject());case 3:"COMBINATION"===e.type?(i={type:null==e?void 0:e.type,score:r,scoreTotal:r*(null==t?void 0:t.length)},F(i)):(a={type:null==e?void 0:e.type,score:r,scoreTotal:r*e.questions_count},F(a));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}(e)},type:"primary",ghost:!0,className:"mr20"},"设置得分"),v.a.createElement(l.a,{onClick:function(){return i=null===(n=(t=e).questions)||void 0===n?void 0:n.map((function(e){return e.id})),a=t.name,void(o=f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换".concat(a,"中的所有试题吗?"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(r=Object(u.a)(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.update({cancelButtonProps:{disabled:!0}}),e.next=3,q({seleted_item_bank_ids:i},{type:t.type});case 3:o.update({cancelButtonProps:{disabled:!1}}),c.b.success("已重新随机生成".concat(a,"试题"));case 5:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})}));var t,n,r,i,a,o},type:"primary",ghost:!0},"随机更换"))),null==e||null===(r=e.questions)||void 0===r?void 0:r.map((function(t,n){return Z===t.id?v.a.createElement("div",{id:"Anchor_".concat(t.id),className:y.a.content,style:{padding:0,marginTop:10},key:t.id},v.a.createElement("div",{style:{float:"right",marginTop:-6}},v.a.createElement(l.a,{onClick:function(){return X(null)},className:"mr20",type:"primary",ghost:!0},"取消"),v.a.createElement(l.a,{onClick:function(){return pe(null==e?void 0:e.type,t)},type:"primary"},"保存")),function(e,t){if(console.log(e,222),"SINGLE"===t)return v.a.createElement(v.a.Fragment,null,v.a.createElement(Y,{ref:V,editData:e,isEdit:!0}),v.a.createElement(a.a,null));if("MULTIPLE"===t)return v.a.createElement(v.a.Fragment,null,v.a.createElement(J,{ref:V,editData:e,isEdit:!0}),v.a.createElement(a.a,null));if("JUDGMENT"===t)return v.a.createElement(v.a.Fragment,null,v.a.createElement($,{ref:V,editData:e,isEdit:!0}),v.a.createElement(a.a,null));if("COMPLETION"===t)return v.a.createElement(v.a.Fragment,null,v.a.createElement(H,{ref:V,editData:e,isEdit:!0}),v.a.createElement(a.a,null));if("SUBJECTIVE"===t)return v.a.createElement(v.a.Fragment,null,v.a.createElement(ee,{ref:V,editData:e,isEdit:!0}),v.a.createElement(a.a,null));if("COMBINATION"===t)return v.a.createElement(v.a.Fragment,null,v.a.createElement(ie,{ref:V,editData:e,isEdit:!0}),v.a.createElement(a.a,null));var n;"PROGRAM"===t&&S.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)):v.a.createElement("div",{id:"Anchor_".concat(t.id),className:y.a.content,key:t.id},v.a.createElement("div",{className:y.a.titleWrap},v.a.createElement(k.a,{style:{paddingRight:10},className:y.a.titleHtml,value:n+1+"、"+"".concat("combination"===(null==t?void 0:t.item_type)?"(题干)":"")+t.name}),z&&v.a.createElement(l.a,{disabled:me,onClick:function(){Z?c.b.warn("先保存或取消当前正在编辑的试题"):X(t.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"编辑"),v.a.createElement(l.a,{disabled:me,onClick:function(){return function(e,t,n,r){var i,a,o=null===(i=r.questions)||void 0===i?void 0:i.map((function(e){return e.id})),l=f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认要更换该试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(a=Object(u.a)(m.a.mark((function r(){return m.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l.update({cancelButtonProps:{disabled:!0}}),r.next=3,q({single_question_id:e,seleted_item_bank_ids:o},{type:t,index:n});case 3:l.update({cancelButtonProps:{disabled:!1}}),c.b.success("已重新随机生成试题");case 5:case"end":return r.stop()}}),r)}))),function(){return a.apply(this,arguments)})})}(t.id,e.type,n,e)},type:"primary",ghost:!0},"换一题")),("SINGLE"===e.type||"JUDGMENT"===e.type||"MULTIPLE"===e.type)&&(s=t,p=[],v.a.createElement(v.a.Fragment,null,v.a.createElement("aside",{className:y.a.single},null==s||null===(d=s.choices)||void 0===d?void 0:d.map((function(e,t){return e.is_answer&&p.push(ce[t]),v.a.createElement("ul",{key:t},v.a.createElement("li",null,ce[t],"、"),v.a.createElement("li",null,v.a.createElement(k.a,{value:e.choice_text})))}))),v.a.createElement("div",{className:y.a.analysis},v.a.createElement("div",null,"正确答案:",p.join(""),v.a.createElement("span",{className:"ml30"},"难度:",se[s.difficulty])),v.a.createElement("aside",null,v.a.createElement("span",{className:y.a.text},"解析:"),v.a.createElement(k.a,{value:s.analysis?s.analysis:"暂无解析"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==s?void 0:s.discipline_name,"/").concat(null==s?void 0:s.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==s?void 0:s.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 v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{className:y.a.analysis},v.a.createElement("div",null,"正确答案:",n),v.a.createElement("aside",null,v.a.createElement("span",{className:y.a.text},"解析:"),v.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.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)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name))))}(t),"SUBJECTIVE"===e.type&&function(e){var t;return v.a.createElement("div",{className:y.a.analysis},v.a.createElement("div",null,"正确答案:",null==e||null===(t=e.answer_texts)||void 0===t?void 0:t[0]),v.a.createElement("aside",null,v.a.createElement("span",{className:y.a.text},"解析:"),v.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.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)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name)))}(t),"PROGRAM"===e.type&&function(e){var t;return v.a.createElement("div",{className:y.a.analysis},v.a.createElement("aside",null,v.a.createElement("span",{className:y.a.text},"预期输出:"),v.a.createElement(k.a,{value:null==e||null===(t=e.program_attr)||void 0===t?void 0:t.description})),v.a.createElement("ul",null,v.a.createElement("li",null,v.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)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name)))}(t),"COMBINATION"===e.type&&(r=t,i=n,v.a.createElement("div",null,null==r||null===(o=r.sub_item_banks)||void 0===o?void 0:o.map((function(e,t){var n,a=[];return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},i+1+"."+(t+1),"(单选题)",e.name),v.a.createElement("aside",{className:y.a.single},null==e||null===(n=e.choices)||void 0===n?void 0:n.map((function(e,t){return e.is_answer&&a.push(ce[t]),v.a.createElement("ul",{key:t},v.a.createElement("li",null,ce[t],"、"),v.a.createElement("li",null,v.a.createElement(k.a,{value:e.choice_text})))}))),v.a.createElement("div",{className:y.a.analysis},v.a.createElement("div",null,"正确答案:",a.join(""),v.a.createElement("span",{className:"ml30"},"难度:",se[e.difficulty])),v.a.createElement("aside",null,v.a.createElement("span",{className:y.a.text},"解析:"),v.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==r?void 0:r.discipline_name,"/").concat(null==r?void 0:r.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==r?void 0:r.tag_discipline_name))))})))),v.a.createElement("div",null));var r,i,o,s,d,p})))}))),v.a.createElement("div",{className:y.a.btnsElse,id:"preview_btns_else"},z?fe():de()),v.a.createElement("div",{className:y.a.btnsWrap,id:"preview_btns"},v.a.createElement("div",{className:y.a.btns},z?fe():de()))))}},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"}}}]);