Files
intotheeast-com-content/themes/intotheeast/js/post/post-form.js
T
m038andClaude Opus 4.8 525b684493 feat(post-form): M2 photo edit — load, remove & reorder from the edit form
Editing an entry now loads its existing photos into FilePond so the owner can
remove and reorder them; the first photo is the cover. Adding NEW photos on edit
is intentionally suppressed (see below).

post-form.js (U7):
- On ?edit=, load the entry's current images into FilePond as LOCAL items (via
  the session media API, gpx-manager pattern). They display for remove/reorder
  and ride the existing photo_order manifest on submit, but are never re-uploaded.
- Exclude the FilePond field from the D1 prefill disable-sweep — FilePond reads
  its input's disabled state at init and never re-enables, which had removed its
  controls in edit mode.
- Suppress the add affordance in edit mode (allowBrowse/allowDrop off): a new
  upload on edit hits add-page-by-form's Grav-2.0 edit-merge fatal
  ((array)$page->header() yields mangled protected keys → array_merge(null,…)).
  That plugin is stock/GPM/git-ignored (no fork), so adding photos on edit is
  deferred to the form-to-page/image-upload rework.

cache-on-save.php (U8):
- reconcilePhotos(): on edit, resolve the entry folder via the shared scope guard
  (not the fuzzy create-path finder), delete any image dropped from the manifest,
  then renumber survivors photo-1..N in the submitted order (cover = first).
- Run reconciliation ONCE per submit: onFormProcessed fires per process action
  (4×); a 2nd pass deleted the just-renamed photo-N files as "unlisted".
- Empty manifest reconciles nothing (fail-safe: never wipes photos on a missing
  photo_order).

Verified on the container: existing photos load (V9); remove + reorder persist to
disk with cover=first (V10); reconcile helpers covered by a reflection unit test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 11:25:01 +02:00

96 lines
339 KiB
JavaScript

