PageSourceSearch

https://custom-sports-wear.com/1031.11f85bb8.async.js

js custom-sports-wear.com collected 2026-10-07 14:12:24 UTC 195,999 bytes, 24 lines download raw bytes

1(self.webpackChunksurvey_king=self.webpackChunksurvey_king||[]).push([[1031],{50596:function(){},27279:function(or,ue,K){"use strict";K.d(ue,{Z:function(){return Zt}});var Y=K(22122),A=K(96156),ae=K(8812),Re=K(94184),F=K.n(Re),R=K(85061),J=K(6610),E=K(5991),re=K(10379),ve=K(44144),De=K(90484),N=K(67294),S=K(96774),c=K.n(S),m=K(50344),T=K(5461),w=K(28481),j=N.forwardRef(function(ce,V){var q,_=ce.prefixCls,I=ce.forceRender,Q=ce.className,G=ce.style,Z=ce.children,W=ce.isActive,$=ce.role,te=N.useState(W||I),oe=(0,w.Z)(te,2),ze=oe[0],xe=oe[1];return N.useEffect(function(){(I||W)&&xe(!0)},[I,W]),ze?N.createElement("div",{ref:V,className:F()("".concat(_,"-content"),(q={},(0,A.Z)(q,"".concat(_,"-content-active"),W),(0,A.Z)(q,"".concat(_,"-content-inactive"),!W),q),Q),style:G,role:$},N.createElement("div",{className:"".concat(_,"-content-box")},Z)):null});j.displayName="PanelContent";var fe=j,lr=function(ce){(0,re.Z)(q,ce);var V=(0,ve.Z)(q);function q(){var _;(0,J.Z)(this,q);for(var I=arguments.length,Q=new Array(I),G=0;G<I;G++)Q[G]=arguments[G];return _=V.call.apply(V,[this].concat(Q)),_.onItemClick=function(){var Z=_.props,W=Z.onItemClick,$=Z.panelKey;typeof W=="function"&&W($)},_.handleKeyPress=function(Z){(Z.key==="Enter"||Z.keyCode===13||Z.which===13)&&_.onItemClick()},_.renderIcon=function(){var Z=_.props,W=Z.showArrow,$=Z.expandIcon,te=Z.prefixCls,oe=Z.collapsible;if(!W)return null;var ze=typeof $=="function"?$(_.props):N.createElement("i",{className:"arrow"});return ze&&N.createElement("div",{className:"".concat(te,"-expand-icon"),onClick:oe==="header"?_.onItemClick:null},ze)},_.renderTitle=function(){var Z=_.props,W=Z.header,$=Z.prefixCls,te=Z.collapsible;return N.createElement("span",{className:"".concat($,"-header-text"),onClick:te==="header"?_.onItemClick:null},W)},_}return(0,E.Z)(q,[{key:"shouldComponentUpdate",value:function(I){return!c()(this.props,I)}},{key:"render",value:function(){var I,Q,G=this.props,Z=G.className,W=G.id,$=G.style,te=G.prefixCls,oe=G.headerClass,ze=G.children,xe=G.isActive,Ee=G.destroyInactivePanel,nt=G.accordion,pt=G.forceRender,X=G.openMotion,He=G.extra,ot=G.collapsible,vt=ot==="disabled",et=ot==="header",Ae=F()((I={},(0,A.Z)(I,"".concat(te,"-item"),!0),(0,A.Z)(I,"".concat(te,"-item-active"),xe),(0,A.Z)(I,"".concat(te,"-item-disabled"),vt),I),Z),Qe=F()("".concat(te,"-header"),(Q={},(0,A.Z)(Q,oe,oe),(0,A.Z)(Q,"".concat(te,"-header-collapsible-only"),et),Q)),Oe={className:Qe,"aria-expanded":xe,"aria-disabled":vt,onKeyPress:this.handleKeyPress};et||(Oe.onClick=this.onItemClick,Oe.role=nt?"tab":"button",Oe.tabIndex=vt?-1:0);var Lt=He!=null&&typeof He!="boolean";return N.createElement("div",{className:Ae,style:$,id:W},N.createElement("div",Oe,this.renderIcon(),this.renderTitle(),Lt&&N.createElement("div",{className:"".concat(te,"-extra")},He)),N.createElement(T.default,(0,Y.Z)({visible:xe,leavedClassName:"".concat(te,"-content-hidden")},X,{forceRender:pt,removeOnLeave:Ee}),function(tt,gt){var Et=tt.className,kt=tt.style;return N.createElement(fe,{ref:gt,prefixCls:te,className:Et,style:kt,isActive:xe,forceRender:pt,role:nt?"tabpanel":null},ze)}))}}]),q}(N.Component);lr.defaultProps={showArrow:!0,isActive:!1,onItemClick:function(){},headerClass:"",forceRender:!1};var it=lr;function Ye(ce){var V=ce;if(!Array.isArray(V)){var q=(0,De.Z)(V);V=q==="number"||q==="string"?[V]:[]}return V.map(function(_){return String(_)})}var _t=function(ce){(0,re.Z)(q,ce);var V=(0,ve.Z)(q);function q(_){var I;(0,J.Z)(this,q),I=V.call(this,_),I.onClickItem=function(W){var $=I.state.activeKey;if(I.props.accordion)$=$[0]===W?[]:[W];else{$=(0,R.Z)($);var te=$.indexOf(W),oe=te>-1;oe?$.splice(te,1):$.push(W)}I.setActiveKey($)},I.getNewChild=function(W,$){if(!W)return null;var te=I.state.activeKey,oe=I.props,ze=oe.prefixCls,xe=oe.openMotion,Ee=oe.accordion,nt=oe.destroyInactivePanel,pt=oe.expandIcon,X=oe.collapsible,He=W.key||String($),ot=W.props,vt=ot.header,et=ot.headerClass,Ae=ot.destroyInactivePanel,Qe=ot.collapsible,Oe=!1;Ee?Oe=te[0]===He:Oe=te.indexOf(He)>-1;var Lt=Qe!=null?Qe:X,tt={key:He,panelKey:He,header:vt,headerClass:et,isActive:Oe,prefixCls:ze,destroyInactivePanel:Ae!=null?Ae:nt,openMotion:xe,accordion:Ee,children:W.props.children,onItemClick:Lt==="disabled"?null:I.onClickItem,expandIcon:pt,collapsible:Lt};return typeof W.type=="string"?W:(Object.keys(tt).forEach(function(gt){typeof tt[gt]=="undefined"&&delete tt[gt]}),N.cloneElement(W,tt))},I.getItems=function(){var W=I.props.children;return(0,m.Z)(W).map(I.getNewChild)},I.setActiveKey=function(W){"activeKey"in I.props||I.setState({activeKey:W}),I.props.onChange(I.props.accordion?W[0]:W)};var Q=_.activeKey,G=_.defaultActiveKey,Z=G;return"activeKey"in _&&(Z=Q),I.state={activeKey:Ye(Z)},I}return(0,E.Z)(q,[{key:"shouldComponentUpdate",value:function(I,Q){return!c()(this.props,I)||!c()(this.state,Q)}},{key:"render",value:function(){var I,Q=this.props,G=Q.prefixCls,Z=Q.className,W=Q.style,$=Q.accordion,te=F()((I={},(0,A.Z)(I,G,!0),(0,A.Z)(I,Z,!!Z),I));return N.createElement("div",{className:te,style:W,role:$?"tablist":null},this.getItems())}}],[{key:"getDerivedStateFromProps",value:function(I){var Q={};return"activeKey"in I&&(Q.activeKey=Ye(I.activeKey)),Q}}]),q}(N.Component);_t.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},_t.Panel=it;var wt=_t,ft=wt,St=wt.Panel,Be=K(98423),O=K(53124),Pt=K(33603),ht=K(96159),ct=function(V){var q=N.useContext(O.E_),_=q.getPrefixCls,I=V.prefixCls,Q=V.className,G=Q===void 0?"":Q,Z=V.showArrow,W=Z===void 0?!0:Z,$=_("collapse",I),te=F()((0,A.Z)({},"".concat($,"-no-arrow"),!W),G);return N.createElement(ft.Panel,(0,Y.Z)({},V,{prefixCls:$,className:te}))},qe=ct,dt=function(V){var q,_=N.useContext(O.E_),I=_.getPrefixCls,Q=_.direction,G=V.prefixCls,Z=V.className,W=Z===void 0?"":Z,$=V.bordered,te=$===void 0?!0:$,oe=V.ghost,ze=V.expandIconPosition,xe=ze===void 0?"start":ze,Ee=I("collapse",G),nt=N.useMemo(function(){return xe==="left"?"start":xe==="right"?"end":xe},[xe]),pt=function(){var et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=V.expandIcon,Qe=Ae?Ae(et):N.createElement(ae.Z,{rotate:et.isActive?90:void 0});return(0,ht.Tm)(Qe,function(){return{className:F()(Qe.props.className,"".concat(Ee,"-arrow"))}})},X=F()("".concat(Ee,"-icon-position-").concat(nt),(q={},(0,A.Z)(q,"".concat(Ee,"-borderless"),!te),(0,A.Z)(q,"".concat(Ee,"-rtl"),Q==="rtl"),(0,A.Z)(q,"".concat(Ee,"-ghost"),!!oe),q),W),He=(0,Y.Z)((0,Y.Z)({},Pt.ZP),{motionAppear:!1,leavedClassName:"".concat(Ee,"-content-hidden")}),ot=function(){var et=V.children;return(0,m.Z)(et).map(function(Ae,Qe){var Oe;if((Oe=Ae.props)===null||Oe===void 0?void 0:Oe.disabled){var Lt=Ae.key||String(Qe),tt=Ae.props,gt=tt.disabled,Et=tt.collapsible,kt=(0,Y.Z)((0,Y.Z)({},(0,Be.Z)(Ae.props,["disabled"])),{key:Lt,collapsible:Et!=null?Et:gt?"disabled":void 0});return(0,ht.Tm)(Ae,kt)}return Ae})};
1return N.createElement(ft,(0,Y.Z)({openMotion:He},V,{expandIcon:pt,prefixCls:Ee,className:X}),ot())};dt.Panel=qe;var Nr=dt,Zt=Nr},7359:function(or,ue,K){"use strict";var Y=K(38663),A=K.n(Y),ae=K(50596),Re=K.n(ae)},88386:function(or,ue,K){(function(Y){Y(K(4631))})(function(Y){Y.defineOption("placeholder","",function(E,re,ve){var De=ve&&ve!=Y.Init;if(re&&!De)E.on("blur",F),E.on("change",R),E.on("swapDoc",R),Y.on(E.getInputField(),"compositionupdate",E.state.placeholderCompose=function(){Re(E)}),R(E);else if(!re&&De){E.off("blur",F),E.off("change",R),E.off("swapDoc",R),Y.off(E.getInputField(),"compositionupdate",E.state.placeholderCompose),A(E);var N=E.getWrapperElement();N.className=N.className.replace(" CodeMirror-empty","")}re&&!E.hasFocus()&&F(E)});function A(E){E.state.placeholder&&(E.state.placeholder.parentNode.removeChild(E.state.placeholder),E.state.placeholder=null)}function ae(E){A(E);var re=E.state.placeholder=document.createElement("pre");re.style.cssText="height: 0; overflow: visible",re.style.direction=E.getOption("direction"),re.className="CodeMirror-placeholder CodeMirror-line-like";var ve=E.getOption("placeholder");typeof ve=="string"&&(ve=document.createTextNode(ve)),re.appendChild(ve),E.display.lineSpace.insertBefore(re,E.display.lineSpace.firstChild)}function Re(E){setTimeout(function(){var re=!1;if(E.lineCount()==1){var ve=E.getInputField();re=ve.nodeName=="TEXTAREA"?!E.getLine(0).length:!/[^\u200b]/.test(ve.querySelector(".CodeMirror-line").textContent)}re?ae(E):A(E)},20)}function F(E){J(E)&&ae(E)}function R(E){var re=E.getWrapperElement(),ve=J(E);re.className=re.className.replace(" CodeMirror-empty","")+(ve?" CodeMirror-empty":""),ve?ae(E):A(E)}function J(E){return E.lineCount()===1&&E.getLine(0)===""}})},4631:function(or){(function(ue,K){or.exports=K()})(this,function(){"use strict";var ue=navigator.userAgent,K=navigator.platform,Y=/gecko\/\d/i.test(ue),A=/MSIE \d/.test(ue),ae=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ue),Re=/Edge\/(\d+)/.exec(ue),F=A||ae||Re,R=F&&(A?document.documentMode||6:+(Re||ae)[1]),J=!Re&&/WebKit\//.test(ue),E=J&&/Qt\/\d+\.\d+/.test(ue),re=!Re&&/Chrome\/(\d+)/.exec(ue),ve=re&&+re[1],De=/Opera\//.test(ue),N=/Apple Computer/.test(navigator.vendor),S=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ue),c=/PhantomJS/.test(ue),m=N&&(/Mobile\/\w+/.test(ue)||navigator.maxTouchPoints>2),T=/Android/.test(ue),w=m||T||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ue),j=m||/Mac/.test(K),fe=/\bCrOS\b/.test(ue),lr=/win/i.test(K),it=De&&ue.match(/Version\/(\d*\.\d*)/);it&&(it=Number(it[1])),it&&it>=15&&(De=!1,J=!0);var Ye=j&&(E||De&&(it==null||it<12.11)),_t=Y||F&&R>=9;function wt(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ft=function(e,t){var i=e.className,r=wt(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function St(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Be(e,t){return St(e).appendChild(t)}function O(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function Pt(e,t,i,r){var n=O(e,t,i,r);return n.setAttribute("role","presentation"),n}var ht;document.createRange?ht=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:ht=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(n){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function ct(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 qe(e){var t=e.ownerDocument||e,i;try{i=e.activeElement}catch(r){i=t.body||null}for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;return i}function dt(e,t){var i=e.className;wt(t).test(i)||(e.className+=(i?" ":"")+t)}function Nr(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!wt(i[r]).test(t)&&(t+=" "+i[r]);return t}var Zt=function(e){e.select()};m?Zt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:F&&(Zt=function(e){try{e.select()}catch(t){}});function ce(e){return e.display.wrapper.ownerDocument}
vendor: 117,699 bytes, lines 1-11
1function V(e){return q(e.display.wrapper)}function q(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function _(e){return ce(e).defaultView}function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Q(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function G(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=n||0;;){var a=e.indexOf("	",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=i-l%i,o=a+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function W(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var $=50,te={toString:function(){return"CodeMirror.Pass"}},oe={scroll:!1},ze={origin:"*mouse"},xe={origin:"+move"};function Ee(e,t,i){for(var r=0,n=0;;){var o=e.indexOf("	",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||n+l>=t)return r+Math.min(l,t-n);if(n+=o-r,n+=i-n%i,r=o+1,n>=t)return r}}var nt=[""];function pt(e){for(;nt.length<=e;)nt.push(X(nt)+" ");return nt[e]}function X(e){return e[e.length-1]}function He(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function ot(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function vt(){}function et(e,t){var i;return Object.create?i=Object.create(e):(vt.prototype=e,i=new vt),t&&Q(t,i),i}var Ae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Qe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ae.test(e))}function Oe(e,t){return t?t.source.indexOf("\\w")>-1&&Qe(e)?!0:t.test(e):Qe(e)}function Lt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var tt=/[\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 gt(e){return e.charCodeAt(0)>=768&&tt.test(e)}function Et(e,t,i){for(;(i<0?t>0:t<e.length)&&gt(e.charAt(t));)t+=i;return t}function kt(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,o=r<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:i;e(o)?i=o:t=o+r}}function $l(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,o=0;o<e.length;++o){var l=e[o];(l.from<i&&l.to>t||t==i&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",o),n=!0)}n||r(t,i,"ltr")}var Ar=null;function Or(e,t,i){var r;Ar=null;for(var n=0;n<e.length;++n){var o=e[n];if(o.from<t&&o.to>t)return n;o.to==t&&(o.from!=o.to&&i=="before"?r=n:Ar=n),o.from==t&&(o.from!=o.to&&i!="before"?r=n:Ar=n)}return r!=null?r:Ar}var ea=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(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]/,n=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,f,h){this.level=u,this.from=f,this.to=h}return function(u,f){var h=f=="ltr"?"L":"R";if(u.length==0||f=="ltr"&&!r.test(u))return!1;for(var p=u.length,d=[],v=0;v<p;++v)d.push(i(u.charCodeAt(v)));for(var g=0,C=h;g<p;++g){var b=d[g];b=="m"?d[g]=C:C=b}for(var L=0,x=h;L<p;++L){var k=d[L];k=="1"&&x=="r"?d[L]="n":o.test(k)&&(x=k,k=="r"&&(d[L]="R"))}for(var P=1,D=d[0];P<p-1;++P){var U=d[P];U=="+"&&D=="1"&&d[P+1]=="1"?d[P]="1":U==","&&D==d[P+1]&&(D=="1"||D=="n")&&(d[P]=D),D=U}for(var le=0;le<p;++le){var Te=d[le];if(Te==",")d[le]="N";else if(Te=="%"){var he=void 0;for(he=le+1;he<p&&d[he]=="%";++he);for(var je=le&&d[le-1]=="!"||he<p&&d[he]=="1"?"1":"N",_e=le;_e<he;++_e)d[_e]=je;le=he-1}}for(var me=0,Ze=h;me<p;++me){var Ne=d[me];Ze=="L"&&Ne=="1"?d[me]="L":o.test(Ne)&&(Ze=Ne)}for(var be=0;be<p;++be)if(n.test(d[be])){var Ce=void 0;for(Ce=be+1;Ce<p&&n.test(d[Ce]);++Ce);for(var de=(be?d[be-1]:h)=="L",Xe=(Ce<p?d[Ce]:h)=="L",Mr=de==Xe?de?"L":"R":h,Gt=be;Gt<Ce;++Gt)d[Gt]=Mr;be=Ce-1}for(var Pe=[],xt,Me=0;Me<p;)if(l.test(d[Me])){var Xn=Me;for(++Me;Me<p&&l.test(d[Me]);++Me);Pe.push(new s(0,Xn,Me))}else{var Wt=Me,ir=Pe.length,nr=f=="rtl"?1:0;for(++Me;Me<p&&d[Me]!="L";++Me);for(var Fe=Wt;Fe<Me;)if(a.test(d[Fe])){Wt<Fe&&(Pe.splice(ir,0,new s(1,Wt,Fe)),ir+=nr);var Dr=Fe;for(++Fe;Fe<Me&&a.test(d[Fe]);++Fe);Pe.splice(ir,0,new s(2,Dr,Fe)),ir+=nr,Wt=Fe}else++Fe;Wt<Me&&Pe.splice(ir,0,new s(1,Wt,Me))}return f=="ltr"&&(Pe[0].level==1&&(xt=u.match(/^\s+/))&&(Pe[0].from=xt[0].length,Pe.unshift(new s(0,0,xt[0].length))),X(Pe).level==1&&(xt=u.match(/\s+$/))&&(X(Pe).to-=xt[0].length,Pe.push(new s(0,p-xt[0].length,p)))),f=="rtl"?Pe.reverse():Pe}}();function Tt(e,t){var i=e.order;return i==null&&(i=e.order=ea(e.text,t)),i}var qn=[],H=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||qn).concat(i)}};function zi(e,t){return e._handlers&&e._handlers[t]||qn}function Ve(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var o=W(n,i);o>-1&&(r[t]=n.slice(0,o).concat(n.slice(o+1)))}}}function ge(e,t){var i=zi(e,t);if(!!i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function we(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ge(e,i||t.type,e,t),Ui(t)||t.codemirrorIgnore}function Qn(e){var t=e._handlers&&e._handlers.cursorActivity;if(!!t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)W(i,t[r])==-1&&i.push(t[r])}function rt(e,t){return zi(e,t).length>0}function ar(e){e.prototype.on=function(t,i){H(this,t,i)},e.prototype.off=function(t,i){Ve(this,t,i)}}function Ue(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Jn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ui(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Wr(e){Ue(e),Jn(e)}function Ki(e){return e.target||e.srcElement}function jn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),j&&e.ctrlKey&&t==1&&(t=3),t}var ta=function(){if(F&&R<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}(),Gi;function ra(e){if(Gi==null){var t=O("span","\u200B");Be(e,O("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Gi=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&R<8))}var i=Gi?O("span","\u200B"):O("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var _i;function ia(e){if(_i!=null)return _i;var t=Be(e,document.createTextNode("A\u062EA")),i=ht(t,0,1).getBoundingClientRect(),r=ht(t,1,2).getBoundingClientRect();return St(e),!i||i.left==i.right?!1:_i=r.right-i.right<3}var Zi=`
2
3b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
4`,t);n==-1&&(n=e.length);var o=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),l=o.indexOf("\r");l!=-1?(i.push(o.slice(0,l)),t+=l+1):(i.push(o),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},na=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},oa=function(){var e=O("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Xi=null;function la(e){if(Xi!=null)return Xi;var t=Be(e,O("span","x")),i=t.getBoundingClientRect(),r=ht(t,0,1).getBoundingClientRect();return Xi=Math.abs(i.left-r.left)>1}var Yi={},sr={};function aa(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Yi[e]=t}function sa(e,t){sr[e]=t}function ai(e){if(typeof e=="string"&&sr.hasOwnProperty(e))e=sr[e];else if(e&&typeof e.name=="string"&&sr.hasOwnProperty(e.name)){var t=sr[e.name];typeof t=="string"&&(t={name:t}),e=et(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ai("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ai("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function qi(e,t){t=ai(t);var i=Yi[t.name];if(!i)return qi(e,"text/plain");var r=i(e,t);if(ur.hasOwnProperty(t.name)){var n=ur[t.name];for(var o in n)!n.hasOwnProperty(o)||(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=n[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var ur={};function ua(e,t){var i=ur.hasOwnProperty(e)?ur[e]:ur[e]={};Q(t,i)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Qi(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Vn(e,t,i){return e.startState?e.startState(t,i):!0}var ye=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};ye.prototype.eol=function(){return this.pos>=this.string.length},ye.prototype.sol=function(){return this.pos==this.lineStart},ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ye.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ye.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},ye.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ye.prototype.skipToEnd=function(){this.pos=this.string.length},ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ye.prototype.backUp=function(e){this.pos-=e},ye.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},ye.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},ye.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(l){return i?l.toLowerCase():l},n=this.string.substr(this.pos,e.length);if(r(n)==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)}},ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function M(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],o=n.chunkSize();if(t<o){i=n;break}t-=o}return i.lines[t]}function Yt(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(o){var l=o.text;n==i.line&&(l=l.slice(0,i.ch)),n==t.line&&(l=l.slice(t.ch)),r.push(l),++n}),r}function Ji(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function yt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function ie(e){if(e.parent==null)return null;for(var t=e.parent,i=W(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function qt(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],o=n.height;if(t<o){e=n;continue e}t-=o,i+=n.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return i+l}function Pr(e,t){return t>=e.first&&t<e.first+e.size}function ji(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function y(e,t,i){if(i===void 0&&(i=null),!(this instanceof y))return new y(e,t,i);this.line=e,this.ch=t,this.sticky=i}function B(e,t){return e.line-t.line||e.ch-t.ch}function Vi(e,t){return e.sticky==t.sticky&&B(e,t)==0}function $i(e){return y(e.line,e.ch)}function si(e,t){return B(e,t)<0?t:e}function ui(e,t){return B(e,t)<0?e:t}function $n(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function z(e,t){if(t.line<e.first)return y(e.first,0);var i=e.first+e.size-1;return t.line>i?y(i,M(e,i).text.length):fa(t,M(e,t.line).text.length)}function fa(e,t){var i=e.ch;return i==null||i>t?y(e.line,t):i<0?y(e.line,0):e}function eo(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=z(e,t[r]);return i}var fi=function(e,t){this.state=e,this.lookAhead=t},mt=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.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}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,i){return t instanceof fi?new mt(e,Xt(e.mode,t.state),i,t.lookAhead):new mt(e,Xt(e.mode,t),i)},mt.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fi(t,this.maxLookAhead):t};function to(e,t,i,r){var n=[e.state.modeGen],o={};ao(e,t.text,e.doc.mode,i,function(u,f){return n.push(u,f)},o,r);for(var l=i.state,a=function(u){i.baseTokens=n;var f=e.state.overlays[u],h=1,p=0;i.state=!0,ao(e,t.text,f.mode,i,function(d,v){for(var g=h;p<d;){var C=n[h];C>d&&n.splice(h,1,d,n[h+1],C),h+=2,p=Math.min(d,C)}if(!!v)if(f.opaque)n.splice(g,h-g,d,"overlay "+v),h=g+2;else for(;g<h;g+=2){var b=n[g+1];n[g+1]=(b?b+" ":"")+"overlay "+v}},o),i.state=l,i.baseTokens=null,i.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function ro(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Er(e,ie(t)),n=t.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,r.state),o=to(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Er(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=ha(e,t,i),l=o>r.first&&M(r,o-1).stateAfter,a=l?mt.fromSaved(r,l,o):new mt(r,Vn(r.mode),o);return r.iter(o,t,function(s){en(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=n.viewFrom&&u<n.viewTo?a.save():null,a.nextLine()}),i&&(r.modeFrontier=a.line),a}function en(e,t,i,r){var n=e.doc.mode,o=new ye(t,e.options.tabSize,i);for(o.start=o.pos=r||0,t==""&&io(n,i.state);!o.eol();)tn(n,o,i.state),o.start=o.pos}function io(e,t){if(e.blankLine)return e.blankLine(t);if(!!e.innerMode){var i=Qi(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function tn(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Qi(e,i).mode);var o=e.token(t,i);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var no=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function oo(e,t,i,r){var n=e.doc,o=n.mode,l;t=z(n,t);var a=M(n,t.line),s=Er(e,t.line,i),u=new ye(a.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=tn(o,u,s.state),r&&f.push(new no(u,l,Xt(n.mode,s.state)));return r?f:new no(u,l,s.state)}function lo(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function ao(e,t,i,r,n,o,l){var a=i.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,f=new ye(t,e.options.tabSize,r),h,p=e.options.addModeClass&&[null];for(t==""&&lo(io(i,r.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&en(e,t,r,f.pos),f.pos=t.length,h=null):h=lo(tn(i,f,r.state,p),o),p){var d=p[0].name;d&&(h="m-"+(h?d+" "+h:d))}if(!a||u!=h){for(;s<f.start;)s=Math.min(f.start,s+5e3),n(s,u);u=h}f.start=f.pos}for(;s<f.pos;){var v=Math.min(f.pos,s+5e3);n(v,u),s=v}}function ha(e,t,i){for(var r,n,o=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=M(o,a-1),u=s.stateAfter;if(u&&(!i||a+(u instanceof fi?u.lookAhead:0)<=o.modeFrontier))return a;var f=G(s.text,null,e.options.tabSize);(n==null||r>f)&&(n=a-1,r=f)}return n}function ca(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var n=M(e,r).stateAfter;if(n&&(!(n instanceof fi)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}var so=!1,Mt=!1;function da(){so=!0}function pa(){Mt=!0}function hi(e,t,i){this.marker=e,this.from=t,this.to=i}function Hr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function va(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function ga(e,t,i){var r=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function ya(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var o=e[n],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!i||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new hi(l,o.from,s?null:o.to))}}return r}function ma(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var o=e[n],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!i||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new hi(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function rn(e,t){if(t.full)return null;var i=Pr(e,t.from.line)&&M(e,t.from.line).markedSpans,r=Pr(e,t.to.line)&&M(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,o=t.to.ch,l=B(t.from,t.to)==0,a=ya(i,n,l),s=ma(r,o,l),u=t.text.length==1,f=X(t.text).length+(u?n:0);if(a)for(var h=0;h<a.length;++h){var p=a[h];if(p.to==null){var d=Hr(s,p.marker);d?u&&(p.to=d.to==null?null:d.to+f):p.to=n}}if(s)for(var v=0;v<s.length;++v){var g=s[v];if(g.to!=null&&(g.to+=f),g.from==null){var C=Hr(a,g.marker);C||(g.from=f,u&&(a||(a=[])).push(g))}else g.from+=f,u&&(a||(a=[])).push(g)}a&&(a=uo(a)),s&&s!=a&&(s=uo(s));var b=[a];if(!u){var L=t.text.length-2,x;if(L>0&&a)for(var k=0;k<a.length;++k)a[k].to==null&&(x||(x=[])).push(new hi(a[k].marker,null,null));for(var P=0;P<L;++P)b.push(x);b.push(s)}return b}function uo(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ca(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(d){if(d.markedSpans)for(var v=0;v<d.markedSpans.length;++v){var g=d.markedSpans[v].marker;g.readOnly&&(!r||W(r,g)==-1)&&(r||(r=[])).push(g)}}),!r)return null;for(var n=[{from:t,to:i}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<n.length;++s){var u=n[s];if(!(B(u.to,a.from)<0||B(u.from,a.to)>0)){var f=[s,1],h=B(u.from,a.from),p=B(u.to,a.to);(h<0||!l.inclusiveLeft&&!h)&&f.push({from:u.from,to:a.from}),(p>0||!l.inclusiveRight&&!p)&&f.push({from:a.to,to:u.to}),n.splice.apply(n,f),s+=f.length-3}}return n}function fo(e){var t=e.markedSpans;if(!!t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function ho(e,t){if(!!t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function ci(e){return e.inclusiveLeft?-1:0}function di(e){return e.inclusiveRight?1:0}function nn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),o=B(r.from,n.from)||ci(e)-ci(t);if(o)return-o;var l=B(r.to,n.to)||di(e)-di(t);return l||t.id-e.id}function co(e,t){var i=Mt&&e.markedSpans,r;if(i)for(var n=void 0,o=0;o<i.length;++o)n=i[o],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||nn(r,n.marker)<0)&&(r=n.marker);return r}function po(e){return co(e,!0)}function pi(e){return co(e,!1)}function ba(e,t){var i=Mt&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var o=i[n];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||nn(r,o.marker)<0)&&(r=o.marker)}return r}function vo(e,t,i,r,n){var o=M(e,t),l=Mt&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(!!s.marker.collapsed){var u=s.marker.find(0),f=B(u.from,i)||ci(s.marker)-ci(n),h=B(u.to,r)||di(s.marker)-di(n);if(!(f>=0&&h<=0||f<=0&&h>=0)&&(f<=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?B(u.to,i)>=0:B(u.to,i)>0)||f>=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?B(u.from,r)<=0:B(u.from,r)<0)))return!0}}}function lt(e){for(var t;t=po(e);)e=t.find(-1,!0).line;return e}function xa(e){for(var t;t=pi(e);)e=t.find(1,!0).line;return e}function wa(e){for(var t,i;t=pi(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function on(e,t){var i=M(e,t),r=lt(i);return i==r?t:ie(r)}function go(e,t){if(t>e.lastLine())return t;var i=M(e,t),r;if(!Ht(e,i))return t;for(;r=pi(i);)i=r.find(1,!0).line;return ie(i)+1}function Ht(e,t){var i=Mt&&t.markedSpans;if(i){for(var r=void 0,n=0;n<i.length;++n)if(r=i[n],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&ln(e,t,r))return!0}}}function ln(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return ln(e,r.line,Hr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,o=0;o<t.markedSpans.length;++o)if(n=t.markedSpans[o],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&ln(e,t,n))return!0}function Dt(e){e=lt(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var o=i.parent;o;i=o,o=i.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==i)break;t+=a.height}return t}function vi(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=po(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=pi(r);){var o=i.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function an(e){var t=e.display,i=e.doc;t.maxLine=M(i,i.first),t.maxLineLength=vi(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=vi(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var fr=function(e,t,i){this.text=e,ho(this,t),this.height=i?i(this):1};fr.prototype.lineNo=function(){return ie(this)},ar(fr);function Sa(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),fo(e),ho(e,i);var n=r?r(e):1;n!=e.height&&yt(e,n)}function La(e){e.parent=null,fo(e)}var ka={},Ta={};function yo(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Ta:ka;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function mo(e,t){var i=Pt("span",null,null,J?"padding-right: .1px":null),r={pre:Pt("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,l=void 0;r.pos=0,r.addToken=Da,ia(e.display.measure)&&(l=Tt(o,e.doc.direction))&&(r.addToken=Aa(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&ie(o);Oa(o,r,ro(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Nr(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Nr(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ra(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(J){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 ge(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Nr(r.pre.className,r.textClass||"")),r}function Ma(e){var t=O("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Da(e,t,i,r,n,o,l){if(!!t){var a=e.splitSpaces?Na(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,f;if(!s.test(t))e.col+=t.length,f=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,f),F&&R<9&&(u=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var h=0;;){s.lastIndex=h;var p=s.exec(t),d=p?p.index-h:t.length-h;if(d){var v=document.createTextNode(a.slice(h,h+d));F&&R<9?f.appendChild(O("span",[v])):f.appendChild(v),e.map.push(e.pos,e.pos+d,v),e.col+=d,e.pos+=d}if(!p)break;h+=d+1;var g=void 0;if(p[0]=="	"){var C=e.cm.options.tabSize,b=C-e.col%C;g=f.appendChild(O("span",pt(b),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","	"),e.col+=b}else p[0]=="\r"||p[0]==`
5`?(g=f.appendChild(O("span",p[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),g.setAttribute("cm-text",p[0]),e.col+=1):(g=e.cm.options.specialCharPlaceholder(p[0]),g.setAttribute("cm-text",p[0]),F&&R<9?f.appendChild(O("span",[g])):f.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,i||r||n||u||o||l){var L=i||"";r&&(L+=r),n&&(L+=n);var x=O("span",[f],L,o);if(l)for(var k in l)l.hasOwnProperty(k)&&k!="style"&&k!="class"&&x.setAttribute(k,l[k]);return e.content.appendChild(x)}e.content.appendChild(f)}}function Na(e,t){if(e.length>1&&!/  /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var o=e.charAt(n);o==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(o="\xA0"),r+=o,i=o==" "}return r}function Aa(e,t){return function(i,r,n,o,l,a,s){n=n?n+" cm-force-border":"cm-force-border";for(var u=i.pos,f=u+r.length;;){for(var h=void 0,p=0;p<t.length&&(h=t[p],!(h.to>u&&h.from<=u));p++);if(h.to>=f)return e(i,r,n,o,l,a,s);e(i,r.slice(0,h.to-u),n,o,null,a,s),o=null,r=r.slice(h.to-u),u=h.to}}}function Co(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function Oa(e,t,i){var r=e.markedSpans,n=e.text,o=0;if(!r){for(var l=1;l<i.length;l+=2)t.addToken(t,n.slice(o,o=i[l]),yo(i[l+1],t.cm.options));return}for(var a=n.length,s=0,u=1,f="",h,p,d=0,v,g,C,b,L;;){if(d==s){v=g=C=p="",L=null,b=null,d=Infinity;for(var x=[],k=void 0,P=0;P<r.length;++P){var D=r[P],U=D.marker;if(U.type=="bookmark"&&D.from==s&&U.widgetNode)x.push(U);else if(D.from<=s&&(D.to==null||D.to>s||U.collapsed&&D.to==s&&D.from==s)){if(D.to!=null&&D.to!=s&&d>D.to&&(d=D.to,g=""),U.className&&(v+=" "+U.className),U.css&&(p=(p?p+";":"")+U.css),U.startStyle&&D.from==s&&(C+=" "+U.startStyle),U.endStyle&&D.to==d&&(k||(k=[])).push(U.endStyle,D.to),U.title&&((L||(L={})).title=U.title),U.attributes)for(var le in U.attributes)(L||(L={}))[le]=U.attributes[le];U.collapsed&&(!b||nn(b.marker,U)<0)&&(b=D)}else D.from>s&&d>D.from&&(d=D.from)}if(k)for(var Te=0;Te<k.length;Te+=2)k[Te+1]==d&&(g+=" "+k[Te]);if(!b||b.from==s)for(var he=0;he<x.length;++he)Co(t,0,x[he]);if(b&&(b.from||0)==s){if(Co(t,(b.to==null?a+1:b.to)-s,b.marker,b.from==null),b.to==null)return;b.to==s&&(b=!1)}}if(s>=a)break;for(var je=Math.min(a,d);;){if(f){var _e=s+f.length;if(!b){var me=_e>je?f.slice(0,je-s):f;t.addToken(t,me,h?h+v:v,C,s+me.length==d?g:"",p,L)}if(_e>=je){f=f.slice(je-s),s=je;break}s=_e,C=""}f=n.slice(o,o=i[u++]),h=yo(i[u++],t.cm.options)}}}function bo(e,t,i){this.line=t,this.rest=wa(t),this.size=this.rest?ie(X(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Ht(e,t)}function gi(e,t,i){for(var r=[],n,o=t;o<i;o=n){var l=new bo(e.doc,M(e.doc,o),o);n=o+l.size,r.push(l)}return r}var hr=null;function Wa(e){hr?hr.ops.push(e):e.ownsGroup=hr={ops:[e],delayedCallbacks:[]}}function Pa(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function Ea(e,t){var i=e.ownsGroup;if(!!i)try{Pa(i)}finally{hr=null,t(i)}}var Ir=null;function Se(e,t){var i=zi(e,t);if(!!i.length){var r=Array.prototype.slice.call(arguments,2),n;hr?n=hr.delayedCallbacks:Ir?n=Ir:(n=Ir=[],setTimeout(Ha,0));for(var o=function(a){n.push(function(){return i[a].apply(null,r)})},l=0;l<i.length;++l)o(l)}}function Ha(){var e=Ir;Ir=null;for(var t=0;t<e.length;++t)e[t]()}function xo(e,t,i,r){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];o=="text"?Fa(e,t):o=="gutter"?So(e,t,i,r):o=="class"?sn(e,t):o=="widget"&&Ra(e,t,r)}t.changes=null}function Fr(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),F&&R<8&&(e.node.style.zIndex=2)),e.node}function Ia(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=Fr(t);t.background=r.insertBefore(O("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function wo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):mo(e,t)}function Fa(e,t){var i=t.text.className,r=wo(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,sn(e,t)):i&&(t.text.className=i)}function sn(e,t){Ia(e,t),t.line.wrapClass?Fr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function So(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var n=Fr(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=Fr(t),a=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=a.appendChild(O("div",ji(e.options,i),"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,f=o.hasOwnProperty(u)&&o[u];f&&a.appendChild(O("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ra(e,t,i){t.alignable&&(t.alignable=null);for(var r=wt("CodeMirror-linewidget"),n=t.node.firstChild,o=void 0;n;n=o)o=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);Lo(e,t,i)}function Ba(e,t,i,r){var n=wo(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),sn(e,t),So(e,t,i,r),Lo(e,t,r),t.node}function Lo(e,t,i){if(ko(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)ko(e,t.rest[r],t,i,!1)}function ko(e,t,i,r,n){if(!!t.widgets)for(var o=Fr(i),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=O("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),za(s,u,i,r),e.display.input.setUneditable(u),n&&s.above?o.insertBefore(u,i.gutter||i.text):o.appendChild(u),Se(s,"redraw")}}function za(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Rr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!ct(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),Be(t.display.measure,O("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Nt(e,t){for(var i=Ki(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function yi(e){return e.lineSpace.offsetTop}function un(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function To(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Be(e.measure,O("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Ct(e){return $-e.display.nativeBarWidth}function Qt(e){return e.display.scroller.clientWidth-Ct(e)-e.display.barWidth}function fn(e){return e.display.scroller.clientHeight-Ct(e)-e.display.barHeight}function Ua(e,t,i){var r=e.options.lineWrapping,n=r&&Qt(e);if(!t.measure.heights||r&&t.measure.width!=n){var o=t.measure.heights=[];if(r){t.measure.width=n;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-i.top)}}o.push(i.bottom-i.top)}}function Mo(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var n=0;n<e.rest.length;n++)if(ie(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function Ka(e,t){t=lt(t);var i=ie(t),r=e.display.externalMeasured=new bo(e.doc,t,i);r.lineN=i;var n=r.built=mo(e,r);return r.text=n.pre,Be(e.display.lineMeasure,n.pre),r}function Do(e,t,i,r){return bt(e,cr(e,t),i,r)}function hn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Vt(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function cr(e,t){var i=ie(t),r=hn(e,i);r&&!r.text?r=null:r&&r.changes&&(xo(e,r,i,gn(e)),e.curOp.forceUpdate=!0),r||(r=Ka(e,t));var n=Mo(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function bt(e,t,i,r,n){t.before&&(i=-1);var o=i+(r||""),l;return t.cache.hasOwnProperty(o)?l=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ua(e,t.view,t.rect),t.hasHeights=!0),l=_a(e,t,i,r),l.bogus||(t.cache[o]=l)),{left:l.left,right:l.right,top:n?l.rtop:l.top,bottom:n?l.rbottom:l.bottom}}var No={left:0,right:0,top:0,bottom:0};function Ao(e,t,i){for(var r,n,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(n=0,o=1,l="left"):t<s?(n=t-a,o=n+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-a,n=o-1,t>=s&&(l="right")),n!=null){if(r=e[u+2],a==s&&i==(r.insertLeft?"left":"right")&&(l=i),i=="left"&&n==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(i=="right"&&n==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],l="right";break}return{node:r,start:n,end:o,collapse:l,coverStart:a,coverEnd:s}}function Ga(e,t){var i=No;if(t=="left")for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;n>=0&&(i=e[n]).left==i.right;n--);return i}function _a(e,t,i,r){var n=Ao(t.map,i,r),o=n.node,l=n.start,a=n.end,s=n.collapse,u;if(o.nodeType==3){for(var f=0;f<4;f++){for(;l&&gt(t.line.text.charAt(n.coverStart+l));)--l;for(;n.coverStart+a<n.coverEnd&&gt(t.line.text.charAt(n.coverStart+a));)++a;if(F&&R<9&&l==0&&a==n.coverEnd-n.coverStart?u=o.parentNode.getBoundingClientRect():u=Ga(ht(o,l,a).getClientRects(),r),u.left||u.right||l==0)break;a=l,l=l-1,s="right"}F&&R<11&&(u=Za(e.display.measure,u))}else{l>0&&(s=r="right");var h;e.options.lineWrapping&&(h=o.getClientRects()).length>1?u=h[r=="right"?h.length-1:0]:u=o.getBoundingClientRect()}if(F&&R<9&&!l&&(!u||!u.left&&!u.right)){var p=o.parentNode.getClientRects()[0];p?u={left:p.left,right:p.left+pr(e.display),top:p.top,bottom:p.bottom}:u=No}for(var d=u.top-t.rect.top,v=u.bottom-t.rect.top,g=(d+v)/2,C=t.view.measure.heights,b=0;b<C.length-1&&!(g<C[b]);b++);var L=b?C[b-1]:0,x=C[b],k={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:L,bottom:x};return!u.left&&!u.right&&(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=d,k.rbottom=v),k}function Za(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!la(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function Oo(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 Wo(e){e.display.externalMeasure=null,St(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Oo(e.display.view[t])}function Br(e){Wo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Po(e){return re&&T?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Eo(e){return re&&T?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function cn(e){var t=lt(e),i=t.widgets,r=0;if(i)for(var n=0;n<i.length;++n)i[n].above&&(r+=Rr(i[n]));return r}function mi(e,t,i,r,n){if(!n){var o=cn(t);i.top+=o,i.bottom+=o}if(r=="line")return i;r||(r="local");var l=Dt(t);if(r=="local"?l+=yi(e.display):l-=e.display.viewOffset,r=="page"||r=="window"){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+(r=="window"?0:Eo(ce(e)));var s=a.left+(r=="window"?0:Po(ce(e)));i.left+=s,i.right+=s}return i.top+=l,i.bottom+=l,i}function Ho(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=Po(ce(e)),n-=Eo(ce(e));else if(i=="local"||!i){var o=e.display.sizer.getBoundingClientRect();r+=o.left,n+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:n-l.top}}function Ci(e,t,i,r,n){return r||(r=M(e.doc,t.line)),mi(e,r,Do(e,r,t.ch,n),i)}function at(e,t,i,r,n,o){r=r||M(e.doc,t.line),n||(n=cr(e,r));function l(v,g){var C=bt(e,n,v,g?"right":"left",o);return g?C.left=C.right:C.right=C.left,mi(e,r,C,i)}var a=Tt(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"),!a)return l(u=="before"?s-1:s,u=="before");function f(v,g,C){var b=a[g],L=b.level==1;return l(C?v-1:v,L!=C)}var h=Or(a,s,u),p=Ar,d=f(s,h,u=="before");return p!=null&&(d.other=f(s,p,u!="before")),d}function Io(e,t){var i=0;t=z(e.doc,t),e.options.lineWrapping||(i=pr(e.display)*t.ch);var r=M(e.doc,t.line),n=Dt(r)+yi(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function dn(e,t,i,r,n){var o=y(e,t,i);return o.xRel=n,r&&(o.outside=r),o}function pn(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return dn(r.first,0,null,-1,-1);var n=qt(r,i),o=r.first+r.size-1;if(n>o)return dn(r.first+r.size-1,M(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=M(r,n);;){var a=Xa(e,l,n,t,i),s=ba(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==n)return u;l=M(r,n=u.line)}}function Fo(e,t,i,r){r-=cn(t);var n=t.text.length,o=kt(function(l){return bt(e,i,l-1).bottom<=r},n,0);return n=kt(function(l){return bt(e,i,l).top>r},o,n),{begin:o,end:n}}function Ro(e,t,i,r){i||(i=cr(e,t));var n=mi(e,t,bt(e,i,r),"line").top;return Fo(e,t,i,n)}function vn(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Xa(e,t,i,r,n){n-=Dt(t);var o=cr(e,t),l=cn(t),a=0,s=t.text.length,u=!0,f=Tt(t,e.doc.direction);if(f){var h=(e.options.lineWrapping?qa:Ya)(e,t,i,o,f,r,n);u=h.level!=1,a=u?h.from:h.to-1,s=u?h.to:h.from-1}var p=null,d=null,v=kt(function(P){var D=bt(e,o,P);return D.top+=l,D.bottom+=l,vn(D,r,n,!1)?(D.top<=n&&D.left<=r&&(p=P,d=D),!0):!1},a,s),g,C,b=!1;if(d){var L=r-d.left<d.right-r,x=L==u;v=p+(x?0:1),C=x?"after":"before",g=L?d.left:d.right}else{!u&&(v==s||v==a)&&v++,C=v==0?"after":v==t.text.length?"before":bt(e,o,v-(u?1:0)).bottom+l<=n==u?"after":"before";var k=at(e,y(i,v,C),"line",t,o);g=k.left,b=n<k.top?-1:n>=k.bottom?1:0}return v=Et(t.text,v,1),dn(i,v,C,b,r-g)}function Ya(e,t,i,r,n,o,l){var a=kt(function(h){var p=n[h],d=p.level!=1;return vn(at(e,y(i,d?p.to:p.from,d?"before":"after"),"line",t,r),o,l,!0)},0,n.length-1),s=n[a];if(a>0){var u=s.level!=1,f=at(e,y(i,u?s.from:s.to,u?"after":"before"),"line",t,r);vn(f,o,l,!0)&&f.top>l&&(s=n[a-1])}return s}function qa(e,t,i,r,n,o,l){var a=Fo(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var f=null,h=null,p=0;p<n.length;p++){var d=n[p];if(!(d.from>=u||d.to<=s)){var v=d.level!=1,g=bt(e,r,v?Math.min(u,d.to)-1:Math.max(s,d.from)).right,C=g<o?o-g+1e9:g-o;(!f||h>C)&&(f=d,h=C)}}return f||(f=n[n.length-1]),f.from<s&&(f={from:s,to:f.to,level:f.level}),f.to>u&&(f={from:f.from,to:u,level:f.level}),f}var Jt;function dr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Jt==null){Jt=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Jt.appendChild(document.createTextNode("x")),Jt.appendChild(O("br"));Jt.appendChild(document.createTextNode("x"))}Be(e.measure,Jt);var i=Jt.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),St(e.measure),i||1}function pr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),i=O("pre",[t],"CodeMirror-line-like");Be(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function gn(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;i[a]=o.offsetLeft+o.clientLeft+n,r[a]=o.clientWidth}return{fixedPos:yn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function yn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bo(e){var t=dr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/pr(e.display)-3);return function(n){if(Ht(e.doc,n))return 0;var o=0;if(n.widgets)for(var l=0;l<n.widgets.length;l++)n.widgets[l].height&&(o+=n.widgets[l].height);return i?o+(Math.ceil(n.text.length/r)||1)*t:o+t}}function mn(e){var t=e.doc,i=Bo(e);t.iter(function(r){var n=i(r);n!=r.height&&yt(r,n)})}function jt(e,t,i,r){var n=e.display;if(!i&&Ki(t).getAttribute("cm-not-content")=="true")return null;var o,l,a=n.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(h){return null}var s=pn(e,o,l),u;if(r&&s.xRel>0&&(u=M(e.doc,s.line).text).length==s.ch){var f=G(u,u.length,e.options.tabSize)-u.length;s=y(s.line,Math.max(0,Math.round((o-To(e.display).left)/pr(e.display))-f))}return s}function Vt(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function Ke(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Mt&&on(e.doc,t)<n.viewTo&&Ft(e);else if(i<=n.viewFrom)Mt&&go(e.doc,i+r)>n.viewFrom?Ft(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ft(e);else if(t<=n.viewFrom){var o=bi(e,i,i+r,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=r):Ft(e)}else if(i>=n.viewTo){var l=bi(e,t,t,-1);l?(n.view=n.view.slice(0,l.index),n.viewTo=l.lineN):Ft(e)}else{var a=bi(e,t,t,-1),s=bi(e,i,i+r,1);a&&s?(n.view=n.view.slice(0,a.index).concat(gi(e,a.lineN,s.lineN)).concat(n.view.slice(s.index)),n.viewTo+=r):Ft(e)}var u=n.externalMeasured;u&&(i<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(n.externalMeasured=null))}function It(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Vt(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);W(l,i)==-1&&l.push(i)}}}function Ft(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function bi(e,t,i,r){var n=Vt(e,t),o,l=e.display.view;if(!Mt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var a=e.display.viewFrom,s=0;s<n;s++)a+=l[s].size;if(a!=t){if(r>0){if(n==l.length-1)return null;o=a+l[n].size-t,n++}else o=a-t;t+=o,i+=o}for(;on(e.doc,i)!=i;){if(n==(r<0?0:l.length-1))return null;i+=r*l[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Qa(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=gi(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=gi(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Vt(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(gi(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,Vt(e,i)))),r.viewTo=i}function zo(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function zr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Uo(e,t){t===void 0&&(t=!0);var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<i.sel.ranges.length;a++)if(!(!t&&a==i.sel.primIndex)){var s=i.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(l){var f=l(e,s);f&&Cn(e,f,n)}else(u||e.options.showCursorWhenSelecting)&&Cn(e,s.head,n);u||Ja(e,s,o)}}return r}function Cn(e,t,i){var r=at(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(O("div","\xA0","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Ci(e,t,"div",null,null),l=o.right-o.left;n.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=i.appendChild(O("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function xi(e,t){return e.top-t.top||e.left-t.left}function Ja(e,t,i){var r=e.display,n=e.doc,o=document.createDocumentFragment(),l=To(e.display),a=l.left,s=Math.max(r.sizerWidth,Qt(e)-r.sizer.offsetLeft)-l.right,u=n.direction=="ltr";function f(x,k,P,D){k<0&&(k=0),k=Math.round(k),D=Math.round(D),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+x+`px;
6                             top: `+k+"px; width: "+(P==null?s-x:P)+`px;
7                             height: `+(D-k)+"px"))}function h(x,k,P){var D=M(n,x),U=D.text.length,le,Te;function he(me,Ze){return Ci(e,y(x,me),"div",D,Ze)}function je(me,Ze,Ne){var be=Ro(e,D,null,me),Ce=Ze=="ltr"==(Ne=="after")?"left":"right",de=Ne=="after"?be.begin:be.end-(/\s/.test(D.text.charAt(be.end-1))?2:1);return he(de,Ce)[Ce]}var _e=Tt(D,n.direction);return $l(_e,k||0,P==null?U:P,function(me,Ze,Ne,be){var Ce=Ne=="ltr",de=he(me,Ce?"left":"right"),Xe=he(Ze-1,Ce?"right":"left"),Mr=k==null&&me==0,Gt=P==null&&Ze==U,Pe=be==0,xt=!_e||be==_e.length-1;if(Xe.top-de.top<=3){var Me=(u?Mr:Gt)&&Pe,Xn=(u?Gt:Mr)&&xt,Wt=Me?a:(Ce?de:Xe).left,ir=Xn?s:(Ce?Xe:de).right;f(Wt,de.top,ir-Wt,de.bottom)}else{var nr,Fe,Dr,Yn;Ce?(nr=u&&Mr&&Pe?a:de.left,Fe=u?s:je(me,Ne,"before"),Dr=u?a:je(Ze,Ne,"after"),Yn=u&&Gt&&xt?s:Xe.right):(nr=u?je(me,Ne,"before"):a,Fe=!u&&Mr&&Pe?s:de.right,Dr=!u&&Gt&&xt?a:Xe.left,Yn=u?je(Ze,Ne,"after"):s),f(nr,de.top,Fe-nr,de.bottom),de.bottom<Xe.top&&f(a,de.bottom,null,Xe.top),f(Dr,Xe.top,Yn-Dr,Xe.bottom)}(!le||xi(de,le)<0)&&(le=de),xi(Xe,le)<0&&(le=Xe),(!Te||xi(de,Te)<0)&&(Te=de),xi(Xe,Te)<0&&(Te=Xe)}),{start:le,end:Te}}var p=t.from(),d=t.to();if(p.line==d.line)h(p.line,p.ch,d.ch);else{var v=M(n,p.line),g=M(n,d.line),C=lt(v)==lt(g),b=h(p.line,p.ch,C?v.text.length+1:null).end,L=h(d.line,C?0:null,d.ch).start;C&&(b.top<L.top-2?(f(b.right,b.top,null,b.bottom),f(a,L.top,L.left,L.bottom)):f(b.right,b.top,L.left-b.right,b.bottom)),b.bottom<L.top&&f(a,b.bottom,null,L.top)}i.appendChild(o)}function bn(e){if(!!e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||vr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ko(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||wn(e))}function xn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&vr(e))},100)}function wn(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,dt(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),J&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bn(e))}function vr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,ft(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function wi(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var a=t.view[l],s=e.options.lineWrapping,u=void 0,f=0;if(!a.hidden){if(n+=a.line.height,F&&R<8){var h=a.node.offsetTop+a.node.offsetHeight;u=h-i,i=h}else{var p=a.node.getBoundingClientRect();u=p.bottom-p.top,!s&&a.text.firstChild&&(f=a.text.firstChild.getBoundingClientRect().right-p.left-1)}var d=a.line.height-u;if((d>.005||d<-.005)&&(n<r&&(o-=d),yt(a.line,u),Go(a.line),a.rest))for(var v=0;v<a.rest.length;v++)Go(a.rest[v]);if(f>e.display.sizerWidth){var g=Math.ceil(f/pr(e.display));g>e.display.maxLineLength&&(e.display.maxLineLength=g,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Go(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Si(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-yi(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,o=qt(t,r),l=qt(t,n);if(i&&i.ensure){var a=i.ensure.from.line,s=i.ensure.to.line;a<o?(o=a,l=qt(t,Dt(M(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=qt(t,Dt(M(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ja(e,t){if(!we(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,o=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(n=!1),n!=null&&!c){var l=O("div","\u200B",null,`position: absolute;
8                         top: `+(t.top-i.viewOffset-yi(e.display))+`px;
9                         height: `+(t.bottom-t.top+Ct(e)+i.barHeight)+`px;
10                         left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(n),e.display.lineSpace.removeChild(l)}}}function Va(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?y(t.line,t.ch+1,"before"):t,t=t.ch?y(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=at(e,t),s=!i||i==t?a:at(e,i);n={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=Sn(e,n),f=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(Kr(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(l=!0)),u.scrollLeft!=null&&($t(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return n}function $a(e,t){var i=Sn(e,t);i.scrollTop!=null&&Kr(e,i.scrollTop),i.scrollLeft!=null&&$t(e,i.scrollLeft)}function Sn(e,t){var i=e.display,r=dr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,o=fn(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+un(i),s=t.top<r,u=t.bottom>a-r;if(t.top<n)l.scrollTop=s?0:t.top;else if(t.bottom>n+o){var f=Math.min(t.top,(u?a:t.bottom)-o);f!=n&&(l.scrollTop=f)}var h=e.options.fixedGutter?0:i.gutters.offsetWidth,p=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-h,d=Qt(e)-i.gutters.offsetWidth,v=t.right-t.left>d;return v&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.left<p?l.scrollLeft=Math.max(0,t.left+h-(v?0:10)):t.right>d+p-3&&(l.scrollLeft=t.right+(v?0:10)-d),l}function Ln(e,t){t!=null&&(Li(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function gr(e){Li(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ur(e,t,i){(t!=null||i!=null)&&Li(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function es(e,t){Li(e),e.curOp.scrollToPos=t}function Li(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Io(e,t.from),r=Io(e,t.to);_o(e,i,r,t.margin)}}function _o(e,t,i,r){var n=Sn(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Ur(e,n.scrollLeft,n.scrollTop)}function Kr(e,t){Math.abs(e.doc.scrollTop-t)<2||(Y||Tn(e,{top:t}),Zo(e,t,!0),Y&&Tn(e),Zr(e,100))}function Zo(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function $t(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Jo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Gr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+un(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Ct(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var er=function(e,t,i){this.cm=i;var r=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),H(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),H(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&R<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};er.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(i?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:i?r:0,bottom:t?r:0}},er.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},er.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},er.prototype.zeroWidthHack=function(){var e=j&&!S?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Z,this.disableVert=new Z},er.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},er.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var _r=function(){};_r.prototype.update=function(){return{bottom:0,right:0}},_r.prototype.setScrollLeft=function(){},_r.prototype.setScrollTop=function(){},_r.prototype.clear=function(){};function yr(e,t){t||(t=Gr(e));var i=e.display.barWidth,r=e.display.barHeight;Xo(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&wi(e),Xo(e,Gr(e)),i=e.display.barWidth,r=e.display.barHeight}function Xo(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Yo={native:er,null:_r};function qo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ft(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Yo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),H(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?$t(e,t):Kr(e,t)},e),e.display.scrollbars.addClass&&dt(e.display.wrapper,e.display.scrollbars.addClass)}var ts=0;function tr(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:++ts,markArrays:null},Wa(e.curOp)}function rr(e){var t=e.curOp;t&&Ea(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;rs(i)})}function rs(e){for(var t=e.ops,i=0;i<t.length;i++)is(t[i]);for(var r=0;r<t.length;r++)ns(t[r]);for(var n=0;n<t.length;n++)os(t[n]);for(var o=0;o<t.length;o++)ls(t[o]);for(var l=0;l<t.length;l++)as(t[l])}function is(e){var t=e.cm,i=t.display;us(t),e.updateMaxLine&&an(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ki(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ns(e){e.updatedDisplay=e.mustUpdate&&kn(e.cm,e.update)}function os(e){var t=e.cm,i=t.display;e.updatedDisplay&&wi(t),e.barMeasure=Gr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Do(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ct(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Qt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ls(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&$t(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==qe(V(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yr(t,e.barMeasure),e.updatedDisplay&&Dn(t,e.barMeasure),e.selectionChanged&&bn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ko(e.cm)}function as(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&Qo(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Zo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&$t(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Va(t,z(r,e.scrollToPos.from),z(r,e.scrollToPos.to),e.scrollToPos.margin);ja(t,n)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||ge(o[a],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&ge(l[s],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Je(e,t){if(e.curOp)return t();tr(e);try{return t()}finally{rr(e)}}function Le(e,t){return function(){if(e.curOp)return t.apply(e,arguments);tr(e);try{return t.apply(e,arguments)}finally{rr(e)}}}function Ie(e){return function(){if(this.curOp)return e.apply(this,arguments);tr(this);try{return e.apply(this,arguments)}finally{rr(this)}}}function ke(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);tr(t);try{return e.apply(this,arguments)}finally{rr(t)}}}function Zr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(ss,e))}function ss(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Er(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Xt(t.mode,r.state):null,s=to(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,f=s.classes;f?o.styleClasses=f:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),p=0;!h&&p<l.length;++p)h=l[p]!=o.styles[p];h&&n.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&en(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return Zr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&Je(e,function(){for(var o=0;o<n.length;o++)It(e,n[o],"text")})}}var ki=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Si(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Qt(e),this.force=i,this.dims=gn(e),this.events=[]};ki.prototype.signal=function(e,t){rt(e,t)&&this.events.push(arguments)},ki.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.apply(null,this.events[e])};function us(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ct(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ct(e)+"px",t.scrollbarsClipped=!0)}function fs(e){if(e.hasFocus())return null;var t=qe(V(e));if(!t||!ct(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=_(e).getSelection();r.anchorNode&&r.extend&&ct(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function hs(e){if(!(!e||!e.activeElt||e.activeElt==qe(q(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ct(document.body,e.anchorNode)&&ct(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function kn(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Ft(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&zo(e)==0)return!1;jo(e)&&(Ft(e),t.dims=gn(e));var n=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<o&&o-i.viewFrom<20&&(o=Math.max(r.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(n,i.viewTo)),Mt&&(o=on(e.doc,o),l=go(e.doc,l));var a=o!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Qa(e,o,l),i.viewOffset=Dt(M(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var s=zo(e);if(!a&&s==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var u=fs(e);return s>4&&(i.lineDiv.style.display="none"),cs(e,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,hs(u),St(i.cursorDiv),St(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,a&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Zr(e,400)),i.updateLineNumbers=null,!0}function Qo(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Qt(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+un(e.display)-fn(e),i.top)}),t.visible=Si(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Si(e.display,e.doc,i));if(!kn(e,t))break;wi(e);var n=Gr(e);zr(e),yr(e,n),Dn(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Tn(e,t){var i=new ki(e,t);if(kn(e,i)){wi(e),Qo(e,i);var r=Gr(e);zr(e),yr(e,r),Dn(e,r),i.finish()}}function cs(e,t,i){var r=e.display,n=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(v){var g=v.nextSibling;return J&&j&&e.display.currentWheelTarget==v?v.style.display="none":v.parentNode.removeChild(v),g}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var h=s[f];if(!h.hidden)if(!h.node||h.node.parentNode!=o){var p=Ba(e,h,u,i);o.insertBefore(p,l)}else{for(;l!=h.node;)l=a(l);var d=n&&t!=null&&t<=u&&h.lineNumber;h.changes&&(W(h.changes,"gutter")>-1&&(d=!1),xo(e,h,u,i)),d&&(St(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ji(e.options,u)))),l=h.node.nextSibling}u+=h.size}for(;l;)l=a(l)}function Mn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Se(e,"gutterChanged",e)}function Dn(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+Ct(e)+"px"}function Jo(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=yn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=r+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=o),i[l].gutterBackground&&(i[l].gutterBackground.style.left=o));var a=i[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function jo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ji(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(O("div",[O("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,l=n.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Mn(e.display),!0}return!1}function Nn(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var o=e[n],l=null;if(typeof o!="string"&&(l=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:o,style:l})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Vo(e){var t=e.gutters,i=e.gutterSpecs;St(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],o=n.className,l=n.style,a=t.appendChild(O("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),o=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Mn(e)}function Xr(e){Vo(e.display),Ke(e),Jo(e)}function ds(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=Pt("div",null,"CodeMirror-code"),n.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=O("div",null,"CodeMirror-cursors"),n.measure=O("div",null,"CodeMirror-measure"),n.lineMeasure=O("div",null,"CodeMirror-measure"),n.lineSpace=Pt("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var o=Pt("div",[n.lineSpace],"CodeMirror-lines");n.mover=O("div",[o],null,"position: relative"),n.sizer=O("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=O("div",null,null,"position: absolute; height: "+$+"px; width: 1px;"),n.gutters=O("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=O("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=O("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),re&&ve>=105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),F&&R<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!J&&!(Y&&w)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=Nn(r.gutters,r.lineNumbers),Vo(n),i.init(n)}var Ti=0,At=null;F?At=-.53:Y?At=15:re?At=-.7:N&&(At=-1/3);function $o(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function ps(e){var t=$o(e);return t.x*=At,t.y*=At,t}function el(e,t){re&&ve==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=$o(t),r=i.x,n=i.y,o=At;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(!!(r&&s||n&&u)){if(n&&j&&J){e:for(var f=t.target,h=l.view;f!=a;f=f.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==f){e.display.currentWheelTarget=f;break e}}if(r&&!Y&&!De&&o!=null){n&&u&&Kr(e,Math.max(0,a.scrollTop+n*o)),$t(e,Math.max(0,a.scrollLeft+r*o)),(!n||n&&u)&&Ue(t),l.wheelStartX=null;return}if(n&&o!=null){var d=n*o,v=e.doc.scrollTop,g=v+l.wrapper.clientHeight;d<0?v=Math.max(0,v+d-50):g=Math.min(e.doc.height,g+d+50),Tn(e,{top:v,bottom:g})}Ti<20&&t.deltaMode!==0&&(l.wheelStartX==null?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=r,l.wheelDY=n,setTimeout(function(){if(l.wheelStartX!=null){var C=a.scrollLeft-l.wheelStartX,b=a.scrollTop-l.wheelStartY,L=b&&l.wheelDY&&b/l.wheelDY||C&&l.wheelDX&&C/l.wheelDX;l.wheelStartX=l.wheelStartY=null,!!L&&(At=(At*Ti+L)/(Ti+1),++Ti)}},200)):(l.wheelDX+=r,l.wheelDY+=n))}}var $e=function(e,t){this.ranges=e,this.primIndex=t};$e.prototype.primary=function(){return this.ranges[this.primIndex]},$e.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!Vi(i.anchor,r.anchor)||!Vi(i.head,r.head))return!1}return!0},$e.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ee($i(this.ranges[t].anchor),$i(this.ranges[t].head));return new $e(e,this.primIndex)},$e.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},$e.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(B(t,r.from())>=0&&B(e,r.to())<=0)return i}return-1};var ee=function(e,t){this.anchor=e,this.head=t};ee.prototype.from=function(){return ui(this.anchor,this.head)},ee.prototype.to=function(){return si(this.anchor,this.head)},ee.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function st(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(p,d){return B(p.from(),d.from())}),i=W(t,n);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=B(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var u=ui(a.from(),l.from()),f=si(a.to(),l.to()),h=a.empty()?l.from()==l.head:a.from()==a.head;o<=i&&--i,t.splice(--o,2,new ee(h?f:u,h?u:f))}}return new $e(t,i)}function Rt(e,t){return new $e([new ee(e,t||e)],0)}function Bt(e){return e.text?y(e.from.line+e.text.length-1,X(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function tl(e,t){if(B(e,t.from)<0)return e;if(B(e,t.to)<=0)return Bt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Bt(t).ch-t.to.ch),y(i,r)}function An(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new ee(tl(n.anchor,t),tl(n.head,t)))}return st(e.cm,i,e.sel.primIndex)}function rl(e,t,i){return e.line==t.line?y(i.line,e.ch-t.ch+i.ch):y(i.line+(e.line-t.line),e.ch)}function vs(e,t,i){for(var r=[],n=y(e.first,0),o=n,l=0;l<t.length;l++){var a=t[l],s=rl(a.from,n,o),u=rl(Bt(a),n,o);if(n=a.to,o=u,i=="around"){var f=e.sel.ranges[l],h=B(f.head,f.anchor)<0;r[l]=new ee(h?u:s,h?s:u)}else r[l]=new ee(s,s)}return new $e(r,e.sel.primIndex)}function On(e){e.doc.mode=qi(e.options,e.doc.modeOption),Yr(e)}function Yr(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,Zr(e,100),e.state.modeGen++,e.curOp&&Ke(e)}function il(e,t){return t.from.ch==0&&t.to.ch==0&&X(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wn(e,t,i,r){function n(L){return i?i[L]:null}function o(L,x,k){Sa(L,x,k,r),Se(L,"change",L,t)}function l(L,x){for(var k=[],P=L;P<x;++P)k.push(new fr(u[P],n(P),r));return k}var a=t.from,s=t.to,u=t.text,f=M(e,a.line),h=M(e,s.line),p=X(u),d=n(u.length-1),v=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(il(e,t)){var g=l(0,u.length-1);o(h,h.text,d),v&&e.remove(a.line,v),g.length&&e.insert(a.line,g)}else if(f==h)if(u.length==1)o(f,f.text.slice(0,a.ch)+p+f.text.slice(s.ch),d);else{var C=l(1,u.length-1);C.push(new fr(p+f.text.slice(s.ch),d,r)),o(f,f.text.slice(0,a.ch)+u[0],n(0)),e.insert(a.line+1,C)}else if(u.length==1)o(f,f.text.slice(0,a.ch)+u[0]+h.text.slice(s.ch),n(0)),e.remove(a.line+1,v);else{o(f,f.text.slice(0,a.ch)+u[0],n(0)),o(h,p+h.text.slice(s.ch),d);var b=l(1,u.length-1);v>1&&e.remove(a.line+1,v-1),e.insert(a.line+1,b)}Se(e,"change",e,t)}function zt(e,t,i){function r(n,o,l){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=o){var u=l&&s.sharedHist;i&&!u||(t(s.doc,u),r(s.doc,n,u))}}}r(e,null,!0)}function nl(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,mn(e),On(e),ol(e),e.options.direction=t.direction,e.options.lineWrapping||an(e),e.options.mode=t.modeOption,Ke(e)}function ol(e){(e.doc.direction=="rtl"?dt:ft)(e.display.lineDiv,"CodeMirror-rtl")}function gs(e){Je(e,function(){ol(e),Ke(e)})}function Mi(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Pn(e,t){var i={from:$i(t.from),to:Bt(t),text:Yt(e,t.from,t.to)};return sl(e,i,t.from.line,t.to.line+1),zt(e,function(r){return sl(r,i,t.from.line,t.to.line+1)},!0),i}function ll(e){for(;e.length;){var t=X(e);if(t.ranges)e.pop();else break}}function ys(e,t){if(t)return ll(e.done),X(e.done);if(e.done.length&&!X(e.done).ranges)return X(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),X(e.done)}function al(e,t,i,r){var n=e.history;n.undone.length=0;var o=+new Date,l,a;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=ys(n,n.lastOp==r)))a=X(l.changes),B(t.from,t.to)==0&&B(t.from,a.to)==0?a.to=Bt(t):l.changes.push(Pn(e,t));else{var s=X(n.done);for((!s||!s.ranges)&&Di(e.sel,n.done),l={changes:[Pn(e,t)],generation:n.generation},n.done.push(l);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=o,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,a||ge(e,"historyAdded")}function ms(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Cs(e,t,i,r){var n=e.history,o=r&&r.origin;i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||ms(e,o,X(n.done),t))?n.done[n.done.length-1]=t:Di(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=i,r&&r.clearRedo!==!1&&ll(n.undone)}function Di(e,t){var i=X(t);i&&i.ranges&&i.equals(e)||t.push(e)}function sl(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function bs(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function xs(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(bs(i[n]));return r}function ul(e,t){var i=xs(e,t),r=rn(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var o=i[n],l=r[n];if(o&&l){e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}}else l&&(i[n]=l)}return i}function mr(e,t,i){for(var r=[],n=0;n<e.length;++n){var o=e[n];if(o.ranges){r.push(i?$e.prototype.deepCopy.call(o):o);continue}var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],f=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(f=h.match(/^spans_(\d+)$/))&&W(t,Number(f[1]))>-1&&(X(a)[h]=u[h],delete u[h])}}return r}function En(e,t,i,r){if(r){var n=e.anchor;if(i){var o=B(t,n)<0;o!=B(i,n)<0?(n=t,t=i):o!=B(t,i)<0&&(t=i)}return new ee(n,t)}else return new ee(i||t,t)}function Ni(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),We(e,new $e([En(e.sel.primary(),t,i,n)],0),r)}function fl(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=En(e.sel.ranges[o],t[o],null,n);var l=st(e.cm,r,e.sel.primIndex);We(e,l,i)}function Hn(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,We(e,st(e.cm,n,e.sel.primIndex),r)}function hl(e,t,i,r){We(e,Rt(t,i),r)}function ws(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var o=0;o<n.length;o++)this.ranges[o]=new ee(z(e,n[o].anchor),z(e,n[o].head))},origin:i&&i.origin};return ge(e,"beforeSelectionChange",e,r),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?st(e.cm,r.ranges,r.ranges.length-1):t}function cl(e,t,i){var r=e.history.done,n=X(r);n&&n.ranges?(r[r.length-1]=t,Ai(e,t,i)):We(e,t,i)}function We(e,t,i){Ai(e,t,i),Cs(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Ai(e,t,i){(rt(e,"beforeSelectionChange")||e.cm&&rt(e.cm,"beforeSelectionChange"))&&(t=ws(e,t,i));var r=i&&i.bias||(B(t.primary().head,e.sel.primary().head)<0?-1:1);dl(e,vl(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&gr(e.cm)}function dl(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Qn(e.cm)),Se(e,"cursorActivity",e))}function pl(e){dl(e,vl(e,e.sel,null,!1))}function vl(e,t,i,r){for(var n,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Oi(e,l.anchor,a&&a.anchor,i,r),u=l.head==l.anchor?s:Oi(e,l.head,a&&a.head,i,r);(n||s!=l.anchor||u!=l.head)&&(n||(n=t.ranges.slice(0,o)),n[o]=new ee(s,u))}return n?st(e.cm,n,t.primIndex):t}function Cr(e,t,i,r,n){var o=M(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(f?a.to>=t.ch:a.to>t.ch))){if(n&&(ge(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(i){var h=s.find(r<0?1:-1),p=void 0;if((r<0?f:u)&&(h=gl(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(p=B(h,i))&&(r<0?p<0:p>0))return Cr(e,h,t,r,n)}var d=s.find(r<0?-1:1);return(r<0?u:f)&&(d=gl(e,d,r,d.line==t.line?o:null)),d?Cr(e,d,t,r,n):null}}return t}function Oi(e,t,i,r,n){var o=r||1,l=Cr(e,t,i,o,n)||!n&&Cr(e,t,i,o,!0)||Cr(e,t,i,-o,n)||!n&&Cr(e,t,i,-o,!0);return l||(e.cantEdit=!0,y(e.first,0))}function gl(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?z(e,y(t.line-1)):null:i>0&&t.ch==(r||M(e,t.line)).text.length?t.line<e.first+e.size-1?y(t.line+1,0):null:new y(t.line,t.ch+i)}function yl(e){e.setSelection(y(e.firstLine(),0),y(e.lastLine()),oe)}function ml(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,o,l,a){n&&(r.from=z(e,n)),o&&(r.to=z(e,o)),l&&(r.text=l),a!==void 0&&(r.origin=a)}),ge(e,"beforeChange",e,r),e.cm&&ge(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 br(e,t,i){if(e.cm){if(!e.cm.curOp)return Le(e.cm,br)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((rt(e,"beforeChange")||e.cm&&rt(e.cm,"beforeChange"))&&(t=ml(e,t,!0),!t))){var r=so&&!i&&Ca(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)Cl(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Cl(e,t)}}function Cl(e,t){if(!(t.text.length==1&&t.text[0]==""&&B(t.from,t.to)==0)){var i=An(e,t);al(e,t,i,e.cm?e.cm.curOp.id:NaN),qr(e,t,i,rn(e,t));var r=[];zt(e,function(n,o){!o&&W(r,n.history)==-1&&(Sl(n.history,t),r.push(n.history)),qr(n,t,null,rn(n,t))})}}function Wi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,o,l=e.sel,a=t=="undo"?n.done:n.undone,s=t=="undo"?n.undone:n.done,u=0;u<a.length&&(o=a[u],!(i?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=a.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(o=a.pop(),o.ranges){if(Di(o,s),i&&!o.equals(e.sel)){We(e,o,{clearRedo:!1});return}l=o}else if(r){a.push(o);return}else break;var f=[];Di(l,s),s.push({changes:f,generation:n.generation}),n.generation=o.generation||++n.maxGeneration;for(var h=rt(e,"beforeChange")||e.cm&&rt(e.cm,"beforeChange"),p=function(g){var C=o.changes[g];if(C.origin=t,h&&!ml(e,C,!1))return a.length=0,{};f.push(Pn(e,C));var b=g?An(e,C):X(a);qr(e,C,b,ul(e,C)),!g&&e.cm&&e.cm.scrollIntoView({from:C.from,to:Bt(C)});var L=[];zt(e,function(x,k){!k&&W(L,x.history)==-1&&(Sl(x.history,C),L.push(x.history)),qr(x,C,null,ul(x,C))})},d=o.changes.length-1;d>=0;--d){var v=p(d);if(v)return v.v}}}}function bl(e,t){if(t!=0&&(e.first+=t,e.sel=new $e(He(e.sel.ranges,function(n){return new ee(y(n.anchor.line+t,n.anchor.ch),y(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){Ke(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)It(e.cm,r,"gutter")}}function qr(e,t,i,r){if(e.cm&&!e.cm.curOp)return Le(e.cm,qr)(e,t,i,r);if(t.to.line<e.first){bl(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);bl(e,n),t={from:y(e.first,0),to:y(t.to.line+n,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:y(o,M(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Yt(e,t.from,t.to),i||(i=An(e,t)),e.cm?Ss(e.cm,t,r):Wn(e,t,r),Ai(e,i,oe),e.cantEdit&&Oi(e,y(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ss(e,t,i){var r=e.doc,n=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=ie(lt(M(r,o.line))),r.iter(s,l.line+1,function(d){if(d==n.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Qn(e),Wn(r,t,i,Bo(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(d){var v=vi(d);v>n.maxLineLength&&(n.maxLine=d,n.maxLineLength=v,n.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),ca(r,o.line),Zr(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?Ke(e):o.line==l.line&&t.text.length==1&&!il(e.doc,t)?It(e,o.line,"text"):Ke(e,o.line,l.line+1,u);var f=rt(e,"changes"),h=rt(e,"change");if(h||f){var p={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&Se(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function xr(e,t,i,r,n){var o;r||(r=i),B(r,i)<0&&(o=[r,i],i=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),br(e,{from:i,to:r,text:t,origin:n})}function xl(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function wl(e,t,i,r){for(var n=0;n<e.length;++n){var o=e[n],l=!0;if(o.ranges){o.copied||(o=e[n]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)xl(o.ranges[a].anchor,t,i,r),xl(o.ranges[a].head,t,i,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(i<u.from.line)u.from=y(u.from.line+r,u.from.ch),u.to=y(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,n+1),n=0)}}function Sl(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;wl(e.done,i,r,n),wl(e.undone,i,r,n)}function Qr(e,t,i,r){var n=t,o=t;return typeof t=="number"?o=M(e,$n(e,t)):n=ie(t),n==null?null:(r(o,n)&&e.cm&&It(e.cm,n,i),o)}function Jr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Jr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,La(n),Se(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function jr(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}jr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var o=Math.min(t,n-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,n==o&&(this.children.splice(i--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Jr))){var a=[];this.collapse(a),this.children=[new Jr(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<=o){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var l=n.lines.length%25+25,a=l;a<n.lines.length;){var s=new Jr(n.lines.slice(a,a+=25));n.height-=s.height,this.children.splice(++r,0,s),s.parent=this}n.lines=n.lines.slice(0,l),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),i=new jr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=W(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new jr(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var l=Math.min(t,o-e);if(n.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=o}}};var Vr=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};Vr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=ie(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var o=Rr(this);yt(i,Math.max(0,i.height-o)),e&&(Je(e,function(){Ll(e,i,-o),It(e,r,"widget")}),Se(e,"lineWidgetCleared",e,this,r))}},Vr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=Rr(this)-t;!n||(Ht(this.doc,r)||yt(r,r.height+n),i&&Je(i,function(){i.curOp.forceUpdate=!0,Ll(i,r,n),Se(i,"lineWidgetChanged",i,e,ie(r))}))},ar(Vr);function Ll(e,t,i){Dt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ln(e,i)}function Ls(e,t,i,r){var n=new Vr(e,i,r),o=e.cm;return o&&n.noHScroll&&(o.display.alignWidgets=!0),Qr(e,t,"widget",function(l){var a=l.widgets||(l.widgets=[]);if(n.insertAt==null?a.push(n):a.splice(Math.min(a.length,Math.max(0,n.insertAt)),0,n),n.line=l,o&&!Ht(e,l)){var s=Dt(l)<e.scrollTop;yt(l,l.height+Rr(n)),s&&Ln(o,n.height),o.curOp.forceUpdate=!0}return!0}),o&&Se(o,"lineWidgetAdded",o,n,typeof t=="number"?t:ie(t)),n}var kl=0,Ut=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++kl};Ut.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&tr(e),rt(this,"clear")){var i=this.find();i&&Se(this,"clear",i.from,i.to)}for(var r=null,n=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=Hr(l.markedSpans,this);e&&!this.collapsed?It(e,ie(l),"text"):e&&(a.to!=null&&(n=ie(l)),a.from!=null&&(r=ie(l))),l.markedSpans=va(l.markedSpans,a),a.from==null&&this.collapsed&&!Ht(this.doc,l)&&e&&yt(l,dr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=lt(this.lines[s]),f=vi(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Ke(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&pl(e.doc)),e&&Se(e,"markerCleared",e,this,r,n),t&&rr(e),this.parent&&this.parent.clear()}},Ut.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var o=this.lines[n],l=Hr(o.markedSpans,this);if(l.from!=null&&(i=y(t?o:ie(o),l.from),e==-1))return i;if(l.to!=null&&(r=y(t?o:ie(o),l.to),e==1))return r}return i&&{from:i,to:r}},Ut.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||Je(r,function(){var n=t.line,o=ie(t.line),l=hn(r,o);if(l&&(Oo(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ht(i.doc,n)&&i.height!=null){var a=i.height;i.height=null;var s=Rr(i)-a;s&&yt(n,n.height+s)}Se(r,"markerChanged",r,e)})},Ut.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||W(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ut.prototype.detachLine=function(e){if(this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ar(Ut);function wr(e,t,i,r,n){if(r&&r.shared)return ks(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Le(e.cm,wr)(e,t,i,r,n);var o=new Ut(e,n),l=B(t,i);if(r&&Q(r,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Pt("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vo(e,t.line,t,i,o)||t.line!=i.line&&vo(e,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");pa()}o.addToHistory&&al(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,i.line+1,function(h){s&&o.collapsed&&!s.options.lineWrapping&&lt(h)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&yt(h,0),ga(h,new hi(o,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,i.line+1,function(h){Ht(e,h)&&yt(h,0)}),o.clearOnEnter&&H(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(da(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++kl,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)Ke(s,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var f=t.line;f<=i.line;f++)It(s,f,"text");o.atomic&&pl(s.doc),Se(s,"markerAdded",s,o)}return o}var $r=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};$r.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Se(this,"clear")}},$r.prototype.find=function(e,t){return this.primary.find(e,t)},ar($r);function ks(e,t,i,r,n){r=Q(r),r.shared=!1;var o=[wr(e,t,i,r,n)],l=o[0],a=r.widgetNode;return zt(e,function(s){a&&(r.widgetNode=a.cloneNode(!0)),o.push(wr(s,z(s,t),z(s,i),r,n));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;l=X(o)}),new $r(o,l)}function Tl(e){return e.findMarks(y(e.first,0),e.clipPos(y(e.lastLine())),function(t){return t.parent})}function Ts(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),o=e.clipPos(n.from),l=e.clipPos(n.to);if(B(o,l)){var a=wr(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ms(e){for(var t=function(r){var n=e[r],o=[n.primary.doc];zt(n.primary.doc,function(s){return o.push(s)});for(var l=0;l<n.markers.length;l++){var a=n.markers[l];W(o,a.doc)==-1&&(a.parent=null,n.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Ds=0,Ge=function(e,t,i,r,n){if(!(this instanceof Ge))return new Ge(e,t,i,r,n);i==null&&(i=0),jr.call(this,[new Jr([new fr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var o=y(i,0);this.sel=Rt(o),this.history=new Mi(null),this.id=++Ds,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wn(this,{from:o,to:o,text:e}),We(this,Rt(o),oe)};Ge.prototype=et(jr.prototype,{constructor:Ge,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ji(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ke(function(e){var t=y(this.first,0),i=this.first+this.size-1;br(this,{from:t,to:y(i,M(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ur(this.cm,0,0),We(this,Rt(t),oe)}),replaceRange:function(e,t,i,r){t=z(this,t),i=i?z(this,i):t,xr(this,e,t,i,r)},getRange:function(e,t,i){var r=Yt(this,z(this,e),z(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Pr(this,e))return M(this,e)},getLineNumber:function(e){return ie(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=M(this,e)),lt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return z(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ke(function(e,t,i){hl(this,z(this,typeof e=="number"?y(e,t||0):e),null,i)}),setSelection:ke(function(e,t,i){hl(this,z(this,e),z(this,t||e),i)}),extendSelection:ke(function(e,t,i){Ni(this,z(this,e),t&&z(this,t),i)}),extendSelections:ke(function(e,t){fl(this,eo(this,e),t)}),extendSelectionsBy:ke(function(e,t){var i=He(this.sel.ranges,e);fl(this,eo(this,i),t)}),setSelections:ke(function(e,t,i){if(!!e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new ee(z(this,e[n].anchor),z(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),We(this,st(this.cm,r,t),i)}}),addSelection:ke(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new ee(z(this,e),z(this,t||e))),We(this,st(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=Yt(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=Yt(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:ke(function(e,t,i){for(var r=[],n=this.sel,o=0;o<n.ranges.length;o++){var l=n.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:i}}for(var a=t&&t!="end"&&vs(this,r,t),s=r.length-1;s>=0;s--)br(this,r[s]);a?cl(this,a):this.cm&&gr(this.cm)}),undo:ke(function(){Wi(this,"undo")}),redo:ke(function(){Wi(this,"redo")}),undoSelection:ke(function(){Wi(this,"undo",!0)}),redoSelection:ke(function(){Wi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Mi(this.history),zt(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:mr(this.history.done),undone:mr(this.history.undone)}},setHistory:function(e){var t=this.history=new Mi(this.history);t.done=mr(e.done.slice(0),null,!0),t.undone=mr(e.undone.slice(0),null,!0)},setGutterMarker:ke(function(e,t,i){return Qr(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Lt(n)&&(r.gutterMarkers=null),!0})}),clearGutter:ke(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Qr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Lt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pr(this,e)||(t=e,e=M(this,e),!e))return null}else if(t=ie(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:ke(function(e,t,i){return Qr(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(wt(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:ke(function(e,t,i){return Qr(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[n];if(o)if(i==null)r[n]=null;else{var l=o.match(wt(i));if(!l)return!1;var a=l.index+l[0].length;r[n]=o.slice(0,l.index)+(!l.index||a==o.length?"":" ")+o.slice(a)||null}else return!1;return!0})}),addLineWidget:ke(function(e,t,i){return Ls(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return wr(this,z(this,e),z(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=z(this,e),wr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=z(this,e);var t=[],i=M(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=z(this,e),t=z(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];!(s.to!=null&&n==e.line&&e.ch>=s.to||s.from==null&&n!=e.line||s.from!=null&&n==t.line&&s.from>=t.ch)&&(!i||i(s.marker))&&r.push(s.marker.parent||s.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var o=n.text.length+r;if(o>e)return t=e,!0;e-=o,++i}),z(this,y(i,t))},indexFromPos:function(e){e=z(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new Ge(Ji(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new Ge(Ji(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ts(r,Tl(this)),r},unlinkDoc:function(e){if(e instanceof se&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ms(Tl(this));break}}if(e.history==this.history){var r=[e.id];zt(e,function(n){return r.push(n.id)},!0),e.history=new Mi(null),e.history.done=mr(this.history.done,r),e.history.undone=mr(this.history.undone,r)}},iterLinkedDocs:function(e){zt(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Zi(e)},lineSeparator:function(){return this.lineSep||`
11`},setDirection:ke(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&gs(this.cm))})}),Ge.prototype.eachLine=Ge.prototype.iter;var Ml=0;function Ns(e){var t=this;if(Dl(t),!(we(t,e)||Nt(t.display,e))){Ue(e),F&&(Ml=+new Date);var i=jt(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,o=Array(n),l=0,a=function(){++l==n&&Le(t,function(){i=z(t.doc,i);var d={from:i,to:i,text:t.doc.splitLines(o.filter(function(v){return v!=null}).join(t.doc.lineSeparator())),origin:"paste"};br(t.doc,d),cl(t.doc,Rt(z(t.doc,i),z(t.doc,Bt(d))))})()},s=function(d,v){if(t.options.allowDropFileTypes&&W(t.options.allowDropFileTypes,d.type)==-1){a();return}var g=new FileReader;g.onerror=function(){return a()},g.onload=function(){var C=g.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(C)){a();return}o[v]=C,a()},g.readAsText(d)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Ai(t.doc,Rt(i,i)),h)for(var p=0;p<h.length;++p)xr(t.doc,"",h[p].anchor,h[p].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(d){}}}}function As(e,t){if(F&&(!e.state.draggingText||+new Date-Ml<100)){Wr(t);return}if(!(we(e,t)||Nt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!N)){var i=O("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",De&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),De&&i.parentNode.removeChild(i)}}function Os(e,t){var i=jt(e,t);if(!!i){var r=document.createDocumentFragment();Cn(e,i,r),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Be(e.display.dragCursor,r)}}function Dl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Nl(e){if(!!document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var o=0;o<i.length;o++)e(i[o])})}}var Al=!1;function Ws(){Al||(Ps(),Al=!0)}function Ps(){var e;H(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Nl(Es)},100))}),H(window,"blur",function(){return Nl(vr)})}function Es(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Kt={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"},ei=0;ei<10;ei++)Kt[ei+48]=Kt[ei+96]=String(ei);for(var Pi=65;Pi<=90;Pi++)Kt[Pi]=String.fromCharCode(Pi);for(var ti=1;ti<=12;ti++)Kt[ti+111]=Kt[ti+63235]="F"+ti;var Ot={};Ot.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"},Ot.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"},Ot.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"},Ot.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"]},Ot.default=j?Ot.macDefault:Ot.pcDefault;function Hs(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,o,l=0;l<t.length-1;l++){var a=t[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))n=!0;else throw new Error("Unrecognized modifier name: "+a)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Is(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=He(i.split(" "),Hs),o=0;o<n.length;o++){var l=void 0,a=void 0;o==n.length-1?(a=n.join(" "),l=r):(a=n.slice(0,o+1).join(" "),l="...");var s=t[a];if(!s)t[a]=l;else if(s!=l)throw new Error("Inconsistent bindings for "+a)}delete e[i]}for(var u in t)e[u]=t[u];return e}function Sr(e,t,i,r){t=Ei(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Sr(e,t.fallthrough,i,r);for(var o=0;o<t.fallthrough.length;o++){var l=Sr(e,t.fallthrough[o],i,r);if(l)return l}}}function Ol(e){var t=typeof e=="string"?e:Kt[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Wl(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Ye?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Ye?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Pl(e,t){if(De&&e.keyCode==34&&e.char)return!1;var i=Kt[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Wl(i,e,t))}function Ei(e){return typeof e=="string"?Ot[e]:e}function Lr(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var o=t(i[n]);r.length&&B(o.from,X(r).to)<=0;){var l=r.pop();if(B(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}Je(e,function(){for(var a=r.length-1;a>=0;a--)xr(e.doc,"",r[a].from,r[a].to,"+delete");gr(e)})}function In(e,t,i){var r=Et(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Fn(e,t,i){var r=In(e,t.ch,i);return r==null?null:new y(t.line,r,i<0?"after":"before")}function Rn(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var o=Tt(i,t.doc.direction);if(o){var l=n<0?X(o):o[0],a=n<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var f=cr(t,i);u=n<0?i.text.length-1:0;var h=bt(t,f,u).top;u=kt(function(p){return bt(t,f,p).top==h},n<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=In(i,u,1))}else u=n<0?l.to:l.from;return new y(r,u,s)}}return new y(r,n<0?i.text.length:0,n<0?"before":"after")}function Fs(e,t,i,r){var n=Tt(t,e.doc.direction);if(!n)return Fn(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var o=Or(n,i.ch,i.sticky),l=n[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>i.ch:l.from<i.ch))return Fn(t,i,r);var a=function(b,L){return In(t,b instanceof y?b.ch:b,L)},s,u=function(b){return e.options.lineWrapping?(s=s||cr(e,t),Ro(e,t,s,b)):{begin:0,end:t.text.length}},f=u(i.sticky=="before"?a(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var h=l.level==1==r<0,p=a(i,h?1:-1);if(p!=null&&(h?p<=l.to&&p<=f.end:p>=l.from&&p>=f.begin)){var d=h?"before":"after";return new y(i.line,p,d)}}var v=function(b,L,x){for(var k=function(le,Te){return Te?new y(i.line,a(le,1),"before"):new y(i.line,le,"after")};b>=0&&b<n.length;b+=L){var P=n[b],D=L>0==(P.level!=1),U=D?x.begin:a(x.end,-1);if(P.from<=U&&U<P.to||(U=D?P.from:a(P.to,-1),x.begin<=U&&U<x.end))return k(U,D)}},g=v(o+r,r,f);if(g)return g;var C=r>0?f.end:a(f.begin,-1);return C!=null&&!(r>0&&C==t.text.length)&&(g=v(r>0?0:n.length-1,r,u(C)),g)?g:null}var ri={selectAll:yl,singleSelection:function(e){return e.setSelection(e.getCursor("anch
11or"),e.getCursor("head"),oe)},killLine:function(e){return Lr(e,function(t){if(t.empty()){var i=M(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:y(t.head.line+1,0)}:{from:t.head,to:y(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Lr(e,function(t){return{from:y(t.from().line,0),to:z(e.doc,y(t.to().line+1,0))}})},delLineLeft:function(e){return Lr(e,function(t){return{from:y(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(y(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(y(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return El(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Hl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Rs(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},xe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},xe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Hl(e,t.head):r},xe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("	")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var o=i[n].from(),l=G(e.getLine(o.line),o.ch,r);t.push(pt(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Je(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(!!t[r].empty()){var n=t[r].head,o=M(e.doc,n.line).text;if(o){if(n.ch==o.length&&(n=new y(n.line,n.ch-1)),n.ch>0)n=new y(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),y(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var l=M(e.doc,n.line-1).text;l&&(n=new y(n.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),y(n.line-1,l.length-1),n,"+transpose"))}}i.push(new ee(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return Je(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);gr(e)})},openLine:function(e){return e.replaceSelection(`
12`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function El(e,t){var i=M(e.doc,t),r=lt(i);return r!=i&&(t=ie(r)),Rn(!0,e,r,t,1)}function Rs(e,t){var i=M(e.doc,t),r=xa(i);return r!=i&&(t=ie(r)),Rn(!0,e,i,t,-1)}function Hl(e,t){var i=El(e,t.line),r=M(e.doc,i.line),n=Tt(r,e.doc.direction);if(!n||n[0].level==0){var o=Math.max(i.ch,r.text.search(/\S/)),l=t.line==i.line&&t.ch<=o&&t.ch;return y(i.line,l?0:o,i.sticky)}return i}function Hi(e,t,i){if(typeof t=="string"&&(t=ri[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=te}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function Bs(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Sr(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&Sr(t,e.options.extraKeys,i,e)||Sr(t,e.options.keyMap,i,e)}var zs=new Z;function ii(e,t,i,r){var n=e.state.keySeq;if(n){if(Ol(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:zs.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),Il(e,n+" "+t,i,r))return!0}return Il(e,t,i,r)}function Il(e,t,i,r){var n=Bs(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&Se(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(Ue(i),bn(e)),!!n}function Fl(e,t){var i=Pl(t,!0);return i?t.shiftKey&&!e.state.keySeq?ii(e,"Shift-"+i,t,function(r){return Hi(e,r,!0)})||ii(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Hi(e,r)}):ii(e,i,t,function(r){return Hi(e,r)}):!1}function Us(e,t,i){return ii(e,"'"+i+"'",t,function(r){return Hi(e,r,!0)})}var Bn=null;function Rl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=qe(V(t)),!we(t,e))){F&&R<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Fl(t,e);De&&(Bn=r?i:null,!r&&i==88&&!oa&&(j?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),Y&&!j&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ks(t)}}
vendor: 47,481 bytes, lines 12-24
12function Ks(e){var t=e.display.lineDiv;dt(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(ft(t,"CodeMirror-crosshair"),Ve(document,"keyup",i),Ve(document,"mouseover",i))}H(document,"keyup",i),H(document,"mouseover",i)}function Bl(e){e.keyCode==16&&(this.doc.sel.shift=!1),we(this,e)}function zl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Nt(t.display,e)||we(t,e)||e.ctrlKey&&!e.altKey||j&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(De&&i==Bn){Bn=null,Ue(e);return}if(!(De&&(!e.which||e.which<10)&&Fl(t,e))){var n=String.fromCharCode(r==null?i:r);n!="\b"&&(Us(t,e,n)||t.display.input.onKeyPress(e))}}}var Gs=400,zn=function(e,t,i){this.time=e,this.pos=t,this.button=i};zn.prototype.compare=function(e,t,i){return this.time+Gs>e&&B(t,this.pos)==0&&i==this.button};var ni,oi;function _s(e,t){var i=+new Date;return oi&&oi.compare(i,e,t)?(ni=oi=null,"triple"):ni&&ni.compare(i,e,t)?(oi=new zn(i,e,t),ni=null,"double"):(ni=new zn(i,e,t),oi=null,"single")}function Ul(e){var t=this,i=t.display;if(!(we(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,Nt(i,e)){J||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Un(t,e)){var r=jt(t,e),n=jn(e),o=r?_s(r,n):"single";_(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Zs(t,n,r,o,e))&&(n==1?r?Ys(t,r,o,e):Ki(e)==i.scroller&&Ue(e):n==2?(r&&Ni(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(_t?t.display.input.onContextMenu(e):xn(t)))}}}function Zs(e,t,i,r,n){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,ii(e,Wl(o,n),n,function(l){if(typeof l=="string"&&(l=ri[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,i)!=te}finally{e.state.suppressEdits=!1}return a})}function Xs(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var o=fe?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=j?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(j?i.altKey:i.ctrlKey)),n}function Ys(e,t,i,r){F?setTimeout(I(Ko,e),0):e.curOp.focus=qe(V(e));var n=Xs(e,i,r),o=e.doc.sel,l;e.options.dragDrop&&ta&&!e.isReadOnly()&&i=="single"&&(l=o.contains(t))>-1&&(B((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(B(l.to(),t)>0||t.xRel<0)?qs(e,r,t,n):Qs(e,r,t,n)}function qs(e,t,i,r){var n=e.display,o=!1,l=Le(e,function(u){J&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:xn(e)),Ve(n.wrapper.ownerDocument,"mouseup",l),Ve(n.wrapper.ownerDocument,"mousemove",a),Ve(n.scroller,"dragstart",s),Ve(n.scroller,"drop",l),o||(Ue(u),r.addNew||Ni(e.doc,i,null,null,r.extend),J&&!N||F&&R==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};J&&(n.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,H(n.wrapper.ownerDocument,"mouseup",l),H(n.wrapper.ownerDocument,"mousemove",a),H(n.scroller,"dragstart",s),H(n.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function Kl(e,t,i){if(i=="char")return new ee(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new ee(y(t.line,0),z(e.doc,y(t.line+1,0)));var r=i(e,t);return new ee(r.from,r.to)}function Qs(e,t,i,r){F&&xn(e);var n=e.display,o=e.doc;Ue(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(i),a>-1?l=u[a]:l=new ee(i,i)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new ee(i,i)),i=jt(e,t,!0,!0),a=-1;else{var f=Kl(e,i,r.unit);r.extend?l=En(l,f.anchor,f.head,r.extend):l=f}r.addNew?a==-1?(a=u.length,We(o,st(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(We(o,st(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Hn(o,a,l,ze):(a=0,We(o,new $e([l],0),ze),s=o.sel);var h=i;function p(x){if(B(h,x)!=0)if(h=x,r.unit=="rectangle"){for(var k=[],P=e.options.tabSize,D=G(M(o,i.line).text,i.ch,P),U=G(M(o,x.line).text,x.ch,P),le=Math.min(D,U),Te=Math.max(D,U),he=Math.min(i.line,x.line),je=Math.min(e.lastLine(),Math.max(i.line,x.line));he<=je;he++){var _e=M(o,he).text,me=Ee(_e,le,P);le==Te?k.push(new ee(y(he,me),y(he,me))):_e.length>me&&k.push(new ee(y(he,me),y(he,Ee(_e,Te,P))))}k.length||k.push(new ee(i,i)),We(o,st(e,s.ranges.slice(0,a).concat(k),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(x)}else{var Ze=l,Ne=Kl(e,x,r.unit),be=Ze.anchor,Ce;B(Ne.anchor,be)>0?(Ce=Ne.head,be=ui(Ze.from(),Ne.anchor)):(Ce=Ne.anchor,be=si(Ze.to(),Ne.head));var de=s.ranges.slice(0);de[a]=Js(e,new ee(z(o,be),Ce)),We(o,st(e,de,a),ze)}}var d=n.wrapper.getBoundingClientRect(),v=0;function g(x){var k=++v,P=jt(e,x,!0,r.unit=="rectangle");if(!!P)if(B(P,h)!=0){e.curOp.focus=qe(V(e)),p(P);var D=Si(n,o);(P.line>=D.to||P.line<D.from)&&setTimeout(Le(e,function(){v==k&&g(x)}),150)}else{var U=x.clientY<d.top?-20:x.clientY>d.bottom?20:0;U&&setTimeout(Le(e,function(){v==k&&(n.scroller.scrollTop+=U,g(x))}),50)}}function C(x){e.state.selectingText=!1,v=Infinity,x&&(Ue(x),n.input.focus()),Ve(n.wrapper.ownerDocument,"mousemove",b),Ve(n.wrapper.ownerDocument,"mouseup",L),o.history.lastSelOrigin=null}var b=Le(e,function(x){x.buttons===0||!jn(x)?C(x):g(x)}),L=Le(e,C);e.state.selectingText=L,H(n.wrapper.ownerDocument,"mousemove",b),H(n.wrapper.ownerDocument,"mouseup",L)}function Js(e,t){var i=t.anchor,r=t.head,n=M(e.doc,i.line);if(B(i,r)==0&&i.sticky==r.sticky)return t;var o=Tt(n);if(!o)return t;var l=Or(o,i.ch,i.sticky),a=o[l];if(a.from!=i.ch&&a.to!=i.ch)return t;var s=l+(a.from==i.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=i.line)u=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=Or(o,r.ch,r.sticky),h=f-l||(r.ch-i.ch)*(a.level==1?-1:1);f==s-1||f==s?u=h<0:u=h>0}var p=o[s+(u?-1:0)],d=u==(p.level==1),v=d?p.from:p.to,g=d?"after":"before";return i.ch==v&&i.sticky==g?t:new ee(new y(i.line,v,g),r)}function Gl(e,t,i,r){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch(p){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ue(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!rt(e,i))return Ui(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=n){var f=qt(e.doc,o),h=e.display.gutterSpecs[s];return ge(e,i,e,f,h.className,t),Ui(t)}}}function Un(e,t){return Gl(e,t,"gutterClick",!0)}function _l(e,t){Nt(e.display,t)||js(e,t)||we(e,t,"contextmenu")||_t||e.display.input.onContextMenu(t)}function js(e,t){return rt(e,"gutterContextMenu")?Gl(e,t,"gutterContextMenu",!1):!1}function Zl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Br(e)}var kr={toString:function(){return"CodeMirror.Init"}},Xl={},Ii={};function Vs(e){var t=e.optionHandlers;function i(r,n,o,l){e.defaults[r]=n,o&&(t[r]=l?function(a,s,u){u!=kr&&o(a,s,u)}:o)}e.defineOption=i,e.Init=kr,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,On(r)},!0),i("indentUnit",2,On,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){Yr(r),Br(r),Ke(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var f=s.text.indexOf(n,u);if(f==-1)break;u=f+n.length,o.push(y(l,f))}l++});for(var a=o.length-1;a>=0;a--)xr(r.doc,n,o[a],y(o[a].line,o[a].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,o){r.state.specialChars=new RegExp(n.source+(n.test("	")?"":"|	"),"g"),o!=kr&&r.refresh()}),i("specialCharPlaceholder",Ma,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",w?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!lr),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Zl(r),Xr(r)},!0),i("keyMap","default",function(r,n,o){var l=Ei(n),a=o!=kr&&Ei(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,eu,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Nn(n,r.options.lineNumbers),Xr(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?yn(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return yr(r)},!0),i("scrollbarStyle","native",function(r){qo(r),yr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Nn(r.options.gutters,n),Xr(r)},!0),i("firstLineNumber",1,Xr,!0),i("lineNumberFormatter",function(r){return r},Xr,!0),i("showCursorWhenSelecting",!1,zr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(vr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,$s),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,zr,!0),i("singleCursorHeightPerLine",!0,zr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Yr,!0),i("addModeClass",!1,Yr,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,Yr,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function $s(e,t,i){var r=i&&i!=kr;if(!t!=!r){var n=e.display.dragFunctions,o=t?H:Ve;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function eu(e){e.options.lineWrapping?(dt(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ft(e.display.wrapper,"CodeMirror-wrap"),an(e)),mn(e),Ke(e),Br(e),setTimeout(function(){return yr(e)},100)}function se(e,t){var i=this;if(!(this instanceof se))return new se(e,t);this.options=t=t?Q(t):{},Q(Xl,t,!1);var r=t.value;typeof r=="string"?r=new Ge(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new se.inputStyles[t.inputStyle](this),o=this.display=new ds(e,r,n,t);o.wrapper.CodeMirror=this,Zl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},t.autofocus&&!w&&o.input.focus(),F&&R<11&&setTimeout(function(){return i.display.input.reset(!0)},20),tu(this),Ws(),tr(this),this.curOp.forceUpdate=!0,nl(this,r),t.autofocus&&!w||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&wn(i)},20):vr(this);for(var l in Ii)Ii.hasOwnProperty(l)&&Ii[l](this,t[l],kr);jo(this),t.finishInit&&t.finishInit(this);for(var a=0;a<Kn.length;++a)Kn[a](this);rr(this),J&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}se.defaults=Xl,se.optionHandlers=Ii;function tu(e){var t=e.display;H(t.scroller,"mousedown",Le(e,Ul)),F&&R<11?H(t.scroller,"dblclick",Le(e,function(s){if(!we(e,s)){var u=jt(e,s);if(!(!u||Un(e,s)||Nt(e.display,s))){Ue(s);var f=e.findWordAt(u);Ni(e.doc,f.anchor,f.head)}}})):H(t.scroller,"dblclick",function(s){return we(e,s)||Ue(s)}),H(t.scroller,"contextmenu",function(s){return _l(e,s)}),H(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||_l(e,s)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function l(s,u){if(u.left==null)return!0;var f=u.left-s.left,h=u.top-s.top;return f*f+h*h>20*20}H(t.scroller,"touchstart",function(s){if(!we(e,s)&&!o(s)&&!Un(e,s)){t.input.ensurePolled(),clearTimeout(i);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)}}),H(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),H(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Nt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var f=e.coordsChar(t.activeTouch,"page"),h;!u.prev||l(u,u.prev)?h=new ee(f,f):!u.prev.prev||l(u,u.prev.prev)?h=e.findWordAt(f):h=new ee(y(f.line,0),z(e.doc,y(f.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),Ue(s)}n()}),H(t.scroller,"touchcancel",n),H(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Kr(e,t.scroller.scrollTop),$t(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))}),H(t.scroller,"mousewheel",function(s){return el(e,s)}),H(t.scroller,"DOMMouseScroll",function(s){return el(e,s)}),H(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){we(e,s)||Wr(s)},over:function(s){we(e,s)||(Os(e,s),Wr(s))},start:function(s){return As(e,s)},drop:Le(e,Ns),leave:function(s){we(e,s)||Dl(e)}};var a=t.input.getField();H(a,"keyup",function(s){return Bl.call(e,s)}),H(a,"keydown",Le(e,Rl)),H(a,"keypress",Le(e,zl)),H(a,"focus",function(s){return wn(e,s)}),H(a,"blur",function(s){return vr(e,s)})}var Kn=[];se.defineInitHook=function(e){return Kn.push(e)};function li(e,t,i,r){var n=e.doc,o;i==null&&(i="add"),i=="smart"&&(n.mode.indent?o=Er(e,t).state:i="prev");var l=e.options.tabSize,a=M(n,t),s=G(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(a.text))f=0,i="not";else if(i=="smart"&&(f=n.mode.indent(o,a.text.slice(u.length),a.text),f==te||f>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?f=G(M(n,t-1).text,null,l):f=0:i=="add"?f=s+e.options.indentUnit:i=="subtract"?f=s-e.options.indentUnit:typeof i=="number"&&(f=s+i),f=Math.max(0,f);var h="",p=0;if(e.options.indentWithTabs)for(var d=Math.floor(f/l);d;--d)p+=l,h+="	";if(p<f&&(h+=pt(f-p)),h!=u)return xr(n,h,y(t,0),y(t,u.length),"+input"),a.stateAfter=null,!0;for(var v=0;v<n.sel.ranges.length;v++){var g=n.sel.ranges[v];if(g.head.line==t&&g.head.ch<u.length){var C=y(t,u.length);Hn(n,v,new ee(C,C));break}}}var ut=null;function Fi(e){ut=e}function Gn(e,t,i,r,n){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a=n=="paste"||e.state.pasteIncoming>l,s=Zi(t),u=null;if(a&&r.ranges.length>1)if(ut&&ut.text.join(`
13`)==t){if(r.ranges.length%ut.text.length==0){u=[];for(var f=0;f<ut.text.length;f++)u.push(o.splitLines(ut.text[f]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=He(s,function(b){return[b]}));for(var h=e.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var d=r.ranges[p],v=d.from(),g=d.to();d.empty()&&(i&&i>0?v=y(v.line,v.ch-i):e.state.overwrite&&!a?g=y(g.line,Math.min(M(o,g.line).text.length,g.ch+X(s).length)):a&&ut&&ut.lineWise&&ut.text.join(`
14`)==s.join(`
15`)&&(v=g=y(v.line,0)));var C={from:v,to:g,text:u?u[p%u.length]:s,origin:n||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};br(e.doc,C),Se(e,"inputRead",e,C)}t&&!a&&ql(e,t),gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Yl(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Je(t,function(){return Gn(t,i,0,null,"paste")}),!0}function ql(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var o=e.getModeAt(n.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=li(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(e.doc,n.head.line).text.slice(0,n.head.ch))&&(l=li(e,n.head.line,"smart"));l&&Se(e,"electricInput",e,n.head.line)}}}function Ql(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,o={anchor:y(n,0),head:y(n+1,0)};i.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:i}}function _n(e,t,i,r){e.setAttribute("autocorrect",i?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Jl(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return J?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),t}function ru(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){_(this).focus(),this.display.input.focus()},setOption:function(r,n){var o=this.options,l=o[r];o[r]==n&&r!="mode"||(o[r]=n,t.hasOwnProperty(r)&&Le(this,t[r])(this,n,l),ge(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"](Ei(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,o=0;o<n.length;++o)if(n[o]==r||n[o].name==r)return n.splice(o,1),!0},addOverlay:Ie(function(r,n){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");ot(this.state.overlays,{mode:o,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(l){return l.priority}),this.state.modeGen++,Ke(this)}),removeOverlay:Ie(function(r){for(var n=this.state.overlays,o=0;o<n.length;++o){var l=n[o].modeSpec;if(l==r||typeof r=="string"&&l.name==r){n.splice(o,1),this.state.modeGen++,Ke(this);return}}}),indentLine:Ie(function(r,n,o){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),Pr(this.doc,r)&&li(this,r,n,o)}),indentSelection:Ie(function(r){for(var n=this.doc.sel.ranges,o=-1,l=0;l<n.length;l++){var a=n[l];if(a.empty())a.head.line>o&&(li(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&gr(this));else{var s=a.from(),u=a.to(),f=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var h=f;h<o;++h)li(this,h,r);var p=this.doc.sel.ranges;s.ch==0&&n.length==p.length&&p[l].from().ch>0&&Hn(this.doc,l,new ee(s,p[l].to()),oe)}}}),getTokenAt:function(r,n){return oo(this,r,n)},getLineTokens:function(r,n){return oo(this,y(r),n,!0)},getTokenTypeAt:function(r){r=z(this.doc,r);var n=ro(this,M(this.doc,r.line)),o=0,l=(n.length-1)/2,a=r.ch,s;if(a==0)s=n[2];else for(;;){var u=o+l>>1;if((u?n[u*2-1]:0)>=a)l=u;else if(n[u*2+1]<a)o=u+1;else{s=n[u*2+2];break}}var f=s?s.indexOf("overlay "):-1;return f<0?s:f==0?null:s.slice(0,f-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var o=[];if(!i.hasOwnProperty(n))return o;var l=i[n],a=this.getModeAt(r);if(typeof a[n]=="string")l[a[n]]&&o.push(l[a[n]]);else if(a[n])for(var s=0;s<a[n].length;s++){var u=l[a[n][s]];u&&o.push(u)}else a.helperType&&l[a.helperType]?o.push(l[a.helperType]):l[a.name]&&o.push(l[a.name]);for(var f=0;f<l._global.length;f++){var h=l._global[f];h.pred(a,this)&&W(o,h.val)==-1&&o.push(h.val)}return o},getStateAfter:function(r,n){var o=this.doc;return r=$n(o,r==null?o.first+o.size-1:r),Er(this,r+1,n).state},cursorCoords:function(r,n){var o,l=this.doc.sel.primary();return r==null?o=l.head:typeof r=="object"?o=z(this.doc,r):o=r?l.from():l.to(),at(this,o,n||"page")},charCoords:function(r,n){return Ci(this,z(this.doc,r),n||"page")},coordsChar:function(r,n){return r=Ho(this,r,n||"page"),pn(this,r.left,r.top)},lineAtHeight:function(r,n){return r=Ho(this,{top:r,left:0},n||"page").top,qt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,o){var l=!1,a;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,l=!0),a=M(this.doc,r)}else a=r;return mi(this,a,{top:0,left:0},n||"page",o||l).top+(l?this.doc.height-Dt(a):0)},defaultTextHeight:function(){return dr(this.display)},defaultCharWidth:function(){return pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,o,l,a){var s=this.display;r=at(this,z(this.doc,r));var u=r.bottom,f=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),s.sizer.appendChild(n),l=="over")u=r.top;else if(l=="above"||l=="near"){var h=Math.max(s.wrapper.clientHeight,this.doc.height),p=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+n.offsetHeight>h)&&r.top>n.offsetHeight?u=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=h&&(u=r.bottom),f+n.offsetWidth>p&&(f=p-n.offsetWidth)}n.style.top=u+"px",n.style.left=n.style.right="",a=="right"?(f=s.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(a=="left"?f=0:a=="middle"&&(f=(s.sizer.clientWidth-n.offsetWidth)/2),n.style.left=f+"px"),o&&$a(this,{left:f,top:u,right:f+n.offsetWidth,bottom:u+n.offsetHeight})},triggerOnKeyDown:Ie(Rl),triggerOnKeyPress:Ie(zl),triggerOnKeyUp:Bl,triggerOnMouseDown:Ie(Ul),execCommand:function(r){if(ri.hasOwnProperty(r))return ri[r].call(null,this)},triggerElectric:Ie(function(r){ql(this,r)}),findPosH:function(r,n,o,l){var a=1;n<0&&(a=-1,n=-n);for(var s=z(this.doc,r),u=0;u<n&&(s=Zn(this.doc,s,a,o,l),!s.hitSide);++u);return s},moveH:Ie(function(r,n){var o=this;this.extendSelectionsBy(function(l){return o.display.shift||o.doc.extend||l.empty()?Zn(o.doc,l.head,r,n,o.options.rtlMoveVisually):r<0?l.from():l.to()},xe)}),deleteH:Ie(function(r,n){var o=this.doc.sel,l=this.doc;o.somethingSelected()?l.replaceSelection("",null,"+delete"):Lr(this,function(a){var s=Zn(l,a.head,r,n,!1);return r<0?{from:s,to:a.head}:{from:a.head,to:s}})}),findPosV:function(r,n,o,l){var a=1,s=l;n<0&&(a=-1,n=-n);for(var u=z(this.doc,r),f=0;f<n;++f){var h=at(this,u,"div");if(s==null?s=h.left:h.left=s,u=jl(this,h,a,o),u.hitSide)break}return u},moveV:Ie(function(r,n){var o=this,l=this.doc,a=[],s=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(f){if(s)return r<0?f.from():f.to();var h=at(o,f.head,"div");f.goalColumn!=null&&(h.left=f.goalColumn),a.push(h.left);var p=jl(o,h,r,n);return n=="page"&&f==l.sel.primary()&&Ln(o,Ci(o,p,"div").top-h.top),p},xe),a.length)for(var u=0;u<l.sel.ranges.length;u++)l.sel.ranges[u].goalColumn=a[u]}),findWordAt:function(r){var n=this.doc,o=M(n,r.line).text,l=r.ch,a=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||a==o.length)&&l?--l:++a;for(var u=o.charAt(l),f=Oe(u,s)?function(h){return Oe(h,s)}:/\s/.test(u)?function(h){return/\s/.test(h)}:function(h){return!/\s/.test(h)&&!Oe(h)};l>0&&f(o.charAt(l-1));)--l;for(;a<o.length&&f(o.charAt(a));)++a}return new ee(y(r.line,l),y(r.line,a))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?dt(this.display.cursorDiv,"CodeMirror-overwrite"):ft(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==qe(V(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ie(function(r,n){Ur(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ct(this)-this.display.barHeight,width:r.scrollWidth-Ct(this)-this.display.barWidth,clientHeight:fn(this),clientWidth:Qt(this)}},scrollIntoView:Ie(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:y(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?es(this,r):_o(this,r.from,r.to,r.margin)}),setSize:Ie(function(r,n){var o=this,l=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=l(r)),n!=null&&(this.display.wrapper.style.height=l(n)),this.options.lineWrapping&&Wo(this);var a=this.display.viewFrom;this.doc.iter(a,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){It(o,a,"widget");break}}++a}),this.curOp.forceUpdate=!0,ge(this,"refresh",this)}),operation:function(r){return Je(this,r)},startOperation:function(){return tr(this)},endOperation:function(){return rr(this)},refresh:Ie(function(){var r=this.display.cachedTextHeight;Ke(this),this.curOp.forceUpdate=!0,Br(this),Ur(this,this.doc.scrollLeft,this.doc.scrollTop),Mn(this.display),(r==null||Math.abs(r-dr(this.display))>.5||this.options.lineWrapping)&&mn(this),ge(this,"refresh",this)}),swapDoc:Ie(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),nl(this,r),Br(this),this.display.input.reset(),Ur(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Se(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ar(e),e.registerHelper=function(r,n,o){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=o},e.registerGlobalHelper=function(r,n,o,l){e.registerHelper(r,n,l),i[r]._global.push({pred:o,val:l})}}function Zn(e,t,i,r,n){var o=t,l=i,a=M(e,t.line),s=n&&e.direction=="rtl"?-i:i;function u(){var L=t.line+s;return L<e.first||L>=e.first+e.size?!1:(t=new y(L,t.ch,t.sticky),a=M(e,L))}function f(L){var x;if(r=="codepoint"){var k=a.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(k))x=null;else{var P=i>0?k>=55296&&k<56320:k>=56320&&k<57343;x=new y(t.line,Math.max(0,Math.min(a.text.length,t.ch+i*(P?2:1))),-i)}}else n?x=Fs(e.cm,a,t,i):x=Fn(a,t,i);if(x==null)if(!L&&u())t=Rn(n,e.cm,a,t.line,s);else return!1;else t=x;return!0}if(r=="char"||r=="codepoint")f();else if(r=="column")f(!0);else if(r=="word"||r=="group")for(var h=null,p=r=="group",d=e.cm&&e.cm.getHelper(t,"wordChars"),v=!0;!(i<0&&!f(!v));v=!1){var g=a.text.charAt(t.ch)||`
16`,C=Oe(g,d)?"w":p&&g==`
17`?"n":!p||/\s/.test(g)?null:"p";if(p&&!v&&!C&&(C="s"),h&&h!=C){i<0&&(i=1,f(),t.sticky="after");break}if(C&&(h=C),i>0&&!f(!v))break}var b=Oi(e,t,o,l,!0);return Vi(o,b)&&(b.hitSide=!0),b}function jl(e,t,i,r){var n=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,_(e).innerHeight||n(e).documentElement.clientHeight),s=Math.max(a-.5*dr(e.display),3);l=(i>0?t.bottom:t.top)+i*s}else r=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var u;u=pn(e,o,l),!!u.outside;){if(i<0?l<=0:l>=n.height){u.hitSide=!0;break}l+=i*5}return u}var ne=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ne.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,_n(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}H(n,"paste",function(a){!o(a)||we(r,a)||Yl(a,r)||R<=11&&setTimeout(Le(r,function(){return t.updateFromDOM()}),20)}),H(n,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),H(n,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),H(n,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),H(n,"touchstart",function(){return i.forceCompositionEnd()}),H(n,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||we(r,a))){if(r.somethingSelected())Fi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=Ql(r);Fi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,oe),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=ut.text.join(`
18`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var f=Jl(),h=f.firstChild;_n(h),r.display.lineSpace.insertBefore(f,r.display.lineSpace.firstChild),h.value=ut.text.join(`
19`);var p=qe(q(n));Zt(h),setTimeout(function(){r.display.lineSpace.removeChild(f),p.focus(),p==n&&i.showPrimarySelection()},50)}}H(n,"copy",l),H(n,"cut",l)},ne.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ne.prototype.prepareSelection=function(){var e=Uo(this.cm,!1);return e.focus=qe(q(this.div))==this.div,e},ne.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ne.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ne.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var o=Ri(t,e.anchorNode,e.anchorOffset),l=Ri(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&l&&!l.bad&&B(ui(o,l),r)==0&&B(si(o,l),n)==0)){var a=t.display.view,s=r.line>=t.display.viewFrom&&Vl(t,r)||{node:a[0].measure.map[2],offset:0},u=n.line<t.display.viewTo&&Vl(t,n);if(!u){var f=a[a.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!s||!u){e.removeAllRanges();return}var p=e.rangeCount&&e.getRangeAt(0),d;try{d=ht(s.node,s.offset,u.offset,u.node)}catch(v){}d&&(!Y&&t.state.focused?(e.collapse(s.node,s.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&e.anchorNode==null?e.addRange(p):Y&&this.startGracePeriod()),this.rememberSelection()}},ne.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)},ne.prototype.showMultipleSelections=function(e){Be(this.cm.display.cursorDiv,e.cursors),Be(this.cm.display.selectionDiv,e.selection)},ne.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ne.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return ct(this.div,t)},ne.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||qe(q(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ne.prototype.blur=function(){this.div.blur()},ne.prototype.getField=function(){return this.div},ne.prototype.supportsTouch=function(){return!0},ne.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Je(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function i(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,i))}this.polling.set(this.cm.options.pollInterval,i)},ne.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ne.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(T&&re&&this.cm.display.gutterSpecs.length&&iu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var i=Ri(t,e.anchorNode,e.anchorOffset),r=Ri(t,e.focusNode,e.focusOffset);i&&r&&Je(t,function(){We(t.doc,Rt(i,r),oe),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},ne.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=y(r.line-1,M(e.doc,r.line-1).length)),n.ch==M(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=y(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Vt(e,r.line))==0?(l=ie(t.view[0].line),a=t.view[0].node):(l=ie(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Vt(e,n.line),u,f;if(s==t.view.length-1?(u=t.viewTo-1,f=t.lineDiv.lastChild):(u=ie(t.view[s+1].line)-1,f=t.view[s+1].node.previousSibling),!a)return!1;for(var h=e.doc.splitLines(nu(e,a,f,l,u)),p=Yt(e.doc,y(l,0),y(u,M(e.doc,u).text.length));h.length>1&&p.length>1;)if(X(h)==X(p))h.pop(),p.pop(),u--;else if(h[0]==p[0])h.shift(),p.shift(),l++;else break;for(var d=0,v=0,g=h[0],C=p[0],b=Math.min(g.length,C.length);d<b&&g.charCodeAt(d)==C.charCodeAt(d);)++d;for(var L=X(h),x=X(p),k=Math.min(L.length-(h.length==1?d:0),x.length-(p.length==1?d:0));v<k&&L.charCodeAt(L.length-v-1)==x.charCodeAt(x.length-v-1);)++v;if(h.length==1&&p.length==1&&l==r.line)for(;d&&d>r.ch&&L.charCodeAt(L.length-v-1)==x.charCodeAt(x.length-v-1);)d--,v++;h[h.length-1]=L.slice(0,L.length-v).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var P=y(l,d),D=y(u,p.length?X(p).length-v:0);if(h.length>1||h[0]||B(P,D))return xr(e.doc,h,P,D,"+input"),!0},ne.prototype.ensurePolled=function(){this.forceCompositionEnd()},ne.prototype.reset=function(){this.forceCompositionEnd()},ne.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ne.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))},ne.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Je(this.cm,function(){return Ke(e.cm)})},ne.prototype.setUneditable=function(e){e.contentEditable="false"},ne.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Le(this.cm,Gn)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},ne.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ne.prototype.onContextMenu=function(){},ne.prototype.resetPosition=function(){},ne.prototype.needsContentAttribute=!0;function Vl(e,t){var i=hn(e,t.line);if(!i||i.hidden)return null;var r=M(e.doc,t.line),n=Mo(i,r,t.line),o=Tt(r,e.doc.direction),l="left";if(o){var a=Or(o,t.ch);l=a%2?"right":"left"}var s=Ao(n.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function iu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Tr(e,t){return t&&(e.bad=!0),e}function nu(e,t,i,r,n){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(d){return function(v){return v.id==d}}function f(){l&&(o+=a,s&&(o+=a),l=s=!1)}function h(d){d&&(f(),o+=d)}function p(d){if(d.nodeType==1){var v=d.getAttribute("cm-text");if(v){h(v);return}var g=d.getAttribute("cm-marker"),C;if(g){var b=e.findMarks(y(r,0),y(n+1,0),u(+g));b.length&&(C=b[0].find(0))&&h(Yt(e.doc,C.from,C.to).join(a));return}if(d.getAttribute("contenteditable")=="false")return;var L=/^(pre|div|p|li|table|br)$/i.test(d.nodeName);if(!/^br$/i.test(d.nodeName)&&d.textContent.length==0)return;L&&f();for(var x=0;x<d.childNodes.length;x++)p(d.childNodes[x]);/^(pre|p)$/i.test(d.nodeName)&&(s=!0),L&&(l=!0)}else d.nodeType==3&&h(d.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;p(t),t!=i;)t=t.nextSibling,s=!1;return o}function Ri(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Tr(e.clipPos(y(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var o=e.display.view[n];if(o.node==r)return ou(o,t,i)}}function ou(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!ct(r,t))return Tr(y(ie(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var o=e.rest?X(e.rest):e.line;return Tr(y(ie(o),o.text.length),n)}var l=t.nodeType==3?t:null,a=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,u=s.maps;function f(C,b,L){for(var x=-1;x<(u?u.length:0);x++)for(var k=x<0?s.map:u[x],P=0;P<k.length;P+=3){var D=k[P+2];if(D==C||D==b){var U=ie(x<0?e.line:e.rest[x]),le=k[P]+L;return(L<0||D!=C)&&(le=k[P+(L?1:0)]),y(U,le)}}}var h=f(l,a,i);if(h)return Tr(h,n);for(var p=a.nextSibling,d=l?l.nodeValue.length-i:0;p;p=p.nextSibling){if(h=f(p,p.firstChild,0),h)return Tr(y(h.line,h.ch-d),n);d+=p.textContent.length}for(var v=a.previousSibling,g=i;v;v=v.previousSibling){if(h=f(v,v.firstChild,-1),h)return Tr(y(h.line,h.ch+g),n);g+=v.textContent.length}}var pe=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null,this.resetting=!1};pe.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(n.style.width="0px"),H(n,"input",function(){F&&R>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),H(n,"paste",function(l){we(r,l)||Yl(l,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function o(l){if(!we(r,l)){if(r.somethingSelected())Fi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=Ql(r);Fi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,oe):(i.prevInput="",n.value=a.text.join(`
20`),Zt(n))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}H(n,"cut",o),H(n,"copy",o),H(e.scroller,"paste",function(l){if(!(Nt(e,l)||we(r,l))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,n.dispatchEvent(a)}}),H(e.lineSpace,"selectstart",function(l){Nt(e,l)||Ue(l)}),H(n,"compositionstart",function(){var l=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),H(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},pe.prototype.createField=function(e){this.wrapper=Jl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;_n(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},pe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},pe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Uo(e);if(e.options.moveInputWithCursor){var n=at(e,i.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+l.left-o.left))}return r},pe.prototype.showSelection=function(e){var t=this.cm,i=t.display;Be(i.cursorDiv,e.cursors),Be(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},pe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Zt(this.textarea),F&&R>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",F&&R>=9&&(this.hasSelection=null));this.resetting=!1}},pe.prototype.getField=function(){return this.textarea},pe.prototype.supportsTouch=function(){return!1},pe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!w||qe(q(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},pe.prototype.blur=function(){this.textarea.blur()},pe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},pe.prototype.receivedFocus=function(){this.slowPoll()},pe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},pe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},pe.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||na(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(F&&R>=9&&this.hasSelection===n||j&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,n.length);l<a&&r.charCodeAt(l)==n.charCodeAt(l);)++l;return Je(t,function(){Gn(t,n.slice(l),r.length-l,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
21`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},pe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},pe.prototype.onKeyPress=function(){F&&R>=9&&(this.hasSelection=null),this.fastPoll()},pe.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=jt(i,e),l=r.scroller.scrollTop;if(!o||De)return;var a=i.options.resetSelectionOnContextMenu;a&&i.doc.sel.contains(o)==-1&&Le(i,We)(i.doc,Rt(o),oe);var s=n.style.cssText,u=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
22      top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px;
23      z-index: 1000; background: `+(F?"rgba(255, 255, 255, .05)":"transparent")+`;
24      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;J&&(h=n.ownerDocument.defaultView.scrollY),r.input.focus(),J&&n.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=d,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function p(){if(n.selectionStart!=null){var g=i.somethingSelected(),C="\u200B"+(g?n.value:"");n.value="\u21DA",n.value=C,t.prevInput=g?"":"\u200B",n.selectionStart=1,n.selectionEnd=C.length,r.selForContextMenu=i.doc.sel}}function d(){if(t.contextMenuPending==d&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=s,F&&R<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),n.selectionStart!=null)){(!F||F&&R<9)&&p();var g=0,C=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Le(i,yl)(i):g++<10?r.detectingSelectAll=setTimeout(C,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(C,200)}}if(F&&R>=9&&p(),_t){Wr(e);var v=function(){Ve(window,"mouseup",v),setTimeout(d,20)};H(window,"mouseup",v)}else setTimeout(d,50)},pe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},pe.prototype.setUneditable=function(){},pe.prototype.needsContentAttribute=!1;function lu(e,t){if(t=t?Q(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=qe(q(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=a.getValue()}var n;if(e.form&&(H(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;n=o.submit;try{var l=o.submit=function(){r(),o.submit=n,o.submit(),o.submit=l}}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&&(Ve(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var a=se(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function au(e){e.off=Ve,e.on=H,e.wheelEventPixels=ps,e.Doc=Ge,e.splitLines=Zi,e.countColumn=G,e.findColumn=Ee,e.isWordChar=Qe,e.Pass=te,e.signal=ge,e.Line=fr,e.changeEnd=Bt,e.scrollbarModel=Yo,e.Pos=y,e.cmpPos=B,e.modes=Yi,e.mimeModes=sr,e.resolveMode=ai,e.getMode=qi,e.modeExtensions=ur,e.extendMode=ua,e.copyState=Xt,e.startState=Vn,e.innerMode=Qi,e.commands=ri,e.keyMap=Ot,e.keyName=Pl,e.isModifierKey=Ol,e.lookupKey=Sr,e.normalizeKeyMap=Is,e.StringStream=ye,e.SharedTextMarker=$r,e.TextMarker=Ut,e.LineWidget=Vr,e.e_preventDefault=Ue,e.e_stopPropagation=Jn,e.e_stop=Wr,e.addClass=dt,e.contains=ct,e.rmClass=ft,e.keyNames=Kt}Vs(se),ru(se);var su="iter insert remove copy getEditor constructor".split(" ");for(var Bi in Ge.prototype)Ge.prototype.hasOwnProperty(Bi)&&W(su,Bi)<0&&(se.prototype[Bi]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ge.prototype[Bi]));return ar(Ge),se.inputStyles={textarea:pe,contenteditable:ne},se.defineMode=function(e){!se.defaults.mode&&e!="null"&&(se.defaults.mode=e),aa.apply(this,arguments)},se.defineMIME=sa,se.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}
24),se.defineMIME("text/plain","null"),se.defineExtension=function(e,t){se.prototype[e]=t},se.defineDocExtension=function(e,t){Ge.prototype[e]=t},se.fromTextArea=lu,au(se),se.version="5.65.16",se})},63138:function(or,ue,K){(function(Y){Y(K(4631))})(function(Y){"use strict";Y.defineMode("spreadsheet",function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(A,ae){if(!!A){switch(ae.stack.length===0&&(A.peek()=='"'||A.peek()=="'")&&(ae.stringType=A.peek(),A.next(),ae.stack.unshift("string")),ae.stack[0]){case"string":for(;ae.stack[0]==="string"&&!A.eol();)A.peek()===ae.stringType?(A.next(),ae.stack.shift()):A.peek()==="\\"?(A.next(),A.next()):A.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;ae.stack[0]==="characterClass"&&!A.eol();)A.match(/^[^\]\\]+/)||A.match(/^\\./)||ae.stack.shift();return"operator"}var Re=A.peek();switch(Re){case"[":return A.next(),ae.stack.unshift("characterClass"),"bracket";case":":return A.next(),"operator";case"\\":return A.match(/\\[a-z]+/)?"string-2":(A.next(),"atom");case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return A.next(),"atom";case"$":return A.next(),"builtin"}return A.match(/\d+/)?A.match(/^\w+/)?"error":"number":A.match(/^[a-zA-Z_]\w*/)?A.match(/(?=[\(.])/,!1)?"keyword":"variable-2":["[","]","(",")","{","}"].indexOf(Re)!=-1?(A.next(),"bracket"):(A.eatSpace()||A.next(),null)}}}}),Y.defineMIME("text/x-spreadsheet","spreadsheet")})},29656:function(or,ue,K){"use strict";var Y;function A(){return A=Object.assign||function(N){for(var S=1;S<arguments.length;S++){var c=arguments[S];for(var m in c)Object.prototype.hasOwnProperty.call(c,m)&&(N[m]=c[m])}return N},A.apply(this,arguments)}function ae(N){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ae=function(c){return typeof c}:ae=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},ae(N)}var Re=function(){var N=function(c,m){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,w){T.__proto__=w}||function(T,w){for(var j in w)w.hasOwnProperty(j)&&(T[j]=w[j])},N(c,m)};return function(S,c){N(S,c);function m(){this.constructor=S}S.prototype=c===null?Object.create(c):(m.prototype=c.prototype,new m)}}();Y={value:!0},ue.Rt=Y=void 0;var F=K(67294),R=typeof navigator=="undefined"||typeof K.g!="undefined"&&K.g.PREVENT_CODEMIRROR_RENDER===!0,J;R||(J=K(4631));var E=function(){function N(){}return N.equals=function(S,c){var m=this,T=Object.keys,w=ae(S),j=ae(c);return S&&c&&w==="object"&&w===j?T(S).length===T(c).length&&T(S).every(function(fe){return m.equals(S[fe],c[fe])}):S===c},N}(),re=function(){function N(S,c){this.editor=S,this.props=c}return N.prototype.delegateCursor=function(S,c,m){var T=this.editor.getDoc();m&&this.editor.focus(),c?T.setCursor(S):T.setCursor(S,null,{scroll:!1})},N.prototype.delegateScroll=function(S){this.editor.scrollTo(S.x,S.y)},N.prototype.delegateSelection=function(S,c){var m=this.editor.getDoc();m.setSelections(S),c&&this.editor.focus()},N.prototype.apply=function(S){S&&S.selection&&S.selection.ranges&&this.delegateSelection(S.selection.ranges,S.selection.focus||!1),S&&S.cursor&&this.delegateCursor(S.cursor,S.autoScroll||!1,this.editor.getOption("autofocus")||!1),S&&S.scroll&&this.delegateScroll(S.scroll)},N.prototype.applyNext=function(S,c,m){S&&S.selection&&S.selection.ranges&&c&&c.selection&&c.selection.ranges&&!E.equals(S.selection.ranges,c.selection.ranges)&&this.delegateSelection(c.selection.ranges,c.selection.focus||!1),S&&S.cursor&&c&&c.cursor&&!E.equals(S.cursor,c.cursor)&&this.delegateCursor(m.cursor||c.cursor,c.autoScroll||!1,c.autoCursor||!1),S&&S.scroll&&c&&c.scroll&&!E.equals(S.scroll,c.scroll)&&this.delegateScroll(c.scroll)},N.prototype.applyUserDefined=function(S,c){c&&c.cursor&&this.delegateCursor(c.cursor,S.autoScroll||!1,this.editor.getOption("autofocus")||!1)},N.prototype.wire=function(S){var c=this;Object.keys(S||{}).filter(function(m){return/^on/.test(m)}).forEach(function(m){switch(m){case"onBlur":c.editor.on("blur",function(T,w){c.props.onBlur(c.editor,w)});break;case"onContextMenu":{c.editor.on("contextmenu",function(T,w){c.props.onContextMenu(c.editor,w)});break}case"onCopy":{c.editor.on("copy",function(T,w){c.props.onCopy(c.editor,w)});break}case"onCursor":c.editor.on("cursorActivity",function(T){c.props.onCursor(c.editor,c.editor.getDoc().getCursor())});break;case"onCursorActivity":c.editor.on("cursorActivity",function(T){c.props.onCursorActivity(c.editor)});break;case"onCut":{c.editor.on("cut",function(T,w){c.props.onCut(c.editor,w)});break}case"onDblClick":{c.editor.on("dblclick",function(T,w){c.props.onDblClick(c.editor,w)});break}case"onDragEnter":c.editor.on("dragenter",function(T,w){c.props.onDragEnter(c.editor,w)});break;case"onDragLeave":{c.editor.on("dragleave",function(T,w){c.props.onDragLeave(c.editor,w)});break}case"onDragOver":c.editor.on("dragover",function(T,w){c.props.onDragOver(c.editor,w)});break;case"onDragStart":{c.editor.on("dragstart",function(T,w){c.props.onDragStart(c.editor,w)});break}case"onDrop":c.editor.on("drop",function(T,w){c.props.onDrop(c.editor,w)});break;case"onFocus":c.editor.on("focus",function(T,w){c.props.onFocus(c.editor,w)});break;case"onGutterClick":c.editor.on("gutterClick",function(T,w,j,fe){c.props.onGutterClick(c.editor,w,j,fe)});break;case"onInputRead":c.editor.on("inputRead",function(T,w){c.props.onInputRead(c.editor,w)});break;
24case"onKeyDown":c.editor.on("keydown",function(T,w){c.props.onKeyDown(c.editor,w)});break;case"onKeyHandled":c.editor.on("keyHandled",function(T,w,j){c.props.onKeyHandled(c.editor,w,j)});break;case"onKeyPress":c.editor.on("keypress",function(T,w){c.props.onKeyPress(c.editor,w)});break;case"onKeyUp":c.editor.on("keyup",function(T,w){c.props.onKeyUp(c.editor,w)});break;case"onMouseDown":{c.editor.on("mousedown",function(T,w){c.props.onMouseDown(c.editor,w)});break}case"onPaste":{c.editor.on("paste",function(T,w){c.props.onPaste(c.editor,w)});break}case"onRenderLine":{c.editor.on("renderLine",function(T,w,j){c.props.onRenderLine(c.editor,w,j)});break}case"onScroll":c.editor.on("scroll",function(T){c.props.onScroll(c.editor,c.editor.getScrollInfo())});break;case"onSelection":c.editor.on("beforeSelectionChange",function(T,w){c.props.onSelection(c.editor,w)});break;case"onTouchStart":{c.editor.on("touchstart",function(T,w){c.props.onTouchStart(c.editor,w)});break}case"onUpdate":c.editor.on("update",function(T){c.props.onUpdate(c.editor)});break;case"onViewportChange":c.editor.on("viewportChange",function(T,w,j){c.props.onViewportChange(c.editor,w,j)});break}})},N}(),ve=function(N){Re(S,N);function S(c){var m=N.call(this,c)||this;return R||(m.applied=!1,m.appliedNext=!1,m.appliedUserDefined=!1,m.deferred=null,m.emulating=!1,m.hydrated=!1,m.initCb=function(){m.props.editorDidConfigure&&m.props.editorDidConfigure(m.editor)},m.mounted=!1),m}return S.prototype.hydrate=function(c){var m=this,T=c&&c.options?c.options:{},w=A({},J.defaults,this.editor.options,T),j=Object.keys(w).some(function(fe){return m.editor.getOption(fe)!==w[fe]});
24j&&Object.keys(w).forEach(function(fe){T.hasOwnProperty(fe)&&m.editor.getOption(fe)!==w[fe]&&(m.editor.setOption(fe,w[fe]),m.mirror.setOption(fe,w[fe]))}),this.hydrated||(this.deferred?this.resolveChange(c.value):this.initChange(c.value||"")),this.hydrated=!0},S.prototype.initChange=function(c){this.emulating=!0;var m=this.editor.getDoc(),T=m.lastLine(),w=m.getLine(m.lastLine()).length;m.replaceRange(c||"",{line:0,ch:0},{line:T,ch:w}),this.mirror.setValue(c),m.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},S.prototype.resolveChange=function(c){this.emulating=!0;var m=this.editor.getDoc();if(this.deferred.origin==="undo"?m.undo():this.deferred.origin==="redo"?m.redo():m.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),c&&c!==m.getValue()){var T=m.getCursor();m.setValue(c),m.setCursor(T)}this.emulating=!1,this.deferred=null},S.prototype.mirrorChange=function(c){var m=this.editor.getDoc();return c.origin==="undo"?(m.setHistory(this.mirror.getHistory()),this.mirror.undo()):c.origin==="redo"?(m.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(c.text,c.from,c.to,c.origin),this.mirror.getValue()},S.prototype.componentDidMount=function(){var c=this;R||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&J.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=J(this.ref,this.props.options),this.shared=new re(this.editor,this.props),this.mirror=J(function(){},this.props.options),this.editor.on("electricInput",function(){c.mirror.setHistory(c.editor.getDoc().getHistory())}),this.editor.on("cursorActivity",function(){c.mirror.setCursor(c.editor.getDoc().getCursor())}),this.editor.on("beforeChange",function(m,T){if(!c.emulating){T.cancel(),c.deferred=T;var w=c.mirrorChange(c.deferred);c.props.onBeforeChange&&c.props.onBeforeChange(c.editor,c.deferred,w)}}),this.editor.on("change",function(m,T){!c.mounted||c.props.onChange&&c.props.onChange(c.editor,T,c.editor.getValue())}),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},S.prototype.componentDidUpdate=function(c){if(!R){var m={cursor:null};this.props.value!==c.value&&(this.hydrated=!1),!this.props.autoCursor&&this.props.autoCursor!==void 0&&(m.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(c,this.props,m),this.appliedNext=!0),this.shared.applyUserDefined(c,m),this.appliedUserDefined=!0}},S.prototype.componentWillUnmount=function(){R||this.props.editorWillUnmount&&this.props.editorWillUnmount(J)},S.prototype.shouldComponentUpdate=function(c,m){return!R},S.prototype.render=function(){var c=this;if(R)return null;var m=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return F.createElement("div",{className:m,ref:function(w){return c.ref=w}})},S}(F.Component);Y=ve;var De=function(N){Re(S,N);function S(c){var m=N.call(this,c)||this;return R||(m.applied=!1,m.appliedUserDefined=!1,m.continueChange=!1,m.detached=!1,m.hydrated=!1,m.initCb=function(){m.props.editorDidConfigure&&m.props.editorDidConfigure(m.editor)},m.mounted=!1,m.onBeforeChangeCb=function(){m.continueChange=!0}),m}return S.prototype.hydrate=function(c){var m=this,T=c&&c.options?c.options:{},w=A({},J.defaults,this.editor.options,T),j=Object.keys(w).some(function(Ye){return m.editor.getOption(Ye)!==w[Ye]});
24if(j&&Object.keys(w).forEach(function(Ye){T.hasOwnProperty(Ye)&&m.editor.getOption(Ye)!==w[Ye]&&m.editor.setOption(Ye,w[Ye])}),!this.hydrated){var fe=this.editor.getDoc(),lr=fe.lastLine(),it=fe.getLine(fe.lastLine()).length;fe.replaceRange(c.value||"",{line:0,ch:0},{line:lr,ch:it})}this.hydrated=!0},S.prototype.componentDidMount=function(){var c=this;R||(this.detached=this.props.detach===!0,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&J.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=J(this.ref,this.props.options),this.shared=new re(this.editor,this.props),this.editor.on("beforeChange",function(m,T){c.props.onBeforeChange&&c.props.onBeforeChange(c.editor,T,c.editor.getValue(),c.onBeforeChangeCb)}),this.editor.on("change",function(m,T){!c.mounted||!c.props.onChange||(c.props.onBeforeChange?c.continueChange&&c.props.onChange(c.editor,T,c.editor.getValue()):c.props.onChange(c.editor,T,c.editor.getValue()))}),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},S.prototype.componentDidUpdate=function(c){if(this.detached&&this.props.detach===!1&&(this.detached=!1,c.editorDidAttach&&c.editorDidAttach(this.editor)),!this.detached&&this.props.detach===!0&&(this.detached=!0,c.editorDidDetach&&c.editorDidDetach(this.editor)),!(R||this.detached)){var m={cursor:null};this.props.value!==c.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),!c.autoCursor&&c.autoCursor!==void 0&&(m.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(c),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(c,m),this.appliedUserDefined=!0)}},S.prototype.componentWillUnmount=function(){R||this.props.editorWillUnmount&&this.props.editorWillUnmount(J)},S.prototype.shouldComponentUpdate=function(c,m){var T=!0;return R&&(T=!1),this.detached&&c.detach&&(T=!1),T},S.prototype.render=function(){var c=this;if(R)return null;var m=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return F.createElement("div",{className:m,ref:function(w){return c.ref=w}})},S}(F.Component);ue.Rt=De}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.