return"number"==typeofe||/^\d+$/.test(String(e))?e+"px":e}varr=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&ot(this);vari=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(vart=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){It(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,Hl(r,"refresh",this)}),operation:function(e){returnNt(this,e)},refresh:Ot(function(){vare=this.display.cachedTextHeight;Et(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-vt(this.display))>.5)&&l(this),Hl(this,"refresh",this)}),swapDoc:Ot(function(e){vart=this.doc;returnt.cm=null,Xr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ci(this,"swapDoc",this,t),t}),getInputField:function(){returnthis.display.input.getField()},getWrapperElement:function(){returnthis.display.wrapper},getScrollerElement:function(){returnthis.display.scroller},getGutterElement:function(){returnthis.display.gutters}},Ni(e);varZo=e.defaults={},Jo=e.optionHandlers={},el=e.Init={toString:function(){return"CodeMirror.Init"}};Gn("value","",function(e,t){e.setValue(t)},!0),Gn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Gn("indentUnit",2,n,!0),Gn("indentWithTabs",!1),Gn("smartIndent",!0),Gn("tabSize",4,function(e){r(e),lt(e),Et(e)},!0),Gn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){varn=[],r=e.doc.first;e.doc.iter(function(e){for(vari=0;;){varo=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Po(r,o))}r++});for(vari=n.length-1;i>=0;i--)Hn(e.doc,t,n[i],Po(n[i].line,n[i].ch+t.length))}}),Gn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=newRegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Gn("specialCharPlaceholder",zr,function(e){e.refresh()},!0),Gn("electricChars",!0),Gn("inputStyle",No?"contenteditable":"textarea",function(){thrownewError("inputStyle can not (yet) be changed in a running editor")},!0),Gn("rtlMoveVisually",!Oo),Gn("wholeLineUpdateBefore",!0),Gn("theme","default",function(e){a(e),s(e)},!0),Gn("keyMap","default",function(t,n,r){vari=$n(n),o=r!=e.Init&&$n(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Gn("extraKeys",null),Gn("lineWrapping",!1,i,!0),Gn("gutters",[],function(e){f(e.options),s(e)},!0),Gn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?S(e.display)+"px":"0",e.refresh()},!0),Gn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Gn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Gn("lineNumbers",!1,function(e){f(e.options),s(e)},!0),Gn("firstLineNumber",1,s,!0),Gn("lineNumberFormatter",function(e){returne},s,!0),Gn("showCursorWhenSelecting",!1,De,!0),Gn("resetSelectionOnContextMenu",!0),Gn("lineWiseCopyCut",!0),Gn("readOnly",!1,function(e,t){"nocursor"==t?(vn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Gn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Gn("dragDrop",!0,jt),Gn("allowDropFileTypes",null),Gn("cursorBlinkRate",530),Gn("cursorScrollMargin",0),Gn("cursorHeight",1,De,!0),Gn("singleCursorHeightPerLine",!0,De,!0),Gn("workTime",100),Gn("workDelay",100),Gn("flattenSpans",!0,r,!0),Gn("addModeClass",!1,r,!0),Gn("pollInterval",100),Gn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Gn("historyEventDelay",1250),Gn("viewportMargin",10,function(e){e.refresh()},!0),Gn("maxHighlightLength",1e4,r,!0),Gn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Gn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Gn("autofocus",null);vartl=e.modes={},nl=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),tl[
v;if("endTag"==e||"selfcloseTag"==e){varr=n.tagName,i=n.tagStart;returnn.tagName=n.tagStart=null,"selfcloseTag"==e||L.autoSelfClosers.hasOwnProperty(r)?u(n,r):(u(n,r),n.context=news(n,r,i==n.indented)),d}returnS="error",g}functionv(e,t,n){return"equals"==e?y:(L.allowMissing||(S="error"),g(e,t,n))}functiony(e,t,n){return"string"==e?x:"word"==e&&L.allowUnquoted?(S="string",g):(S="error",g(e,t,n))}functionx(e,t,n){return"string"==e?x:g(e,t,n)}varb=t.indentUnit,w=n.multilineTagIndentFactor||1,k=n.multilineTagIndentPastTag;null==k&&(k=!0);varC,S,L=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},T=n.alignCDATA;returnr.isInText=!0,{startState:function(){return{tokenize:r,state:d,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())returnnull;C=null;varn=t.tokenize(e,t);return(n||C)&&"comment"!=n&&(S=null,t.state=t.state(C||n,e,t),S&&(n="error"==S?n+" error":S)),n},indent:function(t,n,o){varl=t.context;if(t.tokenize.isInAttribute)returnt.tagStart==t.indented?t.stringStartCol+1:t.indented+b;if(l&&l.noIndent)returne.Pass;if(t.tokenize!=i&&t.tokenize!=r)returno?o.match(/^(\s*)/)[0].length:0;if(t.tagName)returnk?t.tagStart+t.tagName.length+2:t.tagStart+b*w;if(T&&/<!\[CDATA\[/.test(n))return0;vara=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;l;){if(l.tagName==a[2]){l=l.prev;break}if(!L.implicitlyClosed.hasOwnProperty(l.tagName))break;l=l.prev}elseif(a)for(;l;){vars=L.contextGrabbers[l.tagName];if(!s||!s.hasOwnProperty(a[2]))break;l=l.prev}for(;l&&!l.startOfLine;)l=l.prev;returnl?l.indent+b:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":6}],11:[function(t,n,r){(function(t){(function(){functiont(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}functioni(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||newo,this.renderer.options=this.options,!this.links)thrownewError("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}functiono(e){this.options=e||{}}functionl(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||newo,this.renderer=this.options.renderer,this.renderer.options=this.options}functiona(e,t){returne.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}functions(e){returne.replace(/&([#\w]+);/g,function(e,t){returnt=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}functionc(e,t){returne=e.source,t=t||"",fun
W.prototype.markdown=function(e){if(E){vart={};returnthis.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks!==!1&&(t.breaks=!0),this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){returnwindow.hljs.highlightAuto(e).value}),E.setOptions(t),E(e)}},W.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;vart=this.options,n=this,i={};for(varoinP)!function(e){i[r(e)]=function(){P[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.F11=function(){a(n)},i.F9=function(){L(n)},i.Esc=function(e){e.getOption("fullScreen")&&a(n)};varl,s;t.spellChecker!==!1?(l="spell-checker",s=t.parsingConfig,s.name="gfm",s.gitHubSpice=!1):(l=t.parsingConfig,l.name="gfm",l.gitHubSpice=!1),this.codemirror=D.fromTextArea(e,{mode:l,backdrop:s,theme:"paper",tabSize:void0!=t.tabSize?t.tabSize:2,indentUnit:void0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs===!1?!1:!0,lineNumbers:!1,autofocus:t.autofocus===!0?!0:!1,extraKeys:i,lineWrapping:t.lineWrapping===!1?!1:!0,allowDropFileTypes:["text/plain"]}),t.toolbar!==!1&&this.createToolbar(),t.status!==!1&&this.createStatusbar(),void0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.createSideBySide(),this._rendered=this.element}},W.prototype.autosave=function(){vare=this.value(),t=this;if(void0==this.options.autosave.unique_id||""==this.options.autosave.unique_id)returnvoidconsole.log("SimpleMDE: You must set a unique_id to use the autosave feature");null!=t.element.form&&void0!=t.element.form&&t.element.form.addEventListener("submit",function(){localStorage.setItem(t.options.autosave.unique_id,"")}),this.options.autosave.loaded!==!0&&(null!=localStorage.getItem(this.options.autosave.unique_id)&&this.codemirror.setValue(localStorage.getItem(this.options.autosave.unique_id)),this.options.autosave.loaded=!0),localStorage&&localStorage.setItem(this.options.autosave.unique_id,e);varn=document.getElementById("autosaved");if(null!=n&&void0!=n&&""!=n){varr=newDate,i=r.getHours(),o=r.getMinutes(),l="am",a=i;a>=12&&(a=i-12,l="pm"),0==a&&(a=12),o=10>o?"0"+o:o,n.innerHTML="Autosaved: "+a+":"+o+" "+l}setTimeout(function(){t.autosave()},this.options.autosave.delay||1e4)},W.prototype.createSideBySide=function(){vare=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));varr=!1,i=!1;returne.on("scroll",function(e){if(r)returnvoid(r=!1);i=!0;vart=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,l=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=l}),n.onscroll=function(){if(i)returnvoid(i=!1);r=!0;vart=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,l=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,l)},!0},W.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){vart;for(t=0;t<e.length;t++)void0!=R[e[t]]&&(e[t]=R[e[t]]);varn=document.createElement("div");n.className="editor-toolbar";varr=this,a={};for(r.toolbar=e,t=0;t<e.length;t++)("guide"!=e[t].name||r.options.toolbarGuideIcon!==!1)&&(r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[t].name)||("fullscreen"!=e[t].name&&"side-by-side"!=e[t].name||!F())&&!function(e){vart;t="|"===e?o():i(e,r.options.toolbarTips),e.action&&("function"==typeofe.action?t.onclick=function(){e.action(r)}:"string"==typeofe.action&&(t.href=e.action,t.target="_blank")),a[e.name||e]=t,n.appendChild(t)}(e[t]));r.toolbarElements=a;vars=this.codemirror;s.on("cursorActivity",function(){vare=l(s);for(vartina)!function(t){varn=a[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)});varc=s.getWrapperElement();ret