index-C_A6cd1S.js 222 KB

123456789101112131415161718192021222324252627
  1. const __vite__fileDeps=["assets/javascript-C0runXw9.js","assets/antd-BmrhB3rb.js","assets/vue-BjERyvPm.js","assets/apl-zLfE5rQP.js","assets/asciiarmor-Do-7xkZ0.js","assets/asterisk-Dl6-Cx_L.js","assets/brainfuck-DVgfREw_.js","assets/clike-CbqrjqIp.js","assets/clojure-B7BO6eTf.js","assets/cmake-CksKCwmd.js","assets/cobol-BagBmwKo.js","assets/coffeescript-fFmhlGnR.js","assets/commonlisp-Dt9YBdGp.js","assets/crystal-C_YQTvkC.js","assets/css-_7XECuso.js","assets/cypher-ClLSXDoB.js","assets/d-DdB_Nypc.js","assets/dart-NqTr4gQb.js","assets/diff-DP8cpWw3.js","assets/django-Cr0ySjV7.js","assets/htmlmixed-BRMskI39.js","assets/xml-DGJz4OSG.js","assets/overlay-DQm5ROUG.js","assets/dockerfile-c7yS_1k1.js","assets/simple-DidUZgS1.js","assets/dtd-BoJNBv-L.js","assets/dylan-glqjD8lh.js","assets/ebnf-B69swxbP.js","assets/ecl-BcquUJs9.js","assets/eiffel-BW6UbfQv.js","assets/elm-BXgy4upO.js","assets/erlang-CoWJ_jdP.js","assets/factor-CvscPoNe.js","assets/fcl-w30Bp-6o.js","assets/forth-BRGZgJzZ.js","assets/fortran-BWfrboS0.js","assets/gas-BAwmoLl4.js","assets/gfm-zED9mVpT.js","assets/markdown-DTiN1g17.js","assets/gherkin-CSTxET5C.js","assets/go-BDFk3iT5.js","assets/groovy-BoGByj99.js","assets/haml-mAoz9Cg_.js","assets/ruby-iLW-yO0L.js","assets/handlebars-tIlZKpI9.js","assets/multiplex-KU3H4tw5.js","assets/haskell-CaA0e7fj.js","assets/haxe-Bw9cDHlO.js","assets/htmlembedded-Ckszlea-.js","assets/htmlmixed-S48eAt07.js","assets/http-B511s2ir.js","assets/idl-DZadFF97.js","assets/jinja2-DgZuyF-4.js","assets/jsx-B4bOLTGX.js","assets/julia-DMwb9N1P.js","assets/livescript-DRBVSWtJ.js","assets/lua-DF6LKH9h.js","assets/markdown-BUyyni4w.js","assets/mathematica-BN67McW3.js","assets/mbox-TtGKsB4G.js","assets/mirc-Do6SGHsb.js","assets/mllike-C4sux_AD.js","assets/modelica-WdF900bX.js","assets/mscgen-FXpyAEp1.js","assets/mumps-CYDAote_.js","assets/nginx-8EWYo5aN.js","assets/nsis-V-nh5FnW.js","assets/ntriples-Bf6qR5Vj.js","assets/octave-0TxgvgfU.js","assets/oz-YKjkJu7g.js","assets/pascal-Cjts3mlK.js","assets/pegjs-r3zISsBk.js","assets/perl-B1do5Zj5.js","assets/php-BjMv37q4.js","assets/pig-UrTc6X8Q.js","assets/powershell-XydHAPqy.js","assets/properties-Czp0CTK7.js","assets/protobuf-BA_h8Wlf.js","assets/pug-DjiMg7mW.js","assets/puppet-DYDSY7Dj.js","assets/python-C1X48StL.js","assets/q-CuOwICRo.js","assets/r-BU6hSvk5.js","assets/rpm-BztRzSX7.js","assets/rst-CKbfDNrD.js","assets/stex-NgOvYG3S.js","assets/ruby-mqj0y2bQ.js","assets/rust-zgJDuv0h.js","assets/sas-CEyk9sX1.js","assets/sass-B9irdM0E.js","assets/scheme-x6TdpmVC.js","assets/shell-YD6A_fFc.js","assets/sieve-C5YXMwr0.js","assets/slim-Bf1FQuBQ.js","assets/smalltalk-Db2BOukD.js","assets/smarty-iKWBBJeb.js","assets/solr-CFsp-tWW.js","assets/soy-Bp7B5X5P.js","assets/sparql-DcPrKfhZ.js","assets/spreadsheet-C3z-gWru.js","assets/sql-DHVlzNoE.js","assets/stex-Cg_aPdoz.js","assets/stylus-MetgqTN6.js","assets/swift-DXKRkQMz.js","assets/tcl-BevIpjQ5.js","assets/textile-_4Nypotk.js","assets/tiddlywiki-DDJ5TKib.js","assets/tiki-DTxprbbV.js","assets/toml-023vXGSv.js","assets/tornado-Bdo4Jy6O.js","assets/troff-DTRuyQRy.js","assets/ttcn-R1BoT9rH.js","assets/turtle-CM9rYn40.js","assets/twig-C7dwzfeV.js","assets/vb-BXrUi_eW.js","assets/vbscript-BokD97Qh.js","assets/velocity-DvNFKKpp.js","assets/verilog-B7VFNSSq.js","assets/vhdl-B1rA6yA-.js","assets/vue-DaauBs6F.js","assets/wast-m9bWxpvr.js","assets/webidl-DE5IAe36.js","assets/xml-BfhUlznu.js","assets/xquery-BzB4WOAP.js","assets/yacas-BaDrOsGa.js","assets/yaml-omGv1gdd.js","assets/z80-B6iIPEr3.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
  2. var qu=Object.defineProperty;var gl=Object.getOwnPropertySymbols;var Zu=Object.prototype.hasOwnProperty,Ju=Object.prototype.propertyIsEnumerable;var yl=(h,T,f)=>T in h?qu(h,T,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[T]=f,Qi=(h,T)=>{for(var f in T||(T={}))Zu.call(T,f)&&yl(h,f,T[f]);if(gl)for(var f of gl(T))Ju.call(T,f)&&yl(h,f,T[f]);return h};var x=(h,T,f)=>new Promise((O,F)=>{var W=b=>{try{w(f.next(b))}catch(_){F(_)}},B=b=>{try{w(f.throw(b))}catch(_){F(_)}},w=b=>b.done?O(b.value):Promise.resolve(b.value).then(W,B);w((f=f.apply(h,T)).next())});import{_ as S,u as Qu,aF as $u,w as _l}from"./entry/index-DShbtsWl.js";import{c as ef,b as tf,l as rf}from"./antd-BmrhB3rb.js";import{d as Hn,f as Tl,w as to,y as ml,h as kl,u as Al,o as nf,b as of,Z as oo,_ as Pl,a1 as af,c as El,k as Ol,G as lf,r as sf,a8 as uf}from"./vue-BjERyvPm.js";import{u as ff}from"./useWindowSizeFn-Cuml40XT.js";var $i={exports:{}},bl;function kt(){return bl||(bl=1,function(h,T){(function(f,O){h.exports=O()})(ef,function(){var f=navigator.userAgent,O=navigator.platform,F=/gecko\/\d/i.test(f),W=/MSIE \d/.test(f),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(f),w=/Edge\/(\d+)/.exec(f),b=W||B||w,_=b&&(W?document.documentMode||6:+(w||B)[1]),R=!w&&/WebKit\//.test(f),U=R&&/Qt\/\d+\.\d+/.test(f),z=!w&&/Chrome\/(\d+)/.exec(f),te=z&&+z[1],J=/Opera\//.test(f),re=/Apple Computer/.test(navigator.vendor),k=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(f),N=/PhantomJS/.test(f),y=re&&(/Mobile\/\w+/.test(f)||navigator.maxTouchPoints>2),v=/Android/.test(f),L=y||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(f),P=y||/Mac/.test(O),K=/\bCrOS\b/.test(f),Q=/win/i.test(O),X=J&&f.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(J=!1,R=!0);var ie=P&&(U||J&&(X==null||X<12.11)),Ue=F||b&&_>=9;function pe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var xe=function(e,t){var n=e.className,r=pe(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function De(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function be(e,t){return De(e).appendChild(t)}function j(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function st(e,t,n,r){var i=j(e,t,n,r);return i.setAttribute("role","presentation"),i}var Je;document.createRange?Je=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Je=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function Xe(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 Re(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch(r){n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function ut(e,t){var n=e.className;pe(t).test(n)||(e.className+=(n?" ":"")+t)}function Wn(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!pe(n[r]).test(t)&&(t+=" "+n[r]);return t}var pr=function(e){e.select()};y?pr=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(pr=function(e){try{e.select()}catch(t){}});function vr(e){return e.display.wrapper.ownerDocument}function Ut(e){return At(e.display.wrapper)}function At(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function qr(e){return vr(e).defaultView}function Mn(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Pt(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function qe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var yt=function(){this.id=null,this.f=null,this.time=0,this.handler=Mn(this.onTimeout,this)};yt.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},yt.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Pe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ao=50,Zr={toString:function(){return"CodeMirror.Pass"}},rt={scroll:!1},Bn={origin:"*mouse"},gr={origin:"+move"};function zn(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Jr=[""];function Vn(e){for(;Jr.length<=e;)Jr.push(ae(Jr)+" ");return Jr[e]}function ae(e){return e[e.length-1]}function Qr(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Fl(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function lo(){}function so(e,t){var n;return Object.create?n=Object.create(e):(lo.prototype=e,n=new lo),t&&Pt(t,n),n}var Hl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Gn(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Hl.test(e))}function $r(e,t){return t?t.source.indexOf("\\w")>-1&&Gn(e)?!0:t.test(e):Gn(e)}function uo(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Wl=/[\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 Un(e){return e.charCodeAt(0)>=768&&Wl.test(e)}function fo(e,t,n){for(;(n<0?t>0:t<e.length)&&Un(e.charAt(t));)t+=n;return t}function yr(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function Ml(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var mr=null;function br(e,t,n){var r;mr=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:mr=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:mr=i)}return r!=null?r:mr}var Bl=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,c,d){this.level=u,this.from=c,this.to=d}return function(u,c){var d=c=="ltr"?"L":"R";if(u.length==0||c=="ltr"&&!r.test(u))return!1;for(var g=u.length,p=[],m=0;m<g;++m)p.push(n(u.charCodeAt(m)));for(var C=0,E=d;C<g;++C){var I=p[C];I=="m"?p[C]=E:E=I}for(var H=0,D=d;H<g;++H){var M=p[H];M=="1"&&D=="r"?p[H]="n":o.test(M)&&(D=M,M=="r"&&(p[H]="R"))}for(var Y=1,G=p[0];Y<g-1;++Y){var ne=p[Y];ne=="+"&&G=="1"&&p[Y+1]=="1"?p[Y]="1":ne==","&&G==p[Y+1]&&(G=="1"||G=="n")&&(p[Y]=G),G=ne}for(var ue=0;ue<g;++ue){var Te=p[ue];if(Te==",")p[ue]="N";else if(Te=="%"){var he=void 0;for(he=ue+1;he<g&&p[he]=="%";++he);for(var Ge=ue&&p[ue-1]=="!"||he<g&&p[he]=="1"?"1":"N",Me=ue;Me<he;++Me)p[Me]=Ge;ue=he-1}}for(var ye=0,Be=d;ye<g;++ye){var Ae=p[ye];Be=="L"&&Ae=="1"?p[ye]="L":o.test(Ae)&&(Be=Ae)}for(var we=0;we<g;++we)if(i.test(p[we])){var me=void 0;for(me=we+1;me<g&&i.test(p[me]);++me);for(var ce=(we?p[we-1]:d)=="L",ze=(me<g?p[me]:d)=="L",hr=ce==ze?ce?"L":"R":d,Tt=we;Tt<me;++Tt)p[Tt]=hr;we=me-1}for(var Oe=[],lt,ke=0;ke<g;)if(a.test(p[ke])){var Zi=ke;for(++ke;ke<g&&a.test(p[ke]);++ke);Oe.push(new s(0,Zi,ke))}else{var gt=ke,zt=Oe.length,Vt=c=="rtl"?1:0;for(++ke;ke<g&&p[ke]!="L";++ke);for(var Ie=gt;Ie<ke;)if(l.test(p[Ie])){gt<Ie&&(Oe.splice(zt,0,new s(1,gt,Ie)),zt+=Vt);var cr=Ie;for(++Ie;Ie<ke&&l.test(p[Ie]);++Ie);Oe.splice(zt,0,new s(2,cr,Ie)),zt+=Vt,gt=Ie}else++Ie;gt<ke&&Oe.splice(zt,0,new s(1,gt,ke))}return c=="ltr"&&(Oe[0].level==1&&(lt=u.match(/^\s+/))&&(Oe[0].from=lt[0].length,Oe.unshift(new s(0,0,lt[0].length))),ae(Oe).level==1&&(lt=u.match(/\s+$/))&&(ae(Oe).to-=lt[0].length,Oe.push(new s(0,g-lt[0].length,g)))),c=="rtl"?Oe.reverse():Oe}}();function ft(e,t){var n=e.order;return n==null&&(n=e.order=Bl(e.text,t)),n}var ho=[],q=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ho).concat(n)}};function Kn(e,t){return e._handlers&&e._handlers[t]||ho}function Ke(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=Pe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ve(e,t){var n=Kn(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Le(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ve(e,n||t.type,e,t),jn(t)||t.codemirrorIgnore}function co(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)Pe(n,t[r])==-1&&n.push(t[r])}function Ze(e,t){return Kn(e,t).length>0}function Kt(e){e.prototype.on=function(t,n){q(this,t,n)},e.prototype.off=function(t,n){Ke(this,t,n)}}function Fe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function po(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function jn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function wr(e){Fe(e),po(e)}function Yn(e){return e.target||e.srcElement}function vo(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),P&&e.ctrlKey&&t==1&&(t=3),t}var zl=function(){if(b&&_<9)return!1;var e=j("div");return"draggable"in e||"dragDrop"in e}(),Xn;function Vl(e){if(Xn==null){var t=j("span","​");be(e,j("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Xn=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&_<8))}var n=Xn?j("span","​"):j("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var qn;function Gl(e){if(qn!=null)return qn;var t=be(e,document.createTextNode("AخA")),n=Je(t,0,1).getBoundingClientRect(),r=Je(t,1,2).getBoundingClientRect();return De(e),!n||n.left==n.right?!1:qn=r.right-n.right<3}var Zn=`
  3. b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
  4. `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ul=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Kl=function(){var e=j("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Jn=null;function jl(e){if(Jn!=null)return Jn;var t=be(e,j("span","x")),n=t.getBoundingClientRect(),r=Je(t,0,1).getBoundingClientRect();return Jn=Math.abs(n.left-r.left)>1}var Qn={},jt={};function Yl(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qn[e]=t}function Xl(e,t){jt[e]=t}function en(e){if(typeof e=="string"&&jt.hasOwnProperty(e))e=jt[e];else if(e&&typeof e.name=="string"&&jt.hasOwnProperty(e.name)){var t=jt[e.name];typeof t=="string"&&(t={name:t}),e=so(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return en("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return en("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $n(e,t){t=en(t);var n=Qn[t.name];if(!n)return $n(e,"text/plain");var r=n(e,t);if(Yt.hasOwnProperty(t.name)){var i=Yt[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Yt={};function ql(e,t){var n=Yt.hasOwnProperty(e)?Yt[e]:Yt[e]={};Pt(t,n)}function Et(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ei(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function go(e,t,n){return e.startState?e.startState(t,n):!0}var ge=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};ge.prototype.eol=function(){return this.pos>=this.string.length},ge.prototype.sol=function(){return this.pos==this.lineStart},ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ge.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ge.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},ge.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ge.prototype.skipToEnd=function(){this.pos=this.string.length},ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ge.prototype.backUp=function(e){this.pos-=e},ge.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=qe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?qe(this.string,this.lineStart,this.tabSize):0)},ge.prototype.indentation=function(){return qe(this.string,null,this.tabSize)-(this.lineStart?qe(this.string,this.lineStart,this.tabSize):0)},ge.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function V(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Ot(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function ti(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function nt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function le(e){if(e.parent==null)return null;for(var t=e.parent,n=Pe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Nt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return n+a}function xr(e,t){return t>=e.first&&t<e.first+e.size}function ri(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function A(e,t,n){if(n===void 0&&(n=null),!(this instanceof A))return new A(e,t,n);this.line=e,this.ch=t,this.sticky=n}function $(e,t){return e.line-t.line||e.ch-t.ch}function ni(e,t){return e.sticky==t.sticky&&$(e,t)==0}function ii(e){return A(e.line,e.ch)}function tn(e,t){return $(e,t)<0?t:e}function rn(e,t){return $(e,t)<0?e:t}function yo(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ee(e,t){if(t.line<e.first)return A(e.first,0);var n=e.first+e.size-1;return t.line>n?A(n,V(e,n).text.length):Zl(t,V(e,t.line).text.length)}function Zl(e,t){var n=e.ch;return n==null||n>t?A(e.line,t):n<0?A(e.line,0):e}function mo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ee(e,t[r]);return n}var nn=function(e,t){this.state=e,this.lookAhead=t},it=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};it.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},it.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}},it.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},it.fromSaved=function(e,t,n){return t instanceof nn?new it(e,Et(e.mode,t.state),n,t.lookAhead):new it(e,Et(e.mode,t),n)},it.prototype.save=function(e){var t=e!==!1?Et(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new nn(t,this.maxLookAhead):t};function bo(e,t,n,r){var i=[e.state.modeGen],o={};_o(e,t.text,e.doc.mode,n,function(u,c){return i.push(u,c)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var c=e.state.overlays[u],d=1,g=0;n.state=!0,_o(e,t.text,c.mode,n,function(p,m){for(var C=d;g<p;){var E=i[d];E>p&&i.splice(d,1,p,i[d+1],E),d+=2,g=Math.min(p,E)}if(m)if(c.opaque)i.splice(C,d-C,p,"overlay "+m),d=C+2;else for(;C<d;C+=2){var I=i[C+1];i[C+1]=(I?I+" ":"")+"overlay "+m}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function wo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Lr(e,le(t)),i=t.text.length>e.options.maxHighlightLength&&Et(e.doc.mode,r.state),o=bo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Lr(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new it(r,!0,t);var o=Jl(e,t,n),a=o>r.first&&V(r,o-1).stateAfter,l=a?it.fromSaved(r,a,o):new it(r,go(r.mode),o);return r.iter(o,t,function(s){oi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function oi(e,t,n,r){var i=e.doc.mode,o=new ge(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&xo(i,n.state);!o.eol();)ai(i,o,n.state),o.start=o.pos}function xo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=ei(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function ai(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ei(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var Lo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Co(e,t,n,r){var i=e.doc,o=i.mode,a;t=ee(i,t);var l=V(i,t.line),s=Lr(e,t.line,n),u=new ge(l.text,e.options.tabSize,s),c;for(r&&(c=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=ai(o,u,s.state),r&&c.push(new Lo(u,a,Et(i.mode,s.state)));return r?c:new Lo(u,a,s.state)}function So(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function _o(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,c=new ge(t,e.options.tabSize,r),d,g=e.options.addModeClass&&[null];for(t==""&&So(xo(n,r.state),o);!c.eol();){if(c.pos>e.options.maxHighlightLength?(l=!1,a&&oi(e,t,r,c.pos),c.pos=t.length,d=null):d=So(ai(n,c,r.state,g),o),g){var p=g[0].name;p&&(d="m-"+(d?p+" "+d:p))}if(!l||u!=d){for(;s<c.start;)s=Math.min(c.start,s+5e3),i(s,u);u=d}c.start=c.pos}for(;s<c.pos;){var m=Math.min(c.pos,s+5e3);i(m,u),s=m}}function Jl(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=V(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof nn?u.lookAhead:0)<=o.modeFrontier))return l;var c=qe(s.text,null,e.options.tabSize);(i==null||r>c)&&(i=l-1,r=c)}return i}function Ql(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=V(e,r).stateAfter;if(i&&(!(i instanceof nn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var To=!1,ht=!1;function $l(){To=!0}function es(){ht=!0}function on(e,t,n){this.marker=e,this.from=t,this.to=n}function Cr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function ts(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function rs(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.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 ns(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new on(a,o.from,s?null:o.to))}}return r}function is(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new on(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function li(e,t){if(t.full)return null;var n=xr(e,t.from.line)&&V(e,t.from.line).markedSpans,r=xr(e,t.to.line)&&V(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=$(t.from,t.to)==0,l=ns(n,i,a),s=is(r,o,a),u=t.text.length==1,c=ae(t.text).length+(u?i:0);if(l)for(var d=0;d<l.length;++d){var g=l[d];if(g.to==null){var p=Cr(s,g.marker);p?u&&(g.to=p.to==null?null:p.to+c):g.to=i}}if(s)for(var m=0;m<s.length;++m){var C=s[m];if(C.to!=null&&(C.to+=c),C.from==null){var E=Cr(l,C.marker);E||(C.from=c,u&&(l||(l=[])).push(C))}else C.from+=c,u&&(l||(l=[])).push(C)}l&&(l=ko(l)),s&&s!=l&&(s=ko(s));var I=[l];if(!u){var H=t.text.length-2,D;if(H>0&&l)for(var M=0;M<l.length;++M)l[M].to==null&&(D||(D=[])).push(new on(l[M].marker,null,null));for(var Y=0;Y<H;++Y)I.push(D);I.push(s)}return I}function ko(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function os(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(p){if(p.markedSpans)for(var m=0;m<p.markedSpans.length;++m){var C=p.markedSpans[m].marker;C.readOnly&&(!r||Pe(r,C)==-1)&&(r||(r=[])).push(C)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!($(u.to,l.from)<0||$(u.from,l.to)>0)){var c=[s,1],d=$(u.from,l.from),g=$(u.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:l.from}),(g>0||!a.inclusiveRight&&!g)&&c.push({from:l.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Ao(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Po(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function an(e){return e.inclusiveLeft?-1:0}function ln(e){return e.inclusiveRight?1:0}function si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=$(r.from,i.from)||an(e)-an(t);if(o)return-o;var a=$(r.to,i.to)||ln(e)-ln(t);return a||t.id-e.id}function Eo(e,t){var n=ht&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||si(r,i.marker)<0)&&(r=i.marker);return r}function Oo(e){return Eo(e,!0)}function sn(e){return Eo(e,!1)}function as(e,t){var n=ht&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||si(r,o.marker)<0)&&(r=o.marker)}return r}function No(e,t,n,r,i){var o=V(e,t),a=ht&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),c=$(u.from,n)||an(s.marker)-an(i),d=$(u.to,r)||ln(s.marker)-ln(i);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?$(u.to,n)>=0:$(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?$(u.from,r)<=0:$(u.from,r)<0)))return!0}}}function Qe(e){for(var t;t=Oo(e);)e=t.find(-1,!0).line;return e}function ls(e){for(var t;t=sn(e);)e=t.find(1,!0).line;return e}function ss(e){for(var t,n;t=sn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ui(e,t){var n=V(e,t),r=Qe(n);return n==r?t:le(r)}function Io(e,t){if(t>e.lastLine())return t;var n=V(e,t),r;if(!mt(e,n))return t;for(;r=sn(n);)n=r.find(1,!0).line;return le(n)+1}function mt(e,t){var n=ht&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&fi(e,t,r))return!0}}}function fi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return fi(e,r.line,Cr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&fi(e,t,i))return!0}function ct(e){e=Qe(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function un(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Oo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=sn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function hi(e){var t=e.display,n=e.doc;t.maxLine=V(n,n.first),t.maxLineLength=un(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=un(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Xt=function(e,t,n){this.text=e,Po(this,t),this.height=n?n(this):1};Xt.prototype.lineNo=function(){return le(this)},Kt(Xt);function us(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ao(e),Po(e,n);var i=r?r(e):1;i!=e.height&&nt(e,i)}function fs(e){e.parent=null,Ao(e)}var hs={},cs={};function Do(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?cs:hs;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Ro(e,t){var n=st("span",null,null,R?"padding-right: .1px":null),r={pre:st("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=ps,Gl(e.display.measure)&&(a=ft(o,e.doc.direction))&&(r.addToken=gs(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&le(o);ys(o,r,wo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Wn(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Wn(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Vl(e.display.measure))),i==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(R){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Wn(r.pre.className,r.textClass||"")),r}function ds(e){var t=j("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ps(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?vs(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,c;if(!s.test(t))e.col+=t.length,c=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,c),b&&_<9&&(u=!0),e.pos+=t.length;else{c=document.createDocumentFragment();for(var d=0;;){s.lastIndex=d;var g=s.exec(t),p=g?g.index-d:t.length-d;if(p){var m=document.createTextNode(l.slice(d,d+p));b&&_<9?c.appendChild(j("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+p,m),e.col+=p,e.pos+=p}if(!g)break;d+=p+1;var C=void 0;if(g[0]==" "){var E=e.cm.options.tabSize,I=E-e.col%E;C=c.appendChild(j("span",Vn(I),"cm-tab")),C.setAttribute("role","presentation"),C.setAttribute("cm-text"," "),e.col+=I}else g[0]=="\r"||g[0]==`
  5. `?(C=c.appendChild(j("span",g[0]=="\r"?"␍":"␤","cm-invalidchar")),C.setAttribute("cm-text",g[0]),e.col+=1):(C=e.cm.options.specialCharPlaceholder(g[0]),C.setAttribute("cm-text",g[0]),b&&_<9?c.appendChild(j("span",[C])):c.appendChild(C),e.col+=1);e.map.push(e.pos,e.pos+1,C),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var H=n||"";r&&(H+=r),i&&(H+=i);var D=j("span",[c],H,o);if(a)for(var M in a)a.hasOwnProperty(M)&&M!="style"&&M!="class"&&D.setAttribute(M,a[M]);return e.content.appendChild(D)}e.content.appendChild(c)}}function vs(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o=" "),r+=o,n=o==" "}return r}function gs(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var d=void 0,g=0;g<t.length&&(d=t[g],!(d.to>u&&d.from<=u));g++);if(d.to>=c)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-u),i,o,null,l,s),o=null,r=r.slice(d.to-u),u=d.to}}}function Fo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ys(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),Do(n[a+1],t.cm.options));return}for(var l=i.length,s=0,u=1,c="",d,g,p=0,m,C,E,I,H;;){if(p==s){m=C=E=g="",H=null,I=null,p=1/0;for(var D=[],M=void 0,Y=0;Y<r.length;++Y){var G=r[Y],ne=G.marker;if(ne.type=="bookmark"&&G.from==s&&ne.widgetNode)D.push(ne);else if(G.from<=s&&(G.to==null||G.to>s||ne.collapsed&&G.to==s&&G.from==s)){if(G.to!=null&&G.to!=s&&p>G.to&&(p=G.to,C=""),ne.className&&(m+=" "+ne.className),ne.css&&(g=(g?g+";":"")+ne.css),ne.startStyle&&G.from==s&&(E+=" "+ne.startStyle),ne.endStyle&&G.to==p&&(M||(M=[])).push(ne.endStyle,G.to),ne.title&&((H||(H={})).title=ne.title),ne.attributes)for(var ue in ne.attributes)(H||(H={}))[ue]=ne.attributes[ue];ne.collapsed&&(!I||si(I.marker,ne)<0)&&(I=G)}else G.from>s&&p>G.from&&(p=G.from)}if(M)for(var Te=0;Te<M.length;Te+=2)M[Te+1]==p&&(C+=" "+M[Te]);if(!I||I.from==s)for(var he=0;he<D.length;++he)Fo(t,0,D[he]);if(I&&(I.from||0)==s){if(Fo(t,(I.to==null?l+1:I.to)-s,I.marker,I.from==null),I.to==null)return;I.to==s&&(I=!1)}}if(s>=l)break;for(var Ge=Math.min(l,p);;){if(c){var Me=s+c.length;if(!I){var ye=Me>Ge?c.slice(0,Ge-s):c;t.addToken(t,ye,d?d+m:m,E,s+ye.length==p?C:"",g,H)}if(Me>=Ge){c=c.slice(Ge-s),s=Ge;break}s=Me,E=""}c=i.slice(o,o=n[u++]),d=Do(n[u++],t.cm.options)}}}function Ho(e,t,n){this.line=t,this.rest=ss(t),this.size=this.rest?le(ae(this.rest))-n+1:1,this.node=this.text=null,this.hidden=mt(e,t)}function fn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Ho(e.doc,V(e.doc,o),o);i=o+a.size,r.push(a)}return r}var qt=null;function ms(e){qt?qt.ops.push(e):e.ownsGroup=qt={ops:[e],delayedCallbacks:[]}}function bs(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function ws(e,t){var n=e.ownsGroup;if(n)try{bs(n)}finally{qt=null,t(n)}}var Sr=null;function Ce(e,t){var n=Kn(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;qt?i=qt.delayedCallbacks:Sr?i=Sr:(i=Sr=[],setTimeout(xs,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function xs(){var e=Sr;Sr=null;for(var t=0;t<e.length;++t)e[t]()}function Wo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Cs(e,t):o=="gutter"?Bo(e,t,n,r):o=="class"?ci(e,t):o=="widget"&&Ss(e,t,r)}t.changes=null}function _r(e){return e.node==e.text&&(e.node=j("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&_<8&&(e.node.style.zIndex=2)),e.node}function Ls(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=_r(t);t.background=r.insertBefore(j("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Mo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Ro(e,t)}function Cs(e,t){var n=t.text.className,r=Mo(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,ci(e,t)):n&&(t.text.className=n)}function ci(e,t){Ls(e,t),t.line.wrapClass?_r(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Bo(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=_r(t);t.gutterBackground=j("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=_r(t),l=t.gutter=j("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(j("div",ri(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&l.appendChild(j("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ss(e,t,n){t.alignable&&(t.alignable=null);for(var r=pe("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);zo(e,t,n)}function _s(e,t,n,r){var i=Mo(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ci(e,t),Bo(e,t,n,r),zo(e,t,r),t.node}function zo(e,t,n){if(Vo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Vo(e,t.rest[r],t,n,!1)}function Vo(e,t,n,r,i){if(t.widgets)for(var o=_r(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=j("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ts(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Ce(s,"redraw")}}function Ts(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Tr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Xe(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),be(t.display.measure,j("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function dt(e,t){for(var n=Yn(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function hn(e){return e.lineSpace.offsetTop}function di(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Go(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=be(e.measure,j("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function ot(e){return ao-e.display.nativeBarWidth}function It(e){return e.display.scroller.clientWidth-ot(e)-e.display.barWidth}function pi(e){return e.display.scroller.clientHeight-ot(e)-e.display.barHeight}function ks(e,t,n){var r=e.options.lineWrapping,i=r&&It(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Uo(e,t,n){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 i=0;i<e.rest.length;i++)if(le(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function As(e,t){t=Qe(t);var n=le(t),r=e.display.externalMeasured=new Ho(e.doc,t,n);r.lineN=n;var i=r.built=Ro(e,r);return r.text=i.pre,be(e.display.lineMeasure,i.pre),r}function Ko(e,t,n,r){return at(e,Zt(e,t),n,r)}function vi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ft(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Zt(e,t){var n=le(t),r=vi(e,n);r&&!r.text?r=null:r&&r.changes&&(Wo(e,r,n,wi(e)),e.curOp.forceUpdate=!0),r||(r=As(e,t));var i=Uo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function at(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ks(e,t.view,t.rect),t.hasHeights=!0),a=Es(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var jo={left:0,right:0,top:0,bottom:0};function Yo(e,t,n){for(var r,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Ps(e,t){var n=jo;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Es(e,t,n,r){var i=Yo(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var c=0;c<4;c++){for(;a&&Un(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&Un(t.line.text.charAt(i.coverStart+l));)++l;if(b&&_<9&&a==0&&l==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=Ps(Je(o,a,l).getClientRects(),r),u.left||u.right||a==0)break;l=a,a=a-1,s="right"}b&&_<11&&(u=Os(e.display.measure,u))}else{a>0&&(s=r="right");var d;e.options.lineWrapping&&(d=o.getClientRects()).length>1?u=d[r=="right"?d.length-1:0]:u=o.getBoundingClientRect()}if(b&&_<9&&!a&&(!u||!u.left&&!u.right)){var g=o.parentNode.getClientRects()[0];g?u={left:g.left,right:g.left+Qt(e.display),top:g.top,bottom:g.bottom}:u=jo}for(var p=u.top-t.rect.top,m=u.bottom-t.rect.top,C=(p+m)/2,E=t.view.measure.heights,I=0;I<E.length-1&&!(C<E[I]);I++);var H=I?E[I-1]:0,D=E[I],M={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:H,bottom:D};return!u.left&&!u.right&&(M.bogus=!0),e.options.singleCursorHeightPerLine||(M.rtop=p,M.rbottom=m),M}function Os(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!jl(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Xo(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 qo(e){e.display.externalMeasure=null,De(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Xo(e.display.view[t])}function kr(e){qo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Zo(e){return z&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Jo(e){return z&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function gi(e){var t=Qe(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=Tr(n[i]));return r}function cn(e,t,n,r,i){if(!i){var o=gi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=ct(t);if(r=="local"?a+=hn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:Jo(vr(e)));var s=l.left+(r=="window"?0:Zo(vr(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Qo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Zo(vr(e)),i-=Jo(vr(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function dn(e,t,n,r,i){return r||(r=V(e.doc,t.line)),cn(e,r,Ko(e,r,t.ch,i),n)}function $e(e,t,n,r,i,o){r=r||V(e.doc,t.line),i||(i=Zt(e,r));function a(m,C){var E=at(e,i,m,C?"right":"left",o);return C?E.left=E.right:E.right=E.left,cn(e,r,E,n)}var l=ft(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function c(m,C,E){var I=l[C],H=I.level==1;return a(E?m-1:m,H!=E)}var d=br(l,s,u),g=mr,p=c(s,d,u=="before");return g!=null&&(p.other=c(s,g,u!="before")),p}function $o(e,t){var n=0;t=ee(e.doc,t),e.options.lineWrapping||(n=Qt(e.display)*t.ch);var r=V(e.doc,t.line),i=ct(r)+hn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function yi(e,t,n,r,i){var o=A(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function mi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return yi(r.first,0,null,-1,-1);var i=Nt(r,n),o=r.first+r.size-1;if(i>o)return yi(r.first+r.size-1,V(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=V(r,i);;){var l=Ns(e,a,i,t,n),s=as(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=V(r,i=u.line)}}function ea(e,t,n,r){r-=gi(t);var i=t.text.length,o=yr(function(a){return at(e,n,a-1).bottom<=r},i,0);return i=yr(function(a){return at(e,n,a).top>r},o,i),{begin:o,end:i}}function ta(e,t,n,r){n||(n=Zt(e,t));var i=cn(e,t,at(e,n,r),"line").top;return ea(e,t,n,i)}function bi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Ns(e,t,n,r,i){i-=ct(t);var o=Zt(e,t),a=gi(t),l=0,s=t.text.length,u=!0,c=ft(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Ds:Is)(e,t,n,o,c,r,i);u=d.level!=1,l=u?d.from:d.to-1,s=u?d.to:d.from-1}var g=null,p=null,m=yr(function(Y){var G=at(e,o,Y);return G.top+=a,G.bottom+=a,bi(G,r,i,!1)?(G.top<=i&&G.left<=r&&(g=Y,p=G),!0):!1},l,s),C,E,I=!1;if(p){var H=r-p.left<p.right-r,D=H==u;m=g+(D?0:1),E=D?"after":"before",C=H?p.left:p.right}else{!u&&(m==s||m==l)&&m++,E=m==0?"after":m==t.text.length?"before":at(e,o,m-(u?1:0)).bottom+a<=i==u?"after":"before";var M=$e(e,A(n,m,E),"line",t,o);C=M.left,I=i<M.top?-1:i>=M.bottom?1:0}return m=fo(t.text,m,1),yi(n,m,E,I,r-C)}function Is(e,t,n,r,i,o,a){var l=yr(function(d){var g=i[d],p=g.level!=1;return bi($e(e,A(n,p?g.to:g.from,p?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,c=$e(e,A(n,u?s.from:s.to,u?"after":"before"),"line",t,r);bi(c,o,a,!0)&&c.top>a&&(s=i[l-1])}return s}function Ds(e,t,n,r,i,o,a){var l=ea(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,g=0;g<i.length;g++){var p=i[g];if(!(p.from>=u||p.to<=s)){var m=p.level!=1,C=at(e,r,m?Math.min(u,p.to)-1:Math.max(s,p.from)).right,E=C<o?o-C+1e9:C-o;(!c||d>E)&&(c=p,d=E)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}var Dt;function Jt(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Dt==null){Dt=j("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dt.appendChild(document.createTextNode("x")),Dt.appendChild(j("br"));Dt.appendChild(document.createTextNode("x"))}be(e.measure,Dt);var n=Dt.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),De(e.measure),n||1}function Qt(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=j("span","xxxxxxxxxx"),n=j("pre",[t],"CodeMirror-line-like");be(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:xi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function xi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ra(e){var t=Jt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Qt(e.display)-3);return function(i){if(mt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Li(e){var t=e.doc,n=ra(e);t.iter(function(r){var i=n(r);i!=r.height&&nt(r,i)})}function Rt(e,t,n,r){var i=e.display;if(!n&&Yn(t).getAttribute("cm-not-content")=="true")return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(d){return null}var s=mi(e,o,a),u;if(r&&s.xRel>0&&(u=V(e.doc,s.line).text).length==s.ch){var c=qe(u,u.length,e.options.tabSize)-u.length;s=A(s.line,Math.max(0,Math.round((o-Go(e.display).left)/Qt(e.display))-c))}return s}function Ft(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function He(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)ht&&ui(e.doc,t)<i.viewTo&&wt(e);else if(n<=i.viewFrom)ht&&Io(e.doc,n+r)>i.viewFrom?wt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)wt(e);else if(t<=i.viewFrom){var o=pn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):wt(e)}else if(n>=i.viewTo){var a=pn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):wt(e)}else{var l=pn(e,t,t,-1),s=pn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(fn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):wt(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function bt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Ft(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);Pe(a,n)==-1&&a.push(n)}}}function wt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pn(e,t,n,r){var i=Ft(e,t),o,a=e.display.view;if(!ht||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=a[s].size;if(l!=t){if(r>0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;ui(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Rs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=fn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=fn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ft(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(fn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ft(e,n)))),r.viewTo=n}function na(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function Ar(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ia(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<n.sel.ranges.length;l++)if(!(!t&&l==n.sel.primIndex)){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var c=a(e,s);c&&Ci(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&Ci(e,s.head,i);u||Fs(e,s,o)}}return r}function Ci(e,t,n){var r=$e(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(j("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=dn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(j("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function vn(e,t){return e.top-t.top||e.left-t.left}function Fs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Go(e.display),l=a.left,s=Math.max(r.sizerWidth,It(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function c(D,M,Y,G){M<0&&(M=0),M=Math.round(M),G=Math.round(G),o.appendChild(j("div",null,"CodeMirror-selected","position: absolute; left: "+D+`px;
  6. top: `+M+"px; width: "+(Y==null?s-D:Y)+`px;
  7. height: `+(G-M)+"px"))}function d(D,M,Y){var G=V(i,D),ne=G.text.length,ue,Te;function he(ye,Be){return dn(e,A(D,ye),"div",G,Be)}function Ge(ye,Be,Ae){var we=ta(e,G,null,ye),me=Be=="ltr"==(Ae=="after")?"left":"right",ce=Ae=="after"?we.begin:we.end-(/\s/.test(G.text.charAt(we.end-1))?2:1);return he(ce,me)[me]}var Me=ft(G,i.direction);return Ml(Me,M||0,Y==null?ne:Y,function(ye,Be,Ae,we){var me=Ae=="ltr",ce=he(ye,me?"left":"right"),ze=he(Be-1,me?"right":"left"),hr=M==null&&ye==0,Tt=Y==null&&Be==ne,Oe=we==0,lt=!Me||we==Me.length-1;if(ze.top-ce.top<=3){var ke=(u?hr:Tt)&&Oe,Zi=(u?Tt:hr)&&lt,gt=ke?l:(me?ce:ze).left,zt=Zi?s:(me?ze:ce).right;c(gt,ce.top,zt-gt,ce.bottom)}else{var Vt,Ie,cr,Ji;me?(Vt=u&&hr&&Oe?l:ce.left,Ie=u?s:Ge(ye,Ae,"before"),cr=u?l:Ge(Be,Ae,"after"),Ji=u&&Tt&&lt?s:ze.right):(Vt=u?Ge(ye,Ae,"before"):l,Ie=!u&&hr&&Oe?s:ce.right,cr=!u&&Tt&&lt?l:ze.left,Ji=u?Ge(Be,Ae,"after"):s),c(Vt,ce.top,Ie-Vt,ce.bottom),ce.bottom<ze.top&&c(l,ce.bottom,null,ze.top),c(cr,ze.top,Ji-cr,ze.bottom)}(!ue||vn(ce,ue)<0)&&(ue=ce),vn(ze,ue)<0&&(ue=ze),(!Te||vn(ce,Te)<0)&&(Te=ce),vn(ze,Te)<0&&(Te=ze)}),{start:ue,end:Te}}var g=t.from(),p=t.to();if(g.line==p.line)d(g.line,g.ch,p.ch);else{var m=V(i,g.line),C=V(i,p.line),E=Qe(m)==Qe(C),I=d(g.line,g.ch,E?m.text.length+1:null).end,H=d(p.line,E?0:null,p.ch).start;E&&(I.top<H.top-2?(c(I.right,I.top,null,I.bottom),c(l,H.top,H.left,H.bottom)):c(I.right,I.top,H.left-I.right,I.bottom)),I.bottom<H.top&&c(l,I.bottom,null,H.top)}n.appendChild(o)}function Si(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||$t(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function oa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ti(e))}function _i(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&$t(e))},100)}function Ti(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,ut(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),R&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Si(e))}function $t(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,xe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function gn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,u=void 0,c=0;if(!l.hidden){if(i+=l.line.height,b&&_<8){var d=l.node.offsetTop+l.node.offsetHeight;u=d-n,n=d}else{var g=l.node.getBoundingClientRect();u=g.bottom-g.top,!s&&l.text.firstChild&&(c=l.text.firstChild.getBoundingClientRect().right-g.left-1)}var p=l.line.height-u;if((p>.005||p<-.005)&&(i<r&&(o-=p),nt(l.line,u),aa(l.line),l.rest))for(var m=0;m<l.rest.length;m++)aa(l.rest[m]);if(c>e.display.sizerWidth){var C=Math.ceil(c/Qt(e.display));C>e.display.maxLineLength&&(e.display.maxLineLength=C,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function aa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function yn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-hn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=Nt(t,r),a=Nt(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=Nt(t,ct(V(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Nt(t,ct(V(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Hs(e,t){if(!Le(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!N){var a=j("div","​",null,`position: absolute;
  8. top: `+(t.top-n.viewOffset-hn(e.display))+`px;
  9. height: `+(t.bottom-t.top+ot(e)+n.barHeight)+`px;
  10. left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function Ws(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?A(t.line,t.ch+1,"before"):t,t=t.ch?A(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=$e(e,t),s=!n||n==t?l:$e(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=ki(e,i),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(u.scrollTop!=null&&(Er(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),u.scrollLeft!=null&&(Ht(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function Ms(e,t){var n=ki(e,t);n.scrollTop!=null&&Er(e,n.scrollTop),n.scrollLeft!=null&&Ht(e,n.scrollLeft)}function ki(e,t){var n=e.display,r=Jt(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=pi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+di(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?l:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,g=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=It(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<g?a.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+g-3&&(a.scrollLeft=t.right+(m?0:10)-p),a}function Ai(e,t){t!=null&&(mn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function er(e){mn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pr(e,t,n){(t!=null||n!=null)&&mn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Bs(e,t){mn(e),e.curOp.scrollToPos=t}function mn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$o(e,t.from),r=$o(e,t.to);la(e,n,r,t.margin)}}function la(e,t,n,r){var i=ki(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Pr(e,i.scrollLeft,i.scrollTop)}function Er(e,t){Math.abs(e.doc.scrollTop-t)<2||(F||Ei(e,{top:t}),sa(e,t,!0),F&&Ei(e),Ir(e,100))}function sa(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ht(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,da(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Or(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+di(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+ot(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Wt=function(e,t,n){this.cm=n;var r=this.vert=j("div",[j("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=j("div",[j("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),q(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),q(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&_<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Wt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wt.prototype.zeroWidthHack=function(){var e=P&&!k?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new yt,this.disableVert=new yt},Wt.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Wt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Nr=function(){};Nr.prototype.update=function(){return{bottom:0,right:0}},Nr.prototype.setScrollLeft=function(){},Nr.prototype.setScrollTop=function(){},Nr.prototype.clear=function(){};function tr(e,t){t||(t=Or(e));var n=e.display.barWidth,r=e.display.barHeight;ua(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&gn(e),ua(e,Or(e)),n=e.display.barWidth,r=e.display.barHeight}function ua(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var fa={native:Wt,null:Nr};function ha(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&xe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new fa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),q(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Ht(e,t):Er(e,t)},e),e.display.scrollbars.addClass&&ut(e.display.wrapper,e.display.scrollbars.addClass)}var zs=0;function Mt(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:++zs,markArrays:null},ms(e.curOp)}function Bt(e){var t=e.curOp;t&&ws(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Vs(n)})}function Vs(e){for(var t=e.ops,n=0;n<t.length;n++)Gs(t[n]);for(var r=0;r<t.length;r++)Us(t[r]);for(var i=0;i<t.length;i++)Ks(t[i]);for(var o=0;o<t.length;o++)js(t[o]);for(var a=0;a<t.length;a++)Ys(t[a])}function Gs(e){var t=e.cm,n=t.display;qs(t),e.updateMaxLine&&hi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new bn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Us(e){e.updatedDisplay=e.mustUpdate&&Pi(e.cm,e.update)}function Ks(e){var t=e.cm,n=t.display;e.updatedDisplay&&gn(t),e.barMeasure=Or(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ko(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+ot(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-It(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function js(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ht(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Re(Ut(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Ni(t,e.barMeasure),e.selectionChanged&&Si(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&oa(e.cm)}function Ys(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ca(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ht(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ws(t,ee(r,e.scrollToPos.from),ee(r,e.scrollToPos.to),e.scrollToPos.margin);Hs(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||ve(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&ve(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ve(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ve(e,t){if(e.curOp)return t();Mt(e);try{return t()}finally{Bt(e)}}function Se(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Mt(e);try{return t.apply(e,arguments)}finally{Bt(e)}}}function Ne(e){return function(){if(this.curOp)return e.apply(this,arguments);Mt(this);try{return e.apply(this,arguments)}finally{Bt(this)}}}function _e(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Mt(t);try{return e.apply(this,arguments)}finally{Bt(t)}}}function Ir(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Mn(Xs,e))}function Xs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Lr(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Et(t.mode,r.state):null,s=bo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),g=0;!d&&g<a.length;++g)d=a[g]!=o.styles[g];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&oi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Ir(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ve(e,function(){for(var o=0;o<i.length;o++)bt(e,i[o],"text")})}}var bn=function(e,t,n){var r=e.display;this.viewport=t,this.visible=yn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=It(e),this.force=n,this.dims=wi(e),this.events=[]};bn.prototype.signal=function(e,t){Ze(e,t)&&this.events.push(arguments)},bn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ve.apply(null,this.events[e])};function qs(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ot(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ot(e)+"px",t.scrollbarsClipped=!0)}function Zs(e){if(e.hasFocus())return null;var t=Re(Ut(e));if(!t||!Xe(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=qr(e).getSelection();r.anchorNode&&r.extend&&Xe(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Js(e){if(!(!e||!e.activeElt||e.activeElt==Re(At(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&Xe(document.body,e.anchorNode)&&Xe(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Pi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return wt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&na(e)==0)return!1;pa(e)&&(wt(e),t.dims=wi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),ht&&(o=ui(e.doc,o),a=Io(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Rs(e,o,a),n.viewOffset=ct(V(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=na(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Zs(e);return s>4&&(n.lineDiv.style.display="none"),Qs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Js(u),De(n.cursorDiv),De(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ir(e,400)),n.updateLineNumbers=null,!0}function ca(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==It(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+di(e.display)-pi(e),n.top)}),t.visible=yn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=yn(e.display,e.doc,n));if(!Pi(e,t))break;gn(e);var i=Or(e);Ar(e),tr(e,i),Ni(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ei(e,t){var n=new bn(e,t);if(Pi(e,n)){gn(e),ca(e,n);var r=Or(e);Ar(e),tr(e,r),Ni(e,r),n.finish()}}function Qs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(m){var C=m.nextSibling;return R&&P&&e.display.currentWheelTarget==m?m.style.display="none":m.parentNode.removeChild(m),C}for(var s=r.view,u=r.viewFrom,c=0;c<s.length;c++){var d=s[c];if(!d.hidden)if(!d.node||d.node.parentNode!=o){var g=_s(e,d,u,n);o.insertBefore(g,a)}else{for(;a!=d.node;)a=l(a);var p=i&&t!=null&&t<=u&&d.lineNumber;d.changes&&(Pe(d.changes,"gutter")>-1&&(p=!1),Wo(e,d,u,n)),p&&(De(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(ri(e.options,u)))),a=d.node.nextSibling}u+=d.size}for(;a;)a=l(a)}function Oi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ce(e,"gutterChanged",e)}function Ni(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+ot(e)+"px"}function da(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=xi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function pa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ri(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(j("div",[j("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Oi(e.display),!0}return!1}function Ii(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function va(e){var t=e.gutters,n=e.gutterSpecs;De(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(j("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Oi(e)}function Dr(e){va(e.display),He(e),da(e)}function $s(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=j("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=j("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=st("div",null,"CodeMirror-code"),i.selectionDiv=j("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=j("div",null,"CodeMirror-cursors"),i.measure=j("div",null,"CodeMirror-measure"),i.lineMeasure=j("div",null,"CodeMirror-measure"),i.lineSpace=st("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=st("div",[i.lineSpace],"CodeMirror-lines");i.mover=j("div",[o],null,"position: relative"),i.sizer=j("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=j("div",null,null,"position: absolute; height: "+ao+"px; width: 1px;"),i.gutters=j("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=j("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=j("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),z&&te>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),b&&_<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!R&&!(F&&L)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ii(r.gutters,r.lineNumbers),va(i),n.init(i)}var wn=0,pt=null;b?pt=-.53:F?pt=15:z?pt=-.7:re&&(pt=-1/3);function ga(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function eu(e){var t=ga(e);return t.x*=pt,t.y*=pt,t}function ya(e,t){z&&te==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 n=ga(t),r=n.x,i=n.y,o=pt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&s||i&&u){if(i&&P&&R){e:for(var c=t.target,d=a.view;c!=l;c=c.parentNode)for(var g=0;g<d.length;g++)if(d[g].node==c){e.display.currentWheelTarget=c;break e}}if(r&&!F&&!J&&o!=null){i&&u&&Er(e,Math.max(0,l.scrollTop+i*o)),Ht(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&u)&&Fe(t),a.wheelStartX=null;return}if(i&&o!=null){var p=i*o,m=e.doc.scrollTop,C=m+a.wrapper.clientHeight;p<0?m=Math.max(0,m+p-50):C=Math.min(e.doc.height,C+p+50),Ei(e,{top:m,bottom:C})}wn<20&&t.deltaMode!==0&&(a.wheelStartX==null?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var E=l.scrollLeft-a.wheelStartX,I=l.scrollTop-a.wheelStartY,H=I&&a.wheelDY&&I/a.wheelDY||E&&a.wheelDX&&E/a.wheelDX;a.wheelStartX=a.wheelStartY=null,H&&(pt=(pt*wn+H)/(wn+1),++wn)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var je=function(e,t){this.ranges=e,this.primIndex=t};je.prototype.primary=function(){return this.ranges[this.primIndex]},je.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ni(n.anchor,r.anchor)||!ni(n.head,r.head))return!1}return!0},je.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oe(ii(this.ranges[t].anchor),ii(this.ranges[t].head));return new je(e,this.primIndex)},je.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},je.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if($(t,r.from())>=0&&$(e,r.to())<=0)return n}return-1};var oe=function(e,t){this.anchor=e,this.head=t};oe.prototype.from=function(){return rn(this.anchor,this.head)},oe.prototype.to=function(){return tn(this.anchor,this.head)},oe.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function et(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(g,p){return $(g.from(),p.from())}),n=Pe(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=$(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=rn(l.from(),a.from()),c=tn(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new oe(d?c:u,d?u:c))}}return new je(t,n)}function xt(e,t){return new je([new oe(e,t||e)],0)}function Lt(e){return e.text?A(e.from.line+e.text.length-1,ae(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ma(e,t){if($(e,t.from)<0)return e;if($(e,t.to)<=0)return Lt(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Lt(t).ch-t.to.ch),A(n,r)}function Di(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new oe(ma(i.anchor,t),ma(i.head,t)))}return et(e.cm,n,e.sel.primIndex)}function ba(e,t,n){return e.line==t.line?A(n.line,e.ch-t.ch+n.ch):A(n.line+(e.line-t.line),e.ch)}function tu(e,t,n){for(var r=[],i=A(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=ba(l.from,i,o),u=ba(Lt(l),i,o);if(i=l.to,o=u,n=="around"){var c=e.sel.ranges[a],d=$(c.head,c.anchor)<0;r[a]=new oe(d?u:s,d?s:u)}else r[a]=new oe(s,s)}return new je(r,e.sel.primIndex)}function Ri(e){e.doc.mode=$n(e.options,e.doc.modeOption),Rr(e)}function Rr(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,Ir(e,100),e.state.modeGen++,e.curOp&&He(e)}function wa(e,t){return t.from.ch==0&&t.to.ch==0&&ae(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fi(e,t,n,r){function i(H){return n?n[H]:null}function o(H,D,M){us(H,D,M,r),Ce(H,"change",H,t)}function a(H,D){for(var M=[],Y=H;Y<D;++Y)M.push(new Xt(u[Y],i(Y),r));return M}var l=t.from,s=t.to,u=t.text,c=V(e,l.line),d=V(e,s.line),g=ae(u),p=i(u.length-1),m=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(wa(e,t)){var C=a(0,u.length-1);o(d,d.text,p),m&&e.remove(l.line,m),C.length&&e.insert(l.line,C)}else if(c==d)if(u.length==1)o(c,c.text.slice(0,l.ch)+g+c.text.slice(s.ch),p);else{var E=a(1,u.length-1);E.push(new Xt(g+c.text.slice(s.ch),p,r)),o(c,c.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,E)}else if(u.length==1)o(c,c.text.slice(0,l.ch)+u[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,m);else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(d,g+d.text.slice(s.ch),p);var I=a(1,u.length-1);m>1&&e.remove(l.line+1,m-1),e.insert(l.line+1,I)}Ce(e,"change",e,t)}function Ct(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=o){var u=a&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function xa(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Li(e),Ri(e),La(e),e.options.direction=t.direction,e.options.lineWrapping||hi(e),e.options.mode=t.modeOption,He(e)}function La(e){(e.doc.direction=="rtl"?ut:xe)(e.display.lineDiv,"CodeMirror-rtl")}function ru(e){Ve(e,function(){La(e),He(e)})}function xn(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 Hi(e,t){var n={from:ii(t.from),to:Lt(t),text:Ot(e,t.from,t.to)};return _a(e,n,t.from.line,t.to.line+1),Ct(e,function(r){return _a(r,n,t.from.line,t.to.line+1)},!0),n}function Ca(e){for(;e.length;){var t=ae(e);if(t.ranges)e.pop();else break}}function nu(e,t){if(t)return Ca(e.done),ae(e.done);if(e.done.length&&!ae(e.done).ranges)return ae(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ae(e.done)}function Sa(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=nu(i,i.lastOp==r)))l=ae(a.changes),$(t.from,t.to)==0&&$(t.from,l.to)==0?l.to=Lt(t):a.changes.push(Hi(e,t));else{var s=ae(i.done);for((!s||!s.ranges)&&Ln(e.sel,i.done),a={changes:[Hi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ve(e,"historyAdded")}function iu(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ou(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||iu(e,o,ae(i.done),t))?i.done[i.done.length-1]=t:Ln(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&Ca(i.undone)}function Ln(e,t){var n=ae(t);n&&n.ranges&&n.equals(e)||t.push(e)}function _a(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function au(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function lu(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(au(n[i]));return r}function Ta(e,t){var n=lu(e,t),r=li(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function rr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?je.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],c=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&Pe(t,Number(c[1]))>-1&&(ae(l)[d]=u[d],delete u[d])}}return r}function Wi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=$(t,i)<0;o!=$(n,i)<0?(i=t,t=n):o!=$(t,n)<0&&(t=n)}return new oe(i,t)}else return new oe(n||t,t)}function Cn(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ee(e,new je([Wi(e.sel.primary(),t,n,i)],0),r)}function ka(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Wi(e.sel.ranges[o],t[o],null,i);var a=et(e.cm,r,e.sel.primIndex);Ee(e,a,n)}function Mi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ee(e,et(e.cm,i,e.sel.primIndex),r)}function Aa(e,t,n,r){Ee(e,xt(t,n),r)}function su(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new oe(ee(e,i[o].anchor),ee(e,i[o].head))},origin:n&&n.origin};return ve(e,"beforeSelectionChange",e,r),e.cm&&ve(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?et(e.cm,r.ranges,r.ranges.length-1):t}function Pa(e,t,n){var r=e.history.done,i=ae(r);i&&i.ranges?(r[r.length-1]=t,Sn(e,t,n)):Ee(e,t,n)}function Ee(e,t,n){Sn(e,t,n),ou(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Sn(e,t,n){(Ze(e,"beforeSelectionChange")||e.cm&&Ze(e.cm,"beforeSelectionChange"))&&(t=su(e,t,n));var r=n&&n.bias||($(t.primary().head,e.sel.primary().head)<0?-1:1);Ea(e,Na(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&er(e.cm)}function Ea(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,co(e.cm)),Ce(e,"cursorActivity",e))}function Oa(e){Ea(e,Na(e,e.sel,null,!1))}function Na(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=_n(e,a.anchor,l&&l.anchor,n,r),u=a.head==a.anchor?s:_n(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new oe(s,u))}return i?et(e.cm,i,t.primIndex):t}function nr(e,t,n,r,i){var o=V(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(c?l.to>=t.ch:l.to>t.ch))){if(i&&(ve(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),g=void 0;if((r<0?c:u)&&(d=Ia(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(g=$(d,n))&&(r<0?g<0:g>0))return nr(e,d,t,r,i)}var p=s.find(r<0?-1:1);return(r<0?u:c)&&(p=Ia(e,p,r,p.line==t.line?o:null)),p?nr(e,p,t,r,i):null}}return t}function _n(e,t,n,r,i){var o=r||1,a=nr(e,t,n,o,i)||!i&&nr(e,t,n,o,!0)||nr(e,t,n,-o,i)||!i&&nr(e,t,n,-o,!0);return a||(e.cantEdit=!0,A(e.first,0))}function Ia(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ee(e,A(t.line-1)):null:n>0&&t.ch==(r||V(e,t.line)).text.length?t.line<e.first+e.size-1?A(t.line+1,0):null:new A(t.line,t.ch+n)}function Da(e){e.setSelection(A(e.firstLine(),0),A(e.lastLine()),rt)}function Ra(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,l){i&&(r.from=ee(e,i)),o&&(r.to=ee(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),ve(e,"beforeChange",e,r),e.cm&&ve(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 ir(e,t,n){if(e.cm){if(!e.cm.curOp)return Se(e.cm,ir)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Ze(e,"beforeChange")||e.cm&&Ze(e.cm,"beforeChange"))&&(t=Ra(e,t,!0),!t))){var r=To&&!n&&os(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Fa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Fa(e,t)}}function Fa(e,t){if(!(t.text.length==1&&t.text[0]==""&&$(t.from,t.to)==0)){var n=Di(e,t);Sa(e,t,n,e.cm?e.cm.curOp.id:NaN),Fr(e,t,n,li(e,t));var r=[];Ct(e,function(i,o){!o&&Pe(r,i.history)==-1&&(Ba(i.history,t),r.push(i.history)),Fr(i,t,null,li(i,t))})}}function Tn(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(o=l[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(Ln(o,s),n&&!o.equals(e.sel)){Ee(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var c=[];Ln(a,s),s.push({changes:c,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var d=Ze(e,"beforeChange")||e.cm&&Ze(e.cm,"beforeChange"),g=function(C){var E=o.changes[C];if(E.origin=t,d&&!Ra(e,E,!1))return l.length=0,{};c.push(Hi(e,E));var I=C?Di(e,E):ae(l);Fr(e,E,I,Ta(e,E)),!C&&e.cm&&e.cm.scrollIntoView({from:E.from,to:Lt(E)});var H=[];Ct(e,function(D,M){!M&&Pe(H,D.history)==-1&&(Ba(D.history,E),H.push(D.history)),Fr(D,E,null,Ta(D,E))})},p=o.changes.length-1;p>=0;--p){var m=g(p);if(m)return m.v}}}}function Ha(e,t){if(t!=0&&(e.first+=t,e.sel=new je(Qr(e.sel.ranges,function(i){return new oe(A(i.anchor.line+t,i.anchor.ch),A(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){He(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)bt(e.cm,r,"gutter")}}function Fr(e,t,n,r){if(e.cm&&!e.cm.curOp)return Se(e.cm,Fr)(e,t,n,r);if(t.to.line<e.first){Ha(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 i=t.text.length-1-(e.first-t.from.line);Ha(e,i),t={from:A(e.first,0),to:A(t.to.line+i,t.to.ch),text:[ae(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:A(o,V(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ot(e,t.from,t.to),n||(n=Di(e,t)),e.cm?uu(e.cm,t,r):Fi(e,t,r),Sn(e,n,rt),e.cantEdit&&_n(e,A(e.firstLine(),0))&&(e.cantEdit=!1)}}function uu(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=le(Qe(V(r,o.line))),r.iter(s,a.line+1,function(p){if(p==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&co(e),Fi(r,t,n,ra(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(p){var m=un(p);m>i.maxLineLength&&(i.maxLine=p,i.maxLineLength=m,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Ql(r,o.line),Ir(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?He(e):o.line==a.line&&t.text.length==1&&!wa(e.doc,t)?bt(e,o.line,"text"):He(e,o.line,a.line+1,u);var c=Ze(e,"changes"),d=Ze(e,"change");if(d||c){var g={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ce(e,"change",e,g),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(g)}e.display.selForContextMenu=null}function or(e,t,n,r,i){var o;r||(r=n),$(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),ir(e,{from:n,to:r,text:t,origin:i})}function Wa(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ma(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Wa(o.ranges[l].anchor,t,n,r),Wa(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=A(u.from.line+r,u.from.ch),u.to=A(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function Ba(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ma(e.done,n,r,i),Ma(e.undone,n,r,i)}function Hr(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=V(e,yo(e,t)):i=le(t),i==null?null:(r(o,i)&&e.cm&&bt(e.cm,i,n),o)}function Wr(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Wr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,fs(i),Ce(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Mr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Mr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Wr))){var l=[];this.collapse(l),this.children=[new Wr(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new Wr(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Mr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=Pe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Mr(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var Br=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Br.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=le(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Tr(this);nt(n,Math.max(0,n.height-o)),e&&(Ve(e,function(){za(e,n,-o),bt(e,r,"widget")}),Ce(e,"lineWidgetCleared",e,this,r))}},Br.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Tr(this)-t;i&&(mt(this.doc,r)||nt(r,r.height+i),n&&Ve(n,function(){n.curOp.forceUpdate=!0,za(n,r,i),Ce(n,"lineWidgetChanged",n,e,le(r))}))},Kt(Br);function za(e,t,n){ct(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ai(e,n)}function fu(e,t,n,r){var i=new Br(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Hr(e,t,"widget",function(a){var l=a.widgets||(a.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!mt(e,a)){var s=ct(a)<e.scrollTop;nt(a,a.height+Tr(i)),s&&Ai(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&Ce(o,"lineWidgetAdded",o,i,typeof t=="number"?t:le(t)),i}var Va=0,St=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Va};St.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Mt(e),Ze(this,"clear")){var n=this.find();n&&Ce(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Cr(a.markedSpans,this);e&&!this.collapsed?bt(e,le(a),"text"):e&&(l.to!=null&&(i=le(a)),l.from!=null&&(r=le(a))),a.markedSpans=ts(a.markedSpans,l),l.from==null&&this.collapsed&&!mt(this.doc,a)&&e&&nt(a,Jt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Qe(this.lines[s]),c=un(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&He(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Oa(e.doc)),e&&Ce(e,"markerCleared",e,this,r,i),t&&Bt(e),this.parent&&this.parent.clear()}},St.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Cr(o.markedSpans,this);if(a.from!=null&&(n=A(t?o:le(o),a.from),e==-1))return n;if(a.to!=null&&(r=A(t?o:le(o),a.to),e==1))return r}return n&&{from:n,to:r}},St.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Ve(r,function(){var i=t.line,o=le(t.line),a=vi(r,o);if(a&&(Xo(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!mt(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=Tr(n)-l;s&&nt(i,i.height+s)}Ce(r,"markerChanged",r,e)})},St.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Pe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},St.prototype.detachLine=function(e){if(this.lines.splice(Pe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Kt(St);function ar(e,t,n,r,i){if(r&&r.shared)return hu(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Se(e.cm,ar)(e,t,n,r,i);var o=new St(e,i),a=$(t,n);if(r&&Pt(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=st("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(No(e,t.line,t,n,o)||t.line!=n.line&&No(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");es()}o.addToHistory&&Sa(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(d){s&&o.collapsed&&!s.options.lineWrapping&&Qe(d)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&nt(d,0),rs(d,new on(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(d){mt(e,d)&&nt(d,0)}),o.clearOnEnter&&q(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&($l(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Va,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)He(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)bt(s,c,"text");o.atomic&&Oa(s.doc),Ce(s,"markerAdded",s,o)}return o}var zr=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};zr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ce(this,"clear")}},zr.prototype.find=function(e,t){return this.primary.find(e,t)},Kt(zr);function hu(e,t,n,r,i){r=Pt(r),r.shared=!1;var o=[ar(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Ct(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(ar(s,ee(s,t),ee(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;a=ae(o)}),new zr(o,a)}function Ga(e){return e.findMarks(A(e.first,0),e.clipPos(A(e.lastLine())),function(t){return t.parent})}function cu(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if($(o,a)){var l=ar(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function du(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];Ct(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];Pe(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var pu=0,We=function(e,t,n,r,i){if(!(this instanceof We))return new We(e,t,n,r,i);n==null&&(n=0),Mr.call(this,[new Wr([new Xt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=A(n,0);this.sel=xt(o),this.history=new xn(null),this.id=++pu,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Fi(this,{from:o,to:o,text:e}),Ee(this,xt(o),rt)};We.prototype=so(Mr.prototype,{constructor:We,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ti(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:_e(function(e){var t=A(this.first,0),n=this.first+this.size-1;ir(this,{from:t,to:A(n,V(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pr(this.cm,0,0),Ee(this,xt(t),rt)}),replaceRange:function(e,t,n,r){t=ee(this,t),n=n?ee(this,n):t,or(this,e,t,n,r)},getRange:function(e,t,n){var r=Ot(this,ee(this,e),ee(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(xr(this,e))return V(this,e)},getLineNumber:function(e){return le(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=V(this,e)),Qe(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ee(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_e(function(e,t,n){Aa(this,ee(this,typeof e=="number"?A(e,t||0):e),null,n)}),setSelection:_e(function(e,t,n){Aa(this,ee(this,e),ee(this,t||e),n)}),extendSelection:_e(function(e,t,n){Cn(this,ee(this,e),t&&ee(this,t),n)}),extendSelections:_e(function(e,t){ka(this,mo(this,e),t)}),extendSelectionsBy:_e(function(e,t){var n=Qr(this.sel.ranges,e);ka(this,mo(this,n),t)}),setSelections:_e(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new oe(ee(this,e[i].anchor),ee(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ee(this,et(this.cm,r,t),n)}}),addSelection:_e(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new oe(ee(this,e),ee(this,t||e))),Ee(this,et(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Ot(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Ot(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:_e(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&t!="end"&&tu(this,r,t),s=r.length-1;s>=0;s--)ir(this,r[s]);l?Pa(this,l):this.cm&&er(this.cm)}),undo:_e(function(){Tn(this,"undo")}),redo:_e(function(){Tn(this,"redo")}),undoSelection:_e(function(){Tn(this,"undo",!0)}),redoSelection:_e(function(){Tn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new xn(this.history),Ct(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:rr(this.history.done),undone:rr(this.history.undone)}},setHistory:function(e){var t=this.history=new xn(this.history);t.done=rr(e.done.slice(0),null,!0),t.undone=rr(e.undone.slice(0),null,!0)},setGutterMarker:_e(function(e,t,n){return Hr(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&uo(i)&&(r.gutterMarkers=null),!0})}),clearGutter:_e(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Hr(t,n,"gutter",function(){return n.gutterMarkers[e]=null,uo(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!xr(this,e)||(t=e,e=V(this,e),!e))return null}else if(t=le(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:_e(function(e,t,n){return Hr(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(pe(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:_e(function(e,t,n){return Hr(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(pe(n));if(!a)return!1;var l=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||l==o.length?"":" ")+o.slice(l)||null}else return!1;return!0})}),addLineWidget:_e(function(e,t,n){return fu(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ar(this,ee(this,e),ee(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ee(this,e),ar(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ee(this,e);var t=[],n=V(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ee(this,e),t=ee(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),ee(this,A(n,t))},indexFromPos:function(e){e=ee(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new We(ti(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new We(ti(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],cu(r,Ga(this)),r},unlinkDoc:function(e){if(e instanceof fe&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),du(Ga(this));break}}if(e.history==this.history){var r=[e.id];Ct(e,function(i){return r.push(i.id)},!0),e.history=new xn(null),e.history.done=rr(this.history.done,r),e.history.undone=rr(this.history.undone,r)}},iterLinkedDocs:function(e){Ct(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Zn(e)},lineSeparator:function(){return this.lineSep||`
  11. `},setDirection:_e(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&ru(this.cm))})}),We.prototype.eachLine=We.prototype.iter;var Ua=0;function vu(e){var t=this;if(Ka(t),!(Le(t,e)||dt(t.display,e))){Fe(e),b&&(Ua=+new Date);var n=Rt(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&Se(t,function(){n=ee(t.doc,n);var p={from:n,to:n,text:t.doc.splitLines(o.filter(function(m){return m!=null}).join(t.doc.lineSeparator())),origin:"paste"};ir(t.doc,p),Pa(t.doc,xt(ee(t.doc,n),ee(t.doc,Lt(p))))})()},s=function(p,m){if(t.options.allowDropFileTypes&&Pe(t.options.allowDropFileTypes,p.type)==-1){l();return}var C=new FileReader;C.onerror=function(){return l()},C.onload=function(){var E=C.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(E)){l();return}o[m]=E,l()},C.readAsText(p)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var c=e.dataTransfer.getData("Text");if(c){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Sn(t.doc,xt(n,n)),d)for(var g=0;g<d.length;++g)or(t.doc,"",d[g].anchor,d[g].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(p){}}}}function gu(e,t){if(b&&(!e.state.draggingText||+new Date-Ua<100)){wr(t);return}if(!(Le(e,t)||dt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!re)){var n=j("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",J&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),J&&n.parentNode.removeChild(n)}}function yu(e,t){var n=Rt(e,t);if(n){var r=document.createDocumentFragment();Ci(e,n,r),e.display.dragCursor||(e.display.dragCursor=j("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),be(e.display.dragCursor,r)}}function Ka(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ja(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ya=!1;function mu(){Ya||(bu(),Ya=!0)}function bu(){var e;q(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ja(wu)},100))}),q(window,"blur",function(){return ja($t)})}function wu(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var _t={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"},Vr=0;Vr<10;Vr++)_t[Vr+48]=_t[Vr+96]=String(Vr);for(var kn=65;kn<=90;kn++)_t[kn]=String.fromCharCode(kn);for(var Gr=1;Gr<=12;Gr++)_t[Gr+111]=_t[Gr+63235]="F"+Gr;var vt={};vt.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"},vt.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"},vt.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"},vt.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"]},vt.default=P?vt.macDefault:vt.pcDefault;function xu(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Lu(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Qr(n.split(" "),xu),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(!s)t[l]=a;else if(s!=a)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function lr(e,t,n,r){t=An(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return lr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=lr(e,t.fallthrough[o],n,r);if(a)return a}}}function Xa(e){var t=typeof e=="string"?e:_t[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function qa(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(ie?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(ie?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Za(e,t){if(J&&e.keyCode==34&&e.char)return!1;var n=_t[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),qa(n,e,t))}function An(e){return typeof e=="string"?vt[e]:e}function sr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&$(o.from,ae(r).to)<=0;){var a=r.pop();if($(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Ve(e,function(){for(var l=r.length-1;l>=0;l--)or(e.doc,"",r[l].from,r[l].to,"+delete");er(e)})}function Bi(e,t,n){var r=fo(e.text,t+n,n);return r<0||r>e.text.length?null:r}function zi(e,t,n){var r=Bi(e,t.ch,n);return r==null?null:new A(t.line,r,n<0?"after":"before")}function Vi(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=ft(n,t.doc.direction);if(o){var a=i<0?ae(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var c=Zt(t,n);u=i<0?n.text.length-1:0;var d=at(t,c,u).top;u=yr(function(g){return at(t,c,g).top==d},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=Bi(n,u,1))}else u=i<0?a.to:a.from;return new A(r,u,s)}}return new A(r,i<0?n.text.length:0,i<0?"before":"after")}function Cu(e,t,n,r){var i=ft(t,e.doc.direction);if(!i)return zi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=br(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return zi(t,n,r);var l=function(I,H){return Bi(t,I instanceof A?I.ch:I,H)},s,u=function(I){return e.options.lineWrapping?(s=s||Zt(e,t),ta(e,t,s,I)):{begin:0,end:t.text.length}},c=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var d=a.level==1==r<0,g=l(n,d?1:-1);if(g!=null&&(d?g<=a.to&&g<=c.end:g>=a.from&&g>=c.begin)){var p=d?"before":"after";return new A(n.line,g,p)}}var m=function(I,H,D){for(var M=function(ue,Te){return Te?new A(n.line,l(ue,1),"before"):new A(n.line,ue,"after")};I>=0&&I<i.length;I+=H){var Y=i[I],G=H>0==(Y.level!=1),ne=G?D.begin:l(D.end,-1);if(Y.from<=ne&&ne<Y.to||(ne=G?Y.from:l(Y.to,-1),D.begin<=ne&&ne<D.end))return M(ne,G)}},C=m(o+r,r,c);if(C)return C;var E=r>0?c.end:l(c.begin,-1);return E!=null&&!(r>0&&E==t.text.length)&&(C=m(r>0?0:i.length-1,r,u(E)),C)?C:null}var Ur={selectAll:Da,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return sr(e,function(t){if(t.empty()){var n=V(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:A(t.head.line+1,0)}:{from:t.head,to:A(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return sr(e,function(t){return{from:A(t.from().line,0),to:ee(e.doc,A(t.to().line+1,0))}})},delLineLeft:function(e){return sr(e,function(t){return{from:A(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return sr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return sr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(A(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(A(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ja(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Qa(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Su(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},gr)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},gr)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Qa(e,t.head):r},gr)},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=qe(e.getLine(o.line),o.ch,r);t.push(Vn(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ve(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=V(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new A(i.line,i.ch-1)),i.ch>0)i=new A(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),A(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=V(e.doc,i.line-1).text;a&&(i=new A(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),A(i.line-1,a.length-1),i,"+transpose"))}}n.push(new oe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Ve(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);er(e)})},openLine:function(e){return e.replaceSelection(`
  12. `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ja(e,t){var n=V(e.doc,t),r=Qe(n);return r!=n&&(t=le(r)),Vi(!0,e,r,t,1)}function Su(e,t){var n=V(e.doc,t),r=ls(n);return r!=n&&(t=le(r)),Vi(!0,e,n,t,-1)}function Qa(e,t){var n=Ja(e,t.line),r=V(e.doc,n.line),i=ft(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return A(n.line,a?0:o,n.sticky)}return n}function Pn(e,t,n){if(typeof t=="string"&&(t=Ur[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Zr}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function _u(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=lr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&lr(t,e.options.extraKeys,n,e)||lr(t,e.options.keyMap,n,e)}var Tu=new yt;function Kr(e,t,n,r){var i=e.state.keySeq;if(i){if(Xa(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Tu.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),$a(e,i+" "+t,n,r))return!0}return $a(e,t,n,r)}function $a(e,t,n,r){var i=_u(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Ce(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Fe(n),Si(e)),!!i}function el(e,t){var n=Za(t,!0);return n?t.shiftKey&&!e.state.keySeq?Kr(e,"Shift-"+n,t,function(r){return Pn(e,r,!0)})||Kr(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Pn(e,r)}):Kr(e,n,t,function(r){return Pn(e,r)}):!1}function ku(e,t,n){return Kr(e,"'"+n+"'",t,function(r){return Pn(e,r,!0)})}var Gi=null;function tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=Re(Ut(t)),!Le(t,e))){b&&_<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=el(t,e);J&&(Gi=r?n:null,!r&&n==88&&!Kl&&(P?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),F&&!P&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Au(t)}}function Au(e){var t=e.display.lineDiv;ut(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(xe(t,"CodeMirror-crosshair"),Ke(document,"keyup",n),Ke(document,"mouseover",n))}q(document,"keyup",n),q(document,"mouseover",n)}function rl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Le(this,e)}function nl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(dt(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||P&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(J&&n==Gi){Gi=null,Fe(e);return}if(!(J&&(!e.which||e.which<10)&&el(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(ku(t,e,i)||t.display.input.onKeyPress(e))}}}var Pu=400,Ui=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ui.prototype.compare=function(e,t,n){return this.time+Pu>e&&$(t,this.pos)==0&&n==this.button};var jr,Yr;function Eu(e,t){var n=+new Date;return Yr&&Yr.compare(n,e,t)?(jr=Yr=null,"triple"):jr&&jr.compare(n,e,t)?(Yr=new Ui(n,e,t),jr=null,"double"):(jr=new Ui(n,e,t),Yr=null,"single")}function il(e){var t=this,n=t.display;if(!(Le(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,dt(n,e)){R||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Ki(t,e)){var r=Rt(t,e),i=vo(e),o=r?Eu(r,i):"single";qr(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ou(t,i,r,o,e))&&(i==1?r?Iu(t,r,o,e):Yn(e)==n.scroller&&Fe(e):i==2?(r&&Cn(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(Ue?t.display.input.onContextMenu(e):_i(t)))}}}function Ou(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Kr(e,qa(o,i),i,function(a){if(typeof a=="string"&&(a=Ur[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=Zr}finally{e.state.suppressEdits=!1}return l})}function Nu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=K?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=P?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(P?n.altKey:n.ctrlKey)),i}function Iu(e,t,n,r){b?setTimeout(Mn(oa,e),0):e.curOp.focus=Re(Ut(e));var i=Nu(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&zl&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&($((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&($(a.to(),t)>0||t.xRel<0)?Du(e,r,t,i):Ru(e,r,t,i)}function Du(e,t,n,r){var i=e.display,o=!1,a=Se(e,function(u){R&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:_i(e)),Ke(i.wrapper.ownerDocument,"mouseup",a),Ke(i.wrapper.ownerDocument,"mousemove",l),Ke(i.scroller,"dragstart",s),Ke(i.scroller,"drop",a),o||(Fe(u),r.addNew||Cn(e.doc,n,null,null,r.extend),R&&!re||b&&_==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};R&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,q(i.wrapper.ownerDocument,"mouseup",a),q(i.wrapper.ownerDocument,"mousemove",l),q(i.scroller,"dragstart",s),q(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ol(e,t,n){if(n=="char")return new oe(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new oe(A(t.line,0),ee(e.doc,A(t.line+1,0)));var r=n(e,t);return new oe(r.from,r.to)}function Ru(e,t,n,r){b&&_i(e);var i=e.display,o=e.doc;Fe(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new oe(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new oe(n,n)),n=Rt(e,t,!0,!0),l=-1;else{var c=ol(e,n,r.unit);r.extend?a=Wi(a,c.anchor,c.head,r.extend):a=c}r.addNew?l==-1?(l=u.length,Ee(o,et(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Ee(o,et(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Mi(o,l,a,Bn):(l=0,Ee(o,new je([a],0),Bn),s=o.sel);var d=n;function g(D){if($(d,D)!=0)if(d=D,r.unit=="rectangle"){for(var M=[],Y=e.options.tabSize,G=qe(V(o,n.line).text,n.ch,Y),ne=qe(V(o,D.line).text,D.ch,Y),ue=Math.min(G,ne),Te=Math.max(G,ne),he=Math.min(n.line,D.line),Ge=Math.min(e.lastLine(),Math.max(n.line,D.line));he<=Ge;he++){var Me=V(o,he).text,ye=zn(Me,ue,Y);ue==Te?M.push(new oe(A(he,ye),A(he,ye))):Me.length>ye&&M.push(new oe(A(he,ye),A(he,zn(Me,Te,Y))))}M.length||M.push(new oe(n,n)),Ee(o,et(e,s.ranges.slice(0,l).concat(M),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(D)}else{var Be=a,Ae=ol(e,D,r.unit),we=Be.anchor,me;$(Ae.anchor,we)>0?(me=Ae.head,we=rn(Be.from(),Ae.anchor)):(me=Ae.anchor,we=tn(Be.to(),Ae.head));var ce=s.ranges.slice(0);ce[l]=Fu(e,new oe(ee(o,we),me)),Ee(o,et(e,ce,l),Bn)}}var p=i.wrapper.getBoundingClientRect(),m=0;function C(D){var M=++m,Y=Rt(e,D,!0,r.unit=="rectangle");if(Y)if($(Y,d)!=0){e.curOp.focus=Re(Ut(e)),g(Y);var G=yn(i,o);(Y.line>=G.to||Y.line<G.from)&&setTimeout(Se(e,function(){m==M&&C(D)}),150)}else{var ne=D.clientY<p.top?-20:D.clientY>p.bottom?20:0;ne&&setTimeout(Se(e,function(){m==M&&(i.scroller.scrollTop+=ne,C(D))}),50)}}function E(D){e.state.selectingText=!1,m=1/0,D&&(Fe(D),i.input.focus()),Ke(i.wrapper.ownerDocument,"mousemove",I),Ke(i.wrapper.ownerDocument,"mouseup",H),o.history.lastSelOrigin=null}var I=Se(e,function(D){D.buttons===0||!vo(D)?E(D):C(D)}),H=Se(e,E);e.state.selectingText=H,q(i.wrapper.ownerDocument,"mousemove",I),q(i.wrapper.ownerDocument,"mouseup",H)}function Fu(e,t){var n=t.anchor,r=t.head,i=V(e.doc,n.line);if($(n,r)==0&&n.sticky==r.sticky)return t;var o=ft(i);if(!o)return t;var a=br(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var c=br(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(l.level==1?-1:1);c==s-1||c==s?u=d<0:u=d>0}var g=o[s+(u?-1:0)],p=u==(g.level==1),m=p?g.from:g.to,C=p?"after":"before";return n.ch==m&&n.sticky==C?t:new oe(new A(n.line,m,C),r)}function al(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(g){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Fe(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ze(e,n))return jn(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var c=Nt(e.doc,o),d=e.display.gutterSpecs[s];return ve(e,n,e,c,d.className,t),jn(t)}}}function Ki(e,t){return al(e,t,"gutterClick",!0)}function ll(e,t){dt(e.display,t)||Hu(e,t)||Le(e,t,"contextmenu")||Ue||e.display.input.onContextMenu(t)}function Hu(e,t){return Ze(e,"gutterContextMenu")?al(e,t,"gutterContextMenu",!1):!1}function sl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),kr(e)}var ur={toString:function(){return"CodeMirror.Init"}},ul={},En={};function Wu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=ur&&o(l,s,u)}:o)}e.defineOption=n,e.Init=ur,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ri(r)},!0),n("indentUnit",2,Ri,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Rr(r),kr(r),He(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var c=s.text.indexOf(i,u);if(c==-1)break;u=c+i.length,o.push(A(a,c))}a++});for(var l=o.length-1;l>=0;l--)or(r.doc,i,o[l],A(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=ur&&r.refresh()}),n("specialCharPlaceholder",ds,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",L?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!Q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){sl(r),Dr(r)},!0),n("keyMap","default",function(r,i,o){var a=An(i),l=o!=ur&&An(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Bu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Ii(i,r.options.lineNumbers),Dr(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?xi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return tr(r)},!0),n("scrollbarStyle","native",function(r){ha(r),tr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Ii(r.options.gutters,i),Dr(r)},!0),n("firstLineNumber",1,Dr,!0),n("lineNumberFormatter",function(r){return r},Dr,!0),n("showCursorWhenSelecting",!1,Ar,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&($t(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Mu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Ar,!0),n("singleCursorHeightPerLine",!0,Ar,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Rr,!0),n("addModeClass",!1,Rr,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Rr,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Mu(e,t,n){var r=n&&n!=ur;if(!t!=!r){var i=e.display.dragFunctions,o=t?q:Ke;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Bu(e){e.options.lineWrapping?(ut(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(xe(e.display.wrapper,"CodeMirror-wrap"),hi(e)),Li(e),He(e),kr(e),setTimeout(function(){return tr(e)},100)}function fe(e,t){var n=this;if(!(this instanceof fe))return new fe(e,t);this.options=t=t?Pt(t):{},Pt(ul,t,!1);var r=t.value;typeof r=="string"?r=new We(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new fe.inputStyles[t.inputStyle](this),o=this.display=new $s(e,r,i,t);o.wrapper.CodeMirror=this,sl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ha(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 yt,keySeq:null,specialChars:null},t.autofocus&&!L&&o.input.focus(),b&&_<11&&setTimeout(function(){return n.display.input.reset(!0)},20),zu(this),mu(),Mt(this),this.curOp.forceUpdate=!0,xa(this,r),t.autofocus&&!L||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ti(n)},20):$t(this);for(var a in En)En.hasOwnProperty(a)&&En[a](this,t[a],ur);pa(this),t.finishInit&&t.finishInit(this);for(var l=0;l<ji.length;++l)ji[l](this);Bt(this),R&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}fe.defaults=ul,fe.optionHandlers=En;function zu(e){var t=e.display;q(t.scroller,"mousedown",Se(e,il)),b&&_<11?q(t.scroller,"dblclick",Se(e,function(s){if(!Le(e,s)){var u=Rt(e,s);if(!(!u||Ki(e,s)||dt(e.display,s))){Fe(s);var c=e.findWordAt(u);Cn(e.doc,c.anchor,c.head)}}})):q(t.scroller,"dblclick",function(s){return Le(e,s)||Fe(s)}),q(t.scroller,"contextmenu",function(s){return ll(e,s)}),q(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||ll(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(s,u){if(u.left==null)return!0;var c=u.left-s.left,d=u.top-s.top;return c*c+d*d>20*20}q(t.scroller,"touchstart",function(s){if(!Le(e,s)&&!o(s)&&!Ki(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),q(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),q(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!dt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var c=e.coordsChar(t.activeTouch,"page"),d;!u.prev||a(u,u.prev)?d=new oe(c,c):!u.prev.prev||a(u,u.prev.prev)?d=e.findWordAt(c):d=new oe(A(c.line,0),ee(e.doc,A(c.line+1,0))),e.setSelection(d.anchor,d.head),e.focus(),Fe(s)}i()}),q(t.scroller,"touchcancel",i),q(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),Ht(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))}),q(t.scroller,"mousewheel",function(s){return ya(e,s)}),q(t.scroller,"DOMMouseScroll",function(s){return ya(e,s)}),q(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Le(e,s)||wr(s)},over:function(s){Le(e,s)||(yu(e,s),wr(s))},start:function(s){return gu(e,s)},drop:Se(e,vu),leave:function(s){Le(e,s)||Ka(e)}};var l=t.input.getField();q(l,"keyup",function(s){return rl.call(e,s)}),q(l,"keydown",Se(e,tl)),q(l,"keypress",Se(e,nl)),q(l,"focus",function(s){return Ti(e,s)}),q(l,"blur",function(s){return $t(e,s)})}var ji=[];fe.defineInitHook=function(e){return ji.push(e)};function Xr(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=Lr(e,t).state:n="prev");var a=e.options.tabSize,l=V(i,t),s=qe(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],c;if(!r&&!/\S/.test(l.text))c=0,n="not";else if(n=="smart"&&(c=i.mode.indent(o,l.text.slice(u.length),l.text),c==Zr||c>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?c=qe(V(i,t-1).text,null,a):c=0:n=="add"?c=s+e.options.indentUnit:n=="subtract"?c=s-e.options.indentUnit:typeof n=="number"&&(c=s+n),c=Math.max(0,c);var d="",g=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)g+=a,d+=" ";if(g<c&&(d+=Vn(c-g)),d!=u)return or(i,d,A(t,0),A(t,u.length),"+input"),l.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var C=i.sel.ranges[m];if(C.head.line==t&&C.head.ch<u.length){var E=A(t,u.length);Mi(i,m,new oe(E,E));break}}}var tt=null;function On(e){tt=e}function Yi(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l=i=="paste"||e.state.pasteIncoming>a,s=Zn(t),u=null;if(l&&r.ranges.length>1)if(tt&&tt.text.join(`
  13. `)==t){if(r.ranges.length%tt.text.length==0){u=[];for(var c=0;c<tt.text.length;c++)u.push(o.splitLines(tt.text[c]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Qr(s,function(I){return[I]}));for(var d=e.curOp.updateInput,g=r.ranges.length-1;g>=0;g--){var p=r.ranges[g],m=p.from(),C=p.to();p.empty()&&(n&&n>0?m=A(m.line,m.ch-n):e.state.overwrite&&!l?C=A(C.line,Math.min(V(o,C.line).text.length,C.ch+ae(s).length)):l&&tt&&tt.lineWise&&tt.text.join(`
  14. `)==s.join(`
  15. `)&&(m=C=A(m.line,0)));var E={from:m,to:C,text:u?u[g%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};ir(e.doc,E),Ce(e,"inputRead",e,E)}t&&!l&&hl(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function fl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Ve(t,function(){return Yi(t,n,0,null,"paste")}),!0}function hl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Xr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(V(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Xr(e,i.head.line,"smart"));a&&Ce(e,"electricInput",e,i.head.line)}}}function cl(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:A(i,0),head:A(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Xi(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=j("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=j("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return R?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),t}function Vu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){qr(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&Se(this,t[r])(this,i,a),ve(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](An(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:Ne(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");Fl(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,He(this)}),removeOverlay:Ne(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,He(this);return}}}),indentLine:Ne(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),xr(this.doc,r)&&Xr(this,r,i,o)}),indentSelection:Ne(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Xr(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&er(this));else{var s=l.from(),u=l.to(),c=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var d=c;d<o;++d)Xr(this,d,r);var g=this.doc.sel.ranges;s.ch==0&&i.length==g.length&&g[a].from().ch>0&&Mi(this.doc,a,new oe(s,g[a].to()),rt)}}}),getTokenAt:function(r,i){return Co(this,r,i)},getLineTokens:function(r,i){return Co(this,A(r),i,!0)},getTokenTypeAt:function(r){r=ee(this.doc,r);var i=wo(this,V(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]<l)o=u+1;else{s=i[u*2+2];break}}var c=s?s.indexOf("overlay "):-1;return c<0?s:c==0?null:s.slice(0,c-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.push(a[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=a[l[i][s]];u&&o.push(u)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var c=0;c<a._global.length;c++){var d=a._global[c];d.pred(l,this)&&Pe(o,d.val)==-1&&o.push(d.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=yo(o,r==null?o.first+o.size-1:r),Lr(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=ee(this.doc,r):o=r?a.from():a.to(),$e(this,o,i||"page")},charCoords:function(r,i){return dn(this,ee(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Qo(this,r,i||"page"),mi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Qo(this,{top:r,left:0},i||"page").top,Nt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,a=!0),l=V(this.doc,r)}else l=r;return cn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-ct(l):0)},defaultTextHeight:function(){return Jt(this.display)},defaultCharWidth:function(){return Qt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=$e(this,ee(this.doc,r));var u=r.bottom,c=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var d=Math.max(s.wrapper.clientHeight,this.doc.height),g=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>d)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=d&&(u=r.bottom),c+i.offsetWidth>g&&(c=g-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(c=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?c=0:l=="middle"&&(c=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=c+"px"),o&&Ms(this,{left:c,top:u,right:c+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:Ne(tl),triggerOnKeyPress:Ne(nl),triggerOnKeyUp:rl,triggerOnMouseDown:Ne(il),execCommand:function(r){if(Ur.hasOwnProperty(r))return Ur[r].call(null,this)},triggerElectric:Ne(function(r){hl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=ee(this.doc,r),u=0;u<i&&(s=qi(this.doc,s,l,o,a),!s.hitSide);++u);return s},moveH:Ne(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?qi(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},gr)}),deleteH:Ne(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):sr(this,function(l){var s=qi(a,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,o,a){var l=1,s=a;i<0&&(l=-1,i=-i);for(var u=ee(this.doc,r),c=0;c<i;++c){var d=$e(this,u,"div");if(s==null?s=d.left:d.left=s,u=pl(this,d,l,o),u.hitSide)break}return u},moveV:Ne(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(c){if(s)return r<0?c.from():c.to();var d=$e(o,c.head,"div");c.goalColumn!=null&&(d.left=c.goalColumn),l.push(d.left);var g=pl(o,d,r,i);return i=="page"&&c==a.sel.primary()&&Ai(o,dn(o,g,"div").top-d.top),g},gr),l.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,o=V(i,r.line).text,a=r.ch,l=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==o.length)&&a?--a:++l;for(var u=o.charAt(a),c=$r(u,s)?function(d){return $r(d,s)}:/\s/.test(u)?function(d){return/\s/.test(d)}:function(d){return!/\s/.test(d)&&!$r(d)};a>0&&c(o.charAt(a-1));)--a;for(;l<o.length&&c(o.charAt(l));)++l}return new oe(A(r.line,a),A(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ut(this.display.cursorDiv,"CodeMirror-overwrite"):xe(this.display.cursorDiv,"CodeMirror-overwrite"),ve(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Re(Ut(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ne(function(r,i){Pr(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-ot(this)-this.display.barHeight,width:r.scrollWidth-ot(this)-this.display.barWidth,clientHeight:pi(this),clientWidth:It(this)}},scrollIntoView:Ne(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:A(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Bs(this,r):la(this,r.from,r.to,r.margin)}),setSize:Ne(function(r,i){var o=this,a=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&qo(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){bt(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,ve(this,"refresh",this)}),operation:function(r){return Ve(this,r)},startOperation:function(){return Mt(this)},endOperation:function(){return Bt(this)},refresh:Ne(function(){var r=this.display.cachedTextHeight;He(this),this.curOp.forceUpdate=!0,kr(this),Pr(this,this.doc.scrollLeft,this.doc.scrollTop),Oi(this.display),(r==null||Math.abs(r-Jt(this.display))>.5||this.options.lineWrapping)&&Li(this),ve(this,"refresh",this)}),swapDoc:Ne(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),xa(this,r),kr(this),this.display.input.reset(),Pr(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ce(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[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}},Kt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function qi(e,t,n,r,i){var o=t,a=n,l=V(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var H=t.line+s;return H<e.first||H>=e.first+e.size?!1:(t=new A(H,t.ch,t.sticky),l=V(e,H))}function c(H){var D;if(r=="codepoint"){var M=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(M))D=null;else{var Y=n>0?M>=55296&&M<56320:M>=56320&&M<57343;D=new A(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Y?2:1))),-n)}}else i?D=Cu(e.cm,l,t,n):D=zi(l,t,n);if(D==null)if(!H&&u())t=Vi(i,e.cm,l,t.line,s);else return!1;else t=D;return!0}if(r=="char"||r=="codepoint")c();else if(r=="column")c(!0);else if(r=="word"||r=="group")for(var d=null,g=r=="group",p=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(n<0&&!c(!m));m=!1){var C=l.text.charAt(t.ch)||`
  16. `,E=$r(C,p)?"w":g&&C==`
  17. `?"n":!g||/\s/.test(C)?null:"p";if(g&&!m&&!E&&(E="s"),d&&d!=E){n<0&&(n=1,c(),t.sticky="after");break}if(E&&(d=E),n>0&&!c(!m))break}var I=_n(e,t,o,a,!0);return ni(o,I)&&(I.hitSide=!0),I}function pl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,qr(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Jt(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=mi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var se=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new yt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};se.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Xi(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}q(i,"paste",function(l){!o(l)||Le(r,l)||fl(l,r)||_<=11&&setTimeout(Se(r,function(){return t.updateFromDOM()}),20)}),q(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),q(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),q(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),q(i,"touchstart",function(){return n.forceCompositionEnd()}),q(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Le(r,l))){if(r.somethingSelected())On({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=cl(r);On({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=tt.text.join(`
  18. `);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var c=dl(),d=c.firstChild;Xi(d),r.display.lineSpace.insertBefore(c,r.display.lineSpace.firstChild),d.value=tt.text.join(`
  19. `);var g=Re(At(i));pr(d),setTimeout(function(){r.display.lineSpace.removeChild(c),g.focus(),g==i&&n.showPrimarySelection()},50)}}q(i,"copy",a),q(i,"cut",a)},se.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},se.prototype.prepareSelection=function(){var e=ia(this.cm,!1);return e.focus=Re(At(this.div))==this.div,e},se.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},se.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},se.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=Nn(t,e.anchorNode,e.anchorOffset),a=Nn(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&$(rn(o,a),r)==0&&$(tn(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&vl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&vl(t,i);if(!u){var c=l[l.length-1].measure,d=c.maps?c.maps[c.maps.length-1]:c.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(!s||!u){e.removeAllRanges();return}var g=e.rangeCount&&e.getRangeAt(0),p;try{p=Je(s.node,s.offset,u.offset,u.node)}catch(m){}p&&(!F&&t.state.focused?(e.collapse(s.node,s.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),g&&e.anchorNode==null?e.addRange(g):F&&this.startGracePeriod()),this.rememberSelection()}},se.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)},se.prototype.showMultipleSelections=function(e){be(this.cm.display.cursorDiv,e.cursors),be(this.cm.display.selectionDiv,e.selection)},se.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},se.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Xe(this.div,t)},se.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Re(At(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},se.prototype.blur=function(){this.div.blur()},se.prototype.getField=function(){return this.div},se.prototype.supportsTouch=function(){return!0},se.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Ve(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},se.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},se.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(v&&z&&this.cm.display.gutterSpecs.length&&Gu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=Nn(t,e.anchorNode,e.anchorOffset),r=Nn(t,e.focusNode,e.focusOffset);n&&r&&Ve(t,function(){Ee(t.doc,xt(n,r),rt),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},se.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=A(r.line-1,V(e.doc,r.line-1).length)),i.ch==V(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=A(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=Ft(e,r.line))==0?(a=le(t.view[0].line),l=t.view[0].node):(a=le(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=Ft(e,i.line),u,c;if(s==t.view.length-1?(u=t.viewTo-1,c=t.lineDiv.lastChild):(u=le(t.view[s+1].line)-1,c=t.view[s+1].node.previousSibling),!l)return!1;for(var d=e.doc.splitLines(Uu(e,l,c,a,u)),g=Ot(e.doc,A(a,0),A(u,V(e.doc,u).text.length));d.length>1&&g.length>1;)if(ae(d)==ae(g))d.pop(),g.pop(),u--;else if(d[0]==g[0])d.shift(),g.shift(),a++;else break;for(var p=0,m=0,C=d[0],E=g[0],I=Math.min(C.length,E.length);p<I&&C.charCodeAt(p)==E.charCodeAt(p);)++p;for(var H=ae(d),D=ae(g),M=Math.min(H.length-(d.length==1?p:0),D.length-(g.length==1?p:0));m<M&&H.charCodeAt(H.length-m-1)==D.charCodeAt(D.length-m-1);)++m;if(d.length==1&&g.length==1&&a==r.line)for(;p&&p>r.ch&&H.charCodeAt(H.length-m-1)==D.charCodeAt(D.length-m-1);)p--,m++;d[d.length-1]=H.slice(0,H.length-m).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var Y=A(a,p),G=A(u,g.length?ae(g).length-m:0);if(d.length>1||d[0]||$(Y,G))return or(e.doc,d,Y,G,"+input"),!0},se.prototype.ensurePolled=function(){this.forceCompositionEnd()},se.prototype.reset=function(){this.forceCompositionEnd()},se.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},se.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))},se.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ve(this.cm,function(){return He(e.cm)})},se.prototype.setUneditable=function(e){e.contentEditable="false"},se.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Se(this.cm,Yi)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},se.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},se.prototype.onContextMenu=function(){},se.prototype.resetPosition=function(){},se.prototype.needsContentAttribute=!0;function vl(e,t){var n=vi(e,t.line);if(!n||n.hidden)return null;var r=V(e.doc,t.line),i=Uo(n,r,t.line),o=ft(r,e.doc.direction),a="left";if(o){var l=br(o,t.ch);a=l%2?"right":"left"}var s=Yo(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function Gu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function fr(e,t){return t&&(e.bad=!0),e}function Uu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(p){return function(m){return m.id==p}}function c(){a&&(o+=l,s&&(o+=l),a=s=!1)}function d(p){p&&(c(),o+=p)}function g(p){if(p.nodeType==1){var m=p.getAttribute("cm-text");if(m){d(m);return}var C=p.getAttribute("cm-marker"),E;if(C){var I=e.findMarks(A(r,0),A(i+1,0),u(+C));I.length&&(E=I[0].find(0))&&d(Ot(e.doc,E.from,E.to).join(l));return}if(p.getAttribute("contenteditable")=="false")return;var H=/^(pre|div|p|li|table|br)$/i.test(p.nodeName);if(!/^br$/i.test(p.nodeName)&&p.textContent.length==0)return;H&&c();for(var D=0;D<p.childNodes.length;D++)g(p.childNodes[D]);/^(pre|p)$/i.test(p.nodeName)&&(s=!0),H&&(a=!0)}else p.nodeType==3&&d(p.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;g(t),t!=n;)t=t.nextSibling,s=!1;return o}function Nn(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return fr(e.clipPos(A(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Ku(o,t,n)}}function Ku(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!Xe(r,t))return fr(A(le(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?ae(e.rest):e.line;return fr(A(le(o),o.text.length),i)}var a=t.nodeType==3?t:null,l=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function c(E,I,H){for(var D=-1;D<(u?u.length:0);D++)for(var M=D<0?s.map:u[D],Y=0;Y<M.length;Y+=3){var G=M[Y+2];if(G==E||G==I){var ne=le(D<0?e.line:e.rest[D]),ue=M[Y]+H;return(H<0||G!=E)&&(ue=M[Y+(H?1:0)]),A(ne,ue)}}}var d=c(a,l,n);if(d)return fr(d,i);for(var g=l.nextSibling,p=a?a.nodeValue.length-n:0;g;g=g.nextSibling){if(d=c(g,g.firstChild,0),d)return fr(A(d.line,d.ch-p),i);p+=g.textContent.length}for(var m=l.previousSibling,C=n;m;m=m.previousSibling){if(d=c(m,m.firstChild,-1),d)return fr(A(d.line,d.ch+C),i);C+=m.textContent.length}}var de=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new yt,this.hasSelection=!1,this.composing=null,this.resetting=!1};de.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),y&&(i.style.width="0px"),q(i,"input",function(){b&&_>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),q(i,"paste",function(a){Le(r,a)||fl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Le(r,a)){if(r.somethingSelected())On({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=cl(r);On({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,rt):(n.prevInput="",i.value=l.text.join(`
  20. `),pr(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}q(i,"cut",o),q(i,"copy",o),q(e.scroller,"paste",function(a){if(!(dt(e,a)||Le(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),q(e.lineSpace,"selectstart",function(a){dt(e,a)||Fe(a)}),q(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),q(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},de.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Xi(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},de.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},de.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ia(e);if(e.options.moveInputWithCursor){var i=$e(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},de.prototype.showSelection=function(e){var t=this.cm,n=t.display;be(n.cursorDiv,e.cursors),be(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},de.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&pr(this.textarea),b&&_>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",b&&_>=9&&(this.hasSelection=null));this.resetting=!1}},de.prototype.getField=function(){return this.textarea},de.prototype.supportsTouch=function(){return!1},de.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!L||Re(At(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},de.prototype.blur=function(){this.textarea.blur()},de.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},de.prototype.receivedFocus=function(){this.slowPoll()},de.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},de.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},de.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Ul(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(b&&_>=9&&this.hasSelection===i||P&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="​"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return Ve(t,function(){Yi(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
  21. `)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},de.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},de.prototype.onKeyPress=function(){b&&_>=9&&(this.hasSelection=null),this.fastPoll()},de.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Rt(n,e),a=r.scroller.scrollTop;if(!o||J)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&Se(n,Ee)(n.doc,xt(o),rt);var s=i.style.cssText,u=t.wrapper.style.cssText,c=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
  22. top: `+(e.clientY-c.top-5)+"px; left: "+(e.clientX-c.left-5)+`px;
  23. z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`;
  24. outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var d;R&&(d=i.ownerDocument.defaultView.scrollY),r.input.focus(),R&&i.ownerDocument.defaultView.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=p,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function g(){if(i.selectionStart!=null){var C=n.somethingSelected(),E="​"+(C?i.value:"");i.value="⇚",i.value=E,t.prevInput=C?"":"​",i.selectionStart=1,i.selectionEnd=E.length,r.selForContextMenu=n.doc.sel}}function p(){if(t.contextMenuPending==p&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,b&&_<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!b||b&&_<9)&&g();var C=0,E=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?Se(n,Da)(n):C++<10?r.detectingSelectAll=setTimeout(E,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(E,200)}}if(b&&_>=9&&g(),Ue){wr(e);var m=function(){Ke(window,"mouseup",m),setTimeout(p,20)};q(window,"mouseup",m)}else setTimeout(p,50)},de.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},de.prototype.setUneditable=function(){},de.prototype.needsContentAttribute=!1;function ju(e,t){if(t=t?Pt(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 n=Re(At(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(q(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(Ke(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=fe(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function Yu(e){e.off=Ke,e.on=q,e.wheelEventPixels=eu,e.Doc=We,e.splitLines=Zn,e.countColumn=qe,e.findColumn=zn,e.isWordChar=Gn,e.Pass=Zr,e.signal=ve,e.Line=Xt,e.changeEnd=Lt,e.scrollbarModel=fa,e.Pos=A,e.cmpPos=$,e.modes=Qn,e.mimeModes=jt,e.resolveMode=en,e.getMode=$n,e.modeExtensions=Yt,e.extendMode=ql,e.copyState=Et,e.startState=go,e.innerMode=ei,e.commands=Ur,e.keyMap=vt,e.keyName=Za,e.isModifierKey=Xa,e.lookupKey=lr,e.normalizeKeyMap=Lu,e.StringStream=ge,e.SharedTextMarker=zr,e.TextMarker=St,e.LineWidget=Br,e.e_preventDefault=Fe,e.e_stopPropagation=po,e.e_stop=wr,e.addClass=ut,e.contains=Xe,e.rmClass=xe,e.keyNames=_t}Wu(fe),Vu(fe);var Xu="iter insert remove copy getEditor constructor".split(" ");for(var In in We.prototype)We.prototype.hasOwnProperty(In)&&Pe(Xu,In)<0&&(fe.prototype[In]=function(e){return function(){return e.apply(this.doc,arguments)}}(We.prototype[In]));return Kt(We),fe.inputStyles={textarea:de,contenteditable:se},fe.defineMode=function(e){!fe.defaults.mode&&e!="null"&&(fe.defaults.mode=e),Yl.apply(this,arguments)},fe.defineMIME=Xl,fe.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),fe.defineMIME("text/plain","null"),fe.defineExtension=function(e,t){fe.prototype[e]=t},fe.defineDocExtension=function(e,t){We.prototype[e]=t},fe.fromTextArea=ju,Yu(fe),fe.version="5.65.16",fe})}($i)),$i.exports}var hf=kt();const cf=tf(hf);var dr=(h=>(h.JSON="application/json",h.APL="apl",h.ASCIIARMOR="asciiarmor",h.ASTERISK="asterisk",h.BRAINFUCK="brainfuck",h.CLIKE="clike",h.CLOJURE="clojure",h.CMAKE="cmake",h.COBOL="cobol",h.COFFEESCRIPT="coffeescript",h.COMMONLISP="commonlisp",h.CRYSTAL="crystal",h.CSS="css",h.CYPHER="cypher",h.D="d",h.DART="dart",h.DIFF="diff",h.DJANGO="django",h.DOCKERFILE="dockerfile",h.DTD="dtd",h.DYLAN="dylan",h.EBNF="ebnf",h.ECL="ecl",h.EIFFEL="eiffel",h.ELM="elm",h.ERLANG="erlang",h.FACTOR="factor",h.FCL="fcl",h.FORTH="forth",h.FORTRAN="fortran",h.GAS="gas",h.GFM="gfm",h.GHERKIN="gherkin",h.GO="go",h.GROOVY="groovy",h.HAML="haml",h.HANDLEBARS="handlebars",h.HASKELL="haskell",h.HAXE="haxe",h.HTMLEMBEDDED="htmlembedded",h.HTMLMIXED="htmlmixed",h.HTTP="http",h.IDL="idl",h.JAVASCRIPT="javascript",h.JINJA2="jinja2",h.JSX="jsx",h.JULIA="julia",h.LIVESCRIPT="livescript",h.LUA="lua",h.MARKDOWN="markdown",h.MATHEMATICA="mathematica",h.MBOX="mbox",h.MIRC="mirc",h.MLLIKE="mllike",h.MODELICA="modelica",h.MSCGEN="mscgen",h.MUMPS="mumps",h.NGINX="nginx",h.NSIS="nsis",h.NTRIPLES="ntriples",h.OCTAVE="octave",h.OZ="oz",h.PASCAL="pascal",h.PEGJS="pegjs",h.PERL="perl",h.PHP="php",h.PIG="pig",h.POWERSHELL="powershell",h.PROPERTIES="properties",h.PROTOBUF="protobuf",h.PUG="pug",h.PUPPET="puppet",h.PYTHON="python",h.Q="q",h.R="r",h.RPM="rpm",h.RST="rst",h.RUBY="ruby",h.RUST="rust",h.SAS="sas",h.SASS="sass",h.SCHEME="scheme",h.SHELL="shell",h.SIEVE="sieve",h.SLIM="slim",h.SMALLTALK="smalltalk",h.SMARTY="smarty",h.SOLR="solr",h.SOY="soy",h.SPARQL="sparql",h.SPREADSHEET="spreadsheet",h.SQL="sql",h.STEX="stex",h.STYLUS="stylus",h.SWIFT="swift",h.TCL="tcl",h.TEXTILE="textile",h.TIDDLYWIKI="tiddlywiki",h.TIKI="tiki",h.TOML="toml",h.TORNADO="tornado",h.TROFF="troff",h.TTCN="ttcn",h.TURTLE="turtle",h.TWIG="twig",h.VB="vb",h.VBSCRIPT="vbscript",h.VELOCITY="velocity",h.VERILOG="verilog",h.VHDL="vhdl",h.VUE="vue",h.WAST="wast",h.WEBIDL="webidl",h.XML="xml",h.XQUERY="xquery",h.YACAS="yacas",h.YAML="yaml",h.Z80="z80",h))(dr||{});function df(h){return{"application/json":()=>x(this,null,function*(){return yield S(()=>import("./javascript-C0runXw9.js").then(f=>f.j),__vite__mapDeps([0,1,2]))}),apl:()=>x(this,null,function*(){return yield S(()=>import("./apl-zLfE5rQP.js").then(f=>f.a),__vite__mapDeps([3,1,2]))}),asciiarmor:()=>x(this,null,function*(){return yield S(()=>import("./asciiarmor-Do-7xkZ0.js").then(f=>f.a),__vite__mapDeps([4,1,2]))}),asterisk:()=>x(this,null,function*(){return yield S(()=>import("./asterisk-Dl6-Cx_L.js").then(f=>f.a),__vite__mapDeps([5,1,2]))}),brainfuck:()=>x(this,null,function*(){return yield S(()=>import("./brainfuck-DVgfREw_.js").then(f=>f.b),__vite__mapDeps([6,1,2]))}),clike:()=>x(this,null,function*(){return yield S(()=>import("./clike-CbqrjqIp.js").then(f=>f.c),__vite__mapDeps([7,1,2]))}),clojure:()=>x(this,null,function*(){return yield S(()=>import("./clojure-B7BO6eTf.js").then(f=>f.c),__vite__mapDeps([8,1,2]))}),cmake:()=>x(this,null,function*(){return yield S(()=>import("./cmake-CksKCwmd.js").then(f=>f.c),__vite__mapDeps([9,1,2]))}),cobol:()=>x(this,null,function*(){return yield S(()=>import("./cobol-BagBmwKo.js").then(f=>f.c),__vite__mapDeps([10,1,2]))}),coffeescript:()=>x(this,null,function*(){return yield S(()=>import("./coffeescript-fFmhlGnR.js").then(f=>f.c),__vite__mapDeps([11,1,2]))}),commonlisp:()=>x(this,null,function*(){return yield S(()=>import("./commonlisp-Dt9YBdGp.js").then(f=>f.c),__vite__mapDeps([12,1,2]))}),crystal:()=>x(this,null,function*(){return yield S(()=>import("./crystal-C_YQTvkC.js").then(f=>f.c),__vite__mapDeps([13,1,2]))}),css:()=>x(this,null,function*(){return yield S(()=>import("./css-_7XECuso.js").then(f=>f.c),__vite__mapDeps([14,1,2]))}),cypher:()=>x(this,null,function*(){return yield S(()=>import("./cypher-ClLSXDoB.js").then(f=>f.c),__vite__mapDeps([15,1,2]))}),d:()=>x(this,null,function*(){return yield S(()=>import("./d-DdB_Nypc.js").then(f=>f.d),__vite__mapDeps([16,1,2]))}),dart:()=>x(this,null,function*(){return yield S(()=>import("./dart-NqTr4gQb.js").then(f=>f.d),__vite__mapDeps([17,1,2,7]))}),diff:()=>x(this,null,function*(){return yield S(()=>import("./diff-DP8cpWw3.js").then(f=>f.d),__vite__mapDeps([18,1,2]))}),django:()=>x(this,null,function*(){return yield S(()=>import("./django-Cr0ySjV7.js").then(f=>f.d),__vite__mapDeps([19,1,2,20,21,0,14,22]))}),dockerfile:()=>x(this,null,function*(){return yield S(()=>import("./dockerfile-c7yS_1k1.js").then(f=>f.d),__vite__mapDeps([23,1,2,24]))}),dtd:()=>x(this,null,function*(){return yield S(()=>import("./dtd-BoJNBv-L.js").then(f=>f.d),__vite__mapDeps([25,1,2]))}),dylan:()=>x(this,null,function*(){return yield S(()=>import("./dylan-glqjD8lh.js").then(f=>f.d),__vite__mapDeps([26,1,2]))}),ebnf:()=>x(this,null,function*(){return yield S(()=>import("./ebnf-B69swxbP.js").then(f=>f.e),__vite__mapDeps([27,1,2]))}),ecl:()=>x(this,null,function*(){return yield S(()=>import("./ecl-BcquUJs9.js").then(f=>f.e),__vite__mapDeps([28,1,2]))}),eiffel:()=>x(this,null,function*(){return yield S(()=>import("./eiffel-BW6UbfQv.js").then(f=>f.e),__vite__mapDeps([29,1,2]))}),elm:()=>x(this,null,function*(){return yield S(()=>import("./elm-BXgy4upO.js").then(f=>f.e),__vite__mapDeps([30,1,2]))}),erlang:()=>x(this,null,function*(){return yield S(()=>import("./erlang-CoWJ_jdP.js").then(f=>f.e),__vite__mapDeps([31,1,2]))}),factor:()=>x(this,null,function*(){return yield S(()=>import("./factor-CvscPoNe.js").then(f=>f.f),__vite__mapDeps([32,1,2,24]))}),fcl:()=>x(this,null,function*(){return yield S(()=>import("./fcl-w30Bp-6o.js").then(f=>f.f),__vite__mapDeps([33,1,2]))}),forth:()=>x(this,null,function*(){return yield S(()=>import("./forth-BRGZgJzZ.js").then(f=>f.f),__vite__mapDeps([34,1,2]))}),fortran:()=>x(this,null,function*(){return yield S(()=>import("./fortran-BWfrboS0.js").then(f=>f.f),__vite__mapDeps([35,1,2]))}),gas:()=>x(this,null,function*(){return yield S(()=>import("./gas-BAwmoLl4.js").then(f=>f.g),__vite__mapDeps([36,1,2]))}),gfm:()=>x(this,null,function*(){return yield S(()=>import("./gfm-zED9mVpT.js").then(f=>f.g),__vite__mapDeps([37,1,2,38,21,22]))}),gherkin:()=>x(this,null,function*(){return yield S(()=>import("./gherkin-CSTxET5C.js").then(f=>f.g),__vite__mapDeps([39,1,2]))}),go:()=>x(this,null,function*(){return yield S(()=>import("./go-BDFk3iT5.js").then(f=>f.g),__vite__mapDeps([40,1,2]))}),groovy:()=>x(this,null,function*(){return yield S(()=>import("./groovy-BoGByj99.js").then(f=>f.g),__vite__mapDeps([41,1,2]))}),haml:()=>x(this,null,function*(){return yield S(()=>import("./haml-mAoz9Cg_.js").then(f=>f.h),__vite__mapDeps([42,1,2,20,21,0,14,43]))}),handlebars:()=>x(this,null,function*(){return yield S(()=>import("./handlebars-tIlZKpI9.js").then(f=>f.h),__vite__mapDeps([44,1,2,24,45]))}),haskell:()=>x(this,null,function*(){return yield S(()=>import("./haskell-CaA0e7fj.js").then(f=>f.h),__vite__mapDeps([46,1,2]))}),haxe:()=>x(this,null,function*(){return yield S(()=>import("./haxe-Bw9cDHlO.js").then(f=>f.h),__vite__mapDeps([47,1,2]))}),htmlembedded:()=>x(this,null,function*(){return yield S(()=>import("./htmlembedded-Ckszlea-.js").then(f=>f.h),__vite__mapDeps([48,1,2,20,21,0,14,45]))}),htmlmixed:()=>x(this,null,function*(){return yield S(()=>import("./htmlmixed-S48eAt07.js").then(f=>f.h),__vite__mapDeps([49,1,2,20,21,0,14]))}),http:()=>x(this,null,function*(){return yield S(()=>import("./http-B511s2ir.js").then(f=>f.h),__vite__mapDeps([50,1,2]))}),idl:()=>x(this,null,function*(){return yield S(()=>import("./idl-DZadFF97.js").then(f=>f.i),__vite__mapDeps([51,1,2]))}),javascript:()=>x(this,null,function*(){return yield S(()=>import("./javascript-C0runXw9.js").then(f=>f.j),__vite__mapDeps([0,1,2]))}),jinja2:()=>x(this,null,function*(){return yield S(()=>import("./jinja2-DgZuyF-4.js").then(f=>f.j),__vite__mapDeps([52,1,2]))}),jsx:()=>x(this,null,function*(){return yield S(()=>import("./jsx-B4bOLTGX.js").then(f=>f.j),__vite__mapDeps([53,1,2,21,0]))}),julia:()=>x(this,null,function*(){return yield S(()=>import("./julia-DMwb9N1P.js").then(f=>f.j),__vite__mapDeps([54,1,2]))}),livescript:()=>x(this,null,function*(){return yield S(()=>import("./livescript-DRBVSWtJ.js").then(f=>f.l),__vite__mapDeps([55,1,2]))}),lua:()=>x(this,null,function*(){return yield S(()=>import("./lua-DF6LKH9h.js").then(f=>f.l),__vite__mapDeps([56,1,2]))}),markdown:()=>x(this,null,function*(){return yield S(()=>import("./markdown-BUyyni4w.js").then(f=>f.m),__vite__mapDeps([57,1,2,38,21]))}),mathematica:()=>x(this,null,function*(){return yield S(()=>import("./mathematica-BN67McW3.js").then(f=>f.m),__vite__mapDeps([58,1,2]))}),mbox:()=>x(this,null,function*(){return yield S(()=>import("./mbox-TtGKsB4G.js").then(f=>f.m),__vite__mapDeps([59,1,2]))}),mirc:()=>x(this,null,function*(){return yield S(()=>import("./mirc-Do6SGHsb.js").then(f=>f.m),__vite__mapDeps([60,1,2]))}),mllike:()=>x(this,null,function*(){return yield S(()=>import("./mllike-C4sux_AD.js").then(f=>f.m),__vite__mapDeps([61,1,2]))}),modelica:()=>x(this,null,function*(){return yield S(()=>import("./modelica-WdF900bX.js").then(f=>f.m),__vite__mapDeps([62,1,2]))}),mscgen:()=>x(this,null,function*(){return yield S(()=>import("./mscgen-FXpyAEp1.js").then(f=>f.m),__vite__mapDeps([63,1,2]))}),mumps:()=>x(this,null,function*(){return yield S(()=>import("./mumps-CYDAote_.js").then(f=>f.m),__vite__mapDeps([64,1,2]))}),nginx:()=>x(this,null,function*(){return yield S(()=>import("./nginx-8EWYo5aN.js").then(f=>f.n),__vite__mapDeps([65,1,2]))}),nsis:()=>x(this,null,function*(){return yield S(()=>import("./nsis-V-nh5FnW.js").then(f=>f.n),__vite__mapDeps([66,1,2,24]))}),ntriples:()=>x(this,null,function*(){return yield S(()=>import("./ntriples-Bf6qR5Vj.js").then(f=>f.n),__vite__mapDeps([67,1,2]))}),octave:()=>x(this,null,function*(){return yield S(()=>import("./octave-0TxgvgfU.js").then(f=>f.o),__vite__mapDeps([68,1,2]))}),oz:()=>x(this,null,function*(){return yield S(()=>import("./oz-YKjkJu7g.js").then(f=>f.o),__vite__mapDeps([69,1,2]))}),pascal:()=>x(this,null,function*(){return yield S(()=>import("./pascal-Cjts3mlK.js").then(f=>f.p),__vite__mapDeps([70,1,2]))}),pegjs:()=>x(this,null,function*(){return yield S(()=>import("./pegjs-r3zISsBk.js").then(f=>f.p),__vite__mapDeps([71,1,2,0]))}),perl:()=>x(this,null,function*(){return yield S(()=>import("./perl-B1do5Zj5.js").then(f=>f.p),__vite__mapDeps([72,1,2]))}),php:()=>x(this,null,function*(){return yield S(()=>import("./php-BjMv37q4.js").then(f=>f.p),__vite__mapDeps([73,1,2,20,21,0,14,7]))}),pig:()=>x(this,null,function*(){return yield S(()=>import("./pig-UrTc6X8Q.js").then(f=>f.p),__vite__mapDeps([74,1,2]))}),powershell:()=>x(this,null,function*(){return yield S(()=>import("./powershell-XydHAPqy.js").then(f=>f.p),__vite__mapDeps([75,1,2]))}),properties:()=>x(this,null,function*(){return yield S(()=>import("./properties-Czp0CTK7.js").then(f=>f.p),__vite__mapDeps([76,1,2]))}),protobuf:()=>x(this,null,function*(){return yield S(()=>import("./protobuf-BA_h8Wlf.js").then(f=>f.p),__vite__mapDeps([77,1,2]))}),pug:()=>x(this,null,function*(){return yield S(()=>import("./pug-DjiMg7mW.js").then(f=>f.p),__vite__mapDeps([78,1,2,0,14,20,21]))}),puppet:()=>x(this,null,function*(){return yield S(()=>import("./puppet-DYDSY7Dj.js").then(f=>f.p),__vite__mapDeps([79,1,2]))}),python:()=>x(this,null,function*(){return yield S(()=>import("./python-C1X48StL.js").then(f=>f.p),__vite__mapDeps([80,1,2]))}),q:()=>x(this,null,function*(){return yield S(()=>import("./q-CuOwICRo.js").then(f=>f.q),__vite__mapDeps([81,1,2]))}),r:()=>x(this,null,function*(){return yield S(()=>import("./r-BU6hSvk5.js").then(f=>f.r),__vite__mapDeps([82,1,2]))}),rpm:()=>x(this,null,function*(){return yield S(()=>import("./rpm-BztRzSX7.js").then(f=>f.r),__vite__mapDeps([83,1,2]))}),rst:()=>x(this,null,function*(){return yield S(()=>import("./rst-CKbfDNrD.js").then(f=>f.r),__vite__mapDeps([84,1,2,80,85,22]))}),ruby:()=>x(this,null,function*(){return yield S(()=>import("./ruby-mqj0y2bQ.js").then(f=>f.r),__vite__mapDeps([86,1,2,43]))}),rust:()=>x(this,null,function*(){return yield S(()=>import("./rust-zgJDuv0h.js").then(f=>f.r),__vite__mapDeps([87,1,2,24]))}),sas:()=>x(this,null,function*(){return yield S(()=>import("./sas-CEyk9sX1.js").then(f=>f.s),__vite__mapDeps([88,1,2]))}),sass:()=>x(this,null,function*(){return yield S(()=>import("./sass-B9irdM0E.js").then(f=>f.s),__vite__mapDeps([89,1,2,14]))}),scheme:()=>x(this,null,function*(){return yield S(()=>import("./scheme-x6TdpmVC.js").then(f=>f.s),__vite__mapDeps([90,1,2]))}),shell:()=>x(this,null,function*(){return yield S(()=>import("./shell-YD6A_fFc.js").then(f=>f.s),__vite__mapDeps([91,1,2]))}),sieve:()=>x(this,null,function*(){return yield S(()=>import("./sieve-C5YXMwr0.js").then(f=>f.s),__vite__mapDeps([92,1,2]))}),slim:()=>x(this,null,function*(){return yield S(()=>import("./slim-Bf1FQuBQ.js").then(f=>f.s),__vite__mapDeps([93,1,2,20,21,0,14,43]))}),smalltalk:()=>x(this,null,function*(){return yield S(()=>import("./smalltalk-Db2BOukD.js").then(f=>f.s),__vite__mapDeps([94,1,2]))}),smarty:()=>x(this,null,function*(){return yield S(()=>import("./smarty-iKWBBJeb.js").then(f=>f.s),__vite__mapDeps([95,1,2]))}),solr:()=>x(this,null,function*(){return yield S(()=>import("./solr-CFsp-tWW.js").then(f=>f.s),__vite__mapDeps([96,1,2]))}),soy:()=>x(this,null,function*(){return yield S(()=>import("./soy-Bp7B5X5P.js").then(f=>f.s),__vite__mapDeps([97,1,2,20,21,0,14]))}),sparql:()=>x(this,null,function*(){return yield S(()=>import("./sparql-DcPrKfhZ.js").then(f=>f.s),__vite__mapDeps([98,1,2]))}),spreadsheet:()=>x(this,null,function*(){return yield S(()=>import("./spreadsheet-C3z-gWru.js").then(f=>f.s),__vite__mapDeps([99,1,2]))}),sql:()=>x(this,null,function*(){return yield S(()=>import("./sql-DHVlzNoE.js").then(f=>f.s),__vite__mapDeps([100,1,2]))}),stex:()=>x(this,null,function*(){return yield S(()=>import("./stex-Cg_aPdoz.js").then(f=>f.s),__vite__mapDeps([101,1,2,85]))}),stylus:()=>x(this,null,function*(){return yield S(()=>import("./stylus-MetgqTN6.js").then(f=>f.s),__vite__mapDeps([102,1,2]))}),swift:()=>x(this,null,function*(){return yield S(()=>import("./swift-DXKRkQMz.js").then(f=>f.s),__vite__mapDeps([103,1,2]))}),tcl:()=>x(this,null,function*(){return yield S(()=>import("./tcl-BevIpjQ5.js").then(f=>f.t),__vite__mapDeps([104,1,2]))}),textile:()=>x(this,null,function*(){return yield S(()=>import("./textile-_4Nypotk.js").then(f=>f.t),__vite__mapDeps([105,1,2]))}),tiddlywiki:()=>x(this,null,function*(){return yield S(()=>import("./tiddlywiki-DDJ5TKib.js").then(f=>f.t),__vite__mapDeps([106,1,2]))}),tiki:()=>x(this,null,function*(){return yield S(()=>import("./tiki-DTxprbbV.js").then(f=>f.t),__vite__mapDeps([107,1,2]))}),toml:()=>x(this,null,function*(){return yield S(()=>import("./toml-023vXGSv.js").then(f=>f.t),__vite__mapDeps([108,1,2]))}),tornado:()=>x(this,null,function*(){return yield S(()=>import("./tornado-Bdo4Jy6O.js").then(f=>f.t),__vite__mapDeps([109,1,2,20,21,0,14,22]))}),troff:()=>x(this,null,function*(){return yield S(()=>import("./troff-DTRuyQRy.js").then(f=>f.t),__vite__mapDeps([110,1,2]))}),ttcn:()=>x(this,null,function*(){return yield S(()=>import("./ttcn-R1BoT9rH.js").then(f=>f.t),__vite__mapDeps([111,1,2]))}),turtle:()=>x(this,null,function*(){return yield S(()=>import("./turtle-CM9rYn40.js").then(f=>f.t),__vite__mapDeps([112,1,2]))}),twig:()=>x(this,null,function*(){return yield S(()=>import("./twig-C7dwzfeV.js").then(f=>f.t),__vite__mapDeps([113,1,2,45]))}),vb:()=>x(this,null,function*(){return yield S(()=>import("./vb-BXrUi_eW.js").then(f=>f.v),__vite__mapDeps([114,1,2]))}),vbscript:()=>x(this,null,function*(){return yield S(()=>import("./vbscript-BokD97Qh.js").then(f=>f.v),__vite__mapDeps([115,1,2]))}),velocity:()=>x(this,null,function*(){return yield S(()=>import("./velocity-DvNFKKpp.js").then(f=>f.v),__vite__mapDeps([116,1,2]))}),verilog:()=>x(this,null,function*(){return yield S(()=>import("./verilog-B7VFNSSq.js").then(f=>f.v),__vite__mapDeps([117,1,2]))}),vhdl:()=>x(this,null,function*(){return yield S(()=>import("./vhdl-B1rA6yA-.js").then(f=>f.v),__vite__mapDeps([118,1,2]))}),vue:()=>x(this,null,function*(){return yield S(()=>import("./vue-DaauBs6F.js").then(f=>f.v),__vite__mapDeps([119,1,2,22,21,0,11,14,89,102,78,20,44,24,45]))}),wast:()=>x(this,null,function*(){return yield S(()=>import("./wast-m9bWxpvr.js").then(f=>f.w),__vite__mapDeps([120,1,2,24]))}),webidl:()=>x(this,null,function*(){return yield S(()=>import("./webidl-DE5IAe36.js").then(f=>f.w),__vite__mapDeps([121,1,2]))}),xml:()=>x(this,null,function*(){return yield S(()=>import("./xml-BfhUlznu.js").then(f=>f.x),__vite__mapDeps([122,1,2,21]))}),xquery:()=>x(this,null,function*(){return yield S(()=>import("./xquery-BzB4WOAP.js").then(f=>f.x),__vite__mapDeps([123,1,2]))}),yacas:()=>x(this,null,function*(){return yield S(()=>import("./yacas-BaDrOsGa.js").then(f=>f.y),__vite__mapDeps([124,1,2]))}),yaml:()=>x(this,null,function*(){return yield S(()=>import("./yaml-omGv1gdd.js").then(f=>f.y),__vite__mapDeps([125,1,2]))}),z80:()=>x(this,null,function*(){return yield S(()=>import("./z80-B6iIPEr3.js").then(f=>f.z),__vite__mapDeps([126,1,2]))})}[h]}var pf={exports:{}};(function(h,T){(function(f){f(kt())})(function(f){function O(w,b,_,R){if(_&&_.call){var U=_;_=null}else var U=B(w,_,"rangeFinder");typeof b=="number"&&(b=f.Pos(b,0));var z=B(w,_,"minFoldSize");function te(N){var y=U(w,b);if(!y||y.to.line-y.from.line<z)return null;if(R==="fold")return y;for(var v=w.findMarksAt(y.from),L=0;L<v.length;++L)if(v[L].__isFold){if(!N)return null;y.cleared=!0,v[L].clear()}return y}var J=te(!0);if(B(w,_,"scanUp"))for(;!J&&b.line>w.firstLine();)b=f.Pos(b.line-1,0),J=te(!1);if(!(!J||J.cleared||R==="unfold")){var re=F(w,_,J);f.on(re,"mousedown",function(N){k.clear(),f.e_preventDefault(N)});var k=w.markText(J.from,J.to,{replacedWith:re,clearOnEnter:B(w,_,"clearOnEnter"),__isFold:!0});k.on("clear",function(N,y){f.signal(w,"unfold",w,N,y)}),f.signal(w,"fold",w,J.from,J.to)}}function F(w,b,_){var R=B(w,b,"widget");if(typeof R=="function"&&(R=R(_.from,_.to)),typeof R=="string"){var U=document.createTextNode(R);R=document.createElement("span"),R.appendChild(U),R.className="CodeMirror-foldmarker"}else R&&(R=R.cloneNode(!0));return R}f.newFoldFunction=function(w,b){return function(_,R){O(_,R,{rangeFinder:w,widget:b})}},f.defineExtension("foldCode",function(w,b,_){O(this,w,b,_)}),f.defineExtension("isFolded",function(w){for(var b=this.findMarksAt(w),_=0;_<b.length;++_)if(b[_].__isFold)return!0}),f.commands.toggleFold=function(w){w.foldCode(w.getCursor())},f.commands.fold=function(w){w.foldCode(w.getCursor(),null,"fold")},f.commands.unfold=function(w){w.foldCode(w.getCursor(),{scanUp:!1},"unfold")},f.commands.foldAll=function(w){w.operation(function(){for(var b=w.firstLine(),_=w.lastLine();b<=_;b++)w.foldCode(f.Pos(b,0),{scanUp:!1},"fold")})},f.commands.unfoldAll=function(w){w.operation(function(){for(var b=w.firstLine(),_=w.lastLine();b<=_;b++)w.foldCode(f.Pos(b,0),{scanUp:!1},"unfold")})},f.registerHelper("fold","combine",function(){var w=Array.prototype.slice.call(arguments,0);return function(b,_){for(var R=0;R<w.length;++R){var U=w[R](b,_);if(U)return U}}}),f.registerHelper("fold","auto",function(w,b){for(var _=w.getHelpers(b,"fold"),R=0;R<_.length;R++){var U=_[R](w,b);if(U)return U}});var W={rangeFinder:f.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};f.defineOption("foldOptions",null);function B(w,b,_){if(b&&b[_]!==void 0)return b[_];var R=w.options.foldOptions;return R&&R[_]!==void 0?R[_]:W[_]}f.defineExtension("foldOption",function(w,b){return B(this,w,b)})})})();var vf=pf.exports;(function(h,T){(function(f){f(kt(),vf)})(function(f){f.defineOption("foldGutter",!1,function(k,N,y){y&&y!=f.Init&&(k.clearGutter(k.state.foldGutter.options.gutter),k.state.foldGutter=null,k.off("gutterClick",U),k.off("changes",te),k.off("viewportChange",J),k.off("fold",re),k.off("unfold",re),k.off("swapDoc",te),k.off("optionChange",z)),N&&(k.state.foldGutter=new F(W(N)),R(k),k.on("gutterClick",U),k.on("changes",te),k.on("viewportChange",J),k.on("fold",re),k.on("unfold",re),k.on("swapDoc",te),k.on("optionChange",z))});var O=f.Pos;function F(k){this.options=k,this.from=this.to=0}function W(k){return k===!0&&(k={}),k.gutter==null&&(k.gutter="CodeMirror-foldgutter"),k.indicatorOpen==null&&(k.indicatorOpen="CodeMirror-foldgutter-open"),k.indicatorFolded==null&&(k.indicatorFolded="CodeMirror-foldgutter-folded"),k}function B(k,N){for(var y=k.findMarks(O(N,0),O(N+1,0)),v=0;v<y.length;++v)if(y[v].__isFold){var L=y[v].find(-1);if(L&&L.line===N)return y[v]}}function w(k){if(typeof k=="string"){var N=document.createElement("div");return N.className=k+" CodeMirror-guttermarker-subtle",N}else return k.cloneNode(!0)}function b(k,N,y){var v=k.state.foldGutter.options,L=N-1,P=k.foldOption(v,"minFoldSize"),K=k.foldOption(v,"rangeFinder"),Q=typeof v.indicatorFolded=="string"&&_(v.indicatorFolded),X=typeof v.indicatorOpen=="string"&&_(v.indicatorOpen);k.eachLine(N,y,function(ie){++L;var Ue=null,pe=ie.gutterMarkers;if(pe&&(pe=pe[v.gutter]),B(k,L)){if(Q&&pe&&Q.test(pe.className))return;Ue=w(v.indicatorFolded)}else{var xe=O(L,0),De=K&&K(k,xe);if(De&&De.to.line-De.from.line>=P){if(X&&pe&&X.test(pe.className))return;Ue=w(v.indicatorOpen)}}!Ue&&!pe||k.setGutterMarker(ie,v.gutter,Ue)})}function _(k){return new RegExp("(^|\\s)"+k+"(?:$|\\s)\\s*")}function R(k){var N=k.getViewport(),y=k.state.foldGutter;y&&(k.operation(function(){b(k,N.from,N.to)}),y.from=N.from,y.to=N.to)}function U(k,N,y){var v=k.state.foldGutter;if(v){var L=v.options;if(y==L.gutter){var P=B(k,N);P?P.clear():k.foldCode(O(N,0),L)}}}function z(k,N){N=="mode"&&te(k)}function te(k){var N=k.state.foldGutter;if(N){var y=N.options;N.from=N.to=0,clearTimeout(N.changeUpdate),N.changeUpdate=setTimeout(function(){R(k)},y.foldOnChangeTimeSpan||600)}}function J(k){var N=k.state.foldGutter;if(N){var y=N.options;clearTimeout(N.changeUpdate),N.changeUpdate=setTimeout(function(){var v=k.getViewport();N.from==N.to||v.from-N.to>20||N.from-v.to>20?R(k):k.operation(function(){v.from<N.from&&(b(k,v.from,N.from),N.from=v.from),v.to>N.to&&(b(k,N.to,v.to),N.to=v.to)})},y.updateViewportTimeSpan||400)}}function re(k,N){var y=k.state.foldGutter;if(y){var v=N.line;v>=y.from&&v<y.to&&b(k,v,v+1)}}})})();(function(h,T){(function(f){f(kt())})(function(f){function O(F){return function(W,B){var w=B.line,b=W.getLine(w);function _(re){for(var k,N=B.ch,y=0;;){var v=N<=0?-1:b.lastIndexOf(re[0],N-1);if(v==-1){if(y==1)break;y=1,N=b.length;continue}if(y==1&&v<B.ch)break;if(k=W.getTokenTypeAt(f.Pos(w,v+1)),!/^(comment|string)/.test(k))return{ch:v+1,tokenType:k,pair:re};N=v-1}}function R(re){var k=1,N=W.lastLine(),y,v=re.ch,L;e:for(var P=w;P<=N;++P)for(var K=W.getLine(P),Q=P==w?v:0;;){var X=K.indexOf(re.pair[0],Q),ie=K.indexOf(re.pair[1],Q);if(X<0&&(X=K.length),ie<0&&(ie=K.length),Q=Math.min(X,ie),Q==K.length)break;if(W.getTokenTypeAt(f.Pos(P,Q+1))==re.tokenType){if(Q==X)++k;else if(!--k){y=P,L=Q;break e}}++Q}return y==null||w==y?null:{from:f.Pos(w,v),to:f.Pos(y,L)}}for(var U=[],z=0;z<F.length;z++){var te=_(F[z]);te&&U.push(te)}U.sort(function(re,k){return re.ch-k.ch});for(var z=0;z<U.length;z++){var J=R(U[z]);if(J)return J}return null}}f.registerHelper("fold","brace",O([["{","}"],["[","]"]])),f.registerHelper("fold","brace-paren",O([["{","}"],["[","]"],["(",")"]])),f.registerHelper("fold","import",function(F,W){function B(z){if(z<F.firstLine()||z>F.lastLine())return null;var te=F.getTokenAt(f.Pos(z,1));if(/\S/.test(te.string)||(te=F.getTokenAt(f.Pos(z,te.end+1))),te.type!="keyword"||te.string!="import")return null;for(var J=z,re=Math.min(F.lastLine(),z+10);J<=re;++J){var k=F.getLine(J),N=k.indexOf(";");if(N!=-1)return{startCh:te.end,end:f.Pos(J,N)}}}var w=W.line,b=B(w),_;if(!b||B(w-1)||(_=B(w-2))&&_.end.line==w-1)return null;for(var R=b.end;;){var U=B(R.line+1);if(U==null)break;R=U.end}return{from:F.clipPos(f.Pos(w,b.startCh+1)),to:R}}),f.registerHelper("fold","include",function(F,W){function B(U){if(U<F.firstLine()||U>F.lastLine())return null;var z=F.getTokenAt(f.Pos(U,1));if(/\S/.test(z.string)||(z=F.getTokenAt(f.Pos(U,z.end+1))),z.type=="meta"&&z.string.slice(0,8)=="#include")return z.start+8}var w=W.line,b=B(w);if(b==null||B(w-1)!=null)return null;for(var _=w;;){var R=B(_+1);if(R==null)break;++_}return{from:f.Pos(w,b+1),to:F.clipPos(f.Pos(_))}})})})();(function(h,T){(function(f){f(kt())})(function(f){f.registerGlobalHelper("fold","comment",function(O){return O.blockCommentStart&&O.blockCommentEnd},function(O,F){var W=O.getModeAt(F),B=W.blockCommentStart,w=W.blockCommentEnd;if(!(!B||!w)){for(var b=F.line,_=O.getLine(b),R,U=F.ch,z=0;;){var te=U<=0?-1:_.lastIndexOf(B,U-1);if(te==-1){if(z==1)return;z=1,U=_.length;continue}if(z==1&&te<F.ch)return;if(/comment/.test(O.getTokenTypeAt(f.Pos(b,te+1)))&&(te==0||_.slice(te-w.length,te)==w||!/comment/.test(O.getTokenTypeAt(f.Pos(b,te))))){R=te+B.length;break}U=te-1}var J=1,re=O.lastLine(),k,N;e:for(var y=b;y<=re;++y)for(var v=O.getLine(y),L=y==b?R:0;;){var P=v.indexOf(B,L),K=v.indexOf(w,L);if(P<0&&(P=v.length),K<0&&(K=v.length),L=Math.min(P,K),L==v.length)break;if(L==P)++J;else if(!--J){k=y,N=L;break e}++L}if(!(k==null||b==k&&N==R))return{from:f.Pos(b,R),to:f.Pos(k,N)}}})})})();(function(h,T){(function(f){f(kt())})(function(f){f.registerHelper("fold","markdown",function(O,F){var W=100;function B(J){var re=O.getTokenTypeAt(f.Pos(J,0));return re&&/\bheader\b/.test(re)}function w(J,re,k){var N=re&&re.match(/^#+/);return N&&B(J)?N[0].length:(N=k&&k.match(/^[=\-]+\s*$/),N&&B(J+1)?k[0]=="="?1:2:W)}var b=O.getLine(F.line),_=O.getLine(F.line+1),R=w(F.line,b,_);if(R!==W){for(var U=O.lastLine(),z=F.line,te=O.getLine(z+2);z<U&&!(w(z+1,_,te)<=R);)++z,_=te,te=O.getLine(z+2);return{from:f.Pos(F.line,b.length),to:f.Pos(z,O.getLine(z).length)}}})})})();(function(h,T){(function(f){f(kt())})(function(f){var O=f.Pos;function F(y,v){return y.line-v.line||y.ch-v.ch}var W="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B=W+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",w=new RegExp("<(/?)(["+W+"]["+B+"]*)","g");function b(y,v,L,P){this.line=v,this.ch=L,this.cm=y,this.text=y.getLine(v),this.min=P?Math.max(P.from,y.firstLine()):y.firstLine(),this.max=P?Math.min(P.to-1,y.lastLine()):y.lastLine()}function _(y,v){var L=y.cm.getTokenTypeAt(O(y.line,v));return L&&/\btag\b/.test(L)}function R(y){if(!(y.line>=y.max))return y.ch=0,y.text=y.cm.getLine(++y.line),!0}function U(y){if(!(y.line<=y.min))return y.text=y.cm.getLine(--y.line),y.ch=y.text.length,!0}function z(y){for(;;){var v=y.text.indexOf(">",y.ch);if(v==-1){if(R(y))continue;return}if(!_(y,v+1)){y.ch=v+1;continue}var L=y.text.lastIndexOf("/",v),P=L>-1&&!/\S/.test(y.text.slice(L+1,v));return y.ch=v+1,P?"selfClose":"regular"}}function te(y){for(;;){var v=y.ch?y.text.lastIndexOf("<",y.ch-1):-1;if(v==-1){if(U(y))continue;return}if(!_(y,v+1)){y.ch=v;continue}w.lastIndex=v,y.ch=v;var L=w.exec(y.text);if(L&&L.index==v)return L}}function J(y){for(;;){w.lastIndex=y.ch;var v=w.exec(y.text);if(!v){if(R(y))continue;return}if(!_(y,v.index+1)){y.ch=v.index+1;continue}return y.ch=v.index+v[0].length,v}}function re(y){for(;;){var v=y.ch?y.text.lastIndexOf(">",y.ch-1):-1;if(v==-1){if(U(y))continue;return}if(!_(y,v+1)){y.ch=v;continue}var L=y.text.lastIndexOf("/",v),P=L>-1&&!/\S/.test(y.text.slice(L+1,v));return y.ch=v+1,P?"selfClose":"regular"}}function k(y,v){for(var L=[];;){var P=J(y),K,Q=y.line,X=y.ch-(P?P[0].length:0);if(!P||!(K=z(y)))return;if(K!="selfClose")if(P[1]){for(var ie=L.length-1;ie>=0;--ie)if(L[ie]==P[2]){L.length=ie;break}if(ie<0&&(!v||v==P[2]))return{tag:P[2],from:O(Q,X),to:O(y.line,y.ch)}}else L.push(P[2])}}function N(y,v){for(var L=[];;){var P=re(y);if(!P)return;if(P=="selfClose"){te(y);continue}var K=y.line,Q=y.ch,X=te(y);if(!X)return;if(X[1])L.push(X[2]);else{for(var ie=L.length-1;ie>=0;--ie)if(L[ie]==X[2]){L.length=ie;break}if(ie<0&&(!v||v==X[2]))return{tag:X[2],from:O(y.line,y.ch),to:O(K,Q)}}}}f.registerHelper("fold","xml",function(y,v){for(var L=new b(y,v.line,0);;){var P=J(L);if(!P||L.line!=v.line)return;var K=z(L);if(!K)return;if(!P[1]&&K!="selfClose"){var Q=O(L.line,L.ch),X=k(L,P[2]);return X&&F(X.from,Q)>0?{from:Q,to:X.from}:null}}}),f.findMatchingTag=function(y,v,L){var P=new b(y,v.line,v.ch,L);if(!(P.text.indexOf(">")==-1&&P.text.indexOf("<")==-1)){var K=z(P),Q=K&&O(P.line,P.ch),X=K&&te(P);if(!(!K||!X||F(P,v)>0)){var ie={from:O(P.line,P.ch),to:Q,tag:X[2]};return K=="selfClose"?{open:ie,close:null,at:"open"}:X[1]?{open:N(P,X[2]),close:ie,at:"close"}:(P=new b(y,Q.line,Q.ch,L),{open:ie,close:k(P,X[2]),at:"open"})}}},f.findEnclosingTag=function(y,v,L,P){for(var K=new b(y,v.line,v.ch,L);;){var Q=N(K,P);if(!Q)break;var X=new b(y,v.line,v.ch,L),ie=k(X,Q.tag);if(ie)return{open:Q,close:ie}}},f.scanForClosingTag=function(y,v,L,P){var K=new b(y,v.line,v.ch,P?{from:0,to:P}:null);return k(K,L)}})})();(function(h,T){(function(f){f(kt())})(function(f){function O(F,W){var B=F.getLine(W),w=B.search(/\S/);return w==-1||/\bcomment\b/.test(F.getTokenTypeAt(f.Pos(W,w+1)))?-1:f.countColumn(B,null,F.getOption("tabSize"))}f.registerHelper("fold","indent",function(F,W){var B=O(F,W.line);if(!(B<0)){for(var w=null,b=W.line+1,_=F.lastLine();b<=_;++b){var R=O(F,b);if(R!=-1)if(R>B)w=b;else break}if(w)return{from:f.Pos(W.line,F.getLine(W.line).length),to:f.Pos(w,F.getLine(w).length)}}})})})();const gf=Hn({__name:"CodeMirror",props:{mode:{type:String,default:dr.JSON,validator(h){return Object.values(dr).includes(h)}},value:{type:String,default:""},readonly:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},config:{type:Object,default:()=>{}}},emits:["change"],setup(h,{emit:T}){const f=h,O=T,F=Tl();let W;const B=Qu(_,100),w=$u();to(()=>f.value,U=>x(this,null,function*(){yield ml();const z=W==null?void 0:W.getValue();U!==z&&(W==null||W.setValue(U||""))}),{flush:"post"}),kl(()=>x(this,null,function*(){yield df(f.mode)(),W==null||W.setOption("mode",f.mode)})),to(()=>w.getDarkMode,()=>x(this,null,function*(){b()}),{immediate:!0});function b(){var U;(U=Al(W))==null||U.setOption("theme",w.getDarkMode==="light"?"idea":"material-palenight")}function _(){W==null||W.refresh()}function R(){return x(this,null,function*(){const U={autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-lint-markers","CodeMirror-linenumbers","CodeMirror-foldgutter"]};W=cf(F.value,Qi(Qi({value:"",mode:f.mode,readOnly:f.readonly,tabSize:2,theme:"material-palenight",lineWrapping:!0,lineNumbers:!0},U),f.config)),W==null||W.setValue(f.value),b(),W==null||W.on("change",()=>{O("change",W==null?void 0:W.getValue())})})}return nf(()=>x(this,null,function*(){yield ml(),R(),ff(B)})),of(()=>{W=null}),(U,z)=>(oo(),Pl("div",{class:af(["relative !h-full w-full overflow-hidden",{"ant-input":f.bordered,"css-dev-only-do-not-override-kqecok":f.bordered}]),ref_key:"el",ref:F},null,2))}}),yf={class:"h-full"},mf=Hn({__name:"CodeEditor",props:{value:{type:[Object,String]},mode:{type:String,default:dr.JSON,validator(h){return Object.values(dr).includes(h)}},readonly:{type:Boolean},autoFormat:{type:Boolean,default:!0},bordered:{type:Boolean,default:!1},config:{type:Object,default:()=>{}}},emits:["change","update:value","format-error"],setup(h,{emit:T}){const f=h,O=T,F=El(()=>{const{value:B,mode:w,autoFormat:b}=f;if(!b||w!==dr.JSON)return B;let _=B;if(rf(B))try{_=JSON.parse(B)}catch(R){return O("format-error",B),B}return JSON.stringify(_,null,2)});function W(B){O("update:value",B),O("change",B)}return(B,w)=>(oo(),Pl("div",yf,[Ol(gf,{value:F.value,onChange:W,mode:h.mode,readonly:h.readonly,bordered:h.bordered,config:h.config},null,8,["value","mode","readonly","bordered","config"])]))}});var Dn={d:(h,T)=>{for(var f in T)Dn.o(T,f)&&!Dn.o(h,f)&&Object.defineProperty(h,f,{enumerable:!0,get:T[f]})},o:(h,T)=>Object.prototype.hasOwnProperty.call(h,T)},Nl={};function ro(h,T){(T==null||T>h.length)&&(T=h.length);for(var f=0,O=new Array(T);f<T;f++)O[f]=h[f];return O}function Il(h,T){if(h){if(typeof h=="string")return ro(h,T);var f=Object.prototype.toString.call(h).slice(8,-1);return f==="Object"&&h.constructor&&(f=h.constructor.name),f==="Map"||f==="Set"?Array.from(h):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?ro(h,T):void 0}}function Rn(h){return function(T){if(Array.isArray(T))return ro(T)}(h)||function(T){if(typeof Symbol!="undefined"&&T[Symbol.iterator]!=null||T["@@iterator"]!=null)return Array.from(T)}(h)||Il(h)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
  25. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Fn(h,T,f){return T in h?Object.defineProperty(h,T,{value:f,enumerable:!0,configurable:!0,writable:!0}):h[T]=f,h}Dn.d(Nl,{Z:()=>Cf});const Z=(wl={computed:()=>El,createTextVNode:()=>lf,createVNode:()=>Ol,defineComponent:()=>Hn,reactive:()=>sf,ref:()=>Tl,watch:()=>to,watchEffect:()=>kl},eo={},Dn.d(eo,wl),eo),bf=(0,Z.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var h=this.data,T=this.onClick;return(0,Z.createVNode)("span",{class:"vjs-tree-brackets",onClick:T},[h])}}),wf=(0,Z.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(h,T){var f=T.emit;return{uiType:(0,Z.computed)(function(){return h.isMultiple?"checkbox":"radio"}),model:(0,Z.computed)({get:function(){return h.checked},set:function(O){return f("update:modelValue",O)}})}},render:function(){var h=this.uiType,T=this.model,f=this.$emit;return(0,Z.createVNode)("label",{class:["vjs-check-controller",T?"is-checked":""],onClick:function(O){return O.stopPropagation()}},[(0,Z.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(h)},null),(0,Z.createVNode)("input",{checked:T,class:"vjs-check-controller-original is-".concat(h),type:h,onChange:function(){return f("change",T)}},null)])}}),xf=(0,Z.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var h=this.nodeType,T=this.onClick,f=h==="objectStart"||h==="arrayStart";return f||h==="objectCollapsed"||h==="arrayCollapsed"?(0,Z.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(f?"open":"close"),onClick:T},[(0,Z.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,Z.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var wl,eo;function no(h){return no=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},no(h)}function Dl(h){return Object.prototype.toString.call(h).slice(8,-1).toLowerCase()}function Gt(h){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,O=arguments.length>3?arguments[3]:void 0,F=O||{},W=F.key,B=F.index,w=F.type,b=w===void 0?"content":w,_=F.showComma,R=_!==void 0&&_,U=F.length,z=U===void 0?1:U,te=Dl(h);if(te==="array"){var J=xl(h.map(function(N,y,v){return Gt(N,"".concat(T,"[").concat(y,"]"),f+1,{index:y,showComma:y!==v.length-1,length:z,type:b})}));return[Gt("[",T,f,{showComma:!1,key:W,length:h.length,type:"arrayStart"})[0]].concat(J,Gt("]",T,f,{showComma:R,length:h.length,type:"arrayEnd"})[0])}if(te==="object"){var re=Object.keys(h),k=xl(re.map(function(N,y,v){return Gt(h[N],/^[a-zA-Z_]\w*$/.test(N)?"".concat(T,".").concat(N):"".concat(T,'["').concat(N,'"]'),f+1,{key:N,showComma:y!==v.length-1,length:z,type:b})}));return[Gt("{",T,f,{showComma:!1,key:W,index:B,length:re.length,type:"objectStart"})[0]].concat(k,Gt("}",T,f,{showComma:R,length:re.length,type:"objectEnd"})[0])}return[{content:h,level:f,key:W,index:B,path:T,showComma:R,length:z,type:b}]}function xl(h){if(typeof Array.prototype.flat=="function")return h.flat();for(var T=Rn(h),f=[];T.length;){var O=T.shift();Array.isArray(O)?T.unshift.apply(T,Rn(O)):f.push(O)}return f}function io(h){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(h==null)return h;if(h instanceof Date)return new Date(h);if(h instanceof RegExp)return new RegExp(h);if(no(h)!=="object")return h;if(T.get(h))return T.get(h);if(Array.isArray(h)){var f=h.map(function(W){return io(W,T)});return T.set(h,f),f}var O={};for(var F in h)O[F]=io(h[F],T);return T.set(h,O),O}function Ll(h,T){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(h);T&&(O=O.filter(function(F){return Object.getOwnPropertyDescriptor(h,F).enumerable})),f.push.apply(f,O)}return f}function Cl(h){for(var T=1;T<arguments.length;T++){var f=arguments[T]!=null?arguments[T]:{};T%2?Ll(Object(f),!0).forEach(function(O){Fn(h,O,f[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):Ll(Object(f)).forEach(function(O){Object.defineProperty(h,O,Object.getOwnPropertyDescriptor(f,O))})}return h}var Rl={showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const Lf=(0,Z.defineComponent)({name:"TreeNode",props:Cl(Cl({},Rl),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(h,T){var f=T.emit,O=(0,Z.computed)(function(){return Dl(h.node.content)}),F=(0,Z.computed)(function(){return"vjs-value vjs-value-".concat(O.value)}),W=(0,Z.computed)(function(){return h.showDoubleQuotes?'"'.concat(h.node.key,'"'):h.node.key}),B=(0,Z.computed)(function(){return h.selectableType==="multiple"}),w=(0,Z.computed)(function(){return h.selectableType==="single"}),b=(0,Z.computed)(function(){return h.nodeSelectable(h.node)&&(B.value||w.value)}),_=(0,Z.reactive)({editing:!1}),R=function(y){var v,L,P=(L=(v=y.target)===null||v===void 0?void 0:v.value)==="null"?null:L==="undefined"?void 0:L==="true"||L!=="false"&&(L[0]+L[L.length-1]==='""'||L[0]+L[L.length-1]==="''"?L.slice(1,-1):typeof Number(L)=="number"&&!isNaN(Number(L))||L==="NaN"?Number(L):L);f("valueChange",P,h.node.path)},U=(0,Z.computed)(function(){var y,v=(y=h.node)===null||y===void 0?void 0:y.content;return v===null?v="null":v===void 0&&(v="undefined"),O.value==="string"?'"'.concat(v,'"'):v+""}),z=function(){var y=h.renderNodeValue;return y?y({node:h.node,defaultValue:U.value}):U.value},te=function(){f("bracketsClick",!h.collapsed,h.node)},J=function(){f("iconClick",!h.collapsed,h.node)},re=function(){f("selectedChange",h.node)},k=function(){f("nodeClick",h.node),b.value&&h.selectOnClickNode&&f("selectedChange",h.node)},N=function(y){if(h.editable&&!_.editing){_.editing=!0;var v=function L(P){var K;P.target!==y.target&&((K=P.target)===null||K===void 0?void 0:K.parentElement)!==y.target&&(_.editing=!1,document.removeEventListener("click",L))};document.removeEventListener("click",v),document.addEventListener("click",v)}};return function(){var y,v=h.node;return(0,Z.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":h.showSelectController,"has-carets":h.showIcon,"is-highlight":h.highlightSelectedNode&&h.checked,dark:h.theme==="dark"},onClick:k,style:h.style},[h.showLineNumber&&(0,Z.createVNode)("span",{class:"vjs-node-index"},[v.id+1]),h.showSelectController&&b.value&&v.type!=="objectEnd"&&v.type!=="arrayEnd"&&(0,Z.createVNode)(wf,{isMultiple:B.value,checked:h.checked,onChange:re},null),(0,Z.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(v.level)).map(function(L,P){return(0,Z.createVNode)("div",{key:P,class:{"vjs-indent-unit":!0,"has-line":h.showLine}},null)}),h.showIcon&&(0,Z.createVNode)(xf,{nodeType:v.type,onClick:J},null)]),v.key&&(0,Z.createVNode)("span",{class:"vjs-key"},[(y=h.renderNodeKey,y?y({node:h.node,defaultKey:W.value||""}):W.value),(0,Z.createVNode)("span",{class:"vjs-colon"},[":".concat(h.showKeyValueSpace?" ":"")])]),(0,Z.createVNode)("span",null,[v.type!=="content"&&v.content?(0,Z.createVNode)(bf,{data:v.content.toString(),onClick:te},null):(0,Z.createVNode)("span",{class:F.value,onClick:!h.editable||h.editableTrigger&&h.editableTrigger!=="click"?void 0:N,onDblclick:h.editable&&h.editableTrigger==="dblclick"?N:void 0},[h.editable&&_.editing?(0,Z.createVNode)("input",{value:U.value,onChange:R,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):z()]),v.showComma&&(0,Z.createVNode)("span",null,[","]),h.showLength&&h.collapsed&&(0,Z.createVNode)("span",{class:"vjs-comment"},[(0,Z.createTextVNode)(" // "),v.length,(0,Z.createTextVNode)(" items ")])])])}}});function Sl(h,T){var f=Object.keys(h);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(h);T&&(O=O.filter(function(F){return Object.getOwnPropertyDescriptor(h,F).enumerable})),f.push.apply(f,O)}return f}function Ye(h){for(var T=1;T<arguments.length;T++){var f=arguments[T]!=null?arguments[T]:{};T%2?Sl(Object(f),!0).forEach(function(O){Fn(h,O,f[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):Sl(Object(f)).forEach(function(O){Object.defineProperty(h,O,Object.getOwnPropertyDescriptor(f,O))})}return h}const Cf=(0,Z.defineComponent)({name:"Tree",props:Ye(Ye({},Rl),{},{data:{type:[String,Number,Boolean,Array,Object],default:null},collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},rootPath:{type:String,default:"root"},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue"],emits:["nodeClick","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(h,T){var f=T.emit,O=T.slots,F=(0,Z.ref)(),W=(0,Z.computed)(function(){return Gt(h.data,h.rootPath)}),B=function(v,L){return W.value.reduce(function(P,K){var Q,X=K.level>=v||K.length>=L,ie=(Q=h.pathCollapsible)===null||Q===void 0?void 0:Q.call(h,K);return K.type!=="objectStart"&&K.type!=="arrayStart"||!X&&!ie?P:Ye(Ye({},P),{},Fn({},K.path,1))},{})},w=(0,Z.reactive)({translateY:0,visibleData:null,hiddenPaths:B(h.deep,h.collapsedNodeLength)}),b=(0,Z.computed)(function(){for(var v=null,L=[],P=W.value.length,K=0;K<P;K++){var Q=Ye(Ye({},W.value[K]),{},{id:K}),X=w.hiddenPaths[Q.path];if(v&&v.path===Q.path){var ie=v.type==="objectStart",Ue=Ye(Ye(Ye({},Q),v),{},{showComma:Q.showComma,content:ie?"{...}":"[...]",type:ie?"objectCollapsed":"arrayCollapsed"});v=null,L.push(Ue)}else{if(X&&!v){v=Q;continue}if(v)continue;L.push(Q)}}return L}),_=(0,Z.computed)(function(){var v=h.selectedValue;return v&&h.selectableType==="multiple"&&Array.isArray(v)?v:[v]}),R=(0,Z.computed)(function(){return!h.selectableType||h.selectOnClickNode||h.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}),U=function(){var v=b.value;if(h.virtual){var L,P=h.height/h.itemHeight,K=((L=F.value)===null||L===void 0?void 0:L.scrollTop)||0,Q=Math.floor(K/h.itemHeight),X=Q<0?0:Q+P>v.length?v.length-P:Q;X<0&&(X=0);var ie=X+P;w.translateY=X*h.itemHeight,w.visibleData=v.filter(function(Ue,pe){return pe>=X&&pe<ie})}else w.visibleData=v},z=function(){U()},te=function(v){var L,P,K=v.path,Q=h.selectableType;if(Q==="multiple"){var X=_.value.findIndex(function(xe){return xe===K}),ie=Rn(_.value);X!==-1?ie.splice(X,1):ie.push(K),f("update:selectedValue",ie),f("selectedChange",ie,Rn(_.value))}else if(Q==="single"&&_.value[0]!==K){var Ue=(L=_.value,P=1,function(xe){if(Array.isArray(xe))return xe}(L)||function(xe,De){var be=xe==null?null:typeof Symbol!="undefined"&&xe[Symbol.iterator]||xe["@@iterator"];if(be!=null){var j,st,Je=[],Xe=!0,Re=!1;try{for(be=be.call(xe);!(Xe=(j=be.next()).done)&&(Je.push(j.value),!De||Je.length!==De);Xe=!0);}catch(ut){Re=!0,st=ut}finally{try{Xe||be.return==null||be.return()}finally{if(Re)throw st}}return Je}}(L,P)||Il(L,P)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
  26. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],pe=K;f("update:selectedValue",pe),f("selectedChange",pe,Ue)}},J=function(v){f("nodeClick",v)},re=function(v,L){if(v)w.hiddenPaths=Ye(Ye({},w.hiddenPaths),{},Fn({},L,1));else{var P=Ye({},w.hiddenPaths);delete P[L],w.hiddenPaths=P}},k=function(v,L){h.collapsedOnClickBrackets&&re(v,L.path),f("bracketsClick",v,L)},N=function(v,L){re(v,L.path),f("iconClick",v,L)},y=function(v,L){var P=io(h.data),K=h.rootPath;new Function("data","val","data".concat(L.slice(K.length),"=val"))(P,v),f("update:data",P)};return(0,Z.watchEffect)(function(){R.value&&function(v){throw new Error("[VueJSONPretty] ".concat(v))}(R.value)}),(0,Z.watchEffect)(function(){b.value&&U()}),(0,Z.watch)(function(){return h.deep},function(v){v&&(w.hiddenPaths=B(v,h.collapsedNodeLength))}),(0,Z.watch)(function(){return h.collapsedNodeLength},function(v){v&&(w.hiddenPaths=B(h.deep,v))}),function(){var v,L,P=(v=h.renderNodeKey)!==null&&v!==void 0?v:O.renderNodeKey,K=(L=h.renderNodeValue)!==null&&L!==void 0?L:O.renderNodeValue,Q=w.visibleData&&w.visibleData.map(function(X){return(0,Z.createVNode)(Lf,{key:X.id,node:X,collapsed:!!w.hiddenPaths[X.path],theme:h.theme,showDoubleQuotes:h.showDoubleQuotes,showLength:h.showLength,checked:_.value.includes(X.path),selectableType:h.selectableType,showLine:h.showLine,showLineNumber:h.showLineNumber,showSelectController:h.showSelectController,selectOnClickNode:h.selectOnClickNode,nodeSelectable:h.nodeSelectable,highlightSelectedNode:h.highlightSelectedNode,editable:h.editable,editableTrigger:h.editableTrigger,showIcon:h.showIcon,showKeyValueSpace:h.showKeyValueSpace,renderNodeKey:P,renderNodeValue:K,onNodeClick:J,onBracketsClick:k,onIconClick:N,onSelectedChange:te,onValueChange:y,style:h.itemHeight&&h.itemHeight!==20?{lineHeight:"".concat(h.itemHeight,"px")}:{}},null)});return(0,Z.createVNode)("div",{ref:F,class:{"vjs-tree":!0,"is-virtual":h.virtual,dark:h.theme==="dark"},onScroll:h.virtual?z:void 0,style:h.showLineNumber?Ye({paddingLeft:"".concat(12*Number(W.value.length.toString().length),"px")},h.style):h.style},[h.virtual?(0,Z.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(h.height,"px")}},[(0,Z.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(b.value.length*h.itemHeight,"px")}},[(0,Z.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(w.translateY,"px)")}},[Q])])]):Q])}}});var Sf=Nl.Z;const _f=Hn({__name:"JsonPreview",props:{data:Object},setup(h){return(T,f)=>(oo(),uf(Al(Sf),{path:"res",deep:3,showLength:!0,data:h.data},null,8,["data"]))}}),Of=_l(mf),Nf=_l(_f);export{Of as C,Nf as J,dr as M,kt as r};