import{a as Ds,b as Ye,c as Xc}from"./chunk-ZWRDP37E.js";var ct=Ye((Xo,Yo)=>{(function(o,f){typeof Xo=="object"&&typeof Yo<"u"?Yo.exports=f():typeof define=="function"&&define.amd?define(f):(o=o||self,o.CodeMirror=f())})(Xo,function(){"use strict";var o=navigator.userAgent,f=navigator.platform,c=/gecko\/\d/i.test(o),l=/MSIE \d/.test(o),s=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),g=/Edge\/(\d+)/.exec(o),d=l||s||g,p=d&&(l?document.documentMode||6:+(g||s)[1]),y=!g&&/WebKit\//.test(o),w=y&&/Qt\/\d+\.\d+/.test(o),D=!g&&/Chrome\/(\d+)/.exec(o),S=D&&+D[1],F=/Opera\//.test(o),T=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),N=/PhantomJS/.test(o),A=T&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),B=/Android/.test(o),I=A||B||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),R=A||/Mac/.test(f),H=/\bCrOS\b/.test(o),_=/win/i.test(f),X=F&&o.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(F=!1,y=!0);var K=R&&(w||F&&(X==null||X<12.11)),ge=c||d&&p>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ue=function(e,t){var i=e.className,r=G(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return ae(e).appendChild(t)}function L(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)n.appendChild(t[a]);return n}function U(e,t,i,r){var n=L(e,t,i,r);return n.setAttribute("role","presentation"),n}var W;document.createRange?W=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:W=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function V(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ve(e){var t=e.ownerDocument||e,i;try{i=e.activeElement}catch{i=t.body||null}for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;return i}function Te(e,t){var i=e.className;G(t).test(i)||(e.className+=(i?" ":"")+t)}function mt(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!G(i[r]).test(t)&&(t+=" "+i[r]);return t}var k=function(e){e.select()};A?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:d&&(k=function(e){try{e.select()}catch{}});function b(e){return e.display.wrapper.ownerDocument}function ee(e){return ye(e.display.wrapper)}function ye(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function he(e){return b(e).defaultView}function tt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function dt(e,t,i){t||(t={});for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function Re(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,u=n||0;;){var h=e.indexOf(" ",a);if(h<0||h>=t)return u+(t-a);u+=h-a,u+=i-u%i,a=h+1}}var Je=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};Je.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Je.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function Fe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Me=50,Pe={toString:function(){return"CodeMirror.Pass"}},rt={scroll:!1},jr={origin:"*mouse"},St={origin:"+move"};function Ft(e,t,i){for(var r=0,n=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var u=a-r;if(a==e.length||n+u>=t)return r+Math.min(u,t-n);if(n+=a-r,n+=i-n%i,r=a+1,n>=t)return r}}var bt=[""];function qt(e){for(;bt.length<=e;)bt.push(me(bt)+" ");return bt[e]}function me(e){return e[e.length-1]}function xt(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Ut(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function Fi(){}function pa(e,t){var i;return Object.create?i=Object.create(e):(Fi.prototype=e,i=new Fi),t&&dt(t,i),i}var Iu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Hn(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Iu.test(e))}function Ei(e,t){return t?t.source.indexOf("\\w")>-1&&Hn(e)?!0:t.test(e):Hn(e)}function ga(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var zu=/[\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 Rn(e){return e.charCodeAt(0)>=768&&zu.test(e)}function va(e,t,i){for(;(i<0?t>0:t<e.length)&&Rn(e.charAt(t));)t+=i;return t}function Gr(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,a=r<0?Math.ceil(n):Math.floor(n);if(a==t)return e(a)?t:i;e(a)?i=a:t=a+r}}function Ou(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,a=0;a<e.length;++a){var u=e[a];(u.from<i&&u.to>t||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr",a),n=!0)}n||r(t,i,"ltr")}var Kr=null;function Xr(e,t,i){var r;Kr=null;for(var n=0;n<e.length;++n){var a=e[n];if(a.from<t&&a.to>t)return n;a.to==t&&(a.from!=a.to&&i=="before"?r=n:Kr=n),a.from==t&&(a.from!=a.to&&i!="before"?r=n:Kr=n)}return r??Kr}var Hu=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,a=/[LRr]/,u=/[Lb1n]/,h=/[1n]/;function v(m,x,C){this.level=m,this.from=x,this.to=C}return function(m,x){var C=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!r.test(m))return!1;for(var M=m.length,E=[],O=0;O<M;++O)E.push(i(m.charCodeAt(O)));for(var P=0,j=C;P<M;++P){var Y=E[P];Y=="m"?E[P]=j:j=Y}for(var Q=0,Z=C;Q<M;++Q){var $=E[Q];$=="1"&&Z=="r"?E[Q]="n":a.test($)&&(Z=$,$=="r"&&(E[Q]="R"))}for(var ne=1,ie=E[0];ne<M-1;++ne){var pe=E[ne];pe=="+"&&ie=="1"&&E[ne+1]=="1"?E[ne]="1":pe==","&&ie==E[ne+1]&&(ie=="1"||ie=="n")&&(E[ne]=ie),ie=pe}for(var we=0;we<M;++we){var Ge=E[we];if(Ge==",")E[we]="N";else if(Ge=="%"){var Le=void 0;for(Le=we+1;Le<M&&E[Le]=="%";++Le);for(var ft=we&&E[we-1]=="!"||Le<M&&E[Le]=="1"?"1":"N",at=we;at<Le;++at)E[at]=ft;we=Le-1}}for(var Oe=0,lt=C;Oe<M;++Oe){var Xe=E[Oe];lt=="L"&&Xe=="1"?E[Oe]="L":a.test(Xe)&&(lt=Xe)}for(var _e=0;_e<M;++_e)if(n.test(E[_e])){var He=void 0;for(He=_e+1;He<M&&n.test(E[He]);++He);for(var Be=(_e?E[_e-1]:C)=="L",st=(He<M?E[He]:C)=="L",Rr=Be==st?Be?"L":"R":C,$t=_e;$t<He;++$t)E[$t]=Rr;_e=He-1}for(var Qe=[],Mt,Ke=0;Ke<M;)if(u.test(E[Ke])){var Go=Ke;for(++Ke;Ke<M&&u.test(E[Ke]);++Ke);Qe.push(new v(0,Go,Ke))}else{var Rt=Ke,dr=Qe.length,hr=x=="rtl"?1:0;for(++Ke;Ke<M&&E[Ke]!="L";++Ke);for(var Ve=Rt;Ve<Ke;)if(h.test(E[Ve])){Rt<Ve&&(Qe.splice(dr,0,new v(1,Rt,Ve)),dr+=hr);var Pr=Ve;for(++Ve;Ve<Ke&&h.test(E[Ve]);++Ve);Qe.splice(dr,0,new v(2,Pr,Ve)),dr+=hr,Rt=Ve}else++Ve;Rt<Ke&&Qe.splice(dr,0,new v(1,Rt,Ke))}return x=="ltr"&&(Qe[0].level==1&&(Mt=m.match(/^\s+/))&&(Qe[0].from=Mt[0].length,Qe.unshift(new v(0,0,Mt[0].length))),me(Qe).level==1&&(Mt=m.match(/\s+$/))&&(me(Qe).to-=Mt[0].length,Qe.push(new v(0,M-Mt[0].length,M)))),x=="rtl"?Qe.reverse():Qe}}();function Bt(e,t){var i=e.order;return i==null&&(i=e.order=Hu(e.text,t)),i}var ma=[],oe=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ma).concat(i)}};function Pn(e,t){return e._handlers&&e._handlers[t]||ma}function ht(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var a=Fe(n,i);a>-1&&(r[t]=n.slice(0,a).concat(n.slice(a+1)))}}}function Ie(e,t){var i=Pn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ie(e,i||t.type,e,t),_n(t)||t.codemirrorIgnore}function ya(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)Fe(i,t[r])==-1&&i.push(t[r])}function yt(e,t){return Pn(e,t).length>0}function yr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ba(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function _n(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Yr(e){it(e),ba(e)}function Wn(e){return e.target||e.srcElement}function xa(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),R&&e.ctrlKey&&t==1&&(t=3),t}var Ru=function(){if(d&&p<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}(),qn;function Pu(e){if(qn==null){var t=L("span","\u200B");de(e,L("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(qn=t.offsetWidth<=1&&t.offsetHeight>2&&!(d&&p<8))}var i=qn?L("span","\u200B"):L("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Un;function _u(e){if(Un!=null)return Un;var t=de(e,document.createTextNode("A\u062EA")),i=W(t,0,1).getBoundingClientRect(),r=W(t,1,2).getBoundingClientRect();return ae(e),!i||i.left==i.right?!1:Un=r.right-i.right<3}var jn=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
`,t);n==-1&&(n=e.length);var a=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),u=a.indexOf("\r");u!=-1?(i.push(a.slice(0,u)),t+=u+1):(i.push(a),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Wu=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},qu=function(){var e=L("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gn=null;function Uu(e){if(Gn!=null)return Gn;var t=de(e,L("span","x")),i=t.getBoundingClientRect(),r=W(t,0,1).getBoundingClientRect();return Gn=Math.abs(i.left-r.left)>1}var Kn={},br={};function ju(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Kn[e]=t}function Gu(e,t){br[e]=t}function Ai(e){if(typeof e=="string"&&br.hasOwnProperty(e))e=br[e];else if(e&&typeof e.name=="string"&&br.hasOwnProperty(e.name)){var t=br[e.name];typeof t=="string"&&(t={name:t}),e=pa(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ai("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ai("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Xn(e,t){t=Ai(t);var i=Kn[t.name];if(!i)return Xn(e,"text/plain");var r=i(e,t);if(xr.hasOwnProperty(t.name)){var n=xr[t.name];for(var a in n)n.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=n[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var u in t.modeProps)r[u]=t.modeProps[u];return r}var xr={};function Ku(e,t){var i=xr.hasOwnProperty(e)?xr[e]:xr[e]={};dt(t,i)}function tr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Yn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Da(e,t,i){return e.startState?e.startState(t,i):!0}var ze=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};ze.prototype.eol=function(){return this.pos>=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ze.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},ze.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Re(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Re(this.string,this.lineStart,this.tabSize):0)},ze.prototype.indentation=function(){return Re(this.string,null,this.tabSize)-(this.lineStart?Re(this.string,this.lineStart,this.tabSize):0)},ze.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(u){return i?u.toLowerCase():u},n=this.string.substr(this.pos,e.length);if(r(n)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],a=n.chunkSize();if(t<a){i=n;break}t-=a}return i.lines[t]}function rr(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(a){var u=a.text;n==i.line&&(u=u.slice(0,i.ch)),n==t.line&&(u=u.slice(t.ch)),r.push(u),++n}),r}function Zn(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function Et(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function xe(e){if(e.parent==null)return null;for(var t=e.parent,i=Fe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function ir(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],a=n.height;if(t<a){e=n;continue e}t-=a,i+=n.chunkSize()}return i}while(!e.lines);for(var u=0;u<e.lines.length;++u){var h=e.lines[u],v=h.height;if(t<v)break;t-=v}return i+u}function Zr(e,t){return t>=e.first&&t<e.first+e.size}function Qn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function q(e,t,i){if(i===void 0&&(i=null),!(this instanceof q))return new q(e,t,i);this.line=e,this.ch=t,this.sticky=i}function fe(e,t){return e.line-t.line||e.ch-t.ch}function Jn(e,t){return e.sticky==t.sticky&&fe(e,t)==0}function $n(e){return q(e.line,e.ch)}function Li(e,t){return fe(e,t)<0?t:e}function Ti(e,t){return fe(e,t)<0?e:t}function wa(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ce(e,t){if(t.line<e.first)return q(e.first,0);var i=e.first+e.size-1;return t.line>i?q(i,re(e,i).text.length):Xu(t,re(e,t.line).text.length)}function Xu(e,t){var i=e.ch;return i==null||i>t?q(e.line,t):i<0?q(e.line,0):e}function Ca(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=ce(e,t[r]);return i}var Mi=function(e,t){this.state=e,this.lookAhead=t},At=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};At.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},At.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}},At.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},At.fromSaved=function(e,t,i){return t instanceof Mi?new At(e,tr(e.mode,t.state),i,t.lookAhead):new At(e,tr(e.mode,t),i)},At.prototype.save=function(e){var t=e!==!1?tr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Mi(t,this.maxLookAhead):t};function ka(e,t,i,r){var n=[e.state.modeGen],a={};Ta(e,t.text,e.doc.mode,i,function(m,x){return n.push(m,x)},a,r);for(var u=i.state,h=function(m){i.baseTokens=n;var x=e.state.overlays[m],C=1,M=0;i.state=!0,Ta(e,t.text,x.mode,i,function(E,O){for(var P=C;M<E;){var j=n[C];j>E&&n.splice(C,1,E,n[C+1],j),C+=2,M=Math.min(E,j)}if(O)if(x.opaque)n.splice(P,C-P,E,"overlay "+O),C=P+2;else for(;P<C;P+=2){var Y=n[P+1];n[P+1]=(Y?Y+" ":"")+"overlay "+O}},a),i.state=u,i.baseTokens=null,i.baseTokenPos=1},v=0;v<e.state.overlays.length;++v)h(v);return{styles:n,classes:a.bgClass||a.textClass?a:null}}function Sa(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Qr(e,xe(t)),n=t.text.length>e.options.maxHighlightLength&&tr(e.doc.mode,r.state),a=ka(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Qr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new At(r,!0,t);var a=Yu(e,t,i),u=a>r.first&&re(r,a-1).stateAfter,h=u?At.fromSaved(r,u,a):new At(r,Da(r.mode),a);return r.iter(a,t,function(v){Vn(e,v.text,h);var m=h.line;v.stateAfter=m==t-1||m%5==0||m>=n.viewFrom&&m<n.viewTo?h.save():null,h.nextLine()}),i&&(r.modeFrontier=h.line),h}function Vn(e,t,i,r){var n=e.doc.mode,a=new ze(t,e.options.tabSize,i);for(a.start=a.pos=r||0,t==""&&Fa(n,i.state);!a.eol();)eo(n,a,i.state),a.start=a.pos}function Fa(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=Yn(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function eo(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Yn(e,i).mode);var a=e.token(t,i);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ea=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Aa(e,t,i,r){var n=e.doc,a=n.mode,u;t=ce(n,t);var h=re(n,t.line),v=Qr(e,t.line,i),m=new ze(h.text,e.options.tabSize,v),x;for(r&&(x=[]);(r||m.pos<t.ch)&&!m.eol();)m.start=m.pos,u=eo(a,m,v.state),r&&x.push(new Ea(m,u,tr(n.mode,v.state)));return r?x:new Ea(m,u,v.state)}function La(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function Ta(e,t,i,r,n,a,u){var h=i.flattenSpans;h==null&&(h=e.options.flattenSpans);var v=0,m=null,x=new ze(t,e.options.tabSize,r),C,M=e.options.addModeClass&&[null];for(t==""&&La(Fa(i,r.state),a);!x.eol();){if(x.pos>e.options.maxHighlightLength?(h=!1,u&&Vn(e,t,r,x.pos),x.pos=t.length,C=null):C=La(eo(i,x,r.state,M),a),M){var E=M[0].name;E&&(C="m-"+(C?E+" "+C:E))}if(!h||m!=C){for(;v<x.start;)v=Math.min(x.start,v+5e3),n(v,m);m=C}x.start=x.pos}for(;v<x.pos;){var O=Math.min(x.pos,v+5e3);n(O,m),v=O}}function Yu(e,t,i){for(var r,n,a=e.doc,u=i?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>u;--h){if(h<=a.first)return a.first;var v=re(a,h-1),m=v.stateAfter;if(m&&(!i||h+(m instanceof Mi?m.lookAhead:0)<=a.modeFrontier))return h;var x=Re(v.text,null,e.options.tabSize);(n==null||r>x)&&(n=h-1,r=x)}return n}function Zu(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var n=re(e,r).stateAfter;if(n&&(!(n instanceof Mi)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}var Ma=!1,Nt=!1;function Qu(){Ma=!0}function Ju(){Nt=!0}function Bi(e,t,i){this.marker=e,this.from=t,this.to=i}function Jr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function $u(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function Vu(e,t,i){var r=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function ef(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var a=e[n],u=a.marker,h=a.from==null||(u.inclusiveLeft?a.from<=t:a.from<t);if(h||a.from==t&&u.type=="bookmark"&&(!i||!a.marker.insertLeft)){var v=a.to==null||(u.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new Bi(u,a.from,v?null:a.to))}}return r}function tf(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var a=e[n],u=a.marker,h=a.to==null||(u.inclusiveRight?a.to>=t:a.to>t);if(h||a.from==t&&u.type=="bookmark"&&(!i||a.marker.insertLeft)){var v=a.from==null||(u.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new Bi(u,v?null:a.from-t,a.to==null?null:a.to-t))}}return r}function to(e,t){if(t.full)return null;var i=Zr(e,t.from.line)&&re(e,t.from.line).markedSpans,r=Zr(e,t.to.line)&&re(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,a=t.to.ch,u=fe(t.from,t.to)==0,h=ef(i,n,u),v=tf(r,a,u),m=t.text.length==1,x=me(t.text).length+(m?n:0);if(h)for(var C=0;C<h.length;++C){var M=h[C];if(M.to==null){var E=Jr(v,M.marker);E?m&&(M.to=E.to==null?null:E.to+x):M.to=n}}if(v)for(var O=0;O<v.length;++O){var P=v[O];if(P.to!=null&&(P.to+=x),P.from==null){var j=Jr(h,P.marker);j||(P.from=x,m&&(h||(h=[])).push(P))}else P.from+=x,m&&(h||(h=[])).push(P)}h&&(h=Ba(h)),v&&v!=h&&(v=Ba(v));var Y=[h];if(!m){var Q=t.text.length-2,Z;if(Q>0&&h)for(var $=0;$<h.length;++$)h[$].to==null&&(Z||(Z=[])).push(new Bi(h[$].marker,null,null));for(var ne=0;ne<Q;++ne)Y.push(Z);Y.push(v)}return Y}function Ba(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function rf(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(E){if(E.markedSpans)for(var O=0;O<E.markedSpans.length;++O){var P=E.markedSpans[O].marker;P.readOnly&&(!r||Fe(r,P)==-1)&&(r||(r=[])).push(P)}}),!r)return null;for(var n=[{from:t,to:i}],a=0;a<r.length;++a)for(var u=r[a],h=u.find(0),v=0;v<n.length;++v){var m=n[v];if(!(fe(m.to,h.from)<0||fe(m.from,h.to)>0)){var x=[v,1],C=fe(m.from,h.from),M=fe(m.to,h.to);(C<0||!u.inclusiveLeft&&!C)&&x.push({from:m.from,to:h.from}),(M>0||!u.inclusiveRight&&!M)&&x.push({from:h.to,to:m.to}),n.splice.apply(n,x),v+=x.length-3}}return n}function Na(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function Ia(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function Ni(e){return e.inclusiveLeft?-1:0}function Ii(e){return e.inclusiveRight?1:0}function ro(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),a=fe(r.from,n.from)||Ni(e)-Ni(t);if(a)return-a;var u=fe(r.to,n.to)||Ii(e)-Ii(t);return u||t.id-e.id}function za(e,t){var i=Nt&&e.markedSpans,r;if(i)for(var n=void 0,a=0;a<i.length;++a)n=i[a],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||ro(r,n.marker)<0)&&(r=n.marker);return r}function Oa(e){return za(e,!0)}function zi(e){return za(e,!1)}function nf(e,t){var i=Nt&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var a=i[n];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||ro(r,a.marker)<0)&&(r=a.marker)}return r}function Ha(e,t,i,r,n){var a=re(e,t),u=Nt&&a.markedSpans;if(u)for(var h=0;h<u.length;++h){var v=u[h];if(v.marker.collapsed){var m=v.marker.find(0),x=fe(m.from,i)||Ni(v.marker)-Ni(n),C=fe(m.to,r)||Ii(v.marker)-Ii(n);if(!(x>=0&&C<=0||x<=0&&C>=0)&&(x<=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.to,i)>=0:fe(m.to,i)>0)||x>=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.from,r)<=0:fe(m.from,r)<0)))return!0}}}function Dt(e){for(var t;t=Oa(e);)e=t.find(-1,!0).line;return e}function of(e){for(var t;t=zi(e);)e=t.find(1,!0).line;return e}function af(e){for(var t,i;t=zi(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function io(e,t){var i=re(e,t),r=Dt(i);return i==r?t:xe(r)}function Ra(e,t){if(t>e.lastLine())return t;var i=re(e,t),r;if(!jt(e,i))return t;for(;r=zi(i);)i=r.find(1,!0).line;return xe(i)+1}function jt(e,t){var i=Nt&&t.markedSpans;if(i){for(var r=void 0,n=0;n<i.length;++n)if(r=i[n],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&no(e,t,r))return!0}}}function no(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return no(e,r.line,Jr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,a=0;a<t.markedSpans.length;++a)if(n=t.markedSpans[a],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&no(e,t,n))return!0}function It(e){e=Dt(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var a=i.parent;a;i=a,a=i.parent)for(var u=0;u<a.children.length;++u){var h=a.children[u];if(h==i)break;t+=h.height}return t}function Oi(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=Oa(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=zi(r);){var a=i.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function oo(e){var t=e.display,i=e.doc;t.maxLine=re(i,i.first),t.maxLineLength=Oi(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=Oi(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Dr=function(e,t,i){this.text=e,Ia(this,t),this.height=i?i(this):1};Dr.prototype.lineNo=function(){return xe(this)},yr(Dr);function lf(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Na(e),Ia(e,i);var n=r?r(e):1;n!=e.height&&Et(e,n)}function sf(e){e.parent=null,Na(e)}var uf={},ff={};function Pa(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ff:uf;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function _a(e,t){var i=U("span",null,null,y?"padding-right: .1px":null),r={pre:U("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var a=n?t.rest[n-1]:t.line,u=void 0;r.pos=0,r.addToken=df,_u(e.display.measure)&&(u=Bt(a,e.doc.direction))&&(r.addToken=pf(r.addToken,u)),r.map=[];var h=t!=e.display.externalMeasured&&xe(a);gf(a,r,Sa(e,a,h)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=mt(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=mt(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Pu(e.display.measure))),n==0?(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(y){var v=r.content.lastChild;(/\bcm-tab\b/.test(v.className)||v.querySelector&&v.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ie(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=mt(r.pre.className,r.textClass||"")),r}function cf(e){var t=L("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function df(e,t,i,r,n,a,u){if(t){var h=e.splitSpaces?hf(t,e.trailingSpace):t,v=e.cm.state.specialChars,m=!1,x;if(!v.test(t))e.col+=t.length,x=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,x),d&&p<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var C=0;;){v.lastIndex=C;var M=v.exec(t),E=M?M.index-C:t.length-C;if(E){var O=document.createTextNode(h.slice(C,C+E));d&&p<9?x.appendChild(L("span",[O])):x.appendChild(O),e.map.push(e.pos,e.pos+E,O),e.col+=E,e.pos+=E}if(!M)break;C+=E+1;var P=void 0;if(M[0]==" "){var j=e.cm.options.tabSize,Y=j-e.col%j;P=x.appendChild(L("span",qt(Y),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=Y}else M[0]=="\r"||M[0]==`
`?(P=x.appendChild(L("span",M[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),P.setAttribute("cm-text",M[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(M[0]),P.setAttribute("cm-text",M[0]),d&&p<9?x.appendChild(L("span",[P])):x.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,i||r||n||m||a||u){var Q=i||"";r&&(Q+=r),n&&(Q+=n);var Z=L("span",[x],Q,a);if(u)for(var $ in u)u.hasOwnProperty($)&&$!="style"&&$!="class"&&Z.setAttribute($,u[$]);return e.content.appendChild(Z)}e.content.appendChild(x)}}function hf(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var a=e.charAt(n);a==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(a="\xA0"),r+=a,i=a==" "}return r}function pf(e,t){return function(i,r,n,a,u,h,v){n=n?n+" cm-force-border":"cm-force-border";for(var m=i.pos,x=m+r.length;;){for(var C=void 0,M=0;M<t.length&&(C=t[M],!(C.to>m&&C.from<=m));M++);if(C.to>=x)return e(i,r,n,a,u,h,v);e(i,r.slice(0,C.to-m),n,a,null,h,v),a=null,r=r.slice(C.to-m),m=C.to}}}function Wa(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function gf(e,t,i){var r=e.markedSpans,n=e.text,a=0;if(!r){for(var u=1;u<i.length;u+=2)t.addToken(t,n.slice(a,a=i[u]),Pa(i[u+1],t.cm.options));return}for(var h=n.length,v=0,m=1,x="",C,M,E=0,O,P,j,Y,Q;;){if(E==v){O=P=j=M="",Q=null,Y=null,E=1/0;for(var Z=[],$=void 0,ne=0;ne<r.length;++ne){var ie=r[ne],pe=ie.marker;if(pe.type=="bookmark"&&ie.from==v&&pe.widgetNode)Z.push(pe);else if(ie.from<=v&&(ie.to==null||ie.to>v||pe.collapsed&&ie.to==v&&ie.from==v)){if(ie.to!=null&&ie.to!=v&&E>ie.to&&(E=ie.to,P=""),pe.className&&(O+=" "+pe.className),pe.css&&(M=(M?M+";":"")+pe.css),pe.startStyle&&ie.from==v&&(j+=" "+pe.startStyle),pe.endStyle&&ie.to==E&&($||($=[])).push(pe.endStyle,ie.to),pe.title&&((Q||(Q={})).title=pe.title),pe.attributes)for(var we in pe.attributes)(Q||(Q={}))[we]=pe.attributes[we];pe.collapsed&&(!Y||ro(Y.marker,pe)<0)&&(Y=ie)}else ie.from>v&&E>ie.from&&(E=ie.from)}if($)for(var Ge=0;Ge<$.length;Ge+=2)$[Ge+1]==E&&(P+=" "+$[Ge]);if(!Y||Y.from==v)for(var Le=0;Le<Z.length;++Le)Wa(t,0,Z[Le]);if(Y&&(Y.from||0)==v){if(Wa(t,(Y.to==null?h+1:Y.to)-v,Y.marker,Y.from==null),Y.to==null)return;Y.to==v&&(Y=!1)}}if(v>=h)break;for(var ft=Math.min(h,E);;){if(x){var at=v+x.length;if(!Y){var Oe=at>ft?x.slice(0,ft-v):x;t.addToken(t,Oe,C?C+O:O,j,v+Oe.length==E?P:"",M,Q)}if(at>=ft){x=x.slice(ft-v),v=ft;break}v=at,j=""}x=n.slice(a,a=i[m++]),C=Pa(i[m++],t.cm.options)}}}function qa(e,t,i){this.line=t,this.rest=af(t),this.size=this.rest?xe(me(this.rest))-i+1:1,this.node=this.text=null,this.hidden=jt(e,t)}function Hi(e,t,i){for(var r=[],n,a=t;a<i;a=n){var u=new qa(e.doc,re(e.doc,a),a);n=a+u.size,r.push(u)}return r}var wr=null;function vf(e){wr?wr.ops.push(e):e.ownsGroup=wr={ops:[e],delayedCallbacks:[]}}function mf(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function yf(e,t){var i=e.ownsGroup;if(i)try{mf(i)}finally{wr=null,t(i)}}var $r=null;function qe(e,t){var i=Pn(e,t);if(i.length){var r=Array.prototype.slice.call(arguments,2),n;wr?n=wr.delayedCallbacks:$r?n=$r:(n=$r=[],setTimeout(bf,0));for(var a=function(h){n.push(function(){return i[h].apply(null,r)})},u=0;u<i.length;++u)a(u)}}function bf(){var e=$r;$r=null;for(var t=0;t<e.length;++t)e[t]()}function Ua(e,t,i,r){for(var n=0;n<t.changes.length;n++){var a=t.changes[n];a=="text"?Df(e,t):a=="gutter"?Ga(e,t,i,r):a=="class"?ao(e,t):a=="widget"&&wf(e,t,r)}t.changes=null}function Vr(e){return e.node==e.text&&(e.node=L("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),d&&p<8&&(e.node.style.zIndex=2)),e.node}function xf(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=Vr(t);t.background=r.insertBefore(L("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function ja(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):_a(e,t)}function Df(e,t){var i=t.text.className,r=ja(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,ao(e,t)):i&&(t.text.className=i)}function ao(e,t){xf(e,t),t.line.wrapClass?Vr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ga(e,t,i,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 n=Vr(t);t.gutterBackground=L("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),n.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var u=Vr(t),h=t.gutter=L("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),u.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(L("div",Qn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var v=0;v<e.display.gutterSpecs.length;++v){var m=e.display.gutterSpecs[v].className,x=a.hasOwnProperty(m)&&a[m];x&&h.appendChild(L("div",[x],"CodeMirror-gutter-elt","left: "+r.gutterLeft[m]+"px; width: "+r.gutterWidth[m]+"px"))}}}function wf(e,t,i){t.alignable&&(t.alignable=null);for(var r=G("CodeMirror-linewidget"),n=t.node.firstChild,a=void 0;n;n=a)a=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);Ka(e,t,i)}function Cf(e,t,i,r){var n=ja(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),ao(e,t),Ga(e,t,i,r),Ka(e,t,r),t.node}function Ka(e,t,i){if(Xa(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)Xa(e,t.rest[r],t,i,!1)}function Xa(e,t,i,r,n){if(t.widgets)for(var a=Vr(i),u=0,h=t.widgets;u<h.length;++u){var v=h[u],m=L("div",[v.node],"CodeMirror-linewidget"+(v.className?" "+v.className:""));v.handleMouseEvents||m.setAttribute("cm-ignore-events","true"),kf(v,m,i,r),e.display.input.setUneditable(m),n&&v.above?a.insertBefore(m,i.gutter||i.text):a.appendChild(m),qe(v,"redraw")}}function kf(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ei(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!V(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),de(t.display.measure,L("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function zt(e,t){for(var i=Wn(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Ri(e){return e.lineSpace.offsetTop}function lo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ya(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=de(e.measure,L("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Lt(e){return Me-e.display.nativeBarWidth}function nr(e){return e.display.scroller.clientWidth-Lt(e)-e.display.barWidth}function so(e){return e.display.scroller.clientHeight-Lt(e)-e.display.barHeight}function Sf(e,t,i){var r=e.options.lineWrapping,n=r&&nr(e);if(!t.measure.heights||r&&t.measure.width!=n){var a=t.measure.heights=[];if(r){t.measure.width=n;for(var u=t.text.firstChild.getClientRects(),h=0;h<u.length-1;h++){var v=u[h],m=u[h+1];Math.abs(v.bottom-m.bottom)>2&&a.push((v.bottom+m.top)/2-i.top)}}a.push(i.bottom-i.top)}}function Za(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){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 n=0;n<e.rest.length;n++)if(xe(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function Ff(e,t){t=Dt(t);var i=xe(t),r=e.display.externalMeasured=new qa(e.doc,t,i);r.lineN=i;var n=r.built=_a(e,r);return r.text=n.pre,de(e.display.lineMeasure,n.pre),r}function Qa(e,t,i,r){return Tt(e,Cr(e,t),i,r)}function uo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[lr(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Cr(e,t){var i=xe(t),r=uo(e,i);r&&!r.text?r=null:r&&r.changes&&(Ua(e,r,i,go(e)),e.curOp.forceUpdate=!0),r||(r=Ff(e,t));var n=Za(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Tt(e,t,i,r,n){t.before&&(i=-1);var a=i+(r||""),u;return t.cache.hasOwnProperty(a)?u=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Sf(e,t.view,t.rect),t.hasHeights=!0),u=Af(e,t,i,r),u.bogus||(t.cache[a]=u)),{left:u.left,right:u.right,top:n?u.rtop:u.top,bottom:n?u.rbottom:u.bottom}}var Ja={left:0,right:0,top:0,bottom:0};function $a(e,t,i){for(var r,n,a,u,h,v,m=0;m<e.length;m+=3)if(h=e[m],v=e[m+1],t<h?(n=0,a=1,u="left"):t<v?(n=t-h,a=n+1):(m==e.length-3||t==v&&e[m+3]>t)&&(a=v-h,n=a-1,t>=v&&(u="right")),n!=null){if(r=e[m+2],h==v&&i==(r.insertLeft?"left":"right")&&(u=i),i=="left"&&n==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],u="left";if(i=="right"&&n==v-h)for(;m<e.length-3&&e[m+3]==e[m+4]&&!e[m+5].insertLeft;)r=e[(m+=3)+2],u="right";break}return{node:r,start:n,end:a,collapse:u,coverStart:h,coverEnd:v}}function Ef(e,t){var i=Ja;if(t=="left")for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;n>=0&&(i=e[n]).left==i.right;n--);return i}function Af(e,t,i,r){var n=$a(t.map,i,r),a=n.node,u=n.start,h=n.end,v=n.collapse,m;if(a.nodeType==3){for(var x=0;x<4;x++){for(;u&&Rn(t.line.text.charAt(n.coverStart+u));)--u;for(;n.coverStart+h<n.coverEnd&&Rn(t.line.text.charAt(n.coverStart+h));)++h;if(d&&p<9&&u==0&&h==n.coverEnd-n.coverStart?m=a.parentNode.getBoundingClientRect():m=Ef(W(a,u,h).getClientRects(),r),m.left||m.right||u==0)break;h=u,u=u-1,v="right"}d&&p<11&&(m=Lf(e.display.measure,m))}else{u>0&&(v=r="right");var C;e.options.lineWrapping&&(C=a.getClientRects()).length>1?m=C[r=="right"?C.length-1:0]:m=a.getBoundingClientRect()}if(d&&p<9&&!u&&(!m||!m.left&&!m.right)){var M=a.parentNode.getClientRects()[0];M?m={left:M.left,right:M.left+Sr(e.display),top:M.top,bottom:M.bottom}:m=Ja}for(var E=m.top-t.rect.top,O=m.bottom-t.rect.top,P=(E+O)/2,j=t.view.measure.heights,Y=0;Y<j.length-1&&!(P<j[Y]);Y++);var Q=Y?j[Y-1]:0,Z=j[Y],$={left:(v=="right"?m.right:m.left)-t.rect.left,right:(v=="left"?m.left:m.right)-t.rect.left,top:Q,bottom:Z};return!m.left&&!m.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=E,$.rbottom=O),$}function Lf(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Uu(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function Va(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 el(e){e.display.externalMeasure=null,ae(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Va(e.display.view[t])}function ti(e){el(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function tl(e){return D&&B?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function rl(e){return D&&B?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function fo(e){var t=Dt(e),i=t.widgets,r=0;if(i)for(var n=0;n<i.length;++n)i[n].above&&(r+=ei(i[n]));return r}function Pi(e,t,i,r,n){if(!n){var a=fo(t);i.top+=a,i.bottom+=a}if(r=="line")return i;r||(r="local");var u=It(t);if(r=="local"?u+=Ri(e.display):u-=e.display.viewOffset,r=="page"||r=="window"){var h=e.display.lineSpace.getBoundingClientRect();u+=h.top+(r=="window"?0:rl(b(e)));var v=h.left+(r=="window"?0:tl(b(e)));i.left+=v,i.right+=v}return i.top+=u,i.bottom+=u,i}function il(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=tl(b(e)),n-=rl(b(e));else if(i=="local"||!i){var a=e.display.sizer.getBoundingClientRect();r+=a.left,n+=a.top}var u=e.display.lineSpace.getBoundingClientRect();return{left:r-u.left,top:n-u.top}}function _i(e,t,i,r,n){return r||(r=re(e.doc,t.line)),Pi(e,r,Qa(e,r,t.ch,n),i)}function wt(e,t,i,r,n,a){r=r||re(e.doc,t.line),n||(n=Cr(e,r));function u(O,P){var j=Tt(e,n,O,P?"right":"left",a);return P?j.left=j.right:j.right=j.left,Pi(e,r,j,i)}var h=Bt(r,e.doc.direction),v=t.ch,m=t.sticky;if(v>=r.text.length?(v=r.text.length,m="before"):v<=0&&(v=0,m="after"),!h)return u(m=="before"?v-1:v,m=="before");function x(O,P,j){var Y=h[P],Q=Y.level==1;return u(j?O-1:O,Q!=j)}var C=Xr(h,v,m),M=Kr,E=x(v,C,m=="before");return M!=null&&(E.other=x(v,M,m!="before")),E}function nl(e,t){var i=0;t=ce(e.doc,t),e.options.lineWrapping||(i=Sr(e.display)*t.ch);var r=re(e.doc,t.line),n=It(r)+Ri(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function co(e,t,i,r,n){var a=q(e,t,i);return a.xRel=n,r&&(a.outside=r),a}function ho(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return co(r.first,0,null,-1,-1);var n=ir(r,i),a=r.first+r.size-1;if(n>a)return co(r.first+r.size-1,re(r,a).text.length,null,1,1);t<0&&(t=0);for(var u=re(r,n);;){var h=Tf(e,u,n,t,i),v=nf(u,h.ch+(h.xRel>0||h.outside>0?1:0));if(!v)return h;var m=v.find(1);if(m.line==n)return m;u=re(r,n=m.line)}}function ol(e,t,i,r){r-=fo(t);var n=t.text.length,a=Gr(function(u){return Tt(e,i,u-1).bottom<=r},n,0);return n=Gr(function(u){return Tt(e,i,u).top>r},a,n),{begin:a,end:n}}function al(e,t,i,r){i||(i=Cr(e,t));var n=Pi(e,t,Tt(e,i,r),"line").top;return ol(e,t,i,n)}function po(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Tf(e,t,i,r,n){n-=It(t);var a=Cr(e,t),u=fo(t),h=0,v=t.text.length,m=!0,x=Bt(t,e.doc.direction);if(x){var C=(e.options.lineWrapping?Bf:Mf)(e,t,i,a,x,r,n);m=C.level!=1,h=m?C.from:C.to-1,v=m?C.to:C.from-1}var M=null,E=null,O=Gr(function(ne){var ie=Tt(e,a,ne);return ie.top+=u,ie.bottom+=u,po(ie,r,n,!1)?(ie.top<=n&&ie.left<=r&&(M=ne,E=ie),!0):!1},h,v),P,j,Y=!1;if(E){var Q=r-E.left<E.right-r,Z=Q==m;O=M+(Z?0:1),j=Z?"after":"before",P=Q?E.left:E.right}else{!m&&(O==v||O==h)&&O++,j=O==0?"after":O==t.text.length?"before":Tt(e,a,O-(m?1:0)).bottom+u<=n==m?"after":"before";var $=wt(e,q(i,O,j),"line",t,a);P=$.left,Y=n<$.top?-1:n>=$.bottom?1:0}return O=va(t.text,O,1),co(i,O,j,Y,r-P)}function Mf(e,t,i,r,n,a,u){var h=Gr(function(C){var M=n[C],E=M.level!=1;return po(wt(e,q(i,E?M.to:M.from,E?"before":"after"),"line",t,r),a,u,!0)},0,n.length-1),v=n[h];if(h>0){var m=v.level!=1,x=wt(e,q(i,m?v.from:v.to,m?"after":"before"),"line",t,r);po(x,a,u,!0)&&x.top>u&&(v=n[h-1])}return v}function Bf(e,t,i,r,n,a,u){var h=ol(e,t,r,u),v=h.begin,m=h.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,C=null,M=0;M<n.length;M++){var E=n[M];if(!(E.from>=m||E.to<=v)){var O=E.level!=1,P=Tt(e,r,O?Math.min(m,E.to)-1:Math.max(v,E.from)).right,j=P<a?a-P+1e9:P-a;(!x||C>j)&&(x=E,C=j)}}return x||(x=n[n.length-1]),x.from<v&&(x={from:v,to:x.to,level:x.level}),x.to>m&&(x={from:x.from,to:m,level:x.level}),x}var or;function kr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(or==null){or=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)or.appendChild(document.createTextNode("x")),or.appendChild(L("br"));or.appendChild(document.createTextNode("x"))}de(e.measure,or);var i=or.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ae(e.measure),i||1}function Sr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),i=L("pre",[t],"CodeMirror-line-like");de(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function go(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,a=t.gutters.firstChild,u=0;a;a=a.nextSibling,++u){var h=e.display.gutterSpecs[u].className;i[h]=a.offsetLeft+a.clientLeft+n,r[h]=a.clientWidth}return{fixedPos:vo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function vo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ll(e){var t=kr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Sr(e.display)-3);return function(n){if(jt(e.doc,n))return 0;var a=0;if(n.widgets)for(var u=0;u<n.widgets.length;u++)n.widgets[u].height&&(a+=n.widgets[u].height);return i?a+(Math.ceil(n.text.length/r)||1)*t:a+t}}function mo(e){var t=e.doc,i=ll(e);t.iter(function(r){var n=i(r);n!=r.height&&Et(r,n)})}function ar(e,t,i,r){var n=e.display;if(!i&&Wn(t).getAttribute("cm-not-content")=="true")return null;var a,u,h=n.lineSpace.getBoundingClientRect();try{a=t.clientX-h.left,u=t.clientY-h.top}catch{return null}var v=ho(e,a,u),m;if(r&&v.xRel>0&&(m=re(e.doc,v.line).text).length==v.ch){var x=Re(m,m.length,e.options.tabSize)-m.length;v=q(v.line,Math.max(0,Math.round((a-Ya(e.display).left)/Sr(e.display))-x))}return v}function lr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function nt(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Nt&&io(e.doc,t)<n.viewTo&&Kt(e);else if(i<=n.viewFrom)Nt&&Ra(e.doc,i+r)>n.viewFrom?Kt(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Kt(e);else if(t<=n.viewFrom){var a=Wi(e,i,i+r,1);a?(n.view=n.view.slice(a.index),n.viewFrom=a.lineN,n.viewTo+=r):Kt(e)}else if(i>=n.viewTo){var u=Wi(e,t,t,-1);u?(n.view=n.view.slice(0,u.index),n.viewTo=u.lineN):Kt(e)}else{var h=Wi(e,t,t,-1),v=Wi(e,i,i+r,1);h&&v?(n.view=n.view.slice(0,h.index).concat(Hi(e,h.lineN,v.lineN)).concat(n.view.slice(v.index)),n.viewTo+=r):Kt(e)}var m=n.externalMeasured;m&&(i<m.lineN?m.lineN+=r:t<m.lineN+m.size&&(n.externalMeasured=null))}function Gt(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[lr(e,t)];if(a.node!=null){var u=a.changes||(a.changes=[]);Fe(u,i)==-1&&u.push(i)}}}function Kt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wi(e,t,i,r){var n=lr(e,t),a,u=e.display.view;if(!Nt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var h=e.display.viewFrom,v=0;v<n;v++)h+=u[v].size;if(h!=t){if(r>0){if(n==u.length-1)return null;a=h+u[n].size-t,n++}else a=h-t;t+=a,i+=a}for(;io(e.doc,i)!=i;){if(n==(r<0?0:u.length-1))return null;i+=r*u[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Nf(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Hi(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Hi(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(lr(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Hi(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,lr(e,i)))),r.viewTo=i}function sl(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function ri(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ul(e,t){t===void 0&&(t=!0);var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),u=e.options.$customCursor;u&&(t=!0);for(var h=0;h<i.sel.ranges.length;h++)if(!(!t&&h==i.sel.primIndex)){var v=i.sel.ranges[h];if(!(v.from().line>=e.display.viewTo||v.to().line<e.display.viewFrom)){var m=v.empty();if(u){var x=u(e,v);x&&yo(e,x,n)}else(m||e.options.showCursorWhenSelecting)&&yo(e,v.head,n);m||If(e,v,a)}}return r}function yo(e,t,i){var r=wt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(L("div","\xA0","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=_i(e,t,"div",null,null),u=a.right-a.left;n.style.width=(u>0?u:e.defaultCharWidth())+"px"}if(r.other){var h=i.appendChild(L("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=r.other.left+"px",h.style.top=r.other.top+"px",h.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function qi(e,t){return e.top-t.top||e.left-t.left}function If(e,t,i){var r=e.display,n=e.doc,a=document.createDocumentFragment(),u=Ya(e.display),h=u.left,v=Math.max(r.sizerWidth,nr(e)-r.sizer.offsetLeft)-u.right,m=n.direction=="ltr";function x(Z,$,ne,ie){$<0&&($=0),$=Math.round($),ie=Math.round(ie),a.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+Z+`px;
top: `+$+"px; width: "+(ne??v-Z)+`px;
height: `+(ie-$)+"px"))}function C(Z,$,ne){var ie=re(n,Z),pe=ie.text.length,we,Ge;function Le(Oe,lt){return _i(e,q(Z,Oe),"div",ie,lt)}function ft(Oe,lt,Xe){var _e=al(e,ie,null,Oe),He=lt=="ltr"==(Xe=="after")?"left":"right",Be=Xe=="after"?_e.begin:_e.end-(/\s/.test(ie.text.charAt(_e.end-1))?2:1);return Le(Be,He)[He]}var at=Bt(ie,n.direction);return Ou(at,$||0,ne??pe,function(Oe,lt,Xe,_e){var He=Xe=="ltr",Be=Le(Oe,He?"left":"right"),st=Le(lt-1,He?"right":"left"),Rr=$==null&&Oe==0,$t=ne==null&&lt==pe,Qe=_e==0,Mt=!at||_e==at.length-1;if(st.top-Be.top<=3){var Ke=(m?Rr:$t)&&Qe,Go=(m?$t:Rr)&&Mt,Rt=Ke?h:(He?Be:st).left,dr=Go?v:(He?st:Be).right;x(Rt,Be.top,dr-Rt,Be.bottom)}else{var hr,Ve,Pr,Ko;He?(hr=m&&Rr&&Qe?h:Be.left,Ve=m?v:ft(Oe,Xe,"before"),Pr=m?h:ft(lt,Xe,"after"),Ko=m&&$t&&Mt?v:st.right):(hr=m?ft(Oe,Xe,"before"):h,Ve=!m&&Rr&&Qe?v:Be.right,Pr=!m&&$t&&Mt?h:st.left,Ko=m?ft(lt,Xe,"after"):v),x(hr,Be.top,Ve-hr,Be.bottom),Be.bottom<st.top&&x(h,Be.bottom,null,st.top),x(Pr,st.top,Ko-Pr,st.bottom)}(!we||qi(Be,we)<0)&&(we=Be),qi(st,we)<0&&(we=st),(!Ge||qi(Be,Ge)<0)&&(Ge=Be),qi(st,Ge)<0&&(Ge=st)}),{start:we,end:Ge}}var M=t.from(),E=t.to();if(M.line==E.line)C(M.line,M.ch,E.ch);else{var O=re(n,M.line),P=re(n,E.line),j=Dt(O)==Dt(P),Y=C(M.line,M.ch,j?O.text.length+1:null).end,Q=C(E.line,j?0:null,E.ch).start;j&&(Y.top<Q.top-2?(x(Y.right,Y.top,null,Y.bottom),x(h,Q.top,Q.left,Q.bottom)):x(Y.right,Y.top,Q.left-Y.right,Y.bottom)),Y.bottom<Q.top&&x(h,Y.bottom,null,Q.top)}i.appendChild(a)}function bo(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Fr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function fl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Do(e))}function xo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Fr(e))},100)}function Do(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ie(e,"focus",e,t),e.state.focused=!0,Te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bo(e))}function Fr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ie(e,"blur",e,t),e.state.focused=!1,ue(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ui(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,a=0,u=0;u<t.view.length;u++){var h=t.view[u],v=e.options.lineWrapping,m=void 0,x=0;if(!h.hidden){if(n+=h.line.height,d&&p<8){var C=h.node.offsetTop+h.node.offsetHeight;m=C-i,i=C}else{var M=h.node.getBoundingClientRect();m=M.bottom-M.top,!v&&h.text.firstChild&&(x=h.text.firstChild.getBoundingClientRect().right-M.left-1)}var E=h.line.height-m;if((E>.005||E<-.005)&&(n<r&&(a-=E),Et(h.line,m),cl(h.line),h.rest))for(var O=0;O<h.rest.length;O++)cl(h.rest[O]);if(x>e.display.sizerWidth){var P=Math.ceil(x/Sr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function cl(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function ji(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Ri(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,a=ir(t,r),u=ir(t,n);if(i&&i.ensure){var h=i.ensure.from.line,v=i.ensure.to.line;h<a?(a=h,u=ir(t,It(re(t,h))+e.wrapper.clientHeight)):Math.min(v,t.lastLine())>=u&&(a=ir(t,It(re(t,v))-e.wrapper.clientHeight),u=v)}return{from:a,to:Math.max(u,a+1)}}function zf(e,t){if(!We(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,a=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(n=!1),n!=null&&!N){var u=L("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Ri(e.display))+`px;
height: `+(t.bottom-t.top+Lt(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(u),u.scrollIntoView(n),e.display.lineSpace.removeChild(u)}}}function Of(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?q(t.line,t.ch+1,"before"):t,t=t.ch?q(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var u=!1,h=wt(e,t),v=!i||i==t?h:wt(e,i);n={left:Math.min(h.left,v.left),top:Math.min(h.top,v.top)-r,right:Math.max(h.left,v.left),bottom:Math.max(h.bottom,v.bottom)+r};var m=wo(e,n),x=e.doc.scrollTop,C=e.doc.scrollLeft;if(m.scrollTop!=null&&(ni(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(u=!0)),m.scrollLeft!=null&&(sr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(u=!0)),!u)break}return n}function Hf(e,t){var i=wo(e,t);i.scrollTop!=null&&ni(e,i.scrollTop),i.scrollLeft!=null&&sr(e,i.scrollLeft)}function wo(e,t){var i=e.display,r=kr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,a=so(e),u={};t.bottom-t.top>a&&(t.bottom=t.top+a);var h=e.doc.height+lo(i),v=t.top<r,m=t.bottom>h-r;if(t.top<n)u.scrollTop=v?0:t.top;else if(t.bottom>n+a){var x=Math.min(t.top,(m?h:t.bottom)-a);x!=n&&(u.scrollTop=x)}var C=e.options.fixedGutter?0:i.gutters.offsetWidth,M=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-C,E=nr(e)-i.gutters.offsetWidth,O=t.right-t.left>E;return O&&(t.right=t.left+E),t.left<10?u.scrollLeft=0:t.left<M?u.scrollLeft=Math.max(0,t.left+C-(O?0:10)):t.right>E+M-3&&(u.scrollLeft=t.right+(O?0:10)-E),u}function Co(e,t){t!=null&&(Gi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){Gi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ii(e,t,i){(t!=null||i!=null)&&Gi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Rf(e,t){Gi(e),e.curOp.scrollToPos=t}function Gi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=nl(e,t.from),r=nl(e,t.to);dl(e,i,r,t.margin)}}function dl(e,t,i,r){var n=wo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ii(e,n.scrollLeft,n.scrollTop)}function ni(e,t){Math.abs(e.doc.scrollTop-t)<2||(c||So(e,{top:t}),hl(e,t,!0),c&&So(e),li(e,100))}function hl(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function sr(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,yl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function oi(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+lo(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?i:0,docHeight:r,scrollHeight:r+Lt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var ur=function(e,t,i){this.cm=i;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,d&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ur.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(i?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&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},ur.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ur.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ur.prototype.zeroWidthHack=function(){var e=R&&!z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Je,this.disableVert=new Je},ur.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),a=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);a!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},ur.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ai=function(){};ai.prototype.update=function(){return{bottom:0,right:0}},ai.prototype.setScrollLeft=function(){},ai.prototype.setScrollTop=function(){},ai.prototype.clear=function(){};function Ar(e,t){t||(t=oi(e));var i=e.display.barWidth,r=e.display.barHeight;pl(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Ui(e),pl(e,oi(e)),i=e.display.barWidth,r=e.display.barHeight}function pl(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var gl={native:ur,null:ai};function vl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ue(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new gl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?sr(e,t):ni(e,t)},e),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)}var Pf=0;function fr(e){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:++Pf,markArrays:null},vf(e.curOp)}function cr(e){var t=e.curOp;t&&yf(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;_f(i)})}function _f(e){for(var t=e.ops,i=0;i<t.length;i++)Wf(t[i]);for(var r=0;r<t.length;r++)qf(t[r]);for(var n=0;n<t.length;n++)Uf(t[n]);for(var a=0;a<t.length;a++)jf(t[a]);for(var u=0;u<t.length;u++)Gf(t[u])}function Wf(e){var t=e.cm,i=t.display;Xf(t),e.updateMaxLine&&oo(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ki(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qf(e){e.updatedDisplay=e.mustUpdate&&ko(e.cm,e.update)}function Uf(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ui(t),e.barMeasure=oi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Lt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function jf(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&sr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==ve(ee(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ar(t,e.barMeasure),e.updatedDisplay&&Eo(t,e.barMeasure),e.selectionChanged&&bo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&fl(e.cm)}function Gf(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&ml(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&hl(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&sr(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Of(t,ce(r,e.scrollToPos.from),ce(r,e.scrollToPos.to),e.scrollToPos.margin);zf(t,n)}var a=e.maybeHiddenMarkers,u=e.maybeUnhiddenMarkers;if(a)for(var h=0;h<a.length;++h)a[h].lines.length||Ie(a[h],"hide");if(u)for(var v=0;v<u.length;++v)u[v].lines.length&&Ie(u[v],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ie(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ut(e,t){if(e.curOp)return t();fr(e);try{return t()}finally{cr(e)}}function Ue(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fr(e);try{return t.apply(e,arguments)}finally{cr(e)}}}function $e(e){return function(){if(this.curOp)return e.apply(this,arguments);fr(this);try{return e.apply(this,arguments)}finally{cr(this)}}}function je(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fr(t);try{return e.apply(this,arguments)}finally{cr(t)}}}function li(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,tt(Kf,e))}function Kf(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Qr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var u=a.styles,h=a.text.length>e.options.maxHighlightLength?tr(t.mode,r.state):null,v=ka(e,a,r,!0);h&&(r.state=h),a.styles=v.styles;var m=a.styleClasses,x=v.classes;x?a.styleClasses=x:m&&(a.styleClasses=null);for(var C=!u||u.length!=a.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),M=0;!C&&M<u.length;++M)C=u[M]!=a.styles[M];C&&n.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Vn(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return li(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ut(e,function(){for(var a=0;a<n.length;a++)Gt(e,n[a],"text")})}}var Ki=function(e,t,i){var r=e.display;this.viewport=t,this.visible=ji(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=nr(e),this.force=i,this.dims=go(e),this.events=[]};Ki.prototype.signal=function(e,t){yt(e,t)&&this.events.push(arguments)},Ki.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ie.apply(null,this.events[e])};function Xf(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Lt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Lt(e)+"px",t.scrollbarsClipped=!0)}function Yf(e){if(e.hasFocus())return null;var t=ve(ee(e));if(!t||!V(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=he(e).getSelection();r.anchorNode&&r.extend&&V(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function Zf(e){if(!(!e||!e.activeElt||e.activeElt==ve(ye(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&V(document.body,e.anchorNode)&&V(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function ko(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Kt(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&sl(e)==0)return!1;bl(e)&&(Kt(e),t.dims=go(e));var n=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),u=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<a&&a-i.viewFrom<20&&(a=Math.max(r.first,i.viewFrom)),i.viewTo>u&&i.viewTo-u<20&&(u=Math.min(n,i.viewTo)),Nt&&(a=io(e.doc,a),u=Ra(e.doc,u));var h=a!=i.viewFrom||u!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Nf(e,a,u),i.viewOffset=It(re(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var v=sl(e);if(!h&&v==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var m=Yf(e);return v>4&&(i.lineDiv.style.display="none"),Qf(e,i.updateLineNumbers,t.dims),v>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Zf(m),ae(i.cursorDiv),ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,li(e,400)),i.updateLineNumbers=null,!0}function ml(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==nr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+lo(e.display)-so(e),i.top)}),t.visible=ji(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ji(e.display,e.doc,i));if(!ko(e,t))break;Ui(e);var n=oi(e);ri(e),Ar(e,n),Eo(e,n),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 So(e,t){var i=new Ki(e,t);if(ko(e,i)){Ui(e),ml(e,i);var r=oi(e);ri(e),Ar(e,r),Eo(e,r),i.finish()}}function Qf(e,t,i){var r=e.display,n=e.options.lineNumbers,a=r.lineDiv,u=a.firstChild;function h(O){var P=O.nextSibling;return y&&R&&e.display.currentWheelTarget==O?O.style.display="none":O.parentNode.removeChild(O),P}for(var v=r.view,m=r.viewFrom,x=0;x<v.length;x++){var C=v[x];if(!C.hidden)if(!C.node||C.node.parentNode!=a){var M=Cf(e,C,m,i);a.insertBefore(M,u)}else{for(;u!=C.node;)u=h(u);var E=n&&t!=null&&t<=m&&C.lineNumber;C.changes&&(Fe(C.changes,"gutter")>-1&&(E=!1),Ua(e,C,m,i)),E&&(ae(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(Qn(e.options,m)))),u=C.node.nextSibling}m+=C.size}for(;u;)u=h(u)}function Fo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function Eo(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+Lt(e)+"px"}function yl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=vo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,a=r+"px",u=0;u<i.length;u++)if(!i[u].hidden){e.options.fixedGutter&&(i[u].gutter&&(i[u].gutter.style.left=a),i[u].gutterBackground&&(i[u].gutterBackground.style.left=a));var h=i[u].alignable;if(h)for(var v=0;v<h.length;v++)h[v].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function bl(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Qn(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(L("div",[L("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=n.firstChild.offsetWidth,u=n.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-u)+1,r.lineNumWidth=r.lineNumInnerWidth+u,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Fo(e.display),!0}return!1}function Ao(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var a=e[n],u=null;if(typeof a!="string"&&(u=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:a,style:u})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function xl(e){var t=e.gutters,i=e.gutterSpecs;ae(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],a=n.className,u=n.style,h=t.appendChild(L("div",null,"CodeMirror-gutter "+a));u&&(h.style.cssText=u),a=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Fo(e)}function si(e){xl(e.display),nt(e),yl(e)}function Jf(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=U("div",null,"CodeMirror-code"),n.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=L("div",null,"CodeMirror-cursors"),n.measure=L("div",null,"CodeMirror-measure"),n.lineMeasure=L("div",null,"CodeMirror-measure"),n.lineSpace=U("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var a=U("div",[n.lineSpace],"CodeMirror-lines");n.mover=L("div",[a],null,"position: relative"),n.sizer=L("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=L("div",null,null,"position: absolute; height: "+Me+"px; width: 1px;"),n.gutters=L("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=L("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=L("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),D&&S===105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),d&&p<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!y&&!(c&&I)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=Ao(r.gutters,r.lineNumbers),xl(n),i.init(n)}var Xi=0,Ot=null;d?Ot=-.53:c?Ot=15:D?Ot=-.7:T&&(Ot=-1/3);function Dl(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function $f(e){var t=Dl(e);return t.x*=Ot,t.y*=Ot,t}function wl(e,t){D&&S==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=Dl(t),r=i.x,n=i.y,a=Ot;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,a=1);var u=e.display,h=u.scroller,v=h.scrollWidth>h.clientWidth,m=h.scrollHeight>h.clientHeight;if(r&&v||n&&m){if(n&&R&&y){e:for(var x=t.target,C=u.view;x!=h;x=x.parentNode)for(var M=0;M<C.length;M++)if(C[M].node==x){e.display.currentWheelTarget=x;break e}}if(r&&!c&&!F&&a!=null){n&&m&&ni(e,Math.max(0,h.scrollTop+n*a)),sr(e,Math.max(0,h.scrollLeft+r*a)),(!n||n&&m)&&it(t),u.wheelStartX=null;return}if(n&&a!=null){var E=n*a,O=e.doc.scrollTop,P=O+u.wrapper.clientHeight;E<0?O=Math.max(0,O+E-50):P=Math.min(e.doc.height,P+E+50),So(e,{top:O,bottom:P})}Xi<20&&t.deltaMode!==0&&(u.wheelStartX==null?(u.wheelStartX=h.scrollLeft,u.wheelStartY=h.scrollTop,u.wheelDX=r,u.wheelDY=n,setTimeout(function(){if(u.wheelStartX!=null){var j=h.scrollLeft-u.wheelStartX,Y=h.scrollTop-u.wheelStartY,Q=Y&&u.wheelDY&&Y/u.wheelDY||j&&u.wheelDX&&j/u.wheelDX;u.wheelStartX=u.wheelStartY=null,Q&&(Ot=(Ot*Xi+Q)/(Xi+1),++Xi)}},200)):(u.wheelDX+=r,u.wheelDY+=n))}}var pt=function(e,t){this.ranges=e,this.primIndex=t};pt.prototype.primary=function(){return this.ranges[this.primIndex]},pt.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 i=this.ranges[t],r=e.ranges[t];if(!Jn(i.anchor,r.anchor)||!Jn(i.head,r.head))return!1}return!0},pt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new be($n(this.ranges[t].anchor),$n(this.ranges[t].head));return new pt(e,this.primIndex)},pt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},pt.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(fe(t,r.from())>=0&&fe(e,r.to())<=0)return i}return-1};var be=function(e,t){this.anchor=e,this.head=t};be.prototype.from=function(){return Ti(this.anchor,this.head)},be.prototype.to=function(){return Li(this.anchor,this.head)},be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ct(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(M,E){return fe(M.from(),E.from())}),i=Fe(t,n);for(var a=1;a<t.length;a++){var u=t[a],h=t[a-1],v=fe(h.to(),u.from());if(r&&!u.empty()?v>0:v>=0){var m=Ti(h.from(),u.from()),x=Li(h.to(),u.to()),C=h.empty()?u.from()==u.head:h.from()==h.head;a<=i&&--i,t.splice(--a,2,new be(C?x:m,C?m:x))}}return new pt(t,i)}function Xt(e,t){return new pt([new be(e,t||e)],0)}function Yt(e){return e.text?q(e.from.line+e.text.length-1,me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Cl(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return Yt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Yt(t).ch-t.to.ch),q(i,r)}function Lo(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new be(Cl(n.anchor,t),Cl(n.head,t)))}return Ct(e.cm,i,e.sel.primIndex)}function kl(e,t,i){return e.line==t.line?q(i.line,e.ch-t.ch+i.ch):q(i.line+(e.line-t.line),e.ch)}function Vf(e,t,i){for(var r=[],n=q(e.first,0),a=n,u=0;u<t.length;u++){var h=t[u],v=kl(h.from,n,a),m=kl(Yt(h),n,a);if(n=h.to,a=m,i=="around"){var x=e.sel.ranges[u],C=fe(x.head,x.anchor)<0;r[u]=new be(C?m:v,C?v:m)}else r[u]=new be(v,v)}return new pt(r,e.sel.primIndex)}function To(e){e.doc.mode=Xn(e.options,e.doc.modeOption),ui(e)}function ui(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,li(e,100),e.state.modeGen++,e.curOp&&nt(e)}function Sl(e,t){return t.from.ch==0&&t.to.ch==0&&me(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mo(e,t,i,r){function n(Q){return i?i[Q]:null}function a(Q,Z,$){lf(Q,Z,$,r),qe(Q,"change",Q,t)}function u(Q,Z){for(var $=[],ne=Q;ne<Z;++ne)$.push(new Dr(m[ne],n(ne),r));return $}var h=t.from,v=t.to,m=t.text,x=re(e,h.line),C=re(e,v.line),M=me(m),E=n(m.length-1),O=v.line-h.line;if(t.full)e.insert(0,u(0,m.length)),e.remove(m.length,e.size-m.length);else if(Sl(e,t)){var P=u(0,m.length-1);a(C,C.text,E),O&&e.remove(h.line,O),P.length&&e.insert(h.line,P)}else if(x==C)if(m.length==1)a(x,x.text.slice(0,h.ch)+M+x.text.slice(v.ch),E);else{var j=u(1,m.length-1);j.push(new Dr(M+x.text.slice(v.ch),E,r)),a(x,x.text.slice(0,h.ch)+m[0],n(0)),e.insert(h.line+1,j)}else if(m.length==1)a(x,x.text.slice(0,h.ch)+m[0]+C.text.slice(v.ch),n(0)),e.remove(h.line+1,O);else{a(x,x.text.slice(0,h.ch)+m[0],n(0)),a(C,M+C.text.slice(v.ch),E);var Y=u(1,m.length-1);O>1&&e.remove(h.line+1,O-1),e.insert(h.line+1,Y)}qe(e,"change",e,t)}function Zt(e,t,i){function r(n,a,u){if(n.linked)for(var h=0;h<n.linked.length;++h){var v=n.linked[h];if(v.doc!=a){var m=u&&v.sharedHist;i&&!m||(t(v.doc,m),r(v.doc,n,m))}}}r(e,null,!0)}function Fl(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,mo(e),To(e),El(e),e.options.direction=t.direction,e.options.lineWrapping||oo(e),e.options.mode=t.modeOption,nt(e)}function El(e){(e.doc.direction=="rtl"?Te:ue)(e.display.lineDiv,"CodeMirror-rtl")}function ec(e){ut(e,function(){El(e),nt(e)})}function Yi(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Bo(e,t){var i={from:$n(t.from),to:Yt(t),text:rr(e,t.from,t.to)};return Tl(e,i,t.from.line,t.to.line+1),Zt(e,function(r){return Tl(r,i,t.from.line,t.to.line+1)},!0),i}function Al(e){for(;e.length;){var t=me(e);if(t.ranges)e.pop();else break}}function tc(e,t){if(t)return Al(e.done),me(e.done);if(e.done.length&&!me(e.done).ranges)return me(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(e.done)}function Ll(e,t,i,r){var n=e.history;n.undone.length=0;var a=+new Date,u,h;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(u=tc(n,n.lastOp==r)))h=me(u.changes),fe(t.from,t.to)==0&&fe(t.from,h.to)==0?h.to=Yt(t):u.changes.push(Bo(e,t));else{var v=me(n.done);for((!v||!v.ranges)&&Zi(e.sel,n.done),u={changes:[Bo(e,t)],generation:n.generation},n.done.push(u);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=a,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,h||Ie(e,"historyAdded")}function rc(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ic(e,t,i,r){var n=e.history,a=r&&r.origin;i==n.lastSelOp||a&&n.lastSelOrigin==a&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==a||rc(e,a,me(n.done),t))?n.done[n.done.length-1]=t:Zi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=a,n.lastSelOp=i,r&&r.clearRedo!==!1&&Al(n.undone)}function Zi(e,t){var i=me(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Tl(e,t,i,r){var n=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(u){u.markedSpans&&((n||(n=t["spans_"+e.id]={}))[a]=u.markedSpans),++a})}function nc(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function oc(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(nc(i[n]));return r}function Ml(e,t){var i=oc(e,t),r=to(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var a=i[n],u=r[n];if(a&&u)e:for(var h=0;h<u.length;++h){for(var v=u[h],m=0;m<a.length;++m)if(a[m].marker==v.marker)continue e;a.push(v)}else u&&(i[n]=u)}return i}function Lr(e,t,i){for(var r=[],n=0;n<e.length;++n){var a=e[n];if(a.ranges){r.push(i?pt.prototype.deepCopy.call(a):a);continue}var u=a.changes,h=[];r.push({changes:h});for(var v=0;v<u.length;++v){var m=u[v],x=void 0;if(h.push({from:m.from,to:m.to,text:m.text}),t)for(var C in m)(x=C.match(/^spans_(\d+)$/))&&Fe(t,Number(x[1]))>-1&&(me(h)[C]=m[C],delete m[C])}}return r}function No(e,t,i,r){if(r){var n=e.anchor;if(i){var a=fe(t,n)<0;a!=fe(i,n)<0?(n=t,t=i):a!=fe(t,i)<0&&(t=i)}return new be(n,t)}else return new be(i||t,t)}function Qi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Ze(e,new pt([No(e.sel.primary(),t,i,n)],0),r)}function Bl(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=No(e.sel.ranges[a],t[a],null,n);var u=Ct(e.cm,r,e.sel.primIndex);Ze(e,u,i)}function Io(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,Ze(e,Ct(e.cm,n,e.sel.primIndex),r)}function Nl(e,t,i,r){Ze(e,Xt(t,i),r)}function ac(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var a=0;a<n.length;a++)this.ranges[a]=new be(ce(e,n[a].anchor),ce(e,n[a].head))},origin:i&&i.origin};return Ie(e,"beforeSelectionChange",e,r),e.cm&&Ie(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ct(e.cm,r.ranges,r.ranges.length-1):t}function Il(e,t,i){var r=e.history.done,n=me(r);n&&n.ranges?(r[r.length-1]=t,Ji(e,t,i)):Ze(e,t,i)}function Ze(e,t,i){Ji(e,t,i),ic(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Ji(e,t,i){(yt(e,"beforeSelectionChange")||e.cm&&yt(e.cm,"beforeSelectionChange"))&&(t=ac(e,t,i));var r=i&&i.bias||(fe(t.primary().head,e.sel.primary().head)<0?-1:1);zl(e,Hl(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Er(e.cm)}function zl(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ya(e.cm)),qe(e,"cursorActivity",e))}function Ol(e){zl(e,Hl(e,e.sel,null,!1))}function Hl(e,t,i,r){for(var n,a=0;a<t.ranges.length;a++){var u=t.ranges[a],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],v=$i(e,u.anchor,h&&h.anchor,i,r),m=u.head==u.anchor?v:$i(e,u.head,h&&h.head,i,r);(n||v!=u.anchor||m!=u.head)&&(n||(n=t.ranges.slice(0,a)),n[a]=new be(v,m))}return n?Ct(e.cm,n,t.primIndex):t}function Tr(e,t,i,r,n){var a=re(e,t.line);if(a.markedSpans)for(var u=0;u<a.markedSpans.length;++u){var h=a.markedSpans[u],v=h.marker,m="selectLeft"in v?!v.selectLeft:v.inclusiveLeft,x="selectRight"in v?!v.selectRight:v.inclusiveRight;if((h.from==null||(m?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(x?h.to>=t.ch:h.to>t.ch))){if(n&&(Ie(v,"beforeCursorEnter"),v.explicitlyCleared))if(a.markedSpans){--u;continue}else break;if(!v.atomic)continue;if(i){var C=v.find(r<0?1:-1),M=void 0;if((r<0?x:m)&&(C=Rl(e,C,-r,C&&C.line==t.line?a:null)),C&&C.line==t.line&&(M=fe(C,i))&&(r<0?M<0:M>0))return Tr(e,C,t,r,n)}var E=v.find(r<0?-1:1);return(r<0?m:x)&&(E=Rl(e,E,r,E.line==t.line?a:null)),E?Tr(e,E,t,r,n):null}}return t}function $i(e,t,i,r,n){var a=r||1,u=Tr(e,t,i,a,n)||!n&&Tr(e,t,i,a,!0)||Tr(e,t,i,-a,n)||!n&&Tr(e,t,i,-a,!0);return u||(e.cantEdit=!0,q(e.first,0))}function Rl(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ce(e,q(t.line-1)):null:i>0&&t.ch==(r||re(e,t.line)).text.length?t.line<e.first+e.size-1?q(t.line+1,0):null:new q(t.line,t.ch+i)}function Pl(e){e.setSelection(q(e.firstLine(),0),q(e.lastLine()),rt)}function _l(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,a,u,h){n&&(r.from=ce(e,n)),a&&(r.to=ce(e,a)),u&&(r.text=u),h!==void 0&&(r.origin=h)}),Ie(e,"beforeChange",e,r),e.cm&&Ie(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 Mr(e,t,i){if(e.cm){if(!e.cm.curOp)return Ue(e.cm,Mr)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((yt(e,"beforeChange")||e.cm&&yt(e.cm,"beforeChange"))&&(t=_l(e,t,!0),!t))){var r=Ma&&!i&&rf(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)Wl(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Wl(e,t)}}function Wl(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var i=Lo(e,t);Ll(e,t,i,e.cm?e.cm.curOp.id:NaN),fi(e,t,i,to(e,t));var r=[];Zt(e,function(n,a){!a&&Fe(r,n.history)==-1&&(Gl(n.history,t),r.push(n.history)),fi(n,t,null,to(n,t))})}}function Vi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,a,u=e.sel,h=t=="undo"?n.done:n.undone,v=t=="undo"?n.undone:n.done,m=0;m<h.length&&(a=h[m],!(i?a.ranges&&!a.equals(e.sel):!a.ranges));m++);if(m!=h.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(a=h.pop(),a.ranges){if(Zi(a,v),i&&!a.equals(e.sel)){Ze(e,a,{clearRedo:!1});return}u=a}else if(r){h.push(a);return}else break;var x=[];Zi(u,v),v.push({changes:x,generation:n.generation}),n.generation=a.generation||++n.maxGeneration;for(var C=yt(e,"beforeChange")||e.cm&&yt(e.cm,"beforeChange"),M=function(P){var j=a.changes[P];if(j.origin=t,C&&!_l(e,j,!1))return h.length=0,{};x.push(Bo(e,j));var Y=P?Lo(e,j):me(h);fi(e,j,Y,Ml(e,j)),!P&&e.cm&&e.cm.scrollIntoView({from:j.from,to:Yt(j)});var Q=[];Zt(e,function(Z,$){!$&&Fe(Q,Z.history)==-1&&(Gl(Z.history,j),Q.push(Z.history)),fi(Z,j,null,Ml(Z,j))})},E=a.changes.length-1;E>=0;--E){var O=M(E);if(O)return O.v}}}}function ql(e,t){if(t!=0&&(e.first+=t,e.sel=new pt(xt(e.sel.ranges,function(n){return new be(q(n.anchor.line+t,n.anchor.ch),q(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){nt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Gt(e.cm,r,"gutter")}}function fi(e,t,i,r){if(e.cm&&!e.cm.curOp)return Ue(e.cm,fi)(e,t,i,r);if(t.to.line<e.first){ql(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ql(e,n),t={from:q(e.first,0),to:q(t.to.line+n,t.to.ch),text:[me(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:q(a,re(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=rr(e,t.from,t.to),i||(i=Lo(e,t)),e.cm?lc(e.cm,t,r):Mo(e,t,r),Ji(e,i,rt),e.cantEdit&&$i(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function lc(e,t,i){var r=e.doc,n=e.display,a=t.from,u=t.to,h=!1,v=a.line;e.options.lineWrapping||(v=xe(Dt(re(r,a.line))),r.iter(v,u.line+1,function(E){if(E==n.maxLine)return h=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ya(e),Mo(r,t,i,ll(e)),e.options.lineWrapping||(r.iter(v,a.line+t.text.length,function(E){var O=Oi(E);O>n.maxLineLength&&(n.maxLine=E,n.maxLineLength=O,n.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),Zu(r,a.line),li(e,400);var m=t.text.length-(u.line-a.line)-1;t.full?nt(e):a.line==u.line&&t.text.length==1&&!Sl(e.doc,t)?Gt(e,a.line,"text"):nt(e,a.line,u.line+1,m);var x=yt(e,"changes"),C=yt(e,"change");if(C||x){var M={from:a,to:u,text:t.text,removed:t.removed,origin:t.origin};C&&qe(e,"change",e,M),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(M)}e.display.selForContextMenu=null}function Br(e,t,i,r,n){var a;r||(r=i),fe(r,i)<0&&(a=[r,i],i=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Mr(e,{from:i,to:r,text:t,origin:n})}function Ul(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function jl(e,t,i,r){for(var n=0;n<e.length;++n){var a=e[n],u=!0;if(a.ranges){a.copied||(a=e[n]=a.deepCopy(),a.copied=!0);for(var h=0;h<a.ranges.length;h++)Ul(a.ranges[h].anchor,t,i,r),Ul(a.ranges[h].head,t,i,r);continue}for(var v=0;v<a.changes.length;++v){var m=a.changes[v];if(i<m.from.line)m.from=q(m.from.line+r,m.from.ch),m.to=q(m.to.line+r,m.to.ch);else if(t<=m.to.line){u=!1;break}}u||(e.splice(0,n+1),n=0)}}function Gl(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;jl(e.done,i,r,n),jl(e.undone,i,r,n)}function ci(e,t,i,r){var n=t,a=t;return typeof t=="number"?a=re(e,wa(e,t)):n=xe(t),n==null?null:(r(a,n)&&e.cm&&Gt(e.cm,n,i),a)}function di(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}di.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,sf(n),qe(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,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,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function hi(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}hi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var a=Math.min(t,n-e),u=r.height;if(r.removeInner(e,a),this.height-=u-r.height,n==a&&(this.children.splice(i--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof di))){var h=[];this.collapse(h),this.children=[new di(h)],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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],a=n.chunkSize();if(e<=a){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var u=n.lines.length%25+25,h=u;h<n.lines.length;){var v=new di(n.lines.slice(h,h+=25));n.height-=v.height,this.children.splice(++r,0,v),v.parent=this}n.lines=n.lines.slice(0,u),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new hi(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=Fe(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new hi(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],a=n.chunkSize();if(e<a){var u=Math.min(t,a-e);if(n.iterN(e,u,i))return!0;if((t-=u)==0)break;e=0}else e-=a}}};var pi=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};pi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=xe(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var a=ei(this);Et(i,Math.max(0,i.height-a)),e&&(ut(e,function(){Kl(e,i,-a),Gt(e,r,"widget")}),qe(e,"lineWidgetCleared",e,this,r))}},pi.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=ei(this)-t;n&&(jt(this.doc,r)||Et(r,r.height+n),i&&ut(i,function(){i.curOp.forceUpdate=!0,Kl(i,r,n),qe(i,"lineWidgetChanged",i,e,xe(r))}))},yr(pi);function Kl(e,t,i){It(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Co(e,i)}function sc(e,t,i,r){var n=new pi(e,i,r),a=e.cm;return a&&n.noHScroll&&(a.display.alignWidgets=!0),ci(e,t,"widget",function(u){var h=u.widgets||(u.widgets=[]);if(n.insertAt==null?h.push(n):h.splice(Math.min(h.length,Math.max(0,n.insertAt)),0,n),n.line=u,a&&!jt(e,u)){var v=It(u)<e.scrollTop;Et(u,u.height+ei(n)),v&&Co(a,n.height),a.curOp.forceUpdate=!0}return!0}),a&&qe(a,"lineWidgetAdded",a,n,typeof t=="number"?t:xe(t)),n}var Xl=0,Qt=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Xl};Qt.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&fr(e),yt(this,"clear")){var i=this.find();i&&qe(this,"clear",i.from,i.to)}for(var r=null,n=null,a=0;a<this.lines.length;++a){var u=this.lines[a],h=Jr(u.markedSpans,this);e&&!this.collapsed?Gt(e,xe(u),"text"):e&&(h.to!=null&&(n=xe(u)),h.from!=null&&(r=xe(u))),u.markedSpans=$u(u.markedSpans,h),h.from==null&&this.collapsed&&!jt(this.doc,u)&&e&&Et(u,kr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var v=0;v<this.lines.length;++v){var m=Dt(this.lines[v]),x=Oi(m);x>e.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&nt(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ol(e.doc)),e&&qe(e,"markerCleared",e,this,r,n),t&&cr(e),this.parent&&this.parent.clear()}},Qt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var a=this.lines[n],u=Jr(a.markedSpans,this);if(u.from!=null&&(i=q(t?a:xe(a),u.from),e==-1))return i;if(u.to!=null&&(r=q(t?a:xe(a),u.to),e==1))return r}return i&&{from:i,to:r}},Qt.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||ut(r,function(){var n=t.line,a=xe(t.line),u=uo(r,a);if(u&&(Va(u),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!jt(i.doc,n)&&i.height!=null){var h=i.height;i.height=null;var v=ei(i)-h;v&&Et(n,n.height+v)}qe(r,"markerChanged",r,e)})},Qt.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Qt.prototype.detachLine=function(e){if(this.lines.splice(Fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},yr(Qt);function Nr(e,t,i,r,n){if(r&&r.shared)return uc(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Ue(e.cm,Nr)(e,t,i,r,n);var a=new Qt(e,n),u=fe(t,i);if(r&&dt(r,a,!1),u>0||u==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=U("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ha(e,t.line,t,i,a)||t.line!=i.line&&Ha(e,i.line,t,i,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ju()}a.addToHistory&&Ll(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var h=t.line,v=e.cm,m;if(e.iter(h,i.line+1,function(C){v&&a.collapsed&&!v.options.lineWrapping&&Dt(C)==v.display.maxLine&&(m=!0),a.collapsed&&h!=t.line&&Et(C,0),Vu(C,new Bi(a,h==t.line?t.ch:null,h==i.line?i.ch:null),e.cm&&e.cm.curOp),++h}),a.collapsed&&e.iter(t.line,i.line+1,function(C){jt(e,C)&&Et(C,0)}),a.clearOnEnter&&oe(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Qu(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Xl,a.atomic=!0),v){if(m&&(v.curOp.updateMaxLine=!0),a.collapsed)nt(v,t.line,i.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var x=t.line;x<=i.line;x++)Gt(v,x,"text");a.atomic&&Ol(v.doc),qe(v,"markerAdded",v,a)}return a}var gi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};gi.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();qe(this,"clear")}},gi.prototype.find=function(e,t){return this.primary.find(e,t)},yr(gi);function uc(e,t,i,r,n){r=dt(r),r.shared=!1;var a=[Nr(e,t,i,r,n)],u=a[0],h=r.widgetNode;return Zt(e,function(v){h&&(r.widgetNode=h.cloneNode(!0)),a.push(Nr(v,ce(v,t),ce(v,i),r,n));for(var m=0;m<v.linked.length;++m)if(v.linked[m].isParent)return;u=me(a)}),new gi(a,u)}function Yl(e){return e.findMarks(q(e.first,0),e.clipPos(q(e.lastLine())),function(t){return t.parent})}function fc(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),a=e.clipPos(n.from),u=e.clipPos(n.to);if(fe(a,u)){var h=Nr(e,a,u,r.primary,r.primary.type);r.markers.push(h),h.parent=r}}}function cc(e){for(var t=function(r){var n=e[r],a=[n.primary.doc];Zt(n.primary.doc,function(v){return a.push(v)});for(var u=0;u<n.markers.length;u++){var h=n.markers[u];Fe(a,h.doc)==-1&&(h.parent=null,n.markers.splice(u--,1))}},i=0;i<e.length;i++)t(i)}var dc=0,ot=function(e,t,i,r,n){if(!(this instanceof ot))return new ot(e,t,i,r,n);i==null&&(i=0),hi.call(this,[new di([new Dr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var a=q(i,0);this.sel=Xt(a),this.history=new Yi(null),this.id=++dc,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Mo(this,{from:a,to:a,text:e}),Ze(this,Xt(a),rt)};ot.prototype=pa(hi.prototype,{constructor:ot,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Zn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:je(function(e){var t=q(this.first,0),i=this.first+this.size-1;Mr(this,{from:t,to:q(i,re(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ii(this.cm,0,0),Ze(this,Xt(t),rt)}),replaceRange:function(e,t,i,r){t=ce(this,t),i=i?ce(this,i):t,Br(this,e,t,i,r)},getRange:function(e,t,i){var r=rr(this,ce(this,e),ce(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Zr(this,e))return re(this,e)},getLineNumber:function(e){return xe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=re(this,e)),Dt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ce(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:je(function(e,t,i){Nl(this,ce(this,typeof e=="number"?q(e,t||0):e),null,i)}),setSelection:je(function(e,t,i){Nl(this,ce(this,e),ce(this,t||e),i)}),extendSelection:je(function(e,t,i){Qi(this,ce(this,e),t&&ce(this,t),i)}),extendSelections:je(function(e,t){Bl(this,Ca(this,e),t)}),extendSelectionsBy:je(function(e,t){var i=xt(this.sel.ranges,e);Bl(this,Ca(this,i),t)}),setSelections:je(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new be(ce(this,e[n].anchor),ce(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ze(this,Ct(this.cm,r,t),i)}}),addSelection:je(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new be(ce(this,e),ce(this,t||e))),Ze(this,Ct(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=rr(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=rr(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:je(function(e,t,i){for(var r=[],n=this.sel,a=0;a<n.ranges.length;a++){var u=n.ranges[a];r[a]={from:u.from(),to:u.to(),text:this.splitLines(e[a]),origin:i}}for(var h=t&&t!="end"&&Vf(this,r,t),v=r.length-1;v>=0;v--)Mr(this,r[v]);h?Il(this,h):this.cm&&Er(this.cm)}),undo:je(function(){Vi(this,"undo")}),redo:je(function(){Vi(this,"redo")}),undoSelection:je(function(){Vi(this,"undo",!0)}),redoSelection:je(function(){Vi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Yi(this.history),Zt(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:Lr(this.history.done),undone:Lr(this.history.undone)}},setHistory:function(e){var t=this.history=new Yi(this.history);t.done=Lr(e.done.slice(0),null,!0),t.undone=Lr(e.undone.slice(0),null,!0)},setGutterMarker:je(function(e,t,i){return ci(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&ga(n)&&(r.gutterMarkers=null),!0})}),clearGutter:je(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&ci(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ga(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Zr(this,e)||(t=e,e=re(this,e),!e))return null}else if(t=xe(e),t==null)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:je(function(e,t,i){return ci(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(G(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:je(function(e,t,i){return ci(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=r[n];if(a)if(i==null)r[n]=null;else{var u=a.match(G(i));if(!u)return!1;var h=u.index+u[0].length;r[n]=a.slice(0,u.index)+(!u.index||h==a.length?"":" ")+a.slice(h)||null}else return!1;return!0})}),addLineWidget:je(function(e,t,i){return sc(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Nr(this,ce(this,e),ce(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ce(this,e),Nr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=ce(this,e);var t=[],i=re(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ce(this,e),t=ce(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(a){var u=a.markedSpans;if(u)for(var h=0;h<u.length;h++){var v=u[h];!(v.to!=null&&n==e.line&&e.ch>=v.to||v.from==null&&n!=e.line||v.from!=null&&n==t.line&&v.from>=t.ch)&&(!i||i(v.marker))&&r.push(v.marker.parent||v.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var a=n.text.length+r;if(a>e)return t=e,!0;e-=a,++i}),ce(this,q(i,t))},indexFromPos:function(e){e=ce(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new ot(Zn(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new ot(Zn(this,t,i),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}],fc(r,Yl(this)),r},unlinkDoc:function(e){if(e instanceof Ee&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),cc(Yl(this));break}}if(e.history==this.history){var r=[e.id];Zt(e,function(n){return r.push(n.id)},!0),e.history=new Yi(null),e.history.done=Lr(this.history.done,r),e.history.undone=Lr(this.history.undone,r)}},iterLinkedDocs:function(e){Zt(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):jn(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:je(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&ec(this.cm))})}),ot.prototype.eachLine=ot.prototype.iter;var Zl=0;function hc(e){var t=this;if(Ql(t),!(We(t,e)||zt(t.display,e))){it(e),d&&(Zl=+new Date);var i=ar(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,a=Array(n),u=0,h=function(){++u==n&&Ue(t,function(){i=ce(t.doc,i);var E={from:i,to:i,text:t.doc.splitLines(a.filter(function(O){return O!=null}).join(t.doc.lineSeparator())),origin:"paste"};Mr(t.doc,E),Il(t.doc,Xt(ce(t.doc,i),ce(t.doc,Yt(E))))})()},v=function(E,O){if(t.options.allowDropFileTypes&&Fe(t.options.allowDropFileTypes,E.type)==-1){h();return}var P=new FileReader;P.onerror=function(){return h()},P.onload=function(){var j=P.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(j)){h();return}a[O]=j,h()},P.readAsText(E)},m=0;m<r.length;m++)v(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Ji(t.doc,Xt(i,i)),C)for(var M=0;M<C.length;++M)Br(t.doc,"",C[M].anchor,C[M].head,"drag");t.replaceSelection(x,"around","paste"),t.display.input.focus()}}catch{}}}}function pc(e,t){if(d&&(!e.state.draggingText||+new Date-Zl<100)){Yr(t);return}if(!(We(e,t)||zt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!T)){var i=L("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",F&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),F&&i.parentNode.removeChild(i)}}function gc(e,t){var i=ar(e,t);if(i){var r=document.createDocumentFragment();yo(e,i,r),e.display.dragCursor||(e.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),de(e.display.dragCursor,r)}}function Ql(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Jl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var a=0;a<i.length;a++)e(i[a])})}}var $l=!1;function vc(){$l||(mc(),$l=!0)}function mc(){var e;oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Jl(yc)},100))}),oe(window,"blur",function(){return Jl(Fr)})}function yc(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Jt={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"},vi=0;vi<10;vi++)Jt[vi+48]=Jt[vi+96]=String(vi);for(var en=65;en<=90;en++)Jt[en]=String.fromCharCode(en);for(var mi=1;mi<=12;mi++)Jt[mi+111]=Jt[mi+63235]="F"+mi;var Ht={};Ht.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"},Ht.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"},Ht.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ht.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"]},Ht.default=R?Ht.macDefault:Ht.pcDefault;function bc(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,a,u=0;u<t.length-1;u++){var h=t[u];if(/^(cmd|meta|m)$/i.test(h))a=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))n=!0;else throw new Error("Unrecognized modifier name: "+h)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function xc(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=xt(i.split(" "),bc),a=0;a<n.length;a++){var u=void 0,h=void 0;a==n.length-1?(h=n.join(" "),u=r):(h=n.slice(0,a+1).join(" "),u="...");var v=t[h];if(!v)t[h]=u;else if(v!=u)throw new Error("Inconsistent bindings for "+h)}delete e[i]}for(var m in t)e[m]=t[m];return e}function Ir(e,t,i,r){t=tn(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ir(e,t.fallthrough,i,r);for(var a=0;a<t.fallthrough.length;a++){var u=Ir(e,t.fallthrough[a],i,r);if(u)return u}}}function Vl(e){var t=typeof e=="string"?e:Jt[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function es(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(K?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(K?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function ts(e,t){if(F&&e.keyCode==34&&e.char)return!1;var i=Jt[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),es(i,e,t))}function tn(e){return typeof e=="string"?Ht[e]:e}function zr(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var a=t(i[n]);r.length&&fe(a.from,me(r).to)<=0;){var u=r.pop();if(fe(u.from,a.from)<0){a.from=u.from;break}}r.push(a)}ut(e,function(){for(var h=r.length-1;h>=0;h--)Br(e.doc,"",r[h].from,r[h].to,"+delete");Er(e)})}function zo(e,t,i){var r=va(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Oo(e,t,i){var r=zo(e,t.ch,i);return r==null?null:new q(t.line,r,i<0?"after":"before")}function Ho(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var a=Bt(i,t.doc.direction);if(a){var u=n<0?me(a):a[0],h=n<0==(u.level==1),v=h?"after":"before",m;if(u.level>0||t.doc.direction=="rtl"){var x=Cr(t,i);m=n<0?i.text.length-1:0;var C=Tt(t,x,m).top;m=Gr(function(M){return Tt(t,x,M).top==C},n<0==(u.level==1)?u.from:u.to-1,m),v=="before"&&(m=zo(i,m,1))}else m=n<0?u.to:u.from;return new q(r,m,v)}}return new q(r,n<0?i.text.length:0,n<0?"before":"after")}function Dc(e,t,i,r){var n=Bt(t,e.doc.direction);if(!n)return Oo(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var a=Xr(n,i.ch,i.sticky),u=n[a];if(e.doc.direction=="ltr"&&u.level%2==0&&(r>0?u.to>i.ch:u.from<i.ch))return Oo(t,i,r);var h=function(Y,Q){return zo(t,Y instanceof q?Y.ch:Y,Q)},v,m=function(Y){return e.options.lineWrapping?(v=v||Cr(e,t),al(e,t,v,Y)):{begin:0,end:t.text.length}},x=m(i.sticky=="before"?h(i,-1):i.ch);if(e.doc.direction=="rtl"||u.level==1){var C=u.level==1==r<0,M=h(i,C?1:-1);if(M!=null&&(C?M<=u.to&&M<=x.end:M>=u.from&&M>=x.begin)){var E=C?"before":"after";return new q(i.line,M,E)}}var O=function(Y,Q,Z){for(var $=function(we,Ge){return Ge?new q(i.line,h(we,1),"before"):new q(i.line,we,"after")};Y>=0&&Y<n.length;Y+=Q){var ne=n[Y],ie=Q>0==(ne.level!=1),pe=ie?Z.begin:h(Z.end,-1);if(ne.from<=pe&&pe<ne.to||(pe=ie?ne.from:h(ne.to,-1),Z.begin<=pe&&pe<Z.end))return $(pe,ie)}},P=O(a+r,r,x);if(P)return P;var j=r>0?x.end:h(x.begin,-1);return j!=null&&!(r>0&&j==t.text.length)&&(P=O(r>0?0:n.length-1,r,m(j)),P)?P:null}var yi={selectAll:Pl,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return zr(e,function(t){if(t.empty()){var i=re(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:q(t.head.line+1,0)}:{from:t.head,to:q(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return zr(e,function(t){return{from:q(t.from().line,0),to:ce(e.doc,q(t.to().line+1,0))}})},delLineLeft:function(e){return zr(e,function(t){return{from:q(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return zr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return zr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"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(q(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(q(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return rs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return is(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return wc(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},St)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},St)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?is(e,t.head):r},St)},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(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var a=i[n].from(),u=Re(e.getLine(a.line),a.ch,r);t.push(qt(r-u%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ut(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var n=t[r].head,a=re(e.doc,n.line).text;if(a){if(n.ch==a.length&&(n=new q(n.line,n.ch-1)),n.ch>0)n=new q(n.line,n.ch+1),e.replaceRange(a.charAt(n.ch-1)+a.charAt(n.ch-2),q(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var u=re(e.doc,n.line-1).text;u&&(n=new q(n.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+u.charAt(u.length-1),q(n.line-1,u.length-1),n,"+transpose"))}}i.push(new be(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ut(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Er(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function rs(e,t){var i=re(e.doc,t),r=Dt(i);return r!=i&&(t=xe(r)),Ho(!0,e,r,t,1)}function wc(e,t){var i=re(e.doc,t),r=of(i);return r!=i&&(t=xe(r)),Ho(!0,e,i,t,-1)}function is(e,t){var i=rs(e,t.line),r=re(e.doc,i.line),n=Bt(r,e.doc.direction);if(!n||n[0].level==0){var a=Math.max(i.ch,r.text.search(/\S/)),u=t.line==i.line&&t.ch<=a&&t.ch;return q(i.line,u?0:a,i.sticky)}return i}function rn(e,t,i){if(typeof t=="string"&&(t=yi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Pe}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function Cc(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Ir(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&Ir(t,e.options.extraKeys,i,e)||Ir(t,e.options.keyMap,i,e)}var kc=new Je;function bi(e,t,i,r){var n=e.state.keySeq;if(n){if(Vl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:kc.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),ns(e,n+" "+t,i,r))return!0}return ns(e,t,i,r)}function ns(e,t,i,r){var n=Cc(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&qe(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(it(i),bo(e)),!!n}function os(e,t){var i=ts(t,!0);return i?t.shiftKey&&!e.state.keySeq?bi(e,"Shift-"+i,t,function(r){return rn(e,r,!0)})||bi(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return rn(e,r)}):bi(e,i,t,function(r){return rn(e,r)}):!1}function Sc(e,t,i){return bi(e,"'"+i+"'",t,function(r){return rn(e,r,!0)})}var Ro=null;function as(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ve(ee(t)),!We(t,e))){d&&p<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=os(t,e);F&&(Ro=r?i:null,!r&&i==88&&!qu&&(R?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),c&&!R&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fc(t)}}function Fc(e){var t=e.display.lineDiv;Te(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(ue(t,"CodeMirror-crosshair"),ht(document,"keyup",i),ht(document,"mouseover",i))}oe(document,"keyup",i),oe(document,"mouseover",i)}function ls(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function ss(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(zt(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||R&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(F&&i==Ro){Ro=null,it(e);return}if(!(F&&(!e.which||e.which<10)&&os(t,e))){var n=String.fromCharCode(r??i);n!="\b"&&(Sc(t,e,n)||t.display.input.onKeyPress(e))}}}var Ec=400,Po=function(e,t,i){this.time=e,this.pos=t,this.button=i};Po.prototype.compare=function(e,t,i){return this.time+Ec>e&&fe(t,this.pos)==0&&i==this.button};var xi,Di;function Ac(e,t){var i=+new Date;return Di&&Di.compare(i,e,t)?(xi=Di=null,"triple"):xi&&xi.compare(i,e,t)?(Di=new Po(i,e,t),xi=null,"double"):(xi=new Po(i,e,t),Di=null,"single")}function us(e){var t=this,i=t.display;if(!(We(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,zt(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!_o(t,e)){var r=ar(t,e),n=xa(e),a=r?Ac(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Lc(t,n,r,a,e))&&(n==1?r?Mc(t,r,a,e):Wn(e)==i.scroller&&it(e):n==2?(r&&Qi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(ge?t.display.input.onContextMenu(e):xo(t)))}}}function Lc(e,t,i,r,n){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,bi(e,es(a,n),n,function(u){if(typeof u=="string"&&(u=yi[u]),!u)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=u(e,i)!=Pe}finally{e.state.suppressEdits=!1}return h})}function Tc(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var a=H?i.shiftKey&&i.metaKey:i.altKey;n.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=R?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(R?i.altKey:i.ctrlKey)),n}function Mc(e,t,i,r){d?setTimeout(tt(fl,e),0):e.curOp.focus=ve(ee(e));var n=Tc(e,i,r),a=e.doc.sel,u;e.options.dragDrop&&Ru&&!e.isReadOnly()&&i=="single"&&(u=a.contains(t))>-1&&(fe((u=a.ranges[u]).from(),t)<0||t.xRel>0)&&(fe(u.to(),t)>0||t.xRel<0)?Bc(e,r,t,n):Nc(e,r,t,n)}function Bc(e,t,i,r){var n=e.display,a=!1,u=Ue(e,function(m){y&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:xo(e)),ht(n.wrapper.ownerDocument,"mouseup",u),ht(n.wrapper.ownerDocument,"mousemove",h),ht(n.scroller,"dragstart",v),ht(n.scroller,"drop",u),a||(it(m),r.addNew||Qi(e.doc,i,null,null,r.extend),y&&!T||d&&p==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),h=function(m){a=a||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},v=function(){return a=!0};y&&(n.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",u),oe(n.wrapper.ownerDocument,"mousemove",h),oe(n.scroller,"dragstart",v),oe(n.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function fs(e,t,i){if(i=="char")return new be(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new be(q(t.line,0),ce(e.doc,q(t.line+1,0)));var r=i(e,t);return new be(r.from,r.to)}function Nc(e,t,i,r){d&&xo(e);var n=e.display,a=e.doc;it(t);var u,h,v=a.sel,m=v.ranges;if(r.addNew&&!r.extend?(h=a.sel.contains(i),h>-1?u=m[h]:u=new be(i,i)):(u=a.sel.primary(),h=a.sel.primIndex),r.unit=="rectangle")r.addNew||(u=new be(i,i)),i=ar(e,t,!0,!0),h=-1;else{var x=fs(e,i,r.unit);r.extend?u=No(u,x.anchor,x.head,r.extend):u=x}r.addNew?h==-1?(h=m.length,Ze(a,Ct(e,m.concat([u]),h),{scroll:!1,origin:"*mouse"})):m.length>1&&m[h].empty()&&r.unit=="char"&&!r.extend?(Ze(a,Ct(e,m.slice(0,h).concat(m.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),v=a.sel):Io(a,h,u,jr):(h=0,Ze(a,new pt([u],0),jr),v=a.sel);var C=i;function M(Z){if(fe(C,Z)!=0)if(C=Z,r.unit=="rectangle"){for(var $=[],ne=e.options.tabSize,ie=Re(re(a,i.line).text,i.ch,ne),pe=Re(re(a,Z.line).text,Z.ch,ne),we=Math.min(ie,pe),Ge=Math.max(ie,pe),Le=Math.min(i.line,Z.line),ft=Math.min(e.lastLine(),Math.max(i.line,Z.line));Le<=ft;Le++){var at=re(a,Le).text,Oe=Ft(at,we,ne);we==Ge?$.push(new be(q(Le,Oe),q(Le,Oe))):at.length>Oe&&$.push(new be(q(Le,Oe),q(Le,Ft(at,Ge,ne))))}$.length||$.push(new be(i,i)),Ze(a,Ct(e,v.ranges.slice(0,h).concat($),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Z)}else{var lt=u,Xe=fs(e,Z,r.unit),_e=lt.anchor,He;fe(Xe.anchor,_e)>0?(He=Xe.head,_e=Ti(lt.from(),Xe.anchor)):(He=Xe.anchor,_e=Li(lt.to(),Xe.head));var Be=v.ranges.slice(0);Be[h]=Ic(e,new be(ce(a,_e),He)),Ze(a,Ct(e,Be,h),jr)}}var E=n.wrapper.getBoundingClientRect(),O=0;function P(Z){var $=++O,ne=ar(e,Z,!0,r.unit=="rectangle");if(ne)if(fe(ne,C)!=0){e.curOp.focus=ve(ee(e)),M(ne);var ie=ji(n,a);(ne.line>=ie.to||ne.line<ie.from)&&setTimeout(Ue(e,function(){O==$&&P(Z)}),150)}else{var pe=Z.clientY<E.top?-20:Z.clientY>E.bottom?20:0;pe&&setTimeout(Ue(e,function(){O==$&&(n.scroller.scrollTop+=pe,P(Z))}),50)}}function j(Z){e.state.selectingText=!1,O=1/0,Z&&(it(Z),n.input.focus()),ht(n.wrapper.ownerDocument,"mousemove",Y),ht(n.wrapper.ownerDocument,"mouseup",Q),a.history.lastSelOrigin=null}var Y=Ue(e,function(Z){Z.buttons===0||!xa(Z)?j(Z):P(Z)}),Q=Ue(e,j);e.state.selectingText=Q,oe(n.wrapper.ownerDocument,"mousemove",Y),oe(n.wrapper.ownerDocument,"mouseup",Q)}function Ic(e,t){var i=t.anchor,r=t.head,n=re(e.doc,i.line);if(fe(i,r)==0&&i.sticky==r.sticky)return t;var a=Bt(n);if(!a)return t;var u=Xr(a,i.ch,i.sticky),h=a[u];if(h.from!=i.ch&&h.to!=i.ch)return t;var v=u+(h.from==i.ch==(h.level!=1)?0:1);if(v==0||v==a.length)return t;var m;if(r.line!=i.line)m=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Xr(a,r.ch,r.sticky),C=x-u||(r.ch-i.ch)*(h.level==1?-1:1);x==v-1||x==v?m=C<0:m=C>0}var M=a[v+(m?-1:0)],E=m==(M.level==1),O=E?M.from:M.to,P=E?"after":"before";return i.ch==O&&i.sticky==P?t:new be(new q(i.line,O,P),r)}function cs(e,t,i,r){var n,a;if(t.touches)n=t.touches[0].clientX,a=t.touches[0].clientY;else try{n=t.clientX,a=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&it(t);var u=e.display,h=u.lineDiv.getBoundingClientRect();if(a>h.bottom||!yt(e,i))return _n(t);a-=h.top-u.viewOffset;for(var v=0;v<e.display.gutterSpecs.length;++v){var m=u.gutters.childNodes[v];if(m&&m.getBoundingClientRect().right>=n){var x=ir(e.doc,a),C=e.display.gutterSpecs[v];return Ie(e,i,e,x,C.className,t),_n(t)}}}function _o(e,t){return cs(e,t,"gutterClick",!0)}function ds(e,t){zt(e.display,t)||zc(e,t)||We(e,t,"contextmenu")||ge||e.display.input.onContextMenu(t)}function zc(e,t){return yt(e,"gutterContextMenu")?cs(e,t,"gutterContextMenu",!1):!1}function hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ti(e)}var Or={toString:function(){return"CodeMirror.Init"}},ps={},nn={};function Oc(e){var t=e.optionHandlers;function i(r,n,a,u){e.defaults[r]=n,a&&(t[r]=u?function(h,v,m){m!=Or&&a(h,v,m)}:a)}e.defineOption=i,e.Init=Or,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,To(r)},!0),i("indentUnit",2,To,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){ui(r),ti(r),nt(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var a=[],u=r.doc.first;r.doc.iter(function(v){for(var m=0;;){var x=v.text.indexOf(n,m);if(x==-1)break;m=x+n.length,a.push(q(u,x))}u++});for(var h=a.length-1;h>=0;h--)Br(r.doc,n,a[h],q(a[h].line,a[h].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,a){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),a!=Or&&r.refresh()}),i("specialCharPlaceholder",cf,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",I?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!_),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){hs(r),si(r)},!0),i("keyMap","default",function(r,n,a){var u=tn(n),h=a!=Or&&tn(a);h&&h.detach&&h.detach(r,u),u.attach&&u.attach(r,h||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Rc,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Ao(n,r.options.lineNumbers),si(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?vo(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Ar(r)},!0),i("scrollbarStyle","native",function(r){vl(r),Ar(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Ao(r.options.gutters,n),si(r)},!0),i("firstLineNumber",1,si,!0),i("lineNumberFormatter",function(r){return r},si,!0),i("showCursorWhenSelecting",!1,ri,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Fr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Hc),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ri,!0),i("singleCursorHeightPerLine",!0,ri,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,ui,!0),i("addModeClass",!1,ui,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,ui,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Hc(e,t,i){var r=i&&i!=Or;if(!t!=!r){var n=e.display.dragFunctions,a=t?oe:ht;a(e.display.scroller,"dragstart",n.start),a(e.display.scroller,"dragenter",n.enter),a(e.display.scroller,"dragover",n.over),a(e.display.scroller,"dragleave",n.leave),a(e.display.scroller,"drop",n.drop)}}function Rc(e){e.options.lineWrapping?(Te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ue(e.display.wrapper,"CodeMirror-wrap"),oo(e)),mo(e),nt(e),ti(e),setTimeout(function(){return Ar(e)},100)}function Ee(e,t){var i=this;if(!(this instanceof Ee))return new Ee(e,t);this.options=t=t?dt(t):{},dt(ps,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ee.inputStyles[t.inputStyle](this),a=this.display=new Jf(e,r,n,t);a.wrapper.CodeMirror=this,hs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vl(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 Je,keySeq:null,specialChars:null},t.autofocus&&!I&&a.input.focus(),d&&p<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Pc(this),vc(),fr(this),this.curOp.forceUpdate=!0,Fl(this,r),t.autofocus&&!I||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Do(i)},20):Fr(this);for(var u in nn)nn.hasOwnProperty(u)&&nn[u](this,t[u],Or);bl(this),t.finishInit&&t.finishInit(this);for(var h=0;h<Wo.length;++h)Wo[h](this);cr(this),y&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Ee.defaults=ps,Ee.optionHandlers=nn;function Pc(e){var t=e.display;oe(t.scroller,"mousedown",Ue(e,us)),d&&p<11?oe(t.scroller,"dblclick",Ue(e,function(v){if(!We(e,v)){var m=ar(e,v);if(!(!m||_o(e,v)||zt(e.display,v))){it(v);var x=e.findWordAt(m);Qi(e.doc,x.anchor,x.head)}}})):oe(t.scroller,"dblclick",function(v){return We(e,v)||it(v)}),oe(t.scroller,"contextmenu",function(v){return ds(e,v)}),oe(t.input.getField(),"contextmenu",function(v){t.scroller.contains(v.target)||ds(e,v)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(v){if(v.touches.length!=1)return!1;var m=v.touches[0];return m.radiusX<=1&&m.radiusY<=1}function u(v,m){if(m.left==null)return!0;var x=m.left-v.left,C=m.top-v.top;return x*x+C*C>20*20}oe(t.scroller,"touchstart",function(v){if(!We(e,v)&&!a(v)&&!_o(e,v)){t.input.ensurePolled(),clearTimeout(i);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},v.touches.length==1&&(t.activeTouch.left=v.touches[0].pageX,t.activeTouch.top=v.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(v){var m=t.activeTouch;if(m&&!zt(t,v)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),C;!m.prev||u(m,m.prev)?C=new be(x,x):!m.prev.prev||u(m,m.prev.prev)?C=e.findWordAt(x):C=new be(q(x.line,0),ce(e.doc,q(x.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),it(v)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ni(e,t.scroller.scrollTop),sr(e,t.scroller.scrollLeft,!0),Ie(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(v){return wl(e,v)}),oe(t.scroller,"DOMMouseScroll",function(v){return wl(e,v)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){We(e,v)||Yr(v)},over:function(v){We(e,v)||(gc(e,v),Yr(v))},start:function(v){return pc(e,v)},drop:Ue(e,hc),leave:function(v){We(e,v)||Ql(e)}};var h=t.input.getField();oe(h,"keyup",function(v){return ls.call(e,v)}),oe(h,"keydown",Ue(e,as)),oe(h,"keypress",Ue(e,ss)),oe(h,"focus",function(v){return Do(e,v)}),oe(h,"blur",function(v){return Fr(e,v)})}var Wo=[];Ee.defineInitHook=function(e){return Wo.push(e)};function wi(e,t,i,r){var n=e.doc,a;i==null&&(i="add"),i=="smart"&&(n.mode.indent?a=Qr(e,t).state:i="prev");var u=e.options.tabSize,h=re(n,t),v=Re(h.text,null,u);h.stateAfter&&(h.stateAfter=null);var m=h.text.match(/^\s*/)[0],x;if(!r&&!/\S/.test(h.text))x=0,i="not";else if(i=="smart"&&(x=n.mode.indent(a,h.text.slice(m.length),h.text),x==Pe||x>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?x=Re(re(n,t-1).text,null,u):x=0:i=="add"?x=v+e.options.indentUnit:i=="subtract"?x=v-e.options.indentUnit:typeof i=="number"&&(x=v+i),x=Math.max(0,x);var C="",M=0;if(e.options.indentWithTabs)for(var E=Math.floor(x/u);E;--E)M+=u,C+=" ";if(M<x&&(C+=qt(x-M)),C!=m)return Br(n,C,q(t,0),q(t,m.length),"+input"),h.stateAfter=null,!0;for(var O=0;O<n.sel.ranges.length;O++){var P=n.sel.ranges[O];if(P.head.line==t&&P.head.ch<m.length){var j=q(t,m.length);Io(n,O,new be(j,j));break}}}var kt=null;function on(e){kt=e}function qo(e,t,i,r,n){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var u=+new Date-200,h=n=="paste"||e.state.pasteIncoming>u,v=jn(t),m=null;if(h&&r.ranges.length>1)if(kt&&kt.text.join(`
`)==t){if(r.ranges.length%kt.text.length==0){m=[];for(var x=0;x<kt.text.length;x++)m.push(a.splitLines(kt.text[x]))}}else v.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=xt(v,function(Y){return[Y]}));for(var C=e.curOp.updateInput,M=r.ranges.length-1;M>=0;M--){var E=r.ranges[M],O=E.from(),P=E.to();E.empty()&&(i&&i>0?O=q(O.line,O.ch-i):e.state.overwrite&&!h?P=q(P.line,Math.min(re(a,P.line).text.length,P.ch+me(v).length)):h&&kt&&kt.lineWise&&kt.text.join(`
`)==v.join(`
`)&&(O=P=q(O.line,0)));var j={from:O,to:P,text:m?m[M%m.length]:v,origin:n||(h?"paste":e.state.cutIncoming>u?"cut":"+input")};Mr(e.doc,j),qe(e,"inputRead",e,j)}t&&!h&&vs(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function gs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ut(t,function(){return qo(t,i,0,null,"paste")}),!0}function vs(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var a=e.getModeAt(n.head),u=!1;if(a.electricChars){for(var h=0;h<a.electricChars.length;h++)if(t.indexOf(a.electricChars.charAt(h))>-1){u=wi(e,n.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(re(e.doc,n.head.line).text.slice(0,n.head.ch))&&(u=wi(e,n.head.line,"smart"));u&&qe(e,"electricInput",e,n.head.line)}}}function ms(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,a={anchor:q(n,0),head:q(n+1,0)};i.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:i}}function Uo(e,t,i,r){e.setAttribute("autocorrect",i?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function ys(){var e=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=L("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return y?e.style.width="1000px":e.setAttribute("wrap","off"),A&&(e.style.border="1px solid black"),t}function _c(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){he(this).focus(),this.display.input.focus()},setOption:function(r,n){var a=this.options,u=a[r];a[r]==n&&r!="mode"||(a[r]=n,t.hasOwnProperty(r)&&Ue(this,t[r])(this,n,u),Ie(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"](tn(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,a=0;a<n.length;++a)if(n[a]==r||n[a].name==r)return n.splice(a,1),!0},addOverlay:$e(function(r,n){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");Ut(this.state.overlays,{mode:a,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(u){return u.priority}),this.state.modeGen++,nt(this)}),removeOverlay:$e(function(r){for(var n=this.state.overlays,a=0;a<n.length;++a){var u=n[a].modeSpec;if(u==r||typeof r=="string"&&u.name==r){n.splice(a,1),this.state.modeGen++,nt(this);return}}}),indentLine:$e(function(r,n,a){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),Zr(this.doc,r)&&wi(this,r,n,a)}),indentSelection:$e(function(r){for(var n=this.doc.sel.ranges,a=-1,u=0;u<n.length;u++){var h=n[u];if(h.empty())h.head.line>a&&(wi(this,h.head.line,r,!0),a=h.head.line,u==this.doc.sel.primIndex&&Er(this));else{var v=h.from(),m=h.to(),x=Math.max(a,v.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var C=x;C<a;++C)wi(this,C,r);var M=this.doc.sel.ranges;v.ch==0&&n.length==M.length&&M[u].from().ch>0&&Io(this.doc,u,new be(v,M[u].to()),rt)}}}),getTokenAt:function(r,n){return Aa(this,r,n)},getLineTokens:function(r,n){return Aa(this,q(r),n,!0)},getTokenTypeAt:function(r){r=ce(this.doc,r);var n=Sa(this,re(this.doc,r.line)),a=0,u=(n.length-1)/2,h=r.ch,v;if(h==0)v=n[2];else for(;;){var m=a+u>>1;if((m?n[m*2-1]:0)>=h)u=m;else if(n[m*2+1]<h)a=m+1;else{v=n[m*2+2];break}}var x=v?v.indexOf("overlay "):-1;return x<0?v:x==0?null:v.slice(0,x-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var a=[];if(!i.hasOwnProperty(n))return a;var u=i[n],h=this.getModeAt(r);if(typeof h[n]=="string")u[h[n]]&&a.push(u[h[n]]);else if(h[n])for(var v=0;v<h[n].length;v++){var m=u[h[n][v]];m&&a.push(m)}else h.helperType&&u[h.helperType]?a.push(u[h.helperType]):u[h.name]&&a.push(u[h.name]);for(var x=0;x<u._global.length;x++){var C=u._global[x];C.pred(h,this)&&Fe(a,C.val)==-1&&a.push(C.val)}return a},getStateAfter:function(r,n){var a=this.doc;return r=wa(a,r??a.first+a.size-1),Qr(this,r+1,n).state},cursorCoords:function(r,n){var a,u=this.doc.sel.primary();return r==null?a=u.head:typeof r=="object"?a=ce(this.doc,r):a=r?u.from():u.to(),wt(this,a,n||"page")},charCoords:function(r,n){return _i(this,ce(this.doc,r),n||"page")},coordsChar:function(r,n){return r=il(this,r,n||"page"),ho(this,r.left,r.top)},lineAtHeight:function(r,n){return r=il(this,{top:r,left:0},n||"page").top,ir(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,a){var u=!1,h;if(typeof r=="number"){var v=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>v&&(r=v,u=!0),h=re(this.doc,r)}else h=r;return Pi(this,h,{top:0,left:0},n||"page",a||u).top+(u?this.doc.height-It(h):0)},defaultTextHeight:function(){return kr(this.display)},defaultCharWidth:function(){return Sr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,a,u,h){var v=this.display;r=wt(this,ce(this.doc,r));var m=r.bottom,x=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),v.sizer.appendChild(n),u=="over")m=r.top;else if(u=="above"||u=="near"){var C=Math.max(v.wrapper.clientHeight,this.doc.height),M=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(u=="above"||r.bottom+n.offsetHeight>C)&&r.top>n.offsetHeight?m=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=C&&(m=r.bottom),x+n.offsetWidth>M&&(x=M-n.offsetWidth)}n.style.top=m+"px",n.style.left=n.style.right="",h=="right"?(x=v.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(h=="left"?x=0:h=="middle"&&(x=(v.sizer.clientWidth-n.offsetWidth)/2),n.style.left=x+"px"),a&&Hf(this,{left:x,top:m,right:x+n.offsetWidth,bottom:m+n.offsetHeight})},triggerOnKeyDown:$e(as),triggerOnKeyPress:$e(ss),triggerOnKeyUp:ls,triggerOnMouseDown:$e(us),execCommand:function(r){if(yi.hasOwnProperty(r))return yi[r].call(null,this)},triggerElectric:$e(function(r){vs(this,r)}),findPosH:function(r,n,a,u){var h=1;n<0&&(h=-1,n=-n);for(var v=ce(this.doc,r),m=0;m<n&&(v=jo(this.doc,v,h,a,u),!v.hitSide);++m);return v},moveH:$e(function(r,n){var a=this;this.extendSelectionsBy(function(u){return a.display.shift||a.doc.extend||u.empty()?jo(a.doc,u.head,r,n,a.options.rtlMoveVisually):r<0?u.from():u.to()},St)}),deleteH:$e(function(r,n){var a=this.doc.sel,u=this.doc;a.somethingSelected()?u.replaceSelection("",null,"+delete"):zr(this,function(h){var v=jo(u,h.head,r,n,!1);return r<0?{from:v,to:h.head}:{from:h.head,to:v}})}),findPosV:function(r,n,a,u){var h=1,v=u;n<0&&(h=-1,n=-n);for(var m=ce(this.doc,r),x=0;x<n;++x){var C=wt(this,m,"div");if(v==null?v=C.left:C.left=v,m=bs(this,C,h,a),m.hitSide)break}return m},moveV:$e(function(r,n){var a=this,u=this.doc,h=[],v=!this.display.shift&&!u.extend&&u.sel.somethingSelected();if(u.extendSelectionsBy(function(x){if(v)return r<0?x.from():x.to();var C=wt(a,x.head,"div");x.goalColumn!=null&&(C.left=x.goalColumn),h.push(C.left);var M=bs(a,C,r,n);return n=="page"&&x==u.sel.primary()&&Co(a,_i(a,M,"div").top-C.top),M},St),h.length)for(var m=0;m<u.sel.ranges.length;m++)u.sel.ranges[m].goalColumn=h[m]}),findWordAt:function(r){var n=this.doc,a=re(n,r.line).text,u=r.ch,h=r.ch;if(a){var v=this.getHelper(r,"wordChars");(r.sticky=="before"||h==a.length)&&u?--u:++h;for(var m=a.charAt(u),x=Ei(m,v)?function(C){return Ei(C,v)}:/\s/.test(m)?function(C){return/\s/.test(C)}:function(C){return!/\s/.test(C)&&!Ei(C)};u>0&&x(a.charAt(u-1));)--u;for(;h<a.length&&x(a.charAt(h));)++h}return new be(q(r.line,u),q(r.line,h))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Te(this.display.cursorDiv,"CodeMirror-overwrite"):ue(this.display.cursorDiv,"CodeMirror-overwrite"),Ie(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ve(ee(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:$e(function(r,n){ii(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Lt(this)-this.display.barHeight,width:r.scrollWidth-Lt(this)-this.display.barWidth,clientHeight:so(this),clientWidth:nr(this)}},scrollIntoView:$e(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:q(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?Rf(this,r):dl(this,r.from,r.to,r.margin)}),setSize:$e(function(r,n){var a=this,u=function(v){return typeof v=="number"||/^\d+$/.test(String(v))?v+"px":v};r!=null&&(this.display.wrapper.style.width=u(r)),n!=null&&(this.display.wrapper.style.height=u(n)),this.options.lineWrapping&&el(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(v){if(v.widgets){for(var m=0;m<v.widgets.length;m++)if(v.widgets[m].noHScroll){Gt(a,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,Ie(this,"refresh",this)}),operation:function(r){return ut(this,r)},startOperation:function(){return fr(this)},endOperation:function(){return cr(this)},refresh:$e(function(){var r=this.display.cachedTextHeight;nt(this),this.curOp.forceUpdate=!0,ti(this),ii(this,this.doc.scrollLeft,this.doc.scrollTop),Fo(this.display),(r==null||Math.abs(r-kr(this.display))>.5||this.options.lineWrapping)&&mo(this),Ie(this,"refresh",this)}),swapDoc:$e(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Fl(this,r),ti(this),this.display.input.reset(),ii(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},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}},yr(e),e.registerHelper=function(r,n,a){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=a},e.registerGlobalHelper=function(r,n,a,u){e.registerHelper(r,n,u),i[r]._global.push({pred:a,val:u})}}function jo(e,t,i,r,n){var a=t,u=i,h=re(e,t.line),v=n&&e.direction=="rtl"?-i:i;function m(){var Q=t.line+v;return Q<e.first||Q>=e.first+e.size?!1:(t=new q(Q,t.ch,t.sticky),h=re(e,Q))}function x(Q){var Z;if(r=="codepoint"){var $=h.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Z=null;else{var ne=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Z=new q(t.line,Math.max(0,Math.min(h.text.length,t.ch+i*(ne?2:1))),-i)}}else n?Z=Dc(e.cm,h,t,i):Z=Oo(h,t,i);if(Z==null)if(!Q&&m())t=Ho(n,e.cm,h,t.line,v);else return!1;else t=Z;return!0}if(r=="char"||r=="codepoint")x();else if(r=="column")x(!0);else if(r=="word"||r=="group")for(var C=null,M=r=="group",E=e.cm&&e.cm.getHelper(t,"wordChars"),O=!0;!(i<0&&!x(!O));O=!1){var P=h.text.charAt(t.ch)||`
`,j=Ei(P,E)?"w":M&&P==`
`?"n":!M||/\s/.test(P)?null:"p";if(M&&!O&&!j&&(j="s"),C&&C!=j){i<0&&(i=1,x(),t.sticky="after");break}if(j&&(C=j),i>0&&!x(!O))break}var Y=$i(e,t,a,u,!0);return Jn(a,Y)&&(Y.hitSide=!0),Y}function bs(e,t,i,r){var n=e.doc,a=t.left,u;if(r=="page"){var h=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),v=Math.max(h-.5*kr(e.display),3);u=(i>0?t.bottom:t.top)+i*v}else r=="line"&&(u=i>0?t.bottom+3:t.top-3);for(var m;m=ho(e,a,u),!!m.outside;){if(i<0?u<=0:u>=n.height){m.hitSide=!0;break}u+=i*5}return m}var De=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Je,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};De.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,Uo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(h){for(var v=h.target;v;v=v.parentNode){if(v==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}oe(n,"paste",function(h){!a(h)||We(r,h)||gs(h,r)||p<=11&&setTimeout(Ue(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),oe(n,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),oe(n,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function u(h){if(!(!a(h)||We(r,h))){if(r.somethingSelected())on({lineWise:!1,text:r.getSelections()}),h.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var v=ms(r);on({lineWise:!0,text:v.text}),h.type=="cut"&&r.operation(function(){r.setSelections(v.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var m=kt.text.join(`
`);if(h.clipboardData.setData("Text",m),h.clipboardData.getData("Text")==m){h.preventDefault();return}}var x=ys(),C=x.firstChild;Uo(C),r.display.lineSpace.insertBefore(x,r.display.lineSpace.firstChild),C.value=kt.text.join(`
`);var M=ve(ye(n));k(C),setTimeout(function(){r.display.lineSpace.removeChild(x),M.focus(),M==n&&i.showPrimarySelection()},50)}}oe(n,"copy",u),oe(n,"cut",u)},De.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=ul(this.cm,!1);return e.focus=ve(ye(this.div))==this.div,e},De.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},De.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},De.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var a=an(t,e.anchorNode,e.anchorOffset),u=an(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&u&&!u.bad&&fe(Ti(a,u),r)==0&&fe(Li(a,u),n)==0)){var h=t.display.view,v=r.line>=t.display.viewFrom&&xs(t,r)||{node:h[0].measure.map[2],offset:0},m=n.line<t.display.viewTo&&xs(t,n);if(!m){var x=h[h.length-1].measure,C=x.maps?x.maps[x.maps.length-1]:x.map;m={node:C[C.length-1],offset:C[C.length-2]-C[C.length-3]}}if(!v||!m){e.removeAllRanges();return}var M=e.rangeCount&&e.getRangeAt(0),E;try{E=W(v.node,v.offset,m.offset,m.node)}catch{}E&&(!c&&t.state.focused?(e.collapse(v.node,v.offset),E.collapsed||(e.removeAllRanges(),e.addRange(E))):(e.removeAllRanges(),e.addRange(E)),M&&e.anchorNode==null?e.addRange(M):c&&this.startGracePeriod()),this.rememberSelection()}},De.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)},De.prototype.showMultipleSelections=function(e){de(this.cm.display.cursorDiv,e.cursors),de(this.cm.display.selectionDiv,e.selection)},De.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},De.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return V(this.div,t)},De.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ve(ye(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},De.prototype.blur=function(){this.div.blur()},De.prototype.getField=function(){return this.div},De.prototype.supportsTouch=function(){return!0},De.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):ut(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function i(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,i))}this.polling.set(this.cm.options.pollInterval,i)},De.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},De.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(B&&D&&this.cm.display.gutterSpecs.length&&Wc(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var i=an(t,e.anchorNode,e.anchorOffset),r=an(t,e.focusNode,e.focusOffset);i&&r&&ut(t,function(){Ze(t.doc,Xt(i,r),rt),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},De.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=q(r.line-1,re(e.doc,r.line-1).length)),n.ch==re(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=q(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var a,u,h;r.line==t.viewFrom||(a=lr(e,r.line))==0?(u=xe(t.view[0].line),h=t.view[0].node):(u=xe(t.view[a].line),h=t.view[a-1].node.nextSibling);var v=lr(e,n.line),m,x;if(v==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=xe(t.view[v+1].line)-1,x=t.view[v+1].node.previousSibling),!h)return!1;for(var C=e.doc.splitLines(qc(e,h,x,u,m)),M=rr(e.doc,q(u,0),q(m,re(e.doc,m).text.length));C.length>1&&M.length>1;)if(me(C)==me(M))C.pop(),M.pop(),m--;else if(C[0]==M[0])C.shift(),M.shift(),u++;else break;for(var E=0,O=0,P=C[0],j=M[0],Y=Math.min(P.length,j.length);E<Y&&P.charCodeAt(E)==j.charCodeAt(E);)++E;for(var Q=me(C),Z=me(M),$=Math.min(Q.length-(C.length==1?E:0),Z.length-(M.length==1?E:0));O<$&&Q.charCodeAt(Q.length-O-1)==Z.charCodeAt(Z.length-O-1);)++O;if(C.length==1&&M.length==1&&u==r.line)for(;E&&E>r.ch&&Q.charCodeAt(Q.length-O-1)==Z.charCodeAt(Z.length-O-1);)E--,O++;C[C.length-1]=Q.slice(0,Q.length-O).replace(/^\u200b+/,""),C[0]=C[0].slice(E).replace(/\u200b+$/,"");var ne=q(u,E),ie=q(m,M.length?me(M).length-O:0);if(C.length>1||C[0]||fe(ne,ie))return Br(e.doc,C,ne,ie,"+input"),!0},De.prototype.ensurePolled=function(){this.forceCompositionEnd()},De.prototype.reset=function(){this.forceCompositionEnd()},De.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},De.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},De.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ut(this.cm,function(){return nt(e.cm)})},De.prototype.setUneditable=function(e){e.contentEditable="false"},De.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ue(this.cm,qo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},De.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},De.prototype.onContextMenu=function(){},De.prototype.resetPosition=function(){},De.prototype.needsContentAttribute=!0;function xs(e,t){var i=uo(e,t.line);if(!i||i.hidden)return null;var r=re(e.doc,t.line),n=Za(i,r,t.line),a=Bt(r,e.doc.direction),u="left";if(a){var h=Xr(a,t.ch);u=h%2?"right":"left"}var v=$a(n.map,t.ch,u);return v.offset=v.collapse=="right"?v.end:v.start,v}function Wc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Hr(e,t){return t&&(e.bad=!0),e}function qc(e,t,i,r,n){var a="",u=!1,h=e.doc.lineSeparator(),v=!1;function m(E){return function(O){return O.id==E}}function x(){u&&(a+=h,v&&(a+=h),u=v=!1)}function C(E){E&&(x(),a+=E)}function M(E){if(E.nodeType==1){var O=E.getAttribute("cm-text");if(O){C(O);return}var P=E.getAttribute("cm-marker"),j;if(P){var Y=e.findMarks(q(r,0),q(n+1,0),m(+P));Y.length&&(j=Y[0].find(0))&&C(rr(e.doc,j.from,j.to).join(h));return}if(E.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(E.nodeName);if(!/^br$/i.test(E.nodeName)&&E.textContent.length==0)return;Q&&x();for(var Z=0;Z<E.childNodes.length;Z++)M(E.childNodes[Z]);/^(pre|p)$/i.test(E.nodeName)&&(v=!0),Q&&(u=!0)}else E.nodeType==3&&C(E.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;M(t),t!=i;)t=t.nextSibling,v=!1;return a}function an(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Hr(e.clipPos(q(e.display.viewTo-1)),!0);t=null,i=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 n=0;n<e.display.view.length;n++){var a=e.display.view[n];if(a.node==r)return Uc(a,t,i)}}function Uc(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!V(r,t))return Hr(q(xe(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var a=e.rest?me(e.rest):e.line;return Hr(q(xe(a),a.text.length),n)}var u=t.nodeType==3?t:null,h=t;for(!u&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(u=t.firstChild,i&&(i=u.nodeValue.length));h.parentNode!=r;)h=h.parentNode;var v=e.measure,m=v.maps;function x(j,Y,Q){for(var Z=-1;Z<(m?m.length:0);Z++)for(var $=Z<0?v.map:m[Z],ne=0;ne<$.length;ne+=3){var ie=$[ne+2];if(ie==j||ie==Y){var pe=xe(Z<0?e.line:e.rest[Z]),we=$[ne]+Q;return(Q<0||ie!=j)&&(we=$[ne+(Q?1:0)]),q(pe,we)}}}var C=x(u,h,i);if(C)return Hr(C,n);for(var M=h.nextSibling,E=u?u.nodeValue.length-i:0;M;M=M.nextSibling){if(C=x(M,M.firstChild,0),C)return Hr(q(C.line,C.ch-E),n);E+=M.textContent.length}for(var O=h.previousSibling,P=i;O;O=O.previousSibling){if(C=x(O,O.firstChild,-1),C)return Hr(q(C.line,C.ch+P),n);P+=O.textContent.length}}var Ne=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Je,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ne.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),A&&(n.style.width="0px"),oe(n,"input",function(){d&&p>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(u){We(r,u)||gs(u,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function a(u){if(!We(r,u)){if(r.somethingSelected())on({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var h=ms(r);on({lineWise:!0,text:h.text}),u.type=="cut"?r.setSelections(h.ranges,null,rt):(i.prevInput="",n.value=h.text.join(`
`),k(n))}else return;u.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",a),oe(n,"copy",a),oe(e.scroller,"paste",function(u){if(!(zt(e,u)||We(r,u))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var h=new Event("paste");h.clipboardData=u.clipboardData,n.dispatchEvent(h)}}),oe(e.lineSpace,"selectstart",function(u){zt(e,u)||it(u)}),oe(n,"compositionstart",function(){var u=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:u,range:r.markText(u,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ne.prototype.createField=function(e){this.wrapper=ys(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Uo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ul(e);if(e.options.moveInputWithCursor){var n=wt(e,i.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+u.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+u.left-a.left))}return r},Ne.prototype.showSelection=function(e){var t=this.cm,i=t.display;de(i.cursorDiv,e.cursors),de(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ne.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&k(this.textarea),d&&p>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",d&&p>=9&&(this.hasSelection=null));this.resetting=!1}},Ne.prototype.getField=function(){return this.textarea},Ne.prototype.supportsTouch=function(){return!1},Ne.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!I||ve(ye(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ne.prototype.blur=function(){this.textarea.blur()},Ne.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ne.prototype.receivedFocus=function(){this.slowPoll()},Ne.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ne.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ne.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Wu(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(d&&p>=9&&this.hasSelection===n||R&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=n.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var u=0,h=Math.min(r.length,n.length);u<h&&r.charCodeAt(u)==n.charCodeAt(u);)++u;return ut(t,function(){qo(t,n.slice(u),r.length-u,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ne.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ne.prototype.onKeyPress=function(){d&&p>=9&&(this.hasSelection=null),this.fastPoll()},Ne.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=ar(i,e),u=r.scroller.scrollTop;if(!a||F)return;var h=i.options.resetSelectionOnContextMenu;h&&i.doc.sel.contains(a)==-1&&Ue(i,Ze)(i.doc,Xt(a),rt);var v=n.style.cssText,m=t.wrapper.style.cssText,x=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-x.top-5)+"px; left: "+(e.clientX-x.left-5)+`px;
z-index: 1000; background: `+(d?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;y&&(C=n.ownerDocument.defaultView.scrollY),r.input.focus(),y&&n.ownerDocument.defaultView.scrollTo(null,C),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=E,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function M(){if(n.selectionStart!=null){var P=i.somethingSelected(),j="\u200B"+(P?n.value:"");n.value="\u21DA",n.value=j,t.prevInput=P?"":"\u200B",n.selectionStart=1,n.selectionEnd=j.length,r.selForContextMenu=i.doc.sel}}function E(){if(t.contextMenuPending==E&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,n.style.cssText=v,d&&p<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),n.selectionStart!=null)){(!d||d&&p<9)&&M();var P=0,j=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Ue(i,Pl)(i):P++<10?r.detectingSelectAll=setTimeout(j,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(j,200)}}if(d&&p>=9&&M(),ge){Yr(e);var O=function(){ht(window,"mouseup",O),setTimeout(E,20)};oe(window,"mouseup",O)}else setTimeout(E,50)},Ne.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ne.prototype.setUneditable=function(){},Ne.prototype.needsContentAttribute=!1;function jc(e,t){if(t=t?dt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ve(ye(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=h.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;n=a.submit;try{var u=a.submit=function(){r(),a.submit=n,a.submit(),a.submit=u}}catch{}}t.finishInit=function(v){v.save=r,v.getTextArea=function(){return e},v.toTextArea=function(){v.toTextArea=isNaN,r(),e.parentNode.removeChild(v.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var h=Ee(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return h}function Gc(e){e.off=ht,e.on=oe,e.wheelEventPixels=$f,e.Doc=ot,e.splitLines=jn,e.countColumn=Re,e.findColumn=Ft,e.isWordChar=Hn,e.Pass=Pe,e.signal=Ie,e.Line=Dr,e.changeEnd=Yt,e.scrollbarModel=gl,e.Pos=q,e.cmpPos=fe,e.modes=Kn,e.mimeModes=br,e.resolveMode=Ai,e.getMode=Xn,e.modeExtensions=xr,e.extendMode=Ku,e.copyState=tr,e.startState=Da,e.innerMode=Yn,e.commands=yi,e.keyMap=Ht,e.keyName=ts,e.isModifierKey=Vl,e.lookupKey=Ir,e.normalizeKeyMap=xc,e.StringStream=ze,e.SharedTextMarker=gi,e.TextMarker=Qt,e.LineWidget=pi,e.e_preventDefault=it,e.e_stopPropagation=ba,e.e_stop=Yr,e.addClass=Te,e.contains=V,e.rmClass=ue,e.keyNames=Jt}Oc(Ee),_c(Ee);var Kc="iter insert remove copy getEditor constructor".split(" ");for(var ln in ot.prototype)ot.prototype.hasOwnProperty(ln)&&Fe(Kc,ln)<0&&(Ee.prototype[ln]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[ln]));return yr(ot),Ee.inputStyles={textarea:Ne,contenteditable:De},Ee.defineMode=function(e){!Ee.defaults.mode&&e!="null"&&(Ee.defaults.mode=e),ju.apply(this,arguments)},Ee.defineMIME=Gu,Ee.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ee.defineMIME("text/plain","null"),Ee.defineExtension=function(e,t){Ee.prototype[e]=t},Ee.defineDocExtension=function(e,t){ot.prototype[e]=t},Ee.fromTextArea=jc,Gc(Ee),Ee.version="5.65.21",Ee})});var ks=Ye((ws,Cs)=>{(function(o){typeof ws=="object"&&typeof Cs=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var f=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,l=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(g){if(g.getOption("disableInput"))return o.Pass;for(var d=g.listSelections(),p=[],y=0;y<d.length;y++){var w=d[y].head,D=g.getStateAfter(w.line),S=o.innerMode(g.getMode(),D);if(S.mode.name!=="markdown"&&S.mode.helperType!=="markdown"){g.execCommand("newlineAndIndent");return}else D=S.state;var F=D.list!==!1,T=D.quote!==0,z=g.getLine(w.line),N=f.exec(z),A=/^\s*$/.test(z.slice(0,w.ch));if(!d[y].empty()||!F&&!T||!N||A){g.execCommand("newlineAndIndent");return}if(c.test(z)){var B=T&&/>\s*$/.test(z),I=!/>\s*$/.test(z);(B||I)&&g.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),p[y]=`
`}else{var R=N[1],H=N[5],_=!(l.test(N[2])||N[2].indexOf(">")>=0),X=_?parseInt(N[3],10)+1+N[4]:N[2].replace("x"," ");p[y]=`
`+R+X+H,_&&s(g,w)}}g.replaceSelections(p)};function s(g,d){var p=d.line,y=0,w=0,D=f.exec(g.getLine(p)),S=D[1];do{y+=1;var F=p+y,T=g.getLine(F),z=f.exec(T);if(z){var N=z[1],A=parseInt(D[3],10)+y-w,B=parseInt(z[3],10),I=B;if(S===N&&!isNaN(B))A===B&&(I=B+1),A>B&&(I=A+1),g.replaceRange(T.replace(f,N+I+z[4]+z[5]),{line:F,ch:0},{line:F,ch:T.length});else{if(S.length>N.length||S.length<N.length&&y===1)return;w+=1}}}while(z)}})});var Fs=Ye(()=>{var Ss=ct();Ss.commands.tabAndIndentMarkdownList=function(o){var f=o.listSelections(),c=f[0].head,l=o.getStateAfter(c.line),s=l.list!==!1;if(s){o.execCommand("indentMore");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var g=Array(o.options.tabSize+1).join(" ");o.replaceSelection(g)}};Ss.commands.shiftTabAndUnindentMarkdownList=function(o){var f=o.listSelections(),c=f[0].head,l=o.getStateAfter(c.line),s=l.list!==!1;if(s){o.execCommand("indentLess");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var g=Array(o.options.tabSize+1).join(" ");o.replaceSelection(g)}}});var Ls=Ye((Es,As)=>{(function(o){typeof Es=="object"&&typeof As=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("fullScreen",!1,function(l,s,g){g==o.Init&&(g=!1),!g!=!s&&(s?f(l):c(l))});function f(l){var s=l.getWrapperElement();l.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:s.style.width,height:s.style.height},s.style.width="",s.style.height="auto",s.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",l.refresh()}function c(l){var s=l.getWrapperElement();s.className=s.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var g=l.state.fullScreenRestore;s.style.width=g.width,s.style.height=g.height,window.scrollTo(g.scrollLeft,g.scrollTop),l.refresh()}})});var Zo=Ye((Ts,Ms)=>{(function(o){typeof Ts=="object"&&typeof Ms=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var f={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},c={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};o.defineMode("xml",function(l,s){var g=l.indentUnit,d={},p=s.htmlMode?f:c;for(var y in p)d[y]=p[y];for(var y in s)d[y]=s[y];var w,D;function S(L,U){function W(Te){return U.tokenize=Te,Te(L,U)}var V=L.next();if(V=="<")return L.eat("!")?L.eat("[")?L.match("CDATA[")?W(z("atom","]]>")):null:L.match("--")?W(z("comment","-->")):L.match("DOCTYPE",!0,!0)?(L.eatWhile(/[\w\._\-]/),W(N(1))):null:L.eat("?")?(L.eatWhile(/[\w\._\-]/),U.tokenize=z("meta","?>"),"meta"):(w=L.eat("/")?"closeTag":"openTag",U.tokenize=F,"tag bracket");if(V=="&"){var ve;return L.eat("#")?L.eat("x")?ve=L.eatWhile(/[a-fA-F\d]/)&&L.eat(";"):ve=L.eatWhile(/[\d]/)&&L.eat(";"):ve=L.eatWhile(/[\w\.\-:]/)&&L.eat(";"),ve?"atom":"error"}else return L.eatWhile(/[^&<]/),null}S.isInText=!0;function F(L,U){var W=L.next();if(W==">"||W=="/"&&L.eat(">"))return U.tokenize=S,w=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return w="equals",null;if(W=="<"){U.tokenize=S,U.state=H,U.tagName=U.tagStart=null;var V=U.tokenize(L,U);return V?V+" tag error":"tag error"}else return/[\'\"]/.test(W)?(U.tokenize=T(W),U.stringStartCol=L.column(),U.tokenize(L,U)):(L.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function T(L){var U=function(W,V){for(;!W.eol();)if(W.next()==L){V.tokenize=F;break}return"string"};return U.isInAttribute=!0,U}function z(L,U){return function(W,V){for(;!W.eol();){if(W.match(U)){V.tokenize=S;break}W.next()}return L}}function N(L){return function(U,W){for(var V;(V=U.next())!=null;){if(V=="<")return W.tokenize=N(L+1),W.tokenize(U,W);if(V==">")if(L==1){W.tokenize=S;break}else return W.tokenize=N(L-1),W.tokenize(U,W)}return"meta"}}function A(L){return L&&L.toLowerCase()}function B(L,U,W){this.prev=L.context,this.tagName=U||"",this.indent=L.indented,this.startOfLine=W,(d.doNotIndent.hasOwnProperty(U)||L.context&&L.context.noIndent)&&(this.noIndent=!0)}function I(L){L.context&&(L.context=L.context.prev)}function R(L,U){for(var W;;){if(!L.context||(W=L.context.tagName,!d.contextGrabbers.hasOwnProperty(A(W))||!d.contextGrabbers[A(W)].hasOwnProperty(A(U))))return;I(L)}}function H(L,U,W){return L=="openTag"?(W.tagStart=U.column(),_):L=="closeTag"?X:H}function _(L,U,W){return L=="word"?(W.tagName=U.current(),D="tag",G):d.allowMissingTagName&&L=="endTag"?(D="tag bracket",G(L,U,W)):(D="error",_)}function X(L,U,W){if(L=="word"){var V=U.current();return W.context&&W.context.tagName!=V&&d.implicitlyClosed.hasOwnProperty(A(W.context.tagName))&&I(W),W.context&&W.context.tagName==V||d.matchClosing===!1?(D="tag",K):(D="tag error",ge)}else return d.allowMissingTagName&&L=="endTag"?(D="tag bracket",K(L,U,W)):(D="error",ge)}function K(L,U,W){return L!="endTag"?(D="error",K):(I(W),H)}function ge(L,U,W){return D="error",K(L,U,W)}function G(L,U,W){if(L=="word")return D="attribute",ue;if(L=="endTag"||L=="selfcloseTag"){var V=W.tagName,ve=W.tagStart;return W.tagName=W.tagStart=null,L=="selfcloseTag"||d.autoSelfClosers.hasOwnProperty(A(V))?R(W,V):(R(W,V),W.context=new B(W,V,ve==W.indented)),H}return D="error",G}function ue(L,U,W){return L=="equals"?ae:(d.allowMissing||(D="error"),G(L,U,W))}function ae(L,U,W){return L=="string"?de:L=="word"&&d.allowUnquoted?(D="string",G):(D="error",G(L,U,W))}function de(L,U,W){return L=="string"?de:G(L,U,W)}return{startState:function(L){var U={tokenize:S,state:H,indented:L||0,tagName:null,tagStart:null,context:null};return L!=null&&(U.baseIndent=L),U},token:function(L,U){if(!U.tagName&&L.sol()&&(U.indented=L.indentation()),L.eatSpace())return null;w=null;var W=U.tokenize(L,U);return(W||w)&&W!="comment"&&(D=null,U.state=U.state(w||W,L,U),D&&(W=D=="error"?W+" error":D)),W},indent:function(L,U,W){var V=L.context;if(L.tokenize.isInAttribute)return L.tagStart==L.indented?L.stringStartCol+1:L.indented+g;if(V&&V.noIndent)return o.Pass;if(L.tokenize!=F&&L.tokenize!=S)return W?W.match(/^(\s*)/)[0].length:0;if(L.tagName)return d.multilineTagIndentPastTag!==!1?L.tagStart+L.tagName.length+2:L.tagStart+g*(d.multilineTagIndentFactor||1);if(d.alignCDATA&&/<!\[CDATA\[/.test(U))return 0;var ve=U&&/^<(\/)?([\w_:\.-]*)/.exec(U);if(ve&&ve[1])for(;V;)if(V.tagName==ve[2]){V=V.prev;break}else if(d.implicitlyClosed.hasOwnProperty(A(V.tagName)))V=V.prev;else break;else if(ve)for(;V;){var Te=d.contextGrabbers[A(V.tagName)];if(Te&&Te.hasOwnProperty(A(ve[2])))V=V.prev;else break}for(;V&&V.prev&&!V.startOfLine;)V=V.prev;return V?V.indent+g:L.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:d.htmlMode?"html":"xml",helperType:d.htmlMode?"html":"xml",skipAttribute:function(L){L.state==ae&&(L.state=G)},xmlCurrentTag:function(L){return L.tagName?{name:L.tagName,close:L.type=="closeTag"}:null},xmlCurrentContext:function(L){for(var U=[],W=L.context;W;W=W.prev)U.push(W.tagName);return U.reverse()}}}),o.defineMIME("text/xml","xml"),o.defineMIME("application/xml","xml"),o.mimeModes.hasOwnProperty("text/html")||o.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Is=Ye((Bs,Ns)=>{(function(o){typeof Bs=="object"&&typeof Ns=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.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","cbl"]},{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"],alias:["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 f=0;f<o.modeInfo.length;f++){var c=o.modeInfo[f];c.mimes&&(c.mime=c.mimes[0])}o.findModeByMIME=function(l){l=l.toLowerCase();for(var s=0;s<o.modeInfo.length;s++){var g=o.modeInfo[s];if(g.mime==l)return g;if(g.mimes){for(var d=0;d<g.mimes.length;d++)if(g.mimes[d]==l)return g}}if(/\+xml$/.test(l))return o.findModeByMIME("application/xml");if(/\+json$/.test(l))return o.findModeByMIME("application/json")},o.findModeByExtension=function(l){l=l.toLowerCase();for(var s=0;s<o.modeInfo.length;s++){var g=o.modeInfo[s];if(g.ext){for(var d=0;d<g.ext.length;d++)if(g.ext[d]==l)return g}}},o.findModeByFileName=function(l){for(var s=0;s<o.modeInfo.length;s++){var g=o.modeInfo[s];if(g.file&&g.file.test(l))return g}var d=l.lastIndexOf("."),p=d>-1&&l.substring(d+1,l.length);if(p)return o.findModeByExtension(p)},o.findModeByName=function(l){l=l.toLowerCase();for(var s=0;s<o.modeInfo.length;s++){var g=o.modeInfo[s];if(g.name.toLowerCase()==l)return g;if(g.alias){for(var d=0;d<g.alias.length;d++)if(g.alias[d].toLowerCase()==l)return g}}}})});var Qo=Ye((zs,Os)=>{(function(o){typeof zs=="object"&&typeof Os=="object"?o(ct(),Zo(),Is()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("markdown",function(f,c){var l=o.getMode(f,"text/html"),s=l.name=="null";function g(k){if(o.findModeByName){var b=o.findModeByName(k);b&&(k=b.mime||b.mimes[0])}var ee=o.getMode(f,k);return ee.name=="null"?null:ee}c.highlightFormatting===void 0&&(c.highlightFormatting=!1),c.maxBlockquoteDepth===void 0&&(c.maxBlockquoteDepth=0),c.taskLists===void 0&&(c.taskLists=!1),c.strikethrough===void 0&&(c.strikethrough=!1),c.emoji===void 0&&(c.emoji=!1),c.fencedCodeBlockHighlighting===void 0&&(c.fencedCodeBlockHighlighting=!0),c.fencedCodeBlockDefaultMode===void 0&&(c.fencedCodeBlockDefaultMode="text/plain"),c.xml===void 0&&(c.xml=!0),c.tokenTypeOverrides===void 0&&(c.tokenTypeOverrides={});var d={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 p in d)d.hasOwnProperty(p)&&c.tokenTypeOverrides[p]&&(d[p]=c.tokenTypeOverrides[p]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,S=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,F=/^ {0,3}(?:\={1,}|-{2,})\s*$/,T=/^[^#!\[\]*_\\<>` "'(~:]+/,z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,N=/^\s*\[[^\]]+?\]:.*$/,A=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,B=" ";function I(k,b,ee){return b.f=b.inline=ee,ee(k,b)}function R(k,b,ee){return b.f=b.block=ee,ee(k,b)}function H(k){return!k||!/\S/.test(k.string)}function _(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==K){var b=s;if(!b){var ee=o.innerMode(l,k.htmlState);b=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}b&&(k.f=ae,k.block=X,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function X(k,b){var ee=k.column()===b.indentation,ye=H(b.prevLine.stream),he=b.indentedCode,tt=b.prevLine.hr,dt=b.list!==!1,Re=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Je=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,dt)){for(b.list=null;Je<b.listStack[b.listStack.length-1];)b.listStack.pop(),b.listStack.length?b.indentation=b.listStack[b.listStack.length-1]:b.list=!1;b.list!==!1&&(b.indentationDiff=Je-b.listStack[b.listStack.length-1])}var Fe=!ye&&!tt&&!b.prevLine.header&&(!dt||!he)&&!b.prevLine.fencedCodeEnd,Me=(b.list===!1||tt||ye)&&b.indentation<=Re&&k.match(y),Pe=null;if(b.indentationDiff>=4&&(he||b.prevLine.fencedCodeEnd||b.prevLine.header||ye))return k.skipToEnd(),b.indentedCode=!0,d.code;if(k.eatSpace())return null;if(ee&&b.indentation<=Re&&(Pe=k.match(S))&&Pe[1].length<=6)return b.quote=0,b.header=Pe[1].length,b.thisLine.header=!0,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,G(b);if(b.indentation<=Re&&k.eat(">"))return b.quote=ee?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),k.eatSpace(),G(b);if(!Me&&!b.setext&&ee&&b.indentation<=Re&&(Pe=k.match(w))){var rt=Pe[1]?"ol":"ul";return b.indentation=Je+k.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,c.taskLists&&k.match(D,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+rt]),G(b)}else{if(ee&&b.indentation<=Re&&(Pe=k.match(z,!0)))return b.quote=0,b.fencedEndRE=new RegExp(Pe[1]+"+ *$"),b.localMode=c.fencedCodeBlockHighlighting&&g(Pe[2]||c.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=o.startState(b.localMode)),b.f=b.block=ge,c.highlightFormatting&&(b.formatting="code-block"),b.code=-1,G(b);if(b.setext||(!Fe||!dt)&&!b.quote&&b.list===!1&&!b.code&&!Me&&!N.test(k.string)&&(Pe=k.lookAhead(1))&&(Pe=Pe.match(F)))return b.setext?(b.header=b.setext,b.setext=0,k.skipToEnd(),c.highlightFormatting&&(b.formatting="header")):(b.header=Pe[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,G(b);if(Me)return k.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,d.hr;if(k.peek()==="[")return I(k,b,V)}return I(k,b,b.inline)}function K(k,b){var ee=l.token(k,b.htmlState);if(!s){var ye=o.innerMode(l,b.htmlState);(ye.mode.name=="xml"&&ye.state.tagStart===null&&!ye.state.context&&ye.state.tokenize.isInText||b.md_inside&&k.current().indexOf(">")>-1)&&(b.f=ae,b.block=X,b.htmlState=null)}return ee}function ge(k,b){var ee=b.listStack[b.listStack.length-1]||0,ye=b.indentation<ee,he=ee+3;if(b.fencedEndRE&&b.indentation<=he&&(ye||k.match(b.fencedEndRE))){c.highlightFormatting&&(b.formatting="code-block");var tt;return ye||(tt=G(b)),b.localMode=b.localState=null,b.block=X,b.f=ae,b.fencedEndRE=null,b.code=0,b.thisLine.fencedCodeEnd=!0,ye?R(k,b,b.block):tt}else return b.localMode?b.localMode.token(k,b.localState):(k.skipToEnd(),d.code)}function G(k){var b=[];if(k.formatting){b.push(d.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var ee=0;ee<k.formatting.length;ee++)b.push(d.formatting+"-"+k.formatting[ee]),k.formatting[ee]==="header"&&b.push(d.formatting+"-"+k.formatting[ee]+"-"+k.header),k.formatting[ee]==="quote"&&(!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=k.quote?b.push(d.formatting+"-"+k.formatting[ee]+"-"+k.quote):b.push("error"))}if(k.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(k.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(k.linkHref?b.push(d.linkHref,"url"):(k.strong&&b.push(d.strong),k.em&&b.push(d.em),k.strikethrough&&b.push(d.strikethrough),k.emoji&&b.push(d.emoji),k.linkText&&b.push(d.linkText),k.code&&b.push(d.code),k.image&&b.push(d.image),k.imageAltText&&b.push(d.imageAltText,"link"),k.imageMarker&&b.push(d.imageMarker)),k.header&&b.push(d.header,d.header+"-"+k.header),k.quote&&(b.push(d.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=k.quote?b.push(d.quote+"-"+k.quote):b.push(d.quote+"-"+c.maxBlockquoteDepth)),k.list!==!1){var ye=(k.listStack.length-1)%3;ye?ye===1?b.push(d.list2):b.push(d.list3):b.push(d.list1)}return k.trailingSpaceNewLine?b.push("trailing-space-new-line"):k.trailingSpace&&b.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function ue(k,b){if(k.match(T,!0))return G(b)}function ae(k,b){var ee=b.text(k,b);if(typeof ee<"u")return ee;if(b.list)return b.list=null,G(b);if(b.taskList){var ye=k.match(D,!0)[1]===" ";return ye?b.taskOpen=!0:b.taskClosed=!0,c.highlightFormatting&&(b.formatting="task"),b.taskList=!1,G(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&k.match(/^#+$/,!0))return c.highlightFormatting&&(b.formatting="header"),G(b);var he=k.next();if(b.linkTitle){b.linkTitle=!1;var tt=he;he==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dt="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(k.match(new RegExp(dt),!0))return d.linkHref}if(he==="`"){var Re=b.formatting;c.highlightFormatting&&(b.formatting="code"),k.eatWhile("`");var Je=k.current().length;if(b.code==0&&(!b.quote||Je==1))return b.code=Je,G(b);if(Je==b.code){var Fe=G(b);return b.code=0,Fe}else return b.formatting=Re,G(b)}else if(b.code)return G(b);if(he==="\\"&&(k.next(),c.highlightFormatting)){var Me=G(b),Pe=d.formatting+"-escape";return Me?Me+" "+Pe:Pe}if(he==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="["&&b.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="]"&&b.imageAltText){c.highlightFormatting&&(b.formatting="image");var Me=G(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=L,Me}if(he==="["&&!b.image)return b.linkText&&k.match(/^.*?\]/)||(b.linkText=!0,c.highlightFormatting&&(b.formatting="link")),G(b);if(he==="]"&&b.linkText){c.highlightFormatting&&(b.formatting="link");var Me=G(b);return b.linkText=!1,b.inline=b.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?L:ae,Me}if(he==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+d.linkInline}if(he==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+d.linkEmail}if(c.xml&&he==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var rt=k.string.indexOf(">",k.pos);if(rt!=-1){var jr=k.string.substring(k.start,rt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(jr)&&(b.md_inside=!0)}return k.backUp(1),b.htmlState=o.startState(l),R(k,b,K)}if(c.xml&&he==="<"&&k.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var St=1,Ft=k.pos==1?" ":k.string.charAt(k.pos-2);St<3&&k.eat(he);)St++;var bt=k.peek()||" ",qt=!/\s/.test(bt)&&(!A.test(bt)||/\s/.test(Ft)||A.test(Ft)),me=!/\s/.test(Ft)&&(!A.test(Ft)||/\s/.test(bt)||A.test(bt)),xt=null,Ut=null;if(St%2&&(!b.em&&qt&&(he==="*"||!me||A.test(Ft))?xt=!0:b.em==he&&me&&(he==="*"||!qt||A.test(bt))&&(xt=!1)),St>1&&(!b.strong&&qt&&(he==="*"||!me||A.test(Ft))?Ut=!0:b.strong==he&&me&&(he==="*"||!qt||A.test(bt))&&(Ut=!1)),Ut!=null||xt!=null){c.highlightFormatting&&(b.formatting=xt==null?"strong":Ut==null?"em":"strong em"),xt===!0&&(b.em=he),Ut===!0&&(b.strong=he);var Fe=G(b);return xt===!1&&(b.em=!1),Ut===!1&&(b.strong=!1),Fe}}else if(he===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return G(b);k.backUp(1)}if(c.strikethrough){if(he==="~"&&k.eatWhile(he)){if(b.strikethrough){c.highlightFormatting&&(b.formatting="strikethrough");var Fe=G(b);return b.strikethrough=!1,Fe}else if(k.match(/^[^\s]/,!1))return b.strikethrough=!0,c.highlightFormatting&&(b.formatting="strikethrough"),G(b)}else if(he===" "&&k.match("~~",!0)){if(k.peek()===" ")return G(b);k.backUp(2)}}if(c.emoji&&he===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,c.highlightFormatting&&(b.formatting="emoji");var Fi=G(b);return b.emoji=!1,Fi}return he===" "&&(k.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),G(b)}function de(k,b){var ee=k.next();if(ee===">"){b.f=b.inline=ae,c.highlightFormatting&&(b.formatting="link");var ye=G(b);return ye?ye+=" ":ye="",ye+d.linkInline}return k.match(/^[^>]+/,!0),d.linkInline}function L(k,b){if(k.eatSpace())return null;var ee=k.next();return ee==="("||ee==="["?(b.f=b.inline=W(ee==="("?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,G(b)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(k){return function(b,ee){var ye=b.next();if(ye===k){ee.f=ee.inline=ae,c.highlightFormatting&&(ee.formatting="link-string");var he=G(ee);return ee.linkHref=!1,he}return b.match(U[k]),ee.linkHref=!0,G(ee)}}function V(k,b){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=ve,k.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,G(b)):I(k,b,ae)}function ve(k,b){if(k.match("]:",!0)){b.f=b.inline=Te,c.highlightFormatting&&(b.formatting="link");var ee=G(b);return b.linkText=!1,ee}return k.match(/^([^\]\\]|\\.)+/,!0),d.linkText}function Te(k,b){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?b.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),b.f=b.inline=ae,d.linkHref+" url")}var mt={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:ae,text:ue,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(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&o.copyState(l,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?o.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,b){if(b.formatting=!1,k!=b.thisLine.stream){if(b.header=0,b.hr=!1,k.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:k},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=K)){var ee=k.match(/^\s*/,!0)[0].replace(/\t/g,B).length;if(b.indentation=ee,b.indentationDiff=null,ee>0)return null}}return b.f(k,b)},innerMode:function(k){return k.block==K?{state:k.htmlState,mode:l}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:mt}},indent:function(k,b,ee){return k.block==K&&l.indent?l.indent(k.htmlState,b,ee):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,b,ee):o.Pass},blankLine:_,getType:G,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return mt},"xml"),o.defineMIME("text/markdown","markdown"),o.defineMIME("text/x-markdown","markdown")})});var Jo=Ye((Hs,Rs)=>{(function(o){typeof Hs=="object"&&typeof Rs=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(f,c,l){return{startState:function(){return{base:o.startState(f),overlay:o.startState(c),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(s){return{base:o.copyState(f,s.base),overlay:o.copyState(c,s.overlay),basePos:s.basePos,baseCur:null,overlayPos:s.overlayPos,overlayCur:null}},token:function(s,g){return(s!=g.streamSeen||Math.min(g.basePos,g.overlayPos)<s.start)&&(g.streamSeen=s,g.basePos=g.overlayPos=s.start),s.start==g.basePos&&(g.baseCur=f.token(s,g.base),g.basePos=s.pos),s.start==g.overlayPos&&(s.pos=s.start,g.overlayCur=c.token(s,g.overlay),g.overlayPos=s.pos),s.pos=Math.min(g.basePos,g.overlayPos),g.overlayCur==null?g.baseCur:g.baseCur!=null&&g.overlay.combineTokens||l&&g.overlay.combineTokens==null?g.baseCur+" "+g.overlayCur:g.overlayCur},indent:f.indent&&function(s,g,d){return f.indent(s.base,g,d)},electricChars:f.electricChars,innerMode:function(s){return{state:s.base,mode:f}},blankLine:function(s){var g,d;return f.blankLine&&(g=f.blankLine(s.base)),c.blankLine&&(d=c.blankLine(s.overlay)),d==null?g:l&&g!=null?g+" "+d:d}}}})});var Ws=Ye((Ps,_s)=>{(function(o){typeof Ps=="object"&&typeof _s=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(p,y,w){var D=w&&w!=o.Init;if(y&&!D)p.on("blur",s),p.on("change",g),p.on("swapDoc",g),o.on(p.getInputField(),"compositionupdate",p.state.placeholderCompose=function(){l(p)}),g(p);else if(!y&&D){p.off("blur",s),p.off("change",g),p.off("swapDoc",g),o.off(p.getInputField(),"compositionupdate",p.state.placeholderCompose),f(p);var S=p.getWrapperElement();S.className=S.className.replace(" CodeMirror-empty","")}y&&!p.hasFocus()&&s(p)});function f(p){p.state.placeholder&&(p.state.placeholder.parentNode.removeChild(p.state.placeholder),p.state.placeholder=null)}function c(p){f(p);var y=p.state.placeholder=document.createElement("pre");y.style.cssText="height: 0; overflow: visible",y.style.direction=p.getOption("direction"),y.className="CodeMirror-placeholder CodeMirror-line-like";var w=p.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),y.appendChild(w),p.display.lineSpace.insertBefore(y,p.display.lineSpace.firstChild)}function l(p){setTimeout(function(){var y=!1;if(p.lineCount()==1){var w=p.getInputField();y=w.nodeName=="TEXTAREA"?!p.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}y?c(p):f(p)},20)}function s(p){d(p)&&c(p)}function g(p){var y=p.getWrapperElement(),w=d(p);y.className=y.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?c(p):f(p)}function d(p){return p.lineCount()===1&&p.getLine(0)===""}})});var js=Ye((qs,Us)=>{(function(o){typeof qs=="object"&&typeof Us=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("autoRefresh",!1,function(l,s){l.state.autoRefresh&&(c(l,l.state.autoRefresh),l.state.autoRefresh=null),s&&l.display.wrapper.offsetHeight==0&&f(l,l.state.autoRefresh={delay:s.delay||250})});function f(l,s){function g(){l.display.wrapper.offsetHeight?(c(l,s),l.display.lastWrapHeight!=l.display.wrapper.clientHeight&&l.refresh()):s.timeout=setTimeout(g,s.delay)}s.timeout=setTimeout(g,s.delay),s.hurry=function(){clearTimeout(s.timeout),s.timeout=setTimeout(g,50)},o.on(window,"mouseup",s.hurry),o.on(window,"keyup",s.hurry)}function c(l,s){clearTimeout(s.timeout),o.off(window,"mouseup",s.hurry),o.off(window,"keyup",s.hurry)}})});var Xs=Ye((Gs,Ks)=>{(function(o){typeof Gs=="object"&&typeof Ks=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(D,S,F){var T=F&&F!=o.Init;S&&!T?(D.state.markedSelection=[],D.state.markedSelectionStyle=typeof S=="string"?S:"CodeMirror-selectedtext",y(D),D.on("cursorActivity",f),D.on("change",c)):!S&&T&&(D.off("cursorActivity",f),D.off("change",c),p(D),D.state.markedSelection=D.state.markedSelectionStyle=null)});function f(D){D.state.markedSelection&&D.operation(function(){w(D)})}function c(D){D.state.markedSelection&&D.state.markedSelection.length&&D.operation(function(){p(D)})}var l=8,s=o.Pos,g=o.cmpPos;function d(D,S,F,T){if(g(S,F)!=0)for(var z=D.state.markedSelection,N=D.state.markedSelectionStyle,A=S.line;;){var B=A==S.line?S:s(A,0),I=A+l,R=I>=F.line,H=R?F:s(I,0),_=D.markText(B,H,{className:N});if(T==null?z.push(_):z.splice(T++,0,_),R)break;A=I}}function p(D){for(var S=D.state.markedSelection,F=0;F<S.length;++F)S[F].clear();S.length=0}function y(D){p(D);for(var S=D.listSelections(),F=0;F<S.length;F++)d(D,S[F].from(),S[F].to())}function w(D){if(!D.somethingSelected())return p(D);if(D.listSelections().length>1)return y(D);var S=D.getCursor("start"),F=D.getCursor("end"),T=D.state.markedSelection;if(!T.length)return d(D,S,F);var z=T[0].find(),N=T[T.length-1].find();if(!z||!N||F.line-S.line<=l||g(S,N.to)>=0||g(F,z.from)<=0)return y(D);for(;g(S,z.from)>0;)T.shift().clear(),z=T[0].find();for(g(S,z.from)<0&&(z.to.line-S.line<l?(T.shift().clear(),d(D,S,z.to,0)):d(D,S,z.from,0));g(F,N.to)<0;)T.pop().clear(),N=T[T.length-1].find();g(F,N.to)>0&&(F.line-N.from.line<l?(T.pop().clear(),d(D,N.from,F)):d(D,N.to,F))}})});var Qs=Ye((Ys,Zs)=>{(function(o){typeof Ys=="object"&&typeof Zs=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var f=o.Pos;function c(A){var B=A.flags;return B??(A.ignoreCase?"i":"")+(A.global?"g":"")+(A.multiline?"m":"")}function l(A,B){for(var I=c(A),R=I,H=0;H<B.length;H++)R.indexOf(B.charAt(H))==-1&&(R+=B.charAt(H));return I==R?A:new RegExp(A.source,R)}function s(A){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(A.source)}function g(A,B,I){B=l(B,"g");for(var R=I.line,H=I.ch,_=A.lastLine();R<=_;R++,H=0){B.lastIndex=H;var X=A.getLine(R),K=B.exec(X);if(K)return{from:f(R,K.index),to:f(R,K.index+K[0].length),match:K}}}function d(A,B,I){if(!s(B))return g(A,B,I);B=l(B,"gm");for(var R,H=1,_=I.line,X=A.lastLine();_<=X;){for(var K=0;K<H&&!(_>X);K++){var ge=A.getLine(_++);R=R==null?ge:R+`
`+ge}H=H*2,B.lastIndex=I.ch;var G=B.exec(R);if(G){var ue=R.slice(0,G.index).split(`
`),ae=G[0].split(`
`),de=I.line+ue.length-1,L=ue[ue.length-1].length;return{from:f(de,L),to:f(de+ae.length-1,ae.length==1?L+ae[0].length:ae[ae.length-1].length),match:G}}}}function p(A,B,I){for(var R,H=0;H<=A.length;){B.lastIndex=H;var _=B.exec(A);if(!_)break;var X=_.index+_[0].length;if(X>A.length-I)break;(!R||X>R.index+R[0].length)&&(R=_),H=_.index+1}return R}function y(A,B,I){B=l(B,"g");for(var R=I.line,H=I.ch,_=A.firstLine();R>=_;R--,H=-1){var X=A.getLine(R),K=p(X,B,H<0?0:X.length-H);if(K)return{from:f(R,K.index),to:f(R,K.index+K[0].length),match:K}}}function w(A,B,I){if(!s(B))return y(A,B,I);B=l(B,"gm");for(var R,H=1,_=A.getLine(I.line).length-I.ch,X=I.line,K=A.firstLine();X>=K;){for(var ge=0;ge<H&&X>=K;ge++){var G=A.getLine(X--);R=R==null?G:G+`
`+R}H*=2;var ue=p(R,B,_);if(ue){var ae=R.slice(0,ue.index).split(`
`),de=ue[0].split(`
`),L=X+ae.length,U=ae[ae.length-1].length;return{from:f(L,U),to:f(L+de.length-1,de.length==1?U+de[0].length:de[de.length-1].length),match:ue}}}}var D,S;String.prototype.normalize?(D=function(A){return A.normalize("NFD").toLowerCase()},S=function(A){return A.normalize("NFD")}):(D=function(A){return A.toLowerCase()},S=function(A){return A});function F(A,B,I,R){if(A.length==B.length)return I;for(var H=0,_=I+Math.max(0,A.length-B.length);;){if(H==_)return H;var X=H+_>>1,K=R(A.slice(0,X)).length;if(K==I)return X;K>I?_=X:H=X+1}}function T(A,B,I,R){if(!B.length)return null;var H=R?D:S,_=H(B).split(/\r|\n\r?/);e:for(var X=I.line,K=I.ch,ge=A.lastLine()+1-_.length;X<=ge;X++,K=0){var G=A.getLine(X).slice(K),ue=H(G);if(_.length==1){var ae=ue.indexOf(_[0]);if(ae==-1)continue e;var I=F(G,ue,ae,H)+K;return{from:f(X,F(G,ue,ae,H)+K),to:f(X,F(G,ue,ae+_[0].length,H)+K)}}else{var de=ue.length-_[0].length;if(ue.slice(de)!=_[0])continue e;for(var L=1;L<_.length-1;L++)if(H(A.getLine(X+L))!=_[L])continue e;var U=A.getLine(X+_.length-1),W=H(U),V=_[_.length-1];if(W.slice(0,V.length)!=V)continue e;return{from:f(X,F(G,ue,de,H)+K),to:f(X+_.length-1,F(U,W,V.length,H))}}}}function z(A,B,I,R){if(!B.length)return null;var H=R?D:S,_=H(B).split(/\r|\n\r?/);e:for(var X=I.line,K=I.ch,ge=A.firstLine()-1+_.length;X>=ge;X--,K=-1){var G=A.getLine(X);K>-1&&(G=G.slice(0,K));var ue=H(G);if(_.length==1){var ae=ue.lastIndexOf(_[0]);if(ae==-1)continue e;return{from:f(X,F(G,ue,ae,H)),to:f(X,F(G,ue,ae+_[0].length,H))}}else{var de=_[_.length-1];if(ue.slice(0,de.length)!=de)continue e;for(var L=1,I=X-_.length+1;L<_.length-1;L++)if(H(A.getLine(I+L))!=_[L])continue e;var U=A.getLine(X+1-_.length),W=H(U);if(W.slice(W.length-_[0].length)!=_[0])continue e;return{from:f(X+1-_.length,F(U,W,U.length-_[0].length,H)),to:f(X,F(G,ue,de.length,H))}}}}function N(A,B,I,R){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=A,I=I?A.clipPos(I):f(0,0),this.pos={from:I,to:I};var H;typeof R=="object"?H=R.caseFold:(H=R,R=null),typeof B=="string"?(H==null&&(H=!1),this.matches=function(_,X){return(_?z:T)(A,B,X,H)}):(B=l(B,"gm"),!R||R.multiline!==!1?this.matches=function(_,X){return(_?w:d)(A,B,X)}:this.matches=function(_,X){return(_?y:g)(A,B,X)})}N.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(A){var B=this.doc.clipPos(A?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(B=f(B.line,B.ch),A?(B.ch--,B.ch<0&&(B.line--,B.ch=(this.doc.getLine(B.line)||"").length)):(B.ch++,B.ch>(this.doc.getLine(B.line)||"").length&&(B.ch=0,B.line++)),o.cmpPos(B,this.doc.clipPos(B))!=0))return this.atOccurrence=!1;var I=this.matches(A,B);if(this.afterEmptyMatch=I&&o.cmpPos(I.from,I.to)==0,I)return this.pos=I,this.atOccurrence=!0,this.pos.match||!0;var R=f(A?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:R,to:R},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(A,B){if(this.atOccurrence){var I=o.splitLines(A);this.doc.replaceRange(I,this.pos.from,this.pos.to,B),this.pos.to=f(this.pos.from.line+I.length-1,I[I.length-1].length+(I.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(A,B,I){return new N(this.doc,A,B,I)}),o.defineDocExtension("getSearchCursor",function(A,B,I){return new N(this,A,B,I)}),o.defineExtension("selectMatches",function(A,B){for(var I=[],R=this.getSearchCursor(A,this.getCursor("from"),B);R.findNext()&&!(o.cmpPos(R.to(),this.getCursor("to"))>0);)I.push({anchor:R.from(),head:R.to()});I.length&&this.setSelections(I,0)})})});var Vs=Ye((Js,$s)=>{(function(o){typeof Js=="object"&&typeof $s=="object"?o(ct(),Qo(),Jo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],o):o(CodeMirror)})(function(o){"use strict";var f=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;o.defineMode("gfm",function(c,l){var s=0;function g(w){return w.code=!1,null}var d={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(w){return{code:w.code,codeBlock:w.codeBlock,ateSpace:w.ateSpace}},token:function(w,D){if(D.combineTokens=null,D.codeBlock)return w.match(/^```+/)?(D.codeBlock=!1,null):(w.skipToEnd(),null);if(w.sol()&&(D.code=!1),w.sol()&&w.match(/^```+/))return w.skipToEnd(),D.codeBlock=!0,null;if(w.peek()==="`"){w.next();var S=w.pos;w.eatWhile("`");var F=1+w.pos-S;return D.code?F===s&&(D.code=!1):(s=F,D.code=!0),null}else if(D.code)return w.next(),null;if(w.eatSpace())return D.ateSpace=!0,null;if((w.sol()||D.ateSpace)&&(D.ateSpace=!1,l.gitHubSpice!==!1)){if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return D.combineTokens=!0,"link";if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return D.combineTokens=!0,"link"}return w.match(f)&&w.string.slice(w.start-2,w.start)!="]("&&(w.start==0||/\W/.test(w.string.charAt(w.start-1)))?(D.combineTokens=!0,"link"):(w.next(),null)},blankLine:g},p={taskLists:!0,strikethrough:!0,emoji:!0};for(var y in l)p[y]=l[y];return p.name="markdown",o.overlayMode(o.getMode(c,p),d)},"markdown"),o.defineMIME("text/x-gfm","gfm")})});var eu=Ye(()=>{});var tu=Ye((sh,Vo)=>{var $o;(function(){"use strict";$o=function(o,f,c,l){l=l||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=l.flags||{},this.memoized={},this.loaded=!1;var s=this,g,d,p,y,w;o&&(s.dictionary=o,f&&c?T():(typeof window<"u"?(l.dictionaryPath?g=l.dictionaryPath:g="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?g=window.chrome.runtime.getURL(g):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(g=window.browser.runtime.getURL(g))):typeof __dirname<"u"?g=__dirname+"/dictionaries":g="./dictionaries",f||D(g+"/"+o+"/"+o+".aff",S),c||D(g+"/"+o+"/"+o+".dic",F)));function D(z,N){var A=s._readFile(z,null,l?.asyncLoad);l?.asyncLoad?A.then(function(B){N(B)}):N(A)}function S(z){f=z,c&&T()}function F(z){c=z,f&&T()}function T(){for(s.rules=s._parseAFF(f),s.compoundRuleCodes={},d=0,y=s.compoundRules.length;d<y;d++){var z=s.compoundRules[d];for(p=0,w=z.length;p<w;p++)s.compoundRuleCodes[z[p]]=[]}"ONLYINCOMPOUND"in s.flags&&(s.compoundRuleCodes[s.flags.ONLYINCOMPOUND]=[]),s.dictionaryTable=s._parseDIC(c);for(d in s.compoundRuleCodes)s.compoundRuleCodes[d].length===0&&delete s.compoundRuleCodes[d];for(d=0,y=s.compoundRules.length;d<y;d++){var N=s.compoundRules[d],A="";for(p=0,w=N.length;p<w;p++){var B=N[p];B in s.compoundRuleCodes?A+="("+s.compoundRuleCodes[B].join("|")+")":A+=B}s.compoundRules[d]=new RegExp("^"+A+"$","i")}s.loaded=!0,l?.asyncLoad&&l?.loadedCallback&&l.loadedCallback(s)}return this},$o.prototype={load:function(o){for(var f in o)o.hasOwnProperty(f)&&(this[f]=o[f]);return this},_readFile:function(o,f,c){var l;if(f=f||"utf8",typeof XMLHttpRequest<"u"){var s=new XMLHttpRequest;if(s.open("GET",o,!!c),(l=s.overrideMimeType)===null||l===void 0||l.call(s,"text/plain; charset="+f),c){var g=new Promise(function(p,y){s.onload=function(){s.status===200?p(s.responseText):y(s.statusText)},s.onerror=function(){y(s.statusText)}});return s.send(null),g}else return s.send(null),s.responseText}else if(typeof Ds<"u"){var d=eu();try{if(d.existsSync(o))return d.readFileSync(o,f);console.log("Path "+o+" does not exist.")}catch(p){console.log(p)}return""}return""},_parseAFF:function(o){var f={},c,l,s,g,d,p,y,w,D=o.split(/\r?\n/);for(d=0,y=D.length;d<y;d++)if(c=this._removeAffixComments(D[d]),c=c.trim(),!!c){var S=c.split(/\s+/),F=S[0];if(F==="PFX"||F==="SFX"){var T=S[1],z=S[2];s=parseInt(S[3],10);var N=[];for(p=d+1,w=d+1+s;p<w;p++){l=D[p],g=l.split(/\s+/);var A=g[2],B=g[3].split("/"),I=B[0];I==="0"&&(I="");var R=this.parseRuleCodes(B[1]),H=g[4],_={add:I};R.length>0&&(_.continuationClasses=R),H!=="."&&(F==="SFX"?_.match=new RegExp(H+"$"):_.match=new RegExp("^"+H)),A!="0"&&(F==="SFX"?_.remove=new RegExp(A+"$"):_.remove=A),N.push(_)}f[T]={type:F,combineable:z==="Y",entries:N},d+=s}else if(F==="COMPOUNDRULE"){for(s=parseInt(S[1],10),p=d+1,w=d+1+s;p<w;p++)c=D[p],g=c.split(/\s+/),this.compoundRules.push(g[1]);d+=s}else F==="REP"?(g=c.split(/\s+/),g.length===3&&this.replacementTable.push([g[1],g[2]])):this.flags[F]=S[1]}return f},_removeAffixComments:function(o){return o.match(/^\s*#/)?"":o},_parseDIC:function(o){o=this._removeDicComments(o);var f=o.split(/\r?\n/),c=new Map;function l(ue,ae){c.has(ue)||c.set(ue,null),ae.length>0&&(c.get(ue)===null&&c.set(ue,[]),c.get(ue).push(ae))}for(var s=1,g=f.length;s<g;s++){var d=f[s];if(d){var p=d.replace(/\s.*$/,""),y=p.split("/",2),w=y[0];if(y.length>1){var D=this.parseRuleCodes(y[1]);(!("NEEDAFFIX"in this.flags)||D.indexOf(this.flags.NEEDAFFIX)===-1)&&l(w,D);for(var S=0,F=D.length;S<F;S++){var T=D[S],z=this.rules[T];if(z)for(var N=this._applyRule(w,z),A=0,B=N.length;A<B;A++){var I=N[A];if(l(I,[]),z.combineable)for(var R=S+1;R<F;R++){var H=D[R],_=this.rules[H];if(_&&_.combineable&&z.type!=_.type)for(var X=this._applyRule(I,_),K=0,ge=X.length;K<ge;K++){var G=X[K];l(G,[])}}}T in this.compoundRuleCodes&&this.compoundRuleCodes[T].push(w)}}else l(w.trim(),[])}}return c},_removeDicComments:function(o){return o=o.replace(/^\t.*$/mg,""),o},parseRuleCodes:function(o){if(o)if("FLAG"in this.flags)if(this.flags.FLAG==="long"){for(var f=[],c=0,l=o.length;c<l;c+=2)f.push(o.substr(c,2));return f}else return this.flags.FLAG==="num"?o.split(","):this.flags.FLAG==="UTF-8"?Array.from(o):o.split("");else return o.split("");else return[]},_applyRule:function(o,f){for(var c=f.entries,l=[],s=0,g=c.length;s<g;s++){var d=c[s];if(!d.match||o.match(d.match)){var p=o;if(d.remove&&(p=p.replace(d.remove,"")),f.type==="SFX"?p=p+d.add:p=d.add+p,l.push(p),"continuationClasses"in d)for(var y=0,w=d.continuationClasses.length;y<w;y++){var D=this.rules[d.continuationClasses[y]];D&&(l=l.concat(this._applyRule(p,D)))}}}return l},check:function(o){if(!this.loaded)throw"Dictionary not loaded.";if(!o)return!1;var f=o.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(f))return!0;if(f.toUpperCase()===f){var c=f[0]+f.substring(1).toLowerCase();if(this.hasFlag(c,"KEEPCASE"))return!1;if(this.checkExact(c)||this.checkExact(f.toLowerCase()))return!0}var l=f[0].toLowerCase()+f.substring(1);if(l!==f){if(this.hasFlag(l,"KEEPCASE"))return!1;if(this.checkExact(l))return!0}return!1},checkExact:function(o){if(!this.loaded)throw"Dictionary not loaded.";var f=this.dictionaryTable.get(o),c,l;if(typeof f>"u"){if("COMPOUNDMIN"in this.flags&&o.length>=this.flags.COMPOUNDMIN){for(c=0,l=this.compoundRules.length;c<l;c++)if(o.match(this.compoundRules[c]))return!0}}else{if(f===null)return!0;if(typeof f=="object"){for(c=0,l=f.length;c<l;c++)if(!this.hasFlag(o,"ONLYINCOMPOUND",f[c]))return!0}}return!1},hasFlag:function(o,f,c){if(!this.loaded)throw"Dictionary not loaded.";return!!(f in this.flags&&(typeof c>"u"&&(c=Array.prototype.concat.apply([],this.dictionaryTable.get(o))),c&&c.indexOf(this.flags[f])!==-1))},alphabet:"",suggest:function(o,f){if(!this.loaded)throw"Dictionary not loaded.";if(f=f||5,this.memoized.hasOwnProperty(o)){var c=this.memoized[o].limit;if(f<=c||this.memoized[o].suggestions.length<c)return this.memoized[o].suggestions.slice(0,f)}if(this.check(o))return[];for(var l=0,s=this.replacementTable.length;l<s;l++){var g=this.replacementTable[l];if(o.indexOf(g[0])!==-1){var d=o.replace(g[0],g[1]);if(this.check(d))return[d]}}if(!this.alphabet){this.alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","TRY"in this.flags&&(this.alphabet+=this.flags.TRY),"WORDCHARS"in this.flags&&(this.alphabet+=this.flags.WORDCHARS);var p=this.alphabet.split("");p.sort();for(var y={},l=0;l<p.length;l++)y[p[l]]=!0;this.alphabet="";for(var l in y)this.alphabet+=l}var w=this;function D(F,T){var z={},N,A,B,I,R,H,_=w.alphabet.length;for(var X in F)for(N=0,I=X.length+1;N<I;N++){var K=[X.substring(0,N),X.substring(N)];if(K[1]&&(H=K[0]+K[1].substring(1),(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1)),K[1].length>1&&K[1][1]!==K[1][0]&&(H=K[0]+K[1][1]+K[1][0]+K[1].substring(2),(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1)),K[1]){var ge=K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase";for(A=0;A<_;A++){var G=w.alphabet[A];ge==="uppercase"&&(G=G.toUpperCase()),G!=K[1].substring(0,1)&&(H=K[0]+G+K[1].substring(1),(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1))}}if(K[1])for(A=0;A<_;A++){var ge=K[0].substring(-1).toUpperCase()===K[0].substring(-1)&&K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase",G=w.alphabet[A];ge==="uppercase"&&(G=G.toUpperCase()),H=K[0]+G+K[1],(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1)}}return z}function S(F){var T,z=D((T={},T[F]=!0,T)),N=D(z,!0),A=N;for(var B in z)w.check(B)&&(B in A?A[B]+=z[B]:A[B]=z[B]);var I,R,H=[];for(I in A)A.hasOwnProperty(I)&&(w.hasFlag(I,"PRIORITYSUGGEST")&&(A[I]+=1e3),H.push([I,A[I]]));function _(G,ue){var ae=G[1],de=ue[1];return ae<de?-1:ae>de?1:ue[0].localeCompare(G[0])}H.sort(_).reverse();var X=[],K="lowercase";F.toUpperCase()===F?K="uppercase":F.substr(0,1).toUpperCase()+F.substr(1).toLowerCase()===F&&(K="capitalized");var ge=f;for(I=0;I<Math.min(ge,H.length);I++)K==="uppercase"?H[I][0]=H[I][0].toUpperCase():K==="capitalized"&&(H[I][0]=H[I][0].substr(0,1).toUpperCase()+H[I][0].substr(1)),!w.hasFlag(H[I][0],"NOSUGGEST")&&X.indexOf(H[I][0])===-1?X.push(H[I][0]):ge++;return X}return this.memoized[o]={suggestions:S(o),limit:f},this.memoized[o].suggestions}}})();typeof Vo<"u"&&(Vo.exports=$o)});var nu=Ye((fh,iu)=>{"use strict";var ru=tu();function Ae(o){if(o=o||{},typeof o.codeMirrorInstance!="function"||typeof o.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),o.codeMirrorInstance.defineMode("spell-checker",function(f){if(!Ae.aff_loading){Ae.aff_loading=!0;var c=new XMLHttpRequest;c.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),c.onload=function(){c.readyState===4&&c.status===200&&(Ae.aff_data=c.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new ru("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},c.send(null)}if(!Ae.dic_loading){Ae.dic_loading=!0;var l=new XMLHttpRequest;l.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),l.onload=function(){l.readyState===4&&l.status===200&&(Ae.dic_data=l.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new ru("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},l.send(null)}var s='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',g={token:function(p){var y=p.peek(),w="";if(s.includes(y))return p.next(),null;for(;(y=p.peek())!=null&&!s.includes(y);)w+=y,p.next();return Ae.typo&&!Ae.typo.check(w)?"spell-error":null}},d=o.codeMirrorInstance.getMode(f,f.backdrop||"text/plain");return o.codeMirrorInstance.overlayMode(d,g,!0)})}Ae.num_loaded=0;Ae.aff_loading=!1;Ae.dic_loading=!1;Ae.aff_data="";Ae.dic_data="";Ae.typo;iu.exports=Ae});var mu=Ye(Se=>{"use strict";function ou(o,f){for(var c=0;c<f.length;c++){var l=f[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(o,Jc(l.key),l)}}function Yc(o,f,c){return f&&ou(o.prototype,f),c&&ou(o,c),Object.defineProperty(o,"prototype",{writable:!1}),o}function gt(){return gt=Object.assign?Object.assign.bind():function(o){for(var f=1;f<arguments.length;f++){var c=arguments[f];for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(o[l]=c[l])}return o},gt.apply(this,arguments)}function Zc(o,f){if(o){if(typeof o=="string")return au(o,f);var c=Object.prototype.toString.call(o).slice(8,-1);if(c==="Object"&&o.constructor&&(c=o.constructor.name),c==="Map"||c==="Set")return Array.from(o);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return au(o,f)}}function au(o,f){(f==null||f>o.length)&&(f=o.length);for(var c=0,l=new Array(f);c<f;c++)l[c]=o[c];return l}function sn(o,f){var c=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(c)return(c=c.call(o)).next.bind(c);if(Array.isArray(o)||(c=Zc(o))||f&&o&&typeof o.length=="number"){c&&(o=c);var l=0;return function(){return l>=o.length?{done:!0}:{done:!1,value:o[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qc(o,f){if(typeof o!="object"||o===null)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var l=c.call(o,f||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(o)}function Jc(o){var f=Qc(o,"string");return typeof f=="symbol"?f:String(f)}function ea(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Se.defaults=ea();function $c(o){Se.defaults=o}var hu=/[&<>"']/,Vc=new RegExp(hu.source,"g"),pu=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ed=new RegExp(pu.source,"g"),td={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},lu=function(f){return td[f]};function et(o,f){if(f){if(hu.test(o))return o.replace(Vc,lu)}else if(pu.test(o))return o.replace(ed,lu);return o}var rd=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function gu(o){return o.replace(rd,function(f,c){return c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""})}var id=/(^|[^\[])\^/g;function Ce(o,f){o=typeof o=="string"?o:o.source,f=f||"";var c={replace:function(s,g){return g=g.source||g,g=g.replace(id,"$1"),o=o.replace(s,g),c},getRegex:function(){return new RegExp(o,f)}};return c}var nd=/[^\w:]/g,od=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function su(o,f,c){if(o){var l;try{l=decodeURIComponent(gu(c)).replace(nd,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}f&&!od.test(c)&&(c=ud(f,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch{return null}return c}var un={},ad=/^[^:]+:\/*[^/]*$/,ld=/^([^:]+:)[\s\S]*$/,sd=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ud(o,f){un[" "+o]||(ad.test(o)?un[" "+o]=o+"/":un[" "+o]=fn(o,"/",!0)),o=un[" "+o];var c=o.indexOf(":")===-1;return f.substring(0,2)==="//"?c?f:o.replace(ld,"$1")+f:f.charAt(0)==="/"?c?f:o.replace(sd,"$1")+f:o+f}var cn={exec:function(){}};function uu(o,f){var c=o.replace(/\|/g,function(g,d,p){for(var y=!1,w=d;--w>=0&&p[w]==="\\";)y=!y;return y?"|":" |"}),l=c.split(/ \|/),s=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>f)l.splice(f);else for(;l.length<f;)l.push("");for(;s<l.length;s++)l[s]=l[s].trim().replace(/\\\|/g,"|");return l}function fn(o,f,c){var l=o.length;if(l===0)return"";for(var s=0;s<l;){var g=o.charAt(l-s-1);if(g===f&&!c)s++;else if(g!==f&&c)s++;else break}return o.slice(0,l-s)}function fd(o,f){if(o.indexOf(f[1])===-1)return-1;for(var c=o.length,l=0,s=0;s<c;s++)if(o[s]==="\\")s++;else if(o[s]===f[0])l++;else if(o[s]===f[1]&&(l--,l<0))return s;return-1}function cd(o){o&&o.sanitize&&!o.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")}function fu(o,f){if(f<1)return"";for(var c="";f>1;)f&1&&(c+=o),f>>=1,o+=o;return c+o}function cu(o,f,c,l){var s=f.href,g=f.title?et(f.title):null,d=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){l.state.inLink=!0;var p={type:"link",raw:c,href:s,title:g,text:d,tokens:l.inlineTokens(d)};return l.state.inLink=!1,p}return{type:"image",raw:c,href:s,title:g,text:et(d)}}function dd(o,f){var c=o.match(/^(\s+)(?:```)/);if(c===null)return f;var l=c[1];return f.split(`
`).map(function(s){var g=s.match(/^\s+/);if(g===null)return s;var d=g[0];return d.length>=l.length?s.slice(l.length):s}).join(`
`)}var dn=function(){function o(c){this.options=c||Se.defaults}var f=o.prototype;return f.space=function(l){var s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}},f.code=function(l){var s=this.rules.block.code.exec(l);if(s){var g=s[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?g:fn(g,`
`)}}},f.fences=function(l){var s=this.rules.block.fences.exec(l);if(s){var g=s[0],d=dd(g,s[3]||"");return{type:"code",raw:g,lang:s[2]?s[2].trim().replace(this.rules.inline._escapes,"$1"):s[2],text:d}}},f.heading=function(l){var s=this.rules.block.heading.exec(l);if(s){var g=s[2].trim();if(/#$/.test(g)){var d=fn(g,"#");(this.options.pedantic||!d||/ $/.test(d))&&(g=d.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:g,tokens:this.lexer.inline(g)}}},f.hr=function(l){var s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:s[0]}},f.blockquote=function(l){var s=this.rules.block.blockquote.exec(l);if(s){var g=s[0].replace(/^ *>[ \t]?/gm,""),d=this.lexer.state.top;this.lexer.state.top=!0;var p=this.lexer.blockTokens(g);return this.lexer.state.top=d,{type:"blockquote",raw:s[0],tokens:p,text:g}}},f.list=function(l){var s=this.rules.block.list.exec(l);if(s){var g,d,p,y,w,D,S,F,T,z,N,A,B=s[1].trim(),I=B.length>1,R={type:"list",raw:"",ordered:I,start:I?+B.slice(0,-1):"",loose:!1,items:[]};B=I?"\\d{1,9}\\"+B.slice(-1):"\\"+B,this.options.pedantic&&(B=I?B:"[*+-]");for(var H=new RegExp("^( {0,3}"+B+")((?:[ ][^\\n]*)?(?:\\n|$))");l&&(A=!1,!(!(s=H.exec(l))||this.rules.block.hr.test(l)));){if(g=s[0],l=l.substring(g.length),F=s[2].split(`
`,1)[0].replace(/^\t+/,function(de){return" ".repeat(3*de.length)}),T=l.split(`
`,1)[0],this.options.pedantic?(y=2,N=F.trimLeft()):(y=s[2].search(/[^ ]/),y=y>4?1:y,N=F.slice(y),y+=s[1].length),D=!1,!F&&/^ *$/.test(T)&&(g+=T+`
`,l=l.substring(T.length+1),A=!0),!A)for(var _=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),X=new RegExp("^ {0,"+Math.min(3,y-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),K=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:```|~~~)"),ge=new RegExp("^ {0,"+Math.min(3,y-1)+"}#");l&&(z=l.split(`
`,1)[0],T=z,this.options.pedantic&&(T=T.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(T)||ge.test(T)||_.test(T)||X.test(l)));){if(T.search(/[^ ]/)>=y||!T.trim())N+=`
`+T.slice(y);else{if(D||F.search(/[^ ]/)>=4||K.test(F)||ge.test(F)||X.test(F))break;N+=`
`+T}!D&&!T.trim()&&(D=!0),g+=z+`
`,l=l.substring(z.length+1),F=T.slice(y)}R.loose||(S?R.loose=!0:/\n *\n *$/.test(g)&&(S=!0)),this.options.gfm&&(d=/^\[[ xX]\] /.exec(N),d&&(p=d[0]!=="[ ] ",N=N.replace(/^\[[ xX]\] +/,""))),R.items.push({type:"list_item",raw:g,task:!!d,checked:p,loose:!1,text:N}),R.raw+=g}R.items[R.items.length-1].raw=g.trimRight(),R.items[R.items.length-1].text=N.trimRight(),R.raw=R.raw.trimRight();var G=R.items.length;for(w=0;w<G;w++)if(this.lexer.state.top=!1,R.items[w].tokens=this.lexer.blockTokens(R.items[w].text,[]),!R.loose){var ue=R.items[w].tokens.filter(function(de){return de.type==="space"}),ae=ue.length>0&&ue.some(function(de){return/\n.*\n/.test(de.raw)});R.loose=ae}if(R.loose)for(w=0;w<G;w++)R.items[w].loose=!0;return R}},f.html=function(l){var s=this.rules.block.html.exec(l);if(s){var g={type:"html",raw:s[0],pre:!this.options.sanitizer&&(s[1]==="pre"||s[1]==="script"||s[1]==="style"),text:s[0]};if(this.options.sanitize){var d=this.options.sanitizer?this.options.sanitizer(s[0]):et(s[0]);g.type="paragraph",g.text=d,g.tokens=this.lexer.inline(d)}return g}},f.def=function(l){var s=this.rules.block.def.exec(l);if(s){var g=s[1].toLowerCase().replace(/\s+/g," "),d=s[2]?s[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",p=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline._escapes,"$1"):s[3];return{type:"def",tag:g,raw:s[0],href:d,title:p}}},f.table=function(l){var s=this.rules.block.table.exec(l);if(s){var g={type:"table",header:uu(s[1]).map(function(S){return{text:S}}),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:s[3]&&s[3].trim()?s[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(g.header.length===g.align.length){g.raw=s[0];var d=g.align.length,p,y,w,D;for(p=0;p<d;p++)/^ *-+: *$/.test(g.align[p])?g.align[p]="right":/^ *:-+: *$/.test(g.align[p])?g.align[p]="center":/^ *:-+ *$/.test(g.align[p])?g.align[p]="left":g.align[p]=null;for(d=g.rows.length,p=0;p<d;p++)g.rows[p]=uu(g.rows[p],g.header.length).map(function(S){return{text:S}});for(d=g.header.length,y=0;y<d;y++)g.header[y].tokens=this.lexer.inline(g.header[y].text);for(d=g.rows.length,y=0;y<d;y++)for(D=g.rows[y],w=0;w<D.length;w++)D[w].tokens=this.lexer.inline(D[w].text);return g}}},f.lheading=function(l){var s=this.rules.block.lheading.exec(l);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}},f.paragraph=function(l){var s=this.rules.block.paragraph.exec(l);if(s){var g=s[1].charAt(s[1].length-1)===`
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:g,tokens:this.lexer.inline(g)}}},f.text=function(l){var s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}},f.escape=function(l){var s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:et(s[1])}},f.tag=function(l){var s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&/^<a /i.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):et(s[0]):s[0]}},f.link=function(l){var s=this.rules.inline.link.exec(l);if(s){var g=s[2].trim();if(!this.options.pedantic&&/^</.test(g)){if(!/>$/.test(g))return;var d=fn(g.slice(0,-1),"\\");if((g.length-d.length)%2===0)return}else{var p=fd(s[2],"()");if(p>-1){var y=s[0].indexOf("!")===0?5:4,w=y+s[1].length+p;s[2]=s[2].substring(0,p),s[0]=s[0].substring(0,w).trim(),s[3]=""}}var D=s[2],S="";if(this.options.pedantic){var F=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(D);F&&(D=F[1],S=F[3])}else S=s[3]?s[3].slice(1,-1):"";return D=D.trim(),/^</.test(D)&&(this.options.pedantic&&!/>$/.test(g)?D=D.slice(1):D=D.slice(1,-1)),cu(s,{href:D&&D.replace(this.rules.inline._escapes,"$1"),title:S&&S.replace(this.rules.inline._escapes,"$1")},s[0],this.lexer)}},f.reflink=function(l,s){var g;if((g=this.rules.inline.reflink.exec(l))||(g=this.rules.inline.nolink.exec(l))){var d=(g[2]||g[1]).replace(/\s+/g," ");if(d=s[d.toLowerCase()],!d){var p=g[0].charAt(0);return{type:"text",raw:p,text:p}}return cu(g,d,g[0],this.lexer)}},f.emStrong=function(l,s,g){g===void 0&&(g="");var d=this.rules.inline.emStrong.lDelim.exec(l);if(d&&!(d[3]&&g.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var p=d[1]||d[2]||"";if(!p||p&&(g===""||this.rules.inline.punctuation.exec(g))){var y=d[0].length-1,w,D,S=y,F=0,T=d[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(T.lastIndex=0,s=s.slice(-1*l.length+y);(d=T.exec(s))!=null;)if(w=d[1]||d[2]||d[3]||d[4]||d[5]||d[6],!!w){if(D=w.length,d[3]||d[4]){S+=D;continue}else if((d[5]||d[6])&&y%3&&!((y+D)%3)){F+=D;continue}if(S-=D,!(S>0)){D=Math.min(D,D+S+F);var z=l.slice(0,y+d.index+(d[0].length-w.length)+D);if(Math.min(y,D)%2){var N=z.slice(1,-1);return{type:"em",raw:z,text:N,tokens:this.lexer.inlineTokens(N)}}var A=z.slice(2,-2);return{type:"strong",raw:z,text:A,tokens:this.lexer.inlineTokens(A)}}}}}},f.codespan=function(l){var s=this.rules.inline.code.exec(l);if(s){var g=s[2].replace(/\n/g," "),d=/[^ ]/.test(g),p=/^ /.test(g)&&/ $/.test(g);return d&&p&&(g=g.substring(1,g.length-1)),g=et(g,!0),{type:"codespan",raw:s[0],text:g}}},f.br=function(l){var s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}},f.del=function(l){var s=this.rules.inline.del.exec(l);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}},f.autolink=function(l,s){var g=this.rules.inline.autolink.exec(l);if(g){var d,p;return g[2]==="@"?(d=et(this.options.mangle?s(g[1]):g[1]),p="mailto:"+d):(d=et(g[1]),p=d),{type:"link",raw:g[0],text:d,href:p,tokens:[{type:"text",raw:d,text:d}]}}},f.url=function(l,s){var g;if(g=this.rules.inline.url.exec(l)){var d,p;if(g[2]==="@")d=et(this.options.mangle?s(g[0]):g[0]),p="mailto:"+d;else{var y;do y=g[0],g[0]=this.rules.inline._backpedal.exec(g[0])[0];while(y!==g[0]);d=et(g[0]),g[1]==="www."?p="http://"+g[0]:p=g[0]}return{type:"link",raw:g[0],text:d,href:p,tokens:[{type:"text",raw:d,text:d}]}}},f.inlineText=function(l,s){var g=this.rules.inline.text.exec(l);if(g){var d;return this.lexer.state.inRawBlock?d=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(g[0]):et(g[0]):g[0]:d=et(this.options.smartypants?s(g[0]):g[0]),{type:"text",raw:g[0],text:d}}},o}(),se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:cn,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=Ce(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=Ce(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=Ce(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._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";se._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;se.html=Ce(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=Ce(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").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|textarea|!--)").replace("tag",se._tag).getRegex();se.blockquote=Ce(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=gt({},se);se.gfm=gt({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.table=Ce(se.gfm.table).replace("hr",se.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|textarea|!--)").replace("tag",se._tag).getRegex();se.gfm.paragraph=Ce(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).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|textarea|!--)").replace("tag",se._tag).getRegex();se.pedantic=gt({},se.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._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+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ce(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:cn,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)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:cn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};te._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";te.punctuation=Ce(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=Ce(se._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=Ce(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=Ce(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=Ce(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._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])?)+(?![-_])/;te.autolink=Ce(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=Ce(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=Ce(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=Ce(te.reflink).replace("label",te._label).replace("ref",se._label).getRegex();te.nolink=Ce(te.nolink).replace("ref",se._label).getRegex();te.reflinkSearch=Ce(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=gt({},te);te.pedantic=gt({},te.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=gt({},te.normal,{escape:Ce(te.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/});te.gfm.url=Ce(te.gfm.url,"i").replace("email",te.gfm._extended_email).getRegex();te.breaks=gt({},te.gfm,{br:Ce(te.br).replace("{2,}","*").getRegex(),text:Ce(te.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function hd(o){return o.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function du(o){var f="",c,l,s=o.length;for(c=0;c<s;c++)l=o.charCodeAt(c),Math.random()>.5&&(l="x"+l.toString(16)),f+="&#"+l+";";return f}var _r=function(){function o(c){this.tokens=[],this.tokens.links=Object.create(null),this.options=c||Se.defaults,this.options.tokenizer=this.options.tokenizer||new dn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var l={block:se.normal,inline:te.normal};this.options.pedantic?(l.block=se.pedantic,l.inline=te.pedantic):this.options.gfm&&(l.block=se.gfm,this.options.breaks?l.inline=te.breaks:l.inline=te.gfm),this.tokenizer.rules=l}o.lex=function(l,s){var g=new o(s);return g.lex(l)},o.lexInline=function(l,s){var g=new o(s);return g.inlineTokens(l)};var f=o.prototype;return f.lex=function(l){l=l.replace(/\r\n|\r/g,`
`),this.blockTokens(l,this.tokens);for(var s;s=this.inlineQueue.shift();)this.inlineTokens(s.src,s.tokens);return this.tokens},f.blockTokens=function(l,s){var g=this;s===void 0&&(s=[]),this.options.pedantic?l=l.replace(/\t/g," ").replace(/^ +$/gm,""):l=l.replace(/^( *)(\t+)/gm,function(S,F,T){return F+" ".repeat(T.length)});for(var d,p,y,w;l;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(S){return(d=S.call({lexer:g},l,s))?(l=l.substring(d.raw.length),s.push(d),!0):!1}))){if(d=this.tokenizer.space(l)){l=l.substring(d.raw.length),d.raw.length===1&&s.length>0?s[s.length-1].raw+=`
`:s.push(d);continue}if(d=this.tokenizer.code(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=`
`+d.raw,p.text+=`
`+d.text,this.inlineQueue[this.inlineQueue.length-1].src=p.text):s.push(d);continue}if(d=this.tokenizer.fences(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.heading(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.hr(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.blockquote(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.list(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.html(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.def(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=`
`+d.raw,p.text+=`
`+d.raw,this.inlineQueue[this.inlineQueue.length-1].src=p.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title});continue}if(d=this.tokenizer.table(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.lheading(l)){l=l.substring(d.raw.length),s.push(d);continue}if(y=l,this.options.extensions&&this.options.extensions.startBlock&&function(){var S=1/0,F=l.slice(1),T=void 0;g.options.extensions.startBlock.forEach(function(z){T=z.call({lexer:this},F),typeof T=="number"&&T>=0&&(S=Math.min(S,T))}),S<1/0&&S>=0&&(y=l.substring(0,S+1))}(),this.state.top&&(d=this.tokenizer.paragraph(y))){p=s[s.length-1],w&&p.type==="paragraph"?(p.raw+=`
`+d.raw,p.text+=`
`+d.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):s.push(d),w=y.length!==l.length,l=l.substring(d.raw.length);continue}if(d=this.tokenizer.text(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&p.type==="text"?(p.raw+=`
`+d.raw,p.text+=`
`+d.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):s.push(d);continue}if(l){var D="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(D);break}else throw new Error(D)}}return this.state.top=!0,s},f.inline=function(l,s){return s===void 0&&(s=[]),this.inlineQueue.push({src:l,tokens:s}),s},f.inlineTokens=function(l,s){var g=this;s===void 0&&(s=[]);var d,p,y,w=l,D,S,F;if(this.tokens.links){var T=Object.keys(this.tokens.links);if(T.length>0)for(;(D=this.tokenizer.rules.inline.reflinkSearch.exec(w))!=null;)T.includes(D[0].slice(D[0].lastIndexOf("[")+1,-1))&&(w=w.slice(0,D.index)+"["+fu("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(D=this.tokenizer.rules.inline.blockSkip.exec(w))!=null;)w=w.slice(0,D.index)+"["+fu("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(D=this.tokenizer.rules.inline.escapedEmSt.exec(w))!=null;)w=w.slice(0,D.index+D[0].length-2)+"++"+w.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;l;)if(S||(F=""),S=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(N){return(d=N.call({lexer:g},l,s))?(l=l.substring(d.raw.length),s.push(d),!0):!1}))){if(d=this.tokenizer.escape(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.tag(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&d.type==="text"&&p.type==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(d=this.tokenizer.link(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(d.raw.length),p=s[s.length-1],p&&d.type==="text"&&p.type==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(d=this.tokenizer.emStrong(l,w,F)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.codespan(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.br(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.del(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.autolink(l,du)){l=l.substring(d.raw.length),s.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(l,du))){l=l.substring(d.raw.length),s.push(d);continue}if(y=l,this.options.extensions&&this.options.extensions.startInline&&function(){var N=1/0,A=l.slice(1),B=void 0;g.options.extensions.startInline.forEach(function(I){B=I.call({lexer:this},A),typeof B=="number"&&B>=0&&(N=Math.min(N,B))}),N<1/0&&N>=0&&(y=l.substring(0,N+1))}(),d=this.tokenizer.inlineText(y,hd)){l=l.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(F=d.raw.slice(-1)),S=!0,p=s[s.length-1],p&&p.type==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(l){var z="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(z);break}else throw new Error(z)}}return s},Yc(o,null,[{key:"rules",get:function(){return{block:se,inline:te}}}]),o}(),hn=function(){function o(c){this.options=c||Se.defaults}var f=o.prototype;return f.code=function(l,s,g){var d=(s||"").match(/\S*/)[0];if(this.options.highlight){var p=this.options.highlight(l,d);p!=null&&p!==l&&(g=!0,l=p)}return l=l.replace(/\n$/,"")+`
`,d?'<pre><code class="'+this.options.langPrefix+et(d)+'">'+(g?l:et(l,!0))+`</code></pre>
`:"<pre><code>"+(g?l:et(l,!0))+`</code></pre>
`},f.blockquote=function(l){return`<blockquote>
`+l+`</blockquote>
`},f.html=function(l){return l},f.heading=function(l,s,g,d){if(this.options.headerIds){var p=this.options.headerPrefix+d.slug(g);return"<h"+s+' id="'+p+'">'+l+"</h"+s+`>
`}return"<h"+s+">"+l+"</h"+s+`>
`},f.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},f.list=function(l,s,g){var d=s?"ol":"ul",p=s&&g!==1?' start="'+g+'"':"";return"<"+d+p+`>
`+l+"</"+d+`>
`},f.listitem=function(l){return"<li>"+l+`</li>
`},f.checkbox=function(l){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},f.paragraph=function(l){return"<p>"+l+`</p>
`},f.table=function(l,s){return s&&(s="<tbody>"+s+"</tbody>"),`<table>
<thead>
`+l+`</thead>
`+s+`</table>
`},f.tablerow=function(l){return`<tr>
`+l+`</tr>
`},f.tablecell=function(l,s){var g=s.header?"th":"td",d=s.align?"<"+g+' align="'+s.align+'">':"<"+g+">";return d+l+("</"+g+`>
`)},f.strong=function(l){return"<strong>"+l+"</strong>"},f.em=function(l){return"<em>"+l+"</em>"},f.codespan=function(l){return"<code>"+l+"</code>"},f.br=function(){return this.options.xhtml?"<br/>":"<br>"},f.del=function(l){return"<del>"+l+"</del>"},f.link=function(l,s,g){if(l=su(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var d='<a href="'+l+'"';return s&&(d+=' title="'+s+'"'),d+=">"+g+"</a>",d},f.image=function(l,s,g){if(l=su(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var d='<img src="'+l+'" alt="'+g+'"';return s&&(d+=' title="'+s+'"'),d+=this.options.xhtml?"/>":">",d},f.text=function(l){return l},o}(),ta=function(){function o(){}var f=o.prototype;return f.strong=function(l){return l},f.em=function(l){return l},f.codespan=function(l){return l},f.del=function(l){return l},f.html=function(l){return l},f.text=function(l){return l},f.link=function(l,s,g){return""+g},f.image=function(l,s,g){return""+g},f.br=function(){return""},o}(),ra=function(){function o(){this.seen={}}var f=o.prototype;return f.serialize=function(l){return l.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},f.getNextSafeSlug=function(l,s){var g=l,d=0;if(this.seen.hasOwnProperty(g)){d=this.seen[l];do d++,g=l+"-"+d;while(this.seen.hasOwnProperty(g))}return s||(this.seen[l]=d,this.seen[g]=0),g},f.slug=function(l,s){s===void 0&&(s={});var g=this.serialize(l);return this.getNextSafeSlug(g,s.dryrun)},o}(),Wr=function(){function o(c){this.options=c||Se.defaults,this.options.renderer=this.options.renderer||new hn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ta,this.slugger=new ra}o.parse=function(l,s){var g=new o(s);return g.parse(l)},o.parseInline=function(l,s){var g=new o(s);return g.parseInline(l)};var f=o.prototype;return f.parse=function(l,s){s===void 0&&(s=!0);var g="",d,p,y,w,D,S,F,T,z,N,A,B,I,R,H,_,X,K,ge,G=l.length;for(d=0;d<G;d++){if(N=l[d],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[N.type]&&(ge=this.options.extensions.renderers[N.type].call({parser:this},N),ge!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(N.type))){g+=ge||"";continue}switch(N.type){case"space":continue;case"hr":{g+=this.renderer.hr();continue}case"heading":{g+=this.renderer.heading(this.parseInline(N.tokens),N.depth,gu(this.parseInline(N.tokens,this.textRenderer)),this.slugger);continue}case"code":{g+=this.renderer.code(N.text,N.lang,N.escaped);continue}case"table":{for(T="",F="",w=N.header.length,p=0;p<w;p++)F+=this.renderer.tablecell(this.parseInline(N.header[p].tokens),{header:!0,align:N.align[p]});for(T+=this.renderer.tablerow(F),z="",w=N.rows.length,p=0;p<w;p++){for(S=N.rows[p],F="",D=S.length,y=0;y<D;y++)F+=this.renderer.tablecell(this.parseInline(S[y].tokens),{header:!1,align:N.align[y]});z+=this.renderer.tablerow(F)}g+=this.renderer.table(T,z);continue}case"blockquote":{z=this.parse(N.tokens),g+=this.renderer.blockquote(z);continue}case"list":{for(A=N.ordered,B=N.start,I=N.loose,w=N.items.length,z="",p=0;p<w;p++)H=N.items[p],_=H.checked,X=H.task,R="",H.task&&(K=this.renderer.checkbox(_),I?H.tokens.length>0&&H.tokens[0].type==="paragraph"?(H.tokens[0].text=K+" "+H.tokens[0].text,H.tokens[0].tokens&&H.tokens[0].tokens.length>0&&H.tokens[0].tokens[0].type==="text"&&(H.tokens[0].tokens[0].text=K+" "+H.tokens[0].tokens[0].text)):H.tokens.unshift({type:"text",text:K}):R+=K),R+=this.parse(H.tokens,I),z+=this.renderer.listitem(R,X,_);g+=this.renderer.list(z,A,B);continue}case"html":{g+=this.renderer.html(N.text);continue}case"paragraph":{g+=this.renderer.paragraph(this.parseInline(N.tokens));continue}case"text":{for(z=N.tokens?this.parseInline(N.tokens):N.text;d+1<G&&l[d+1].type==="text";)N=l[++d],z+=`
`+(N.tokens?this.parseInline(N.tokens):N.text);g+=s?this.renderer.paragraph(z):z;continue}default:{var ue='Token with "'+N.type+'" type was not found.';if(this.options.silent){console.error(ue);return}else throw new Error(ue)}}}return g},f.parseInline=function(l,s){s=s||this.renderer;var g="",d,p,y,w=l.length;for(d=0;d<w;d++){if(p=l[d],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(y=this.options.extensions.renderers[p.type].call({parser:this},p),y!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type))){g+=y||"";continue}switch(p.type){case"escape":{g+=s.text(p.text);break}case"html":{g+=s.html(p.text);break}case"link":{g+=s.link(p.href,p.title,this.parseInline(p.tokens,s));break}case"image":{g+=s.image(p.href,p.title,p.text);break}case"strong":{g+=s.strong(this.parseInline(p.tokens,s));break}case"em":{g+=s.em(this.parseInline(p.tokens,s));break}case"codespan":{g+=s.codespan(p.text);break}case"br":{g+=s.br();break}case"del":{g+=s.del(this.parseInline(p.tokens,s));break}case"text":{g+=s.text(p.text);break}default:{var D='Token with "'+p.type+'" type was not found.';if(this.options.silent){console.error(D);return}else throw new Error(D)}}}return g},o}(),Ci=function(){function o(c){this.options=c||Se.defaults}var f=o.prototype;return f.preprocess=function(l){return l},f.postprocess=function(l){return l},o}();Ci.passThroughHooks=new Set(["preprocess","postprocess"]);function pd(o,f,c){return function(l){if(l.message+=`
Please report this to https://github.com/markedjs/marked.`,o){var s="<p>An error occurred:</p><pre>"+et(l.message+"",!0)+"</pre>";if(f)return Promise.resolve(s);if(c){c(null,s);return}return s}if(f)return Promise.reject(l);if(c){c(l);return}throw l}}function vu(o,f){return function(c,l,s){typeof l=="function"&&(s=l,l=null);var g=gt({},l);l=gt({},le.defaults,g);var d=pd(l.silent,l.async,s);if(typeof c>"u"||c===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));if(cd(l),l.hooks&&(l.hooks.options=l),s){var p=l.highlight,y;try{l.hooks&&(c=l.hooks.preprocess(c)),y=o(c,l)}catch(T){return d(T)}var w=function(z){var N;if(!z)try{l.walkTokens&&le.walkTokens(y,l.walkTokens),N=f(y,l),l.hooks&&(N=l.hooks.postprocess(N))}catch(A){z=A}return l.highlight=p,z?d(z):s(null,N)};if(!p||p.length<3||(delete l.highlight,!y.length))return w();var D=0;le.walkTokens(y,function(T){T.type==="code"&&(D++,setTimeout(function(){p(T.text,T.lang,function(z,N){if(z)return w(z);N!=null&&N!==T.text&&(T.text=N,T.escaped=!0),D--,D===0&&w()})},0))}),D===0&&w();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(c):c).then(function(T){return o(T,l)}).then(function(T){return l.walkTokens?Promise.all(le.walkTokens(T,l.walkTokens)).then(function(){return T}):T}).then(function(T){return f(T,l)}).then(function(T){return l.hooks?l.hooks.postprocess(T):T}).catch(d);try{l.hooks&&(c=l.hooks.preprocess(c));var S=o(c,l);l.walkTokens&&le.walkTokens(S,l.walkTokens);var F=f(S,l);return l.hooks&&(F=l.hooks.postprocess(F)),F}catch(T){return d(T)}}}function le(o,f,c){return vu(_r.lex,Wr.parse)(o,f,c)}le.options=le.setOptions=function(o){return le.defaults=gt({},le.defaults,o),$c(le.defaults),le};le.getDefaults=ea;le.defaults=Se.defaults;le.use=function(){for(var o=le.defaults.extensions||{renderers:{},childTokens:{}},f=arguments.length,c=new Array(f),l=0;l<f;l++)c[l]=arguments[l];c.forEach(function(s){var g=gt({},s);if(g.async=le.defaults.async||g.async||!1,s.extensions&&(s.extensions.forEach(function(p){if(!p.name)throw new Error("extension name required");if(p.renderer){var y=o.renderers[p.name];y?o.renderers[p.name]=function(){for(var w=arguments.length,D=new Array(w),S=0;S<w;S++)D[S]=arguments[S];var F=p.renderer.apply(this,D);return F===!1&&(F=y.apply(this,D)),F}:o.renderers[p.name]=p.renderer}if(p.tokenizer){if(!p.level||p.level!=="block"&&p.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");o[p.level]?o[p.level].unshift(p.tokenizer):o[p.level]=[p.tokenizer],p.start&&(p.level==="block"?o.startBlock?o.startBlock.push(p.start):o.startBlock=[p.start]:p.level==="inline"&&(o.startInline?o.startInline.push(p.start):o.startInline=[p.start]))}p.childTokens&&(o.childTokens[p.name]=p.childTokens)}),g.extensions=o),s.renderer&&function(){var p=le.defaults.renderer||new hn,y=function(S){var F=p[S];p[S]=function(){for(var T=arguments.length,z=new Array(T),N=0;N<T;N++)z[N]=arguments[N];var A=s.renderer[S].apply(p,z);return A===!1&&(A=F.apply(p,z)),A}};for(var w in s.renderer)y(w);g.renderer=p}(),s.tokenizer&&function(){var p=le.defaults.tokenizer||new dn,y=function(S){var F=p[S];p[S]=function(){for(var T=arguments.length,z=new Array(T),N=0;N<T;N++)z[N]=arguments[N];var A=s.tokenizer[S].apply(p,z);return A===!1&&(A=F.apply(p,z)),A}};for(var w in s.tokenizer)y(w);g.tokenizer=p}(),s.hooks&&function(){var p=le.defaults.hooks||new Ci,y=function(S){var F=p[S];Ci.passThroughHooks.has(S)?p[S]=function(T){if(le.defaults.async)return Promise.resolve(s.hooks[S].call(p,T)).then(function(N){return F.call(p,N)});var z=s.hooks[S].call(p,T);return F.call(p,z)}:p[S]=function(){for(var T=arguments.length,z=new Array(T),N=0;N<T;N++)z[N]=arguments[N];var A=s.hooks[S].apply(p,z);return A===!1&&(A=F.apply(p,z)),A}};for(var w in s.hooks)y(w);g.hooks=p}(),s.walkTokens){var d=le.defaults.walkTokens;g.walkTokens=function(p){var y=[];return y.push(s.walkTokens.call(this,p)),d&&(y=y.concat(d.call(this,p))),y}}le.setOptions(g)})};le.walkTokens=function(o,f){for(var c=[],l=function(){var p=g.value;switch(c=c.concat(f.call(le,p)),p.type){case"table":{for(var y=sn(p.header),w;!(w=y()).done;){var D=w.value;c=c.concat(le.walkTokens(D.tokens,f))}for(var S=sn(p.rows),F;!(F=S()).done;)for(var T=F.value,z=sn(T),N;!(N=z()).done;){var A=N.value;c=c.concat(le.walkTokens(A.tokens,f))}break}case"list":{c=c.concat(le.walkTokens(p.items,f));break}default:le.defaults.extensions&&le.defaults.extensions.childTokens&&le.defaults.extensions.childTokens[p.type]?le.defaults.extensions.childTokens[p.type].forEach(function(B){c=c.concat(le.walkTokens(p[B],f))}):p.tokens&&(c=c.concat(le.walkTokens(p.tokens,f)))}},s=sn(o),g;!(g=s()).done;)l();return c};le.parseInline=vu(_r.lexInline,Wr.parseInline);le.Parser=Wr;le.parser=Wr.parse;le.Renderer=hn;le.TextRenderer=ta;le.Lexer=_r;le.lexer=_r.lex;le.Tokenizer=dn;le.Slugger=ra;le.Hooks=Ci;le.parse=le;var gd=le.options,vd=le.setOptions,md=le.use,yd=le.walkTokens,bd=le.parseInline,xd=le,Dd=Wr.parse,wd=_r.lex;Se.Hooks=Ci;Se.Lexer=_r;Se.Parser=Wr;Se.Renderer=hn;Se.Slugger=ra;Se.TextRenderer=ta;Se.Tokenizer=dn;Se.getDefaults=ea;Se.lexer=wd;Se.marked=le;Se.options=gd;Se.parse=xd;Se.parseInline=bd;Se.parser=Dd;Se.setOptions=vd;Se.use=md;Se.walkTokens=yd});var Au=Ye((dh,Eu)=>{"use strict";var qr=ct();ks();Fs();Ls();Qo();Jo();Ws();js();Xs();Qs();Vs();Zo();var Cd=nu(),ia=mu().marked,xu=/Mac/.test(navigator.platform),kd=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),ki={toggleBold:vn,toggleItalic:mn,drawLink:Ln,toggleHeadingSmaller:Si,toggleHeadingBigger:Dn,drawImage:Tn,toggleBlockquote:xn,toggleOrderedList:Fn,toggleUnorderedList:Sn,toggleCheckList:En,toggleCodeBlock:bn,togglePreview:zn,toggleStrikethrough:yn,toggleHeading1:wn,toggleHeading2:Cn,toggleHeading3:kn,toggleHeading4:oa,toggleHeading5:aa,toggleHeading6:la,cleanBlock:An,drawTable:Mn,drawHorizontalRule:Bn,undo:Nn,redo:In,toggleSideBySide:Ur,toggleFullScreen:gr},Sd={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Fd=function(o){for(var f in ki)if(ki[f]===o)return f;return null},na=function(){var o=!1;return function(f){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(f)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(f.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};function Ed(o){for(var f;(f=kd.exec(o))!==null;){var c=f[0];if(c.indexOf("target=")===-1){var l=c.replace(/>$/,' target="_blank">');o=o.replace(c,l)}}return o}function Ad(o){for(var f=new DOMParser,c=f.parseFromString(o,"text/html"),l=c.getElementsByTagName("li"),s=0;s<l.length;s++)for(var g=l[s],d=0;d<g.children.length;d++){var p=g.children[d];p instanceof HTMLInputElement&&p.type==="checkbox"&&(g.style.marginLeft="-1.5em",g.style.listStyleType="none")}return c.documentElement.innerHTML}function Du(o){return xu?o=o.replace("Ctrl","Cmd"):o=o.replace("Cmd","Ctrl"),o}function Ld(o,f,c,l){var s=pn(o,!1,f,c,"button",l);s.classList.add("easymde-dropdown"),s.onclick=function(){s.focus()};var g=document.createElement("div");g.className="easymde-dropdown-content";for(var d=0;d<o.children.length;d++){var p=o.children[d],y;typeof p=="string"&&p in pr?y=pn(pr[p],!0,f,c,"button",l):y=pn(p,!0,f,c,"button",l),y.addEventListener("click",function(w){w.stopPropagation()},!1),g.appendChild(y)}return s.appendChild(g),s}function pn(o,f,c,l,s,g){o=o||{};var d=document.createElement(s);if(o.attributes)for(var p in o.attributes)Object.prototype.hasOwnProperty.call(o.attributes,p)&&d.setAttribute(p,o.attributes[p]);var y=g.options.toolbarButtonClassPrefix?g.options.toolbarButtonClassPrefix+"-":"";d.className=y+o.name,d.setAttribute("type",s),c=c??!0,o.text&&(d.innerText=o.text),o.name&&o.name in l&&(ki[o.name]=o.action),o.title&&c&&(d.title=Md(o.title,o.action,l),xu&&(d.title=d.title.replace("Ctrl","\u2318"),d.title=d.title.replace("Alt","\u2325"))),o.title&&d.setAttribute("aria-label",o.title),o.noDisable&&d.classList.add("no-disable"),o.noMobile&&d.classList.add("no-mobile");var w=[];typeof o.className<"u"&&(w=o.className.split(" "));for(var D=[],S=0;S<w.length;S++){var F=w[S];F.match(/^fa([srlb]|(-[\w-]*)|$)/)?D.push(F):d.classList.add(F)}if(d.tabIndex=-1,D.length>0){for(var T=document.createElement("i"),z=0;z<D.length;z++){var N=D[z];T.classList.add(N)}d.appendChild(T)}return typeof o.icon<"u"&&(d.innerHTML=o.icon),o.action&&f&&(typeof o.action=="function"?d.onclick=function(A){A.preventDefault(),o.action(g)}:typeof o.action=="string"&&(d.onclick=function(A){A.preventDefault(),window.open(o.action,"_blank")})),d}function Td(){var o=document.createElement("i");return o.className="separator",o.innerHTML="|",o}function Md(o,f,c){var l,s=o;return f&&(l=Fd(f),c[l]&&(s+=" ("+Du(c[l])+")")),s}function Vt(o,f){f=f||o.getCursor("start");var c=o.getTokenAt(f);if(!c.type)return{};for(var l=c.type.split(" "),s={},g,d,p=0;p<l.length;p++)g=l[p],g==="strong"?s.bold=!0:g==="variable-2"?(d=o.getLine(f.line),/^\s*\d+\.\s/.test(d)?s["ordered-list"]=!0:/^\s*- \[[ xX]]\s/.test(d)?s["check-list"]=!0:s["unordered-list"]=!0):g==="atom"?s.quote=!0:g==="em"?s.italic=!0:g==="quote"?s.quote=!0:g==="strikethrough"?s.strikethrough=!0:g==="comment"?s.code=!0:g==="link"&&!s.image?s.link=!0:g==="image"?s.image=!0:g.match(/^header(-[1-6])?$/)&&(s[g.replace("header","heading")]=!0);return s}var yu="";function gr(o){var f=o.codemirror;f.setOption("fullScreen",!f.getOption("fullScreen")),f.getOption("fullScreen")?(yu=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=yu;var c=f.getWrapperElement(),l=c.nextSibling;if(l.classList.contains("editor-preview-active-side"))if(o.options.sideBySideFullscreen===!1){var s=c.parentNode;f.getOption("fullScreen")?s.classList.remove("sided--no-fullscreen"):s.classList.add("sided--no-fullscreen")}else Ur(o);if(o.options.onToggleFullScreen&&o.options.onToggleFullScreen(f.getOption("fullScreen")||!1),typeof o.options.maxHeight<"u"&&(f.getOption("fullScreen")?(f.getScrollerElement().style.removeProperty("height"),l.style.removeProperty("height")):(f.getScrollerElement().style.height=o.options.maxHeight,o.setPreviewMaxHeight())),o.toolbar_div.classList.toggle("fullscreen"),o.toolbarElements&&o.toolbarElements.fullscreen){var g=o.toolbarElements.fullscreen;g.classList.toggle("active")}}function vn(o){ua(o,"bold",o.options.blockStyles.bold)}function mn(o){ua(o,"italic",o.options.blockStyles.italic)}function yn(o){ua(o,"strikethrough","~~")}function bn(o){var f=o.options.blockStyles.code;function c(U){if(typeof U!="object")throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof U+": "+U;return U.styles&&U.styles[2]&&U.styles[2].indexOf("formatting-code-block")!==-1}function l(U){return U.state.base.base||U.state.base}function s(U,W,V,ve,Te){V=V||U.getLineHandle(W),ve=ve||U.getTokenAt({line:W,ch:1}),Te=Te||!!V.text&&U.getTokenAt({line:W,ch:V.text.length-1});var mt=ve.type?ve.type.split(" "):[];return Te&&l(Te).indentedCode?"indented":mt.indexOf("comment")===-1?!1:l(ve).fencedChars||l(Te).fencedChars||c(V)?"fenced":"single"}function g(U,W,V,ve){var Te=W.line+1,mt=V.line+1,k=W.line!==V.line,b=ve+`
`,ee=`
`+ve;k&&mt++,k&&V.ch===0&&(ee=ve+`
`,mt--),vr(U,!1,[b,ee]),U.setSelection({line:Te,ch:0},{line:mt,ch:0})}var d=o.codemirror,p=d.getCursor("start"),y=d.getCursor("end"),w=d.getTokenAt({line:p.line,ch:p.ch||1}),D=d.getLineHandle(p.line),S=s(d,p.line,D,w),F,T,z;if(S==="single"){var N=D.text.slice(0,p.ch).replace("`",""),A=D.text.slice(p.ch).replace("`","");d.replaceRange(N+A,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch--,p!==y&&y.ch--,d.setSelection(p,y),d.focus()}else if(S==="fenced")if(p.line!==y.line||p.ch!==y.ch){for(F=p.line;F>=0&&(D=d.getLineHandle(F),!c(D));F--);var B=d.getTokenAt({line:F,ch:1}),I=l(B).fencedChars,R,H,_,X;c(d.getLineHandle(p.line))?(R="",H=p.line):c(d.getLineHandle(p.line-1))?(R="",H=p.line-1):(R=I+`
`,H=p.line),c(d.getLineHandle(y.line))?(_="",X=y.line,y.ch===0&&(X+=1)):y.ch!==0&&c(d.getLineHandle(y.line+1))?(_="",X=y.line+1):(_=I+`
`,X=y.line+1),y.ch===0&&(X-=1),d.operation(function(){d.replaceRange(_,{line:X,ch:0},{line:X+(_?0:1),ch:0}),d.replaceRange(R,{line:H,ch:0},{line:H+(R?0:1),ch:0})}),d.setSelection({line:H+(R?1:0),ch:0},{line:X+(R?1:-1),ch:0}),d.focus()}else{var K=p.line;if(c(d.getLineHandle(p.line))&&(s(d,p.line+1)==="fenced"?(F=p.line,K=p.line+1):(T=p.line,K=p.line-1)),F===void 0)for(F=K;F>=0&&(D=d.getLineHandle(F),!c(D));F--);if(T===void 0)for(z=d.lineCount(),T=K;T<z&&(D=d.getLineHandle(T),!c(D));T++);d.operation(function(){d.replaceRange("",{line:F,ch:0},{line:F+1,ch:0}),d.replaceRange("",{line:T-1,ch:0},{line:T,ch:0})}),d.focus()}else if(S==="indented"){if(p.line!==y.line||p.ch!==y.ch)F=p.line,T=y.line,y.ch===0&&T--;else{for(F=p.line;F>=0;F--)if(D=d.getLineHandle(F),!D.text.match(/^\s*$/)&&s(d,F,D)!=="indented"){F+=1;break}for(z=d.lineCount(),T=p.line;T<z;T++)if(D=d.getLineHandle(T),!D.text.match(/^\s*$/)&&s(d,T,D)!=="indented"){T-=1;break}}var ge=d.getLineHandle(T+1),G=ge&&d.getTokenAt({line:T+1,ch:ge.text.length-1}),ue=G&&l(G).indentedCode;ue&&d.replaceRange(`
`,{line:T+1,ch:0});for(var ae=F;ae<=T;ae++)d.indentLine(ae,"subtract");d.focus()}else{var de=p.line===y.line&&p.ch===y.ch&&p.ch===0,L=p.line!==y.line;de||L?g(d,p,y,f):vr(d,!1,["`","`"])}}function xn(o){On(o.codemirror,"quote")}function Si(o){er(o.codemirror,"smaller")}function Dn(o){er(o.codemirror,"bigger")}function wn(o){er(o.codemirror,void 0,1)}function Cn(o){er(o.codemirror,void 0,2)}function kn(o){er(o.codemirror,void 0,3)}function oa(o){er(o.codemirror,void 0,4)}function aa(o){er(o.codemirror,void 0,5)}function la(o){er(o.codemirror,void 0,6)}function Sn(o){var f=o.codemirror,c="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(c=o.options.unorderedListStyle),On(f,"unordered-list",c)}function Fn(o){On(o.codemirror,"ordered-list")}function En(o){On(o.codemirror,"check-list")}function An(o){Bd(o.codemirror)}function Ln(o){var f=o.options,c="https://";if(f.promptURLs){var l=prompt(f.promptTexts.link,c);if(!l)return!1;c=wu(l)}ku(o,"link",f.insertTexts.link,c)}function Tn(o){var f=o.options,c="https://";if(f.promptURLs){var l=prompt(f.promptTexts.image,c);if(!l)return!1;c=wu(l)}ku(o,"image",f.insertTexts.image,c)}function wu(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function sa(o){o.openBrowseFileWindow()}function Cu(o,f){var c=o.codemirror,l=Vt(c),s=o.options,g=f.substr(f.lastIndexOf("/")+1),d=g.substring(g.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(d))vr(c,l.image,s.insertTexts.uploadedImage,f);else{var p=s.insertTexts.link;p[0]="["+g,vr(c,l.link,p,f)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",g)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Mn(o){var f=o.codemirror,c=Vt(f),l=o.options;vr(f,c.table,l.insertTexts.table)}function Bn(o){var f=o.codemirror,c=Vt(f),l=o.options;vr(f,c.image,l.insertTexts.horizontalRule)}function Nn(o){var f=o.codemirror;f.undo(),f.focus()}function In(o){var f=o.codemirror;f.redo(),f.focus()}function Ur(o){var f=o.codemirror,c=f.getWrapperElement(),l=c.nextSibling,s=o.toolbarElements&&o.toolbarElements["side-by-side"],g=!1,d=c.parentNode;l.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&d.classList.remove("sided--no-fullscreen"),l.classList.remove("editor-preview-active-side"),s&&s.classList.remove("active"),c.classList.remove("CodeMirror-sided")):(setTimeout(function(){f.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?d.classList.add("sided--no-fullscreen"):gr(o)),l.classList.add("editor-preview-active-side")},1),s&&s.classList.add("active"),c.classList.add("CodeMirror-sided"),g=!0);var p=c.lastChild;if(p.classList.contains("editor-preview-active")){p.classList.remove("editor-preview-active");var y=o.toolbarElements.preview,w=o.toolbar_div;y.classList.remove("active"),w.classList.remove("disabled-for-preview")}var D=function(){var F=o.options.previewRender(o.value(),l);F!=null&&(l.innerHTML=F)};if(f.sideBySideRenderingFunction||(f.sideBySideRenderingFunction=D),g){var S=o.options.previewRender(o.value(),l);S!=null&&(l.innerHTML=S),f.on("update",f.sideBySideRenderingFunction)}else f.off("update",f.sideBySideRenderingFunction);f.refresh()}function zn(o){var f=o.codemirror,c=f.getWrapperElement(),l=o.toolbar_div,s=o.options.toolbar?o.toolbarElements.preview:!1,g=c.lastChild,d=f.getWrapperElement().nextSibling;if(d.classList.contains("editor-preview-active-side")&&Ur(o),!g||!g.classList.contains("editor-preview-full")){if(g=document.createElement("div"),g.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var p=0;p<o.options.previewClass.length;p++)g.classList.add(o.options.previewClass[p]);else typeof o.options.previewClass=="string"&&g.classList.add(o.options.previewClass);c.appendChild(g)}g.classList.contains("editor-preview-active")?(g.classList.remove("editor-preview-active"),s&&(s.classList.remove("active"),l.classList.remove("disabled-for-preview"))):(setTimeout(function(){g.classList.add("editor-preview-active")},1),s&&(s.classList.add("active"),l.classList.add("disabled-for-preview")));var y=o.options.previewRender(o.value(),g);y!==null&&(g.innerHTML=y)}function vr(o,f,c,l){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var s,g=c[0],d=c[1],p={},y={};Object.assign(p,o.getCursor("start")),Object.assign(y,o.getCursor("end")),l&&(g=g.replace("#url#",l),d=d.replace("#url#",l)),f?(s=o.getLine(p.line),g=s.slice(0,p.ch),d=s.slice(p.ch),o.replaceRange(g+d,{line:p.line,ch:0})):(s=o.getSelection(),o.replaceSelection(g+s+d),p.ch+=g.length,p!==y&&(y.ch+=g.length)),o.setSelection(p,y),o.focus()}}function er(o,f,c){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var l=o.getCursor("start"),s=o.getCursor("end"),g=l.line;g<=s.line;g++)(function(d){var p=o.getLine(d),y=p.search(/[^#]/);f!==void 0?y<=0?f=="bigger"?p="###### "+p:p="# "+p:y==6&&f=="smaller"?p=p.substr(7):y==1&&f=="bigger"?p=p.substr(2):f=="bigger"?p=p.substr(1):p="#"+p:y<=0?p="#".repeat(c)+" "+p:y==c?p=p.substr(y+1):p="#".repeat(c)+" "+p.substr(y+1),o.replaceRange(p,{line:d,ch:0},{line:d,ch:99999999999999})})(g);o.focus()}}function On(o,f,c){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var l=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,s=/^\s*/,g=Vt(o),d=o.getCursor("start"),p=o.getCursor("end"),y={quote:/^(\s*)>\s+/,"unordered-list":l,"ordered-list":l,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},w=function(B,I){var R={quote:">","unordered-list":c,"ordered-list":"%%i.","check-list":"- [ ]"};return R[B].replace("%%i",I)},D=function(B,I){var R={quote:">","unordered-list":"\\"+c,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},H=new RegExp(R[B]);return I&&H.test(I)},S=function(B,I,R){var H=l.exec(I),_=w(B,F);return H!==null?(D(B,H[2])&&(_=""),I=H[1]+_+H[3]+I.replace(s,"").replace(y[B],"$1")):R==!1&&(I=_+" "+I),I},F=1,T=["unordered-list","ordered-list","check-list"],z=Object.keys(g)[0];if(!T.includes(z)){var N=o.getLine(d.line);/^\s*- \[[ xX]]\s/.test(N)?z="check-list":/^\s*\d+\.\s/.test(N)?z="ordered-list":/^\s*[*\-+]\s/.test(N)&&(z="unordered-list")}for(var A=d.line;A<=p.line;A++)(function(B){var I=o.getLine(B);g[f]?I=I.replace(y[f],"$1"):T.includes(z)&&T.includes(f)?(I=I.replace(y[z],"$1"),I=S(f,I,!1),F+=1):(I=S(f,I,!1),F+=1),o.replaceRange(I,{line:B,ch:0},{line:B,ch:99999999999999})})(A);o.focus()}}function ku(o,f,c,l){if(!(!o.codemirror||o.isPreviewActive())){var s=o.codemirror,g=Vt(s),d=g[f];if(!d){vr(s,d,c,l);return}var p=s.getCursor("start"),y=s.getCursor("end"),w=s.getLine(p.line),D=w.slice(0,p.ch),S=w.slice(p.ch);f=="link"?D=D.replace(/(.*)[^!]\[/,"$1"):f=="image"&&(D=D.replace(/(.*)!\[$/,"$1")),S=S.replace(/]\(.*?\)/,""),s.replaceRange(D+S,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch-=c[0].length,p!==y&&(y.ch-=c[0].length),s.setSelection(p,y),s.focus()}}function ua(o,f,c,l){if(!(!o.codemirror||o.isPreviewActive())){l=typeof l>"u"?c:l;var s=o.codemirror,g=Vt(s),d,p=c,y=l,w=s.getCursor("start"),D=s.getCursor("end");g[f]?(d=s.getLine(w.line),p=d.slice(0,w.ch),y=d.slice(w.ch),f=="bold"?(p=p.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),y=y.replace(/(\*\*|__)/,"")):f=="italic"?(p=p.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),y=y.replace(/(\*|_)/,"")):f=="strikethrough"&&(p=p.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),y=y.replace(/(\*\*|~~)/,"")),s.replaceRange(p+y,{line:w.line,ch:0},{line:w.line,ch:99999999999999}),f=="bold"||f=="strikethrough"?(w.ch-=2,w!==D&&(D.ch-=2)):f=="italic"&&(w.ch-=1,w!==D&&(D.ch-=1))):(d=s.getSelection(),f=="bold"?(d=d.split("**").join(""),d=d.split("__").join("")):f=="italic"?(d=d.split("*").join(""),d=d.split("_").join("")):f=="strikethrough"&&(d=d.split("~~").join("")),s.replaceSelection(p+d+y),w.ch+=c.length,D.ch=w.ch+d.length),s.setSelection(w,D),s.focus()}}function Bd(o){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var f=o.getCursor("start"),c=o.getCursor("end"),l,s=f.line;s<=c.line;s++)l=o.getLine(s),l=l.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),o.replaceRange(l,{line:s,ch:0},{line:s,ch:99999999999999})}function gn(o,f){if(Math.abs(o)<1024)return""+o+f[0];var c=0;do o/=1024,++c;while(Math.abs(o)>=1024&&c<f.length);return""+o.toFixed(1)+f[c]}function Su(o,f){for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(f[c]instanceof Array?o[c]=f[c].concat(o[c]instanceof Array?o[c]:[]):f[c]!==null&&typeof f[c]=="object"&&f[c].constructor===Object?o[c]=Su(o[c]||{},f[c]):o[c]=f[c]);return o}function Pt(o){for(var f=1;f<arguments.length;f++)o=Su(o,arguments[f]);return o}function bu(o){var f=/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,c=o.match(f),l=0;if(c===null)return l;for(var s=0;s<c.length;s++)c[s].charCodeAt(0)>=19968?l+=c[s].length:l+=1;return l}var ke={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","check-list":"fa fa-check-square-o","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},pr={bold:{name:"bold",action:vn,className:ke.bold,title:"Bold",default:!0},italic:{name:"italic",action:mn,className:ke.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:yn,className:ke.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:Si,className:ke.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:Si,className:ke["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:Dn,className:ke["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:wn,className:ke["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Cn,className:ke["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:kn,className:ke["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:bn,className:ke.code,title:"Code"},quote:{name:"quote",action:xn,className:ke.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:Sn,className:ke["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Fn,className:ke["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:En,className:ke["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:An,className:ke["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:Ln,className:ke.link,title:"Create Link",default:!0},image:{name:"image",action:Tn,className:ke.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:sa,className:ke["upload-image"],title:"Import an image"},table:{name:"table",action:Mn,className:ke.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Bn,className:ke["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:zn,className:ke.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:Ur,className:ke["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:gr,className:ke.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:ke.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Nn,className:ke.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:In,className:ke.redo,noDisable:!0,title:"Redo"}},Nd={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",`
| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Text | Text | Text |
`],horizontalRule:["",`
-----
`]},Id={link:"URL for the link:",image:"URL of the image:"},zd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Od={bold:"**",code:"```",italic:"*"},Hd={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Rd={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function J(o){o=o||{},o.parent=this;var f=!0;if(o.autoDownloadFontAwesome===!1&&(f=!1),o.autoDownloadFontAwesome!==!0)for(var c=document.styleSheets,l=0;l<c.length;l++)c[l].href&&c[l].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(f=!1);if(f){var s=document.createElement("link");s.rel="stylesheet",s.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(s)}if(o.element)this.element=o.element;else if(o.element===null){console.log("EasyMDE: Error. No element was found.");return}if(o.toolbar===void 0){o.toolbar=[];for(var g in pr)Object.prototype.hasOwnProperty.call(pr,g)&&(g.indexOf("separator-")!=-1&&o.toolbar.push("|"),(pr[g].default===!0||o.showIcons&&o.showIcons.constructor===Array&&o.showIcons.indexOf(g)!=-1)&&o.toolbar.push(g))}if(Object.prototype.hasOwnProperty.call(o,"previewClass")||(o.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(o,"status")||(o.status=["autosave","lines","words","cursor"],o.uploadImage&&o.status.unshift("upload-image")),o.previewRender||(o.previewRender=function(p){return this.parent.markdown(p)}),o.parsingConfig=Pt({highlightFormatting:!0},o.parsingConfig||{}),o.insertTexts=Pt({},Nd,o.insertTexts||{}),o.promptTexts=Pt({},Id,o.promptTexts||{}),o.blockStyles=Pt({},Od,o.blockStyles||{}),o.autosave!=null&&(o.autosave.timeFormat=Pt({},zd,o.autosave.timeFormat||{})),o.iconClassMap=Pt({},ke,o.iconClassMap||{}),o.shortcuts=Pt({},Sd,o.shortcuts||{}),o.maxHeight=o.maxHeight||void 0,o.direction=o.direction||"ltr",typeof o.maxHeight<"u"?o.minHeight=o.maxHeight:o.minHeight=o.minHeight||"300px",o.errorCallback=o.errorCallback||function(p){alert(p)},o.uploadImage=o.uploadImage||!1,o.imageMaxSize=o.imageMaxSize||2097152,o.imageAccept=o.imageAccept||"image/png, image/jpeg, image/gif, image/avif",o.imageTexts=Pt({},Hd,o.imageTexts||{}),o.errorMessages=Pt({},Rd,o.errorMessages||{}),o.imagePathAbsolute=o.imagePathAbsolute||!1,o.imageCSRFName=o.imageCSRFName||"csrfmiddlewaretoken",o.imageCSRFHeader=o.imageCSRFHeader||!1,o.imageInputName=o.imageInputName||"image",o.autosave!=null&&o.autosave.unique_id!=null&&o.autosave.unique_id!=""&&(o.autosave.uniqueId=o.autosave.unique_id),o.overlayMode&&o.overlayMode.combine===void 0&&(o.overlayMode.combine=!0),this.options=o,this.render(),o.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(o.initialValue),o.uploadImage){var d=this;this.codemirror.on("dragenter",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragend",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragleave",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragover",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("drop",function(p,y){y.stopPropagation(),y.preventDefault(),o.imageUploadFunction?d.uploadImagesUsingCustomFunction(o.imageUploadFunction,y.dataTransfer.files):d.uploadImages(y.dataTransfer.files)}),this.codemirror.on("paste",function(p,y){o.imageUploadFunction?d.uploadImagesUsingCustomFunction(o.imageUploadFunction,y.clipboardData.files):d.uploadImages(y.clipboardData.files)})}}J.prototype.uploadImages=function(o,f,c){if(o.length!==0){for(var l=[],s=0;s<o.length;s++)l.push(o[s].name),this.uploadImage(o[s],f,c);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",l.join(", ")))}};J.prototype.uploadImagesUsingCustomFunction=function(o,f){if(f.length!==0){for(var c=[],l=0;l<f.length;l++)c.push(f[l].name),this.uploadImageUsingCustomFunction(o,f[l]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",c.join(", ")))}};J.prototype.updateStatusBar=function(o,f){if(this.gui.statusbar){var c=this.gui.statusbar.getElementsByClassName(o);c.length===1?this.gui.statusbar.getElementsByClassName(o)[0].textContent=f:c.length===0?console.log("EasyMDE: status bar item "+o+" was not found."):console.log("EasyMDE: Several status bar items named "+o+" was found.")}};J.prototype.markdown=function(o){if(ia){var f;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?f=this.options.renderingConfig.markedOptions:f={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?f.breaks=!1:f.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var c=this.options.renderingConfig.hljs||window.hljs;c&&(f.highlight=function(s,g){return g&&c.getLanguage(g)?c.highlight(g,s).value:c.highlightAuto(s).value})}ia.use(f);var l=ia.parse(o);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(l=this.options.renderingConfig.sanitizerFunction.call(this,l)),l=Ed(l),l=Ad(l),l}};J.prototype.render=function(o){if(o||(o=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===o)return;this.element=o;var f=this.options,c=this,l={};for(var s in f.shortcuts)f.shortcuts[s]!==null&&ki[s]!==null&&function(A){l[Du(f.shortcuts[A])]=function(){var B=ki[A];typeof B=="function"?B(c):typeof B=="string"&&window.open(B,"_blank")}}(s);l.Enter="newlineAndIndentContinueMarkdownList",l.Tab="tabAndIndentMarkdownList",l["Shift-Tab"]="shiftTabAndUnindentMarkdownList",l.Esc=function(A){A.getOption("fullScreen")&&gr(c)},this.documentOnKeyDown=function(A){A=A||window.event,A.keyCode==27&&c.codemirror.getOption("fullScreen")&&gr(c)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var g,d;f.overlayMode?(qr.defineMode("overlay-mode",function(A){return qr.overlayMode(qr.getMode(A,f.spellChecker!==!1?"spell-checker":"gfm"),f.overlayMode.mode,f.overlayMode.combine)}),g="overlay-mode",d=f.parsingConfig,d.gitHubSpice=!1):(g=f.parsingConfig,g.name="gfm",g.gitHubSpice=!1),f.spellChecker!==!1&&(g="spell-checker",d=f.parsingConfig,d.name="gfm",d.gitHubSpice=!1,typeof f.spellChecker=="function"?f.spellChecker({codeMirrorInstance:qr}):Cd({codeMirrorInstance:qr}));function p(A,B,I){return{addNew:!1}}if(this.codemirror=qr.fromTextArea(o,{mode:g,backdrop:d,theme:f.theme!=null?f.theme:"easymde",tabSize:f.tabSize!=null?f.tabSize:2,indentUnit:f.tabSize!=null?f.tabSize:2,indentWithTabs:f.indentWithTabs!==!1,lineNumbers:f.lineNumbers===!0,autofocus:f.autofocus===!0,extraKeys:l,direction:f.direction,lineWrapping:f.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:f.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:f.styleSelectedText!=null?f.styleSelectedText:!na(),scrollbarStyle:f.scrollbarStyle!=null?f.scrollbarStyle:"native",configureMouse:p,inputStyle:f.inputStyle!=null?f.inputStyle:na()?"contenteditable":"textarea",spellcheck:f.nativeSpellcheck!=null?f.nativeSpellcheck:!0,autoRefresh:f.autoRefresh!=null?f.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=f.minHeight,typeof f.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=f.maxHeight),f.forceSync===!0){var y=this.codemirror;y.on("change",function(){y.save()})}this.gui={};var w=document.createElement("div");w.classList.add("EasyMDEContainer"),w.setAttribute("role","application");var D=this.codemirror.getWrapperElement();D.parentNode.insertBefore(w,D),w.appendChild(D),f.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),f.status!==!1&&(this.gui.statusbar=this.createStatusbar()),f.autosave!=null&&f.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(c._autosave_timeout),c._autosave_timeout=setTimeout(function(){c.autosave()},c.options.autosave.submit_delay||c.options.autosave.delay||1e3)}));function S(A,B){var I,R=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return A<R?I=B+"px":I=B/A*100+"%",I}var F=this;function T(A,B){var I=new URL(B.url,document.baseURI).href;A.setAttribute("data-img-src",I),A.setAttribute("style","--bg-image:url("+I+");--width:"+B.naturalWidth+"px;--height:"+S(B.naturalWidth,B.naturalHeight)),F.codemirror.setSize()}function z(){f.previewImagesInEditor&&w.querySelectorAll(".cm-image-marker").forEach(function(A){var B=A.parentElement;if(B.innerText.match(/^!\[.*?\]\(.*\)/g)&&!B.hasAttribute("data-img-src")){var I=B.innerText.match(/!\[.*?\]\((.*?)\)/);if(window.EMDEimagesCache||(window.EMDEimagesCache={}),I&&I.length>=2){var R=I[1];if(f.imagesPreviewHandler){var H=f.imagesPreviewHandler(I[1]);typeof H=="string"&&(R=H)}if(window.EMDEimagesCache[R])T(B,window.EMDEimagesCache[R]);else{window.EMDEimagesCache[R]={};var _=document.createElement("img");_.onload=function(){window.EMDEimagesCache[R]={naturalWidth:_.naturalWidth,naturalHeight:_.naturalHeight,url:R},T(B,window.EMDEimagesCache[R])},_.src=R}}}})}this.codemirror.on("update",function(){z()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(f.autofocus===!0||o.autofocus)&&this.codemirror.focus();var N=this.codemirror;setTimeout(function(){N.refresh()}.bind(N),0)};J.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Fu(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}J.prototype.autosave=function(){if(Fu()){var o=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(o.element.form!=null&&o.element.form!=null&&o.element.form.addEventListener("submit",function(){clearTimeout(o.autosaveTimeoutId),o.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+o.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var f=o.value();f!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,f):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var c=document.getElementById("autosaved");if(c!=null&&c!=null&&c!=""){var l=new Date,s=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(l),g=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;c.innerHTML=g+s}}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.clearAutosavedValue=function(){if(Fu()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.openBrowseFileWindow=function(o,f){var c=this,l=this.gui.toolbar.getElementsByClassName("imageInput")[0];l.click();function s(g){c.options.imageUploadFunction?c.uploadImagesUsingCustomFunction(c.options.imageUploadFunction,g.target.files):c.uploadImages(g.target.files,o,f),l.removeEventListener("change",s)}l.addEventListener("change",s)};J.prototype.uploadImage=function(o,f,c){var l=this;f=f||function(w){Cu(l,w)};function s(y){l.updateStatusBar("upload-image",y),setTimeout(function(){l.updateStatusBar("upload-image",l.options.imageTexts.sbInit)},1e4),c&&typeof c=="function"&&c(y),l.options.errorCallback(y)}function g(y){var w=l.options.imageTexts.sizeUnits.split(",");return y.replace("#image_name#",o.name).replace("#image_size#",gn(o.size,w)).replace("#image_max_size#",gn(l.options.imageMaxSize,w))}if(o.size>this.options.imageMaxSize){s(g(this.options.errorMessages.fileTooLarge));return}var d=new FormData;d.append("image",o),l.options.imageCSRFToken&&!l.options.imageCSRFHeader&&d.append(l.options.imageCSRFName,l.options.imageCSRFToken);var p=new XMLHttpRequest;p.upload.onprogress=function(y){if(y.lengthComputable){var w=""+Math.round(y.loaded*100/y.total);l.updateStatusBar("upload-image",l.options.imageTexts.sbProgress.replace("#file_name#",o.name).replace("#progress#",w))}},p.open("POST",this.options.imageUploadEndpoint),l.options.imageCSRFToken&&l.options.imageCSRFHeader&&p.setRequestHeader(l.options.imageCSRFName,l.options.imageCSRFToken),p.onload=function(){try{var y=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),s(g(l.options.errorMessages.importError));return}this.status===200&&y&&!y.error&&y.data&&y.data.filePath?f((l.options.imagePathAbsolute?"":window.location.origin+"/")+y.data.filePath):y.error&&y.error in l.options.errorMessages?s(g(l.options.errorMessages[y.error])):y.error?s(g(y.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),s(g(l.options.errorMessages.importError)))},p.onerror=function(y){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+y.target.status+" ("+y.target.statusText+")"),s(l.options.errorMessages.importError)},p.send(d)};J.prototype.uploadImageUsingCustomFunction=function(o,f){var c=this;function l(d){Cu(c,d)}function s(d){var p=g(d);c.updateStatusBar("upload-image",p),setTimeout(function(){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit)},1e4),c.options.errorCallback(p)}function g(d){var p=c.options.imageTexts.sizeUnits.split(",");return d.replace("#image_name#",f.name).replace("#image_size#",gn(f.size,p)).replace("#image_max_size#",gn(c.options.imageMaxSize,p))}o.apply(this,[f,l,s])};J.prototype.setPreviewMaxHeight=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.nextSibling,l=parseInt(window.getComputedStyle(f).paddingTop),s=parseInt(window.getComputedStyle(f).borderTopWidth),g=parseInt(this.options.maxHeight),d=g+l*2+s*2,p=d.toString()+"px";c.style.height=p};J.prototype.createSideBySide=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.nextSibling;if(!c||!c.classList.contains("editor-preview-side")){if(c=document.createElement("div"),c.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var l=0;l<this.options.previewClass.length;l++)c.classList.add(this.options.previewClass[l]);else typeof this.options.previewClass=="string"&&c.classList.add(this.options.previewClass);f.parentNode.insertBefore(c,f.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return c;var s=!1,g=!1;return o.on("scroll",function(d){if(s){s=!1;return}g=!0;var p=d.getScrollInfo().height-d.getScrollInfo().clientHeight,y=parseFloat(d.getScrollInfo().top)/p,w=(c.scrollHeight-c.clientHeight)*y;c.scrollTop=w}),c.onscroll=function(){if(g){g=!1;return}s=!0;var d=c.scrollHeight-c.clientHeight,p=parseFloat(c.scrollTop)/d,y=(o.getScrollInfo().height-o.getScrollInfo().clientHeight)*p;o.scrollTo(0,y)},c};J.prototype.createToolbar=function(o){if(o=o||this.options.toolbar,!(!o||o.length===0)){var f;for(f=0;f<o.length;f++)pr[o[f]]!=null&&(o[f]=pr[o[f]]);var c=document.createElement("div");c.className="editor-toolbar",c.setAttribute("role","toolbar");var l=this,s={};for(l.toolbar=o,f=0;f<o.length;f++)if(!(o[f].name=="guide"&&l.options.toolbarGuideIcon===!1)&&!(l.options.hideIcons&&l.options.hideIcons.indexOf(o[f].name)!=-1)&&!((o[f].name=="fullscreen"||o[f].name=="side-by-side")&&na())){if(o[f]==="|"){for(var g=!1,d=f+1;d<o.length;d++)o[d]!=="|"&&(!l.options.hideIcons||l.options.hideIcons.indexOf(o[d].name)==-1)&&(g=!0);if(!g)continue}(function(w){var D;if(w==="|"?D=Td():w.children?D=Ld(w,l.options.toolbarTips,l.options.shortcuts,l):D=pn(w,!0,l.options.toolbarTips,l.options.shortcuts,"button",l),s[w.name||w]=D,c.appendChild(D),w.name==="upload-image"){var S=document.createElement("input");S.className="imageInput",S.type="file",S.multiple=!0,S.name=l.options.imageInputName,S.accept=l.options.imageAccept,S.style.display="none",S.style.opacity=0,c.appendChild(S)}})(o[f])}l.toolbar_div=c,l.toolbarElements=s;var p=this.codemirror;p.on("cursorActivity",function(){var w=Vt(p);for(var D in s)(function(S){var F=s[S];w[S]?F.classList.add("active"):S!="fullscreen"&&S!="side-by-side"&&F.classList.remove("active")})(D)});var y=p.getWrapperElement();return y.parentNode.insertBefore(c,y),c}};J.prototype.createStatusbar=function(o){o=o||this.options.status;var f=this.options,c=this.codemirror;if(!(!o||o.length===0)){var l=[],s,g,d,p;for(s=0;s<o.length;s++)if(g=void 0,d=void 0,p=void 0,typeof o[s]=="object")l.push({className:o[s].className,defaultValue:o[s].defaultValue,onUpdate:o[s].onUpdate,onActivity:o[s].onActivity});else{var y=o[s];y==="words"?(p=function(T){T.innerHTML=bu(c.getValue())},g=function(T){T.innerHTML=bu(c.getValue())}):y==="lines"?(p=function(T){T.innerHTML=c.lineCount()},g=function(T){T.innerHTML=c.lineCount()}):y==="cursor"?(p=function(T){T.innerHTML="1:1"},d=function(T){var z=c.getCursor(),N=z.line+1,A=z.ch+1;T.innerHTML=N+":"+A}):y==="autosave"?p=function(T){f.autosave!=null&&f.autosave.enabled===!0&&T.setAttribute("id","autosaved")}:y==="upload-image"&&(p=function(T){T.innerHTML=f.imageTexts.sbInit}),l.push({className:y,defaultValue:p,onUpdate:g,onActivity:d})}var w=document.createElement("div");for(w.className="editor-statusbar",s=0;s<l.length;s++){var D=l[s],S=document.createElement("span");S.className=D.className,typeof D.defaultValue=="function"&&D.defaultValue(S),typeof D.onUpdate=="function"&&this.codemirror.on("update",function(T,z){return function(){z.onUpdate(T)}}(S,D)),typeof D.onActivity=="function"&&this.codemirror.on("cursorActivity",function(T,z){return function(){z.onActivity(T)}}(S,D)),w.appendChild(S)}var F=this.codemirror.getWrapperElement();return F.parentNode.insertBefore(w,F.nextSibling),w}};J.prototype.value=function(o){var f=this.codemirror;if(o===void 0)return f.getValue();if(f.getDoc().setValue(o),this.isPreviewActive()){var c=f.getWrapperElement(),l=c.lastChild,s=this.options.previewRender(o,l);s!==null&&(l.innerHTML=s)}return this};J.toggleBold=vn;J.toggleItalic=mn;J.toggleStrikethrough=yn;J.toggleBlockquote=xn;J.toggleHeadingSmaller=Si;J.toggleHeadingBigger=Dn;J.toggleHeading1=wn;J.toggleHeading2=Cn;J.toggleHeading3=kn;J.toggleHeading4=oa;J.toggleHeading5=aa;J.toggleHeading6=la;J.toggleCodeBlock=bn;J.toggleUnorderedList=Sn;J.toggleOrderedList=Fn;J.toggleCheckList=En;J.cleanBlock=An;J.drawLink=Ln;J.drawImage=Tn;J.drawUploadedImage=sa;J.drawTable=Mn;J.drawHorizontalRule=Bn;J.undo=Nn;J.redo=In;J.togglePreview=zn;J.toggleSideBySide=Ur;J.toggleFullScreen=gr;J.prototype.toggleBold=function(){vn(this)};J.prototype.toggleItalic=function(){mn(this)};J.prototype.toggleStrikethrough=function(){yn(this)};J.prototype.toggleBlockquote=function(){xn(this)};J.prototype.toggleHeadingSmaller=function(){Si(this)};J.prototype.toggleHeadingBigger=function(){Dn(this)};J.prototype.toggleHeading1=function(){wn(this)};J.prototype.toggleHeading2=function(){Cn(this)};J.prototype.toggleHeading3=function(){kn(this)};J.prototype.toggleHeading4=function(){oa(this)};J.prototype.toggleHeading5=function(){aa(this)};J.prototype.toggleHeading6=function(){la(this)};J.prototype.toggleCodeBlock=function(){bn(this)};J.prototype.toggleUnorderedList=function(){Sn(this)};J.prototype.toggleOrderedList=function(){Fn(this)};J.prototype.toggleCheckList=function(){En(this)};J.prototype.cleanBlock=function(){An(this)};J.prototype.drawLink=function(){Ln(this)};J.prototype.drawImage=function(){Tn(this)};J.prototype.drawUploadedImage=function(){sa(this)};J.prototype.drawTable=function(){Mn(this)};J.prototype.drawHorizontalRule=function(){Bn(this)};J.prototype.undo=function(){Nn(this)};J.prototype.redo=function(){In(this)};J.prototype.togglePreview=function(){zn(this)};J.prototype.toggleSideBySide=function(){Ur(this)};J.prototype.toggleFullScreen=function(){gr(this)};J.prototype.isPreviewActive=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.lastChild;return c.classList.contains("editor-preview-active")};J.prototype.isSideBySideActive=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.nextSibling;return c.classList.contains("editor-preview-active-side")};J.prototype.isFullscreenActive=function(){var o=this.codemirror;return o.getOption("fullScreen")};J.prototype.getState=function(){var o=this.codemirror;return Vt(o)};J.prototype.toTextArea=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.parentNode;c&&(this.gui.toolbar&&c.removeChild(this.gui.toolbar),this.gui.statusbar&&c.removeChild(this.gui.statusbar),this.gui.sideBySide&&c.removeChild(this.gui.sideBySide)),c.parentNode.insertBefore(f,c),c.remove(),o.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};Eu.exports=J});var mr=Xc(Au());function Pd(){var o=document.querySelector('textarea[name="data[content]"]');if(!o)return null;var f=new mr.default({element:o,spellChecker:!1,autoDownloadFontAwesome:!1,status:!1,placeholder:"What happened today?",minHeight:"180px",toolbar:[{name:"bold",action:mr.default.toggleBold,className:"mde-btn mde-bold",title:"Bold"},{name:"italic",action:mr.default.toggleItalic,className:"mde-btn mde-italic",title:"Italic"},{name:"unordered-list",action:mr.default.toggleUnorderedList,className:"mde-btn mde-ul",title:"Bulleted list"},{name:"link",action:mr.default.drawLink,className:"mde-btn mde-link",title:"Insert link"},"|",{name:"preview",action:mr.default.togglePreview,className:"mde-btn mde-preview",title:"Toggle preview"}]});f.codemirror.on("change",function(){f.codemirror.save()});var c=o.closest("form");return c&&c.addEventListener("submit",function(){f.codemirror.save()},!0),f}var _d=["heic","heix","heif","hevc","hevx","mif1","msf1","heim","heis","hevm","hevs"];function Wd(o){return o.slice(0,64).arrayBuffer().then(function(f){var c=new Uint8Array(f);if(c.length<12||String.fromCharCode(c[4],c[5],c[6],c[7])!=="ftyp")return!1;for(var l="",s=8;s+4<=c.length;s+=4)l+=String.fromCharCode(c[s],c[s+1],c[s+2],c[s+3]).toLowerCase();return _d.some(function(g){return l.indexOf(g)!==-1})}).catch(function(){return!1})}function qd(o){var f=String(o||"photo").replace(/\.[^.]+$/,"");return f=f.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),(f||"photo")+".jpg"}function Lu(){var o=document.querySelector(".filepond-root, .form-input-file");if(!o||!o.parentNode)return null;var f=o.parentNode.querySelector(".photo-convert-status");return f||(f=document.createElement("p"),f.className="photo-convert-status form-status",f.setAttribute("role","status"),o.parentNode.insertBefore(f,o.nextSibling)),f}function Ud(){var o=document.querySelector(".filepond-root, .form-input-file");if(!o)return null;var f=o.closest(".form-field");if(!f)return null;var c=f.querySelector(".form-label"),l=document.createElement("details");l.className="photos-collapse",l.open=!0;var s=document.createElement("summary");for(s.className="photos-collapse__summary",s.textContent="Photos (1\u20136)",l.appendChild(s);f.firstChild;)l.appendChild(f.firstChild);return f.appendChild(l),c&&(c.style.display="none"),{details:l,summary:s}}function jd(){var o=document.querySelector('form[name="new-entry"]');if(!o)return;var f=0,c=Ud(),l=null;o.addEventListener("submit",function(){if(l){var D=l.getFiles();if(D.length){var S=o.querySelector('input[name="photo_order"]');S||(S=document.createElement("input"),S.type="hidden",S.name="photo_order",o.appendChild(S)),S.value=JSON.stringify(D.map(function(F){return F.filename}))}}},!0);function s(D,S){var F=Lu();F&&(F.textContent=D||"",F.className="photo-convert-status form-status"+(S?" form-status--"+S:""))}function g(){if(c){var D=document.querySelectorAll(".filepond--item[data-filepond-item-state]"),S=D.length,F=0;Array.prototype.forEach.call(D,function(T){T.getAttribute("data-filepond-item-state")==="processing-complete"&&F++}),f>0||S>0&&F<S?(c.summary.textContent=f>0?"Converting "+f+" photo"+(f>1?"s":"")+"\u2026":"Uploading "+S+" photo"+(S>1?"s":"")+"\u2026",c.details.open=!0):S>0?(c.summary.textContent="\u2713 "+S+" photo"+(S>1?"s":"")+" ready \u2014 tap to review",c.details.open=!1):(c.summary.textContent="Photos (1\u20136)",c.details.open=!0)}}function d(){g(),setTimeout(g,150),setTimeout(g,500)}function p(){var D=o.querySelector('button[type="submit"], input[type="submit"]');if(D&&(D.disabled=f>0),f>0)s("Converting "+f+" photo"+(f>1?"s":"")+"\u2026");else{var S=Lu();S&&/Converting/.test(S.textContent)&&s("")}g()}o.addEventListener("submit",function(D){f>0&&(D.preventDefault(),s("Hang on \u2014 a photo is still converting.","err"))},!0);function y(D){return function(S){var F=S&&S.file;return F?Wd(F).then(function(T){return T?(f++,p(),import("./heic-to-CN7JBE7H.js").then(function(z){var N=z.heicTo||z.default&&z.default.heicTo;return N({blob:F,type:"image/jpeg",quality:.85})}).then(function(z){var N=new File([z],qd(F.name),{type:"image/jpeg"});D.addFile(N)}).catch(function(){s("A photo couldn\u2019t be converted and was skipped \u2014 the others are fine.","err")}).then(function(){f--,p()}),!1):!0}):!0}}var w=0;(function D(){var S=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(!S.length){w++<120&&setTimeout(D,50);return}S.forEach(function(F){F&&!F._heicHooked&&(F._heicHooked=!0,F.setOptions({beforeAddFile:y(F),allowReorder:!0,itemInsertLocation:"after"}),l=F,["addfile","processfile","processfiles","removefile","error"].forEach(function(T){try{F.on(T,d)}catch{}}),g())})})()}function vt(o){return document.querySelector('[name="data['+o+']"]')}function Gd(){var o=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(o.length){var f=[];if(o.forEach(function(g){var d=g.closest(".form-field");d&&f.indexOf(d)===-1&&f.push(d)}),!!f.length){var c=document.createElement("details");c.className="more-options";var l=document.createElement("summary");l.className="more-options__summary",l.textContent="More options",c.appendChild(l),f[0].parentNode.insertBefore(c,f[0]),f.forEach(function(g){c.appendChild(g)});var s=f.some(function(g){var d=g.querySelector('input[type="text"]');if(d&&d.value.trim())return!0;var p=g.querySelector('input[type="radio"]:checked');return!!(p&&p.value&&p.value!=="0")});s&&(c.open=!0)}}}var Kd={0:"Sunny",1:"Partly cloudy",2:"Partly cloudy",3:"Cloudy",45:"Foggy",48:"Foggy",51:"Drizzle",53:"Drizzle",55:"Drizzle",56:"Drizzle",57:"Drizzle",61:"Rain",63:"Rain",65:"Rain",66:"Rain",67:"Rain",80:"Rain",81:"Rain",82:"Rain",71:"Snow",73:"Snow",75:"Snow",77:"Snow",85:"Snow",86:"Snow",95:"Thunderstorm",96:"Thunderstorm",99:"Thunderstorm"};function _t(o,f,c){o&&(o.className="form-status"+(c?" form-status--"+c:""),o.textContent=f||"")}function Xd(){var o=document.getElementById("get-location"),f=document.getElementById("get-weather");if(!o&&!f)return;var c=document.getElementById("location-status"),l=document.getElementById("weather-status");function s(){var p=vt("lat"),y=vt("lng"),w=p?p.value.trim():"",D=y?y.value.trim():"";return w&&D?{lat:w,lng:D}:null}function g(){if(f){var p=!!s();f.disabled=!p,f.title=p?"":"Get location first"}}g();function d(p,y){var w=vt("location_city"),D=vt("location_country");if(!((!w||w.value.trim())&&(!D||D.value.trim()))){var S="https://api.bigdatacloud.net/data/reverse-geocode-client?latitude="+encodeURIComponent(p)+"&longitude="+encodeURIComponent(y)+"&localityLanguage=en";fetch(S).then(function(F){return F.json()}).then(function(F){var T=(F.city||F.locality||"").trim(),z=(F.countryName||"").trim();w&&!w.value.trim()&&T&&(w.value=T),D&&!D.value.trim()&&z&&(D.value=z);var N=[T,z].filter(Boolean).join(", ");N&&_t(c,"\u2713 Location captured \xB7 "+N,"ok")}).catch(function(){})}}o&&o.addEventListener("click",function(){if(!navigator.geolocation){_t(c,"Geolocation is not supported on this device.","err");return}o.classList.add("is-loading"),o.disabled=!0,_t(c,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(p){var y=p.coords.latitude.toFixed(6),w=p.coords.longitude.toFixed(6),D=vt("lat"),S=vt("lng");D&&(D.value=y),S&&(S.value=w),o.classList.remove("is-loading"),o.disabled=!1,_t(c,"\u2713 Location captured \xB7 "+y+", "+w,"ok"),g(),d(y,w)},function(p){o.classList.remove("is-loading"),o.disabled=!1,_t(c,"\u2717 "+(p&&p.message?p.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),f&&f.addEventListener("click",function(){var p=s();if(!p){_t(l,"Get location first, then fetch weather.","err");return}f.classList.add("is-loading"),f.disabled=!0,_t(l,"Fetching weather\u2026");var y="https://api.open-meteo.com/v1/forecast?latitude="+p.lat+"&longitude="+p.lng+"&current=temperature_2m,weather_code&temperature_unit=celsius";fetch(y).then(function(w){return w.json()}).then(function(w){var D=Math.round(w.current.temperature_2m),S=Kd[w.current.weather_code]||"Cloudy",F=vt("weather_temp_c"),T=vt("weather_desc");F&&(F.value=D),T&&(T.value=S),f.classList.remove("is-loading"),g(),_t(l,"\u2713 Weather set \xB7 "+S+" \xB7 "+D+"\xB0C (edit above if needed)","ok")}).catch(function(){f.classList.remove("is-loading"),g(),_t(l,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function Yd(){var o=new Date;return o.setSeconds(0,0),o.setMinutes(o.getMinutes()-o.getTimezoneOffset()),o.toISOString().slice(0,16)}function Zd(){var o={title:"Title",date:"Date & time",content:"Content"},f=document.querySelector('form[name="new-entry"]');if(!f)return;var c=vt("date");c&&!String(c.value).trim()&&(c.value=Yd());function l(){f.querySelectorAll(".field-error").forEach(function(d){d.remove()}),f.querySelectorAll(".field-invalid").forEach(function(d){d.classList.remove("field-invalid")})}function s(d,p){d.classList.add("field-invalid");var y=document.createElement("span");y.className="field-error",y.textContent=p,d.parentNode.insertBefore(y,d.nextSibling)}function g(d){var p=f.querySelector(".photos-collapse"),y,w;if(p?(p.open=!0,w=p.querySelector(".photos-collapse__summary"),y=p):(y=document.querySelector(".filepond-root, .form-input-file"),w=y),!w)return y||null;var D=document.createElement("span");return D.className="field-error",D.textContent=d,w.insertAdjacentElement("afterend",D),y||w}f.addEventListener("submit",function(d){l();var p=null;!ha&&document.querySelectorAll(".filepond--item").length<1&&(p=g("Add at least one photo.")),Object.keys(o).forEach(function(y){var w=vt(y);w&&!String(w.value).trim()&&(s(w,o[y]+" is required."),p||(p=w))}),p&&(d.preventDefault(),typeof p.focus=="function"&&p.focus(),p.scrollIntoView({behavior:"smooth",block:"center"}))})}var fa="intotheeast:new-entry-draft";function Qd(o){return Array.prototype.slice.call(o.querySelectorAll('[name^="data["]')).filter(function(f){if(f.type==="file")return!1;var c=f.name;return c.indexOf("data[_json")!==0&&c.indexOf("data[photos")!==0})}function Jd(){var o=document.querySelector(".filepond-root, .form-input-file");if(!(!o||!o.parentNode)&&!o.parentNode.querySelector(".photo-reauth-hint")){var f=document.createElement("p");f.className="photo-reauth-hint is-shown",f.textContent="Your text was restored \u2014 photos need re-selecting (they can\u2019t be saved in a draft).",o.parentNode.insertBefore(f,o.nextSibling)}}function $d(){var o=document.querySelector('form[name="new-entry"]');if(!o||ha)return;if(document.querySelector(".notices.success")){try{localStorage.removeItem(fa)}catch{}return}function f(){var g={};Qd(o).forEach(function(d){d.type==="radio"?d.checked&&(g[d.name]=d.value):g[d.name]=d.value});try{localStorage.setItem(fa,JSON.stringify(g))}catch{}}var c=null;try{c=localStorage.getItem(fa)}catch{c=null}if(c){var l=null;try{l=JSON.parse(c)}catch{l=null}if(l){var s=!1;Object.keys(l).forEach(function(g){var d=l[g];if(d!=null&&String(d).trim()&&(s=!0),g!=="data[content]"){var p=o.querySelectorAll('input[type="radio"][name="'+g+'"]');if(p.length){p.forEach(function(w){w.checked=w.value===d});return}var y=o.querySelector('[name="'+g+'"]');y&&y.type!=="file"&&(y.value=d)}}),window.postFormEditor&&l["data[content]"]!=null&&window.postFormEditor.value(l["data[content]"]),s&&Jd()}}o.addEventListener("input",f),o.addEventListener("change",f),window.postFormEditor&&window.postFormEditor.codemirror.on("change",f)}function Vd(){var o=document.querySelector(".post-form-wrap"),f=document.querySelector(".post-form-wrap .notices.success, .post-form-wrap .notices.green");if(!(!o||!f)){var c=document.createElement("div");c.className="post-success";var l=document.createElement("p");l.className="post-success__title",l.textContent="\u2713 Saved to your journal.",c.appendChild(l);var s=document.createElement("div");s.className="post-success__actions";var g=o.getAttribute("data-trip-url");if(g){var d=document.createElement("a");d.className="post-success__view",d.href=g,d.textContent="View your journal \u2192",s.appendChild(d)}var p=document.createElement("a");p.className="post-success__again",p.href=window.location.pathname,p.textContent="Post another",s.appendChild(p),c.appendChild(s),f.parentNode.insertBefore(c,f.nextSibling),["form",".form-action-row","#location-status","#weather-status"].forEach(function(y){var w=o.querySelector(y);w&&(w.style.display="none")}),f.scrollIntoView({behavior:"smooth",block:"start"})}}var ha=!1;function Tu(o){return new URLSearchParams(window.location.search).get(o)}function Wt(o,f){var c=vt(o);c&&(c.value=f==null?"":String(f))}function ca(o,f){var c=f?"1":"0",l=document.querySelectorAll('[name="data['+o+']"]');Array.prototype.forEach.call(l,function(s){s.checked=String(s.value)===c})}function eh(o){var f=o==null?"":String(o);if(window.postFormEditor&&typeof window.postFormEditor.value=="function")window.postFormEditor.value(f);else{var c=vt("content");c&&(c.value=f)}}function Mu(o,f){var c=o.querySelectorAll("input, textarea, select, button");Array.prototype.forEach.call(c,function(l){l.type==="file"||l.name&&l.name.indexOf("data[photos")===0||(l.disabled=f)}),window.postFormEditor&&window.postFormEditor.codemirror&&window.postFormEditor.codemirror.setOption("readOnly",f?"nocursor":!1)}function da(o,f){o&&(o.tagName==="INPUT"?o.value=f:o.textContent=f)}function th(o,f){var c=o.querySelector(".post-edit-error");if(c){c.textContent=f;return}var l=document.createElement("div");l.className="post-edit-error",l.setAttribute("role","alert"),l.textContent=f;var s=o.querySelector("h1");s?s.insertAdjacentElement("afterend",l):o.insertBefore(l,o.firstChild)}function Nu(o,f){f=f||0;var c=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(c.length&&c[0]){o(c[0]);return}f<120&&setTimeout(function(){Nu(o,f+1)},50)}function rh(o){fetch("/api/v1/pages"+o+"/media",{credentials:"include",headers:{Accept:"application/json"}}).then(function(f){return f.ok?f.json():{data:[]}}).then(function(f){var c=f&&f.data||[],l=c.filter(function(s){return s&&typeof s.filename=="string"&&/\.(jpe?g|png|gif|webp|heic|heif)$/i.test(s.filename)}).sort(function(s,g){return s.filename<g.filename?-1:s.filename>g.filename?1:0});Nu(function(s){try{s.setOptions({allowBrowse:!1,allowDrop:!1,allowReorder:!0})}catch{}l.forEach(function(g){try{var d=s.addFile(o+"/"+g.filename,{type:"local"});d&&typeof d.catch=="function"&&d.catch(function(){})}catch{}})})}).catch(function(){})}function ih(){var o=document.querySelector('form[name="new-entry"]'),f=document.querySelector(".post-form-wrap");if(!(!o||!f)){var c=Tu("edit");if(c){ha=!0;var l=f.querySelector("h1");l&&(l.textContent="Edit entry");var s=o.querySelector('button[type="submit"], input[type="submit"]'),g=s?s.tagName==="INPUT"?s.value:s.textContent:"Save changes";Mu(o,!0),da(s,"Loading entry\u2026");var d=Tu("return")||f.getAttribute("data-trip-url")||"";o.setAttribute("action","/post?edit="+encodeURIComponent(c)+(d?"&return="+encodeURIComponent(d):"")),fetch("/api/v1/pages"+c,{credentials:"include",headers:{Accept:"application/json"}}).then(function(p){if(!p.ok)throw new Error("HTTP "+p.status);return p.json()}).then(function(p){var y=p&&p.data||{},w=y.header||{};Wt("title",w.title!=null?w.title:y.title),Wt("date",w.date?String(w.date).replace(" ","T"):""),eh(y.content),Wt("lat",w.lat),Wt("lng",w.lng),Wt("location_city",w.location_city),Wt("location_country",w.location_country),Wt("weather_desc",w.weather_desc),Wt("weather_temp_c",w.weather_temp_c),Wt("transport_mode",w.transport_mode),ca("featured",w.featured),ca("force_connect",w.force_connect),ca("published",w.published!==void 0?w.published:y.published);var D=vt("edit_path");D&&(D.value=c+"/entry.md"),Mu(o,!1),da(s,"Save changes");var S=o.querySelector(".more-options");S&&(S.open=!0),rh(c)}).catch(function(){th(f,"Sorry \u2014 this entry could not be loaded for editing. Go back to the journal and try again."),da(s,g)})}}}function Bu(){window.postFormEditor=Pd(),Vd(),ih(),$d(),jd(),Gd(),Xd(),Zd()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Bu):Bu();