You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Detail__Reposit...

35 lines
194 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[261],{"7ahc":function(st,Ee,g){"use strict";g.d(Ee,"a",function(){return _e});var Y=g("k1fw"),pe=g("0Owb"),ue=g("+L6B"),Oe=g("2/Rp"),B=g("y8nQ"),P=g("Vl3Y"),D=g("tJVT"),Z=g("OaEy"),Q=g("2fM7"),Le=g("q1tI"),q=g.n(Le),F=g("VrN/"),lt=g.n(F),We=g("p77/"),Mt=g.n(We),nt=g("c5Ni"),gt=g.n(nt),Qe=Q.a.Option,xe={labelCol:{span:4},wrapperCol:{span:20}},Xe={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ee.b=function(ce){var Ae=ce.callback,Fe=ce.onCancel,Ue=Object(Le.useState)("python"),ve=Object(D.a)(Ue,2),me=ve[0],ie=ve[1];function k($){ie(Xe[$][1])}function le($){Ae($)}return q.a.createElement(P.a,Object(pe.a)({},xe,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:le}),q.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},q.a.createElement(Q.a,{onChange:k},Object.keys(Xe).map(function($){return q.a.createElement(Qe,{key:$,value:$},Xe[$][0])}))),q.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},q.a.createElement(_e,{mode:me})),q.a.createElement("div",{className:"flex-container flex-end"},q.a.createElement(Oe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),q.a.createElement(Oe.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function _e(ce){var Ae=ce.value,Fe=ce.onChange,Ue=ce.mode,ve=ce.options,me=ve===void 0?{}:ve,ie=Object(Le.useRef)(),k=Object(Le.useState)(),le=Object(D.a)(k,2),$=le[0],it=le[1];return Object(Le.useEffect)(function(){if($){function Ce(oe){var wt=oe.getValue();Fe&&Fe(wt)}return $.on("change",Ce),function(){$.off("change",Ce)}}},[$,Fe]),Object(Le.useEffect)(function(){$&&$.setOption("mode",Ue)},[$,Ue]),Object(Le.useEffect)(function(){$&&((Ae!==$.getValue()||Ae==="")&&setTimeout(function(){$.setValue(Ae||" ")},300))},[$,Ae]),Object(Le.useEffect)(function(){if(ie.current&&!$){var Ce=lt.a.fromTextArea(ie.current,Object(Y.a)({mode:Ue,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},me));it(Ce)}},[ie.current,$]),q.a.createElement("div",{className:"my-codemirror-container"},q.a.createElement("textarea",{ref:ie}))}},"9ZNV":function(st,Ee,g){"use strict";g.d(Ee,"a",function(){return Le});var Y=g("0Owb"),pe=g("+L6B"),ue=g("2/Rp"),Oe=g("q1tI"),B=g.n(Oe),P=g("UUDw"),D=g.n(P),Z=g("TSYQ"),Q=g.n(Z),Le=function(F){var lt=F.cancelText,We=lt===void 0?"\u53D6\u6D88":lt,Mt=F.okText,nt=Mt===void 0?"\u786E\u5B9A":Mt,gt=F.loading,Qe=gt===void 0?!1:gt,xe=F.hasOkBtn,Xe=xe===void 0?!0:xe,_e=F.okButtonProps,ce=_e===void 0?{}:_e,Ae=F.onCancel,Fe=Ae===void 0?function(){}:Ae,Ue=F.onOk,ve=Ue===void 0?function(){}:Ue,me=F.className,ie=me===void 0?"":me;return B.a.createElement("div",{className:Q()(D.a.buttonFixed,ie)},B.a.createElement("div",{className:D.a.buttonWrap},B.a.createElement(ue.a,{size:"large",className:"".concat(D.a.button," mr20"),onClick:Fe},We),Xe&&B.a.createElement(ue.a,Object(Y.a)({size:"large",type:"primary",className:"".concat(D.a.button," mr20"),loading:Qe,onClick:ve},ce),nt)))}},Gytx:function(st,Ee){st.exports=function(Y,pe,ue,Oe){var B=ue?ue.call(Oe,Y,pe):void 0;if(B!==void 0)return!!B;if(Y===pe)return!0;if(typeof Y!="object"||!Y||typeof pe!="object"||!pe)return!1;var P=Object.keys(Y),D=Object.keys(pe);if(P.length!==D.length)return!1;for(var Z=Object.prototype.hasOwnProperty.bind(pe),Q=0;Q<P.length;Q++){var Le=P[Q];if(!Z(Le))return!1;var q=Y[Le],F=pe[Le];if(B=ue?ue.call(Oe,q,F,Le):void 0,B===!1||B===void 0&&q!==F)return!1}return!0}},LdHM:function(st,Ee,g){"use strict";g.d(Ee,"b",function(){return Xe}),g.d(Ee,"a",function(){return ce});var Y=g("1OyB"),pe=g("vuIU"),ue=g("Ji7U"),Oe=g("LK+K"),B=g("q1tI"),P=g("rePB"),D=g("Ff2n"),Z=g("ODXe"),Q=g("4IlW"),Le=g("bX4T"),q=g("YrtM"),F=g("TSYQ"),lt=g.n(F),We=g("+nKL"),Mt=g("8OUc"),nt=function(M,j){var G=M.prefixCls,Ve=M.id,Ye=M.flattenOptions,C=M.childrenAsData,N=M.values,L=M.searchValue,O=M.multiple,b=M.defaultActiveFirstOption,W=M.height,T=M.itemHeight,H=M.notFoundContent,he=M.open,ne=M.menuItemSelectedIcon,De=M.virtual,Be=M.onSelect,ye=M.onToggleOpen,qe=M.onActiveValue,_t=M.onScroll,$e=M.onMouseEnter,te="".concat(G,"-item"),ge=Object(q.a)(function(){return Ye},[he,Ye],function(X,ee){return ee[0]&&X[1]!==ee[1]}),ut=B.useRef(null),xt=function(ee){ee.preventDefault()},mt=function(ee){ut.current&&ut.current.scrollTo({index:ee})},Et=function(ee){for(var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Te=ge.length,fe=0;fe<Te;fe+=1){var Re=(ee+fe*V+Te)%Te,Tt=ge[Re],kt=Tt.group,Pt=Tt.data;if(!kt&&!Pt.disabled)return Re}return-1},yr=B.useState(function(){return Et(0)}),ht=Object(Z.a)(yr,2),Lt=ht[0],R=ht[1],At=function(ee){R(ee);var V=ge[ee];if(!V){qe(null,-1);return}qe(V.data.value,ee)};B.useEffect(function(){At(b!==!1?Et(0):-1)},[ge.length,L]),B.useEffect(function(){var X=setTimeout(function(){if(!O&&he&&N.size===1){var ee=Array.from(N)[0],V=ge.findIndex(function(Te){var fe=Te.data;return fe.value===ee});At(V),mt(V)}});return function(){return clearTimeout(X)}},[he]);var et=function(ee){ee!==void 0&&Be(ee,{selected:!N.has(ee)}),O||ye(!1)};if(B.useImperativeHandle(j,function(){return{onKeyDown:function(ee){var V=ee.which;switch(V){case Q.a.UP:case Q.a.DOWN:{var Te=0;if(V===Q.a.UP?Te=-1:V===Q.a.DOWN&&(Te=1),Te!==0){var fe=Et(Lt+Te,Te);mt(fe),At(fe)}break}case Q.a.ENTER:{var Re=ge[Lt];Re&&!Re.data.disabled?et(Re.data.value):et(void 0),he&&ee.preventDefault();break}case Q.a.ESC:ye(!1)}},onKeyUp:function(){},scrollTo:function(ee){mt(ee)}}}),ge.length===0)return B.createElement("div",{role:"listbox",id:"".concat(Ve,"_list"),className:"".concat(te,"-empty"),onMouseDown:xt},H);function be(X){var ee=ge[X];if(!ee)return null;var V=ee.data||{},Te=V.value,fe=V.label,Re=V.children,Tt=Object(Le.a)(V,!0),kt=C?Re:fe;return ee?B.createElement("div",Object.assign({"aria-label":typeof kt=="string"?kt:null},Tt,{key:X,role:"option",id:"".concat(Ve,"_list_").concat(X),"aria-selected":N.has(Te)}),Te):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(Ve,"_list"),style:{height:0,width:0,overflow:"hidden"}},be(Lt-1),be(Lt),be(Lt+1)),B.createElement(We.a,{itemKey:"key",ref:ut,data:ge,height:W,itemHeight:T,fullHeight:!1,onMouseDown:xt,onScroll:_t,virtual:De,onMouseEnter:$e},function(X,ee){var V,Te=X.group,fe=X.groupOption,Re=X.data,Tt=Re.label,kt=Re.key;if(Te)return B.createElement("div",{className:lt()(te,"".concat(te,"-group"))},Tt!==void 0?Tt:kt);var Pt=Re.disabled,br=Re.value,qn=Re.title,Br=Re.children,$n=Re.style,Hr=Re.className,ei=Object(D.a)(Re,["disabled","value","title","children","style","className"]),It=N.has(br),Jt="".concat(te,"-option"),ti=lt()(te,Jt,Hr,(V={},Object(P.a)(V,"".concat(Jt,"-grouped"),fe),Object(P.a)(V,"".concat(Jt,"-active"),Lt===ee&&!Pt),Object(P.a)(V,"".concat(Jt,"-disabled"),Pt),Object(P.a)(V,"".concat(Jt,"-selected"),It),V)),jr=C?Br:Tt,ri=!ne||typeof ne=="function"||It;return B.createElement("div",Object.assign({},ei,{"aria-selected":It,className:ti,title:qn,onMouseMove:function(){if(Lt===ee||Pt)return;At(ee)},onClick:function(){Pt||et(br)},style:$n}),B.createElement("div",{className:"".concat(Jt,"-content")},jr||br),B.isValidElement(ne)||It,ri&&B.createElement(Mt.a,{className:"".concat(te,"-option-state"),customizeIcon:ne,customizeIconProps:{isSelected:It}},It?"\u2713":null))}))},gt=B.forwardRef(nt);gt.displayName="OptionList";var Qe=gt,xe=function(){return null};xe.isSelectOption=!0;var Xe=xe,_e=function(){return null};_e.isSelectOptGroup=!0;var ce=_e,Ae=g("VTBJ"),Fe=g("Zm9Q");function Ue(J){var M=J.key,j=J.props,G=j.children,Ve=j.value,Ye=Object(D.a)(j,["children","value"]);return Object(Ae.a)({key:M,value:Ve!==void 0?Ve:M,children:G},Ye)}function ve(J){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Fe.a)(J).map(function(j,G){if(!B.isValidElement(j)||!j.type)return null;var Ve=j.type.isSelectOptGroup,Ye=j.key,C=j.props,N=C.children,L=Object(D.a)(C,["children"]);return M||!Ve?Ue(j):Object(Ae.a)(Object(Ae.a)({key:"__RC_SELECT_GRP__".concat(Ye===null?G:Ye,"__"),label:Ye},L),{},{options:ve(N)})}).filter(function(j){return j})}var me=g("2Qr1"),ie=g("qNPg"),k=g("U8pU"),le=g("Kwbf"),$=g("WKfj");function it(J){var M=J.mode,j=J.options,G=J.children,Ve=J.backfill,Ye=J.allowClear,C=J.placeholder,N=J.getInputElement,L=J.showSearch,O=J.onSearch,b=J.defaultOpen,W=J.autoFocus,T=J.labelInValue,H=J.value,he=J.inputValue,ne=J.optionLabelProp,De=M==="multiple"||M==="tags",Be=L!==void 0?L:De||M==="combobox",ye=j||ve(G);if(Object(le.a)(M!=="tags"||ye.every(function(te){return!te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),M==="tags"||M==="combobox"){var qe=ye.some(function(te){return te.options?te.options.some(function(ge){return typeof("value"in ge?ge.value:ge.key)=="number"}):typeof("value"in te?te.value:te.key)=="number"});Object(le.a)(!qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(le.a)(M!=="combobox"||!ne,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(le.a)(M==="combobox"||!Ve,"`backfill` only works with `combobox` mode."),Object(le.a)(M==="combobox"||!N,"`getInputElement` only work with `combobox` mode."),Object(le.b)(M!=="combobox"||!N||!Ye||!C,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),O&&!Be&&M!=="combobox"&&M!=="tags"&&Object(le.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(le.b)(!b||W,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),H!=null){var _t=Object($.d)(H);Object(le.a)(!T||_t.every(function(te){return Object(k.a)(te)==="object"&&("key"in te||"value"in te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(le.a)(!De||Array.isArray(H),"`value` should be array when `mode` is `multiple` or `tags`")}if(G){var $e=null;Object(Fe.a)(G).some(function(te){if(!B.isValidElement(te)||!te.type)return!1;var ge=te.type;if(ge.isSelectOption)return!1;if(ge.isSelectOptGroup){var ut=Object(Fe.a)(te.props.children).every(function(xt){return!B.isValidElement(xt)||!te.type||xt.type.isSelectOption?!0:($e=xt.type,!1)});return!ut}return $e=ge,!0}),$e&&Object(le.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat($e.displayName||$e.name||$e,"`.")),Object(le.a)(he===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var Ce=it,oe=Object(ie.a)({prefixCls:"rc-select",components:{optionList:Qe},convertChildrenToData:ve,flattenOptions:me.d,getLabeledValue:me.e,filterOptions:me.b,isValueDisabled:me.g,findValueOption:me.c,warningProps:Ce,fillOptionsWithMissingValue:me.a}),wt=function(J){Object(ue.a)(j,J);var M=Object(Oe.a)(j);function j(){var G;return Object(Y.a)(this,j),G=M.apply(this,arguments),G.selectRef=B.createRef(),G.focus=function(){G.selectRef.current.focus()},G.blur=function(){G.selectRef.current.blur()},G}return Object(pe.a)(j,[{key:"render",value:function(){return B.createElement(oe,Object.assign({ref:this.selectRef},this.props))}}]),j}(B.Component);wt.Option=Xe,wt.OptGroup=ce;var Ot=wt,jt=Ee.c=Ot},UUDw:function(st,Ee,g){st.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/":function(st,Ee,g){(function(Y,pe){st.exports=pe()})(this,function(){"use strict";var Y=navigator.userAgent,pe=navigator.platform,ue=/gecko\/\d/i.test(Y),Oe=/MSIE \d/.test(Y),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Y),P=/Edge\/(\d+)/.exec(Y),D=Oe||B||P,Z=D&&(Oe?document.documentMode||6:+(P||B)[1]),Q=!P&&/WebKit\//.test(Y),Le=Q&&/Qt\/\d+\.\d+/.test(Y),q=!P&&/Chrome\//.test(Y),F=/Opera\//.test(Y),lt=/Apple Computer/.test(navigator.vendor),We=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Y),Mt=/PhantomJS/.test(Y),nt=!P&&/AppleWebKit/.test(Y)&&/Mobile\/\w+/.test(Y),gt=/Android/.test(Y),Qe=nt||gt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Y),xe=nt||/Mac/.test(pe),Xe=/\bCrOS\b/.test(Y),_e=/win/i.test(pe),ce=F&&Y.match(/Version\/(\d*\.\d*)/);ce&&(ce=Number(ce[1])),ce&&ce>=15&&(F=!1,Q=!0);var Ae=xe&&(Le||F&&(ce==null||ce<12.11)),Fe=ue||D&&Z>=9;function Ue(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ve=function(e,t){var n=e.className,r=Ue(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function me(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ie(e,t){return me(e).appendChild(t)}function k(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function le(e,t,n,r){var i=k(e,t,n,r);return i.setAttribute("role","presentation"),i}var $;document.createRange?$=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:$=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function it(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 Ce(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function oe(e,t){var n=e.className;Ue(t).test(n)||(e.className+=(n?" ":"")+t)}function wt(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Ue(n[r]).test(t)&&(t+=" "+n[r]);return t}var Ot=function(e){e.select()};nt?Ot=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(Ot=function(e){try{e.select()}catch(t){}});function jt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function J(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function M(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var s=e.indexOf(" ",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}var j=function(){this.id=null,this.f=null,this.time=0,this.handler=jt(this.onTimeout,this)};j.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},j.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function G(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ve=50,Ye={toString:function(){return"CodeMirror.Pass"}},C={scroll:!1},N={origin:"*mouse"},L={origin:"+move"};function O(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var b=[""];function W(e){for(;b.length<=e;)b.push(T(b)+" ");return b[e]}function T(e){return e[e.length-1]}function H(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function he(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ne(){}function De(e,t){var n;return Object.create?n=Object.create(e):(ne.prototype=e,n=new ne),t&&J(t,n),n}var Be=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ye(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Be.test(e))}function qe(e,t){return t?t.source.indexOf("\\w")>-1&&ye(e)?!0:t.test(e):ye(e)}function _t(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var $e=/[\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 te(e){return e.charCodeAt(0)>=768&&$e.test(e)}function ge(e,t,n){for(;(n<0?t>0:t<e.length)&&te(e.charAt(t));)t+=n;return t}function ut(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function xt(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var mt=null;function Et(e,t,n){var r;mt=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:mt=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:mt=i)}return r!=null?r:mt}var yr=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(u,h,f){this.level=u,this.from=h,this.to=f}return function(u,h){var f=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var c=u.length,d=[],p=0;p<c;++p)d.push(n(u.charCodeAt(p)));for(var v=0,y=f;v<c;++v){var w=d[v];w=="m"?d[v]=y:y=w}for(var S=0,x=f;S<c;++S){var E=d[S];E=="1"&&x=="r"?d[S]="n":o.test(E)&&(x=E,E=="r"&&(d[S]="R"))}for(var I=1,A=d[0];I<c-1;++I){var K=d[I];K=="+"&&A=="1"&&d[I+1]=="1"?d[I]="1":K==","&&A==d[I+1]&&(A=="1"||A=="n")&&(d[I]=A),A=K}for(var de=0;de<c;++de){var Ke=d[de];if(Ke==",")d[de]="N";else if(Ke=="%"){var Se=void 0;for(Se=de+1;Se<c&&d[Se]=="%";++Se);for(var bt=de&&d[de-1]=="!"||Se<c&&d[Se]=="1"?"1":"N",ct=de;ct<Se;++ct)d[ct]=bt;de=Se-1}}for(var Pe=0,pt=f;Pe<c;++Pe){var Je=d[Pe];pt=="L"&&Je=="1"?d[Pe]="L":o.test(Je)&&(pt=Je)}for(var ze=0;ze<c;++ze)if(i.test(d[ze])){var Ie=void 0;for(Ie=ze+1;Ie<c&&i.test(d[Ie]);++Ie);for(var ke=(ze?d[ze-1]:f)=="L",vt=(Ie<c?d[Ie]:f)=="L",Ur=ke==vt?ke?"L":"R":f,ir=ze;ir<Ie;++ir)d[ir]=Ur;ze=Ie-1}for(var rt=[],Ht,Ge=0;Ge<c;)if(a.test(d[Ge])){var qi=Ge;for(++Ge;Ge<c&&a.test(d[Ge]);++Ge);rt.push(new l(0,qi,Ge))}else{var Zt=Ge,gr=rt.length,mr=h=="rtl"?1:0;for(++Ge;Ge<c&&d[Ge]!="L";++Ge);for(var at=Zt;at<Ge;)if(s.test(d[at])){Zt<at&&(rt.splice(gr,0,new l(1,Zt,at)),gr+=mr);var zr=at;for(++at;at<Ge&&s.test(d[at]);++at);rt.splice(gr,0,new l(2,zr,at)),gr+=mr,Zt=at}else++at;Zt<Ge&&rt.splice(gr,0,new l(1,Zt,Ge))}return h=="ltr"&&(rt[0].level==1&&(Ht=u.match(/^\s+/))&&(rt[0].from=Ht[0].length,rt.unshift(new l(0,0,Ht[0].length))),T(rt).level==1&&(Ht=u.match(/\s+$/))&&(T(rt).to-=Ht[0].length,rt.push(new l(0,c-Ht[0].length,c)))),h=="rtl"?rt.reverse():rt}}();function ht(e,t){var n=e.order;return n==null&&(n=e.order=yr(e.text,t)),n}var Lt=[],R=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Lt).concat(n)}};function At(e,t){return e._handlers&&e._handlers[t]||Lt}function et(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=G(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function be(e,t){var n=At(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function X(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),be(e,n||t.type,e,t),Tt(t)||t.codemirrorIgnore}function ee(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)G(n,t[r])==-1&&n.push(t[r])}function V(e,t){return At(e,t).length>0}function Te(e){e.prototype.on=function(t,n){R(this,t,n)},e.prototype.off=function(t,n){et(this,t,n)}}function fe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Tt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function kt(e){fe(e),Re(e)}function Pt(e){return e.target||e.srcElement}function br(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),xe&&e.ctrlKey&&t==1&&(t=3),t}var qn=function(){if(D&&Z<9)return!1;var e=k("div");return"draggable"in e||"dragDrop"in e}(),Br;function $n(e){if(Br==null){var t=k("span","\u200B");ie(e,k("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Br=t.offsetWidth<=1&&t.offsetHeight>2&&!(D&&Z<8))}var n=Br?k("span","\u200B"):k("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Hr;function ei(e){if(Hr!=null)return Hr;var t=ie(e,document.createTextNode("A\u062EA")),n=$(t,0,1).getBoundingClientRect(),r=$(t,1,2).getBoundingClientRect();return me(e),!n||n.left==n.right?!1:Hr=r.right-n.right<3}var It=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Jt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ti=function(){var e=k("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jr=null;function ri(e){if(jr!=null)return jr;var t=ie(e,k("span","x")),n=t.getBoundingClientRect(),r=$(t,0,1).getBoundingClientRect();return jr=Math.abs(n.left-r.left)>1}var Kr={},wr={};function is(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Kr[e]=t}function os(e,t){wr[e]=t}function wn(e){if(typeof e=="string"&&wr.hasOwnProperty(e))e=wr[e];else if(e&&typeof e.name=="string"&&wr.hasOwnProperty(e.name)){var t=wr[e.name];typeof t=="string"&&(t={name:t}),e=De(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return wn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return wn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ni(e,t){t=wn(t);var n=Kr[t.name];if(!n)return ni(e,"text/plain");var r=n(e,t);if(xr.hasOwnProperty(t.name)){var i=xr[t.name];for(var o in i){if(!i.hasOwnProperty(o))continue;r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var xr={};function as(e,t){var n=xr.hasOwnProperty(e)?xr[e]:xr[e]={};J(t,n)}function or(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ii(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function eo(e,t,n){return e.startState?e.startState(t,n):!0}var Ne=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ne.prototype.eol=function(){return this.pos>=this.string.length},Ne.prototype.sol=function(){return this.pos==this.lineStart},Ne.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ne.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ne.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Ne.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ne.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ne.prototype.skipToEnd=function(){this.pos=this.string.length},Ne.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ne.prototype.backUp=function(e){this.pos-=e},Ne.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=M(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?M(this.string,this.lineStart,this.tabSize):0)},Ne.prototype.indentation=function(){return M(this.string,null,this.tabSize)-(this.lineStart?M(this.string,this.lineStart,this.tabSize):0)},Ne.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Ne.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ne.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ne.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ne.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function _(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function ar(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function oi(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Wt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ae(e){if(e.parent==null)return null;for(var t=e.parent,n=G(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function sr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],l=s.height;if(t<l)break;t-=l}return n+a}function Gr(e,t){return t>=e.first&&t<e.first+e.size}function ai(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function m(e,t,n){if(n===void 0&&(n=null),!(this instanceof m))return new m(e,t,n);this.line=e,this.ch=t,this.sticky=n}function U(e,t){return e.line-t.line||e.ch-t.ch}function si(e,t){return e.sticky==t.sticky&&U(e,t)==0}function li(e){return m(e.line,e.ch)}function xn(e,t){return U(e,t)<0?t:e}function Cn(e,t){return U(e,t)<0?e:t}function to(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 m(e.first,0);var n=e.first+e.size-1;return t.line>n?m(n,_(e,n).text.length):ss(t,_(e,t.line).text.length)}function ss(e,t){var n=e.ch;return n==null||n>t?m(e.line,t):n<0?m(e.line,0):e}function ro(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=z(e,t[r]);return n}var Sn=function(e,t){this.state=e,this.lookAhead=t},Ft=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ft.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}},Ft.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ft.fromSaved=function(e,t,n){return t instanceof Sn?new Ft(e,or(e.mode,t.state),n,t.lookAhead):new Ft(e,or(e.mode,t),n)},Ft.prototype.save=function(e){var t=e!==!1?or(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Sn(t,this.maxLookAhead):t};function no(e,t,n,r){var i=[e.state.modeGen],o={};uo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,s=function(u){n.baseTokens=i;var h=e.state.overlays[u],f=1,c=0;n.state=!0,uo(e,t.text,h.mode,n,function(d,p){for(var v=f;c<d;){var y=i[f];y>d&&i.splice(f,1,d,i[f+1],y),f+=2,c=Math.min(d,y)}if(!p)return;if(h.opaque)i.splice(v,f-v,d,"overlay "+p),f=v+2;else for(;v<f;v+=2){var w=i[v+1];i[v+1]=(w?w+" ":"")+"overlay "+p}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function io(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Xr(e,ae(t)),i=t.text.length>e.options.maxHighlightLength&&or(e.doc.mode,r.state),o=no(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xr(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ft(r,!0,t);var o=ls(e,t,n),a=o>r.first&&_(r,o-1).stateAfter,s=a?Ft.fromSaved(r,a,o):new Ft(r,eo(r.mode),o);return r.iter(o,t,function(l){ui(e,l.text,s);var u=s.line;l.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function ui(e,t,n,r){var i=e.doc.mode,o=new Ne(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&oo(i,n.state);!o.eol();)hi(i,o,n.state),o.start=o.pos}function oo(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=ii(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function hi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ii(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var ao=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function so(e,t,n,r){var i=e.doc,o=i.mode,a;t=z(i,t);var s=_(i,t.line),l=Xr(e,t.line,n),u=new Ne(s.text,e.options.tabSize,l),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=hi(o,u,l.state),r&&h.push(new ao(u,a,or(i.mode,l.state)));return r?h:new ao(u,a,l.state)}function lo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function uo(e,t,n,r,i,o,a){var s=n.flattenSpans;s==null&&(s=e.options.flattenSpans);var l=0,u=null,h=new Ne(t,e.options.tabSize,r),f,c=e.options.addModeClass&&[null];for(t==""&&lo(oo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,a&&ui(e,t,r,h.pos),h.pos=t.length,f=null):f=lo(hi(n,h,r.state,c),o),c){var d=c[0].name;d&&(f="m-"+(f?d+" "+f:d))}if(!s||u!=f){for(;l<h.start;)l=Math.min(h.start,l+5e3),i(l,u);u=f}h.start=h.pos}for(;l<h.pos;){var p=Math.min(h.pos,l+5e3);i(p,u),l=p}}function ls(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=_(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof Sn?u.lookAhead:0)<=o.modeFrontier))return s;var h=M(l.text,null,e.options.tabSize);(i==null||r>h)&&(i=s-1,r=h)}return i}function us(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=_(e,r).stateAfter;if(i&&(!(i instanceof Sn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var ho=!1,Kt=!1;function hs(){ho=!0}function fs(){Kt=!0}function En(e,t,n){this.marker=e,this.from=t,this.to=n}function Yr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function ds(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function cs(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ps(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new En(a,o.from,l?null:o.to))}}return r}function vs(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new En(a,l?null:o.from-t,o.to==null?null:o.to-t))}}return r}function fi(e,t){if(t.full)return null;var n=Gr(e,t.from.line)&&_(e,t.from.line).markedSpans,r=Gr(e,t.to.line)&&_(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=U(t.from,t.to)==0,s=ps(n,i,a),l=vs(r,o,a),u=t.text.length==1,h=T(t.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var c=s[f];if(c.to==null){var d=Yr(l,c.marker);d?u&&(c.to=d.to==null?null:d.to+h):c.to=i}}if(l)for(var p=0;p<l.length;++p){var v=l[p];if(v.to!=null&&(v.to+=h),v.from==null){var y=Yr(s,v.marker);y||(v.from=h,u&&(s||(s=[])).push(v))}else v.from+=h,u&&(s||(s=[])).push(v)}s&&(s=fo(s)),l&&l!=s&&(l=fo(l));var w=[s];if(!u){var S=t.text.length-2,x;if(S>0&&s)for(var E=0;E<s.length;++E)s[E].to==null&&(x||(x=[])).push(new En(s[E].marker,null,null));for(var I=0;I<S;++I)w.push(x);w.push(l)}return w}function fo(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function gs(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(d){if(d.markedSpans)for(var p=0;p<d.markedSpans.length;++p){var v=d.markedSpans[p].marker;v.readOnly&&(!r||G(r,v)==-1)&&(r||(r=[])).push(v)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(U(u.to,s.from)<0||U(u.from,s.to)>0)continue;var h=[l,1],f=U(u.from,s.from),c=U(u.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&h.push({from:u.from,to:s.from}),(c>0||!a.inclusiveRight&&!c)&&h.push({from:s.to,to:u.to}),i.splice.apply(i,h),l+=h.length-3}return i}function co(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function po(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Ln(e){return e.inclusiveLeft?-1:0}function Tn(e){return e.inclusiveRight?1:0}function di(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=U(r.from,i.from)||Ln(e)-Ln(t);if(o)return-o;var a=U(r.to,i.to)||Tn(e)-Tn(t);return a||t.id-e.id}function vo(e,t){var n=Kt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||di(r,i.marker)<0)&&(r=i.marker);return r}function go(e){return vo(e,!0)}function kn(e){return vo(e,!1)}function ms(e,t){var n=Kt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||di(r,o.marker)<0)&&(r=o.marker)}return r}function mo(e,t,n,r,i){var o=_(e,t),a=Kt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(!l.marker.collapsed)continue;var u=l.marker.find(0),h=U(u.from,n)||Ln(l.marker)-Ln(i),f=U(u.to,r)||Tn(l.marker)-Tn(i);if(h>=0&&f<=0||h<=0&&f>=0)continue;if(h<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?U(u.to,n)>=0:U(u.to,n)>0)||h>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?U(u.from,r)<=0:U(u.from,r)<0))return!0}}function Ut(e){for(var t;t=go(e);)e=t.find(-1,!0).line;return e}function ys(e){for(var t;t=kn(e);)e=t.find(1,!0).line;return e}function bs(e){for(var t,n;t=kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ci(e,t){var n=_(e,t),r=Ut(n);return n==r?t:ae(r)}function yo(e,t){if(t>e.lastLine())return t;var n=_(e,t),r;if(!Qt(e,n))return t;for(;r=kn(n);)n=r.find(1,!0).line;return ae(n)+1}function Qt(e,t){var n=Kt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&pi(e,t,r))return!0}}function pi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return pi(e,r.line,Yr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&pi(e,t,i))return!0}function Gt(e){e=Ut(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Mn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=go(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function vi(e){var t=e.display,n=e.doc;t.maxLine=_(n,n.first),t.maxLineLength=Mn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Mn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Cr=function(e,t,n){this.text=e,po(this,t),this.height=n?n(this):1};Cr.prototype.lineNo=function(){return ae(this)},Te(Cr);function ws(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),co(e),po(e,n);var i=r?r(e):1;i!=e.height&&Wt(e,i)}function xs(e){e.parent=null,co(e)}var Cs={},Ss={};function bo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ss:Cs;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function wo(e,t){var n=le("span",null,null,Q?"padding-right: .1px":null),r={pre:le("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Ls,ei(e.display.measure)&&(a=ht(o,e.doc.direction))&&(r.addToken=ks(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&ae(o);Ms(o,r,io(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=wt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=wt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild($n(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Q){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return be(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=wt(r.pre.className,r.textClass||"")),r}function Es(e){var t=k("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ls(e,t,n,r,i,o,a){if(!t)return;var s=e.splitSpaces?Ts(t,e.trailingSpace):t,l=e.cm.state.specialChars,u=!1,h;if(!l.test(t))e.col+=t.length,h=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,h),D&&Z<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var f=0;;){l.lastIndex=f;var c=l.exec(t),d=c?c.index-f:t.length-f;if(d){var p=document.createTextNode(s.slice(f,f+d));D&&Z<9?h.appendChild(k("span",[p])):h.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!c)break;f+=d+1;var v=void 0;if(c[0]==" "){var y=e.cm.options.tabSize,w=y-e.col%y;v=h.appendChild(k("span",W(w),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text"," "),e.col+=w}else c[0]=="\r"||c[0]==`
`?(v=h.appendChild(k("span",c[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),v.setAttribute("cm-text",c[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(c[0]),v.setAttribute("cm-text",c[0]),D&&Z<9?h.appendChild(k("span",[v])):h.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var S=n||"";r&&(S+=r),i&&(S+=i);var x=k("span",[h],S,o);if(a)for(var E in a)a.hasOwnProperty(E)&&E!="style"&&E!="class"&&x.setAttribute(E,a[E]);return e.content.appendChild(x)}e.content.appendChild(h)}function Ts(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="\xA0"),r+=o,n=o==" "}return r}function ks(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+r.length;;){for(var f=void 0,c=0;c<t.length&&!(f=t[c],f.to>u&&f.from<=u);c++);if(f.to>=h)return e(n,r,i,o,a,s,l);e(n,r.slice(0,f.to-u),i,o,null,s,l),o=null,r=r.slice(f.to-u),u=f.to}}}function xo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ms(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),bo(n[a+1],t.cm.options));return}for(var s=i.length,l=0,u=1,h="",f,c,d=0,p,v,y,w,S;;){if(d==l){p=v=y=c="",S=null,w=null,d=Infinity;for(var x=[],E=void 0,I=0;I<r.length;++I){var A=r[I],K=A.marker;if(K.type=="bookmark"&&A.from==l&&K.widgetNode)x.push(K);else if(A.from<=l&&(A.to==null||A.to>l||K.collapsed&&A.to==l&&A.from==l)){if(A.to!=null&&A.to!=l&&d>A.to&&(d=A.to,v=""),K.className&&(p+=" "+K.className),K.css&&(c=(c?c+";":"")+K.css),K.startStyle&&A.from==l&&(y+=" "+K.startStyle),K.endStyle&&A.to==d&&(E||(E=[])).push(K.endStyle,A.to),K.title&&((S||(S={})).title=K.title),K.attributes)for(var de in K.attributes)(S||(S={}))[de]=K.attributes[de];K.collapsed&&(!w||di(w.marker,K)<0)&&(w=A)}else A.from>l&&d>A.from&&(d=A.from)}if(E)for(var Ke=0;Ke<E.length;Ke+=2)E[Ke+1]==d&&(v+=" "+E[Ke]);if(!w||w.from==l)for(var Se=0;Se<x.length;++Se)xo(t,0,x[Se]);if(w&&(w.from||0)==l){if(xo(t,(w.to==null?s+1:w.to)-l,w.marker,w.from==null),w.to==null)return;w.to==l&&(w=!1)}}if(l>=s)break;for(var bt=Math.min(s,d);;){if(h){var ct=l+h.length;if(!w){var Pe=ct>bt?h.slice(0,bt-l):h;t.addToken(t,Pe,f?f+p:p,y,l+Pe.length==d?v:"",c,S)}if(ct>=bt){h=h.slice(bt-l),l=bt;break}l=ct,y=""}h=i.slice(o,o=n[u++]),f=bo(n[u++],t.cm.options)}}}function Co(e,t,n){this.line=t,this.rest=bs(t),this.size=this.rest?ae(T(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Qt(e,t)}function On(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Co(e.doc,_(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Sr=null;function Os(e){Sr?Sr.ops.push(e):e.ownsGroup=Sr={ops:[e],delayedCallbacks:[]}}function _s(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function As(e,t){var n=e.ownsGroup;if(!n)return;try{_s(n)}finally{Sr=null,t(n)}}var Zr=null;function Ze(e,t){var n=At(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;Sr?i=Sr.delayedCallbacks:Zr?i=Zr:(i=Zr=[],setTimeout(Ds,0));for(var o=function(s){i.push(function(){return n[s].apply(null,r)})},a=0;a<n.length;++a)o(a)}function Ds(){var e=Zr;Zr=null;for(var t=0;t<e.length;++t)e[t]()}function So(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ns(e,t):o=="gutter"?Lo(e,t,n,r):o=="class"?gi(e,t):o=="widget"&&Ps(e,t,r)}t.changes=null}function Jr(e){return e.node==e.text&&(e.node=k("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),D&&Z<8&&(e.node.style.zIndex=2)),e.node}function Rs(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Jr(t);t.background=r.insertBefore(k("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Eo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):wo(e,t)}function Ns(e,t){var n=t.text.className,r=Eo(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,gi(e,t)):n&&(t.text.className=n)}function gi(e,t){Rs(e,t),t.line.wrapClass?Jr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Lo(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Jr(t);t.gutterBackground=k("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Jr(t),s=t.gutter=k("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=s.appendChild(k("div",ai(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,h=o.hasOwnProperty(u)&&o[u];h&&s.appendChild(k("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ps(e,t,n){t.alignable&&(t.alignable=null);for(var r=Ue("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);To(e,t,n)}function Is(e,t,n,r){var i=Eo(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),gi(e,t),Lo(e,t,n,r),To(e,t,r),t.node}function To(e,t,n){if(ko(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)ko(e,t.rest[r],t,n,!1)}function ko(e,t,n,r,i){if(!t.widgets)return;for(var o=Jr(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],u=k("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ws(l,u,n,r),e.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Ze(l,"redraw")}}function Ws(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Qr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!it(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),ie(t.display.measure,k("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Xt(e,t){for(var n=Pt(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function _n(e){return e.lineSpace.offsetTop}function mi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Mo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ie(e.measure,k("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function zt(e){return Ve-e.display.nativeBarWidth}function lr(e){return e.display.scroller.clientWidth-zt(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-zt(e)-e.display.barHeight}function Fs(e,t,n){var r=e.options.lineWrapping,i=r&&lr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Oo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ae(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Us(e,t){t=Ut(t);var n=ae(t),r=e.display.externalMeasured=new Co(e.doc,t,n);r.lineN=n;var i=r.built=wo(e,r);return r.text=i.pre,ie(e.display.lineMeasure,i.pre),r}function _o(e,t,n,r){return Bt(e,Er(e,t),n,r)}function bi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[fr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Er(e,t){var n=ae(t),r=bi(e,n);r&&!r.text?r=null:r&&r.changes&&(So(e,r,n,Li(e)),e.curOp.forceUpdate=!0),r||(r=Us(e,t));var i=Oo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Bt(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Fs(e,t.view,t.rect),t.hasHeights=!0),a=Bs(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Ao={left:0,right:0,top:0,bottom:0};function Do(e,t,n){for(var r,i,o,a,s,l,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(i=0,o=1,a="left"):t<l?(i=t-s,o=i+1):(u==e.length-3||t==l&&e[u+3]>t)&&(o=l-s,i=o-1,t>=l&&(a="right")),i!=null){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function zs(e,t){var n=Ao;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function Bs(e,t,n,r){var i=Do(t.map,n,r),o=i.node,a=i.start,s=i.end,l=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&te(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+s<i.coverEnd&&te(t.line.text.charAt(i.coverStart+s));)++s;if(D&&Z<9&&a==0&&s==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=zs($(o,a,s).getClientRects(),r),u.left||u.right||a==0)break;s=a,a=a-1,l="right"}D&&Z<11&&(u=Hs(e.display.measure,u))}else{a>0&&(l=r="right");var f;e.options.lineWrapping&&(f=o.getClientRects()).length>1?u=f[r=="right"?f.length-1:0]:u=o.getBoundingClientRect()}if(D&&Z<9&&!a&&(!u||!u.left&&!u.right)){var c=o.parentNode.getClientRects()[0];c?u={left:c.left,right:c.left+Tr(e.display),top:c.top,bottom:c.bottom}:u=Ao}for(var d=u.top-t.rect.top,p=u.bottom-t.rect.top,v=(d+p)/2,y=t.view.measure.heights,w=0;w<y.length-1&&!(v<y[w]);w++);var S=w?y[w-1]:0,x=y[w],E={left:(l=="right"?u.right:u.left)-t.rect.left,right:(l=="left"?u.left:u.right)-t.rect.left,top:S,bottom:x};return!u.left&&!u.right&&(E.bogus=!0),e.options.singleCursorHeightPerLine||(E.rtop=d,E.rbottom=p),E}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ri(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Ro(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 No(e){e.display.externalMeasure=null,me(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ro(e.display.view[t])}function Vr(e){No(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Po(){return q&&gt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Io(){return q&&gt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wi(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Qr(e.widgets[n]));return t}function An(e,t,n,r,i){if(!i){var o=wi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=Gt(t);if(r=="local"?a+=_n(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+(r=="window"?0:Io());var l=s.left+(r=="window"?0:Po());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Wo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Po(),i-=Io();else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function xi(e,t,n,r,i){return r||(r=_(e.doc,t.line)),An(e,r,_o(e,r,t.ch,i),n)}function Dt(e,t,n,r,i,o){r=r||_(e.doc,t.line),i||(i=Er(e,r));function a(p,v){var y=Bt(e,i,p,v?"right":"left",o);return v?y.left=y.right:y.right=y.left,An(e,r,y,n)}var s=ht(r,e.doc.direction),l=t.ch,u=t.sticky;if(l>=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a(u=="before"?l-1:l,u=="before");function h(p,v,y){var w=s[v],S=w.level==1;return a(y?p-1:p,S!=y)}var f=Et(s,l,u),c=mt,d=h(l,f,u=="before");return c!=null&&(d.other=h(l,c,u!="before")),d}function Fo(e,t){var n=0;t=z(e.doc,t),e.options.lineWrapping||(n=Tr(e.display)*t.ch);var r=_(e.doc,t.line),i=Gt(r)+_n(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ci(e,t,n,r,i){var o=m(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Si(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ci(r.first,0,null,-1,-1);var i=sr(r,n),o=r.first+r.size-1;if(i>o)return Ci(r.first+r.size-1,_(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=_(r,i);;){var s=js(e,a,i,t,n),l=ms(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=_(r,i=u.line)}}function Uo(e,t,n,r){r-=wi(t);var i=t.text.length,o=ut(function(a){return Bt(e,n,a-1).bottom<=r},i,0);return i=ut(function(a){return Bt(e,n,a).top>r},o,i),{begin:o,end:i}}function zo(e,t,n,r){n||(n=Er(e,t));var i=An(e,t,Bt(e,n,r),"line").top;return Uo(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function js(e,t,n,r,i){i-=Gt(t);var o=Er(e,t),a=wi(t),s=0,l=t.text.length,u=!0,h=ht(t,e.doc.direction);if(h){var f=(e.options.lineWrapping?Gs:Ks)(e,t,n,o,h,r,i);u=f.level!=1,s=u?f.from:f.to-1,l=u?f.to:f.from-1}var c=null,d=null,p=ut(function(I){var A=Bt(e,o,I);return A.top+=a,A.bottom+=a,Ei(A,r,i,!1)?(A.top<=i&&A.left<=r&&(c=I,d=A),!0):!1},s,l),v,y,w=!1;if(d){var S=r-d.left<d.right-r,x=S==u;p=c+(x?0:1),y=x?"after":"before",v=S?d.left:d.right}else{!u&&(p==l||p==s)&&p++,y=p==0?"after":p==t.text.length?"before":Bt(e,o,p-(u?1:0)).bottom+a<=i==u?"after":"before";var E=Dt(e,m(n,p,y),"line",t,o);v=E.left,w=i<E.top?-1:i>=E.bottom?1:0}return p=ge(t.text,p,1),Ci(n,p,y,w,r-v)}function Ks(e,t,n,r,i,o,a){var s=ut(function(f){var c=i[f],d=c.level!=1;return Ei(Dt(e,m(n,d?c.to:c.from,d?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var u=l.level!=1,h=Dt(e,m(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Ei(h,o,a,!0)&&h.top>a&&(l=i[s-1])}return l}function Gs(e,t,n,r,i,o,a){var s=Uo(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,f=null,c=0;c<i.length;c++){var d=i[c];if(d.from>=u||d.to<=l)continue;var p=d.level!=1,v=Bt(e,r,p?Math.min(u,d.to)-1:Math.max(l,d.from)).right,y=v<o?o-v+1e9:v-o;(!h||f>y)&&(h=d,f=y)}return h||(h=i[i.length-1]),h.from<l&&(h={from:l,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var ur;function Lr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ur==null){ur=k("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ur.appendChild(document.createTextNode("x")),ur.appendChild(k("br"));ur.appendChild(document.createTextNode("x"))}ie(e.measure,ur);var n=ur.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),me(e.measure),n||1}function Tr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k("span","xxxxxxxxxx"),n=k("pre",[t],"CodeMirror-line-like");ie(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Li(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Ti(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ti(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bo(e){var t=Lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Tr(e.display)-3);return function(i){if(Qt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function ki(e){var t=e.doc,n=Bo(e);t.iter(function(r){var i=n(r);i!=r.height&&Wt(r,i)})}function hr(e,t,n,r){var i=e.display;if(!n&&Pt(t).getAttribute("cm-not-content")=="true")return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(f){return null}var l=Si(e,o,a),u;if(r&&l.xRel>0&&(u=_(e.doc,l.line).text).length==l.ch){var h=M(u,u.length,e.options.tabSize)-u.length;l=m(l.line,Math.max(0,Math.round((o-Mo(e.display).left)/Tr(e.display))-h))}return l}function fr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function ft(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Kt&&ci(e.doc,t)<i.viewTo&&qt(e);else if(n<=i.viewFrom)Kt&&yo(e.doc,n+r)>i.viewFrom?qt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)qt(e);else if(t<=i.viewFrom){var o=Dn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):qt(e)}else if(n>=i.viewTo){var a=Dn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):qt(e)}else{var s=Dn(e,t,t,-1),l=Dn(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(On(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):qt(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Vt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var o=r.view[fr(e,t)];if(o.node==null)return;var a=o.changes||(o.changes=[]);G(a,n)==-1&&a.push(n)}function qt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Dn(e,t,n,r){var i=fr(e,t),o,a=e.display.view;if(!Kt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(r>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,n+=o}for(;ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Xs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=On(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=On(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(fr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(On(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,fr(e,n)))),r.viewTo=n}function Ho(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function qr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function jo(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){if(!t&&a==n.sel.primIndex)continue;var s=n.sel.ranges[a];if(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)continue;var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Ko(e,s.head,i),l||Ys(e,s,o)}return r}function Ko(e,t,n){var r=Dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(k("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(k("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Rn(e,t){return e.top-t.top||e.left-t.left}function Ys(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Mo(e.display),s=a.left,l=Math.max(r.sizerWidth,lr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(x,E,I,A){E<0&&(E=0),E=Math.round(E),A=Math.round(A),o.appendChild(k("div",null,"CodeMirror-selected","position: absolute; left: "+x+`px;
top: `+E+"px; width: "+(I==null?l-x:I)+`px;
height: `+(A-E)+"px"))}function f(x,E,I){var A=_(i,x),K=A.text.length,de,Ke;function Se(Pe,pt){return xi(e,m(x,Pe),"div",A,pt)}function bt(Pe,pt,Je){var ze=zo(e,A,null,Pe),Ie=pt=="ltr"==(Je=="after")?"left":"right",ke=Je=="after"?ze.begin:ze.end-(/\s/.test(A.text.charAt(ze.end-1))?2:1);return Se(ke,Ie)[Ie]}var ct=ht(A,i.direction);return xt(ct,E||0,I==null?K:I,function(Pe,pt,Je,ze){var Ie=Je=="ltr",ke=Se(Pe,Ie?"left":"right"),vt=Se(pt-1,Ie?"right":"left"),Ur=E==null&&Pe==0,ir=I==null&&pt==K,rt=ze==0,Ht=!ct||ze==ct.length-1;if(vt.top-ke.top<=3){var Ge=(u?Ur:ir)&&rt,qi=(u?ir:Ur)&&Ht,Zt=Ge?s:(Ie?ke:vt).left,gr=qi?l:(Ie?vt:ke).right;h(Zt,ke.top,gr-Zt,ke.bottom)}else{var mr,at,zr,$i;Ie?(mr=u&&Ur&&rt?s:ke.left,at=u?l:bt(Pe,Je,"before"),zr=u?s:bt(pt,Je,"after"),$i=u&&ir&&Ht?l:vt.right):(mr=u?bt(Pe,Je,"before"):s,at=!u&&Ur&&rt?l:ke.right,zr=!u&&ir&&Ht?s:vt.left,$i=u?bt(pt,Je,"after"):l),h(mr,ke.top,at-mr,ke.bottom),ke.bottom<vt.top&&h(s,ke.bottom,null,vt.top),h(zr,vt.top,$i-zr,vt.bottom)}(!de||Rn(ke,de)<0)&&(de=ke),Rn(vt,de)<0&&(de=vt),(!Ke||Rn(ke,Ke)<0)&&(Ke=ke),Rn(vt,Ke)<0&&(Ke=vt)}),{start:de,end:Ke}}var c=t.from(),d=t.to();if(c.line==d.line)f(c.line,c.ch,d.ch);else{var p=_(i,c.line),v=_(i,d.line),y=Ut(p)==Ut(v),w=f(c.line,c.ch,y?p.text.length+1:null).end,S=f(d.line,y?0:null,d.ch).start;y&&(w.top<S.top-2?(h(w.right,w.top,null,w.bottom),h(s,S.top,S.left,S.bottom)):h(w.right,w.top,S.left-w.right,w.bottom)),w.bottom<S.top&&h(s,w.bottom,null,S.top)}n.appendChild(o)}function Mi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Go(e){e.state.focused||(e.display.input.focus(),Oi(e))}function Xo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,kr(e))},100)}function Oi(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(be(e,"focus",e,t),e.state.focused=!0,oe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Q&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Mi(e)}function kr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(be(e,"blur",e,t),e.state.focused=!1,ve(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Nn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,a=void 0,s=0;if(i.hidden)continue;if(D&&Z<8){var l=i.node.offsetTop+i.node.offsetHeight;a=l-n,n=l}else{var u=i.node.getBoundingClientRect();a=u.bottom-u.top,!o&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var h=i.line.height-a;if((h>.005||h<-.005)&&(Wt(i.line,a),Yo(i.line),i.rest))for(var f=0;f<i.rest.length;f++)Yo(i.rest[f]);if(s>e.display.sizerWidth){var c=Math.ceil(s/Tr(e.display));c>e.display.maxLineLength&&(e.display.maxLineLength=c,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Yo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Pn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-_n(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=sr(t,r),a=sr(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=sr(t,Gt(_(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=sr(t,Gt(_(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Zs(e,t){if(X(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!Mt){var o=k("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-_n(e.display))+`px;
height: `+(t.bottom-t.top+zt(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}function Js(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?m(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?m(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Dt(e,t),l=!n||n==t?s:Dt(e,n);i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r};var u=_i(e,i),h=e.doc.scrollTop,f=e.doc.scrollLeft;if(u.scrollTop!=null&&(en(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(dr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}function Qs(e,t){var n=_i(e,t);n.scrollTop!=null&&en(e,n.scrollTop),n.scrollLeft!=null&&dr(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=yi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+mi(n),l=t.top<r,u=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?s:t.bottom)-o);h!=i&&(a.scrollTop=h)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,c=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-f,d=lr(e)-n.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<c?a.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>d+c-3&&(a.scrollLeft=t.right+(p?0:10)-d),a}function Ai(e,t){if(t==null)return;In(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Mr(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function $r(e,t,n){(t!=null||n!=null)&&In(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Vs(e,t){In(e),e.curOp.scrollToPos=t}function In(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Fo(e,t.from),r=Fo(e,t.to);Zo(e,n,r,t.margin)}}function Zo(e,t,n,r){var i=_i(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});$r(e,i.scrollLeft,i.scrollTop)}function en(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ue||Ri(e,{top:t}),Jo(e,t,!0),ue&&Ri(e),nn(e,100)}function Jo(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function dr(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,ea(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function tn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+mi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+zt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var cr=function(e,t,n){this.cm=n;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),R(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),R(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&Z<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};cr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},cr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},cr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},cr.prototype.zeroWidthHack=function(){var e=xe&&!We?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},cr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},cr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var rn=function(){};rn.prototype.update=function(){return{bottom:0,right:0}},rn.prototype.setScrollLeft=function(){},rn.prototype.setScrollTop=function(){},rn.prototype.clear=function(){};function Or(e,t){t||(t=tn(e));var n=e.display.barWidth,r=e.display.barHeight;Qo(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Nn(e),Qo(e,tn(e)),n=e.display.barWidth,r=e.display.barHeight}function Qo(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Vo={native:cr,null:rn};function qo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ve(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),R(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?dr(e,t):en(e,t)},e),e.display.scrollbars.addClass&&oe(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function pr(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:++qs},Os(e.curOp)}function vr(e){var t=e.curOp;t&&As(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;$s(n)})}function $s(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var i=0;i<t.length;i++)rl(t[i]);for(var o=0;o<t.length;o++)nl(t[o]);for(var a=0;a<t.length;a++)il(t[a])}function el(e){var t=e.cm,n=t.display;al(t),e.updateMaxLine&&vi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Di(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&Nn(t),e.barMeasure=tn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_o(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+zt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-lr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&dr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Ce();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Or(t,e.barMeasure),e.updatedDisplay&&Pi(t,e.barMeasure),e.selectionChanged&&Mi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Go(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&$o(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Jo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&dr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Js(t,z(r,e.scrollToPos.from),z(r,e.scrollToPos.to),e.scrollToPos.margin);Zs(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||be(o[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&be(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function yt(e,t){if(e.curOp)return t();pr(e);try{return t()}finally{vr(e)}}function He(e,t){return function(){if(e.curOp)return t.apply(e,arguments);pr(e);try{return t.apply(e,arguments)}finally{vr(e)}}}function ot(e){return function(){if(this.curOp)return e.apply(this,arguments);pr(this);try{return e.apply(this,arguments)}finally{vr(this)}}}function je(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);pr(t);try{return e.apply(this,arguments)}finally{vr(t)}}}function nn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,jt(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=Xr(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?or(t.mode,r.state):null,l=no(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,h=l.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),c=0;!f&&c<a.length;++c)f=a[c]!=o.styles[c];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&ui(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return nn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&yt(e,function(){for(var o=0;o<i.length;o++)Vt(e,i[o],"text")})}var Wn=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Pn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=lr(e),this.force=n,this.dims=Li(e),this.events=[]};Wn.prototype.signal=function(e,t){V(e,t)&&this.events.push(arguments)},Wn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)be.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=zt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=zt(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=Ce();if(!t||!it(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&it(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==Ce())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&it(document.body,e.anchorNode)&&it(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Di(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return qt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Ho(e)==0)return!1;ta(e)&&(qt(e),t.dims=Li(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Kt&&(o=ci(e.doc,o),a=yo(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Xs(e,o,a),n.viewOffset=Gt(_(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Ho(e);if(!s&&l==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=sl(e);return l>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(u),me(n.cursorDiv),me(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,nn(e,400)),n.updateLineNumbers=null,!0}function $o(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==lr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+mi(e.display)-yi(e),n.top)}),t.visible=Pn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Pn(e.display,e.doc,n));if(!Di(e,t))break;Nn(e);var i=tn(e);qr(e),Or(e,i),Pi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ri(e,t){var n=new Wn(e,t);if(Di(e,n)){Nn(e),$o(e,n);var r=tn(e);qr(e),Or(e,r),Pi(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(p){var v=p.nextSibling;return Q&&xe&&e.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p),v}for(var l=r.view,u=r.viewFrom,h=0;h<l.length;h++){var f=l[h];if(!f.hidden)if(!f.node||f.node.parentNode!=o){var c=Is(e,f,u,n);o.insertBefore(c,a)}else{for(;a!=f.node;)a=s(a);var d=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(G(f.changes,"gutter")>-1&&(d=!1),So(e,f,u,n)),d&&(me(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ai(e.options,u)))),a=f.node.nextSibling}u+=f.size}for(;a;)a=s(a)}function Ni(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Pi(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+zt(e)+"px"}function ea(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ti(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function ta(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ai(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k("div",[k("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ni(e.display),!0}return!1}function Ii(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ra(e){var t=e.gutters,n=e.gutterSpecs;me(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(k("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ni(e)}function on(e){ra(e.display),ft(e),ea(e)}function hl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=k("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=k("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=le("div",null,"CodeMirror-code"),i.selectionDiv=k("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=k("div",null,"CodeMirror-cursors"),i.measure=k("div",null,"CodeMirror-measure"),i.lineMeasure=k("div",null,"CodeMirror-measure"),i.lineSpace=le("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=le("div",[i.lineSpace],"CodeMirror-lines");i.mover=k("div",[o],null,"position: relative"),i.sizer=k("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=k("div",null,null,"position: absolute; height: "+Ve+"px; width: 1px;"),i.gutters=k("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=k("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=k("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),D&&Z<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!Q&&!(ue&&Qe)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ii(r.gutters,r.lineNumbers),ra(i),n.init(i)}var Fn=0,Ct=null;D?Ct=-.53:ue?Ct=15:q?Ct=-.7:lt&&(Ct=-1/3);function na(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function fl(e){var t=na(e);return t.x*=Ct,t.y*=Ct,t}function ia(e,t){var n=na(t),r=n.x,i=n.y,o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(!(r&&s||i&&l))return;if(i&&xe&&Q){e:for(var u=t.target,h=o.view;u!=a;u=u.parentNode)for(var f=0;f<h.length;f++)if(h[f].node==u){e.display.currentWheelTarget=u;break e}}if(r&&!ue&&!F&&Ct!=null){i&&l&&en(e,Math.max(0,a.scrollTop+i*Ct)),dr(e,Math.max(0,a.scrollLeft+r*Ct)),(!i||i&&l)&&fe(t),o.wheelStartX=null;return}if(i&&Ct!=null){var c=i*Ct,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;c<0?d=Math.max(0,d+c-50):p=Math.min(e.doc.height,p+c+50),Ri(e,{top:d,bottom:p})}Fn<20&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(o.wheelStartX==null)return;var v=a.scrollLeft-o.wheelStartX,y=a.scrollTop-o.wheelStartY,w=y&&o.wheelDY&&y/o.wheelDY||v&&o.wheelDX&&v/o.wheelDX;if(o.wheelStartX=o.wheelStartY=null,!w)return;Ct=(Ct*Fn+w)/(Fn+1),++Fn},200)):(o.wheelDX+=r,o.wheelDY+=i))}var St=function(e,t){this.ranges=e,this.primIndex=t};St.prototype.primary=function(){return this.ranges[this.primIndex]},St.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!si(n.anchor,r.anchor)||!si(n.head,r.head))return!1}return!0},St.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new re(li(this.ranges[t].anchor),li(this.ranges[t].head));return new St(e,this.primIndex)},St.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},St.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(U(t,r.from())>=0&&U(e,r.to())<=0)return n}return-1};var re=function(e,t){this.anchor=e,this.head=t};re.prototype.from=function(){return Cn(this.anchor,this.head)},re.prototype.to=function(){return xn(this.anchor,this.head)},re.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Rt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(c,d){return U(c.from(),d.from())}),n=G(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=U(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var u=Cn(s.from(),a.from()),h=xn(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new re(f?h:u,f?u:h))}}return new St(t,n)}function $t(e,t){return new St([new re(e,t||e)],0)}function er(e){return e.text?m(e.from.line+e.text.length-1,T(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function oa(e,t){if(U(e,t.from)<0)return e;if(U(e,t.to)<=0)return er(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=er(t).ch-t.to.ch),m(n,r)}function Wi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new re(oa(i.anchor,t),oa(i.head,t)))}return Rt(e.cm,n,e.sel.primIndex)}function aa(e,t,n){return e.line==t.line?m(n.line,e.ch-t.ch+n.ch):m(n.line+(e.line-t.line),e.ch)}function dl(e,t,n){for(var r=[],i=m(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=aa(s.from,i,o),u=aa(er(s),i,o);if(i=s.to,o=u,n=="around"){var h=e.sel.ranges[a],f=U(h.head,h.anchor)<0;r[a]=new re(f?u:l,f?l:u)}else r[a]=new re(l,l)}return new St(r,e.sel.primIndex)}function Fi(e){e.doc.mode=ni(e.options,e.doc.modeOption),an(e)}function an(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,nn(e,100),e.state.modeGen++,e.curOp&&ft(e)}function sa(e,t){return t.from.ch==0&&t.to.ch==0&&T(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ui(e,t,n,r){function i(S){return n?n[S]:null}function o(S,x,E){ws(S,x,E,r),Ze(S,"change",S,t)}function a(S,x){for(var E=[],I=S;I<x;++I)E.push(new Cr(u[I],i(I),r));return E}var s=t.from,l=t.to,u=t.text,h=_(e,s.line),f=_(e,l.line),c=T(u),d=i(u.length-1),p=l.line-s.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(sa(e,t)){var v=a(0,u.length-1);o(f,f.text,d),p&&e.remove(s.line,p),v.length&&e.insert(s.line,v)}else if(h==f)if(u.length==1)o(h,h.text.slice(0,s.ch)+c+h.text.slice(l.ch),d);else{var y=a(1,u.length-1);y.push(new Cr(c+h.text.slice(l.ch),d,r)),o(h,h.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,y)}else if(u.length==1)o(h,h.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0)),e.remove(s.line+1,p);else{o(h,h.text.slice(0,s.ch)+u[0],i(0)),o(f,c+f.text.slice(l.ch),d);var w=a(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,w)}Ze(e,"change",e,t)}function tr(e,t,n){function r(i,o,a){if(i.linked)for(var s=0;s<i.linked.length;++s){var l=i.linked[s];if(l.doc==o)continue;var u=a&&l.sharedHist;if(n&&!u)continue;t(l.doc,u),r(l.doc,i,u)}}r(e,null,!0)}function la(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ki(e),Fi(e),ua(e),e.options.lineWrapping||vi(e),e.options.mode=t.modeOption,ft(e)}function ua(e){(e.doc.direction=="rtl"?oe:ve)(e.display.lineDiv,"CodeMirror-rtl")}function cl(e){yt(e,function(){ua(e),ft(e)})}function Un(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function zi(e,t){var n={from:li(t.from),to:er(t),text:ar(e,t.from,t.to)};return da(e,n,t.from.line,t.to.line+1),tr(e,function(r){return da(r,n,t.from.line,t.to.line+1)},!0),n}function ha(e){for(;e.length;){var t=T(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ha(e.done),T(e.done);if(e.done.length&&!T(e.done).ranges)return T(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),T(e.done)}function fa(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=pl(i,i.lastOp==r)))s=T(a.changes),U(t.from,t.to)==0&&U(t.from,s.to)==0?s.to=er(t):a.changes.push(zi(e,t));else{var l=T(i.done);for((!l||!l.ranges)&&zn(e.sel,i.done),a={changes:[zi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||be(e,"historyAdded")}function vl(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||vl(e,o,T(i.done),t))?i.done[i.done.length-1]=t:zn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ha(i.undone)}function zn(e,t){var n=T(t);n&&n.ranges&&n.equals(e)||t.push(e)}function da(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function ml(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(ml(n[i]));return r}function ca(e,t){var n=yl(e,t),r=fi(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a){e:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}}else a&&(n[i]=a)}return n}function _r(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?St.prototype.deepCopy.call(o):o);continue}var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],h=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(h=f.match(/^spans_(\d+)$/))&&(G(t,Number(h[1]))>-1&&(T(s)[f]=u[f],delete u[f]))}}return r}function Bi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=U(t,i)<0;o!=U(n,i)<0?(i=t,t=n):o!=U(t,n)<0&&(t=n)}return new re(i,t)}else return new re(n||t,t)}function Bn(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),tt(e,new St([Bi(e.sel.primary(),t,n,i)],0),r)}function pa(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Bi(e.sel.ranges[o],t[o],null,i);var a=Rt(e.cm,r,e.sel.primIndex);tt(e,a,n)}function Hi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,tt(e,Rt(e.cm,i,e.sel.primIndex),r)}function va(e,t,n,r){tt(e,$t(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new re(z(e,i[o].anchor),z(e,i[o].head))},origin:n&&n.origin};return be(e,"beforeSelectionChange",e,r),e.cm&&be(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Rt(e.cm,r.ranges,r.ranges.length-1):t}function ga(e,t,n){var r=e.history.done,i=T(r);i&&i.ranges?(r[r.length-1]=t,Hn(e,t,n)):tt(e,t,n)}function tt(e,t,n){Hn(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Hn(e,t,n){(V(e,"beforeSelectionChange")||e.cm&&V(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(U(t.primary().head,e.sel.primary().head)<0?-1:1);ma(e,ba(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Mr(e.cm)}function ma(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ee(e.cm)),Ze(e,"cursorActivity",e)}function ya(e){ma(e,ba(e,e.sel,null,!1))}function ba(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=jn(e,a.anchor,s&&s.anchor,n,r),u=jn(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new re(l,u))}return i?Rt(e.cm,i,t.primIndex):t}function Ar(e,t,n,r,i){var o=_(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,h="selectRight"in l?!l.selectRight:l.inclusiveRight;if((s.from==null||(u?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(h?s.to>=t.ch:s.to>t.ch))){if(i&&(be(l,"beforeCursorEnter"),l.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),c=void 0;if((r<0?h:u)&&(f=wa(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(c=U(f,n))&&(r<0?c<0:c>0))return Ar(e,f,t,r,i)}var d=l.find(r<0?-1:1);return(r<0?u:h)&&(d=wa(e,d,r,d.line==t.line?o:null)),d?Ar(e,d,t,r,i):null}}return t}function jn(e,t,n,r,i){var o=r||1,a=Ar(e,t,n,o,i)||!i&&Ar(e,t,n,o,!0)||Ar(e,t,n,-o,i)||!i&&Ar(e,t,n,-o,!0);return a||(e.cantEdit=!0,m(e.first,0))}function wa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?z(e,m(t.line-1)):null:n>0&&t.ch==(r||_(e,t.line)).text.length?t.line<e.first+e.size-1?m(t.line+1,0):null:new m(t.line,t.ch+n)}function xa(e){e.setSelection(m(e.firstLine(),0),m(e.lastLine()),C)}function Ca(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,s){i&&(r.from=z(e,i)),o&&(r.to=z(e,o)),a&&(r.text=a),s!==void 0&&(r.origin=s)}),be(e,"beforeChange",e,r),e.cm&&be(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 Dr(e,t,n){if(e.cm){if(!e.cm.curOp)return He(e.cm,Dr)(e,t,n);if(e.cm.state.suppressEdits)return}if((V(e,"beforeChange")||e.cm&&V(e.cm,"beforeChange"))&&(t=Ca(e,t,!0),!t))return;var r=ho&&!n&&gs(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Sa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Sa(e,t)}function Sa(e,t){if(t.text.length==1&&t.text[0]==""&&U(t.from,t.to)==0)return;var n=Wi(e,t);fa(e,t,n,e.cm?e.cm.curOp.id:NaN),sn(e,t,n,fi(e,t));var r=[];tr(e,function(i,o){!o&&G(r,i.history)==-1&&(ka(i.history,t),r.push(i.history)),sn(i,t,null,fi(i,t))})}function Kn(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,o,a=e.sel,s=t=="undo"?i.done:i.undone,l=t=="undo"?i.undone:i.done,u=0;u<s.length&&!(o=s[u],n?o.ranges&&!o.equals(e.sel):!o.ranges);u++);if(u==s.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=s.pop(),o.ranges){if(zn(o,l),n&&!o.equals(e.sel)){tt(e,o,{clearRedo:!1});return}a=o}else if(r){s.push(o);return}else break;var h=[];zn(a,l),l.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var f=V(e,"beforeChange")||e.cm&&V(e.cm,"beforeChange"),c=function(v){var y=o.changes[v];if(y.origin=t,f&&!Ca(e,y,!1))return s.length=0,{};h.push(zi(e,y));var w=v?Wi(e,y):T(s);sn(e,y,w,ca(e,y)),!v&&e.cm&&e.cm.scrollIntoView({from:y.from,to:er(y)});var S=[];tr(e,function(x,E){!E&&G(S,x.history)==-1&&(ka(x.history,y),S.push(x.history)),sn(x,y,null,ca(x,y))})},d=o.changes.length-1;d>=0;--d){var p=c(d);if(p)return p.v}}function Ea(e,t){if(t==0)return;if(e.first+=t,e.sel=new St(H(e.sel.ranges,function(i){return new re(m(i.anchor.line+t,i.anchor.ch),m(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){ft(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Vt(e.cm,r,"gutter")}}function sn(e,t,n,r){if(e.cm&&!e.cm.curOp)return He(e.cm,sn)(e,t,n,r);if(t.to.line<e.first){Ea(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ea(e,i),t={from:m(e.first,0),to:m(t.to.line+i,t.to.ch),text:[T(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:m(o,_(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ar(e,t.from,t.to),n||(n=Wi(e,t)),e.cm?wl(e.cm,t,r):Ui(e,t,r),Hn(e,n,C),e.cantEdit&&jn(e,m(e.firstLine(),0))&&(e.cantEdit=!1)}function wl(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=ae(Ut(_(r,o.line))),r.iter(l,a.line+1,function(d){if(d==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ee(e),Ui(r,t,n,Bo(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(d){var p=Mn(d);p>i.maxLineLength&&(i.maxLine=d,i.maxLineLength=p,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),us(r,o.line),nn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?ft(e):o.line==a.line&&t.text.length==1&&!sa(e.doc,t)?Vt(e,o.line,"text"):ft(e,o.line,a.line+1,u);var h=V(e,"changes"),f=V(e,"change");if(f||h){var c={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&Ze(e,"change",e,c),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(c)}e.display.selForContextMenu=null}function Rr(e,t,n,r,i){var o;r||(r=n),U(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Dr(e,{from:n,to:r,text:t,origin:i})}function La(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ta(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)La(o.ranges[s].anchor,t,n,r),La(o.ranges[s].head,t,n,r);continue}for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=m(u.from.line+r,u.from.ch),u.to=m(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function ka(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ta(e.done,n,r,i),Ta(e.undone,n,r,i)}function ln(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=_(e,to(e,t)):i=ae(t),i==null?null:(r(o,i)&&e.cm&&Vt(e.cm,i,n),o)}function un(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}un.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,xs(i),Ze(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function hn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}hn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof un))){var s=[];this.collapse(s),this.children=[new un(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new un(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new hn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=G(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new hn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var fn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};fn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ae(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Qr(this);Wt(n,Math.max(0,n.height-o)),e&&(yt(e,function(){Ma(e,n,-o),Vt(e,r,"widget")}),Ze(e,"lineWidgetCleared",e,this,r))},fn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Qr(this)-t;if(!i)return;Qt(this.doc,r)||Wt(r,r.height+i),n&&yt(n,function(){n.curOp.forceUpdate=!0,Ma(n,r,i),Ze(n,"lineWidgetChanged",n,e,ae(r))})},Te(fn);function Ma(e,t,n){Gt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ai(e,n)}function xl(e,t,n,r){var i=new fn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ln(e,t,"widget",function(a){var s=a.widgets||(a.widgets=[]);if(i.insertAt==null?s.push(i):s.splice(Math.min(s.length-1,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!Qt(e,a)){var l=Gt(a)<e.scrollTop;Wt(a,a.height+Qr(i)),l&&Ai(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&Ze(o,"lineWidgetAdded",o,i,typeof t=="number"?t:ae(t)),i}var Oa=0,rr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Oa};rr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&pr(e),V(this,"clear")){var n=this.find();n&&Ze(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Yr(a.markedSpans,this);e&&!this.collapsed?Vt(e,ae(a),"text"):e&&(s.to!=null&&(i=ae(a)),s.from!=null&&(r=ae(a))),a.markedSpans=ds(a.markedSpans,s),s.from==null&&this.collapsed&&!Qt(this.doc,a)&&e&&Wt(a,Lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Ut(this.lines[l]),h=Mn(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&ft(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ya(e.doc)),e&&Ze(e,"markerCleared",e,this,r,i),t&&vr(e),this.parent&&this.parent.clear()},rr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Yr(o.markedSpans,this);if(a.from!=null&&(n=m(t?o:ae(o),a.from),e==-1))return n;if(a.to!=null&&(r=m(t?o:ae(o),a.to),e==1))return r}return n&&{from:n,to:r}},rr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;yt(r,function(){var i=t.line,o=ae(t.line),a=bi(r,o);if(a&&(Ro(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Qt(n.doc,i)&&n.height!=null){var s=n.height;n.height=null;var l=Qr(n)-s;l&&Wt(i,i.height+l)}Ze(r,"markerChanged",r,e)})},rr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||G(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},rr.prototype.detachLine=function(e){if(this.lines.splice(G(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Te(rr);function Nr(e,t,n,r,i){if(r&&r.shared)return Cl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return He(e.cm,Nr)(e,t,n,r,i);var o=new rr(e,i),a=U(t,n);if(r&&J(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=le("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mo(e,t.line,t,n,o)||t.line!=n.line&&mo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");fs()}o.addToHistory&&fa(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s=t.line,l=e.cm,u;if(e.iter(s,n.line+1,function(f){l&&o.collapsed&&!l.options.lineWrapping&&Ut(f)==l.display.maxLine&&(u=!0),o.collapsed&&s!=t.line&&Wt(f,0),cs(f,new En(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(f){Qt(e,f)&&Wt(f,0)}),o.clearOnEnter&&R(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(hs(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Oa,o.atomic=!0),l){if(u&&(l.curOp.updateMaxLine=!0),o.collapsed)ft(l,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)Vt(l,h,"text");o.atomic&&ya(l.doc),Ze(l,"markerAdded",l,o)}return o}var dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};dn.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ze(this,"clear")},dn.prototype.find=function(e,t){return this.primary.find(e,t)},Te(dn);function Cl(e,t,n,r,i){r=J(r),r.shared=!1;var o=[Nr(e,t,n,r,i)],a=o[0],s=r.widgetNode;return tr(e,function(l){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Nr(l,z(l,t),z(l,n),r,i));for(var u=0;u<l.linked.length;++u)if(l.linked[u].isParent)return;a=T(o)}),new dn(o,a)}function _a(e){return e.findMarks(m(e.first,0),e.clipPos(m(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(U(o,a)){var s=Nr(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function El(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];tr(i.primary.doc,function(l){return o.push(l)});for(var a=0;a<i.markers.length;a++){var s=i.markers[a];G(o,s.doc)==-1&&(s.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Ll=0,dt=function(e,t,n,r,i){if(!(this instanceof dt))return new dt(e,t,n,r,i);n==null&&(n=0),hn.call(this,[new un([new Cr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=m(n,0);this.sel=$t(o),this.history=new Un(null),this.id=++Ll,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ui(this,{from:o,to:o,text:e}),tt(this,$t(o),C)};dt.prototype=De(hn.prototype,{constructor:dt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=oi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:je(function(e){var t=m(this.first,0),n=this.first+this.size-1;Dr(this,{from:t,to:m(n,_(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&$r(this.cm,0,0),tt(this,$t(t),C)}),replaceRange:function(e,t,n,r){t=z(this,t),n=n?z(this,n):t,Rr(this,e,t,n,r)},getRange:function(e,t,n){var r=ar(this,z(this,e),z(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Gr(this,e))return _(this,e)},getLineNumber:function(e){return ae(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=_(this,e)),Ut(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(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:je(function(e,t,n){va(this,z(this,typeof e=="number"?m(e,t||0):e),null,n)}),setSelection:je(function(e,t,n){va(this,z(this,e),z(this,t||e),n)}),extendSelection:je(function(e,t,n){Bn(this,z(this,e),t&&z(this,t),n)}),extendSelections:je(function(e,t){pa(this,ro(this,e),t)}),extendSelectionsBy:je(function(e,t){var n=H(this.sel.ranges,e);pa(this,ro(this,n),t)}),setSelections:je(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new re(z(this,e[i].anchor),z(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),tt(this,Rt(this.cm,r,t),n)}),addSelection:je(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new re(z(this,e),z(this,t||e))),tt(this,Rt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=ar(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ar(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:je(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&t!="end"&&dl(this,r,t),l=r.length-1;l>=0;l--)Dr(this,r[l]);s?ga(this,s):this.cm&&Mr(this.cm)}),undo:je(function(){Kn(this,"undo")}),redo:je(function(){Kn(this,"redo")}),undoSelection:je(function(){Kn(this,"undo",!0)}),redoSelection:je(function(){Kn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Un(this.history.maxGeneration),tr(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:_r(this.history.done),undone:_r(this.history.undone)}},setHistory:function(e){var t=this.history=new Un(this.history.maxGeneration);t.done=_r(e.done.slice(0),null,!0),t.undone=_r(e.undone.slice(0),null,!0)},setGutterMarker:je(function(e,t,n){return ln(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&_t(i)&&(r.gutterMarkers=null),!0})}),clearGutter:je(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ln(t,n,"gutter",function(){return n.gutterMarkers[e]=null,_t(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Gr(this,e))return null;if(t=e,e=_(this,e),!e)return null}else if(t=ae(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:je(function(e,t,n){return ln(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(Ue(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:je(function(e,t,n){return ln(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(Ue(n));if(!a)return!1;var s=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||s==o.length?"":" ")+o.slice(s)||null}else return!1;return!0})}),addLineWidget:je(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Nr(this,z(this,e),z(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=z(this,e),Nr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=z(this,e);var t=[],n=_(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=z(this,e),t=z(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];!(l.to!=null&&i==e.line&&e.ch>=l.to||l.from==null&&i!=e.line||l.from!=null&&i==t.line&&l.from>=t.ch)&&(!n||n(l.marker))&&r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),z(this,m(n,t))},indexFromPos:function(e){e=z(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new dt(oi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new dt(oi(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,_a(this)),r},unlinkDoc:function(e){if(e instanceof we&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),El(_a(this));break}if(e.history==this.history){var r=[e.id];tr(e,function(i){return r.push(i.id)},!0),e.history=new Un(null),e.history.done=_r(this.history.done,r),e.history.undone=_r(this.history.undone,r)}},iterLinkedDocs:function(e){tr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):It(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:je(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&cl(this.cm)})}),dt.prototype.eachLine=dt.prototype.iter;var Aa=0;function Tl(e){var t=this;if(Da(t),X(t,e)||Xt(t.display,e))return;fe(e),D&&(Aa=+new Date);var n=hr(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(){++a==i&&He(t,function(){n=z(t.doc,n);var d={from:n,to:n,text:t.doc.splitLines(o.filter(function(p){return p!=null}).join(t.doc.lineSeparator())),origin:"paste"};Dr(t.doc,d),ga(t.doc,$t(z(t.doc,n),z(t.doc,er(d))))})()},l=function(d,p){if(t.options.allowDropFileTypes&&G(t.options.allowDropFileTypes,d.type)==-1){s();return}var v=new FileReader;v.onerror=function(){return s()},v.onload=function(){var y=v.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(y)){s();return}o[p]=y,s()},v.readAsText(d)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Hn(t.doc,$t(n,n)),f)for(var c=0;c<f.length;++c)Rr(t.doc,"",f[c].anchor,f[c].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(d){}}}function kl(e,t){if(D&&(!e.state.draggingText||+new Date-Aa<100)){kt(t);return}if(X(e,t)||Xt(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!lt){var n=k("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",F&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),F&&n.parentNode.removeChild(n)}}function Ml(e,t){var n=hr(e,t);if(!n)return;var r=document.createDocumentFragment();Ko(e,n,r),e.display.dragCursor||(e.display.dragCursor=k("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ie(e.display.dragCursor,r)}function Da(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ra(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}var Na=!1;function Ol(){if(Na)return;_l(),Na=!0}function _l(){var e;R(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ra(Al)},100))}),R(window,"blur",function(){return Ra(kr)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var nr={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"},cn=0;cn<10;cn++)nr[cn+48]=nr[cn+96]=String(cn);for(var Gn=65;Gn<=90;Gn++)nr[Gn]=String.fromCharCode(Gn);for(var pn=1;pn<=12;pn++)nr[pn+111]=nr[pn+63235]="F"+pn;var Yt={};Yt.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"},Yt.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"},Yt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Yt.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"]},Yt.default=xe?Yt.macDefault:Yt.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var s=t[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Rl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=H(n.split(" "),Dl),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(!l)t[s]=a;else if(l!=a)throw new Error("Inconsistent bindings for "+s)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Pr(e,t,n,r){t=Xn(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Pr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Pr(e,t.fallthrough[o],n,r);if(a)return a}}}function Pa(e){var t=typeof e=="string"?e:nr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ia(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Ae?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Ae?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Wa(e,t){if(F&&e.keyCode==34&&e.char)return!1;var n=nr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Ia(n,e,t))}function Xn(e){return typeof e=="string"?Yt[e]:e}function Ir(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&U(o.from,T(r).to)<=0;){var a=r.pop();if(U(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}yt(e,function(){for(var s=r.length-1;s>=0;s--)Rr(e.doc,"",r[s].from,r[s].to,"+delete");Mr(e)})}function ji(e,t,n){var r=ge(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ki(e,t,n){var r=ji(e,t.ch,n);return r==null?null:new m(t.line,r,n<0?"after":"before")}function Gi(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=ht(n,t.doc.direction);if(o){var a=i<0?T(o):o[0],s=i<0==(a.level==1),l=s?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Er(t,n);u=i<0?n.text.length-1:0;var f=Bt(t,h,u).top;u=ut(function(c){return Bt(t,h,c).top==f},i<0==(a.level==1)?a.from:a.to-1,u),l=="before"&&(u=ji(n,u,1))}else u=i<0?a.to:a.from;return new m(r,u,l)}}return new m(r,i<0?n.text.length:0,i<0?"before":"after")}function Nl(e,t,n,r){var i=ht(t,e.doc.direction);if(!i)return Ki(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Et(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ki(t,n,r);var s=function(w,S){return ji(t,w instanceof m?w.ch:w,S)},l,u=function(w){return e.options.lineWrapping?(l=l||Er(e,t),zo(e,t,l,w)):{begin:0,end:t.text.length}},h=u(n.sticky=="before"?s(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var f=a.level==1==r<0,c=s(n,f?1:-1);if(c!=null&&(f?c<=a.to&&c<=h.end:c>=a.from&&c>=h.begin)){var d=f?"before":"after";return new m(n.line,c,d)}}var p=function(w,S,x){for(var E=function(de,Ke){return Ke?new m(n.line,s(de,1),"before"):new m(n.line,de,"after")};w>=0&&w<i.length;w+=S){var I=i[w],A=S>0==(I.level!=1),K=A?x.begin:s(x.end,-1);if(I.from<=K&&K<I.to)return E(K,A);if(K=A?I.from:s(I.to,-1),x.begin<=K&&K<x.end)return E(K,A)}},v=p(o+r,r,h);if(v)return v;var y=r>0?h.end:s(h.begin,-1);return y!=null&&!(r>0&&y==t.text.length)&&(v=p(r>0?0:i.length-1,r,u(y)),v)?v:null}var vn={selectAll:xa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),C)},killLine:function(e){return Ir(e,function(t){if(t.empty()){var n=_(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:m(t.head.line+1,0)}:{from:t.head,to:m(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ir(e,function(t){return{from:m(t.from().line,0),to:z(e.doc,m(t.to().line+1,0))}})},delLineLeft:function(e){return Ir(e,function(t){return{from:m(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ir(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Ir(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(m(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(m(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Fa(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ua(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},L)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},L)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ua(e,t.head):r},L)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=M(e.getLine(o.line),o.ch,r);t.push(W(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return yt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,o=_(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new m(i.line,i.ch-1)),i.ch>0)i=new m(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),m(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=_(e.doc,i.line-1).text;a&&(i=new m(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),m(i.line-1,a.length-1),i,"+transpose"))}}n.push(new re(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return yt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Mr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Fa(e,t){var n=_(e.doc,t),r=Ut(n);return r!=n&&(t=ae(r)),Gi(!0,e,r,t,1)}function Pl(e,t){var n=_(e.doc,t),r=ys(n);return r!=n&&(t=ae(r)),Gi(!0,e,n,t,-1)}function Ua(e,t){var n=Fa(e,t.line),r=_(e.doc,n.line),i=ht(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return m(n.line,a?0:o,n.sticky)}return n}function Yn(e,t,n){if(typeof t=="string"&&(t=vn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ye}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Il(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Pr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Pr(t,e.options.extraKeys,n,e)||Pr(t,e.options.keyMap,n,e)}var Wl=new j;function gn(e,t,n,r){var i=e.state.keySeq;if(i){if(Pa(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Wl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),za(e,i+" "+t,n,r))return!0}return za(e,t,n,r)}function za(e,t,n,r){var i=Il(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Ze(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(fe(n),Mi(e)),!!i}function Ba(e,t){var n=Wa(t,!0);return n?t.shiftKey&&!e.state.keySeq?gn(e,"Shift-"+n,t,function(r){return Yn(e,r,!0)})||gn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Yn(e,r)}):gn(e,n,t,function(r){return Yn(e,r)}):!1}function Fl(e,t,n){return gn(e,"'"+n+"'",t,function(r){return Yn(e,r,!0)})}var Xi=null;function Ha(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=Ce(),X(t,e))return;D&&Z<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Ba(t,e);F&&(Xi=r?n:null,!r&&n==88&&!ti&&(xe?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ue&&!xe&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;oe(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(ve(t,"CodeMirror-crosshair"),et(document,"keyup",n),et(document,"mouseover",n))}R(document,"keyup",n),R(document,"mouseover",n)}function ja(e){e.keyCode==16&&(this.doc.sel.shift=!1),X(this,e)}function Ka(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Xt(t.display,e)||X(t,e)||e.ctrlKey&&!e.altKey||xe&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(F&&n==Xi){Xi=null,fe(e);return}if(F&&(!e.which||e.which<10)&&Ba(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Fl(t,e,i))return;t.display.input.onKeyPress(e)}var zl=400,Yi=function(e,t,n){this.time=e,this.pos=t,this.button=n};Yi.prototype.compare=function(e,t,n){return this.time+zl>e&&U(t,this.pos)==0&&n==this.button};var mn,yn;function Bl(e,t){var n=+new Date;return yn&&yn.compare(n,e,t)?(mn=yn=null,"triple"):mn&&mn.compare(n,e,t)?(yn=new Yi(n,e,t),mn=null,"double"):(mn=new Yi(n,e,t),yn=null,"single")}function Ga(e){var t=this,n=t.display;if(X(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Xt(n,e)){Q||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Zi(t,e))return;var r=hr(t,e),i=br(e),o=r?Bl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,i,r,o,e))return;i==1?r?Kl(t,r,o,e):Pt(e)==n.scroller&&fe(e):i==2?(r&&Bn(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(Fe?t.display.input.onContextMenu(e):Xo(t))}function Hl(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,gn(e,Ia(o,i),i,function(a){if(typeof a=="string"&&(a=vn[a]),!a)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=a(e,n)!=Ye}finally{e.state.suppressEdits=!1}return s})}function jl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Xe?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=xe?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(xe?n.altKey:n.ctrlKey)),i}function Kl(e,t,n,r){D?setTimeout(jt(Go,e),0):e.curOp.focus=Ce();var i=jl(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&qn&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(U((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(U(a.to(),t)>0||t.xRel<0)?Gl(e,r,t,i):Xl(e,r,t,i)}function Gl(e,t,n,r){var i=e.display,o=!1,a=He(e,function(u){Q&&(i.scroller.draggable=!1),e.state.draggingText=!1,et(i.wrapper.ownerDocument,"mouseup",a),et(i.wrapper.ownerDocument,"mousemove",s),et(i.scroller,"dragstart",l),et(i.scroller,"drop",a),o||(fe(u),r.addNew||Bn(e.doc,n,null,null,r.extend),Q&&!lt||D&&Z==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},l=function(){return o=!0};Q&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),R(i.wrapper.ownerDocument,"mouseup",a),R(i.wrapper.ownerDocument,"mousemove",s),R(i.scroller,"dragstart",l),R(i.scroller,"drop",a),Xo(e),setTimeout(function(){return i.input.focus()},20)}function Xa(e,t,n){if(n=="char")return new re(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new re(m(t.line,0),z(e.doc,m(t.line+1,0)));var r=n(e,t);return new re(r.from,r.to)}function Xl(e,t,n,r){var i=e.display,o=e.doc;fe(t);var a,s,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),s>-1?a=u[s]:a=new re(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new re(n,n)),n=hr(e,t,!0,!0),s=-1;else{var h=Xa(e,n,r.unit);r.extend?a=Bi(a,h.anchor,h.head,r.extend):a=h}r.addNew?s==-1?(s=u.length,tt(o,Rt(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&r.unit=="char"&&!r.extend?(tt(o,Rt(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Hi(o,s,a,N):(s=0,tt(o,new St([a],0),N),l=o.sel);var f=n;function c(x){if(U(f,x)==0)return;if(f=x,r.unit=="rectangle"){for(var E=[],I=e.options.tabSize,A=M(_(o,n.line).text,n.ch,I),K=M(_(o,x.line).text,x.ch,I),de=Math.min(A,K),Ke=Math.max(A,K),Se=Math.min(n.line,x.line),bt=Math.min(e.lastLine(),Math.max(n.line,x.line));Se<=bt;Se++){var ct=_(o,Se).text,Pe=O(ct,de,I);de==Ke?E.push(new re(m(Se,Pe),m(Se,Pe))):ct.length>Pe&&E.push(new re(m(Se,Pe),m(Se,O(ct,Ke,I))))}E.length||E.push(new re(n,n)),tt(o,Rt(e,l.ranges.slice(0,s).concat(E),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(x)}else{var pt=a,Je=Xa(e,x,r.unit),ze=pt.anchor,Ie;U(Je.anchor,ze)>0?(Ie=Je.head,ze=Cn(pt.from(),Je.anchor)):(Ie=Je.anchor,ze=xn(pt.to(),Je.head));var ke=l.ranges.slice(0);ke[s]=Yl(e,new re(z(o,ze),Ie)),tt(o,Rt(e,ke,s),N)}}var d=i.wrapper.getBoundingClientRect(),p=0;function v(x){var E=++p,I=hr(e,x,!0,r.unit=="rectangle");if(!I)return;if(U(I,f)!=0){e.curOp.focus=Ce(),c(I);var A=Pn(i,o);(I.line>=A.to||I.line<A.from)&&setTimeout(He(e,function(){p==E&&v(x)}),150)}else{var K=x.clientY<d.top?-20:x.clientY>d.bottom?20:0;K&&setTimeout(He(e,function(){if(p!=E)return;i.scroller.scrollTop+=K,v(x)}),50)}}function y(x){e.state.selectingText=!1,p=Infinity,x&&(fe(x),i.input.focus()),et(i.wrapper.ownerDocument,"mousemove",w),et(i.wrapper.ownerDocument,"mouseup",S),o.history.lastSelOrigin=null}var w=He(e,function(x){x.buttons===0||!br(x)?y(x):v(x)}),S=He(e,y);e.state.selectingText=S,R(i.wrapper.ownerDocument,"mousemove",w),R(i.wrapper.ownerDocument,"mouseup",S)}function Yl(e,t){var n=t.anchor,r=t.head,i=_(e.doc,n.line);if(U(n,r)==0&&n.sticky==r.sticky)return t;var o=ht(i);if(!o)return t;var a=Et(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l=a+(s.from==n.ch==(s.level!=1)?0:1);if(l==0||l==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=Et(o,r.ch,r.sticky),f=h-a||(r.ch-n.ch)*(s.level==1?-1:1);h==l-1||h==l?u=f<0:u=f>0}var c=o[l+(u?-1:0)],d=u==(c.level==1),p=d?c.from:c.to,v=d?"after":"before";return n.ch==p&&n.sticky==v?t:new re(new m(n.line,p,v),r)}function Ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(c){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&fe(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!V(e,n))return Tt(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i){var h=sr(e.doc,o),f=e.display.gutterSpecs[l];return be(e,n,e,h,f.className,t),Tt(t)}}}function Zi(e,t){return Ya(e,t,"gutterClick",!0)}function Za(e,t){if(Xt(e.display,t)||Zl(e,t))return;if(X(e,t,"contextmenu"))return;Fe||e.display.input.onContextMenu(t)}function Zl(e,t){return V(e,"gutterContextMenu")?Ya(e,t,"gutterContextMenu",!1):!1}function Ja(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vr(e)}var Wr={toString:function(){return"CodeMirror.Init"}},Qa={},Zn={};function Jl(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(s,l,u){u!=Wr&&o(s,l,u)}:o)}e.defineOption=n,e.Init=Wr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Fi(r)},!0),n("indentUnit",2,Fi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){an(r),Vr(r),ft(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var o=[],a=r.doc.first;r.doc.iter(function(l){for(var u=0;;){var h=l.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(m(a,h))}a++});for(var s=o.length-1;s>=0;s--)Rr(r.doc,i,o[s],m(o[s].line,o[s].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Wr&&r.refresh()}),n("specialCharPlaceholder",Es,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",Qe?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!_e),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Ja(r),on(r)},!0),n("keyMap","default",function(r,i,o){var a=Xn(i),s=o!=Wr&&Xn(o);s&&s.detach&&s.detach(r,a),a.attach&&a.attach(r,s||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Vl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Ii(i,r.options.lineNumbers),on(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ti(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Or(r)},!0),n("scrollbarStyle","native",function(r){qo(r),Or(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Ii(r.options.gutters,i),on(r)},!0),n("firstLineNumber",1,on,!0),n("lineNumberFormatter",function(r){return r},on,!0),n("showCursorWhenSelecting",!1,qr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(kr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Ql),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,qr,!0),n("singleCursorHeightPerLine",!0,qr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,an,!0),n("addModeClass",!1,an,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,an,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Ql(e,t,n){var r=n&&n!=Wr;if(!t!=!r){var i=e.display.dragFunctions,o=t?R:et;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Vl(e){e.options.lineWrapping?(oe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ve(e.display.wrapper,"CodeMirror-wrap"),vi(e)),ki(e),ft(e),Vr(e),setTimeout(function(){return Or(e)},100)}function we(e,t){var n=this;if(!(this instanceof we))return new we(e,t);this.options=t=t?J(t):{},J(Qa,t,!1);var r=t.value;typeof r=="string"?r=new dt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new we.inputStyles[t.inputStyle](this),o=this.display=new hl(e,r,i,t);o.wrapper.CodeMirror=this,Ja(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 j,keySeq:null,specialChars:null},t.autofocus&&!Qe&&o.input.focus(),D&&Z<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Ol(),pr(this),this.curOp.forceUpdate=!0,la(this,r),t.autofocus&&!Qe||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Oi(n)},20):kr(this);for(var a in Zn)Zn.hasOwnProperty(a)&&Zn[a](this,t[a],Wr);ta(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Ji.length;++s)Ji[s](this);vr(this),Q&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}we.defaults=Qa,we.optionHandlers=Zn;function ql(e){var t=e.display;R(t.scroller,"mousedown",He(e,Ga)),D&&Z<11?R(t.scroller,"dblclick",He(e,function(l){if(X(e,l))return;var u=hr(e,l);if(!u||Zi(e,l)||Xt(e.display,l))return;fe(l);var h=e.findWordAt(u);Bn(e.doc,h.anchor,h.head)})):R(t.scroller,"dblclick",function(l){return X(e,l)||fe(l)}),R(t.scroller,"contextmenu",function(l){return Za(e,l)}),R(t.input.getField(),"contextmenu",function(l){t.scroller.contains(l.target)||Za(e,l)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(l){if(l.touches.length!=1)return!1;var u=l.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(l,u){if(u.left==null)return!0;var h=u.left-l.left,f=u.top-l.top;return h*h+f*f>20*20}R(t.scroller,"touchstart",function(l){if(!X(e,l)&&!o(l)&&!Zi(e,l)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},l.touches.length==1&&(t.activeTouch.left=l.touches[0].pageX,t.activeTouch.top=l.touches[0].pageY)}}),R(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),R(t.scroller,"touchend",function(l){var u=t.activeTouch;if(u&&!Xt(t,l)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),f;!u.prev||a(u,u.prev)?f=new re(h,h):!u.prev.prev||a(u,u.prev.prev)?f=e.findWordAt(h):f=new re(m(h.line,0),z(e.doc,m(h.line+1,0))),e.setSelection(f.anchor,f.head),e.focus(),fe(l)}i()}),R(t.scroller,"touchcancel",i),R(t.scroller,"scroll",function(){t.scroller.clientHeight&&(en(e,t.scroller.scrollTop),dr(e,t.scroller.scrollLeft,!0),be(e,"scroll",e))}),R(t.scroller,"mousewheel",function(l){return ia(e,l)}),R(t.scroller,"DOMMouseScroll",function(l){return ia(e,l)}),R(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(l){X(e,l)||kt(l)},over:function(l){X(e,l)||(Ml(e,l),kt(l))},start:function(l){return kl(e,l)},drop:He(e,Tl),leave:function(l){X(e,l)||Da(e)}};var s=t.input.getField();R(s,"keyup",function(l){return ja.call(e,l)}),R(s,"keydown",He(e,Ha)),R(s,"keypress",He(e,Ka)),R(s,"focus",function(l){return Oi(e,l)}),R(s,"blur",function(l){return kr(e,l)})}var Ji=[];we.defineInitHook=function(e){return Ji.push(e)};function bn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=Xr(e,t).state:n="prev");var a=e.options.tabSize,s=_(i,t),l=M(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u=s.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(s.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,s.text.slice(u.length),s.text),h==Ye||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=M(_(i,t-1).text,null,a):h=0:n=="add"?h=l+e.options.indentUnit:n=="subtract"?h=l-e.options.indentUnit:typeof n=="number"&&(h=l+n),h=Math.max(0,h);var f="",c=0;if(e.options.indentWithTabs)for(var d=Math.floor(h/a);d;--d)c+=a,f+=" ";if(c<h&&(f+=W(h-c)),f!=u)return Rr(i,f,m(t,0),m(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<i.sel.ranges.length;p++){var v=i.sel.ranges[p];if(v.head.line==t&&v.head.ch<u.length){var y=m(t,u.length);Hi(i,p,new re(y,y));break}}}var Nt=null;function Jn(e){Nt=e}function Qi(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s=i=="paste"||e.state.pasteIncoming>a,l=It(t),u=null;if(s&&r.ranges.length>1)if(Nt&&Nt.text.join(`
`)==t){if(r.ranges.length%Nt.text.length==0){u=[];for(var h=0;h<Nt.text.length;h++)u.push(o.splitLines(Nt.text[h]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=H(l,function(w){return[w]}));for(var f=e.curOp.updateInput,c=r.ranges.length-1;c>=0;c--){var d=r.ranges[c],p=d.from(),v=d.to();d.empty()&&(n&&n>0?p=m(p.line,p.ch-n):e.state.overwrite&&!s?v=m(v.line,Math.min(_(o,v.line).text.length,v.ch+T(l).length)):s&&Nt&&Nt.lineWise&&Nt.text.join(`
`)==l.join(`
`)&&(p=v=m(p.line,0)));var y={from:p,to:v,text:u?u[c%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Dr(e.doc,y),Ze(e,"inputRead",e,y)}t&&!s&&qa(e,t),Mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Va(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&yt(t,function(){return Qi(t,n,0,null,"paste")}),!0}function qa(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=bn(e,i.head.line,"smart");break}}else o.electricInput&&(o.electricInput.test(_(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=bn(e,i.head.line,"smart")));a&&Ze(e,"electricInput",e,i.head.line)}}function $a(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:m(i,0),head:m(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function es(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function ts(){var e=k("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=k("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Q?e.style.width="1000px":e.setAttribute("wrap","off"),nt&&(e.style.border="1px solid black"),es(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];if(o[r]==i&&r!="mode")return;o[r]=i,t.hasOwnProperty(r)&&He(this,t[r])(this,i,a),be(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Xn(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:ot(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");he(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,ft(this)}),removeOverlay:ot(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,ft(this);return}}}),indentLine:ot(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Gr(this.doc,r)&&bn(this,r,i,o)}),indentSelection:ot(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var s=i[a];if(s.empty())s.head.line>o&&(bn(this,s.head.line,r,!0),o=s.head.line,a==this.doc.sel.primIndex&&Mr(this));else{var l=s.from(),u=s.to(),h=Math.max(o,l.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var f=h;f<o;++f)bn(this,f,r);var c=this.doc.sel.ranges;l.ch==0&&i.length==c.length&&c[a].from().ch>0&&Hi(this.doc,a,new re(l,c[a].to()),C)}}}),getTokenAt:function(r,i){return so(this,r,i)},getLineTokens:function(r,i){return so(this,m(r),i,!0)},getTokenTypeAt:function(r){r=z(this.doc,r);var i=io(this,_(this.doc,r.line)),o=0,a=(i.length-1)/2,s=r.ch,l;if(s==0)l=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=s)a=u;else if(i[u*2+1]<s)o=u+1;else{l=i[u*2+2];break}}var h=l?l.indexOf("overlay "):-1;return h<0?l:h==0?null:l.slice(0,h-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],s=this.getModeAt(r);if(typeof s[i]=="string")a[s[i]]&&o.push(a[s[i]]);else if(s[i])for(var l=0;l<s[i].length;l++){var u=a[s[i][l]];u&&o.push(u)}else s.helperType&&a[s.helperType]?o.push(a[s.helperType]):a[s.name]&&o.push(a[s.name]);for(var h=0;h<a._global.length;h++){var f=a._global[h];f.pred(s,this)&&G(o,f.val)==-1&&o.push(f.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=to(o,r==null?o.first+o.size-1:r),Xr(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=z(this.doc,r):o=r?a.from():a.to(),Dt(this,o,i||"page")},charCoords:function(r,i){return xi(this,z(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Wo(this,r,i||"page"),Si(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Wo(this,{top:r,left:0},i||"page").top,sr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,s;if(typeof r=="number"){var l=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>l&&(r=l,a=!0),s=_(this.doc,r)}else s=r;return An(this,s,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Gt(s):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,s){var l=this.display;r=Dt(this,z(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),l.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var f=Math.max(l.wrapper.clientHeight,this.doc.height),c=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>f)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=f&&(u=r.bottom),h+i.offsetWidth>c&&(h=c-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",s=="right"?(h=l.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?h=0:s=="middle"&&(h=(l.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&Qs(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:ot(Ha),triggerOnKeyPress:ot(Ka),triggerOnKeyUp:ja,triggerOnMouseDown:ot(Ga),execCommand:function(r){if(vn.hasOwnProperty(r))return vn[r].call(null,this)},triggerElectric:ot(function(r){qa(this,r)}),findPosH:function(r,i,o,a){var s=1;i<0&&(s=-1,i=-i);for(var l=z(this.doc,r),u=0;u<i&&!(l=Vi(this.doc,l,s,o,a),l.hitSide);++u);return l},moveH:ot(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?Vi(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},L)}),deleteH:ot(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):Ir(this,function(s){var l=Vi(a,s.head,r,i,!1);return r<0?{from:l,to:s.head}:{from:s.head,to:l}})}),findPosV:function(r,i,o,a){var s=1,l=a;i<0&&(s=-1,i=-i);for(var u=z(this.doc,r),h=0;h<i;++h){var f=Dt(this,u,"div");if(l==null?l=f.left:f.left=l,u=rs(this,f,s,o),u.hitSide)break}return u},moveV:ot(function(r,i){var o=this,a=this.doc,s=[],l=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(h){if(l)return r<0?h.from():h.to();var f=Dt(o,h.head,"div");h.goalColumn!=null&&(f.left=h.goalColumn),s.push(f.left);var c=rs(o,f,r,i);return i=="page"&&h==a.sel.primary()&&Ai(o,xi(o,c,"div").top-f.top),c},L),s.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=s[u]}),findWordAt:function(r){var i=this.doc,o=_(i,r.line).text,a=r.ch,s=r.ch;if(o){var l=this.getHelper(r,"wordChars");(r.sticky=="before"||s==o.length)&&a?--a:++s;for(var u=o.charAt(a),h=qe(u,l)?function(f){return qe(f,l)}:/\s/.test(u)?function(f){return/\s/.test(f)}:function(f){return!/\s/.test(f)&&!qe(f)};a>0&&h(o.charAt(a-1));)--a;for(;s<o.length&&h(o.charAt(s));)++s}return new re(m(r.line,a),m(r.line,s))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?oe(this.display.cursorDiv,"CodeMirror-overwrite"):ve(this.display.cursorDiv,"CodeMirror-overwrite"),be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==Ce()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ot(function(r,i){$r(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-zt(this)-this.display.barHeight,width:r.scrollWidth-zt(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:lr(this)}},scrollIntoView:ot(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:m(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Vs(this,r):Zo(this,r.from,r.to,r.margin)}),setSize:ot(function(r,i){var o=this,a=function(l){return typeof l=="number"||/^\d+$/.test(String(l))?l+"px":l};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&No(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(l){if(l.widgets){for(var u=0;u<l.widgets.length;u++)if(l.widgets[u].noHScroll){Vt(o,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,be(this,"refresh",this)}),operation:function(r){return yt(this,r)},startOperation:function(){return pr(this)},endOperation:function(){return vr(this)},refresh:ot(function(){var r=this.display.cachedTextHeight;ft(this),this.curOp.forceUpdate=!0,Vr(this),$r(this,this.doc.scrollLeft,this.doc.scrollTop),Ni(this.display),(r==null||Math.abs(r-Lr(this.display))>.5||this.options.lineWrapping)&&ki(this),be(this,"refresh",this)}),swapDoc:ot(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),la(this,r),Vr(this),this.display.input.reset(),$r(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ze(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function Vi(e,t,n,r,i){var o=t,a=n,s=_(e,t.line),l=i&&e.direction=="rtl"?-n:n;function u(){var S=t.line+l;return S<e.first||S>=e.first+e.size?!1:(t=new m(S,t.ch,t.sticky),s=_(e,S))}function h(S){var x;if(r=="codepoint"){var E=s.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(E)?x=null:x=new m(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(E>=55296&&E<56320?2:1))),-n)}else i?x=Nl(e.cm,s,t,n):x=Ki(s,t,n);if(x==null)if(!S&&u())t=Gi(i,e.cm,s,t.line,l);else return!1;else t=x;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var f=null,c=r=="group",d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0&&!h(!p));p=!1){var v=s.text.charAt(t.ch)||`
`,y=qe(v,d)?"w":c&&v==`
`?"n":!c||/\s/.test(v)?null:"p";if(c&&!p&&!y&&(y="s"),f&&f!=y){n<0&&(n=1,h(),t.sticky="after");break}if(y&&(f=y),n>0&&!h(!p))break}var w=jn(e,t,o,a,!0);return si(o,w)&&(w.hitSide=!0),w}function rs(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*Lr(e.display),3);a=(n>0?t.bottom:t.top)+n*l}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;!(u=Si(e,o,a),!u.outside);){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var se=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};se.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;es(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(s){for(var l=s.target;l;l=l.parentNode){if(l==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(l.className))break}return!1}R(i,"paste",function(s){if(!o(s)||X(r,s)||Va(s,r))return;Z<=11&&setTimeout(He(r,function(){return t.updateFromDOM()}),20)}),R(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),R(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),R(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),R(i,"touchstart",function(){return n.forceCompositionEnd()}),R(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(s){if(!o(s)||X(r,s))return;if(r.somethingSelected())Jn({lineWise:!1,text:r.getSelections()}),s.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var l=$a(r);Jn({lineWise:!0,text:l.text}),s.type=="cut"&&r.operation(function(){r.setSelections(l.ranges,0,C),r.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var u=Nt.text.join(`
`);if(s.clipboardData.setData("Text",u),s.clipboardData.getData("Text")==u){s.preventDefault();return}}var h=ts(),f=h.firstChild;r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),f.value=Nt.text.join(`
`);var c=document.activeElement;Ot(f),setTimeout(function(){r.display.lineSpace.removeChild(h),c.focus(),c==i&&n.showPrimarySelection()},50)}R(i,"copy",a),R(i,"cut",a)},se.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},se.prototype.prepareSelection=function(){var e=jo(this.cm,!1);return e.focus=document.activeElement==this.div,e},se.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},se.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},se.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=Qn(t,e.anchorNode,e.anchorOffset),a=Qn(t,e.focusNode,e.focusOffset);if(o&&!o.bad&&a&&!a.bad&&U(Cn(o,a),r)==0&&U(xn(o,a),i)==0)return;var s=t.display.view,l=r.line>=t.display.viewFrom&&ns(t,r)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ns(t,i);if(!u){var h=s[s.length-1].measure,f=h.maps?h.maps[h.maps.length-1]:h.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!l||!u){e.removeAllRanges();return}var c=e.rangeCount&&e.getRangeAt(0),d;try{d=$(l.node,l.offset,u.offset,u.node)}catch(p){}d&&(!ue&&t.state.focused?(e.collapse(l.node,l.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),c&&e.anchorNode==null?e.addRange(c):ue&&this.startGracePeriod()),this.rememberSelection()},se.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},se.prototype.showMultipleSelections=function(e){ie(this.cm.display.cursorDiv,e.cursors),ie(this.cm.display.selectionDiv,e.selection)},se.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},se.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return it(this.div,t)},se.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},se.prototype.blur=function(){this.div.blur()},se.prototype.getField=function(){return this.div},se.prototype.supportsTouch=function(){return!0},se.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():yt(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},se.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},se.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(gt&&q&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=Qn(t,e.anchorNode,e.anchorOffset),r=Qn(t,e.focusNode,e.focusOffset);n&&r&&yt(t,function(){tt(t.doc,$t(n,r),C),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},se.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=m(r.line-1,_(e.doc,r.line-1).length)),i.ch==_(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=m(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,s;r.line==t.viewFrom||(o=fr(e,r.line))==0?(a=ae(t.view[0].line),s=t.view[0].node):(a=ae(t.view[o].line),s=t.view[o-1].node.nextSibling);var l=fr(e,i.line),u,h;if(l==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=ae(t.view[l+1].line)-1,h=t.view[l+1].node.previousSibling),!s)return!1;for(var f=e.doc.splitLines(tu(e,s,h,a,u)),c=ar(e.doc,m(a,0),m(u,_(e.doc,u).text.length));f.length>1&&c.length>1;)if(T(f)==T(c))f.pop(),c.pop(),u--;else if(f[0]==c[0])f.shift(),c.shift(),a++;else break;for(var d=0,p=0,v=f[0],y=c[0],w=Math.min(v.length,y.length);d<w&&v.charCodeAt(d)==y.charCodeAt(d);)++d;for(var S=T(f),x=T(c),E=Math.min(S.length-(f.length==1?d:0),x.length-(c.length==1?d:0));p<E&&S.charCodeAt(S.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(f.length==1&&c.length==1&&a==r.line)for(;d&&d>r.ch&&S.charCodeAt(S.length-p-1)==x.charCodeAt(x.length-p-1);)d--,p++;f[f.length-1]=S.slice(0,S.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var I=m(a,d),A=m(u,c.length?T(c).length-p:0);if(f.length>1||f[0]||U(I,A))return Rr(e.doc,f,I,A,"+input"),!0},se.prototype.ensurePolled=function(){this.forceCompositionEnd()},se.prototype.reset=function(){this.forceCompositionEnd()},se.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},se.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},se.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&yt(this.cm,function(){return ft(e.cm)})},se.prototype.setUneditable=function(e){e.contentEditable="false"},se.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||He(this.cm,Qi)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},se.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},se.prototype.onContextMenu=function(){},se.prototype.resetPosition=function(){},se.prototype.needsContentAttribute=!0;function ns(e,t){var n=bi(e,t.line);if(!n||n.hidden)return null;var r=_(e.doc,t.line),i=Oo(n,r,t.line),o=ht(r,e.doc.direction),a="left";if(o){var s=Et(o,t.ch);a=s%2?"right":"left"}var l=Do(i.map,t.ch,a);return l.offset=l.collapse=="right"?l.end:l.start,l}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fr(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(d){return function(p){return p.id==d}}function h(){a&&(o+=s,l&&(o+=s),a=l=!1)}function f(d){d&&(h(),o+=d)}function c(d){if(d.nodeType==1){var p=d.getAttribute("cm-text");if(p){f(p);return}var v=d.getAttribute("cm-marker"),y;if(v){var w=e.findMarks(m(r,0),m(i+1,0),u(+v));w.length&&(y=w[0].find(0))&&f(ar(e.doc,y.from,y.to).join(s));return}if(d.getAttribute("contenteditable")=="false")return;var S=/^(pre|div|p|li|table|br)$/i.test(d.nodeName);if(!/^br$/i.test(d.nodeName)&&d.textContent.length==0)return;S&&h();for(var x=0;x<d.childNodes.length;x++)c(d.childNodes[x]);/^(pre|p)$/i.test(d.nodeName)&&(l=!0),S&&(a=!0)}else d.nodeType==3&&f(d.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(c(t),t==n);)t=t.nextSibling,l=!1;return o}function Qn(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Fr(e.clipPos(m(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ru(o,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!it(r,t))return Fr(m(ae(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?T(e.rest):e.line;return Fr(m(ae(o),o.text.length),i)}var a=t.nodeType==3?t:null,s=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,u=l.maps;function h(y,w,S){for(var x=-1;x<(u?u.length:0);x++)for(var E=x<0?l.map:u[x],I=0;I<E.length;I+=3){var A=E[I+2];if(A==y||A==w){var K=ae(x<0?e.line:e.rest[x]),de=E[I]+S;return(S<0||A!=y)&&(de=E[I+(S?1:0)]),m(K,de)}}}var f=h(a,s,n);if(f)return Fr(f,i);for(var c=s.nextSibling,d=a?a.nodeValue.length-n:0;c;c=c.nextSibling){if(f=h(c,c.firstChild,0),f)return Fr(m(f.line,f.ch-d),i);d+=c.textContent.length}for(var p=s.previousSibling,v=n;p;p=p.previousSibling){if(f=h(p,p.firstChild,-1),f)return Fr(m(f.line,f.ch+v),i);v+=p.textContent.length}}var Me=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};Me.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),nt&&(i.style.width="0px"),R(i,"input",function(){D&&Z>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),R(i,"paste",function(a){if(X(r,a)||Va(a,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function o(a){if(X(r,a))return;if(r.somethingSelected())Jn({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var s=$a(r);Jn({lineWise:!0,text:s.text}),a.type=="cut"?r.setSelections(s.ranges,null,C):(n.prevInput="",i.value=s.text.join(`
`),Ot(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}R(i,"cut",o),R(i,"copy",o),R(e.scroller,"paste",function(a){if(Xt(e,a)||X(r,a))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var s=new Event("paste");s.clipboardData=a.clipboardData,i.dispatchEvent(s)}),R(e.lineSpace,"selectstart",function(a){Xt(e,a)||fe(a)}),R(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),R(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Me.prototype.createField=function(e){this.wrapper=ts(),this.textarea=this.wrapper.firstChild},Me.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Me.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=jo(e);if(e.options.moveInputWithCursor){var i=Dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Me.prototype.showSelection=function(e){var t=this.cm,n=t.display;ie(n.cursorDiv,e.cursors),ie(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Me.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Ot(this.textarea),D&&Z>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",D&&Z>=9&&(this.hasSelection=null))},Me.prototype.getField=function(){return this.textarea},Me.prototype.supportsTouch=function(){return!1},Me.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Qe||Ce()!=this.textarea))try{this.textarea.focus()}catch(e){}},Me.prototype.blur=function(){this.textarea.blur()},Me.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Me.prototype.receivedFocus=function(){this.slowPoll()},Me.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Me.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Me.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Jt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(D&&Z>=9&&this.hasSelection===i||xe&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(r.length,i.length);a<s&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return yt(t,function(){Qi(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Me.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Me.prototype.onKeyPress=function(){D&&Z>=9&&(this.hasSelection=null),this.fastPoll()},Me.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=hr(n,e),a=r.scroller.scrollTop;if(!o||F)return;var s=n.options.resetSelectionOnContextMenu;s&&n.doc.sel.contains(o)==-1&&He(n,tt)(n.doc,$t(o),C);var l=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var f;Q&&(f=window.scrollY),r.input.focus(),Q&&window.scrollTo(null,f),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=d,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function c(){if(i.selectionStart!=null){var v=n.somethingSelected(),y="\u200B"+(v?i.value:"");i.value="\u21DA",i.value=y,t.prevInput=v?"":"\u200B",i.selectionStart=1,i.selectionEnd=y.length,r.selForContextMenu=n.doc.sel}}function d(){if(t.contextMenuPending!=d)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=l,D&&Z<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null){(!D||D&&Z<9)&&c();var v=0,y=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?He(n,xa)(n):v++<10?r.detectingSelectAll=setTimeout(y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(y,200)}}if(D&&Z>=9&&c(),Fe){kt(e);var p=function(){et(window,"mouseup",p),setTimeout(d,20)};R(window,"mouseup",p)}else setTimeout(d,50)},Me.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Me.prototype.setUneditable=function(){},Me.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?J(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=Ce();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(R(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(l){l.save=r,l.getTextArea=function(){return e},l.toTextArea=function(){l.toTextArea=isNaN,r(),e.parentNode.removeChild(l.getWrapperElement()),e.style.display="",e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=we(function(l){return e.parentNode.insertBefore(l,e.nextSibling)},t);return s}function iu(e){e.off=et,e.on=R,e.wheelEventPixels=fl,e.Doc=dt,e.splitLines=It,e.countColumn=M,e.findColumn=O,e.isWordChar=ye,e.Pass=Ye,e.signal=be,e.Line=Cr,e.changeEnd=er,e.scrollbarModel=Vo,e.Pos=m,e.cmpPos=U,e.modes=Kr,e.mimeModes=wr,e.resolveMode=wn,e.getMode=ni,e.modeExtensions=xr,e.extendMode=as,e.copyState=or,e.startState=eo,e.innerMode=ii,e.commands=vn,e.keyMap=Yt,e.keyName=Wa,e.isModifierKey=Pa,e.lookupKey=Pr,e.normalizeKeyMap=Rl,e.StringStream=Ne,e.SharedTextMarker=dn,e.TextMarker=rr,e.LineWidget=fn,e.e_preventDefault=fe,e.e_stopPropagation=Re,e.e_stop=kt,e.addClass=oe,e.contains=it,e.rmClass=ve,e.keyNames=nr}Jl(we),$l(we);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Vn in dt.prototype)dt.prototype.hasOwnProperty(Vn)&&G(ou,Vn)<0&&(we.prototype[Vn]=function(e){return function(){return e.apply(this.doc,arguments)}}(dt.prototype[Vn]));return Te(dt),we.inputStyles={textarea:Me,contenteditable:se},we.defineMode=function(e){!we.defaults.mode&&e!="null"&&(we.defaults.mode=e),is.apply(this,arguments)},we.defineMIME=os,we.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),we.defineMIME("text/plain","null"),we.defineExtension=function(e,t){we.prototype[e]=t},we.defineDocExtension=function(e,t){dt.prototype[e]=t},we.fromTextArea=nu,iu(we),we.version="5.58.2",we})},Y1PL:function(st,Ee,g){"use strict";g.r(Ee),g.d(Ee,"ResizableTextArea",function(){return G});var Y=g("wx14"),pe=g("1OyB"),ue=g("vuIU"),Oe=g("Ji7U"),B=g("LK+K"),P=g("q1tI"),D=g("VTBJ"),Z=g("rePB"),Q=g("Zm9Q"),Le=g("Kwbf"),q=g("c+Xe"),F=g("m+aA"),lt=g("bdgK"),We=new Map;function Mt(C){C.forEach(function(N){var L,O=N.target;(L=We.get(O))===null||L===void 0||L.forEach(function(b){return b(O)})})}var nt=new lt.default(Mt),gt=null,Qe=null;function xe(C,N){We.has(C)||(We.set(C,new Set),nt.observe(C)),We.get(C).add(N)}function Xe(C,N){We.has(C)&&(We.get(C).delete(N),We.get(C).size||(nt.unobserve(C),We.delete(C)))}var _e=function(C){Object(Oe.a)(L,C);var N=Object(B.a)(L);function L(){return Object(pe.a)(this,L),N.apply(this,arguments)}return Object(ue.a)(L,[{key:"render",value:function(){return this.props.children}}]),L}(P.Component),ce=P.createContext(null);function Ae(C){var N=C.children,L=C.onBatchResize,O=P.useRef(0),b=P.useRef([]),W=P.useContext(ce),T=P.useCallback(function(H,he,ne){O.current+=1;var De=O.current;b.current.push({size:H,element:he,data:ne}),Promise.resolve().then(function(){De===O.current&&(L==null||L(b.current),b.current=[])}),W==null||W(H,he,ne)},[L,W]);return P.createElement(ce.Provider,{value:T},N)}function Fe(C){var N=C.children,L=C.disabled,O=P.useRef(null),b=P.useRef(null),W=P.useContext(ce),T=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),H=P.isValidElement(N)&&Object(q.c)(N),he=H?N.ref:null,ne=P.useMemo(function(){return Object(q.a)(he,O)},[he,O]),De=P.useRef(C);De.current=C;var Be=P.useCallback(function(ye){var qe=De.current,_t=qe.onResize,$e=qe.data,te=ye.getBoundingClientRect(),ge=te.width,ut=te.height,xt=ye.offsetWidth,mt=ye.offsetHeight,Et=Math.floor(ge),yr=Math.floor(ut);if(T.current.width!==Et||T.current.height!==yr||T.current.offsetWidth!==xt||T.current.offsetHeight!==mt){var ht={width:Et,height:yr,offsetWidth:xt,offsetHeight:mt};T.current=ht;var Lt=xt===Math.round(ge)?ge:xt,R=mt===Math.round(ut)?ut:mt,At=Object(D.a)(Object(D.a)({},ht),{},{offsetWidth:Lt,offsetHeight:R});W==null||W(At,ye,$e),_t&&Promise.resolve().then(function(){_t(At,ye)})}},[]);return P.useEffect(function(){var ye=Object(F.a)(O.current)||Object(F.a)(b.current);return ye&&!L&&xe(ye,Be),function(){return Xe(ye,Be)}},[O.current,L]),P.createElement(_e,{ref:b},H?P.cloneElement(N,{ref:ne}):N)}var Ue="rc-observer-key";function ve(C){var N=C.children,L=Object(Q.a)(N);return L.map(function(O,b){var W=(O==null?void 0:O.key)||"".concat(Ue,"-").concat(b);return P.createElement(Fe,Object(Y.a)({},C,{key:W}),O)})}ve.Collection=Ae;var me=ve,ie=g("bT9E"),k=g("TSYQ"),le=g.n(k),$=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,it=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],Ce={},oe;function wt(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=C.getAttribute("id")||C.getAttribute("data-reactid")||C.getAttribute("name");if(N&&Ce[L])return Ce[L];var O=window.getComputedStyle(C),b=O.getPropertyValue("box-sizing")||O.getPropertyValue("-moz-box-sizing")||O.getPropertyValue("-webkit-box-sizing"),W=parseFloat(O.getPropertyValue("padding-bottom"))+parseFloat(O.getPropertyValue("padding-top")),T=parseFloat(O.getPropertyValue("border-bottom-width"))+parseFloat(O.getPropertyValue("border-top-width")),H=it.map(function(ne){return"".concat(ne,":").concat(O.getPropertyValue(ne))}).join(";"),he={sizingStyle:H,paddingSize:W,borderSize:T,boxSizing:b};return N&&L&&(Ce[L]=he),he}function Ot(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,O=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;oe||(oe=document.createElement("textarea"),oe.setAttribute("tab-index","-1"),oe.setAttribute("aria-hidden","true"),document.body.appendChild(oe)),C.getAttribute("wrap")?oe.setAttribute("wrap",C.getAttribute("wrap")):oe.removeAttribute("wrap");var b=wt(C,N),W=b.paddingSize,T=b.borderSize,H=b.boxSizing,he=b.sizingStyle;oe.setAttribute("style","".concat(he,";").concat($)),oe.value=C.value||C.placeholder||"";var ne=Number.MIN_SAFE_INTEGER,De=Number.MAX_SAFE_INTEGER,Be=oe.scrollHeight,ye;if(H==="border-box"?Be+=T:H==="content-box"&&(Be-=W),L!==null||O!==null){oe.value=" ";var qe=oe.scrollHeight-W;L!==null&&(ne=qe*L,H==="border-box"&&(ne=ne+W+T),Be=Math.max(ne,Be)),O!==null&&(De=qe*O,H==="border-box"&&(De=De+W+T),ye=Be>De?"":"hidden",Be=Math.min(De,Be))}return{height:Be,minHeight:ne,maxHeight:De,overflowY:ye,resize:"none"}}var jt=g("Gytx"),J=g.n(jt),M;(function(C){C[C.NONE=0]="NONE",C[C.RESIZING=1]="RESIZING",C[C.RESIZED=2]="RESIZED"})(M||(M={}));var j=function(C){Object(Oe.a)(L,C);var N=Object(B.a)(L);function L(O){var b;return Object(pe.a)(this,L),b=N.call(this,O),b.nextFrameActionId=void 0,b.resizeFrameId=void 0,b.textArea=void 0,b.saveTextArea=function(W){b.textArea=W},b.handleResize=function(W){var T=b.state.resizeStatus,H=b.props,he=H.autoSize,ne=H.onResize;if(T!==M.NONE)return;typeof ne=="function"&&ne(W),he&&b.resizeOnNextFrame()},b.resizeOnNextFrame=function(){cancelAnimationFrame(b.nextFrameActionId),b.nextFrameActionId=requestAnimationFrame(b.resizeTextarea)},b.resizeTextarea=function(){var W=b.props.autoSize;if(!W||!b.textArea)return;var T=W.minRows,H=W.maxRows,he=Ot(b.textArea,!1,T,H);b.setState({textareaStyles:he,resizeStatus:M.RESIZING},function(){cancelAnimationFrame(b.resizeFrameId),b.resizeFrameId=requestAnimationFrame(function(){b.setState({resizeStatus:M.RESIZED},function(){b.resizeFrameId=requestAnimationFrame(function(){b.setState({resizeStatus:M.NONE}),b.fixFirefoxAutoScroll()})})})})},b.renderTextArea=function(){var W=b.props,T=W.prefixCls,H=T===void 0?"rc-textarea":T,he=W.autoSize,ne=W.onResize,De=W.className,Be=W.disabled,ye=b.state,qe=ye.textareaStyles,_t=ye.resizeStatus,$e=Object(ie.a)(b.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),te=le()(H,De,Object(Z.a)({},"".concat(H,"-disabled"),Be));"value"in $e&&($e.value=$e.value||"");var ge=Object(D.a)(Object(D.a)(Object(D.a)({},b.props.style),qe),_t===M.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(me,{onResize:b.handleResize,disabled:!(he||ne)},P.createElement("textarea",Object(Y.a)({},$e,{className:te,style:ge,ref:b.saveTextArea})))},b.state={textareaStyles:{},resizeStatus:M.NONE},b}return Object(ue.a)(L,[{key:"componentDidUpdate",value:function(b){(b.value!==this.props.value||!J()(b.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var b=this.textArea.selectionStart,W=this.textArea.selectionEnd;this.textArea.setSelectionRange(b,W)}}catch(T){}}},{key:"render",value:function(){return this.renderTextArea()}}]),L}(P.Component),G=j,Ve=function(C){Object(Oe.a)(L,C);var N=Object(B.a)(L);function L(O){var b;Object(pe.a)(this,L),b=N.call(this,O),b.resizableTextArea=void 0,b.focus=function(){b.resizableTextArea.textArea.focus()},b.saveTextArea=function(T){b.resizableTextArea=T},b.handleChange=function(T){var H=b.props.onChange;b.setValue(T.target.value,function(){b.resizableTextArea.resizeTextarea()}),H&&H(T)},b.handleKeyDown=function(T){var H=b.props,he=H.onPressEnter,ne=H.onKeyDown;T.keyCode===13&&he&&he(T),ne&&ne(T)};var W=typeof O.value=="undefined"||O.value===null?O.defaultValue:O.value;return b.state={value:W},b}return Object(ue.a)(L,[{key:"setValue",value:function(b,W){"value"in this.props||this.setState({value:b},W)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(G,Object(Y.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(b){return"value"in b?{value:b.value}:null}}]),L}(P.Component),Ye=Ee.default=Ve},bT9E:function(st,Ee,g){"use strict";g.d(Ee,"a",function(){return pe});var Y=g("VTBJ");function pe(ue,Oe){var B=Object(Y.a)({},ue);return Array.isArray(Oe)&&Oe.forEach(function(P){delete B[P]}),B}},baNF:function(st,Ee,g){"use strict";g.r(Ee);var Y=g("5NDa"),pe=g("5rEg"),ue=g("k1fw"),Oe=g("9og8"),B=g("y8nQ"),P=g("Vl3Y"),D=g("tJVT"),Z=g("PpiC"),Q=g("WmNS"),Le=g.n(Q),q=g("q1tI"),F=g.n(q),lt=g("Ty5D"),We=g("9kvl"),Mt=g("7ahc"),nt=g("9ZNV"),gt=g("y37m"),Qe=g.n(gt),xe=function(_e){var ce=_e.shixunsDetail,Ae=_e.globalSetting,Fe=_e.loading,Ue=_e.user,ve=_e.dispatch,me=Object(Z.a)(_e,["shixunsDetail","globalSetting","loading","user","dispatch"]),ie=Object(lt.h)(),k=Object(q.useState)({}),le=Object(D.a)(k,2),$=le[0],it=le[1],Ce=Object(q.useRef)(),oe=Object(q.useRef)(),wt=P.a.useForm(),Ot=Object(D.a)(wt,1),jt=Ot[0],J=Object(q.useState)(""),M=Object(D.a)(J,2),j=M[0],G=M[1];Object(q.useEffect)(function(){return ve({type:"globalSetting/footerToggle",payload:!1}),function(){ve({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(q.useEffect)(function(){var C=sessionStorage.getItem("pathArray");if(C){var N=C.split(",").join("/"),L=N.indexOf("/")===0?N.substr(1):N;G(L)}},[]),Object(q.useEffect)(function(){var C,N,L,O;oe.current=(C=ie.pathname)===null||C===void 0||((N=C.split("/"))===null||N===void 0)?void 0:N[2],Ce.current=((L=ie.pathname)===null||L===void 0||((O=L.split("/"))===null||O===void 0)?void 0:O[3])==="repository"},[]);var Ve=function(){var C=Object(Oe.a)(Le.a.mark(function N(){var L,O,b,W=arguments;return Le.a.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:return L=W.length>0&&W[0]!==void 0?W[0]:{},H.next=3,ve({type:"shixunsDetail/addRepositoryFile",payload:{id:oe.current,message:L.commitMessage,content:L.codeMirror,path:"".concat(j?"".concat(j,"/"):"").concat(L.path||""),secret_repository:Ce.current?void 0:!0}});case 3:O=H.sent,O&&(b=Ce.current?"/shixuns/".concat(oe.current,"/repository").concat(j?"/master/shixun_show/".concat(j):""):"/shixuns/".concat(oe.current,"/secret_repository"),We.d.replace(b));case 5:case"end":return H.stop()}},N)}));return function(){return C.apply(this,arguments)}}(),Ye=function(){var N,L;We.d.push("/shixuns/".concat(oe.current,"/").concat((N=ie.pathname)===null||N===void 0||((L=N.split("/"))===null||L===void 0)?void 0:L[3]).concat(j?"/master/shixun_show/".concat(j):""))};return F.a.createElement("section",{className:Qe.a.bg},F.a.createElement("div",{className:Qe.a.wrap},F.a.createElement("div",{className:Qe.a.title},"\u65B0\u5EFA\u6587\u4EF6"),F.a.createElement(P.a,{className:"mt10",form:jt,scrollToFirstError:!0,layout:"vertical",onFinish:Ve,onValuesChange:function(){return it(Object(ue.a)({},jt.getFieldsValue()))}},F.a.createElement(P.a.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},F.a.createElement(P.a.Item,{name:"path",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}],noStyle:!0},F.a.createElement("span",null,F.a.createElement("span",{className:"mr5"},j?"".concat(j,"/"):""),F.a.createElement(pe.a,{className:Qe.a.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),F.a.createElement("span",{className:"ml5"},"\u63D0\u793A\uFF1A1.\u8F93\u5165\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6\uFF1B2.\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u65B0\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u65B0\u6587\u4EF6\u5939\u548C\u65B0\u6587\u4EF6\u3002\uFF08\u5982\uFF1Astep1/HelloWorld.java\uFF09")),F.a.createElement(P.a.Item,{label:"\u63D0\u4EA4\u4FE1\u606F\uFF1A",name:"commitMessage",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63D0\u4EA4\u4FE1\u606F"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},F.a.createElement(pe.a,{placeholder:"\u8BF7\u8F93\u5165\u672C\u6B21\u63D0\u4EA4\u7684\u4E3B\u8981\u4FE1\u606F\uFF0C\u5408\u7406\u7684\u63CF\u8FF0\u4FE1\u606F\u6709\u5229\u4E8E\u4EE3\u7801\u5386\u53F2\u8BB0\u5F55\u7684\u7BA1\u7406"})),F.a.createElement("div",{className:"mt10 mb20"},F.a.createElement(P.a.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},F.a.createElement(Mt.a,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),F.a.createElement(P.a.Item,{noStyle:!0},F.a.createElement(nt.a,{okButtonProps:{htmlType:"submit"},onCancel:Ye})))))};Ee.default=Object(We.a)(function(Xe){var _e=Xe.shixunsDetail,ce=Xe.loading,Ae=Xe.globalSetting,Fe=Xe.user;return{shixunsDetail:_e,globalSetting:Ae,user:Fe,loading:ce.models.index}})(xe)},c5Ni:function(st,Ee,g){},"p77/":function(st,Ee,g){},y37m:function(st,Ee,g){st.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]);