@alicloud/console-components-search 0.2.18 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/components-with-style.tsx +3 -1
- package/demos/demo1.demo.tsx +18 -29
- package/demos/fuzzy.demo.tsx +97 -0
- package/dist/index.css +14 -8
- package/dist/index.js +51 -28
- package/doc-dist/10.js +1 -1
- package/doc-dist/11.js +1 -1
- package/doc-dist/12.js +1 -1
- package/doc-dist/13.js +1 -1
- package/doc-dist/14.js +1 -1
- package/doc-dist/15.js +1 -1
- package/doc-dist/16.js +6 -0
- package/doc-dist/9.js +1 -1
- package/doc-dist/deps/main.css +1 -1
- package/doc-dist/deps/main.js +7 -7
- package/doc-dist/deps/main.os.css +1 -1
- package/doc-dist/index.js +1 -1
- package/doc-dist/log-deps-build.log +3 -3
- package/es/ComplexSearch/InputPrefix.js +16 -7
- package/es/ComplexSearch/index.js +56 -17
- package/es/searchTagList/PureTag.js +3 -3
- package/es/searchTagList/index.js +2 -2
- package/es/style.js +3 -3
- package/lib/ComplexSearch/InputPrefix.js +16 -7
- package/lib/ComplexSearch/index.js +55 -16
- package/lib/searchTagList/PureTag.js +3 -3
- package/lib/searchTagList/index.js +2 -2
- package/lib/style.js +3 -3
- package/lib/types/IRcSearchProps.type.d.ts +5 -1
- package/package.json +1 -1
package/doc-dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ window.__CONSOLE_OS_GLOBAL_HOOK__("console-fe-test-rc-search-doc", function(requ
|
|
|
7
7
|
Copyright (c) 2018 Jed Watson.
|
|
8
8
|
Licensed under the MIT License (MIT), see
|
|
9
9
|
http://jedwatson.github.io/classnames
|
|
10
|
-
*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var a=i.apply(null,r);a&&e.push(a)}}else if("object"===o)if(r.toString===Object.prototype.toString)for(var s in r)n.call(r,s)&&r[s]&&e.push(s);else e.push(r.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):(r=[],o=function(){return i}.apply(t,r),void 0===o||(e.exports=o))}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&r(e,t)}n.d(t,"a",(function(){return o}))},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return r.Context}}),Object.defineProperty(t,"mount",{enumerable:!0,get:function(){return o.mount}}),Object.defineProperty(t,"registerExposedModule",{enumerable:!0,get:function(){return o.registerExposedModule}}),Object.defineProperty(t,"EventEmitter",{enumerable:!0,get:function(){return i.EventEmitter}}),Object.defineProperty(t,"withSyncHistory",{enumerable:!0,get:function(){return a.withSyncHistory}}),Object.defineProperty(t,"withCompatibleSyncHistory",{enumerable:!0,get:function(){return a.withCompatibleSyncHistory}}),Object.defineProperty(t,"isOsContext",{enumerable:!0,get:function(){return a.isOsContext}});var r=n(30),o=n(42),i=n(40),a=n(31)},function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return Ct}));var r=n(3),o=n(2),i=n(1),a=n(0),s=n.n(a),l=n(4),c=n.n(l),u={},f=n(5),d=(n(48),n(49),n(50),n(33)),p=n(34),h=n.n(p),m=n(28),v=n(19),g=n.n(v);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e){return x.apply(this,arguments)}function x(){return x=Object(m.a)(g.a.mark((function e(t){var n,r,o,a,s,l;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.code,r=t.imports,o=t.modifyCode,a=r.filter((function(e){return!e.startsWith(".")})).reduce((function(e,t){return e[t]="latest",e}),{}),s=C({mainCode:n,deps:a}),s=o(s),l=Object.fromEntries(Object.entries(s).map((function(e){var t=Object(i.a)(e,2),n=t[0],r=t[1];return[n,{content:r}]}))),e.abrupt("return",fetch("https://codesandbox.io/api/v1/sandboxes/define?json=1",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:l})}).then((function(e){return e.json()})).then((function(e){var t=e.sandbox_id;return{sandboxId:t,url:"https://codesandbox.io/embed/".concat(t,"?fontsize=14&codemirror=1&view=split&module=/src/main.tsx")}})));case 6:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function C(e){var t=e.mainCode,n=e.deps,r={name:"demo",main:"index.html",dependencies:b({react:"latest","react-dom":"latest"},n)};return{"tsconfig.json":JSON.stringify({compilerOptions:{strict:!0,module:"commonjs",jsx:"react",esModuleInterop:!0,sourceMap:!0,allowJs:!0,lib:["es6","dom"],rootDir:"src",moduleResolution:"node"}},null,2),"sandbox.config.json":JSON.stringify({infiniteLoopProtection:!0,hardReloadOnChange:!1,template:"parcel"},null,2),"package.json":JSON.stringify(r,null,2),"index.html":'\n<html>\n <head>\n <title>Demo</title>\n <meta charset="UTF-8" />\n </head>\n <body>\n <div id="app"></div>\n <script src="src/bootstrap.tsx"><\/script>\n </body>\n</html>\n '.trim(),"src/main.tsx":t,"src/bootstrap.tsx":"\nimport * as React from 'react'\nimport { render } from 'react-dom'\nimport App from './main'\n\nconst rootElement = document.getElementById('app')\nrender(<App />, rootElement)\n "}}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k={border:0,width:"100%",minHeight:520},E=function(e){var t=e.code,n=e.imports,r=e.meta,o=e.modifyCodeSandbox,l=Object(a.useState)(""),c=Object(i.a)(l,2),f=c[0],d=c[1];return Object(a.useEffect)((function(){d("")}),[t]),Object(a.useEffect)((function(){f||w({code:t,imports:n,modifyCode:function(e){var i=e;return u.modifyCodeSandbox&&(i=u.modifyCodeSandbox({code:t,meta:r,imports:n,files:e})),o&&(i=o({code:t,meta:r,imports:n,files:i})),i}}).then((function(e){var t=e.url;d(t)}))}),[f]),f?s.a.createElement("iframe",{sandbox:"allow-modals allow-forms allow-popups allow-scripts allow-same-origin",style:k,src:f}):s.a.createElement("div",{style:S(S({},k),{},{padding:24})},"Loading...")},L=n(36),M=n(35);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e){var t=e.code,r=e.deps,o=e.enable,l=Object(a.useState)(""),c=Object(i.a)(l,2),u=c[0],d=c[1],p=Object(a.useState)({}),h=Object(i.a)(p,2),m=h[0],v=h[1];Object(a.useEffect)((function(){o&&(d(""),v({}),Promise.all([Promise.all([n.e(0),n.e(7)]).then(n.t.bind(null,76,7)),Promise.all([n.e(0),n.e(3),n.e(8)]).then(n.t.bind(null,677,7)),Promise.all([n.e(0),n.e(5)]).then(n.t.bind(null,678,7)),Promise.all([n.e(0),n.e(4)]).then(n.t.bind(null,679,7))]).then((function(e){var n=Object(i.a)(e,4),r=n[0],o=n[1].default,a=n[2].default,s=n[3].default;r.transformAsync(t,{presets:[[o,{isTSX:!0,allExtensions:!0}]],plugins:[s,a]}).then((function(e){"string"==typeof(null==e?void 0:e.code)&&d(e.code)}))})))}),[t,o]),Object(a.useLayoutEffect)((function(){if(o){var e={};try{var t=new Function("define",u);t((function(t,n){var o=N(N({},M),r),i=t.map((function(t){if("exports"===t)return e;if(o&&o.hasOwnProperty(t))return o[t];throw new Error('can not find dependency "'.concat(t,'"'))}));n.apply(void 0,Object(f.a)(i))})),v(e)}catch(n){console.error("error when eval code:"),console.error(n)}}}),[u,r,o]);var g=m.default?s.a.createElement(D,{retryKey:m.default},s.a.createElement(m.default,null)):null;return{value:m,transformedCode:u,renderEvalCode:g}}var D=function(e){var t=e.children,n=e.retryKey;return s.a.createElement(L.ErrorBoundary,{FallbackComponent:P,resetKeys:[n]},t)};function P(e){var t=e.error;return s.a.createElement("div",{role:"alert"},s.a.createElement("p",null,"Error in demo:"),t&&s.a.createElement("pre",null,t.message))}var A=n(12),_=n(8),R=n(9),I=n(10),W=n(20);var H=n(29);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(W.a)(e);if(t){var o=Object(W.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(H.a)(this,n)}}var z=n(6),B=function(e){return+setTimeout(e,16)},U=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(B=function(e){return window.requestAnimationFrame(e)},U=function(e){return window.cancelAnimationFrame(e)});var V=0,G=new Map;function K(e){G.delete(e)}function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;V+=1;var n=V;function r(t){if(0===t)K(n),e();else{var o=B((function(){r(t-1)}));G.set(n,o)}}return r(t),n}q.cancel=function(e){var t=G.get(e);return K(t),U(t)};var $=n(11),X=n.n($);function Y(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var Z,Q=Object(a.forwardRef)((function(e,t){var n=e.didUpdate,r=e.getContainer,o=e.children,i=Object(a.useRef)();Object(a.useImperativeHandle)(t,(function(){return{}}));var s=Object(a.useRef)(!1);return!s.current&&Y()&&(i.current=r(),s.current=!0),Object(a.useEffect)((function(){null==n||n(e)})),Object(a.useEffect)((function(){return function(){var e,t;null===(e=i.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(i.current)}}),[]),i.current?X.a.createPortal(o,i.current):null})),J=Q;function ee(e){if("undefined"==typeof document)return 0;if(e||void 0===Z){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var o=t.offsetWidth;n.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=n.clientWidth),document.body.removeChild(n),Z=o-i}return Z}var te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{};var n=t.element,r=void 0===n?document.body:n,o={},i=Object.keys(e);return i.forEach((function(e){o[e]=r.style[e]})),i.forEach((function(t){r.style[t]=e[t]})),o};var ne={},re=function(e){if(document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth||e){var t=new RegExp("".concat("ant-scrolling-effect"),"g"),n=document.body.className;if(e){if(!t.test(n))return;return te(ne),ne={},void(document.body.className=n.replace(t,"").trim())}var r=ee();if(r&&(ne=te({position:"relative",width:"calc(100% - ".concat(r,"px)")}),!t.test(n))){var o="".concat(n," ").concat("ant-scrolling-effect");document.body.className=o.trim()}}},oe=[],ie=new RegExp("".concat("ant-scrolling-effect"),"g"),ae=0,se=new Map,le=function e(t){var n=this;Object(_.a)(this,e),this.lockTarget=void 0,this.options=void 0,this.getContainer=function(){var e;return null===(e=n.options)||void 0===e?void 0:e.container},this.reLock=function(e){var t=oe.find((function(e){var t=e.target;return t===n.lockTarget}));t&&n.unLock(),n.options=e,t&&(t.options=e,n.lock())},this.lock=function(){var e;if(!oe.some((function(e){var t=e.target;return t===n.lockTarget})))if(oe.some((function(e){var t,r=e.options;return(null==r?void 0:r.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})))oe=[].concat(Object(f.a)(oe),[{target:n.lockTarget,options:n.options}]);else{var t=0,r=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body;(r===document.body&&window.innerWidth-document.documentElement.clientWidth>0||r.scrollHeight>r.clientHeight)&&(t=ee());var o=r.className;if(0===oe.filter((function(e){var t,r=e.options;return(null==r?void 0:r.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})).length&&se.set(r,te({width:0!==t?"calc(100% - ".concat(t,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:r})),!ie.test(o)){var i="".concat(o," ").concat("ant-scrolling-effect");r.className=i.trim()}oe=[].concat(Object(f.a)(oe),[{target:n.lockTarget,options:n.options}])}},this.unLock=function(){var e,t=oe.find((function(e){var t=e.target;return t===n.lockTarget}));if(oe=oe.filter((function(e){var t=e.target;return t!==n.lockTarget})),t&&!oe.some((function(e){var n,r=e.options;return(null==r?void 0:r.container)===(null===(n=t.options)||void 0===n?void 0:n.container)}))){var r=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body,o=r.className;ie.test(o)&&(te(se.get(r),{element:r}),se.delete(r),r.className=r.className.replace(ie,"").trim())}},this.lockTarget=ae++,this.options=t},ce=0,ue=Y();var fe={},de=function(e){if(!ue)return null;if(e){if("string"==typeof e)return document.querySelectorAll(e)[0];if("function"==typeof e)return e();if("object"===Object(z.a)(e)&&e instanceof window.HTMLElement)return e}return document.body},pe=function(e){Object(I.a)(n,e);var t=F(n);function n(e){var r;return Object(_.a)(this,n),r=t.call(this,e),r.container=void 0,r.componentRef=a.createRef(),r.rafId=void 0,r.scrollLocker=void 0,r.renderComponent=void 0,r.updateScrollLocker=function(e){var t=e||{},n=t.visible,o=r.props,i=o.getContainer,a=o.visible;a&&a!==n&&ue&&de(i)!==r.scrollLocker.getContainer()&&r.scrollLocker.reLock({container:de(i)})},r.updateOpenCount=function(e){var t=e||{},n=t.visible,o=t.getContainer,i=r.props,a=i.visible,s=i.getContainer;a!==n&&ue&&de(s)===document.body&&(a&&!n?ce+=1:e&&(ce-=1));var l="function"==typeof s&&"function"==typeof o;(l?s.toString()!==o.toString():s!==o)&&r.removeCurrentContainer()},r.attachToParent=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||r.container&&!r.container.parentNode){var t=de(r.props.getContainer);return!!t&&(t.appendChild(r.container),!0)}return!0},r.getContainer=function(){return ue?(r.container||(r.container=document.createElement("div"),r.attachToParent(!0)),r.setWrapperClassName(),r.container):null},r.setWrapperClassName=function(){var e=r.props.wrapperClassName;r.container&&e&&e!==r.container.className&&(r.container.className=e)},r.removeCurrentContainer=function(){var e,t;null===(e=r.container)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(r.container)},r.switchScrollingEffect=function(){1!==ce||Object.keys(fe).length?ce||(te(fe),fe={},re(!0)):(re(),fe=te({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}))},r.scrollLocker=new le({container:de(e.getContainer)}),r}return Object(R.a)(n,[{key:"componentDidMount",value:function(){var e=this;this.updateOpenCount(),this.attachToParent()||(this.rafId=q((function(){e.forceUpdate()})))}},{key:"componentDidUpdate",value:function(e){this.updateOpenCount(e),this.updateScrollLocker(e),this.setWrapperClassName(),this.attachToParent()}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visible,n=e.getContainer;ue&&de(n)===document.body&&(ce=t&&ce?ce-1:ce),this.removeCurrentContainer(),q.cancel(this.rafId)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.forceRender,r=e.visible,o=null,i={getOpenCount:function(){return ce},getContainer:this.getContainer,switchScrollingEffect:this.switchScrollingEffect,scrollLocker:this.scrollLocker};return(n||r||this.componentRef.current)&&(o=a.createElement(J,{getContainer:this.getContainer,ref:this.componentRef},t(i))),o}}]),n}(a.Component),he=pe;function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ge=n(7),ye=n.n(ge),be={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=be.F1&&t<=be.F12)return!1;switch(t){case be.ALT:case be.CAPS_LOCK:case be.CONTEXT_MENU:case be.CTRL:case be.DOWN:case be.END:case be.ESC:case be.HOME:case be.INSERT:case be.LEFT:case be.MAC_FF_META:case be.META:case be.NUMLOCK:case be.NUM_CENTER:case be.PAGE_DOWN:case be.PAGE_UP:case be.PAUSE:case be.PRINT_SCREEN:case be.RIGHT:case be.SHIFT:case be.UP:case be.WIN_KEY:case be.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=be.ZERO&&e<=be.NINE)return!0;if(e>=be.NUM_ZERO&&e<=be.NUM_MULTIPLY)return!0;if(e>=be.A&&e<=be.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case be.SPACE:case be.QUESTION_MARK:case be.NUM_PLUS:case be.NUM_MINUS:case be.NUM_PERIOD:case be.NUM_DIVISION:case be.SEMICOLON:case be.DASH:case be.EQUALS:case be.COMMA:case be.PERIOD:case be.SLASH:case be.APOSTROPHE:case be.SINGLE_QUOTE:case be.OPEN_SQUARE_BRACKET:case be.BACKSLASH:case be.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},we=be;var xe="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/);function Ce(e,t){return 0===e.indexOf(t)}n(37);function Oe(e,t){"function"==typeof e?e(t):"object"===Object(z.a)(e)&&e&&"current"in e&&(e.current=t)}function Se(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var ke,Ee,Le,Me=(ke=Y(),Ee="undefined"!=typeof window?window:{},Le={animationend:Se("Animation","AnimationEnd"),transitionend:Se("Transition","TransitionEnd")},ke&&("AnimationEvent"in Ee||delete Le.animationend.animation,"TransitionEvent"in Ee||delete Le.transitionend.transition),Le),Te={};if(Y()){var Ne=document.createElement("div");Te=Ne.style}var je={};function De(e){if(je[e])return je[e];var t=Me[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var i=n[o];if(Object.prototype.hasOwnProperty.call(t,i)&&i in Te)return je[e]=t[i],je[e]}return""}var Pe=De("animationend"),Ae=De("transitionend"),_e=!(!Pe||!Ae),Re=Pe||"animationend",Ie=Ae||"transitionend";function We(e,t){if(!e)return null;if("object"===Object(z.a)(e)){var n=t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}));return e[n]}return"".concat(e,"-").concat(t)}function He(e){var t=Object(a.useRef)(!1),n=Object(a.useState)(e),r=Object(i.a)(n,2),o=r[0],s=r[1];return Object(a.useEffect)((function(){return function(){t.current=!0}}),[]),[o,function(e){t.current||s(e)}]}var Fe=Y()?a.useLayoutEffect:a.useEffect,ze=Fe,Be=["prepare","start","active","end"];function Ue(e){return"active"===e||"end"===e}var Ve=function(e,t){var n=a.useState("none"),r=Object(i.a)(n,2),o=r[0],s=r[1],l=function(){var e=a.useRef(null);function t(){q.cancel(e.current)}return a.useEffect((function(){return function(){t()}}),[]),[function n(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var i=q((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)}));e.current=i},t]}(),c=Object(i.a)(l,2),u=c[0],f=c[1];return ze((function(){if("none"!==o&&"end"!==o){var e=Be.indexOf(o),n=Be[e+1],r=t(o);!1===r?s(n):u((function(e){function t(){e.isCanceled()||s(n)}!0===r?t():Promise.resolve(r).then(t)}))}}),[e,o]),a.useEffect((function(){return function(){f()}}),[]),[function(){s("prepare")},o]};function Ge(e,t,n,r){var s=r.motionEnter,l=void 0===s||s,c=r.motionAppear,u=void 0===c||c,f=r.motionLeave,d=void 0===f||f,p=r.motionDeadline,h=r.motionLeaveImmediately,m=r.onAppearPrepare,v=r.onEnterPrepare,g=r.onLeavePrepare,y=r.onAppearStart,b=r.onEnterStart,w=r.onLeaveStart,x=r.onAppearActive,C=r.onEnterActive,O=r.onLeaveActive,S=r.onAppearEnd,k=r.onEnterEnd,E=r.onLeaveEnd,L=r.onVisibleChanged,M=He(),T=Object(i.a)(M,2),N=T[0],j=T[1],D=He("none"),P=Object(i.a)(D,2),A=P[0],_=P[1],R=He(null),I=Object(i.a)(R,2),W=I[0],H=I[1],F=Object(a.useRef)(!1),z=Object(a.useRef)(null),B=Object(a.useRef)(!1),U=Object(a.useRef)(null);function V(){var e=n();return e||U.current}var G=Object(a.useRef)(!1);function K(e){var t,n=V();e&&!e.deadline&&e.target!==n||("appear"===A&&G.current?t=null==S?void 0:S(n,e):"enter"===A&&G.current?t=null==k?void 0:k(n,e):"leave"===A&&G.current&&(t=null==E?void 0:E(n,e)),!1===t||B.current||(_("none"),H(null)))}var q=function(e){var t=Object(a.useRef)(),n=Object(a.useRef)(e);n.current=e;var r=a.useCallback((function(e){n.current(e)}),[]);function o(e){e&&(e.removeEventListener(Ie,r),e.removeEventListener(Re,r))}return a.useEffect((function(){return function(){o(t.current)}}),[]),[function(e){t.current&&t.current!==e&&o(t.current),e&&e!==t.current&&(e.addEventListener(Ie,r),e.addEventListener(Re,r),t.current=e)},o]}(K),$=Object(i.a)(q,1),X=$[0],Y=a.useMemo((function(){var e,t,n;switch(A){case"appear":return e={},Object(o.a)(e,"prepare",m),Object(o.a)(e,"start",y),Object(o.a)(e,"active",x),e;case"enter":return t={},Object(o.a)(t,"prepare",v),Object(o.a)(t,"start",b),Object(o.a)(t,"active",C),t;case"leave":return n={},Object(o.a)(n,"prepare",g),Object(o.a)(n,"start",w),Object(o.a)(n,"active",O),n;default:return{}}}),[A]),Z=Ve(A,(function(e){if("prepare"===e){var t=Y.prepare;return!!t&&t(V())}var n;ee in Y&&H((null===(n=Y[ee])||void 0===n?void 0:n.call(Y,V(),null))||null);return"active"===ee&&(X(V()),p>0&&(clearTimeout(z.current),z.current=setTimeout((function(){K({deadline:!0})}),p))),!0})),Q=Object(i.a)(Z,2),J=Q[0],ee=Q[1],te=Ue(ee);G.current=te,ze((function(){j(t);var n,r=F.current;(F.current=!0,e)&&(!r&&t&&u&&(n="appear"),r&&t&&l&&(n="enter"),(r&&!t&&d||!r&&h&&!t&&d)&&(n="leave"),n&&(_(n),J()))}),[t]),Object(a.useEffect)((function(){("appear"===A&&!u||"enter"===A&&!l||"leave"===A&&!d)&&_("none")}),[u,l,d]),Object(a.useEffect)((function(){return function(){clearTimeout(z.current),B.current=!0}}),[]),Object(a.useEffect)((function(){void 0!==N&&"none"===A&&(null==L||L(N))}),[N,A]);var ne=W;return Y.prepare&&"start"===ee&&(ne=ve({transition:"none"},ne)),[A,ee,ne,null!=N?N:t]}var Ke=function(e){Object(I.a)(n,e);var t=F(n);function n(){return Object(_.a)(this,n),t.apply(this,arguments)}return Object(R.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(a.Component),qe=Ke;var $e=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===Object(z.a)(e)&&(t=e.transitionSupport);var r=a.forwardRef((function(e,t){var r=e.visible,s=void 0===r||r,l=e.removeOnLeave,c=void 0===l||l,u=e.forceRender,f=e.children,d=e.motionName,p=e.leavedClassName,h=e.eventProps,m=n(e),v=Object(a.useRef)(),g=Object(a.useRef)();var y=Ge(m,s,(function(){try{return e=v.current||g.current,e instanceof HTMLElement?e:X.a.findDOMNode(e)}catch(t){return null}var e}),e),b=Object(i.a)(y,4),w=b[0],x=b[1],C=b[2],O=b[3],S=a.useRef(O);O&&(S.current=!0);var k=Object(a.useRef)(t);k.current=t;var E,L=a.useCallback((function(e){v.current=e,Oe(k.current,e)}),[]),M=ve(ve({},h),{},{visible:s});if(f)if("none"!==w&&n(e)){var T,N;"prepare"===x?N="prepare":Ue(x)?N="active":"start"===x&&(N="start"),E=f(ve(ve({},M),{},{className:ye()(We(d,w),(T={},Object(o.a)(T,We(d,"".concat(w,"-").concat(N)),N),Object(o.a)(T,d,"string"==typeof d),T)),style:C}),L)}else E=O?f(ve({},M),L):!c&&S.current?f(ve(ve({},M),{},{className:p}),L):u?f(ve(ve({},M),{},{style:{display:"none"}}),L):null;else E=null;return a.createElement(qe,{ref:g},E)}));return r.displayName="CSSMotion",r}(_e);function Xe(e){var t;return t=e&&"object"===Object(z.a)(e)&&"key"in e?e:{key:e},ve(ve({},t),{},{key:String(t.key)})}function Ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Xe)}function Ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=Ye(e),a=Ye(t);i.forEach((function(e){for(var t=!1,i=r;i<o;i+=1){var s=a[i];if(s.key===e.key){r<i&&(n=n.concat(a.slice(r,i).map((function(e){return ve(ve({},e),{},{status:"add"})}))),r=i),n.push(ve(ve({},s),{},{status:"keep"})),r+=1,t=!0;break}}t||n.push(ve(ve({},e),{},{status:"remove"}))})),r<o&&(n=n.concat(a.slice(r).map((function(e){return ve(ve({},e),{},{status:"add"})}))));var s={};n.forEach((function(e){var t=e.key;s[t]=(s[t]||0)+1}));var l=Object.keys(s).filter((function(e){return s[e]>1}));return l.forEach((function(e){n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||"remove"!==r})),n.forEach((function(t){t.key===e&&(t.status="keep")}))})),n}var Qe=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$e,n=function(e){Object(I.a)(o,e);var n=F(o);function o(){var e;return Object(_.a)(this,o),e=n.apply(this,arguments),e.state={keyEntities:[]},e.removeKey=function(t){e.setState((function(e){var n=e.keyEntities;return{keyEntities:n.map((function(e){return e.key!==t?e:ve(ve({},e),{},{status:"removed"})}))}}))},e}return Object(R.a)(o,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,o=this.props,i=o.component,s=o.children,l=o.onVisibleChanged,c=Object(A.a)(o,["component","children","onVisibleChanged"]),u=i||a.Fragment,f={};return Qe.forEach((function(e){f[e]=c[e],delete c[e]})),delete c.keys,a.createElement(u,c,n.map((function(n){var o=n.status,i=Object(A.a)(n,["status"]),c="add"===o||"keep"===o;return a.createElement(t,Object(r.a)({},f,{key:i.key,visible:c,eventProps:i,onVisibleChanged:function(t){null==l||l(t,{key:i.key}),t||e.removeKey(i.key)}}),s)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,o=Ye(n),i=Ze(r,o);return{keyEntities:i.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||"removed"!==t.status||"remove"!==e.status}))}}}]),o}(a.Component);n.defaultProps={component:"div"}}(_e);var Je=$e;function et(e){var t=e.prefixCls,n=e.style,o=e.visible,i=e.maskProps,s=e.motionName;return a.createElement(Je,{key:"mask",visible:o,motionName:s,leavedClassName:"".concat(t,"-mask-hidden")},(function(e){var o=e.className,s=e.style;return a.createElement("div",Object(r.a)({style:ve(ve({},s),n),className:ye()("".concat(t,"-mask"),o)},i))}))}function tt(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}var nt=-1;function rt(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}var ot=a.memo((function(e){var t=e.children;return t}),(function(e,t){var n=t.shouldUpdate;return!n})),it={width:0,height:0,overflow:"hidden",outline:"none"},at=a.forwardRef((function(e,t){var n=e.closable,o=e.prefixCls,s=e.width,l=e.height,c=e.footer,u=e.title,f=e.closeIcon,d=e.style,p=e.className,h=e.visible,m=e.forceRender,v=e.bodyStyle,g=e.bodyProps,y=e.children,b=e.destroyOnClose,w=e.modalRender,x=e.motionName,C=e.ariaId,O=e.onClose,S=e.onVisibleChanged,k=e.onMouseDown,E=e.onMouseUp,L=e.mousePosition,M=Object(a.useRef)(),T=Object(a.useRef)(),N=Object(a.useRef)();a.useImperativeHandle(t,(function(){return{focus:function(){var e;null===(e=M.current)||void 0===e||e.focus()},changeActive:function(e){var t=document,n=t.activeElement;e&&n===T.current?M.current.focus():e||n!==M.current||T.current.focus()}}}));var j,D,P,A=a.useState(),_=Object(i.a)(A,2),R=_[0],I=_[1],W={};function H(){var e,t,n,r,o,i=(e=N.current,t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,o=r.defaultView||r.parentWindow,n.left+=rt(o),n.top+=rt(o,!0),n);I(L?"".concat(L.x-i.left,"px ").concat(L.y-i.top,"px"):"")}void 0!==s&&(W.width=s),void 0!==l&&(W.height=l),R&&(W.transformOrigin=R),c&&(j=a.createElement("div",{className:"".concat(o,"-footer")},c)),u&&(D=a.createElement("div",{className:"".concat(o,"-header")},a.createElement("div",{className:"".concat(o,"-title"),id:C},u))),n&&(P=a.createElement("button",{type:"button",onClick:O,"aria-label":"Close",className:"".concat(o,"-close")},f||a.createElement("span",{className:"".concat(o,"-close-x")})));var F=a.createElement("div",{className:"".concat(o,"-content")},P,D,a.createElement("div",Object(r.a)({className:"".concat(o,"-body"),style:v},g),y),j);return a.createElement(Je,{visible:h,onVisibleChanged:S,onAppearPrepare:H,onEnterPrepare:H,forceRender:m,motionName:x,removeOnLeave:b,ref:N},(function(e,t){var n=e.className,r=e.style;return a.createElement("div",{key:"dialog-element",role:"document",ref:t,style:ve(ve(ve({},r),d),W),className:ye()(o,p,n),onMouseDown:k,onMouseUp:E},a.createElement("div",{tabIndex:0,ref:M,style:it,"aria-hidden":"true"}),a.createElement(ot,{shouldUpdate:h||m},w?w(F):F),a.createElement("div",{tabIndex:0,ref:T,style:it,"aria-hidden":"true"}))}))}));at.displayName="Content";var st=at;function lt(e){var t=e.prefixCls,n=void 0===t?"rc-dialog":t,o=e.zIndex,s=e.visible,l=void 0!==s&&s,c=e.keyboard,u=void 0===c||c,f=e.focusTriggerAfterClose,d=void 0===f||f,p=e.scrollLocker,h=e.title,m=e.wrapStyle,v=e.wrapClassName,g=e.wrapProps,y=e.onClose,b=e.afterClose,w=e.transitionName,x=e.animation,C=e.closable,O=void 0===C||C,S=e.mask,k=void 0===S||S,E=e.maskTransitionName,L=e.maskAnimation,M=e.maskClosable,T=void 0===M||M,N=e.maskStyle,j=e.maskProps,D=Object(a.useRef)(),P=Object(a.useRef)(),A=Object(a.useRef)(),_=a.useState(l),R=Object(i.a)(_,2),I=R[0],W=R[1],H=Object(a.useRef)();function F(e){null==y||y(e)}H.current||(H.current="rcDialogTitle".concat((nt+=1,nt)));var z=Object(a.useRef)(!1),B=Object(a.useRef)(),U=null;return T&&(U=function(e){z.current?z.current=!1:P.current===e.target&&F(e)}),Object(a.useEffect)((function(){return l&&W(!0),function(){}}),[l]),Object(a.useEffect)((function(){return function(){clearTimeout(B.current)}}),[]),Object(a.useEffect)((function(){return I?(null==p||p.lock(),null==p?void 0:p.unLock):function(){}}),[I,p]),a.createElement("div",Object(r.a)({className:"".concat(n,"-root")},function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:ve({},n);var r={};return Object.keys(e).forEach((function(n){(t.aria&&("role"===n||Ce(n,"aria-"))||t.data&&Ce(n,"data-")||t.attr&&xe.includes(n))&&(r[n]=e[n])})),r}(e,{data:!0})),a.createElement(et,{prefixCls:n,visible:k&&l,motionName:tt(n,E,L),style:ve({zIndex:o},N),maskProps:j}),a.createElement("div",Object(r.a)({tabIndex:-1,onKeyDown:function(e){if(u&&e.keyCode===we.ESC)return e.stopPropagation(),void F(e);l&&e.keyCode===we.TAB&&A.current.changeActive(!e.shiftKey)},className:ye()("".concat(n,"-wrap"),v),ref:P,onClick:U,role:"dialog","aria-labelledby":h?H.current:null,style:ve(ve({zIndex:o},m),{},{display:I?null:"none"})},g),a.createElement(st,Object(r.a)({},e,{onMouseDown:function(){clearTimeout(B.current),z.current=!0},onMouseUp:function(){B.current=setTimeout((function(){z.current=!1}))},ref:A,closable:O,ariaId:H.current,prefixCls:n,visible:l,onClose:F,onVisibleChanged:function(e){if(e){var t;if(n=P.current,r=document.activeElement,!n||!n.contains(r))D.current=document.activeElement,null===(t=A.current)||void 0===t||t.focus()}else{if(W(!1),k&&D.current&&d){try{D.current.focus({preventScroll:!0})}catch(o){}D.current=null}I&&(null==b||b())}var n,r},motionName:tt(n,w,x)}))))}var ct=function(e){var t=e.visible,n=e.getContainer,o=e.forceRender,s=e.destroyOnClose,l=void 0!==s&&s,c=e.afterClose,u=a.useState(t),f=Object(i.a)(u,2),d=f[0],p=f[1];return a.useEffect((function(){t&&p(!0)}),[t]),!1===n?a.createElement(lt,Object(r.a)({},e,{getOpenCount:function(){return 2}})):o||!l||d?a.createElement(he,{visible:t,forceRender:o,getContainer:n},(function(t){return a.createElement(lt,Object(r.a)({},e,{destroyOnClose:l,afterClose:function(){null==c||c(),p(!1)}},t))})):null};ct.displayName="Dialog";var ut=ct,ft=ut,dt=(n(56),["style","className"]),pt=function(e){e.style;var t,n=e.className,o=Object(A.a)(e,dt);return s.a.createElement(ft,Object(r.a)({animation:"zoom",maskAnimation:"fade"},o,{className:"".concat(null!==(t=c.a.fullViewDialog)&&void 0!==t?t:""," ").concat(null!=n?n:"")}))};var ht=[{name:"code",icon:function(){return s.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9027",width:"100%",height:"100%"},s.a.createElement("path",{d:"M85.312 164.8v604.8h853.376v-604.8H85.312zM682.688 870.4V960H341.312v-89.6H0V64h1024v806.4h-341.312zM390.08 632.128L128 503.04V422.336l262.08-128.64V390.4L230.784 462.976l159.296 72.832v96.32zM529.6 256H576l-82.048 413.184H448L529.6 256z m104.32 376.128V535.808l159.296-72.832-159.296-72.512V293.632L896 422.4v80.768L633.92 632.128z","p-id":"9028","data-spm-anchor-id":"a313x.7781069.0.i1"}))},View:function(e){var t=e.code,n=e.setCode;return s.a.createElement(d.Controlled,{value:t,className:c.a.codemirror,options:{lineNumbers:!0,matchBrackets:!0,mode:"text/typescript"},editorDidMount:function(e){setTimeout((function(){e.refresh()}),10)},onBeforeChange:function(e,t,r){n(r)}})}},{name:"full-view",enabled:function(e){e.demoOpts,e.buildTimeDemoOpts,e.demoMeta;var t=e.resolvedOpts;return t.canFullScreen},icon:function(){return s.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9027",width:"100%",height:"100%"},s.a.createElement("path",{d:"M725.333333 42.666667l128 0q52.992 0 90.496 37.504t37.504 90.496l0 128q0 17.664-12.501333 30.165333t-30.165333 12.501333-30.165333-12.501333-12.501333-30.165333l0-128q0-17.664-12.501333-30.165333t-30.165333-12.501333l-128 0q-17.664 0-30.165333-12.501333t-12.501333-30.165333 12.501333-30.165333 30.165333-12.501333zM85.333333 682.666667q17.664 0 30.165333 12.501333t12.501333 30.165333l0 128q0 17.664 12.501333 30.165333t30.165333 12.501333l128 0q17.664 0 30.165333 12.501333t12.501333 30.165333-12.501333 30.165333-30.165333 12.501333l-128 0q-52.992 0-90.496-37.504t-37.504-90.496l0-128q0-17.664 12.501333-30.165333t30.165333-12.501333zM170.666667 42.666667l128 0q17.664 0 30.165333 12.501333t12.501333 30.165333-12.501333 30.165333-30.165333 12.501333l-128 0q-17.664 0-30.165333 12.501333t-12.501333 30.165333l0 128q0 17.664-12.501333 30.165333t-30.165333 12.501333-30.165333-12.501333-12.501333-30.165333l0-128q0-52.992 37.504-90.496t90.496-37.504zM938.666667 682.666667q17.664 0 30.165333 12.501333t12.501333 30.165333l0 128q0 52.992-37.504 90.496t-90.496 37.504l-128 0q-17.664 0-30.165333-12.501333t-12.501333-30.165333 12.501333-30.165333 30.165333-12.501333l128 0q17.664 0 30.165333-12.501333t12.501333-30.165333l0-128q0-17.664 12.501333-30.165333t30.165333-12.501333z","p-id":"11568"}))},View:void 0},{name:"codesandbox",icon:function(){return s.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9197",width:"100%",height:"100%"},s.a.createElement("path",{d:"M755 140.3l0.5-0.3h0.3L512 0 268.3 140h-0.3l0.8 0.4L68.6 256v512L512 1024l443.4-256V256L755 140.3z m-30 506.4v171.2L548 920.1V534.7L883.4 341v215.7l-158.4 90z m-584.4-90.6V340.8L476 534.4v385.7L300 818.5V646.7l-159.4-90.6zM511.7 280l171.1-98.3 166.3 96-336.9 194.5-337-194.6 165.7-95.7L511.7 280z","p-id":"9198"}))},View:function(e){var t=e.code,n=e.imports,r=e.meta,o=e.opts;return s.a.createElement(E,{code:t,imports:n,meta:r,modifyCodeSandbox:o.modifyCodeSandbox})}}],mt={current:"none",previous:"none"};function vt(e,t){return e.current===t?{current:"none",previous:e.current}:{current:t,previous:e.current}}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bt=function(e){var t,n=e.code,r=e.DemoWrapper,o=e.imports,l=e.meta,d=void 0===l?{}:l,p=e.opts,m=void 0===p?{}:p,v=e.className,g=e.style,y=e.demoDeps,b=e.loadOpts,w=e.children,x=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},d=arguments.length>4?arguments[4]:void 0,p=arguments.length>5?arguments[5]:void 0,m=arguments.length>6?arguments[6]:void 0,v=Object(a.useReducer)(vt,mt),g=Object(i.a)(v,2),y=g[0],b=g[1],w={canFullScreen:void 0!==(null==o?void 0:o.canFullScreen)?"false"!==String(null==o?void 0:o.canFullScreen):null!==(n=null!==(r=l.canFullScreen)&&void 0!==r?r:u.canFullScreen)&&void 0!==n&&n},x=Object(a.useMemo)((function(){var n=e;return"function"==typeof u.modifyDisplayCode&&(n=u.modifyDisplayCode({code:n,meta:o,imports:t})),"function"==typeof l.modifyDisplayCode&&(n=l.modifyDisplayCode({code:n,meta:o,imports:t})),n}),[l.modifyDisplayCode,u.modifyDisplayCode,e,o,t]),C=Object(a.useState)(x),O=Object(i.a)(C,2),S=O[0],k=O[1];Object(a.useEffect)((function(){k(x)}),[x]);var E,L,M,T,N=j({code:S,deps:d,enable:S!==x}),D=N.renderEvalCode,P=N.transformedCode,A=Object(a.useMemo)((function(){var e=ht;"function"==typeof u.extraOperations&&(e=[].concat(Object(f.a)(e),Object(f.a)(u.extraOperations({code:x,meta:o,imports:t})))),"function"==typeof l.extraOperations&&(e=[].concat(Object(f.a)(e),Object(f.a)(l.extraOperations({code:x,meta:o,imports:t}))));var n={demoOpts:l,buildTimeDemoOpts:u,demoMeta:o,resolvedOpts:w};return e.filter((function(e){return"function"!=typeof e.enabled||e.enabled(n)}))}),[l.extraOperations,u.extraOperations,x,o,t]),_=(E=null!=D?D:p,m&&(E=s.a.createElement(m,null,E)),E),R=(L=function(){if("none"!==y.current){var e=A.find((function(e){return e.name===y.current}));return{operation:e,height:null!=e&&e.View?"auto":0}}var t=A.find((function(e){return e.name===y.previous}));return{operation:t,height:0}}(),M=L.operation,T=L.height,s.a.createElement(h.a,{duration:250,height:T},null!=M&&M.View?s.a.createElement(M.View,{code:S,originalCode:x,setCode:k,imports:t,meta:o,opts:l}):s.a.createElement("div",null))),I=s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{className:c.a.operations,"data-transformed-code":P},A.map((function(e){var t=e.icon,n=e.name,r=e.onClick;return s.a.createElement("span",{key:n,className:c.a.operation,onClick:function(){b(n),"function"==typeof r&&r()}},t())}))),s.a.createElement(pt,{title:o.title,visible:"full-view"===y.current,onClose:function(){b("full-view")}},_),R);return{demoView:_,operationsView:I,resolvedOpts:w}}(n,o,d,m,y,w,r,b),C=x.demoView,O=x.operationsView,S=x.resolvedOpts,k=S.canFullScreen;return s.a.createElement("div",{className:[k?"canFullScreen":null,u.containerClassName,m.containerClassName,c.a.container,v].filter(Boolean).join(" "),style:yt(yt(yt({},u.containerStyle),null!==(t=m.containerStyle)&&void 0!==t?t:{}),g)},s.a.createElement("div",{className:c.a.title},d.title),s.a.createElement("div",{className:c.a.demo},s.a.createElement("div",{className:c.a.demoInner},C)),s.a.createElement("div",{className:c.a.describe},d.describe||d.description),O)};const wt=Object.assign({},{title:"场景1"},{},{_type:"demo"}),xt=Object.assign({},{},{},{_type:"md"});var Ct=[{key:"demo1",staticMeta:wt,load:()=>n.e(10).then(n.bind(null,681))},{key:"README",staticMeta:xt,load:()=>Promise.all([n.e(1),n.e(9)]).then(n.bind(null,682))},{key:"types/IRcSearchOptions",staticMeta:{_type:"typeInfo"},load:()=>n.e(11).then(n.bind(null,683))},{key:"types/IRcSearchProps",staticMeta:{_type:"typeInfo"},load:()=>n.e(12).then(n.bind(null,684))},{key:"types/IRcSearchTagItemProps",staticMeta:{_type:"typeInfo"},load:()=>n.e(13).then(n.bind(null,685))},{key:"types/IRcSearchTagListProps",staticMeta:{_type:"typeInfo"},load:()=>n.e(14).then(n.bind(null,686))}],Ot=(n(60),void 0),St=void 0;function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lt=s.a.lazy((function(){return Promise.all([n.e(1),n.e(15)]).then(n.bind(null,676))}));t.a=function(e){var t=e.entryKey,n=e.onLoaded,o=e.markdownOpts,l=e.demoOpts,c=e.resolveDemoOpts,u=e.resolveAppServePath,f=e.resolveAppDeps,d=e.loadOpts,p=Object(a.useState)(null),h=Object(i.a)(p,2),m=h[0],v=h[1];Object(a.useEffect)((function(){if(t){var e=Ct.find((function(e){var n=e.key;return t===n}));if(e){var n=e.staticMeta;switch(n._type){case"demo":e.load().then((function(e){var t=e.demo,r=e.meta,o=e.code,i=e.imports,a=e.deps;v({type:n._type,Component:t,code:o,imports:i,meta:Et(Et({},n),r),demoDeps:a,loadOpts:d})}));break;case"md":e.load().then((function(e){var t=e.default;v({type:n._type,Component:t})}));break;case"normal":e.load().then((function(e){var t=e.default;v({type:n._type,Component:t})}));break;case"typeInfo":e.load().then((function(e){var t=e.typeInfo;v({type:n._type,data:t})}))}}}}),[t]);var g=Object(a.useRef)(m);return Object(a.useEffect)((function(){g.current!==m&&"function"==typeof n&&n()}),[m]),m?"demo"===m.type?s.a.createElement(bt,{code:m.code,imports:m.imports,DemoWrapper:null,meta:m.meta,opts:l,demoDeps:m.demoDeps,loadOpts:m.loadOpts},s.a.createElement(m.Component,null)):"md"===m.type?s.a.createElement(m.Component,Object(r.a)({},o,{resolveDemoOpts:c,resolveAppServePath:function(e){var t="";return t||"function"!=typeof Ot||(t=Ot(e)),t||"function"!=typeof u||(t=u(e)),t||"function"!=typeof St||(t=St(e)),t},resolveAppDeps:f})):"typeInfo"===m.type?s.a.createElement(s.a.Suspense,{fallback:null},s.a.createElement(Lt,{typeInfo:m.data})):s.a.createElement(m.Component,{meta:m.meta}):null}},function(e,t,n){e.exports=n(54)},function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(43);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(16).default,o=n(44);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=r||o||i,s=a&&(r?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,l=!0);var C=y&&(c||f&&(null==x||x<12.11)),O=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,E=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return L(e).appendChild(t)}function T(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function N(e,t,n,r){var o=T(e,t,n,r);return o.setAttribute("role","presentation"),o}function j(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(Ne){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function P(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function A(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}k=document.createRange?function(e,t,n,r){var o=document.createRange();return o.setEnd(r||e,n),o.setStart(e,t),o}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(Ne){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var _=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function W(e,t,n,r,o){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var i=r||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}}m?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(t){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function F(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.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)};var z={toString:function(){return"CodeMirror.Pass"}},B={scroll:!1},U={origin:"*mouse"},V={origin:"+move"};function G(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var a=i-r;if(i==e.length||o+a>=t)return r+Math.min(a,t-o);if(o+=i-r,o+=n-o%n,r=i+1,o>=t)return r}}var K=[""];function q(e){for(;K.length<=e;)K.push($(K)+" ");return K[e]}function $(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&I(t,n),n}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function ie(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:ae=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:ae=o)}return null!=r?r:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,o=/[1n]/;function i(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,f=[],d=0;d<u;++d)f.push((c=a.charCodeAt(d),c<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L"));for(var p=0,h=l;p<u;++p){var m=f[p];"m"==m?f[p]=h:h=m}for(var v=0,g=l;v<u;++v){var y=f[v];"1"==y&&"r"==g?f[v]="n":n.test(y)&&(g=y,"r"==y&&(f[v]="R"))}for(var b=1,w=f[0];b<u-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<u;++C){var O=f[C];if(","==O)f[C]="N";else if("%"==O){var S=void 0;for(S=C+1;S<u&&"%"==f[S];++S);for(var k=C&&"!"==f[C-1]||S<u&&"1"==f[S]?"1":"N",E=C;E<S;++E)f[E]=k;C=S-1}}for(var L=0,M=l;L<u;++L){var T=f[L];"L"==M&&"1"==T?f[L]="L":n.test(T)&&(M=T)}for(var N=0;N<u;++N)if(t.test(f[N])){var j=void 0;for(j=N+1;j<u&&t.test(f[j]);++j);for(var D="L"==(N?f[N-1]:l),P="L"==(j<u?f[j]:l),A=D==P?D?"L":"R":l,_=N;_<j;++_)f[_]=A;N=j-1}for(var R,I=[],W=0;W<u;)if(r.test(f[W])){var H=W;for(++W;W<u&&r.test(f[W]);++W);I.push(new i(0,H,W))}else{var F=W,z=I.length,B="rtl"==s?1:0;for(++W;W<u&&"L"!=f[W];++W);for(var U=F;U<W;)if(o.test(f[U])){F<U&&(I.splice(z,0,new i(1,F,U)),z+=B);var V=U;for(++U;U<W&&o.test(f[U]);++U);I.splice(z,0,new i(2,V,U)),z+=B,F=U}else++U;F<W&&I.splice(z,0,new i(1,F,W))}return"ltr"==s&&(1==I[0].level&&(R=a.match(/^\s+/))&&(I[0].from=R[0].length,I.unshift(new i(0,0,R[0].length))),1==$(I).level&&(R=a.match(/\s+$/))&&($(I).to-=R[0].length,I.push(new i(0,u-R[0].length,u)))),"rtl"==s?I.reverse():I}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var ue=[],fe=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]||ue).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function pe(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,o=r&&r[t];if(o){var i=F(o,n);i>-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function he(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,n||t.type,e,t),xe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==F(n,t[r])&&n.push(t[r])}function ge(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),we(e)}function Oe(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var ke,Ee,Le=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==ke){var t=T("span","");M(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=ke?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=Ee)return Ee;var t=M(e,document.createTextNode("AخA")),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return L(e),!(!n||n.left==n.right)&&(Ee=r.right-n.right<3)}var Ne,je=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(Ne){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(Ne){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe=(Ne=T("div"),"oncopy"in Ne||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy)),Ae=null,_e={},Re={};function Ie(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function We(e){if("string"==typeof e&&Re.hasOwnProperty(e))e=Re[e];else if(e&&"string"==typeof e.name&&Re.hasOwnProperty(e.name)){var t=Re[e.name];"string"==typeof t&&(t={name:t}),e=Z(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=We(t);var n=_e[t.name];if(!n)return He(e,"text/plain");var r=n(e,t);if(Fe.hasOwnProperty(t.name)){var o=Fe[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}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 Fe={};function ze(e,t){var n=Fe.hasOwnProperty(e)?Fe[e]:Fe[e]={};I(t,n)}function Be(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Ue(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 Ve(e,t,n){return!e.startState||e.startState(t,n)}var Ge=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ke(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 o=n.children[r],i=o.chunkSize();if(t<i){n=o;break}t-=i}return n.lines[t]}function qe(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,(function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o})),r}function $e(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Xe(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,n=F(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function Ze(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var o=e.children[r],i=o.height;if(t<i){e=o;continue e}t-=i,n+=o.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 Qe(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function ot(e,t){return tt(e,t)<0?t:e}function it(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ke(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ke(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=st(e,t[r]);return n}Ge.prototype.eol=function(){return this.pos>=this.string.length},Ge.prototype.sol=function(){return this.pos==this.lineStart},Ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ge.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ge.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)),t)return++this.pos,n},Ge.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ge.prototype.skipToEnd=function(){this.pos=this.string.length},Ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ge.prototype.backUp=function(e){this.pos-=e},Ge.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(o(i)==o(e))return!1!==t&&(this.pos+=e.length),!0},Ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var o=[e.state.modeGen],i={};wt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=e.state.overlays[r],l=1,c=0;n.state=!0,wt(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=o[l];r>e&&o.splice(l,1,e,o[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}}),i),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=pt(e,Ye(t)),o=t.text.length>e.options.maxHighlightLength&&Be(e.doc.mode,r.state),i=ft(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.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 pt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new ut(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ke(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ct?c.lookAhead:0)<=i.modeFrontier))return s;var u=W(l.text,null,e.options.tabSize);(null==o||r>u)&&(o=s-1,r=u)}return o}(e,t,n),a=i>r.first&&Ke(r,i-1).stateAfter,s=a?ut.fromSaved(r,a,i):new ut(r,Ve(r.mode),i);return r.iter(i,t,(function(n){ht(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function ht(e,t,n,r){var o=e.doc.mode,i=new Ge(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&&mt(o,n.state);!i.eol();)vt(o,i,n.state),i.start=i.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ue(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function vt(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=Ue(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.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}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,Be(e.mode,t.state),n,t.lookAhead):new ut(e,Be(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?Be(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var o,i=e.doc,a=i.mode;t=st(i,t);var s,l=Ke(i,t.line),c=pt(e,t.line,n),u=new Ge(l.text,e.options.tabSize,c);for(r&&(s=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=vt(a,u,c.state),r&&s.push(new gt(u,o,Be(i.mode,c.state)));return r?s:new gt(u,o,c.state)}function bt(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";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function wt(e,t,n,r,o,i,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,f=new Ge(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,r.state),i);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,a&&ht(e,t,r,f.pos),f.pos=t.length,l=null):l=bt(vt(n,f,r.state,d),i),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<f.start;)c=Math.min(f.start,c+5e3),o(c,u);u=l}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e3);o(h,u),c=h}}var xt=!1,Ct=!1;function Ot(e,t,n){this.marker=e,this.from=t,this.to=n}function St(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function kt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Et(e,t){if(t.full)return null;var n=Qe(e,t.from.line)&&Ke(e,t.from.line).markedSpans,r=Qe(e,t.to.line)&&Ke(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker,s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);if(s||i.from==t&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var l=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new Ot(a,i.from,l?null:i.to))}}return r}(n,o,a),l=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker,s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);if(s||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var l=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new Ot(a,l?null:i.from-t,null==i.to?null:i.to-t))}}return r}(r,i,a),c=1==t.text.length,u=$(t.text).length+(c?o:0);if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null==d.to){var p=St(l,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=o}}if(l)for(var h=0;h<l.length;++h){var m=l[h];if(null!=m.to&&(m.to+=u),null==m.from){var v=St(s,m.marker);v||(m.from=u,c&&(s||(s=[])).push(m))}else m.from+=u,c&&(s||(s=[])).push(m)}s&&(s=Lt(s)),l&&l!=s&&(l=Lt(l));var g=[s];if(!c){var y,b=t.text.length-2;if(b>0&&s)for(var w=0;w<s.length;++w)null==s[w].to&&(y||(y=[])).push(new Ot(s[w].marker,null,null));for(var x=0;x<b;++x)g.push(y);g.push(l)}return g}function Lt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Mt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Nt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function Dt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=tt(r.from,o.from)||Nt(e)-Nt(t);if(i)return-i;var a=tt(r.to,o.to)||jt(e)-jt(t);return a||t.id-e.id}function Pt(e,t){var n,r=Ct&&e.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)o=r[i],o.marker.collapsed&&null==(t?o.from:o.to)&&(!n||Dt(n,o.marker)<0)&&(n=o.marker);return n}function At(e){return Pt(e,!0)}function _t(e){return Pt(e,!1)}function Rt(e,t){var n,r=Ct&&e.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!n||Dt(n,i.marker)<0)&&(n=i.marker)}return n}function It(e,t,n,r,o){var i=Ke(e,t),a=Ct&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,n)||Nt(l.marker)-Nt(o),f=tt(c.to,r)||jt(l.marker)-jt(o);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Wt(e){for(var t;t=At(e);)e=t.find(-1,!0).line;return e}function Ht(e,t){var n=Ke(e,t),r=Wt(n);return n==r?t:Ye(r)}function Ft(e,t){if(t>e.lastLine())return t;var n,r=Ke(e,t);if(!zt(e,r))return t;for(;n=_t(r);)r=n.find(1,!0).line;return Ye(r)+1}function zt(e,t){var n=Ct&&t.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if(r=n[o],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Bt(e,t,r))return!0}}function Bt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Bt(e,r.line,St(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if(o=t.markedSpans[i],o.marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&Bt(e,t,o))return!0}function Ut(e){e=Wt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==e)break;t+=o.height}for(var i=n.parent;i;n=i,i=n.parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==n)break;t+=s.height}return t}function Vt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=At(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=_t(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function Gt(e){var t=e.display,n=e.doc;t.maxLine=Ke(n,n.first),t.maxLineLength=Vt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Vt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Kt=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Mt(e)}Kt.prototype.lineNo=function(){return Ye(this)},ye(Kt);var $t={},Xt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Xt:$t;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=Jt,Te(e.display.measure)&&(a=ce(i,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&Ye(i);nn(i,r,dt(e,i,s)),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=A(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=A(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==o?(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(l){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,n,r,o,i,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!n||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}(t,e.trailingSpace):t,f=e.cm.state.specialChars,d=!1;if(f.test(t)){c=document.createDocumentFragment();for(var p=0;;){f.lastIndex=p;var h=f.exec(t),m=h?h.index-p:t.length-p;if(m){var v=document.createTextNode(u.slice(p,p+m));a&&s<9?c.appendChild(T("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;g=c.appendChild(T("span",q(b),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(g=c.appendChild(T("span","\r"==h[0]?"␍":"","cm-invalidchar")),g.setAttribute("cm-text",h[0]),e.col+=1):(g=e.cm.options.specialCharPlaceholder(h[0]),g.setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(T("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||d||i||l){var w=n||"";r&&(w+=r),o&&(w+=o);var x=T("span",[c],w,i);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return e.content.appendChild(x)}e.content.appendChild(c)}}function en(e,t){return function(n,r,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,d=0;d<t.length&&(f=t[d],!(f.to>c&&f.from<=c));d++);if(f.to>=u)return e(n,r,o,i,a,s,l);e(n,r.slice(0,f.to-c),o,i,null,s,l),i=null,r=r.slice(f.to-c),c=f.to}}}function tn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,l,c,u,f,d,p=o.length,h=0,m=1,v="",g=0;;){if(g==h){l=c=u=s="",d=null,f=null,g=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==h&&C.widgetNode)y.push(C);else if(x.from<=h&&(null==x.to||x.to>h||C.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&g>x.to&&(g=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==h&&(u+=" "+C.startStyle),C.endStyle&&x.to==g&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var O in C.attributes)(d||(d={}))[O]=C.attributes[O];C.collapsed&&(!f||Dt(f.marker,C)<0)&&(f=x)}else x.from>h&&g>x.from&&(g=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==g&&(c+=" "+b[S]);if(!f||f.from==h)for(var k=0;k<y.length;++k)tn(t,0,y[k]);if(f&&(f.from||0)==h){if(tn(t,(null==f.to?p+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=p)break;for(var E=Math.min(p,g);;){if(v){var L=h+v.length;if(!f){var M=L>E?v.slice(0,E-h):v;t.addToken(t,M,a?a+l:l,u,h+M.length==g?c:"",s,d)}if(L>=E){v=v.slice(E-h),h=E;break}h=L,u=""}v=o.slice(i,i=n[m++]),a=Yt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,o.slice(i,i=n[T]),Yt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=_t(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye($(this.rest))-n+1:1,this.node=this.text=null,this.hidden=zt(e,t)}function on(e,t,n){for(var r,o=[],i=t;i<n;i=r){var a=new rn(e.doc,Ke(e.doc,i),i);r=i+a.size,o.push(a)}return o}var an=null,sn=null;function ln(e,t){var n=de(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(cn,0));for(var i=function(e){r.push((function(){return n[e].apply(null,o)}))},a=0;a<n.length;++a)i(a)}}function cn(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?pn(e,t):"gutter"==i?mn(e,t,n,r):"class"==i?hn(e,t):"widget"==i&&vn(e,t,r)}t.changes=null}function fn(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function pn(e,t){var n=t.text.className,r=dn(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,hn(e,t)):n&&(t.text.className=n)}function hn(e,t){!function(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=fn(t);t.background=r.insertBefore(T("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?fn(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 mn(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 o=fn(t);t.gutterBackground=T("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),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=fn(t),s=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(T("div",Je(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function vn(e,t,n){t.alignable&&(t.alignable=null);for(var r=S("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&t.node.removeChild(o);yn(e,t,n)}function gn(e,t,n,r){var o=dn(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),hn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,o){if(t.widgets)for(var i=fn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),wn(l,c,n,r),e.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),ln(l,"redraw")}}function wn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var o=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(o-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!j(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;"),M(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Cn(e,t){for(var n=Oe(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function On(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function kn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=M(e.measure,T("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 En(e){return 50-e.display.nativeBarWidth}function Ln(e){return e.display.scroller.clientWidth-En(e)-e.display.barWidth}function Mn(e){return e.display.scroller.clientHeight-En(e)-e.display.barHeight}function Tn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var o=0;o<e.rest.length;o++)if(Ye(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function Nn(e,t,n,r){return Pn(e,Dn(e,t),n,r)}function jn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Dn(e,t){var n=Ye(t),r=jn(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,ir(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){t=Wt(t);var n=Ye(t),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var o=r.built=Zt(e,r);return r.text=o.pre,M(e.display.lineMeasure,o.pre),r}(e,t));var o=Tn(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Pn(e,t,n,r,o){t.before&&(n=-1);var i,l=n+(r||"");return t.cache.hasOwnProperty(l)?i=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,o=r&&Ln(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),i=function(e,t,n,r){var o,i=Rn(t.map,n,r),l=i.node,c=i.start,u=i.end,f=i.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&re(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&re(t.line.text.charAt(i.coverStart+u));)++u;if(o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():In(k(l,c,u).getClientRects(),r),o.left||o.right||0==c)break;u=c,c-=1,f="right"}a&&s<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ae)return Ae;var t=M(e,T("span","x")),n=t.getBoundingClientRect(),r=k(t,0,1).getBoundingClientRect();return Ae=Math.abs(n.left-r.left)>1}(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}}(e.display.measure,o))}else{var p;c>0&&(f=r="right"),o=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+or(e.display),top:h.top,bottom:h.bottom}:_n}for(var m=o.top-t.rect.top,v=o.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==f?o.right:o.left)-t.rect.left,right:("left"==f?o.left:o.right)-t.rect.left,top:w,bottom:x};return o.left||o.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=v),C}(e,t,n,r),i.bogus||(t.cache[l]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var An,_n={left:0,right:0,top:0,bottom:0};function Rn(e,t,n){for(var r,o,i,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(o=0,i=1,a="left"):t<l?(o=t-s,i=o+1):(c==e.length-3||t==l&&e[c+3]>t)&&(i=l-s,o=i-1,t>=l&&(a="right")),null!=o){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&o==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function In(e,t){var n=_n;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var o=e.length-1;o>=0&&(n=e[o]).left==n.right;o--);return n}function Wn(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 Hn(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Wn(e.display.view[t])}function Fn(e){Hn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function zn(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bn(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=xn(e.widgets[n]));return t}function Vn(e,t,n,r,o){if(!o){var i=Un(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var a=Ut(t);if("local"==r?a+=On(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Bn());var l=s.left+("window"==r?0:zn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Gn(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=zn(),o-=Bn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:o-a.top}}function Kn(e,t,n,r,o){return r||(r=Ke(e.doc,t.line)),Vn(e,r,Nn(e,r,t.ch,o),n)}function qn(e,t,n,r,o,i){function a(t,a){var s=Pn(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,Vn(e,r,s,n)}r=r||Ke(e.doc,t.line),o||(o=Dn(e,r));var s=ce(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=s[t],o=1==r.level;return a(n?e-1:e,o!=n)}var f=se(s,l,c),d=ae,p=u(l,f,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function $n(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=or(e.display)*t.ch);var r=Ke(e.doc,t.line),o=Ut(r)+On(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Xn(e,t,n,r,o){var i=et(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Yn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Xn(r.first,0,null,-1,-1);var o=Ze(r,n),i=r.first+r.size-1;if(o>i)return Xn(r.first+r.size-1,Ke(r,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(r,o);;){var s=er(e,a,o,t,n),l=Rt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=Ke(r,o=c.line)}}function Zn(e,t,n,r){r-=Un(t);var o=t.text.length,i=ie((function(t){return Pn(e,n,t-1).bottom<=r}),o,0);return o=ie((function(t){return Pn(e,n,t).top>r}),i,o),{begin:i,end:o}}function Qn(e,t,n,r){n||(n=Dn(e,t));var o=Vn(e,t,Pn(e,n,r),"line").top;return Zn(e,t,n,o)}function Jn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,o){o-=Ut(t);var i=Dn(e,t),a=Un(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?nr:tr)(e,t,n,i,u,r,o);c=1!=f.level,s=c?f.from:f.to-1,l=c?f.to:f.from-1}var d,p,h=null,m=null,v=ie((function(t){var n=Pn(e,i,t);return n.top+=a,n.bottom+=a,!!Jn(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,m=n),!0)}),s,l),g=!1;if(m){var y=r-m.left<m.right-r,b=y==c;v=h+(b?0:1),p=b?"after":"before",d=y?m.left:m.right}else{c||v!=l&&v!=s||v++,p=0==v?"after":v==t.text.length?"before":Pn(e,i,v-(c?1:0)).bottom+a<=o==c?"after":"before";var w=qn(e,et(n,v,p),"line",t,i);d=w.left,g=o<w.top?-1:o>=w.bottom?1:0}return v=oe(t.text,v,1),Xn(n,v,p,g,r-d)}function tr(e,t,n,r,o,i,a){var s=ie((function(s){var l=o[s],c=1!=l.level;return Jn(qn(e,et(n,c?l.to:l.from,c?"before":"after"),"line",t,r),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=qn(e,et(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Jn(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function nr(e,t,n,r,o,i,a){var s=Zn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,d=0;d<o.length;d++){var p=o[d];if(!(p.from>=c||p.to<=l)){var h=1!=p.level,m=Pn(e,r,h?Math.min(c,p.to)-1:Math.max(l,p.from)).right,v=m<i?i-m+1e9:m-i;(!u||f>v)&&(u=p,f=v)}}return u||(u=o[o.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==An){An=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)An.appendChild(document.createTextNode("x")),An.appendChild(T("br"));An.appendChild(document.createTextNode("x"))}M(e.measure,An);var n=An.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),L(e.measure),n||1}function or(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");M(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function ir(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+o,r[s]=i.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/or(e.display)-3);return function(o){if(zt(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return n?i+(Math.ceil(o.text.length/r)||1)*t:i+t}}function lr(e){var t=e.doc,n=sr(e);t.iter((function(e){var t=n(e);t!=e.height&&Xe(e,t)}))}function cr(e,t,n,r){var o=e.display;if(!n&&"true"==Oe(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(f){return null}var l,c=Yn(e,i,a);if(r&&c.xRel>0&&(l=Ke(e.doc,c.line).text).length==c.ch){var u=W(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((i-kn(e.display).left)/or(e.display))-u))}return c}function ur(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 fr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Ct&&Ht(e.doc,t)<o.viewTo&&pr(e);else if(n<=o.viewFrom)Ct&&Ft(e.doc,n+r)>o.viewFrom?pr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)pr(e);else if(t<=o.viewFrom){var i=hr(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):pr(e)}else if(n>=o.viewTo){var a=hr(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):pr(e)}else{var s=hr(e,t,t,-1),l=hr(e,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):pr(e)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(o.externalMeasured=null))}function dr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var i=r.view[ur(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==F(a,n)&&a.push(n)}}}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,n,r){var o,i=ur(e,t),a=e.display.view;if(!Ct||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(;Ht(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 mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var o=t[r];o.hidden||o.node&&!o.changes||++n}return n}function vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function gr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var c=l.empty();if(a){var u=a(e,l);u&&yr(e,u,o)}else(c||e.options.showCursorWhenSelecting)&&yr(e,l.head,o);c||wr(e,l,i)}}return r}function yr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(T("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var i=Kn(e,t,"div",null,null),a=i.right-i.left;o.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function wr(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),a=kn(e.display),s=a.left,l=Math.max(r.sizerWidth,Ln(e)-r.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,r){var i,a,f=Ke(o,t),d=f.text.length;function p(n,r){return Kn(e,et(t,n),"div",f,r)}function h(t,n,r){var o=Qn(e,f,null,t),i="ltr"==n==("after"==r)?"left":"right",a="after"==r?o.begin:o.end-(/\s/.test(f.text.charAt(o.end-1))?2:1);return p(a,i)[i]}var m=ce(f,o.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,o,f){var v="ltr"==o,g=p(e,v?"left":"right"),y=p(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==d,x=0==f,C=!m||f==m.length-1;if(y.top-g.top<=3){var O=(c?b:w)&&x,S=(c?w:b)&&C,k=O?s:(v?g:y).left,E=S?l:(v?y:g).right;u(k,g.top,E-k,g.bottom)}else{var L,M,T,N;v?(L=c&&b&&x?s:g.left,M=c?l:h(e,o,"before"),T=c?s:h(t,o,"after"),N=c&&w&&C?l:y.right):(L=c?h(e,o,"before"):s,M=!c&&b&&x?l:g.right,T=!c&&w&&C?s:y.left,N=c?h(t,o,"after"):l),u(L,g.top,M-L,g.bottom),g.bottom<y.top&&u(s,g.bottom,null,y.top),u(T,y.top,N-T,y.bottom)}(!i||br(g,i)<0)&&(i=g),br(y,i)<0&&(i=y),(!a||br(g,a)<0)&&(a=g),br(y,a)<0&&(a=y)})),{start:i,end:a}}var d=t.from(),p=t.to();if(d.line==p.line)f(d.line,d.ch,p.ch);else{var h=Ke(o,d.line),m=Ke(o,p.line),v=Wt(h)==Wt(m),g=f(d.line,d.ch,v?h.text.length+1:null).end,y=f(p.line,v?0:null,p.ch).start;v&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(s,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(s,g.bottom,null,y.top)}n.appendChild(i)}function xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Sr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&kr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Er(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,i=0,l=0;l<t.view.length;l++){var c=t.view[l],u=e.options.lineWrapping,f=void 0,d=0;if(!c.hidden){if(o+=c.line.height,a&&s<8){var p=c.node.offsetTop+c.node.offsetHeight;f=p-n,n=p}else{var h=c.node.getBoundingClientRect();f=h.bottom-h.top,!u&&c.text.firstChild&&(d=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var m=c.line.height-f;if((m>.005||m<-.005)&&(o<r&&(i-=m),Xe(c.line,f),Lr(c.line),c.rest))for(var v=0;v<c.rest.length;v++)Lr(c.rest[v]);if(d>e.display.sizerWidth){var g=Math.ceil(d/or(e.display));g>e.display.maxLineLength&&(e.display.maxLineLength=g,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function Lr(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 Mr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-On(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=Ze(t,r),a=Ze(t,o);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=Ze(t,Ut(Ke(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=Ze(t,Ut(Ke(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Tr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Mn(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+Sn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?s:t.bottom)-i);u!=o&&(a.scrollTop=u)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,p=Ln(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left+f-(h?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function Nr(e,t){null!=t&&(Pr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function jr(e){Pr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dr(e,t,n){null==t&&null==n||Pr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Pr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$n(e,t.from),r=$n(e,t.to);Ar(e,n,r,t.margin)}}function Ar(e,t,n,r){var o=Tr(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});Dr(e,o.scrollLeft,o.scrollTop)}function _r(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||lo(e,{top:t}),Rr(e,t,!0),n&&lo(e),ro(e,100))}function Rr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ir(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Wr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(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+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Hr=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hr.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 o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Hr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hr.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Hr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var o=e.getBoundingClientRect(),i="vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Hr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fr=function(){};function zr(e,t){t||(t=Wr(e));var n=e.display.barWidth,r=e.display.barHeight;Br(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Er(e),Br(e,Wr(e)),n=e.display.barWidth,r=e.display.barHeight}function Br(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=""}Fr.prototype.update=function(){return{bottom:0,right:0}},Fr.prototype.setScrollLeft=function(){},Fr.prototype.setScrollTop=function(){},Fr.prototype.clear=function(){};var Ur={native:Hr,null:Fr};function Vr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ur[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Ir(e,t):_r(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Gr=0;function Kr(e){var t;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:++Gr,markArrays:null},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(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 o=e.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)$r(t[n]);for(var r=0;r<t.length;r++)Xr(t[r]);for(var o=0;o<t.length;o++)Yr(t[o]);for(var i=0;i<t.length;i++)Zr(t[i]);for(var a=0;a<t.length;a++)Qr(t[a])}(e)}))}function $r(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=En(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=En(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Gt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xr(e){e.updatedDisplay=e.mustUpdate&&ao(e.cm,e.update)}function Yr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Er(t),e.barMeasure=Wr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Nn(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+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ln(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&zr(t,e.barMeasure),e.updatedDisplay&&uo(t,e.barMeasure),e.selectionChanged&&xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Cr(e.cm)}function Qr(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&so(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Rr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Ir(t,e.scrollLeft,!0,!0),e.scrollToPos){var o=function(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var a=!1,s=qn(e,t),l=n&&n!=t?qn(e,n):s;o={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 c=Tr(e,o),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(_r(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Ir(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return o}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=T("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-On(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,o)}var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var s=0;s<i.length;++s)i[s].lines.length||he(i[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&he(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Jr(e,t){if(e.curOp)return t();Kr(e);try{return t()}finally{qr(e)}}function eo(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Kr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function to(e){return function(){if(this.curOp)return e.apply(this,arguments);Kr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function no(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Kr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function ro(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(oo,e))}function oo(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(r.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?Be(t.mode,r.state):null,l=ft(e,i,r,!0);s&&(r.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=i.styles[d];f&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ht(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ro(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Jr(e,(function(){for(var t=0;t<o.length;t++)dr(e,o[t],"text")}))}}var io=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Mr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ln(e),this.force=n,this.dims=ir(e),this.events=[]};function ao(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return pr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;po(e)&&(pr(e),t.dims=ir(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFrom<i&&i-n.viewFrom<20&&(i=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),Ct&&(i=Ht(e.doc,i),a=Ft(e.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display,o=r.view;0==o.length||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(ur(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,ur(e,n)))),r.viewTo=n}(e,i,a),n.viewOffset=Ut(Ke(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mr(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!j(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&j(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,f=0;f<c.length;f++){var d=c[f];if(d.hidden);else if(d.node&&d.node.parentNode==i){for(;a!=d.node;)a=s(a);var p=o&&null!=t&&t<=u&&d.lineNumber;d.changes&&(F(d.changes,"gutter")>-1&&(p=!1),un(e,d,u,n)),p&&(L(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Je(e.options,u)))),a=d.node.nextSibling}else{var h=gn(e,d,u,n);i.insertBefore(h,a)}u+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&j(document.body,e.anchorNode)&&j(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)}}(u),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ro(e,400)),n.updateLineNumbers=null,!0}function so(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ln(e))r&&(t.visible=Mr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Mn(e),n.top)}),t.visible=Mr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ao(e,t))break;Er(e);var o=Wr(e);vr(e),zr(e,o),uo(e,o),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 lo(e,t){var n=new io(e,t);if(ao(e,n)){Er(e),so(e,n);var r=Wr(e);vr(e),zr(e,r),uo(e,r),n.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ln(e,"gutterChanged",e)}function uo(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+En(e)+"px"}function fo(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=i),n[a].gutterBackground&&(n[a].gutterBackground.style.left=i));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=r+o+"px")}}function po(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Je(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",co(e.display),!0}return!1}function ho(e,t){for(var n=[],r=!1,o=0;o<e.length;o++){var i=e[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;r=!0}n.push({className:i,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function mo(e){var t=e.gutters,n=e.gutterSpecs;L(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,a=o.style,s=t.appendChild(T("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",co(e)}function vo(e){mo(e.display),fr(e),fo(e)}function go(e,t,r,o){var i=this;this.input=r,i.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=N("div",null,"CodeMirror-code"),i.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=T("div",null,"CodeMirror-cursors"),i.measure=T("div",null,"CodeMirror-measure"),i.lineMeasure=T("div",null,"CodeMirror-measure"),i.lineSpace=N("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=N("div",[i.lineSpace],"CodeMirror-lines");i.mover=T("div",[c],null,"position: relative"),i.sizer=T("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),i.gutters=T("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=T("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=T("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),i.wrapper.setAttribute("translate","no"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&g||(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=ho(o.gutters,o.lineNumbers),mo(i),r.init(i)}io.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var yo=0,bo=null;function wo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xo(e){var t=wo(e);return t.x*=bo,t.y*=bo,t}function Co(e,t){var r=wo(t),o=r.x,i=r.y,a=bo;0===t.deltaMode&&(o=t.deltaX,i=t.deltaY,a=1);var s=e.display,c=s.scroller,u=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight;if(o&&u||i&&d){if(i&&y&&l)e:for(var p=t.target,h=s.view;p!=c;p=p.parentNode)for(var m=0;m<h.length;m++)if(h[m].node==p){e.display.currentWheelTarget=p;break e}if(o&&!n&&!f&&null!=a)return i&&d&&_r(e,Math.max(0,c.scrollTop+i*a)),Ir(e,Math.max(0,c.scrollLeft+o*a)),(!i||i&&d)&&be(t),void(s.wheelStartX=null);if(i&&null!=a){var v=i*a,g=e.doc.scrollTop,b=g+s.wrapper.clientHeight;v<0?g=Math.max(0,g+v-50):b=Math.min(e.doc.height,b+v+50),lo(e,{top:g,bottom:b})}yo<20&&0!==t.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=o,s.wheelDY=i,setTimeout((function(){if(null!=s.wheelStartX){var e=c.scrollLeft-s.wheelStartX,t=c.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(bo=(bo*yo+n)/(yo+1),++yo)}}),200)):(s.wheelDX+=o,s.wheelDY+=i))}}a?bo=-.53:n?bo=15:u?bo=-.7:d&&(bo=-1/3);var Oo=function(e,t){this.ranges=e,this.primIndex=t};Oo.prototype.primary=function(){return this.ranges[this.primIndex]},Oo.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(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},Oo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new So(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new Oo(e,this.primIndex)},Oo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Oo.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var So=function(e,t){this.anchor=e,this.head=t};function ko(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=F(t,o);for(var i=1;i<t.length;i++){var a=t[i],s=t[i-1],l=tt(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=it(s.from(),a.from()),u=ot(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,t.splice(--i,2,new So(f?u:c,f?c:u))}}return new Oo(t,n)}function Eo(e,t){return new Oo([new So(e,t||e)],0)}function Lo(e){return e.text?et(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Mo(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Lo(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+=Lo(t).ch-t.to.ch),et(n,r)}function To(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new So(Mo(o.anchor,t),Mo(o.head,t)))}return ko(e.cm,n,e.sel.primIndex)}function No(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function jo(e){e.doc.mode=He(e.options,e.doc.modeOption),Do(e)}function Do(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ro(e,100),e.state.modeGen++,e.curOp&&fr(e)}function Po(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ao(e,t,n,r){function o(e){return n?n[e]:null}function i(e,n,o){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Mt(e),Tt(e,n);var o=r?r(e):1;o!=e.height&&Xe(e,o)}(e,n,o,r),ln(e,"change",e,t)}function a(e,t){for(var n=[],i=e;i<t;++i)n.push(new Kt(c[i],o(i),r));return n}var s=t.from,l=t.to,c=t.text,u=Ke(e,s.line),f=Ke(e,l.line),d=$(c),p=o(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Po(e,t)){var m=a(0,c.length-1);i(f,f.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(u==f)if(1==c.length)i(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),p);else{var v=a(1,c.length-1);v.push(new Kt(d+u.text.slice(l.ch),p,r)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,v)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),o(0)),e.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(f,d+f.text.slice(l.ch),p);var g=a(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}ln(e,"change",e,t)}function _o(e,t,n){!function e(r,o,i){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Ro(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,lr(e),jo(e),Io(e),e.options.direction=t.direction,e.options.lineWrapping||Gt(e),e.options.mode=t.modeOption,fr(e)}function Io(e){("rtl"==e.doc.direction?P:E)(e.display.lineDiv,"CodeMirror-rtl")}function Wo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ho(e,t){var n={from:rt(t.from),to:Lo(t),text:qe(e,t.from,t.to)};return Vo(e,n,t.from.line,t.to.line+1),_o(e,(function(e){return Vo(e,n,t.from.line,t.to.line+1)}),!0),n}function Fo(e){for(;e.length;){var t=$(e);if(!t.ranges)break;e.pop()}}function zo(e,t,n,r){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Fo(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(o,o.lastOp==r)))a=$(i.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Lo(t):i.changes.push(Ho(e,t));else{var l=$(o.done);for(l&&l.ranges||Uo(e.sel,o.done),i={changes:[Ho(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,a||he(e,"historyAdded")}function Bo(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,$(o.done),t))?o.done[o.done.length-1]=t:Uo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&Fo(o.undone)}function Uo(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vo(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i}))}function Go(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 Ko(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],o=0;o<t.text.length;++o)r.push(Go(n[o]));return r}(e,t),r=Et(e,t);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],a=r[o];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue e;i.push(l)}else a&&(n[o]=a)}return n}function qo(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)r.push(n?Oo.prototype.deepCopy.call(i):i);else{var a=i.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&F(t,Number(u[1]))>-1&&($(s)[f]=c[f],delete c[f])}}}return r}function $o(e,t,n,r){if(r){var o=e.anchor;if(n){var i=tt(t,o)<0;i!=tt(n,o)<0?(o=t,t=n):i!=tt(t,n)<0&&(t=n)}return new So(o,t)}return new So(n||t,t)}function Xo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ei(e,new Oo([$o(e.sel.primary(),t,n,o)],0),r)}function Yo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)r[i]=$o(e.sel.ranges[i],t[i],null,o);var a=ko(e.cm,r,e.sel.primIndex);ei(e,a,n)}function Zo(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,ei(e,ko(e.cm,o,e.sel.primIndex),r)}function Qo(e,t,n,r){ei(e,Eo(t,n),r)}function Jo(e,t,n){var r=e.history.done,o=$(r);o&&o.ranges?(r[r.length-1]=t,ti(e,t,n)):ei(e,t,n)}function ei(e,t,n){ti(e,t,n),Bo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ti(e,t,n){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new So(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return he(e,"beforeSelectionChange",e,r),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ko(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ni(e,oi(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||jr(e.cm)}function ni(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),ln(e,"cursorActivity",e))}function ri(e){ni(e,oi(e,e.sel,null,!1))}function oi(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=ai(e,a.anchor,s&&s.anchor,n,r),c=ai(e,a.head,s&&s.head,n,r);(o||l!=a.anchor||c!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new So(l,c))}return o?ko(e.cm,o,t.primIndex):t}function ii(e,t,n,r,o){var i=Ke(e,t.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(o&&(he(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(f=si(e,f,-r,f&&f.line==t.line?i:null)),f&&f.line==t.line&&(d=tt(f,n))&&(r<0?d<0:d>0))return ii(e,f,t,r,o)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=si(e,p,r,p.line==t.line?i:null)),p?ii(e,p,t,r,o):null}}return t}function ai(e,t,n,r,o){var i=r||1,a=ii(e,t,n,i,o)||!o&&ii(e,t,n,i,!0)||ii(e,t,n,-i,o)||!o&&ii(e,t,n,-i,!0);return a||(e.cantEdit=!0,et(e.first,0))}function si(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||Ke(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function li(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),B)}function ci(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(t,n,o,i){t&&(r.from=st(e,t)),n&&(r.to=st(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),he(e,"beforeChange",e,r),e.cm&&he(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 ui(e,t,n){if(e.cm){if(!e.cm.curOp)return eo(e.cm,ui)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))||(t=ci(e,t,!0),t)){var r=xt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=F(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:t,to:n}],i=0;i<r.length;++i)for(var a=r[i],s=a.find(0),l=0;l<o.length;++l){var c=o[l];if(!(tt(c.to,s.from)<0||tt(c.from,s.to)>0)){var u=[l,1],f=tt(c.from,s.from),d=tt(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)fi(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else fi(e,t)}}function fi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=To(e,t);zo(e,t,n,e.cm?e.cm.curOp.id:NaN),hi(e,t,n,Et(e,t));var r=[];_o(e,(function(e,n){n||-1!=F(r,e.history)||(yi(e.history,t),r.push(e.history)),hi(e,t,null,Et(e,t))}))}}function di(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,c=0;c<s.length&&(o=s[c],n?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(o=s.pop(),!o.ranges){if(r)return void s.push(o);break}if(Uo(o,l),n&&!o.equals(e.sel))return void ei(e,o,{clearRedo:!1});a=o}var u=[];Uo(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var f=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),d=function(n){var r=o.changes[n];if(r.origin=t,f&&!ci(e,r,!1))return s.length=0,{};u.push(Ho(e,r));var i=n?To(e,r):$(s);hi(e,r,i,Ko(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Lo(r)});var a=[];_o(e,(function(e,t){t||-1!=F(a,e.history)||(yi(e.history,r),a.push(e.history)),hi(e,r,null,Ko(e,r))}))},p=o.changes.length-1;p>=0;--p){var h=d(p);if(h)return h.v}}}}function pi(e,t){if(0!=t&&(e.first+=t,e.sel=new Oo(X(e.sel.ranges,(function(e){return new So(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(e.cm,r,"gutter")}}function hi(e,t,n,r){if(e.cm&&!e.cm.curOp)return eo(e.cm,hi)(e,t,n,r);if(t.to.line<e.first)pi(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);pi(e,o),t={from:et(e.first,0),to:et(t.to.line+o,t.to.ch),text:[$(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:et(i,Ke(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=To(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Ye(Wt(Ke(r,i.line))),r.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ve(e),Ao(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(l,i.line+t.text.length,(function(e){var t=Vt(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var o=Ke(e,r).stateAfter;if(o&&(!(o instanceof ct)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,i.line),ro(e,400);var c=t.text.length-(a.line-i.line)-1;t.full?fr(e):i.line!=a.line||1!=t.text.length||Po(e.doc,t)?fr(e,i.line,a.line+1,c):dr(e,i.line,"text");var u=ge(e,"changes"),f=ge(e,"change");if(f||u){var d={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&ln(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):Ao(e,t,r),ti(e,n,B),e.cantEdit&&ai(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mi(e,t,n,r,o){var i;r||(r=n),tt(r,n)<0&&(i=[r,n],n=i[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ui(e,{from:n,to:r,text:t,origin:o})}function vi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function gi(e,t,n,r){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||(i=e[o]=i.deepCopy(),i.copied=!0);for(var s=0;s<i.ranges.length;s++)vi(i.ranges[s].anchor,t,n,r),vi(i.ranges[s].head,t,n,r)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function yi(e,t){var n=t.from.line,r=t.to.line,o=t.text.length-(r-n)-1;gi(e.done,n,r,o),gi(e.undone,n,r,o)}function bi(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=Ke(e,at(e,t)):o=Ye(t),null==o?null:(r(i,o)&&e.cm&&dr(e.cm,o,n),i)}function wi(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}function xi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}So.prototype.from=function(){return it(this.anchor,this.head)},So.prototype.to=function(){return ot(this.anchor,this.head)},So.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var o=this.lines[n];this.height-=o.height,qt(o),ln(o,"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}},xi.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],o=r.chunkSize();if(e<o){var i=Math.min(t,o-e),a=r.height;if(r.removeInner(e,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wi))){var s=[];this.collapse(s),this.children=[new wi(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 o=this.children[r],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new wi(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++r,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new xi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=F(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var o=new xi(e.children);o.parent=e,e.children=[o,n],e=o}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 o=this.children[r],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var Ci=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Oi(e,t,n){Ut(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Nr(e,n)}Ci.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ye(n);if(null!=r&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(n.widgets=null);var i=xn(this);Xe(n,Math.max(0,n.height-i)),e&&(Jr(e,(function(){Oi(e,n,-i),dr(e,r,"widget")})),ln(e,"lineWidgetCleared",e,this,r))}},Ci.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=xn(this)-t;o&&(zt(this.doc,r)||Xe(r,r.height+o),n&&Jr(n,(function(){n.curOp.forceUpdate=!0,Oi(n,r,o),ln(n,"lineWidgetChanged",n,e,Ye(r))})))},ye(Ci);var Si=0,ki=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Si};function Ei(e,t,n,r,o){if(r&&r.shared)return function(e,t,n,r,o){r=I(r),r.shared=!1;var i=[Ei(e,t,n,r,o)],a=i[0],s=r.widgetNode;return _o(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),i.push(Ei(e,st(e,t),st(e,n),r,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=$(i)})),new Li(i,a)}(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return eo(e.cm,Ei)(e,t,n,r,o);var i=new ki(e,o),a=tt(t,n);if(r&&I(r,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=N("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(It(e,t.line,t,n,i)||t.line!=n.line&&It(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}i.addToHistory&&zo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&Wt(r)==c.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Xe(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new Ot(i,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){zt(e,t)&&Xe(t,0)})),i.clearOnEnter&&fe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Si,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)fr(c,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=n.line;u++)dr(c,u,"text");i.atomic&&ri(c.doc),ln(c,"markerAdded",c,i)}return i}ki.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kr(e),ge(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=St(a.markedSpans,this);e&&!this.collapsed?dr(e,Ye(a),"text"):e&&(null!=s.to&&(o=Ye(a)),null!=s.from&&(r=Ye(a))),a.markedSpans=kt(a.markedSpans,s),null==s.from&&this.collapsed&&!zt(this.doc,a)&&e&&Xe(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Wt(this.lines[l]),u=Vt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&fr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ri(e.doc)),e&&ln(e,"markerCleared",e,this,r,o),t&&qr(e),this.parent&&this.parent.clear()}},ki.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=St(i.markedSpans,this);if(null!=a.from&&(n=et(t?i:Ye(i),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?i:Ye(i),a.to),1==e))return r}return n&&{from:n,to:r}},ki.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Jr(r,(function(){var o=t.line,i=Ye(t.line),a=jn(r,i);if(a&&(Wn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!zt(n.doc,o)&&null!=n.height){var s=n.height;n.height=null;var l=xn(n)-s;l&&Xe(o,o.height+l)}ln(r,"markerChanged",r,e)}))},ki.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=F(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ki.prototype.detachLine=function(e){if(this.lines.splice(F(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(ki);var Li=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Mi(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ti(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];_o(n.primary.doc,(function(e){return r.push(e)}));for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==F(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}Li.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},Li.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Li);var Ni=0,ji=function(e,t,n,r,o){if(!(this instanceof ji))return new ji(e,t,n,r,o);null==n&&(n=0),xi.call(this,[new wi([new Kt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=et(n,0);this.sel=Eo(i),this.history=new Wo(null),this.id=++Ni,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ao(this,{from:i,to:i,text:e}),ei(this,Eo(i),B)};ji.prototype=Z(xi.prototype,{constructor:ji,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=$e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:no((function(e){var t=et(this.first,0),n=this.first+this.size-1;ui(this,{from:t,to:et(n,Ke(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Dr(this.cm,0,0),ei(this,Eo(t),B)})),replaceRange:function(e,t,n,r){t=st(this,t),n=n?st(this,n):t,mi(this,e,t,n,r)},getRange:function(e,t,n){var r=qe(this,st(this,e),st(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ke(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ke(this,e)),Wt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||!1===e?n.to():n.from(),t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:no((function(e,t,n){Qo(this,st(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:no((function(e,t,n){Qo(this,st(this,e),st(this,t||e),n)})),extendSelection:no((function(e,t,n){Xo(this,st(this,e),t&&st(this,t),n)})),extendSelections:no((function(e,t){Yo(this,lt(this,e),t)})),extendSelectionsBy:no((function(e,t){var n=X(this.sel.ranges,e);Yo(this,lt(this,n),t)})),setSelections:no((function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new So(st(this,e[o].anchor),st(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ei(this,ko(this.cm,r,t),n)}})),addSelection:no((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new So(st(this,e),st(this,t||e))),ei(this,ko(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[r]=o}return t},replaceSelection:function(e,t,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:no((function(e,t,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];r[i]={from:a.from(),to:a.to(),text:this.splitLines(e[i]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],o=et(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=No(s.from,o,i),c=No(Lo(s),o,i);if(o=s.to,i=c,"around"==n){var u=e.sel.ranges[a],f=tt(u.head,u.anchor)<0;r[a]=new So(f?c:l,f?l:c)}else r[a]=new So(l,l)}return new Oo(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)ui(this,r[l]);s?Jo(this,s):this.cm&&jr(this.cm)})),undo:no((function(){di(this,"undo")})),redo:no((function(){di(this,"redo")})),undoSelection:no((function(){di(this,"undo",!0)})),redoSelection:no((function(){di(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 o=0;o<e.undone.length;o++)e.undone[o].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Wo(this.history),_o(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:qo(this.history.done),undone:qo(this.history.undone)}},setHistory:function(e){var t=this.history=new Wo(this.history);t.done=qo(e.done.slice(0),null,!0),t.undone=qo(e.undone.slice(0),null,!0)},setGutterMarker:no((function(e,t,n){return bi(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:no((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bi(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,e=Ke(this,e),!e)return null}else if(t=Ye(e),null==t)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:no((function(e,t,n){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:no((function(e,t,n){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==n)e[r]=null;else{var i=o.match(S(n));if(!i)return!1;var a=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:no((function(e,t,n){return function(e,t,n,r){var o=new Ci(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),bi(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!zt(e,t)){var r=Ut(t)<e.scrollTop;Xe(t,t.height+xn(o)),r&&Nr(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&ln(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Ye(t)),o}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ei(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=st(this,e),Ei(this,e,e,n,"bookmark")},findMarksAt:function(e){e=st(this,e);var t=[],n=Ke(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+r;if(i>e)return t=e,!0;e-=i,++n})),st(this,et(n,t))},indexFromPos:function(e){e=st(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(e){t+=e.text.length+n})),t},copy:function(e){var t=new ji($e(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;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new ji($e(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}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],o=r.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(tt(i,a)){var s=Ei(e,i,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Mi(this)),r},unlinkDoc:function(e){if(e instanceof La&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ti(Mi(this));break}}if(e.history==this.history){var r=[e.id];_o(e,(function(e){return r.push(e.id)}),!0),e.history=new Wo(null),e.history.done=qo(this.history.done,r),e.history.undone=qo(this.history.undone,r)}},iterLinkedDocs:function(e){_o(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):je(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:no((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&(t=this.cm,Jr(t,(function(){Io(t),fr(t)}))))}))}),ji.prototype.eachLine=ji.prototype.iter;var Di=0;function Pi(e){var t=this;if(Ai(t),!me(t,e)&&!Cn(t.display,e)){be(e),a&&(Di=+new Date);var n=cr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),s=0,l=function(){++s==o&&eo(t,(function(){n=st(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ui(t.doc,e),Jo(t.doc,Eo(st(t.doc,n),st(t.doc,Lo(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==F(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),ti(t.doc,Eo(n,n)),d)for(var p=0;p<d.length;++p)mi(t.doc,"",d[p].anchor,d[p].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(h){}}}}function Ai(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _i(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var o=t[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Ri=!1;function Ii(){var e;Ri||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_i(Wi)}),100))})),fe(window,"blur",(function(){return _i(kr)})),Ri=!0)}function Wi(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Hi={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"},Fi=0;Fi<10;Fi++)Hi[Fi+48]=Hi[Fi+96]=String(Fi);for(var zi=65;zi<=90;zi++)Hi[zi]=String.fromCharCode(zi);for(var Bi=1;Bi<=12;Bi++)Hi[Bi+111]=Hi[Bi+63235]="F"+Bi;var Ui={};function Vi(e){var t,n,r,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Gi(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 o=X(n.split(" "),Vi),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=r):(s=o.slice(0,i+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Ki(e,t,n,r){t=Yi(t);var o=t.call?t.call(e,r):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ki(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var a=Ki(e,t.fallthrough[i],n,r);if(a)return a}}}function qi(e){var t="string"==typeof e?e:Hi[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $i(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Xi(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Hi[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),$i(n,e,t))}function Yi(e){return"string"==typeof e?Ui[e]:e}function Zi(e,t){for(var n=e.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=t(n[o]);r.length&&tt(i.from,$(r).to)<=0;){var a=r.pop();if(tt(a.from,i.from)<0){i.from=a.from;break}}r.push(i)}Jr(e,(function(){for(var t=r.length-1;t>=0;t--)mi(e.doc,"",r[t].from,r[t].to,"+delete");jr(e)}))}function Qi(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ji(e,t,n){var r=Qi(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(n,t.doc.direction);if(i){var a,s=o<0?$(i):i[0],l=o<0==(1==s.level),c=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Dn(t,n);a=o<0?n.text.length-1:0;var f=Pn(t,u,a).top;a=ie((function(e){return Pn(t,u,e).top==f}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Qi(n,a,1))}else a=o<0?s.to:s.from;return new et(r,a,c)}}return new et(r,o<0?n.text.length:0,o<0?"before":"after")}Ui.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"},Ui.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"},Ui.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ui.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"]},Ui.default=y?Ui.macDefault:Ui.pcDefault;var ta={selectAll:li,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),B)},killLine:function(e){return Zi(e,(function(t){if(t.empty()){var n=Ke(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zi(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zi(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zi(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 Zi(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(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ke(e.doc,t),r=function(e){for(var t;t=_t(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Ye(r)),ea(!0,e,n,t,-1)}(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")}),V)},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")}),V)},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/)?ra(e,t.head):r}),V)},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("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),a=W(e.getLine(i.line),i.ch,r);t.push(q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Jr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=Ke(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new et(o.line,o.ch-1)),o.ch>0)o=new et(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ke(e.doc,o.line-1).text;a&&(o=new et(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(o.line-1,a.length-1),o,"+transpose"))}n.push(new So(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return Jr(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);jr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ke(e.doc,t),r=Wt(n);return r!=n&&(t=Ye(r)),ea(!0,e,r,t,1)}function ra(e,t){var n=na(e,t.line),r=Ke(e.doc,n.line),o=ce(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=i&&t.ch;return et(n.line,a?0:i,n.sticky)}return n}function oa(e,t,n){if("string"==typeof t&&(t=ta[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=z}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}var ia=new H;function aa(e,t,n,r){var o=e.state.keySeq;if(o){if(qi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ia.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,o+" "+t,n,r))return!0}return sa(e,t,n,r)}function sa(e,t,n,r){var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=Ki(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&Ki(t,e.options.extraKeys,n,e)||Ki(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&ln(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(be(n),xr(e)),!!o}function la(e,t){var n=Xi(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return oa(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return oa(e,t)})):aa(e,n,t,(function(t){return oa(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=D(),me(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var o=la(t,e);f&&(ca=o?r:null,o||88!=r||Pe||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!o&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}P(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}(t)}}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Cn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==ca)return ca=null,void be(e);if(!f||e.which&&!(e.which<10)||!la(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return oa(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var pa,ha,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function va(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Cn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=cr(t,e),o=Se(e),i=r?function(e,t){var n=+new Date;return ha&&ha.compare(n,e,t)?(pa=ha=null,"triple"):pa&&pa.compare(n,e,t)?(ha=new ma(n,e,t),pa=null,"double"):(pa=new ma(n,e,t),ha=null,"single")}(r,o):"single";window.focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),i=(1==t?"Left":2==t?"Middle":"Right")+i,aa(e,$i(i,o),o,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=z}finally{e.state.suppressEdits=!1}return r}))}(t,o,r,i,e)||(1==o?r?function(e,t,n,r){a?setTimeout(R(Cr,e),0):e.curOp.focus=D();var o,i=function(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(null==o.unit){var i=b?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=y?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(y?n.altKey:n.ctrlKey)),o}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Le&&!e.isReadOnly()&&"single"==n&&(o=c.contains(t))>-1&&(tt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(tt(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,c=eo(e,(function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Or(e)),pe(o.wrapper.ownerDocument,"mouseup",c),pe(o.wrapper.ownerDocument,"mousemove",u),pe(o.scroller,"dragstart",f),pe(o.scroller,"drop",c),i||(be(t),r.addNew||Xo(e.doc,n,null,null,r.extend),l&&!d||a&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,fe(o.wrapper.ownerDocument,"mouseup",c),fe(o.wrapper.ownerDocument,"mousemove",u),fe(o.scroller,"dragstart",f),fe(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,r,t,i):function(e,t,n,r){a&&Or(e);var o=e.display,i=e.doc;be(t);var s,l,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=i.sel.contains(n),s=l>-1?u[l]:new So(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new So(n,n)),n=cr(e,t,!0,!0),l=-1;else{var f=ga(e,n,r.unit);s=r.extend?$o(s,f.anchor,f.head,r.extend):f}r.addNew?-1==l?(l=u.length,ei(i,ko(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(ei(i,ko(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Zo(i,l,s,U):(l=0,ei(i,new Oo([s],0),U),c=i.sel);var d=n;function p(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var o=[],a=e.options.tabSize,u=W(Ke(i,n.line).text,n.ch,a),f=W(Ke(i,t.line).text,t.ch,a),p=Math.min(u,f),h=Math.max(u,f),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Ke(i,m).text,y=G(g,p,a);p==h?o.push(new So(et(m,y),et(m,y))):g.length>y&&o.push(new So(et(m,y),et(m,G(g,h,a))))}o.length||o.push(new So(n,n)),ei(i,ko(e,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=ga(e,t,r.unit),C=w.anchor;tt(x.anchor,C)>0?(b=x.head,C=it(w.from(),x.anchor)):(b=x.anchor,C=ot(w.to(),x.head));var O=c.ranges.slice(0);O[l]=function(e,t){var n=t.anchor,r=t.head,o=Ke(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var i=ce(o);if(!i)return t;var a=se(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(i,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var d=i[c+(l?-1:0)],p=l==(1==d.level),h=p?d.from:d.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new So(new et(n.line,h,m),r)}(e,new So(st(i,C),b)),ei(i,ko(e,O,l),U)}}var h=o.wrapper.getBoundingClientRect(),m=0;function v(t){e.state.selectingText=!1,m=1/0,t&&(be(t),o.input.focus()),pe(o.wrapper.ownerDocument,"mousemove",g),pe(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var g=eo(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var a=++m,s=cr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=D(),p(s);var l=Mr(o,i);(s.line>=l.to||s.line<l.from)&&setTimeout(eo(e,(function(){m==a&&t(n)})),150)}else{var c=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;c&&setTimeout(eo(e,(function(){m==a&&(o.scroller.scrollTop+=c,t(n))})),50)}}(t):v(t)})),y=eo(e,v);e.state.selectingText=y,fe(o.wrapper.ownerDocument,"mousemove",g),fe(o.wrapper.ownerDocument,"mouseup",y)}(e,r,t,i)}(t,r,i,e):Oe(e)==n.scroller&&be(e):2==o?(r&&Xo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(O?t.display.input.onContextMenu(e):Or(t)))}}function ga(e,t,n){if("char"==n)return new So(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new So(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new So(r.from,r.to)}function ya(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(d){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ge(e,n))return xe(t);i-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o){var u=Ze(e.doc,i),f=e.display.gutterSpecs[l];return he(e,n,e,u,f.className,t),xe(t)}}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function wa(e,t){Cn(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||O||e.display.input.onContextMenu(t)}function xa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},Oa={},Sa={};function ka(e,t,n){var r=n&&n!=Ca;if(!t!=!r){var o=e.display.dragFunctions,i=t?fe:pe;i(e.display.scroller,"dragstart",o.start),i(e.display.scroller,"dragenter",o.enter),i(e.display.scroller,"dragover",o.over),i(e.display.scroller,"dragleave",o.leave),i(e.display.scroller,"drop",o.drop)}}function Ea(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Gt(e)),lr(e),fr(e),Fn(e),setTimeout((function(){return zr(e)}),100)}function La(e,t){var n=this;if(!(this instanceof La))return new La(e,t);this.options=t=t?I(t):{},I(Oa,t,!1);var r=t.value;"string"==typeof r?r=new ji(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new La.inputStyles[t.inputStyle](this),i=this.display=new go(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,xa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vr(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 H,keySeq:null,specialChars:null},t.autofocus&&!g&&i.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",eo(e,va)),fe(t.scroller,"dblclick",a&&s<11?eo(e,(function(t){if(!me(e,t)){var n=cr(e,t);if(n&&!ba(e,t)&&!Cn(e.display,t)){be(t);var r=e.findWordAt(n);Xo(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return wa(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||wa(e,n)}));var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),r=t.activeTouch,r.end=+new Date)}function i(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(o){if(!me(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!ba(e,o)){t.input.ensurePolled(),clearTimeout(n);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Cn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||i(r,r.prev)?new So(s,s):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(s):new So(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}o()})),fe(t.scroller,"touchcancel",o),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(_r(e,t.scroller.scrollTop),Ir(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return Co(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return Co(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||Ce(t)},over:function(t){me(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,r)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Di<100))Ce(t);else if(!me(e,t)&&!Cn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("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)}}(e,t)},drop:eo(e,Pi),leave:function(t){me(e,t)||Ai(e)}};var l=t.input.getField();fe(l,"keyup",(function(t){return fa.call(e,t)})),fe(l,"keydown",eo(e,ua)),fe(l,"keypress",eo(e,da)),fe(l,"focus",(function(t){return Sr(e,t)})),fe(l,"blur",(function(t){return kr(e,t)}))}(this),Ii(),Kr(this),this.curOp.forceUpdate=!0,Ro(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):kr(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](this,t[c],Ca);po(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Ma.length;++u)Ma[u](this);qr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}La.defaults=Oa,La.optionHandlers=Sa;var Ma=[];function Ta(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=pt(e,t).state:n="prev");var a=e.options.tabSize,s=Ke(i,t),l=W(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=i.mode.indent(o,s.text.slice(u.length),s.text),c==z||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>i.first?W(Ke(i,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+="\t";if(d<c&&(f+=q(c-d)),f!=u)return mi(i,f,et(t,0),et(t,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var m=i.sel.ranges[h];if(m.head.line==t&&m.head.ch<u.length){var v=et(t,u.length);Zo(i,h,new So(v,v));break}}}La.defineInitHook=function(e){return Ma.push(e)};var Na=null;function ja(e){Na=e}function Da(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var a=+new Date-200,s="paste"==o||e.state.pasteIncoming>a,l=je(t),c=null;if(s&&r.ranges.length>1)if(Na&&Na.text.join("\n")==t){if(r.ranges.length%Na.text.length==0){c=[];for(var u=0;u<Na.text.length;u++)c.push(i.splitLines(Na.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(l,(function(e){return[e]})));for(var f=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var p=r.ranges[d],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=et(h.line,h.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min(Ke(i,m.line).text.length,m.ch+$(l).length)):s&&Na&&Na.lineWise&&Na.text.join("\n")==l.join("\n")&&(h=m=et(h.line,0)));var v={from:h,to:m,text:c?c[d%c.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ui(e.doc,v),ln(e,"inputRead",e,v)}t&&!s&&Aa(e,t),jr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Pa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jr(t,(function(){return Da(t,n,0,null,"paste")})),!0}function Aa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=Ta(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ke(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Ta(e,o.head.line,"smart"));a&&ln(e,"electricInput",e,o.head.line)}}}function _a(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var o=e.doc.sel.ranges[r].head.line,i={anchor:et(o,0),head:et(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function Ra(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ia(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ra(e),t}function Wa(e,t,n,r,o){var i=t,a=n,s=Ke(e,t.line),l=o&&"rtl"==e.direction?-n:n;function c(i){var a,c;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var f=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(f?2:1))),-n)}}else a=o?function(e,t,n,r){var o=ce(t,e.doc.direction);if(!o)return Ji(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 i=se(o,n.ch,n.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ji(t,n,r);var s,l=function(e,n){return Qi(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Dn(e,t),Qn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==r<0,d=l(n,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=f?"before":"after";return new et(n.line,d,p)}}var h=function(e,t,r){for(var i=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return i(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return i(c,s)}},m=h(i+r,r,u);if(m)return m;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==t.text.length||(m=h(r>0?0:o.length-1,r,c(v)),!m)?null:m}(e.cm,s,t,n):Ji(s,t,n);if(null==a){if(i||(c=t.line+l,c<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ke(e,c)))))return!1;t=ea(o,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var h=s.text.charAt(t.ch)||"\n",m=ee(h,d)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var v=ai(e,t,i,a,!0);return nt(i,v)&&(v.hitSide=!0),v}function Ha(e,t,n,r){var o,i,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*rr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;i=Yn(e,s,o),i.outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var Fa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function za(e,t){var n=jn(e,t.line);if(!n||n.hidden)return null;var r=Ke(e.doc,t.line),o=Tn(n,r,t.line),i=ce(r,e.doc.direction),a="left";if(i){var s=se(i,t.ch);a=s%2?"right":"left"}var l=Rn(o.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ba(e,t){return t&&(e.bad=!0),e}function Ua(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Ba(e.clipPos(et(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 o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==r)return Va(i,t,n)}}function Va(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!j(r,t))return Ba(et(Ye(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?$(e.rest):e.line;return Ba(et(Ye(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==t||s==n){var u=Ye(o<0?e.line:e.rest[o]),f=i[a]+r;return(r<0||s!=t)&&(f=i[a+(r?1:0)]),et(u,f)}}}var f=u(a,s,n);if(f)return Ba(f,o);for(var d=s.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(f=u(d,d.firstChild,0),f)return Ba(et(f.line,f.ch-p),o);p+=d.textContent.length}for(var h=s.previousSibling,m=n;h;h=h.previousSibling){if(f=u(h,h.firstChild,-1),f)return Ba(et(f.line,f.ch+m),o);m+=h.textContent.length}}Fa.prototype.init=function(e){var t=this,n=this,r=n.cm,o=n.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(i(e)&&!me(r,e)){if(r.somethingSelected())ja({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);ja({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,B),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Na.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ia(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Na.text.join("\n");var c=D();_(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Ra(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),fe(o,"paste",(function(e){!i(e)||me(r,e)||Pa(e,r)||s<=11&&setTimeout(eo(r,(function(){return t.updateFromDOM()})),20)})),fe(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(o,"touchstart",(function(){return n.forceCompositionEnd()})),fe(o,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(o,"copy",a),fe(o,"cut",a)},Fa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Fa.prototype.prepareSelection=function(){var e=gr(this.cm,!1);return e.focus=D()==this.div,e},Fa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),o=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ua(t,e.anchorNode,e.anchorOffset),s=Ua(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(it(a,s),o)||0!=tt(ot(a,s),i)){var l=t.display.view,c=o.line>=t.display.viewFrom&&za(t,o)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&za(t,i);if(!u){var f=l[l.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,h=e.rangeCount&&e.getRangeAt(0);try{p=k(c.node,c.offset,u.offset,u.node)}catch(Ne){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Fa.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)},Fa.prototype.showMultipleSelections=function(e){M(this.cm.display.cursorDiv,e.cursors),M(this.cm.display.selectionDiv,e.selection)},Fa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return j(this.div,t)},Fa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&D()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fa.prototype.blur=function(){this.div.blur()},Fa.prototype.getField=function(){return this.div},Fa.prototype.supportsTouch=function(){return!0},Fa.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Jr(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},Fa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ua(t,e.anchorNode,e.anchorOffset),r=Ua(t,e.focusNode,e.focusOffset);n&&r&&Jr(t,(function(){ei(t.doc,Eo(n,r),B),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Fa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,Ke(r.doc,a.line-1).length)),s.ch==Ke(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=et(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=ur(r,a.line))?(t=Ye(o.view[0].line),n=o.view[0].node):(t=Ye(o.view[e].line),n=o.view[e-1].node.nextSibling);var l,c,u=ur(r,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Ye(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(e){e&&(c(),i+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var i,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(et(r,0),et(o+1,0),(v=+d,function(e){return e.id==v}));return void(p.length&&(i=p[0].find(0))&&u(qe(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var m=0;m<t.childNodes.length;m++)f(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),h&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;f(t),t!=n;)t=t.nextSibling,l=!1;return i}(r,n,c,t,l)),d=qe(r.doc,et(t,0),et(l,Ke(r.doc,l).text.length));f.length>1&&d.length>1;)if($(f)==$(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var p=0,h=0,m=f[0],v=d[0],g=Math.min(m.length,v.length);p<g&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=$(f),b=$(d),w=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==f.length&&1==d.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;f[f.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var x=et(t,p),C=et(l,d.length?$(d).length-h:0);return f.length>1||f[0]||tt(x,C)?(mi(r.doc,f,x,C,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Fa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jr(this.cm,(function(){return fr(e.cm)}))},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||eo(this.cm,Da)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0;var Ga=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};Ga.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!me(r,e)){if(r.somethingSelected())ja({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);ja({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,B):(n.prevInput="",o.value=t.text.join("\n"),_(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(o.style.width="0px"),fe(o,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(o,"paste",(function(e){me(r,e)||Pa(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(o,"cut",i),fe(o,"copy",i),fe(e.scroller,"paste",(function(t){if(!Cn(e,t)&&!me(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),fe(e.lineSpace,"selectstart",(function(t){Cn(e,t)||be(t)})),fe(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ga.prototype.createField=function(e){this.wrapper=Ia(),this.textarea=this.wrapper.firstChild},Ga.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ga.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=gr(e);if(e.options.moveInputWithCursor){var o=qn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},Ga.prototype.showSelection=function(e){var t=this.cm,n=t.display;M(n.cursorDiv,e.cursors),M(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ga.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&_(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ga.prototype.getField=function(){return this.textarea},Ga.prototype.supportsTouch=function(){return!1},Ga.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||D()!=this.textarea))try{this.textarea.focus()}catch(Ne){}},Ga.prototype.blur=function(){this.textarea.blur()},Ga.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ga.prototype.receivedFocus=function(){this.slowPoll()},Ga.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ga.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Ga.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,o.length);l<c&&r.charCodeAt(l)==o.charCodeAt(l);)++l;return Jr(t,(function(){Da(t,o.slice(l),r.length-l,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ga.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ga.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ga.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cr(n,e),c=r.scroller.scrollTop;if(i&&!f){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(i)&&eo(n,ei)(n.doc,Eo(i),B);var d,p=o.style.cssText,h=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(d=window.scrollY),r.input.focus(),l&&window.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),O){Ce(e);var v=function(){pe(window,"mouseup",v),setTimeout(y,20)};fe(window,"mouseup",v)}else setTimeout(y,50)}function g(){if(null!=o.selectionStart){var e=n.somethingSelected(),i=""+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,o.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&g();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==t.prevInput?eo(n,li)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Ga.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ga.prototype.setUneditable=function(){},Ga.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=Ca&&o(e,t,n)}:o)}e.defineOption=n,e.Init=Ca,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,jo(e)}),!0),n("indentUnit",2,jo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Do(e),Fn(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(et(r,i))}r++}));for(var o=n.length-1;o>=0;o--)mi(e.doc,t,n[o],et(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ca&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xa(e),vo(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yi(t),o=n!=Ca&&Yi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ea,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=ho(t,e.options.lineNumbers),vo(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return zr(e)}),!0),n("scrollbarStyle","native",(function(e){Vr(e),zr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=ho(e.options.gutters,t),vo(e)}),!0),n("firstLineNumber",1,vo,!0),n("lineNumberFormatter",(function(e){return e}),vo,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(kr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,ka),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Do,!0),n("addModeClass",!1,Do,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Do,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(La),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&eo(this,t[e])(this,n,o),he(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:to((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,o=n(t);r<e.length&&n(e[r])<=o;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,fr(this)})),removeOverlay:to((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void fr(this)}})),indentLine:to((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ta(this,e,t,n)})),indentSelection:to((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var o=t[r];if(o.empty())o.head.line>n&&(Ta(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&jr(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Ta(this,l,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[r].from().ch>0&&Zo(this.doc,r,new So(i,c[r].to()),B)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=dt(this,Ke(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]<i)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var o=n[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&r.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][a]];s&&r.push(s)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==F(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=at(n,null==e?n.first+n.size-1:e),pt(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),qn(this,n,t||"page")},charCoords:function(e,t){return Kn(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Gn(this,e,t||"page"),Yn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Gn(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=Ke(this.doc,e)}else r=e;return Vn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ut(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i=this.display;e=qn(this,st(this.doc,e));var a,s,l,c=e.bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),i.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var f=Math.max(i.wrapper.clientHeight,this.doc.height),d=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=i.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(i.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(a=this,s={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},l=Tr(a,s),null!=l.scrollTop&&_r(a,l.scrollTop),null!=l.scrollLeft&&Ir(a,l.scrollLeft))},triggerOnKeyDown:to(ua),triggerOnKeyPress:to(da),triggerOnKeyUp:fa,triggerOnMouseDown:to(va),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:to((function(e){Aa(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=st(this.doc,e),a=0;a<t&&(i=Wa(this.doc,i,o,n,r),!i.hitSide);++a);return i},moveH:to((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Wa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:to((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Zi(this,(function(n){var o=Wa(r,n.head,e,t,!1);return e<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(e,t,n,r){var o=1,i=r;t<0&&(o=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var l=qn(this,a,"div");if(null==i?i=l.left:l.left=i,a=Ha(this,l,o,n),a.hitSide)break}return a},moveV:to((function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(i)return e<0?a.from():a.to();var s=qn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=Ha(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Nr(n,Kn(n,l,"div").top-s.top),l}),V),o.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(e){var t=this.doc,n=Ke(t,e.line).text,r=e.ch,o=e.ch;if(n){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&o!=n.length||!r?++o:--r;for(var a=n.charAt(r),s=ee(a,i)?function(e){return ee(e,i)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&s(n.charAt(r-1));)--r;for(;o<n.length&&s(n.charAt(o));)++o}return new So(et(e.line,r),et(e.line,o))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:to((function(e,t){Dr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-En(this)-this.display.barHeight,width:e.scrollWidth-En(this)-this.display.barWidth,clientHeight:Mn(this),clientWidth:Ln(this)}},scrollIntoView:to((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Pr(e),e.curOp.scrollToPos=t}(this,e):Ar(this,e.from,e.to,e.margin)})),setSize:to((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Hn(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){dr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Jr(this,e)},startOperation:function(){return Kr(this)},endOperation:function(){return qr(this)},refresh:to((function(){var e=this.display.cachedTextHeight;fr(this),this.curOp.forceUpdate=!0,Fn(this),Dr(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&lr(this),he(this,"refresh",this)})),swapDoc:to((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ro(this,e),Fn(this),this.display.input.reset(),Dr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},ye(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(La);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var qa in ji.prototype)ji.prototype.hasOwnProperty(qa)&&F(Ka,qa)<0&&(La.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(ji.prototype[qa]));return ye(ji),La.inputStyles={textarea:Ga,contenteditable:Fa},La.defineMode=function(e){La.defaults.mode||"null"==e||(La.defaults.mode=e),Ie.apply(this,arguments)},La.defineMIME=function(e,t){Re[e]=t},La.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),La.defineMIME("text/plain","null"),La.defineExtension=function(e,t){La.prototype[e]=t},La.defineDocExtension=function(e,t){ji.prototype[e]=t},La.fromTextArea=function(e,t){if(t=t?I(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var o;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(Ne){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=La((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=pe,e.on=fe,e.wheelEventPixels=xo,e.Doc=ji,e.splitLines=je,e.countColumn=W,e.findColumn=G,e.isWordChar=J,e.Pass=z,e.signal=he,e.Line=Kt,e.changeEnd=Lo,e.scrollbarModel=Ur,e.Pos=et,e.cmpPos=tt,e.modes=_e,e.mimeModes=Re,e.resolveMode=We,e.getMode=He,e.modeExtensions=Fe,e.extendMode=ze,e.copyState=Be,e.startState=Ve,e.innerMode=Ue,e.commands=ta,e.keyMap=Ui,e.keyName=Xi,e.isModifierKey=qi,e.lookupKey=Ki,e.normalizeKeyMap=Gi,e.StringStream=Ge,e.SharedTextMarker=Li,e.TextMarker=ki,e.LineWidget=Ci,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=Ce,e.addClass=P,e.contains=j,e.rmClass=E,e.keyNames=Hi}(La),La.version="5.65.0",La}()},function(e,t,n){"use strict";function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(16),o=n.n(r);function i(e,t){if(t&&("object"===o()(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;var r=n(0),o=r.createContext?(0,r.createContext)({inOsSandBox:!1}):null;t.Context=o},function(e,t,n){"use strict";var r=n(46),o=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.withCompatibleSyncHistory=t.Wrapper=t.withSyncHistory=t.isOsContext=void 0;var i=o(n(22)),a=o(n(23)),s=o(n(24)),l=o(n(25)),c=o(n(26)),u=r(n(0));function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}t.isOsContext=function(){return window.__IS_CONSOLE_OS_CONTEXT__};var d=function(e,t){e&&t&&t!==location.href&&e.push(t)};t.withSyncHistory=function(e,t){var n=function(n){var r=n.path;return(0,u.useEffect)((function(){d(t,r)}),[r]),u.default.createElement(e,n)};return n.displayName="withSyncHistory(".concat(e.displayName,")"),n};var p=function(e){(0,s.default)(n,e);var t=f(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,a.default)(n,[{key:"componentDidMount",value:function(){var e=this.props.history;d(e,this.props.path)}},{key:"componentDidUpdate",value:function(e){var t=this.props.history;this.props.path!=e.path&&d(t,this.props.path)}},{key:"render",value:function(){var e=this.props.Comp;return u.default.createElement(e,this.props)}}]),n}(u.default.Component);t.Wrapper=p,p.displayName="withSyncHistory";t.withCompatibleSyncHistory=function(e,t){return function(n){return u.default.createElement(p,{Comp:e,history:t,props:n})}}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var o,i,a,s;if(c(n),i=e._events,void 0===i?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),o=u(e),o>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=d.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):v(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var c=l.length,u=v(l,c);for(n=0;n<c;++n)i(u[n],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,a;if(c(t),r=this._events,void 0===r)return this;if(n=r[e],void 0===n)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)o=i[r],"removeListener"!==o&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],"function"==typeof t)this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";(function(e){function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i,a=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.UnControlled=t.Controlled=void 0;var s,l=n(0),c="undefined"==typeof navigator||!0===e.PREVENT_CODEMIRROR_RENDER;c||(s=n(27));var u=function(){function e(){}return e.equals=function(e,t){var n=this,r=Object.keys,i=o(e),a=o(t);return e&&t&&"object"===i&&i===a?r(e).length===r(t).length&&r(e).every((function(r){return n.equals(e[r],t[r])})):e===t},e}(),f=function(){function e(e,t){this.editor=e,this.props=t}return e.prototype.delegateCursor=function(e,t,n){var r=this.editor.getDoc();n&&this.editor.focus(),t?r.setCursor(e):r.setCursor(e,null,{scroll:!1})},e.prototype.delegateScroll=function(e){this.editor.scrollTo(e.x,e.y)},e.prototype.delegateSelection=function(e,t){var n=this.editor.getDoc();n.setSelections(e),t&&this.editor.focus()},e.prototype.apply=function(e){e&&e.selection&&e.selection.ranges&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),e&&e.cursor&&this.delegateCursor(e.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1),e&&e.scroll&&this.delegateScroll(e.scroll)},e.prototype.applyNext=function(e,t,n){e&&e.selection&&e.selection.ranges&&t&&t.selection&&t.selection.ranges&&!u.equals(e.selection.ranges,t.selection.ranges)&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),e&&e.cursor&&t&&t.cursor&&!u.equals(e.cursor,t.cursor)&&this.delegateCursor(n.cursor||t.cursor,t.autoScroll||!1,t.autoCursor||!1),e&&e.scroll&&t&&t.scroll&&!u.equals(e.scroll,t.scroll)&&this.delegateScroll(t.scroll)},e.prototype.applyUserDefined=function(e,t){t&&t.cursor&&this.delegateCursor(t.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1)},e.prototype.wire=function(e){var t=this;Object.keys(e||{}).filter((function(e){return/^on/.test(e)})).forEach((function(e){switch(e){case"onBlur":t.editor.on("blur",(function(e,n){t.props.onBlur(t.editor,n)}));break;case"onContextMenu":t.editor.on("contextmenu",(function(e,n){t.props.onContextMenu(t.editor,n)}));break;case"onCopy":t.editor.on("copy",(function(e,n){t.props.onCopy(t.editor,n)}));break;case"onCursor":t.editor.on("cursorActivity",(function(e){t.props.onCursor(t.editor,t.editor.getDoc().getCursor())}));break;case"onCursorActivity":t.editor.on("cursorActivity",(function(e){t.props.onCursorActivity(t.editor)}));break;case"onCut":t.editor.on("cut",(function(e,n){t.props.onCut(t.editor,n)}));break;case"onDblClick":t.editor.on("dblclick",(function(e,n){t.props.onDblClick(t.editor,n)}));break;case"onDragEnter":t.editor.on("dragenter",(function(e,n){t.props.onDragEnter(t.editor,n)}));break;case"onDragLeave":t.editor.on("dragleave",(function(e,n){t.props.onDragLeave(t.editor,n)}));break;case"onDragOver":t.editor.on("dragover",(function(e,n){t.props.onDragOver(t.editor,n)}));break;case"onDragStart":t.editor.on("dragstart",(function(e,n){t.props.onDragStart(t.editor,n)}));break;case"onDrop":t.editor.on("drop",(function(e,n){t.props.onDrop(t.editor,n)}));break;case"onFocus":t.editor.on("focus",(function(e,n){t.props.onFocus(t.editor,n)}));break;case"onGutterClick":t.editor.on("gutterClick",(function(e,n,r,o){t.props.onGutterClick(t.editor,n,r,o)}));break;case"onInputRead":t.editor.on("inputRead",(function(e,n){t.props.onInputRead(t.editor,n)}));break;case"onKeyDown":t.editor.on("keydown",(function(e,n){t.props.onKeyDown(t.editor,n)}));break;case"onKeyHandled":t.editor.on("keyHandled",(function(e,n,r){t.props.onKeyHandled(t.editor,n,r)}));break;case"onKeyPress":t.editor.on("keypress",(function(e,n){t.props.onKeyPress(t.editor,n)}));break;case"onKeyUp":t.editor.on("keyup",(function(e,n){t.props.onKeyUp(t.editor,n)}));break;case"onMouseDown":t.editor.on("mousedown",(function(e,n){t.props.onMouseDown(t.editor,n)}));break;case"onPaste":t.editor.on("paste",(function(e,n){t.props.onPaste(t.editor,n)}));break;case"onRenderLine":t.editor.on("renderLine",(function(e,n,r){t.props.onRenderLine(t.editor,n,r)}));break;case"onScroll":t.editor.on("scroll",(function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())}));break;case"onSelection":t.editor.on("beforeSelectionChange",(function(e,n){t.props.onSelection(t.editor,n)}));break;case"onTouchStart":t.editor.on("touchstart",(function(e,n){t.props.onTouchStart(t.editor,n)}));break;case"onUpdate":t.editor.on("update",(function(e){t.props.onUpdate(t.editor)}));break;case"onViewportChange":t.editor.on("viewportChange",(function(e,n,r){t.props.onViewportChange(t.editor,n,r)}))}}))},e}(),d=function(e){function t(t){var n=e.call(this,t)||this;return c||(n.applied=!1,n.appliedNext=!1,n.appliedUserDefined=!1,n.deferred=null,n.emulating=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1),n}return a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},o=r({},s.defaults,this.editor.options,n),i=Object.keys(o).some((function(e){return t.editor.getOption(e)!==o[e]}));i&&Object.keys(o).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==o[e]&&(t.editor.setOption(e,o[e]),t.mirror.setOption(e,o[e]))})),this.hydrated||(this.deferred?this.resolveChange(e.value):this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.getDoc(),n=t.lastLine(),r=t.getLine(t.lastLine()).length;t.replaceRange(e||"",{line:0,ch:0},{line:n,ch:r}),this.mirror.setValue(e),t.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(e){this.emulating=!0;var t=this.editor.getDoc();if("undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),e&&e!==t.getValue()){var n=t.getCursor();t.setValue(e),t.setCursor(n)}this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){var t=this.editor.getDoc();return"undo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentDidMount=function(){var e=this;c||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.mirror=s((function(){}),this.props.options),this.editor.on("electricInput",(function(){e.mirror.setHistory(e.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(function(){e.mirror.setCursor(e.editor.getDoc().getCursor())})),this.editor.on("beforeChange",(function(t,n){if(!e.emulating){n.cancel(),e.deferred=n;var r=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,r)}})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,n,e.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(!c){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(e,this.props,t),this.appliedNext=!0),this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0}},t.prototype.componentWillUnmount=function(){c||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){return!c},t.prototype.render=function(){var e=this;if(c)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.Controlled=d;var p=function(e){function t(t){var n=e.call(this,t)||this;return c||(n.applied=!1,n.appliedUserDefined=!1,n.continueChange=!1,n.detached=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1,n.onBeforeChangeCb=function(){n.continueChange=!0}),n}return a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},o=r({},s.defaults,this.editor.options,n),i=Object.keys(o).some((function(e){return t.editor.getOption(e)!==o[e]}));if(i&&Object.keys(o).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==o[e]&&t.editor.setOption(e,o[e])})),!this.hydrated){var a=this.editor.getDoc(),l=a.lastLine(),c=a.getLine(a.lastLine()).length;a.replaceRange(e.value||"",{line:0,ch:0},{line:l,ch:c})}this.hydrated=!0},t.prototype.componentDidMount=function(){var e=this;c||(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.editor.on("beforeChange",(function(t,n){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,n,e.editor.getValue(),e.onBeforeChangeCb)})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&(e.props.onBeforeChange?e.continueChange&&e.props.onChange(e.editor,n,e.editor.getValue()):e.props.onChange(e.editor,n,e.editor.getValue()))})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(this.detached&&!1===this.props.detach&&(this.detached=!1,e.editorDidAttach&&e.editorDidAttach(this.editor)),this.detached||!0!==this.props.detach||(this.detached=!0,e.editorDidDetach&&e.editorDidDetach(this.editor)),!c&&!this.detached){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),e.autoCursor||void 0===e.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(e),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0)}},t.prototype.componentWillUnmount=function(){c||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){var n=!0;return c&&(n=!1),this.detached&&e.detach&&(n=!1),n},t.prototype.render=function(){var e=this;if(c)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.UnControlled=p}).call(this,n(38))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),s=d(a),l=n(51),c=d(l),u=n(7),f=d(u);function d(e){return e&&e.__esModule?e:{default:e}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h={animating:"rah-animating",animatingUp:"rah-animating--up",animatingDown:"rah-animating--down",animatingToHeightZero:"rah-animating--to-height-zero",animatingToHeightAuto:"rah-animating--to-height-auto",animatingToHeightSpecific:"rah-animating--to-height-specific",static:"rah-static",staticHeightZero:"rah-static--height-zero",staticHeightAuto:"rah-static--height-auto",staticHeightSpecific:"rah-static--height-specific"},m=["animateOpacity","animationStateClasses","applyInlineTransitions","children","contentClassName","delay","duration","easing","height","onAnimationEnd","onAnimationStart"];function v(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!n.length)return e;for(var o={},i=Object.keys(e),a=0;a<i.length;a++){var s=i[a];-1===n.indexOf(s)&&(o[s]=e[s])}return o}function g(e){e.forEach((function(e){return cancelAnimationFrame(e)}))}function y(e){return!isNaN(parseFloat(e))&&isFinite(e)}function b(e){return"string"==typeof e&&e.search("%")===e.length-1&&y(e.substr(0,e.length-1))}function w(e,t){e&&"function"==typeof e&&e(t)}var x=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.animationFrameIDs=[];var r="auto",i="visible";y(e.height)?(r=e.height<0||"0"===e.height?0:e.height,i="hidden"):b(e.height)&&(r="0%"===e.height?0:e.height,i="hidden"),n.animationStateClasses=o({},h,e.animationStateClasses);var a=n.getStaticStateClasses(r);return n.state={animationStateClasses:a,height:r,overflow:i,shouldUseTransitions:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.state.height;this.contentElement&&this.contentElement.style&&this.hideContent(e)}},{key:"componentDidUpdate",value:function(e,t){var n,r,o=this,i=this.props,a=i.delay,s=i.duration,l=i.height,c=i.onAnimationEnd,u=i.onAnimationStart;if(this.contentElement&&l!==e.height){var d;this.showContent(t.height),this.contentElement.style.overflow="hidden";var h=this.contentElement.offsetHeight;this.contentElement.style.overflow="";var m=s+a,v=null,x={height:null,overflow:"hidden"},C="auto"===t.height;y(l)?(v=l<0||"0"===l?0:l,x.height=v):b(l)?(v="0%"===l?0:l,x.height=v):(v=h,x.height="auto",x.overflow=null),C&&(x.height=v,v=h);var O=(0,f.default)((d={},p(d,this.animationStateClasses.animating,!0),p(d,this.animationStateClasses.animatingUp,"auto"===e.height||l<e.height),p(d,this.animationStateClasses.animatingDown,"auto"===l||l>e.height),p(d,this.animationStateClasses.animatingToHeightZero,0===x.height),p(d,this.animationStateClasses.animatingToHeightAuto,"auto"===x.height),p(d,this.animationStateClasses.animatingToHeightSpecific,x.height>0),d)),S=this.getStaticStateClasses(x.height);this.setState({animationStateClasses:O,height:v,overflow:"hidden",shouldUseTransitions:!C}),clearTimeout(this.timeoutID),clearTimeout(this.animationClassesTimeoutID),C?(x.shouldUseTransitions=!0,g(this.animationFrameIDs),this.animationFrameIDs=(n=function(){o.setState(x),w(u,{newHeight:x.height})},r=[],r[0]=requestAnimationFrame((function(){r[1]=requestAnimationFrame((function(){n()}))})),r),this.animationClassesTimeoutID=setTimeout((function(){o.setState({animationStateClasses:S,shouldUseTransitions:!1}),o.hideContent(x.height),w(c,{newHeight:x.height})}),m)):(w(u,{newHeight:v}),this.timeoutID=setTimeout((function(){x.animationStateClasses=S,x.shouldUseTransitions=!1,o.setState(x),"auto"!==l&&o.hideContent(v),w(c,{newHeight:v})}),m))}}},{key:"componentWillUnmount",value:function(){g(this.animationFrameIDs),clearTimeout(this.timeoutID),clearTimeout(this.animationClassesTimeoutID),this.timeoutID=null,this.animationClassesTimeoutID=null,this.animationStateClasses=null}},{key:"showContent",value:function(e){0===e&&(this.contentElement.style.display="")}},{key:"hideContent",value:function(e){0===e&&(this.contentElement.style.display="none")}},{key:"getStaticStateClasses",value:function(e){var t;return(0,f.default)((t={},p(t,this.animationStateClasses.static,!0),p(t,this.animationStateClasses.staticHeightZero,0===e),p(t,this.animationStateClasses.staticHeightSpecific,e>0),p(t,this.animationStateClasses.staticHeightAuto,"auto"===e),t))}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.animateOpacity,i=n.applyInlineTransitions,a=n.children,l=n.className,c=n.contentClassName,u=n.delay,d=n.duration,h=n.easing,g=n.id,y=n.style,b=this.state,w=b.height,x=b.overflow,C=b.animationStateClasses,O=b.shouldUseTransitions,S=o({},y,{height:w,overflow:x||y.overflow});O&&i&&(S.transition="height "+d+"ms "+h+" "+u+"ms",y.transition&&(S.transition=y.transition+", "+S.transition),S.WebkitTransition=S.transition);var k={};r&&(k.transition="opacity "+d+"ms "+h+" "+u+"ms",k.WebkitTransition=k.transition,0===w&&(k.opacity=0));var E=(0,f.default)((e={},p(e,C,!0),p(e,l,l),e)),L=void 0!==this.props["aria-hidden"],M=L?this.props["aria-hidden"]:0===w;return s.default.createElement("div",o({},v.apply(void 0,[this.props].concat(m)),{"aria-hidden":M,className:E,id:g,style:S}),s.default.createElement("div",{className:c,style:k,ref:function(e){return t.contentElement=e}},a))}}]),t}(s.default.Component);x.propTypes={"aria-hidden":c.default.bool,animateOpacity:c.default.bool,animationStateClasses:c.default.object,applyInlineTransitions:c.default.bool,children:c.default.any.isRequired,className:c.default.string,contentClassName:c.default.string,delay:c.default.number,duration:c.default.number,easing:c.default.string,height:function(e,t,n){var o=e[t];return"number"==typeof o&&o>=0||b(o)||"auto"===o?null:new TypeError('value "'+o+'" of type "'+(void 0===o?"undefined":r(o))+'" is invalid type for '+t+" in "+n+'. It needs to be a positive number, string "auto" or percentage string (e.g. "15%").')},id:c.default.string,onAnimationEnd:c.default.func,onAnimationStart:c.default.func,style:c.default.object},x.defaultProps={animateOpacity:!1,animationStateClasses:h,applyInlineTransitions:!0,duration:250,delay:0,easing:"ease",style:{}},t.default=x},function(e,t){e.exports=r},function(e,t,n){!function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(t);function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var i={error:null},a=function(e){var t,n;function a(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r))||this,t.state=i,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}t=a,n=e,t.prototype=Object.create(n.prototype),t.prototype.constructor=t,o(t,n),a.getDerivedStateFromError=function(e){return{error:e}};var s=a.prototype;return s.reset=function(){this.setState(i)},s.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},s.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(o=e.resetKeys,i=s,void 0===o&&(o=[]),void 0===i&&(i=[]),o.length!==i.length||o.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},s.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,i=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(i))return i;if("function"==typeof n)return n(a);if(o)return r.createElement(o,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},a}(r.Component);e.ErrorBoundary=a,e.useErrorHandler=function(e){var t=r.useState(null),n=t[0],o=t[1];if(null!=e)throw e;if(null!=n)throw n;return o},e.withErrorBoundary=function(e,t){var n=function(n){return r.createElement(a,t,r.createElement(e,n))},o=e.displayName||e.name||"Unknown";return n.displayName="withErrorBoundary("+o+")",n},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(0))},function(e,t,n){"use strict";e.exports=n(55)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t);var r=n(32);n.d(t,"EventEmitter",(function(){return r.EventEmitter}))},function(e,t,n){e.exports=n(61)},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.registerExposedModule=function(e,t){if(w[e])return void console.error("module has been registered in expose module map");w[e]=t},t.mount=function(e,t,n){var r=function(t){(0,a.default)(f,t);var n,r,c=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,l.default)(n);if(r){var o=(0,l.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,s.default)(this,e)});function f(){return(0,o.default)(this,f),c.apply(this,arguments)}return(0,i.default)(f,[{key:"componentDidCatch",value:function(){}},{key:"componentDidMount",value:function(){var e=b(this.props);if(e){var t=e.emitter;!function(e){e&&e.on("main:postMessage",y)}(t)}}},{key:"componentWillUnmount",value:function(){var e=b(this.props),t=e.emitter;!function(e){e&&e.off("main:postMessage",y)}(t)}},{key:"render",value:function(){var t={inOsSandBox:(0,p.isOsContext)()};return u.default.createElement(m.default,{logger:this.props.logger,appDidCatch:this.props.appDidCatch},h.Context?u.default.createElement(h.Context.Provider,{value:t},u.default.createElement(e,Object.assign(b(this.props)||{}))):u.default.createElement(e,Object.assign(b(this.props)||{})))}}]),f}(u.default.Component);if((0,p.isOsContext)()){var c=(0,d.default)({React:u.default,ReactDOM:f.default,rootComponent:r,domElementGetter:function(){return document.getElementsByTagName(n)[0]}});return{bootstrap:[c.bootstrap],mount:[c.mount],unmount:[c.unmount],update:[c.update],exposedModule:w}}f.default.render(u.default.createElement(r,null),t)};var o=r(n(22)),i=r(n(23)),a=r(n(24)),s=r(n(25)),l=r(n(26)),c=r(n(39)),u=r(n(0)),f=r(n(11)),d=r(n(45)),p=n(31),h=n(30),m=r(n(47));function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=function(e){window.postMessage(e.data,null)},b=function(e){var t=g(g({},e),e.appProps||{});return delete t.domElement,delete t.singleSpa,delete t.mountParcel,t||{}},w={}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){!function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.SingleSpaContext=null;var o={React:null,ReactDOM:null,rootComponent:null,loadRootComponent:null,suppressComponentDidCatchWarning:!1,domElements:{},errorBoundary:null,domElementGetter:null,parcelCanUpdate:!0};function i(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function a(e,t){return new Promise((function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-react was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,t);if("function"!=typeof o)throw new Error("single-spa-react: the domElementGetter for react application '".concat(t.appName||t.name,"' is not a function"));var i=u(e,t),a=function(e,t){var n=e(t);if(!n)throw new Error("single-spa-react: domElementGetter function for application '".concat(t.appName||t.name,"' did not return a valid dom element. Please pass a valid domElement or domElementGetter via opts or props"));return n}(o,t);c({elementToRender:i,domElement:a,whenFinished:function(){n(this)},opts:e}),e.domElements[t.name]=a}))}function s(e,t){return Promise.resolve().then((function(){e.ReactDOM.unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name]}))}function l(e,t){return new Promise((function(n,r){c({elementToRender:u(e,t),domElement:e.domElements[t.name],whenFinished:function(){n(this)},opts:e})}))}function c(e){var t=e.opts,n=e.elementToRender,r=e.domElement,o=e.whenFinished;return"createRoot"===t.renderType?t.ReactDOM.createRoot(r).render(n,o):"createBlockingRoot"===t.renderType?t.ReactDOM.createBlockingRoot(r).render(n,o):"hydrate"===t.renderType?t.ReactDOM.hydrate(n,r,o):t.ReactDOM.render(n,r,o)}function u(t,n){var r=t.React.createElement(t.rootComponent,n),o=e.SingleSpaContext?t.React.createElement(e.SingleSpaContext.Provider,{value:n},r):r;return t.errorBoundary&&(t.errorBoundaryClass=t.errorBoundaryClass||function(e){function t(n){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},t.displayName="SingleSpaReactErrorBoundary(".concat(n.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.render=function(){return this.state.caughtError?e.errorBoundary(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},t.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},t}(t),o=t.React.createElement(t.errorBoundaryClass,n,o)),o}e.default=function(c){if("object"!==t(c))throw new Error("single-spa-react requires a configuration object");var u=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?r(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},o,{},c);if(!u.React)throw new Error("single-spa-react must be passed opts.React");if(!u.ReactDOM)throw new Error("single-spa-react must be passed opts.ReactDOM");if(!u.rootComponent&&!u.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(u.errorBoundary&&"function"!=typeof u.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!e.SingleSpaContext&&u.React.createContext&&(e.SingleSpaContext=u.React.createContext());var f={bootstrap:i.bind(null,u),mount:a.bind(null,u),unmount:s.bind(null,u)};return u.parcelCanUpdate&&(f.update=l.bind(null,u)),f},Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){var r=n(16).default;function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=a?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,n&&n.set(e,i),i},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(22)),i=r(n(23)),a=r(n(24)),s=r(n(25)),l=r(n(26)),c=r(n(0));function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var f={lineHeight:"22px",color:"#d93026",fontSize:14},d=function(e){(0,a.default)(n,e);var t=u(n);function n(e){var r;return(0,o.default)(this,n),r=t.call(this,e),r.state={hasError:!1,error:null},r}return(0,i.default)(n,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e}),this.props.logger?this.props.logger.error(e,t):window.__bl&&window.__bl.error&&window.__bl.error(e,t),console.error(e),this.props.appDidCatch&&this.props.appDidCatch(e)}},{key:"render",value:function(){this.state.error;return this.state.hasError?c.default.createElement("div",{style:{padding:24}},c.default.createElement("div",{style:f},"Error")):this.props.children}}]),n}(c.default.Component),p=d;t.default=p},function(e,t,n){},function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,o,i=t.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,u=n.typescript,f=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),o=e("keyword d"),i=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,n){return r=e,o=n,t}function v(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,o=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=v,m("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||o);)o=!o&&"\\"==r;return o||(t.tokenize=v),m("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==r&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return m(r);if("="==r&&e.eat(">"))return m("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Qe(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==r)return t.tokenize=y,y(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==r&&e.eatWhile(f))return m("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?m("."):m("operator","operator",e.current());if(f.test(r)){e.eatWhile(f);var o=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(o)){var i=d[o];return m(i.type,i.style,o)}if("async"==o&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",o)}return m("variable","variable",o)}}function g(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=v;break}r="*"==n}return m("comment","comment")}function y(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=v;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var o=0,i=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!o){++a;break}if(0==--o){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(f.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;var c=e.string.charAt(a-1);if(c==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(i&&!o){++a;break}}i&&!o&&(t.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(e,t,n,r,o,i){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function C(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function O(e,t,n,r,o){var i=e.cc;for(S.state=e,S.stream=o,S.marked=null,S.cc=i,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=i.length?i.pop():l?z:H;if(a(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return S.marked?S.marked:"variable"==n&&C(e,r)?"variable-2":t}}}var S={state:null,column:null,marked:null,cc:null};function k(){for(var e=arguments.length-1;e>=0;e--)S.cc.push(arguments[e])}function E(){return k.apply(null,arguments),!0}function L(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function M(e){var t=S.state;if(S.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new N(r,n.vars,!0):null}return L(t,n.vars)?n:new N(n.prev,new j(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!L(e,t.localVars))return void(t.localVars=new j(e,t.localVars));n.globalVars&&!L(e,t.globalVars)&&(t.globalVars=new j(e,t.globalVars))}}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function N(e,t,n){this.prev=e,this.vars=t,this.block=n}function j(e,t){this.name=e,this.next=t}var D=new j("this",new j("arguments",null));function P(){S.state.context=new N(S.state.context,S.state.localVars,!1),S.state.localVars=D}function A(){S.state.context=new N(S.state.context,S.state.localVars,!0),S.state.localVars=null}function _(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function R(e,t){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new x(r,S.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function I(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function W(e){return function t(n){return n==e?E():";"==e||"}"==n||")"==n||"]"==n?k():E(t)}}function H(e,t){return"var"==e?E(R("vardef",t),Oe,W(";"),I):"keyword a"==e?E(R("form"),U,H,I):"keyword b"==e?E(R("form"),H,I):"keyword d"==e?S.stream.match(/^\s*$/,!1)?E():E(R("stat"),G,W(";"),I):"debugger"==e?E(W(";")):"{"==e?E(R("}"),A,se,I,_):";"==e?E():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==I&&S.state.cc.pop()(),E(R("form"),U,H,I,Te)):"function"==e?E(Pe):"for"==e?E(R("form"),A,Ne,H,_,I):"class"==e||u&&"interface"==t?(S.marked="keyword",E(R("form","class"==e?e:t),We,I)):"variable"==e?u&&"declare"==t?(S.marked="keyword",E(H)):u&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?E(Ye):"type"==t?E(_e,W("operator"),de,W(";")):E(R("form"),Se,W("{"),R("}"),se,I,I)):u&&"namespace"==t?(S.marked="keyword",E(R("form"),z,H,I)):u&&"abstract"==t?(S.marked="keyword",E(H)):E(R("stat"),ee):"switch"==e?E(R("form"),U,W("{"),R("}","switch"),A,se,I,I,_):"case"==e?E(z,W(":")):"default"==e?E(W(":")):"catch"==e?E(R("form"),P,F,H,I,_):"export"==e?E(R("stat"),Be,I):"import"==e?E(R("stat"),Ve,I):"async"==e?E(H):"@"==t?E(z,H):k(R("stat"),z,W(";"),I)}function F(e){if("("==e)return E(Re,W(")"))}function z(e,t){return V(e,t,!1)}function B(e,t){return V(e,t,!0)}function U(e){return"("!=e?k():E(R(")"),G,W(")"),I)}function V(e,t,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:Y;if("("==e)return E(P,R(")"),ie(Re,")"),I,W("=>"),r,_);if("variable"==e)return k(P,Se,W("=>"),r,_)}var o=n?q:K;return w.hasOwnProperty(e)?E(o):"function"==e?E(Pe,o):"class"==e||u&&"interface"==t?(S.marked="keyword",E(R("form"),Ie,I)):"keyword c"==e||"async"==e?E(n?B:z):"("==e?E(R(")"),G,W(")"),I,o):"operator"==e||"spread"==e?E(n?B:z):"["==e?E(R("]"),Xe,I,o):"{"==e?ae(ne,"}",null,o):"quasi"==e?k($,o):"new"==e?E(function(e){return function(t){return"."==t?E(e?J:Q):"variable"==t&&u?E(we,e?q:K):k(e?B:z)}}(n)):E()}function G(e){return e.match(/[;\}\)\],]/)?k():k(z)}function K(e,t){return","==e?E(G):q(e,t,!1)}function q(e,t,n){var r=0==n?K:q,o=0==n?z:B;return"=>"==e?E(P,n?Z:Y,_):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?E(r):u&&"<"==t&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(R(">"),ie(de,">"),I,r):"?"==t?E(z,W(":"),o):E(o):"quasi"==e?k($,r):";"!=e?"("==e?ae(B,")","call",r):"."==e?E(te,r):"["==e?E(R("]"),G,W("]"),I,r):u&&"as"==t?(S.marked="keyword",E(de,r)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),E(o)):void 0:void 0}function $(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?E($):E(G,X)}function X(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,E($)}function Y(e){return b(S.stream,S.state),k("{"==e?H:z)}function Z(e){return b(S.stream,S.state),k("{"==e?H:B)}function Q(e,t){if("target"==t)return S.marked="keyword",E(K)}function J(e,t){if("target"==t)return S.marked="keyword",E(q)}function ee(e){return":"==e?E(I,H):k(K,W(";"),I)}function te(e){if("variable"==e)return S.marked="property",E()}function ne(e,t){return"async"==e?(S.marked="property",E(ne)):"variable"==e||"keyword"==S.style?(S.marked="property","get"==t||"set"==t?E(re):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),E(oe))):"number"==e||"string"==e?(S.marked=s?"property":S.style+" property",E(oe)):"jsonld-keyword"==e?E(oe):u&&T(t)?(S.marked="keyword",E(ne)):"["==e?E(z,le,W("]"),oe):"spread"==e?E(B,oe):"*"==t?(S.marked="keyword",E(ne)):":"==e?k(oe):void 0;var n}function re(e){return"variable"!=e?k(oe):(S.marked="property",E(Pe))}function oe(e){return":"==e?E(B):"("==e?k(Pe):void 0}function ie(e,t,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var a=S.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E((function(n,r){return n==t||r==t?k():k(e)}),r)}return o==t||i==t?E():n&&n.indexOf(";")>-1?k(e):E(W(t))}return function(n,o){return n==t||o==t?E():k(e,r)}}function ae(e,t,n){for(var r=3;r<arguments.length;r++)S.cc.push(arguments[r]);return E(R(t,n),ie(e,t),I)}function se(e){return"}"==e?E():k(H,se)}function le(e,t){if(u){if(":"==e)return E(de);if("?"==t)return E(le)}}function ce(e,t){if(u&&(":"==e||"in"==t))return E(de)}function ue(e){if(u&&":"==e)return S.stream.match(/^\s*\w+\s+is\b/,!1)?E(z,fe,de):E(de)}function fe(e,t){if("is"==t)return S.marked="keyword",E()}function de(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(S.marked="keyword",E("typeof"==t?B:de)):"variable"==e||"void"==t?(S.marked="type",E(be)):"|"==t||"&"==t?E(de):"string"==e||"number"==e||"atom"==e?E(be):"["==e?E(R("]"),ie(de,"]",","),I,be):"{"==e?E(R("}"),he,I,be):"("==e?E(ie(ye,")"),pe,be):"<"==e?E(ie(de,">"),de):"quasi"==e?k(ve,be):void 0}function pe(e){if("=>"==e)return E(de)}function he(e){return e.match(/[\}\)\]]/)?E():","==e||";"==e?E(he):k(me,he)}function me(e,t){return"variable"==e||"keyword"==S.style?(S.marked="property",E(me)):"?"==t||"number"==e||"string"==e?E(me):":"==e?E(de):"["==e?E(W("variable"),ce,W("]"),me):"("==e?k(Ae,me):e.match(/[;\}\)\],]/)?void 0:E()}function ve(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?E(ve):E(de,ge)}function ge(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,E(ve)}function ye(e,t){return"variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?E(ye):":"==e?E(de):"spread"==e?E(ye):k(de)}function be(e,t){return"<"==t?E(R(">"),ie(de,">"),I,be):"|"==t||"."==e||"&"==t?E(de):"["==e?E(de,W("]"),be):"extends"==t||"implements"==t?(S.marked="keyword",E(de)):"?"==t?E(de,W(":"),de):void 0}function we(e,t){if("<"==t)return E(R(">"),ie(de,">"),I,be)}function xe(){return k(de,Ce)}function Ce(e,t){if("="==t)return E(de)}function Oe(e,t){return"enum"==t?(S.marked="keyword",E(Ye)):k(Se,le,Le,Me)}function Se(e,t){return u&&T(t)?(S.marked="keyword",E(Se)):"variable"==e?(M(t),E()):"spread"==e?E(Se):"["==e?ae(Ee,"]"):"{"==e?ae(ke,"}"):void 0}function ke(e,t){return"variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?E(Se):"}"==e?k():"["==e?E(z,W("]"),W(":"),ke):E(W(":"),Se,Le)):(M(t),E(Le))}function Ee(){return k(Se,Le)}function Le(e,t){if("="==t)return E(B)}function Me(e){if(","==e)return E(Oe)}function Te(e,t){if("keyword b"==e&&"else"==t)return E(R("form","else"),H,I)}function Ne(e,t){return"await"==t?E(Ne):"("==e?E(R(")"),je,I):void 0}function je(e){return"var"==e?E(Oe,De):"variable"==e?E(De):k(De)}function De(e,t){return")"==e?E():";"==e?E(De):"in"==t||"of"==t?(S.marked="keyword",E(z,De)):k(z,De)}function Pe(e,t){return"*"==t?(S.marked="keyword",E(Pe)):"variable"==e?(M(t),E(Pe)):"("==e?E(P,R(")"),ie(Re,")"),I,ue,H,_):u&&"<"==t?E(R(">"),ie(xe,">"),I,Pe):void 0}function Ae(e,t){return"*"==t?(S.marked="keyword",E(Ae)):"variable"==e?(M(t),E(Ae)):"("==e?E(P,R(")"),ie(Re,")"),I,ue,_):u&&"<"==t?E(R(">"),ie(xe,">"),I,Ae):void 0}function _e(e,t){return"keyword"==e||"variable"==e?(S.marked="type",E(_e)):"<"==t?E(R(">"),ie(xe,">"),I):void 0}function Re(e,t){return"@"==t&&E(z,Re),"spread"==e?E(Re):u&&T(t)?(S.marked="keyword",E(Re)):u&&"this"==e?E(le,Le):k(Se,le,Le)}function Ie(e,t){return"variable"==e?We(e,t):He(e,t)}function We(e,t){if("variable"==e)return M(t),E(He)}function He(e,t){return"<"==t?E(R(">"),ie(xe,">"),I,He):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(S.marked="keyword"),E(u?de:z,He)):"{"==e?E(R("}"),Fe,I):void 0}function Fe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&T(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",E(Fe)):"variable"==e||"keyword"==S.style?(S.marked="property",E(ze,Fe)):"number"==e||"string"==e?E(ze,Fe):"["==e?E(z,le,W("]"),ze,Fe):"*"==t?(S.marked="keyword",E(Fe)):u&&"("==e?k(Ae,Fe):";"==e||","==e?E(Fe):"}"==e?E():"@"==t?E(z,Fe):void 0}function ze(e,t){if("!"==t)return E(ze);if("?"==t)return E(ze);if(":"==e)return E(de,Le);if("="==t)return E(B);var n=S.state.lexical.prev,r=n&&"interface"==n.info;return k(r?Ae:Pe)}function Be(e,t){return"*"==t?(S.marked="keyword",E($e,W(";"))):"default"==t?(S.marked="keyword",E(z,W(";"))):"{"==e?E(ie(Ue,"}"),$e,W(";")):k(H)}function Ue(e,t){return"as"==t?(S.marked="keyword",E(W("variable"))):"variable"==e?k(B,Ue):void 0}function Ve(e){return"string"==e?E():"("==e?k(z):"."==e?k(K):k(Ge,Ke,$e)}function Ge(e,t){return"{"==e?ae(Ge,"}"):("variable"==e&&M(t),"*"==t&&(S.marked="keyword"),E(qe))}function Ke(e){if(","==e)return E(Ge,Ke)}function qe(e,t){if("as"==t)return S.marked="keyword",E(Ge)}function $e(e,t){if("from"==t)return S.marked="keyword",E(z)}function Xe(e){return"]"==e?E():k(ie(B,"]"))}function Ye(){return k(R("form"),Se,W("{"),R("}"),ie(Ze,"}"),I,I)}function Ze(){return k(Se,Le)}function Qe(e,t,n){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return _.lex=!0,I.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new x((e||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new N(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=o&&"--"!=o?r:"incdec",O(t,n,r,o,e))},indent:function(t,r){if(t.tokenize==g||t.tokenize==y)return e.Pass;if(t.tokenize!=v)return 0;var o,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==I)l=l.prev;else if(u!=Te&&u!=_)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==K||o==q)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,d=s==f;return"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==f&&"{"==s?l.indented:"form"==f?l.indented+i:"stat"==f?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||i:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:i):l.indented+(/^(?:case|default)\b/.test(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Qe,skipExpression:function(t){O(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(27))},function(e,t,n){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function o(e){return e&&e.bracketRegex||/[(){}[\]]/}function i(e,t,i){var s=e.getLineHandle(t.line),l=t.ch-1,c=i&&i.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=o(i),f=!c&&l>=0&&u.test(s.text.charAt(l))&&r[s.text.charAt(l)]||u.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!f)return null;var d=">"==f.charAt(1)?1:-1;if(i&&i.strict&&d>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),h=a(e,n(t.line,l+(d>0?1:0)),d,p,i);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:d>0}}function a(e,t,i,a,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],f=o(s),d=i>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),p=t.line;p!=d;p+=i){var h=e.getLine(p);if(h){var m=i>0?0:h.length-1,v=i>0?h.length:-1;if(!(h.length>l))for(p==t.line&&(m=t.ch-(i<0?1:0));m!=v;m+=i){var g=h.charAt(m);if(f.test(g)&&(void 0===a||(e.getTokenTypeAt(n(p,m+1))||"")==(a||""))){var y=r[g];if(y&&">"==y.charAt(1)==i>0)u.push(g);else{if(!u.length)return{pos:n(p,m),ch:g};u.pop()}}}}}return p-i!=(i>0?e.lastLine():e.firstLine())&&null}function s(e,r,o){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=o&&o.highlightNonMatching,l=[],c=e.listSelections(),u=0;u<c.length;u++){var f=c[u].empty()&&i(e,c[u].head,o);if(f&&(f.match||!1!==s)&&e.getLine(f.from.line).length<=a){var d=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(f.from,n(f.from.line,f.from.ch+1),{className:d})),f.to&&e.getLine(f.to.line).length<=a&&l.push(e.markText(f.to,n(f.to.line,f.to.ch+1),{className:d}))}}if(l.length){t&&e.state.focused&&e.focus();var p=function(){e.operation((function(){for(var e=0;e<l.length;e++)l[e].clear()}))};if(!r)return p;setTimeout(p,800)}}function l(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=s(e,!1,e.state.matchBrackets)}))}function c(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}e.defineOption("matchBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",l),t.off("focus",l),t.off("blur",c),c(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",l),t.on("focus",l),t.on("blur",c))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),i(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,n,r){return a(this,e,t,n,r)}))}(n(27))},function(e,t,n){e.exports=n(52)()},function(e,t,n){"use strict";var r=n(53);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(E){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(E){return{type:"throw",arg:E}}}e.wrap=l;var u={};function f(){}function d(){}function p(){}var h={};s(h,o,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==t&&n.call(v,o)&&(h=v);var g=p.prototype=f.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,s(g,"constructor",p),s(p,"constructor",d),d.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),s(g,a,"Generator"),s(g,o,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";
|
|
10
|
+
*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var a=i.apply(null,r);a&&e.push(a)}}else if("object"===o)if(r.toString===Object.prototype.toString)for(var s in r)n.call(r,s)&&r[s]&&e.push(s);else e.push(r.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):(r=[],o=function(){return i}.apply(t,r),void 0===o||(e.exports=o))}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&r(e,t)}n.d(t,"a",(function(){return o}))},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return r.Context}}),Object.defineProperty(t,"mount",{enumerable:!0,get:function(){return o.mount}}),Object.defineProperty(t,"registerExposedModule",{enumerable:!0,get:function(){return o.registerExposedModule}}),Object.defineProperty(t,"EventEmitter",{enumerable:!0,get:function(){return i.EventEmitter}}),Object.defineProperty(t,"withSyncHistory",{enumerable:!0,get:function(){return a.withSyncHistory}}),Object.defineProperty(t,"withCompatibleSyncHistory",{enumerable:!0,get:function(){return a.withCompatibleSyncHistory}}),Object.defineProperty(t,"isOsContext",{enumerable:!0,get:function(){return a.isOsContext}});var r=n(30),o=n(42),i=n(40),a=n(31)},function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13);function o(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return Ot}));var r=n(3),o=n(2),i=n(1),a=n(0),s=n.n(a),l=n(4),c=n.n(l),u={},f=n(5),d=(n(48),n(49),n(50),n(33)),p=n(34),h=n.n(p),m=n(28),v=n(19),g=n.n(v);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e){return x.apply(this,arguments)}function x(){return x=Object(m.a)(g.a.mark((function e(t){var n,r,o,a,s,l;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.code,r=t.imports,o=t.modifyCode,a=r.filter((function(e){return!e.startsWith(".")})).reduce((function(e,t){return e[t]="latest",e}),{}),s=C({mainCode:n,deps:a}),s=o(s),l=Object.fromEntries(Object.entries(s).map((function(e){var t=Object(i.a)(e,2),n=t[0],r=t[1];return[n,{content:r}]}))),e.abrupt("return",fetch("https://codesandbox.io/api/v1/sandboxes/define?json=1",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:l})}).then((function(e){return e.json()})).then((function(e){var t=e.sandbox_id;return{sandboxId:t,url:"https://codesandbox.io/embed/".concat(t,"?fontsize=14&codemirror=1&view=split&module=/src/main.tsx")}})));case 6:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function C(e){var t=e.mainCode,n=e.deps,r={name:"demo",main:"index.html",dependencies:b({react:"latest","react-dom":"latest"},n)};return{"tsconfig.json":JSON.stringify({compilerOptions:{strict:!0,module:"commonjs",jsx:"react",esModuleInterop:!0,sourceMap:!0,allowJs:!0,lib:["es6","dom"],rootDir:"src",moduleResolution:"node"}},null,2),"sandbox.config.json":JSON.stringify({infiniteLoopProtection:!0,hardReloadOnChange:!1,template:"parcel"},null,2),"package.json":JSON.stringify(r,null,2),"index.html":'\n<html>\n <head>\n <title>Demo</title>\n <meta charset="UTF-8" />\n </head>\n <body>\n <div id="app"></div>\n <script src="src/bootstrap.tsx"><\/script>\n </body>\n</html>\n '.trim(),"src/main.tsx":t,"src/bootstrap.tsx":"\nimport * as React from 'react'\nimport { render } from 'react-dom'\nimport App from './main'\n\nconst rootElement = document.getElementById('app')\nrender(<App />, rootElement)\n "}}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k={border:0,width:"100%",minHeight:520},E=function(e){var t=e.code,n=e.imports,r=e.meta,o=e.modifyCodeSandbox,l=Object(a.useState)(""),c=Object(i.a)(l,2),f=c[0],d=c[1];return Object(a.useEffect)((function(){d("")}),[t]),Object(a.useEffect)((function(){f||w({code:t,imports:n,modifyCode:function(e){var i=e;return u.modifyCodeSandbox&&(i=u.modifyCodeSandbox({code:t,meta:r,imports:n,files:e})),o&&(i=o({code:t,meta:r,imports:n,files:i})),i}}).then((function(e){var t=e.url;d(t)}))}),[f]),f?s.a.createElement("iframe",{sandbox:"allow-modals allow-forms allow-popups allow-scripts allow-same-origin",style:k,src:f}):s.a.createElement("div",{style:S(S({},k),{},{padding:24})},"Loading...")},L=n(36),M=n(35);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e){var t=e.code,r=e.deps,o=e.enable,l=Object(a.useState)(""),c=Object(i.a)(l,2),u=c[0],d=c[1],p=Object(a.useState)({}),h=Object(i.a)(p,2),m=h[0],v=h[1];Object(a.useEffect)((function(){o&&(d(""),v({}),Promise.all([Promise.all([n.e(0),n.e(7)]).then(n.t.bind(null,76,7)),Promise.all([n.e(0),n.e(3),n.e(8)]).then(n.t.bind(null,677,7)),Promise.all([n.e(0),n.e(5)]).then(n.t.bind(null,678,7)),Promise.all([n.e(0),n.e(4)]).then(n.t.bind(null,679,7))]).then((function(e){var n=Object(i.a)(e,4),r=n[0],o=n[1].default,a=n[2].default,s=n[3].default;r.transformAsync(t,{presets:[[o,{isTSX:!0,allExtensions:!0}]],plugins:[s,a]}).then((function(e){"string"==typeof(null==e?void 0:e.code)&&d(e.code)}))})))}),[t,o]),Object(a.useLayoutEffect)((function(){if(o){var e={};try{var t=new Function("define",u);t((function(t,n){var o=N(N({},M),r),i=t.map((function(t){if("exports"===t)return e;if(o&&o.hasOwnProperty(t))return o[t];throw new Error('can not find dependency "'.concat(t,'"'))}));n.apply(void 0,Object(f.a)(i))})),v(e)}catch(n){console.error("error when eval code:"),console.error(n)}}}),[u,r,o]);var g=m.default?s.a.createElement(D,{retryKey:m.default},s.a.createElement(m.default,null)):null;return{value:m,transformedCode:u,renderEvalCode:g}}var D=function(e){var t=e.children,n=e.retryKey;return s.a.createElement(L.ErrorBoundary,{FallbackComponent:P,resetKeys:[n]},t)};function P(e){var t=e.error;return s.a.createElement("div",{role:"alert"},s.a.createElement("p",null,"Error in demo:"),t&&s.a.createElement("pre",null,t.message))}var A=n(12),_=n(8),R=n(9),I=n(10),W=n(20);var H=n(29);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(W.a)(e);if(t){var o=Object(W.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(H.a)(this,n)}}var z=n(6),B=function(e){return+setTimeout(e,16)},U=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(B=function(e){return window.requestAnimationFrame(e)},U=function(e){return window.cancelAnimationFrame(e)});var V=0,G=new Map;function K(e){G.delete(e)}function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;V+=1;var n=V;function r(t){if(0===t)K(n),e();else{var o=B((function(){r(t-1)}));G.set(n,o)}}return r(t),n}q.cancel=function(e){var t=G.get(e);return K(t),U(t)};var $=n(11),X=n.n($);function Y(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var Z,Q=Object(a.forwardRef)((function(e,t){var n=e.didUpdate,r=e.getContainer,o=e.children,i=Object(a.useRef)();Object(a.useImperativeHandle)(t,(function(){return{}}));var s=Object(a.useRef)(!1);return!s.current&&Y()&&(i.current=r(),s.current=!0),Object(a.useEffect)((function(){null==n||n(e)})),Object(a.useEffect)((function(){return function(){var e,t;null===(e=i.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(i.current)}}),[]),i.current?X.a.createPortal(o,i.current):null})),J=Q;function ee(e){if("undefined"==typeof document)return 0;if(e||void 0===Z){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var o=t.offsetWidth;n.style.overflow="scroll";var i=t.offsetWidth;o===i&&(i=n.clientWidth),document.body.removeChild(n),Z=o-i}return Z}var te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{};var n=t.element,r=void 0===n?document.body:n,o={},i=Object.keys(e);return i.forEach((function(e){o[e]=r.style[e]})),i.forEach((function(t){r.style[t]=e[t]})),o};var ne={},re=function(e){if(document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth||e){var t=new RegExp("".concat("ant-scrolling-effect"),"g"),n=document.body.className;if(e){if(!t.test(n))return;return te(ne),ne={},void(document.body.className=n.replace(t,"").trim())}var r=ee();if(r&&(ne=te({position:"relative",width:"calc(100% - ".concat(r,"px)")}),!t.test(n))){var o="".concat(n," ").concat("ant-scrolling-effect");document.body.className=o.trim()}}},oe=[],ie=new RegExp("".concat("ant-scrolling-effect"),"g"),ae=0,se=new Map,le=function e(t){var n=this;Object(_.a)(this,e),this.lockTarget=void 0,this.options=void 0,this.getContainer=function(){var e;return null===(e=n.options)||void 0===e?void 0:e.container},this.reLock=function(e){var t=oe.find((function(e){var t=e.target;return t===n.lockTarget}));t&&n.unLock(),n.options=e,t&&(t.options=e,n.lock())},this.lock=function(){var e;if(!oe.some((function(e){var t=e.target;return t===n.lockTarget})))if(oe.some((function(e){var t,r=e.options;return(null==r?void 0:r.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})))oe=[].concat(Object(f.a)(oe),[{target:n.lockTarget,options:n.options}]);else{var t=0,r=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body;(r===document.body&&window.innerWidth-document.documentElement.clientWidth>0||r.scrollHeight>r.clientHeight)&&(t=ee());var o=r.className;if(0===oe.filter((function(e){var t,r=e.options;return(null==r?void 0:r.container)===(null===(t=n.options)||void 0===t?void 0:t.container)})).length&&se.set(r,te({width:0!==t?"calc(100% - ".concat(t,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:r})),!ie.test(o)){var i="".concat(o," ").concat("ant-scrolling-effect");r.className=i.trim()}oe=[].concat(Object(f.a)(oe),[{target:n.lockTarget,options:n.options}])}},this.unLock=function(){var e,t=oe.find((function(e){var t=e.target;return t===n.lockTarget}));if(oe=oe.filter((function(e){var t=e.target;return t!==n.lockTarget})),t&&!oe.some((function(e){var n,r=e.options;return(null==r?void 0:r.container)===(null===(n=t.options)||void 0===n?void 0:n.container)}))){var r=(null===(e=n.options)||void 0===e?void 0:e.container)||document.body,o=r.className;ie.test(o)&&(te(se.get(r),{element:r}),se.delete(r),r.className=r.className.replace(ie,"").trim())}},this.lockTarget=ae++,this.options=t},ce=0,ue=Y();var fe={},de=function(e){if(!ue)return null;if(e){if("string"==typeof e)return document.querySelectorAll(e)[0];if("function"==typeof e)return e();if("object"===Object(z.a)(e)&&e instanceof window.HTMLElement)return e}return document.body},pe=function(e){Object(I.a)(n,e);var t=F(n);function n(e){var r;return Object(_.a)(this,n),r=t.call(this,e),r.container=void 0,r.componentRef=a.createRef(),r.rafId=void 0,r.scrollLocker=void 0,r.renderComponent=void 0,r.updateScrollLocker=function(e){var t=e||{},n=t.visible,o=r.props,i=o.getContainer,a=o.visible;a&&a!==n&&ue&&de(i)!==r.scrollLocker.getContainer()&&r.scrollLocker.reLock({container:de(i)})},r.updateOpenCount=function(e){var t=e||{},n=t.visible,o=t.getContainer,i=r.props,a=i.visible,s=i.getContainer;a!==n&&ue&&de(s)===document.body&&(a&&!n?ce+=1:e&&(ce-=1));var l="function"==typeof s&&"function"==typeof o;(l?s.toString()!==o.toString():s!==o)&&r.removeCurrentContainer()},r.attachToParent=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||r.container&&!r.container.parentNode){var t=de(r.props.getContainer);return!!t&&(t.appendChild(r.container),!0)}return!0},r.getContainer=function(){return ue?(r.container||(r.container=document.createElement("div"),r.attachToParent(!0)),r.setWrapperClassName(),r.container):null},r.setWrapperClassName=function(){var e=r.props.wrapperClassName;r.container&&e&&e!==r.container.className&&(r.container.className=e)},r.removeCurrentContainer=function(){var e,t;null===(e=r.container)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(r.container)},r.switchScrollingEffect=function(){1!==ce||Object.keys(fe).length?ce||(te(fe),fe={},re(!0)):(re(),fe=te({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}))},r.scrollLocker=new le({container:de(e.getContainer)}),r}return Object(R.a)(n,[{key:"componentDidMount",value:function(){var e=this;this.updateOpenCount(),this.attachToParent()||(this.rafId=q((function(){e.forceUpdate()})))}},{key:"componentDidUpdate",value:function(e){this.updateOpenCount(e),this.updateScrollLocker(e),this.setWrapperClassName(),this.attachToParent()}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visible,n=e.getContainer;ue&&de(n)===document.body&&(ce=t&&ce?ce-1:ce),this.removeCurrentContainer(),q.cancel(this.rafId)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.forceRender,r=e.visible,o=null,i={getOpenCount:function(){return ce},getContainer:this.getContainer,switchScrollingEffect:this.switchScrollingEffect,scrollLocker:this.scrollLocker};return(n||r||this.componentRef.current)&&(o=a.createElement(J,{getContainer:this.getContainer,ref:this.componentRef},t(i))),o}}]),n}(a.Component),he=pe;function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ge=n(7),ye=n.n(ge),be={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=be.F1&&t<=be.F12)return!1;switch(t){case be.ALT:case be.CAPS_LOCK:case be.CONTEXT_MENU:case be.CTRL:case be.DOWN:case be.END:case be.ESC:case be.HOME:case be.INSERT:case be.LEFT:case be.MAC_FF_META:case be.META:case be.NUMLOCK:case be.NUM_CENTER:case be.PAGE_DOWN:case be.PAGE_UP:case be.PAUSE:case be.PRINT_SCREEN:case be.RIGHT:case be.SHIFT:case be.UP:case be.WIN_KEY:case be.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=be.ZERO&&e<=be.NINE)return!0;if(e>=be.NUM_ZERO&&e<=be.NUM_MULTIPLY)return!0;if(e>=be.A&&e<=be.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case be.SPACE:case be.QUESTION_MARK:case be.NUM_PLUS:case be.NUM_MINUS:case be.NUM_PERIOD:case be.NUM_DIVISION:case be.SEMICOLON:case be.DASH:case be.EQUALS:case be.COMMA:case be.PERIOD:case be.SLASH:case be.APOSTROPHE:case be.SINGLE_QUOTE:case be.OPEN_SQUARE_BRACKET:case be.BACKSLASH:case be.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},we=be;var xe="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/);function Ce(e,t){return 0===e.indexOf(t)}n(37);function Oe(e,t){"function"==typeof e?e(t):"object"===Object(z.a)(e)&&e&&"current"in e&&(e.current=t)}function Se(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var ke,Ee,Le,Me=(ke=Y(),Ee="undefined"!=typeof window?window:{},Le={animationend:Se("Animation","AnimationEnd"),transitionend:Se("Transition","TransitionEnd")},ke&&("AnimationEvent"in Ee||delete Le.animationend.animation,"TransitionEvent"in Ee||delete Le.transitionend.transition),Le),Te={};if(Y()){var Ne=document.createElement("div");Te=Ne.style}var je={};function De(e){if(je[e])return je[e];var t=Me[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o<r;o+=1){var i=n[o];if(Object.prototype.hasOwnProperty.call(t,i)&&i in Te)return je[e]=t[i],je[e]}return""}var Pe=De("animationend"),Ae=De("transitionend"),_e=!(!Pe||!Ae),Re=Pe||"animationend",Ie=Ae||"transitionend";function We(e,t){if(!e)return null;if("object"===Object(z.a)(e)){var n=t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}));return e[n]}return"".concat(e,"-").concat(t)}function He(e){var t=Object(a.useRef)(!1),n=Object(a.useState)(e),r=Object(i.a)(n,2),o=r[0],s=r[1];return Object(a.useEffect)((function(){return function(){t.current=!0}}),[]),[o,function(e){t.current||s(e)}]}var Fe=Y()?a.useLayoutEffect:a.useEffect,ze=Fe,Be=["prepare","start","active","end"];function Ue(e){return"active"===e||"end"===e}var Ve=function(e,t){var n=a.useState("none"),r=Object(i.a)(n,2),o=r[0],s=r[1],l=function(){var e=a.useRef(null);function t(){q.cancel(e.current)}return a.useEffect((function(){return function(){t()}}),[]),[function n(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var i=q((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)}));e.current=i},t]}(),c=Object(i.a)(l,2),u=c[0],f=c[1];return ze((function(){if("none"!==o&&"end"!==o){var e=Be.indexOf(o),n=Be[e+1],r=t(o);!1===r?s(n):u((function(e){function t(){e.isCanceled()||s(n)}!0===r?t():Promise.resolve(r).then(t)}))}}),[e,o]),a.useEffect((function(){return function(){f()}}),[]),[function(){s("prepare")},o]};function Ge(e,t,n,r){var s=r.motionEnter,l=void 0===s||s,c=r.motionAppear,u=void 0===c||c,f=r.motionLeave,d=void 0===f||f,p=r.motionDeadline,h=r.motionLeaveImmediately,m=r.onAppearPrepare,v=r.onEnterPrepare,g=r.onLeavePrepare,y=r.onAppearStart,b=r.onEnterStart,w=r.onLeaveStart,x=r.onAppearActive,C=r.onEnterActive,O=r.onLeaveActive,S=r.onAppearEnd,k=r.onEnterEnd,E=r.onLeaveEnd,L=r.onVisibleChanged,M=He(),T=Object(i.a)(M,2),N=T[0],j=T[1],D=He("none"),P=Object(i.a)(D,2),A=P[0],_=P[1],R=He(null),I=Object(i.a)(R,2),W=I[0],H=I[1],F=Object(a.useRef)(!1),z=Object(a.useRef)(null),B=Object(a.useRef)(!1),U=Object(a.useRef)(null);function V(){var e=n();return e||U.current}var G=Object(a.useRef)(!1);function K(e){var t,n=V();e&&!e.deadline&&e.target!==n||("appear"===A&&G.current?t=null==S?void 0:S(n,e):"enter"===A&&G.current?t=null==k?void 0:k(n,e):"leave"===A&&G.current&&(t=null==E?void 0:E(n,e)),!1===t||B.current||(_("none"),H(null)))}var q=function(e){var t=Object(a.useRef)(),n=Object(a.useRef)(e);n.current=e;var r=a.useCallback((function(e){n.current(e)}),[]);function o(e){e&&(e.removeEventListener(Ie,r),e.removeEventListener(Re,r))}return a.useEffect((function(){return function(){o(t.current)}}),[]),[function(e){t.current&&t.current!==e&&o(t.current),e&&e!==t.current&&(e.addEventListener(Ie,r),e.addEventListener(Re,r),t.current=e)},o]}(K),$=Object(i.a)(q,1),X=$[0],Y=a.useMemo((function(){var e,t,n;switch(A){case"appear":return e={},Object(o.a)(e,"prepare",m),Object(o.a)(e,"start",y),Object(o.a)(e,"active",x),e;case"enter":return t={},Object(o.a)(t,"prepare",v),Object(o.a)(t,"start",b),Object(o.a)(t,"active",C),t;case"leave":return n={},Object(o.a)(n,"prepare",g),Object(o.a)(n,"start",w),Object(o.a)(n,"active",O),n;default:return{}}}),[A]),Z=Ve(A,(function(e){if("prepare"===e){var t=Y.prepare;return!!t&&t(V())}var n;ee in Y&&H((null===(n=Y[ee])||void 0===n?void 0:n.call(Y,V(),null))||null);return"active"===ee&&(X(V()),p>0&&(clearTimeout(z.current),z.current=setTimeout((function(){K({deadline:!0})}),p))),!0})),Q=Object(i.a)(Z,2),J=Q[0],ee=Q[1],te=Ue(ee);G.current=te,ze((function(){j(t);var n,r=F.current;(F.current=!0,e)&&(!r&&t&&u&&(n="appear"),r&&t&&l&&(n="enter"),(r&&!t&&d||!r&&h&&!t&&d)&&(n="leave"),n&&(_(n),J()))}),[t]),Object(a.useEffect)((function(){("appear"===A&&!u||"enter"===A&&!l||"leave"===A&&!d)&&_("none")}),[u,l,d]),Object(a.useEffect)((function(){return function(){clearTimeout(z.current),B.current=!0}}),[]),Object(a.useEffect)((function(){void 0!==N&&"none"===A&&(null==L||L(N))}),[N,A]);var ne=W;return Y.prepare&&"start"===ee&&(ne=ve({transition:"none"},ne)),[A,ee,ne,null!=N?N:t]}var Ke=function(e){Object(I.a)(n,e);var t=F(n);function n(){return Object(_.a)(this,n),t.apply(this,arguments)}return Object(R.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(a.Component),qe=Ke;var $e=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===Object(z.a)(e)&&(t=e.transitionSupport);var r=a.forwardRef((function(e,t){var r=e.visible,s=void 0===r||r,l=e.removeOnLeave,c=void 0===l||l,u=e.forceRender,f=e.children,d=e.motionName,p=e.leavedClassName,h=e.eventProps,m=n(e),v=Object(a.useRef)(),g=Object(a.useRef)();var y=Ge(m,s,(function(){try{return e=v.current||g.current,e instanceof HTMLElement?e:X.a.findDOMNode(e)}catch(t){return null}var e}),e),b=Object(i.a)(y,4),w=b[0],x=b[1],C=b[2],O=b[3],S=a.useRef(O);O&&(S.current=!0);var k=Object(a.useRef)(t);k.current=t;var E,L=a.useCallback((function(e){v.current=e,Oe(k.current,e)}),[]),M=ve(ve({},h),{},{visible:s});if(f)if("none"!==w&&n(e)){var T,N;"prepare"===x?N="prepare":Ue(x)?N="active":"start"===x&&(N="start"),E=f(ve(ve({},M),{},{className:ye()(We(d,w),(T={},Object(o.a)(T,We(d,"".concat(w,"-").concat(N)),N),Object(o.a)(T,d,"string"==typeof d),T)),style:C}),L)}else E=O?f(ve({},M),L):!c&&S.current?f(ve(ve({},M),{},{className:p}),L):u?f(ve(ve({},M),{},{style:{display:"none"}}),L):null;else E=null;return a.createElement(qe,{ref:g},E)}));return r.displayName="CSSMotion",r}(_e);function Xe(e){var t;return t=e&&"object"===Object(z.a)(e)&&"key"in e?e:{key:e},ve(ve({},t),{},{key:String(t.key)})}function Ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Xe)}function Ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=Ye(e),a=Ye(t);i.forEach((function(e){for(var t=!1,i=r;i<o;i+=1){var s=a[i];if(s.key===e.key){r<i&&(n=n.concat(a.slice(r,i).map((function(e){return ve(ve({},e),{},{status:"add"})}))),r=i),n.push(ve(ve({},s),{},{status:"keep"})),r+=1,t=!0;break}}t||n.push(ve(ve({},e),{},{status:"remove"}))})),r<o&&(n=n.concat(a.slice(r).map((function(e){return ve(ve({},e),{},{status:"add"})}))));var s={};n.forEach((function(e){var t=e.key;s[t]=(s[t]||0)+1}));var l=Object.keys(s).filter((function(e){return s[e]>1}));return l.forEach((function(e){n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||"remove"!==r})),n.forEach((function(t){t.key===e&&(t.status="keep")}))})),n}var Qe=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$e,n=function(e){Object(I.a)(o,e);var n=F(o);function o(){var e;return Object(_.a)(this,o),e=n.apply(this,arguments),e.state={keyEntities:[]},e.removeKey=function(t){e.setState((function(e){var n=e.keyEntities;return{keyEntities:n.map((function(e){return e.key!==t?e:ve(ve({},e),{},{status:"removed"})}))}}))},e}return Object(R.a)(o,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,o=this.props,i=o.component,s=o.children,l=o.onVisibleChanged,c=Object(A.a)(o,["component","children","onVisibleChanged"]),u=i||a.Fragment,f={};return Qe.forEach((function(e){f[e]=c[e],delete c[e]})),delete c.keys,a.createElement(u,c,n.map((function(n){var o=n.status,i=Object(A.a)(n,["status"]),c="add"===o||"keep"===o;return a.createElement(t,Object(r.a)({},f,{key:i.key,visible:c,eventProps:i,onVisibleChanged:function(t){null==l||l(t,{key:i.key}),t||e.removeKey(i.key)}}),s)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,o=Ye(n),i=Ze(r,o);return{keyEntities:i.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||"removed"!==t.status||"remove"!==e.status}))}}}]),o}(a.Component);n.defaultProps={component:"div"}}(_e);var Je=$e;function et(e){var t=e.prefixCls,n=e.style,o=e.visible,i=e.maskProps,s=e.motionName;return a.createElement(Je,{key:"mask",visible:o,motionName:s,leavedClassName:"".concat(t,"-mask-hidden")},(function(e){var o=e.className,s=e.style;return a.createElement("div",Object(r.a)({style:ve(ve({},s),n),className:ye()("".concat(t,"-mask"),o)},i))}))}function tt(e,t,n){var r=t;return!r&&n&&(r="".concat(e,"-").concat(n)),r}var nt=-1;function rt(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var o=e.document;n=o.documentElement[r],"number"!=typeof n&&(n=o.body[r])}return n}var ot=a.memo((function(e){var t=e.children;return t}),(function(e,t){var n=t.shouldUpdate;return!n})),it={width:0,height:0,overflow:"hidden",outline:"none"},at=a.forwardRef((function(e,t){var n=e.closable,o=e.prefixCls,s=e.width,l=e.height,c=e.footer,u=e.title,f=e.closeIcon,d=e.style,p=e.className,h=e.visible,m=e.forceRender,v=e.bodyStyle,g=e.bodyProps,y=e.children,b=e.destroyOnClose,w=e.modalRender,x=e.motionName,C=e.ariaId,O=e.onClose,S=e.onVisibleChanged,k=e.onMouseDown,E=e.onMouseUp,L=e.mousePosition,M=Object(a.useRef)(),T=Object(a.useRef)(),N=Object(a.useRef)();a.useImperativeHandle(t,(function(){return{focus:function(){var e;null===(e=M.current)||void 0===e||e.focus()},changeActive:function(e){var t=document,n=t.activeElement;e&&n===T.current?M.current.focus():e||n!==M.current||T.current.focus()}}}));var j,D,P,A=a.useState(),_=Object(i.a)(A,2),R=_[0],I=_[1],W={};function H(){var e,t,n,r,o,i=(e=N.current,t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,o=r.defaultView||r.parentWindow,n.left+=rt(o),n.top+=rt(o,!0),n);I(L?"".concat(L.x-i.left,"px ").concat(L.y-i.top,"px"):"")}void 0!==s&&(W.width=s),void 0!==l&&(W.height=l),R&&(W.transformOrigin=R),c&&(j=a.createElement("div",{className:"".concat(o,"-footer")},c)),u&&(D=a.createElement("div",{className:"".concat(o,"-header")},a.createElement("div",{className:"".concat(o,"-title"),id:C},u))),n&&(P=a.createElement("button",{type:"button",onClick:O,"aria-label":"Close",className:"".concat(o,"-close")},f||a.createElement("span",{className:"".concat(o,"-close-x")})));var F=a.createElement("div",{className:"".concat(o,"-content")},P,D,a.createElement("div",Object(r.a)({className:"".concat(o,"-body"),style:v},g),y),j);return a.createElement(Je,{visible:h,onVisibleChanged:S,onAppearPrepare:H,onEnterPrepare:H,forceRender:m,motionName:x,removeOnLeave:b,ref:N},(function(e,t){var n=e.className,r=e.style;return a.createElement("div",{key:"dialog-element",role:"document",ref:t,style:ve(ve(ve({},r),d),W),className:ye()(o,p,n),onMouseDown:k,onMouseUp:E},a.createElement("div",{tabIndex:0,ref:M,style:it,"aria-hidden":"true"}),a.createElement(ot,{shouldUpdate:h||m},w?w(F):F),a.createElement("div",{tabIndex:0,ref:T,style:it,"aria-hidden":"true"}))}))}));at.displayName="Content";var st=at;function lt(e){var t=e.prefixCls,n=void 0===t?"rc-dialog":t,o=e.zIndex,s=e.visible,l=void 0!==s&&s,c=e.keyboard,u=void 0===c||c,f=e.focusTriggerAfterClose,d=void 0===f||f,p=e.scrollLocker,h=e.title,m=e.wrapStyle,v=e.wrapClassName,g=e.wrapProps,y=e.onClose,b=e.afterClose,w=e.transitionName,x=e.animation,C=e.closable,O=void 0===C||C,S=e.mask,k=void 0===S||S,E=e.maskTransitionName,L=e.maskAnimation,M=e.maskClosable,T=void 0===M||M,N=e.maskStyle,j=e.maskProps,D=Object(a.useRef)(),P=Object(a.useRef)(),A=Object(a.useRef)(),_=a.useState(l),R=Object(i.a)(_,2),I=R[0],W=R[1],H=Object(a.useRef)();function F(e){null==y||y(e)}H.current||(H.current="rcDialogTitle".concat((nt+=1,nt)));var z=Object(a.useRef)(!1),B=Object(a.useRef)(),U=null;return T&&(U=function(e){z.current?z.current=!1:P.current===e.target&&F(e)}),Object(a.useEffect)((function(){return l&&W(!0),function(){}}),[l]),Object(a.useEffect)((function(){return function(){clearTimeout(B.current)}}),[]),Object(a.useEffect)((function(){return I?(null==p||p.lock(),null==p?void 0:p.unLock):function(){}}),[I,p]),a.createElement("div",Object(r.a)({className:"".concat(n,"-root")},function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:ve({},n);var r={};return Object.keys(e).forEach((function(n){(t.aria&&("role"===n||Ce(n,"aria-"))||t.data&&Ce(n,"data-")||t.attr&&xe.includes(n))&&(r[n]=e[n])})),r}(e,{data:!0})),a.createElement(et,{prefixCls:n,visible:k&&l,motionName:tt(n,E,L),style:ve({zIndex:o},N),maskProps:j}),a.createElement("div",Object(r.a)({tabIndex:-1,onKeyDown:function(e){if(u&&e.keyCode===we.ESC)return e.stopPropagation(),void F(e);l&&e.keyCode===we.TAB&&A.current.changeActive(!e.shiftKey)},className:ye()("".concat(n,"-wrap"),v),ref:P,onClick:U,role:"dialog","aria-labelledby":h?H.current:null,style:ve(ve({zIndex:o},m),{},{display:I?null:"none"})},g),a.createElement(st,Object(r.a)({},e,{onMouseDown:function(){clearTimeout(B.current),z.current=!0},onMouseUp:function(){B.current=setTimeout((function(){z.current=!1}))},ref:A,closable:O,ariaId:H.current,prefixCls:n,visible:l,onClose:F,onVisibleChanged:function(e){if(e){var t;if(n=P.current,r=document.activeElement,!n||!n.contains(r))D.current=document.activeElement,null===(t=A.current)||void 0===t||t.focus()}else{if(W(!1),k&&D.current&&d){try{D.current.focus({preventScroll:!0})}catch(o){}D.current=null}I&&(null==b||b())}var n,r},motionName:tt(n,w,x)}))))}var ct=function(e){var t=e.visible,n=e.getContainer,o=e.forceRender,s=e.destroyOnClose,l=void 0!==s&&s,c=e.afterClose,u=a.useState(t),f=Object(i.a)(u,2),d=f[0],p=f[1];return a.useEffect((function(){t&&p(!0)}),[t]),!1===n?a.createElement(lt,Object(r.a)({},e,{getOpenCount:function(){return 2}})):o||!l||d?a.createElement(he,{visible:t,forceRender:o,getContainer:n},(function(t){return a.createElement(lt,Object(r.a)({},e,{destroyOnClose:l,afterClose:function(){null==c||c(),p(!1)}},t))})):null};ct.displayName="Dialog";var ut=ct,ft=ut,dt=(n(56),["style","className"]),pt=function(e){e.style;var t,n=e.className,o=Object(A.a)(e,dt);return s.a.createElement(ft,Object(r.a)({animation:"zoom",maskAnimation:"fade"},o,{className:"".concat(null!==(t=c.a.fullViewDialog)&&void 0!==t?t:""," ").concat(null!=n?n:"")}))};var ht=[{name:"code",icon:function(){return s.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9027",width:"100%",height:"100%"},s.a.createElement("path",{d:"M85.312 164.8v604.8h853.376v-604.8H85.312zM682.688 870.4V960H341.312v-89.6H0V64h1024v806.4h-341.312zM390.08 632.128L128 503.04V422.336l262.08-128.64V390.4L230.784 462.976l159.296 72.832v96.32zM529.6 256H576l-82.048 413.184H448L529.6 256z m104.32 376.128V535.808l159.296-72.832-159.296-72.512V293.632L896 422.4v80.768L633.92 632.128z","p-id":"9028","data-spm-anchor-id":"a313x.7781069.0.i1"}))},View:function(e){var t=e.code,n=e.setCode;return s.a.createElement(d.Controlled,{value:t,className:c.a.codemirror,options:{lineNumbers:!0,matchBrackets:!0,mode:"text/typescript"},editorDidMount:function(e){setTimeout((function(){e.refresh()}),10)},onBeforeChange:function(e,t,r){n(r)}})}},{name:"full-view",enabled:function(e){e.demoOpts,e.buildTimeDemoOpts,e.demoMeta;var t=e.resolvedOpts;return t.canFullScreen},icon:function(){return s.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9027",width:"100%",height:"100%"},s.a.createElement("path",{d:"M725.333333 42.666667l128 0q52.992 0 90.496 37.504t37.504 90.496l0 128q0 17.664-12.501333 30.165333t-30.165333 12.501333-30.165333-12.501333-12.501333-30.165333l0-128q0-17.664-12.501333-30.165333t-30.165333-12.501333l-128 0q-17.664 0-30.165333-12.501333t-12.501333-30.165333 12.501333-30.165333 30.165333-12.501333zM85.333333 682.666667q17.664 0 30.165333 12.501333t12.501333 30.165333l0 128q0 17.664 12.501333 30.165333t30.165333 12.501333l128 0q17.664 0 30.165333 12.501333t12.501333 30.165333-12.501333 30.165333-30.165333 12.501333l-128 0q-52.992 0-90.496-37.504t-37.504-90.496l0-128q0-17.664 12.501333-30.165333t30.165333-12.501333zM170.666667 42.666667l128 0q17.664 0 30.165333 12.501333t12.501333 30.165333-12.501333 30.165333-30.165333 12.501333l-128 0q-17.664 0-30.165333 12.501333t-12.501333 30.165333l0 128q0 17.664-12.501333 30.165333t-30.165333 12.501333-30.165333-12.501333-12.501333-30.165333l0-128q0-52.992 37.504-90.496t90.496-37.504zM938.666667 682.666667q17.664 0 30.165333 12.501333t12.501333 30.165333l0 128q0 52.992-37.504 90.496t-90.496 37.504l-128 0q-17.664 0-30.165333-12.501333t-12.501333-30.165333 12.501333-30.165333 30.165333-12.501333l128 0q17.664 0 30.165333-12.501333t12.501333-30.165333l0-128q0-17.664 12.501333-30.165333t30.165333-12.501333z","p-id":"11568"}))},View:void 0},{name:"codesandbox",icon:function(){return s.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9197",width:"100%",height:"100%"},s.a.createElement("path",{d:"M755 140.3l0.5-0.3h0.3L512 0 268.3 140h-0.3l0.8 0.4L68.6 256v512L512 1024l443.4-256V256L755 140.3z m-30 506.4v171.2L548 920.1V534.7L883.4 341v215.7l-158.4 90z m-584.4-90.6V340.8L476 534.4v385.7L300 818.5V646.7l-159.4-90.6zM511.7 280l171.1-98.3 166.3 96-336.9 194.5-337-194.6 165.7-95.7L511.7 280z","p-id":"9198"}))},View:function(e){var t=e.code,n=e.imports,r=e.meta,o=e.opts;return s.a.createElement(E,{code:t,imports:n,meta:r,modifyCodeSandbox:o.modifyCodeSandbox})}}],mt={current:"none",previous:"none"};function vt(e,t){return e.current===t?{current:"none",previous:e.current}:{current:t,previous:e.current}}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bt=function(e){var t,n=e.code,r=e.DemoWrapper,o=e.imports,l=e.meta,d=void 0===l?{}:l,p=e.opts,m=void 0===p?{}:p,v=e.className,g=e.style,y=e.demoDeps,b=e.loadOpts,w=e.children,x=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},d=arguments.length>4?arguments[4]:void 0,p=arguments.length>5?arguments[5]:void 0,m=arguments.length>6?arguments[6]:void 0,v=Object(a.useReducer)(vt,mt),g=Object(i.a)(v,2),y=g[0],b=g[1],w={canFullScreen:void 0!==(null==o?void 0:o.canFullScreen)?"false"!==String(null==o?void 0:o.canFullScreen):null!==(n=null!==(r=l.canFullScreen)&&void 0!==r?r:u.canFullScreen)&&void 0!==n&&n},x=Object(a.useMemo)((function(){var n=e;return"function"==typeof u.modifyDisplayCode&&(n=u.modifyDisplayCode({code:n,meta:o,imports:t})),"function"==typeof l.modifyDisplayCode&&(n=l.modifyDisplayCode({code:n,meta:o,imports:t})),n}),[l.modifyDisplayCode,u.modifyDisplayCode,e,o,t]),C=Object(a.useState)(x),O=Object(i.a)(C,2),S=O[0],k=O[1];Object(a.useEffect)((function(){k(x)}),[x]);var E,L,M,T,N=j({code:S,deps:d,enable:S!==x}),D=N.renderEvalCode,P=N.transformedCode,A=Object(a.useMemo)((function(){var e=ht;"function"==typeof u.extraOperations&&(e=[].concat(Object(f.a)(e),Object(f.a)(u.extraOperations({code:x,meta:o,imports:t})))),"function"==typeof l.extraOperations&&(e=[].concat(Object(f.a)(e),Object(f.a)(l.extraOperations({code:x,meta:o,imports:t}))));var n={demoOpts:l,buildTimeDemoOpts:u,demoMeta:o,resolvedOpts:w};return e.filter((function(e){return"function"!=typeof e.enabled||e.enabled(n)}))}),[l.extraOperations,u.extraOperations,x,o,t]),_=(E=null!=D?D:p,m&&(E=s.a.createElement(m,null,E)),E),R=(L=function(){if("none"!==y.current){var e=A.find((function(e){return e.name===y.current}));return{operation:e,height:null!=e&&e.View?"auto":0}}var t=A.find((function(e){return e.name===y.previous}));return{operation:t,height:0}}(),M=L.operation,T=L.height,s.a.createElement(h.a,{duration:250,height:T},null!=M&&M.View?s.a.createElement(M.View,{code:S,originalCode:x,setCode:k,imports:t,meta:o,opts:l}):s.a.createElement("div",null))),I=s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{className:c.a.operations,"data-transformed-code":P},A.map((function(e){var t=e.icon,n=e.name,r=e.onClick;return s.a.createElement("span",{key:n,className:c.a.operation,onClick:function(){b(n),"function"==typeof r&&r()}},t())}))),s.a.createElement(pt,{title:o.title,visible:"full-view"===y.current,onClose:function(){b("full-view")}},_),R);return{demoView:_,operationsView:I,resolvedOpts:w}}(n,o,d,m,y,w,r,b),C=x.demoView,O=x.operationsView,S=x.resolvedOpts,k=S.canFullScreen;return s.a.createElement("div",{className:[k?"canFullScreen":null,u.containerClassName,m.containerClassName,c.a.container,v].filter(Boolean).join(" "),style:yt(yt(yt({},u.containerStyle),null!==(t=m.containerStyle)&&void 0!==t?t:{}),g)},s.a.createElement("div",{className:c.a.title},d.title),s.a.createElement("div",{className:c.a.demo},s.a.createElement("div",{className:c.a.demoInner},C)),s.a.createElement("div",{className:c.a.describe},d.describe||d.description),O)};const wt=Object.assign({},{title:"场景1"},{},{_type:"demo"}),xt=Object.assign({},{title:"模糊搜索",description:"在你设置 `fuzzy=true` 或者 `defaultDataIndex` 被设置的时候,可以通过 suggestion 来做自动提示"},{},{_type:"demo"}),Ct=Object.assign({},{},{},{_type:"md"});var Ot=[{key:"demo1",staticMeta:wt,load:()=>n.e(10).then(n.bind(null,681))},{key:"fuzzy",staticMeta:xt,load:()=>n.e(11).then(n.bind(null,682))},{key:"README",staticMeta:Ct,load:()=>Promise.all([n.e(1),n.e(9)]).then(n.bind(null,683))},{key:"types/IRcSearchOptions",staticMeta:{_type:"typeInfo"},load:()=>n.e(12).then(n.bind(null,684))},{key:"types/IRcSearchProps",staticMeta:{_type:"typeInfo"},load:()=>n.e(13).then(n.bind(null,685))},{key:"types/IRcSearchTagItemProps",staticMeta:{_type:"typeInfo"},load:()=>n.e(14).then(n.bind(null,686))},{key:"types/IRcSearchTagListProps",staticMeta:{_type:"typeInfo"},load:()=>n.e(15).then(n.bind(null,687))}],St=(n(60),void 0),kt=void 0;function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(n),!0).forEach((function(t){Object(o.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mt=s.a.lazy((function(){return Promise.all([n.e(1),n.e(16)]).then(n.bind(null,676))}));t.a=function(e){var t=e.entryKey,n=e.onLoaded,o=e.markdownOpts,l=e.demoOpts,c=e.resolveDemoOpts,u=e.resolveAppServePath,f=e.resolveAppDeps,d=e.loadOpts,p=Object(a.useState)(null),h=Object(i.a)(p,2),m=h[0],v=h[1];Object(a.useEffect)((function(){if(t){var e=Ot.find((function(e){var n=e.key;return t===n}));if(e){var n=e.staticMeta;switch(n._type){case"demo":e.load().then((function(e){var t=e.demo,r=e.meta,o=e.code,i=e.imports,a=e.deps;v({type:n._type,Component:t,code:o,imports:i,meta:Lt(Lt({},n),r),demoDeps:a,loadOpts:d})}));break;case"md":e.load().then((function(e){var t=e.default;v({type:n._type,Component:t})}));break;case"normal":e.load().then((function(e){var t=e.default;v({type:n._type,Component:t})}));break;case"typeInfo":e.load().then((function(e){var t=e.typeInfo;v({type:n._type,data:t})}))}}}}),[t]);var g=Object(a.useRef)(m);return Object(a.useEffect)((function(){g.current!==m&&"function"==typeof n&&n()}),[m]),m?"demo"===m.type?s.a.createElement(bt,{code:m.code,imports:m.imports,DemoWrapper:null,meta:m.meta,opts:l,demoDeps:m.demoDeps,loadOpts:m.loadOpts},s.a.createElement(m.Component,null)):"md"===m.type?s.a.createElement(m.Component,Object(r.a)({},o,{resolveDemoOpts:c,resolveAppServePath:function(e){var t="";return t||"function"!=typeof St||(t=St(e)),t||"function"!=typeof u||(t=u(e)),t||"function"!=typeof kt||(t=kt(e)),t},resolveAppDeps:f})):"typeInfo"===m.type?s.a.createElement(s.a.Suspense,{fallback:null},s.a.createElement(Mt,{typeInfo:m.data})):s.a.createElement(m.Component,{meta:m.meta}):null}},function(e,t,n){e.exports=n(54)},function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(43);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(16).default,o=n(44);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=r||o||i,s=a&&(r?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,l=!0);var C=y&&(c||f&&(null==x||x<12.11)),O=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,E=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return L(e).appendChild(t)}function T(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function N(e,t,n,r){var o=T(e,t,n,r);return o.setAttribute("role","presentation"),o}function j(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(Ne){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function P(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function A(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}k=document.createRange?function(e,t,n,r){var o=document.createRange();return o.setEnd(r||e,n),o.setStart(e,t),o}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(Ne){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var _=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function W(e,t,n,r,o){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var i=r||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}}m?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(t){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function F(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.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)};var z={toString:function(){return"CodeMirror.Pass"}},B={scroll:!1},U={origin:"*mouse"},V={origin:"+move"};function G(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var a=i-r;if(i==e.length||o+a>=t)return r+Math.min(a,t-o);if(o+=i-r,o+=n-o%n,r=i+1,o>=t)return r}}var K=[""];function q(e){for(;K.length<=e;)K.push($(K)+" ");return K[e]}function $(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Y(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Y.prototype=e,n=new Y),t&&I(t,n),n}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function ie(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:ae=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:ae=o)}return null!=r?r:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,o=/[1n]/;function i(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,f=[],d=0;d<u;++d)f.push((c=a.charCodeAt(d),c<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L"));for(var p=0,h=l;p<u;++p){var m=f[p];"m"==m?f[p]=h:h=m}for(var v=0,g=l;v<u;++v){var y=f[v];"1"==y&&"r"==g?f[v]="n":n.test(y)&&(g=y,"r"==y&&(f[v]="R"))}for(var b=1,w=f[0];b<u-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<u;++C){var O=f[C];if(","==O)f[C]="N";else if("%"==O){var S=void 0;for(S=C+1;S<u&&"%"==f[S];++S);for(var k=C&&"!"==f[C-1]||S<u&&"1"==f[S]?"1":"N",E=C;E<S;++E)f[E]=k;C=S-1}}for(var L=0,M=l;L<u;++L){var T=f[L];"L"==M&&"1"==T?f[L]="L":n.test(T)&&(M=T)}for(var N=0;N<u;++N)if(t.test(f[N])){var j=void 0;for(j=N+1;j<u&&t.test(f[j]);++j);for(var D="L"==(N?f[N-1]:l),P="L"==(j<u?f[j]:l),A=D==P?D?"L":"R":l,_=N;_<j;++_)f[_]=A;N=j-1}for(var R,I=[],W=0;W<u;)if(r.test(f[W])){var H=W;for(++W;W<u&&r.test(f[W]);++W);I.push(new i(0,H,W))}else{var F=W,z=I.length,B="rtl"==s?1:0;for(++W;W<u&&"L"!=f[W];++W);for(var U=F;U<W;)if(o.test(f[U])){F<U&&(I.splice(z,0,new i(1,F,U)),z+=B);var V=U;for(++U;U<W&&o.test(f[U]);++U);I.splice(z,0,new i(2,V,U)),z+=B,F=U}else++U;F<W&&I.splice(z,0,new i(1,F,W))}return"ltr"==s&&(1==I[0].level&&(R=a.match(/^\s+/))&&(I[0].from=R[0].length,I.unshift(new i(0,0,R[0].length))),1==$(I).level&&(R=a.match(/\s+$/))&&($(I).to-=R[0].length,I.push(new i(0,u-R[0].length,u)))),"rtl"==s?I.reverse():I}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var ue=[],fe=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]||ue).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function pe(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,o=r&&r[t];if(o){var i=F(o,n);i>-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function he(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,n||t.type,e,t),xe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==F(n,t[r])&&n.push(t[r])}function ge(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),we(e)}function Oe(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var ke,Ee,Le=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==ke){var t=T("span","");M(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=ke?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=Ee)return Ee;var t=M(e,document.createTextNode("AخA")),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return L(e),!(!n||n.left==n.right)&&(Ee=r.right-n.right<3)}var Ne,je=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(Ne){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(Ne){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe=(Ne=T("div"),"oncopy"in Ne||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy)),Ae=null,_e={},Re={};function Ie(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function We(e){if("string"==typeof e&&Re.hasOwnProperty(e))e=Re[e];else if(e&&"string"==typeof e.name&&Re.hasOwnProperty(e.name)){var t=Re[e.name];"string"==typeof t&&(t={name:t}),e=Z(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=We(t);var n=_e[t.name];if(!n)return He(e,"text/plain");var r=n(e,t);if(Fe.hasOwnProperty(t.name)){var o=Fe[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}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 Fe={};function ze(e,t){var n=Fe.hasOwnProperty(e)?Fe[e]:Fe[e]={};I(t,n)}function Be(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Ue(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 Ve(e,t,n){return!e.startState||e.startState(t,n)}var Ge=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ke(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 o=n.children[r],i=o.chunkSize();if(t<i){n=o;break}t-=i}return n.lines[t]}function qe(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,(function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o})),r}function $e(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Xe(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,n=F(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function Ze(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var o=e.children[r],i=o.height;if(t<i){e=o;continue e}t-=i,n+=o.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 Qe(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function ot(e,t){return tt(e,t)<0?t:e}function it(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ke(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ke(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=st(e,t[r]);return n}Ge.prototype.eol=function(){return this.pos>=this.string.length},Ge.prototype.sol=function(){return this.pos==this.lineStart},Ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ge.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ge.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)),t)return++this.pos,n},Ge.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ge.prototype.skipToEnd=function(){this.pos=this.string.length},Ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ge.prototype.backUp=function(e){this.pos-=e},Ge.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(o(i)==o(e))return!1!==t&&(this.pos+=e.length),!0},Ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var o=[e.state.modeGen],i={};wt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=e.state.overlays[r],l=1,c=0;n.state=!0,wt(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=o[l];r>e&&o.splice(l,1,e,o[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}}),i),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=pt(e,Ye(t)),o=t.text.length>e.options.maxHighlightLength&&Be(e.doc.mode,r.state),i=ft(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.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 pt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new ut(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ke(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ct?c.lookAhead:0)<=i.modeFrontier))return s;var u=W(l.text,null,e.options.tabSize);(null==o||r>u)&&(o=s-1,r=u)}return o}(e,t,n),a=i>r.first&&Ke(r,i-1).stateAfter,s=a?ut.fromSaved(r,a,i):new ut(r,Ve(r.mode),i);return r.iter(i,t,(function(n){ht(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function ht(e,t,n,r){var o=e.doc.mode,i=new Ge(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&&mt(o,n.state);!i.eol();)vt(o,i,n.state),i.start=i.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ue(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function vt(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=Ue(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.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}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,Be(e.mode,t.state),n,t.lookAhead):new ut(e,Be(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?Be(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var o,i=e.doc,a=i.mode;t=st(i,t);var s,l=Ke(i,t.line),c=pt(e,t.line,n),u=new Ge(l.text,e.options.tabSize,c);for(r&&(s=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=vt(a,u,c.state),r&&s.push(new gt(u,o,Be(i.mode,c.state)));return r?s:new gt(u,o,c.state)}function bt(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";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function wt(e,t,n,r,o,i,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,f=new Ge(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,r.state),i);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,a&&ht(e,t,r,f.pos),f.pos=t.length,l=null):l=bt(vt(n,f,r.state,d),i),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<f.start;)c=Math.min(f.start,c+5e3),o(c,u);u=l}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e3);o(h,u),c=h}}var xt=!1,Ct=!1;function Ot(e,t,n){this.marker=e,this.from=t,this.to=n}function St(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function kt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Et(e,t){if(t.full)return null;var n=Qe(e,t.from.line)&&Ke(e,t.from.line).markedSpans,r=Qe(e,t.to.line)&&Ke(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker,s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);if(s||i.from==t&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var l=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new Ot(a,i.from,l?null:i.to))}}return r}(n,o,a),l=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker,s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);if(s||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var l=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new Ot(a,l?null:i.from-t,null==i.to?null:i.to-t))}}return r}(r,i,a),c=1==t.text.length,u=$(t.text).length+(c?o:0);if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null==d.to){var p=St(l,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=o}}if(l)for(var h=0;h<l.length;++h){var m=l[h];if(null!=m.to&&(m.to+=u),null==m.from){var v=St(s,m.marker);v||(m.from=u,c&&(s||(s=[])).push(m))}else m.from+=u,c&&(s||(s=[])).push(m)}s&&(s=Lt(s)),l&&l!=s&&(l=Lt(l));var g=[s];if(!c){var y,b=t.text.length-2;if(b>0&&s)for(var w=0;w<s.length;++w)null==s[w].to&&(y||(y=[])).push(new Ot(s[w].marker,null,null));for(var x=0;x<b;++x)g.push(y);g.push(l)}return g}function Lt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Mt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Nt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function Dt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=tt(r.from,o.from)||Nt(e)-Nt(t);if(i)return-i;var a=tt(r.to,o.to)||jt(e)-jt(t);return a||t.id-e.id}function Pt(e,t){var n,r=Ct&&e.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)o=r[i],o.marker.collapsed&&null==(t?o.from:o.to)&&(!n||Dt(n,o.marker)<0)&&(n=o.marker);return n}function At(e){return Pt(e,!0)}function _t(e){return Pt(e,!1)}function Rt(e,t){var n,r=Ct&&e.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!n||Dt(n,i.marker)<0)&&(n=i.marker)}return n}function It(e,t,n,r,o){var i=Ke(e,t),a=Ct&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,n)||Nt(l.marker)-Nt(o),f=tt(c.to,r)||jt(l.marker)-jt(o);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Wt(e){for(var t;t=At(e);)e=t.find(-1,!0).line;return e}function Ht(e,t){var n=Ke(e,t),r=Wt(n);return n==r?t:Ye(r)}function Ft(e,t){if(t>e.lastLine())return t;var n,r=Ke(e,t);if(!zt(e,r))return t;for(;n=_t(r);)r=n.find(1,!0).line;return Ye(r)+1}function zt(e,t){var n=Ct&&t.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if(r=n[o],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Bt(e,t,r))return!0}}function Bt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Bt(e,r.line,St(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if(o=t.markedSpans[i],o.marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&Bt(e,t,o))return!0}function Ut(e){e=Wt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==e)break;t+=o.height}for(var i=n.parent;i;n=i,i=n.parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==n)break;t+=s.height}return t}function Vt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=At(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=_t(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function Gt(e){var t=e.display,n=e.doc;t.maxLine=Ke(n,n.first),t.maxLineLength=Vt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Vt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Kt=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Mt(e)}Kt.prototype.lineNo=function(){return Ye(this)},ye(Kt);var $t={},Xt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Xt:$t;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=Jt,Te(e.display.measure)&&(a=ce(i,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&Ye(i);nn(i,r,dt(e,i,s)),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=A(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=A(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==o?(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(l){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,n,r,o,i,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!n||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}(t,e.trailingSpace):t,f=e.cm.state.specialChars,d=!1;if(f.test(t)){c=document.createDocumentFragment();for(var p=0;;){f.lastIndex=p;var h=f.exec(t),m=h?h.index-p:t.length-p;if(m){var v=document.createTextNode(u.slice(p,p+m));a&&s<9?c.appendChild(T("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;g=c.appendChild(T("span",q(b),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(g=c.appendChild(T("span","\r"==h[0]?"␍":"","cm-invalidchar")),g.setAttribute("cm-text",h[0]),e.col+=1):(g=e.cm.options.specialCharPlaceholder(h[0]),g.setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(T("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||d||i||l){var w=n||"";r&&(w+=r),o&&(w+=o);var x=T("span",[c],w,i);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return e.content.appendChild(x)}e.content.appendChild(c)}}function en(e,t){return function(n,r,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,d=0;d<t.length&&(f=t[d],!(f.to>c&&f.from<=c));d++);if(f.to>=u)return e(n,r,o,i,a,s,l);e(n,r.slice(0,f.to-c),o,i,null,s,l),i=null,r=r.slice(f.to-c),c=f.to}}}function tn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,l,c,u,f,d,p=o.length,h=0,m=1,v="",g=0;;){if(g==h){l=c=u=s="",d=null,f=null,g=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==h&&C.widgetNode)y.push(C);else if(x.from<=h&&(null==x.to||x.to>h||C.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&g>x.to&&(g=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==h&&(u+=" "+C.startStyle),C.endStyle&&x.to==g&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var O in C.attributes)(d||(d={}))[O]=C.attributes[O];C.collapsed&&(!f||Dt(f.marker,C)<0)&&(f=x)}else x.from>h&&g>x.from&&(g=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==g&&(c+=" "+b[S]);if(!f||f.from==h)for(var k=0;k<y.length;++k)tn(t,0,y[k]);if(f&&(f.from||0)==h){if(tn(t,(null==f.to?p+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=p)break;for(var E=Math.min(p,g);;){if(v){var L=h+v.length;if(!f){var M=L>E?v.slice(0,E-h):v;t.addToken(t,M,a?a+l:l,u,h+M.length==g?c:"",s,d)}if(L>=E){v=v.slice(E-h),h=E;break}h=L,u=""}v=o.slice(i,i=n[m++]),a=Yt(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,o.slice(i,i=n[T]),Yt(n[T+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=_t(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Ye($(this.rest))-n+1:1,this.node=this.text=null,this.hidden=zt(e,t)}function on(e,t,n){for(var r,o=[],i=t;i<n;i=r){var a=new rn(e.doc,Ke(e.doc,i),i);r=i+a.size,o.push(a)}return o}var an=null,sn=null;function ln(e,t){var n=de(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(cn,0));for(var i=function(e){r.push((function(){return n[e].apply(null,o)}))},a=0;a<n.length;++a)i(a)}}function cn(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?pn(e,t):"gutter"==i?mn(e,t,n,r):"class"==i?hn(e,t):"widget"==i&&vn(e,t,r)}t.changes=null}function fn(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Zt(e,t)}function pn(e,t){var n=t.text.className,r=dn(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,hn(e,t)):n&&(t.text.className=n)}function hn(e,t){!function(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=fn(t);t.background=r.insertBefore(T("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?fn(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 mn(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 o=fn(t);t.gutterBackground=T("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),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=fn(t),s=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(T("div",Je(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function vn(e,t,n){t.alignable&&(t.alignable=null);for(var r=S("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&t.node.removeChild(o);yn(e,t,n)}function gn(e,t,n,r){var o=dn(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),hn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,o){if(t.widgets)for(var i=fn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),wn(l,c,n,r),e.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),ln(l,"redraw")}}function wn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var o=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(o-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!j(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;"),M(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Cn(e,t){for(var n=Oe(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function On(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function kn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=M(e.measure,T("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 En(e){return 50-e.display.nativeBarWidth}function Ln(e){return e.display.scroller.clientWidth-En(e)-e.display.barWidth}function Mn(e){return e.display.scroller.clientHeight-En(e)-e.display.barHeight}function Tn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var o=0;o<e.rest.length;o++)if(Ye(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function Nn(e,t,n,r){return Pn(e,Dn(e,t),n,r)}function jn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Dn(e,t){var n=Ye(t),r=jn(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,ir(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){t=Wt(t);var n=Ye(t),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var o=r.built=Zt(e,r);return r.text=o.pre,M(e.display.lineMeasure,o.pre),r}(e,t));var o=Tn(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Pn(e,t,n,r,o){t.before&&(n=-1);var i,l=n+(r||"");return t.cache.hasOwnProperty(l)?i=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,o=r&&Ln(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),i=function(e,t,n,r){var o,i=Rn(t.map,n,r),l=i.node,c=i.start,u=i.end,f=i.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&re(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&re(t.line.text.charAt(i.coverStart+u));)++u;if(o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():In(k(l,c,u).getClientRects(),r),o.left||o.right||0==c)break;u=c,c-=1,f="right"}a&&s<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ae)return Ae;var t=M(e,T("span","x")),n=t.getBoundingClientRect(),r=k(t,0,1).getBoundingClientRect();return Ae=Math.abs(n.left-r.left)>1}(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}}(e.display.measure,o))}else{var p;c>0&&(f=r="right"),o=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+or(e.display),top:h.top,bottom:h.bottom}:_n}for(var m=o.top-t.rect.top,v=o.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==f?o.right:o.left)-t.rect.left,right:("left"==f?o.left:o.right)-t.rect.left,top:w,bottom:x};return o.left||o.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=v),C}(e,t,n,r),i.bogus||(t.cache[l]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var An,_n={left:0,right:0,top:0,bottom:0};function Rn(e,t,n){for(var r,o,i,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(o=0,i=1,a="left"):t<l?(o=t-s,i=o+1):(c==e.length-3||t==l&&e[c+3]>t)&&(i=l-s,o=i-1,t>=l&&(a="right")),null!=o){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&o==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function In(e,t){var n=_n;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var o=e.length-1;o>=0&&(n=e[o]).left==n.right;o--);return n}function Wn(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 Hn(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Wn(e.display.view[t])}function Fn(e){Hn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function zn(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bn(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=xn(e.widgets[n]));return t}function Vn(e,t,n,r,o){if(!o){var i=Un(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var a=Ut(t);if("local"==r?a+=On(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Bn());var l=s.left+("window"==r?0:zn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Gn(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=zn(),o-=Bn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:o-a.top}}function Kn(e,t,n,r,o){return r||(r=Ke(e.doc,t.line)),Vn(e,r,Nn(e,r,t.ch,o),n)}function qn(e,t,n,r,o,i){function a(t,a){var s=Pn(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,Vn(e,r,s,n)}r=r||Ke(e.doc,t.line),o||(o=Dn(e,r));var s=ce(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=s[t],o=1==r.level;return a(n?e-1:e,o!=n)}var f=se(s,l,c),d=ae,p=u(l,f,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function $n(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=or(e.display)*t.ch);var r=Ke(e.doc,t.line),o=Ut(r)+On(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Xn(e,t,n,r,o){var i=et(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Yn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Xn(r.first,0,null,-1,-1);var o=Ze(r,n),i=r.first+r.size-1;if(o>i)return Xn(r.first+r.size-1,Ke(r,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(r,o);;){var s=er(e,a,o,t,n),l=Rt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=Ke(r,o=c.line)}}function Zn(e,t,n,r){r-=Un(t);var o=t.text.length,i=ie((function(t){return Pn(e,n,t-1).bottom<=r}),o,0);return o=ie((function(t){return Pn(e,n,t).top>r}),i,o),{begin:i,end:o}}function Qn(e,t,n,r){n||(n=Dn(e,t));var o=Vn(e,t,Pn(e,n,r),"line").top;return Zn(e,t,n,o)}function Jn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,o){o-=Ut(t);var i=Dn(e,t),a=Un(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?nr:tr)(e,t,n,i,u,r,o);c=1!=f.level,s=c?f.from:f.to-1,l=c?f.to:f.from-1}var d,p,h=null,m=null,v=ie((function(t){var n=Pn(e,i,t);return n.top+=a,n.bottom+=a,!!Jn(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,m=n),!0)}),s,l),g=!1;if(m){var y=r-m.left<m.right-r,b=y==c;v=h+(b?0:1),p=b?"after":"before",d=y?m.left:m.right}else{c||v!=l&&v!=s||v++,p=0==v?"after":v==t.text.length?"before":Pn(e,i,v-(c?1:0)).bottom+a<=o==c?"after":"before";var w=qn(e,et(n,v,p),"line",t,i);d=w.left,g=o<w.top?-1:o>=w.bottom?1:0}return v=oe(t.text,v,1),Xn(n,v,p,g,r-d)}function tr(e,t,n,r,o,i,a){var s=ie((function(s){var l=o[s],c=1!=l.level;return Jn(qn(e,et(n,c?l.to:l.from,c?"before":"after"),"line",t,r),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=qn(e,et(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Jn(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function nr(e,t,n,r,o,i,a){var s=Zn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,d=0;d<o.length;d++){var p=o[d];if(!(p.from>=c||p.to<=l)){var h=1!=p.level,m=Pn(e,r,h?Math.min(c,p.to)-1:Math.max(l,p.from)).right,v=m<i?i-m+1e9:m-i;(!u||f>v)&&(u=p,f=v)}}return u||(u=o[o.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==An){An=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)An.appendChild(document.createTextNode("x")),An.appendChild(T("br"));An.appendChild(document.createTextNode("x"))}M(e.measure,An);var n=An.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),L(e.measure),n||1}function or(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");M(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function ir(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+o,r[s]=i.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/or(e.display)-3);return function(o){if(zt(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return n?i+(Math.ceil(o.text.length/r)||1)*t:i+t}}function lr(e){var t=e.doc,n=sr(e);t.iter((function(e){var t=n(e);t!=e.height&&Xe(e,t)}))}function cr(e,t,n,r){var o=e.display;if(!n&&"true"==Oe(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(f){return null}var l,c=Yn(e,i,a);if(r&&c.xRel>0&&(l=Ke(e.doc,c.line).text).length==c.ch){var u=W(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((i-kn(e.display).left)/or(e.display))-u))}return c}function ur(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 fr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Ct&&Ht(e.doc,t)<o.viewTo&&pr(e);else if(n<=o.viewFrom)Ct&&Ft(e.doc,n+r)>o.viewFrom?pr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)pr(e);else if(t<=o.viewFrom){var i=hr(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):pr(e)}else if(n>=o.viewTo){var a=hr(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):pr(e)}else{var s=hr(e,t,t,-1),l=hr(e,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):pr(e)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(o.externalMeasured=null))}function dr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var i=r.view[ur(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==F(a,n)&&a.push(n)}}}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,n,r){var o,i=ur(e,t),a=e.display.view;if(!Ct||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(;Ht(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 mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var o=t[r];o.hidden||o.node&&!o.changes||++n}return n}function vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function gr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var c=l.empty();if(a){var u=a(e,l);u&&yr(e,u,o)}else(c||e.options.showCursorWhenSelecting)&&yr(e,l.head,o);c||wr(e,l,i)}}return r}function yr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(T("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var i=Kn(e,t,"div",null,null),a=i.right-i.left;o.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function wr(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),a=kn(e.display),s=a.left,l=Math.max(r.sizerWidth,Ln(e)-r.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,r){var i,a,f=Ke(o,t),d=f.text.length;function p(n,r){return Kn(e,et(t,n),"div",f,r)}function h(t,n,r){var o=Qn(e,f,null,t),i="ltr"==n==("after"==r)?"left":"right",a="after"==r?o.begin:o.end-(/\s/.test(f.text.charAt(o.end-1))?2:1);return p(a,i)[i]}var m=ce(f,o.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,o,f){var v="ltr"==o,g=p(e,v?"left":"right"),y=p(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==d,x=0==f,C=!m||f==m.length-1;if(y.top-g.top<=3){var O=(c?b:w)&&x,S=(c?w:b)&&C,k=O?s:(v?g:y).left,E=S?l:(v?y:g).right;u(k,g.top,E-k,g.bottom)}else{var L,M,T,N;v?(L=c&&b&&x?s:g.left,M=c?l:h(e,o,"before"),T=c?s:h(t,o,"after"),N=c&&w&&C?l:y.right):(L=c?h(e,o,"before"):s,M=!c&&b&&x?l:g.right,T=!c&&w&&C?s:y.left,N=c?h(t,o,"after"):l),u(L,g.top,M-L,g.bottom),g.bottom<y.top&&u(s,g.bottom,null,y.top),u(T,y.top,N-T,y.bottom)}(!i||br(g,i)<0)&&(i=g),br(y,i)<0&&(i=y),(!a||br(g,a)<0)&&(a=g),br(y,a)<0&&(a=y)})),{start:i,end:a}}var d=t.from(),p=t.to();if(d.line==p.line)f(d.line,d.ch,p.ch);else{var h=Ke(o,d.line),m=Ke(o,p.line),v=Wt(h)==Wt(m),g=f(d.line,d.ch,v?h.text.length+1:null).end,y=f(p.line,v?0:null,p.ch).start;v&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(s,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(s,g.bottom,null,y.top)}n.appendChild(i)}function xr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Sr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&kr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Er(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,i=0,l=0;l<t.view.length;l++){var c=t.view[l],u=e.options.lineWrapping,f=void 0,d=0;if(!c.hidden){if(o+=c.line.height,a&&s<8){var p=c.node.offsetTop+c.node.offsetHeight;f=p-n,n=p}else{var h=c.node.getBoundingClientRect();f=h.bottom-h.top,!u&&c.text.firstChild&&(d=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var m=c.line.height-f;if((m>.005||m<-.005)&&(o<r&&(i-=m),Xe(c.line,f),Lr(c.line),c.rest))for(var v=0;v<c.rest.length;v++)Lr(c.rest[v]);if(d>e.display.sizerWidth){var g=Math.ceil(d/or(e.display));g>e.display.maxLineLength&&(e.display.maxLineLength=g,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function Lr(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 Mr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-On(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=Ze(t,r),a=Ze(t,o);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=Ze(t,Ut(Ke(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=Ze(t,Ut(Ke(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Tr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Mn(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+Sn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?s:t.bottom)-i);u!=o&&(a.scrollTop=u)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,p=Ln(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left+f-(h?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function Nr(e,t){null!=t&&(Pr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function jr(e){Pr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dr(e,t,n){null==t&&null==n||Pr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Pr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$n(e,t.from),r=$n(e,t.to);Ar(e,n,r,t.margin)}}function Ar(e,t,n,r){var o=Tr(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});Dr(e,o.scrollLeft,o.scrollTop)}function _r(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||lo(e,{top:t}),Rr(e,t,!0),n&&lo(e),ro(e,100))}function Rr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ir(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Wr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(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+En(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Hr=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hr.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 o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Hr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hr.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Hr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var o=e.getBoundingClientRect(),i="vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Hr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fr=function(){};function zr(e,t){t||(t=Wr(e));var n=e.display.barWidth,r=e.display.barHeight;Br(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Er(e),Br(e,Wr(e)),n=e.display.barWidth,r=e.display.barHeight}function Br(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=""}Fr.prototype.update=function(){return{bottom:0,right:0}},Fr.prototype.setScrollLeft=function(){},Fr.prototype.setScrollTop=function(){},Fr.prototype.clear=function(){};var Ur={native:Hr,null:Fr};function Vr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ur[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Ir(e,t):_r(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Gr=0;function Kr(e){var t;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:++Gr,markArrays:null},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(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 o=e.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)$r(t[n]);for(var r=0;r<t.length;r++)Xr(t[r]);for(var o=0;o<t.length;o++)Yr(t[o]);for(var i=0;i<t.length;i++)Zr(t[i]);for(var a=0;a<t.length;a++)Qr(t[a])}(e)}))}function $r(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=En(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=En(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Gt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xr(e){e.updatedDisplay=e.mustUpdate&&ao(e.cm,e.update)}function Yr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Er(t),e.barMeasure=Wr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Nn(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+En(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ln(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&zr(t,e.barMeasure),e.updatedDisplay&&uo(t,e.barMeasure),e.selectionChanged&&xr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Cr(e.cm)}function Qr(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&so(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Rr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Ir(t,e.scrollLeft,!0,!0),e.scrollToPos){var o=function(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var a=!1,s=qn(e,t),l=n&&n!=t?qn(e,n):s;o={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 c=Tr(e,o),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(_r(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Ir(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return o}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=T("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-On(e.display))+"px;\n height: "+(t.bottom-t.top+En(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,o)}var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var s=0;s<i.length;++s)i[s].lines.length||he(i[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&he(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Jr(e,t){if(e.curOp)return t();Kr(e);try{return t()}finally{qr(e)}}function eo(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Kr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function to(e){return function(){if(this.curOp)return e.apply(this,arguments);Kr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function no(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Kr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function ro(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(oo,e))}function oo(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(r.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?Be(t.mode,r.state):null,l=ft(e,i,r,!0);s&&(r.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&d<a.length;++d)f=a[d]!=i.styles[d];f&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ht(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ro(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Jr(e,(function(){for(var t=0;t<o.length;t++)dr(e,o[t],"text")}))}}var io=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Mr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ln(e),this.force=n,this.dims=ir(e),this.events=[]};function ao(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return pr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;po(e)&&(pr(e),t.dims=ir(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFrom<i&&i-n.viewFrom<20&&(i=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),Ct&&(i=Ht(e.doc,i),a=Ft(e.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display,o=r.view;0==o.length||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(ur(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,ur(e,n)))),r.viewTo=n}(e,i,a),n.viewOffset=Ut(Ke(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mr(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!j(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&j(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,a=i.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,f=0;f<c.length;f++){var d=c[f];if(d.hidden);else if(d.node&&d.node.parentNode==i){for(;a!=d.node;)a=s(a);var p=o&&null!=t&&t<=u&&d.lineNumber;d.changes&&(F(d.changes,"gutter")>-1&&(p=!1),un(e,d,u,n)),p&&(L(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Je(e.options,u)))),a=d.node.nextSibling}else{var h=gn(e,d,u,n);i.insertBefore(h,a)}u+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&j(document.body,e.anchorNode)&&j(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)}}(u),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ro(e,400)),n.updateLineNumbers=null,!0}function so(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ln(e))r&&(t.visible=Mr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Mn(e),n.top)}),t.visible=Mr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ao(e,t))break;Er(e);var o=Wr(e);vr(e),zr(e,o),uo(e,o),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 lo(e,t){var n=new io(e,t);if(ao(e,n)){Er(e),so(e,n);var r=Wr(e);vr(e),zr(e,r),uo(e,r),n.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ln(e,"gutterChanged",e)}function uo(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+En(e)+"px"}function fo(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=i),n[a].gutterBackground&&(n[a].gutterBackground.style.left=i));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=r+o+"px")}}function po(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Je(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",co(e.display),!0}return!1}function ho(e,t){for(var n=[],r=!1,o=0;o<e.length;o++){var i=e[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;r=!0}n.push({className:i,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function mo(e){var t=e.gutters,n=e.gutterSpecs;L(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,a=o.style,s=t.appendChild(T("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",co(e)}function vo(e){mo(e.display),fr(e),fo(e)}function go(e,t,r,o){var i=this;this.input=r,i.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=N("div",null,"CodeMirror-code"),i.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=T("div",null,"CodeMirror-cursors"),i.measure=T("div",null,"CodeMirror-measure"),i.lineMeasure=T("div",null,"CodeMirror-measure"),i.lineSpace=N("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=N("div",[i.lineSpace],"CodeMirror-lines");i.mover=T("div",[c],null,"position: relative"),i.sizer=T("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),i.gutters=T("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=T("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=T("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),i.wrapper.setAttribute("translate","no"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&g||(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=ho(o.gutters,o.lineNumbers),mo(i),r.init(i)}io.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var yo=0,bo=null;function wo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function xo(e){var t=wo(e);return t.x*=bo,t.y*=bo,t}function Co(e,t){var r=wo(t),o=r.x,i=r.y,a=bo;0===t.deltaMode&&(o=t.deltaX,i=t.deltaY,a=1);var s=e.display,c=s.scroller,u=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight;if(o&&u||i&&d){if(i&&y&&l)e:for(var p=t.target,h=s.view;p!=c;p=p.parentNode)for(var m=0;m<h.length;m++)if(h[m].node==p){e.display.currentWheelTarget=p;break e}if(o&&!n&&!f&&null!=a)return i&&d&&_r(e,Math.max(0,c.scrollTop+i*a)),Ir(e,Math.max(0,c.scrollLeft+o*a)),(!i||i&&d)&&be(t),void(s.wheelStartX=null);if(i&&null!=a){var v=i*a,g=e.doc.scrollTop,b=g+s.wrapper.clientHeight;v<0?g=Math.max(0,g+v-50):b=Math.min(e.doc.height,b+v+50),lo(e,{top:g,bottom:b})}yo<20&&0!==t.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=o,s.wheelDY=i,setTimeout((function(){if(null!=s.wheelStartX){var e=c.scrollLeft-s.wheelStartX,t=c.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(bo=(bo*yo+n)/(yo+1),++yo)}}),200)):(s.wheelDX+=o,s.wheelDY+=i))}}a?bo=-.53:n?bo=15:u?bo=-.7:d&&(bo=-1/3);var Oo=function(e,t){this.ranges=e,this.primIndex=t};Oo.prototype.primary=function(){return this.ranges[this.primIndex]},Oo.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(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},Oo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new So(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new Oo(e,this.primIndex)},Oo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Oo.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var So=function(e,t){this.anchor=e,this.head=t};function ko(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=F(t,o);for(var i=1;i<t.length;i++){var a=t[i],s=t[i-1],l=tt(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=it(s.from(),a.from()),u=ot(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,t.splice(--i,2,new So(f?u:c,f?c:u))}}return new Oo(t,n)}function Eo(e,t){return new Oo([new So(e,t||e)],0)}function Lo(e){return e.text?et(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Mo(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Lo(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+=Lo(t).ch-t.to.ch),et(n,r)}function To(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new So(Mo(o.anchor,t),Mo(o.head,t)))}return ko(e.cm,n,e.sel.primIndex)}function No(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function jo(e){e.doc.mode=He(e.options,e.doc.modeOption),Do(e)}function Do(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ro(e,100),e.state.modeGen++,e.curOp&&fr(e)}function Po(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ao(e,t,n,r){function o(e){return n?n[e]:null}function i(e,n,o){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Mt(e),Tt(e,n);var o=r?r(e):1;o!=e.height&&Xe(e,o)}(e,n,o,r),ln(e,"change",e,t)}function a(e,t){for(var n=[],i=e;i<t;++i)n.push(new Kt(c[i],o(i),r));return n}var s=t.from,l=t.to,c=t.text,u=Ke(e,s.line),f=Ke(e,l.line),d=$(c),p=o(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Po(e,t)){var m=a(0,c.length-1);i(f,f.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(u==f)if(1==c.length)i(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),p);else{var v=a(1,c.length-1);v.push(new Kt(d+u.text.slice(l.ch),p,r)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,v)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),o(0)),e.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(f,d+f.text.slice(l.ch),p);var g=a(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}ln(e,"change",e,t)}function _o(e,t,n){!function e(r,o,i){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Ro(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,lr(e),jo(e),Io(e),e.options.direction=t.direction,e.options.lineWrapping||Gt(e),e.options.mode=t.modeOption,fr(e)}function Io(e){("rtl"==e.doc.direction?P:E)(e.display.lineDiv,"CodeMirror-rtl")}function Wo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ho(e,t){var n={from:rt(t.from),to:Lo(t),text:qe(e,t.from,t.to)};return Vo(e,n,t.from.line,t.to.line+1),_o(e,(function(e){return Vo(e,n,t.from.line,t.to.line+1)}),!0),n}function Fo(e){for(;e.length;){var t=$(e);if(!t.ranges)break;e.pop()}}function zo(e,t,n,r){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Fo(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(o,o.lastOp==r)))a=$(i.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Lo(t):i.changes.push(Ho(e,t));else{var l=$(o.done);for(l&&l.ranges||Uo(e.sel,o.done),i={changes:[Ho(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,a||he(e,"historyAdded")}function Bo(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,$(o.done),t))?o.done[o.done.length-1]=t:Uo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&Fo(o.undone)}function Uo(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vo(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i}))}function Go(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 Ko(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],o=0;o<t.text.length;++o)r.push(Go(n[o]));return r}(e,t),r=Et(e,t);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],a=r[o];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue e;i.push(l)}else a&&(n[o]=a)}return n}function qo(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)r.push(n?Oo.prototype.deepCopy.call(i):i);else{var a=i.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&F(t,Number(u[1]))>-1&&($(s)[f]=c[f],delete c[f])}}}return r}function $o(e,t,n,r){if(r){var o=e.anchor;if(n){var i=tt(t,o)<0;i!=tt(n,o)<0?(o=t,t=n):i!=tt(t,n)<0&&(t=n)}return new So(o,t)}return new So(n||t,t)}function Xo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ei(e,new Oo([$o(e.sel.primary(),t,n,o)],0),r)}function Yo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)r[i]=$o(e.sel.ranges[i],t[i],null,o);var a=ko(e.cm,r,e.sel.primIndex);ei(e,a,n)}function Zo(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,ei(e,ko(e.cm,o,e.sel.primIndex),r)}function Qo(e,t,n,r){ei(e,Eo(t,n),r)}function Jo(e,t,n){var r=e.history.done,o=$(r);o&&o.ranges?(r[r.length-1]=t,ti(e,t,n)):ei(e,t,n)}function ei(e,t,n){ti(e,t,n),Bo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ti(e,t,n){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new So(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return he(e,"beforeSelectionChange",e,r),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ko(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ni(e,oi(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||jr(e.cm)}function ni(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),ln(e,"cursorActivity",e))}function ri(e){ni(e,oi(e,e.sel,null,!1))}function oi(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=ai(e,a.anchor,s&&s.anchor,n,r),c=ai(e,a.head,s&&s.head,n,r);(o||l!=a.anchor||c!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new So(l,c))}return o?ko(e.cm,o,t.primIndex):t}function ii(e,t,n,r,o){var i=Ke(e,t.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(o&&(he(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(f=si(e,f,-r,f&&f.line==t.line?i:null)),f&&f.line==t.line&&(d=tt(f,n))&&(r<0?d<0:d>0))return ii(e,f,t,r,o)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=si(e,p,r,p.line==t.line?i:null)),p?ii(e,p,t,r,o):null}}return t}function ai(e,t,n,r,o){var i=r||1,a=ii(e,t,n,i,o)||!o&&ii(e,t,n,i,!0)||ii(e,t,n,-i,o)||!o&&ii(e,t,n,-i,!0);return a||(e.cantEdit=!0,et(e.first,0))}function si(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||Ke(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function li(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),B)}function ci(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(t,n,o,i){t&&(r.from=st(e,t)),n&&(r.to=st(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),he(e,"beforeChange",e,r),e.cm&&he(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 ui(e,t,n){if(e.cm){if(!e.cm.curOp)return eo(e.cm,ui)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))||(t=ci(e,t,!0),t)){var r=xt&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=F(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:t,to:n}],i=0;i<r.length;++i)for(var a=r[i],s=a.find(0),l=0;l<o.length;++l){var c=o[l];if(!(tt(c.to,s.from)<0||tt(c.from,s.to)>0)){var u=[l,1],f=tt(c.from,s.from),d=tt(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)fi(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else fi(e,t)}}function fi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=To(e,t);zo(e,t,n,e.cm?e.cm.curOp.id:NaN),hi(e,t,n,Et(e,t));var r=[];_o(e,(function(e,n){n||-1!=F(r,e.history)||(yi(e.history,t),r.push(e.history)),hi(e,t,null,Et(e,t))}))}}function di(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,c=0;c<s.length&&(o=s[c],n?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(o=s.pop(),!o.ranges){if(r)return void s.push(o);break}if(Uo(o,l),n&&!o.equals(e.sel))return void ei(e,o,{clearRedo:!1});a=o}var u=[];Uo(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var f=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),d=function(n){var r=o.changes[n];if(r.origin=t,f&&!ci(e,r,!1))return s.length=0,{};u.push(Ho(e,r));var i=n?To(e,r):$(s);hi(e,r,i,Ko(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Lo(r)});var a=[];_o(e,(function(e,t){t||-1!=F(a,e.history)||(yi(e.history,r),a.push(e.history)),hi(e,r,null,Ko(e,r))}))},p=o.changes.length-1;p>=0;--p){var h=d(p);if(h)return h.v}}}}function pi(e,t){if(0!=t&&(e.first+=t,e.sel=new Oo(X(e.sel.ranges,(function(e){return new So(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(e.cm,r,"gutter")}}function hi(e,t,n,r){if(e.cm&&!e.cm.curOp)return eo(e.cm,hi)(e,t,n,r);if(t.to.line<e.first)pi(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);pi(e,o),t={from:et(e.first,0),to:et(t.to.line+o,t.to.ch),text:[$(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:et(i,Ke(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=To(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Ye(Wt(Ke(r,i.line))),r.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ve(e),Ao(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(l,i.line+t.text.length,(function(e){var t=Vt(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var o=Ke(e,r).stateAfter;if(o&&(!(o instanceof ct)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,i.line),ro(e,400);var c=t.text.length-(a.line-i.line)-1;t.full?fr(e):i.line!=a.line||1!=t.text.length||Po(e.doc,t)?fr(e,i.line,a.line+1,c):dr(e,i.line,"text");var u=ge(e,"changes"),f=ge(e,"change");if(f||u){var d={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&ln(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):Ao(e,t,r),ti(e,n,B),e.cantEdit&&ai(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mi(e,t,n,r,o){var i;r||(r=n),tt(r,n)<0&&(i=[r,n],n=i[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ui(e,{from:n,to:r,text:t,origin:o})}function vi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function gi(e,t,n,r){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||(i=e[o]=i.deepCopy(),i.copied=!0);for(var s=0;s<i.ranges.length;s++)vi(i.ranges[s].anchor,t,n,r),vi(i.ranges[s].head,t,n,r)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function yi(e,t){var n=t.from.line,r=t.to.line,o=t.text.length-(r-n)-1;gi(e.done,n,r,o),gi(e.undone,n,r,o)}function bi(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=Ke(e,at(e,t)):o=Ye(t),null==o?null:(r(i,o)&&e.cm&&dr(e.cm,o,n),i)}function wi(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}function xi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}So.prototype.from=function(){return it(this.anchor,this.head)},So.prototype.to=function(){return ot(this.anchor,this.head)},So.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var o=this.lines[n];this.height-=o.height,qt(o),ln(o,"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}},xi.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],o=r.chunkSize();if(e<o){var i=Math.min(t,o-e),a=r.height;if(r.removeInner(e,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wi))){var s=[];this.collapse(s),this.children=[new wi(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 o=this.children[r],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new wi(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++r,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new xi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=F(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var o=new xi(e.children);o.parent=e,e.children=[o,n],e=o}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 o=this.children[r],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var Ci=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Oi(e,t,n){Ut(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Nr(e,n)}Ci.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ye(n);if(null!=r&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(n.widgets=null);var i=xn(this);Xe(n,Math.max(0,n.height-i)),e&&(Jr(e,(function(){Oi(e,n,-i),dr(e,r,"widget")})),ln(e,"lineWidgetCleared",e,this,r))}},Ci.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=xn(this)-t;o&&(zt(this.doc,r)||Xe(r,r.height+o),n&&Jr(n,(function(){n.curOp.forceUpdate=!0,Oi(n,r,o),ln(n,"lineWidgetChanged",n,e,Ye(r))})))},ye(Ci);var Si=0,ki=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Si};function Ei(e,t,n,r,o){if(r&&r.shared)return function(e,t,n,r,o){r=I(r),r.shared=!1;var i=[Ei(e,t,n,r,o)],a=i[0],s=r.widgetNode;return _o(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),i.push(Ei(e,st(e,t),st(e,n),r,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=$(i)})),new Li(i,a)}(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return eo(e.cm,Ei)(e,t,n,r,o);var i=new ki(e,o),a=tt(t,n);if(r&&I(r,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=N("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(It(e,t.line,t,n,i)||t.line!=n.line&&It(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}i.addToHistory&&zo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&Wt(r)==c.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Xe(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new Ot(i,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){zt(e,t)&&Xe(t,0)})),i.clearOnEnter&&fe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Si,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)fr(c,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=n.line;u++)dr(c,u,"text");i.atomic&&ri(c.doc),ln(c,"markerAdded",c,i)}return i}ki.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kr(e),ge(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=St(a.markedSpans,this);e&&!this.collapsed?dr(e,Ye(a),"text"):e&&(null!=s.to&&(o=Ye(a)),null!=s.from&&(r=Ye(a))),a.markedSpans=kt(a.markedSpans,s),null==s.from&&this.collapsed&&!zt(this.doc,a)&&e&&Xe(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Wt(this.lines[l]),u=Vt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&fr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ri(e.doc)),e&&ln(e,"markerCleared",e,this,r,o),t&&qr(e),this.parent&&this.parent.clear()}},ki.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=St(i.markedSpans,this);if(null!=a.from&&(n=et(t?i:Ye(i),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?i:Ye(i),a.to),1==e))return r}return n&&{from:n,to:r}},ki.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Jr(r,(function(){var o=t.line,i=Ye(t.line),a=jn(r,i);if(a&&(Wn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!zt(n.doc,o)&&null!=n.height){var s=n.height;n.height=null;var l=xn(n)-s;l&&Xe(o,o.height+l)}ln(r,"markerChanged",r,e)}))},ki.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=F(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ki.prototype.detachLine=function(e){if(this.lines.splice(F(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(ki);var Li=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Mi(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ti(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];_o(n.primary.doc,(function(e){return r.push(e)}));for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==F(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}Li.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},Li.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Li);var Ni=0,ji=function(e,t,n,r,o){if(!(this instanceof ji))return new ji(e,t,n,r,o);null==n&&(n=0),xi.call(this,[new wi([new Kt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=et(n,0);this.sel=Eo(i),this.history=new Wo(null),this.id=++Ni,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ao(this,{from:i,to:i,text:e}),ei(this,Eo(i),B)};ji.prototype=Z(xi.prototype,{constructor:ji,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=$e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:no((function(e){var t=et(this.first,0),n=this.first+this.size-1;ui(this,{from:t,to:et(n,Ke(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Dr(this.cm,0,0),ei(this,Eo(t),B)})),replaceRange:function(e,t,n,r){t=st(this,t),n=n?st(this,n):t,mi(this,e,t,n,r)},getRange:function(e,t,n){var r=qe(this,st(this,e),st(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ke(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ke(this,e)),Wt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||!1===e?n.to():n.from(),t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:no((function(e,t,n){Qo(this,st(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:no((function(e,t,n){Qo(this,st(this,e),st(this,t||e),n)})),extendSelection:no((function(e,t,n){Xo(this,st(this,e),t&&st(this,t),n)})),extendSelections:no((function(e,t){Yo(this,lt(this,e),t)})),extendSelectionsBy:no((function(e,t){var n=X(this.sel.ranges,e);Yo(this,lt(this,n),t)})),setSelections:no((function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new So(st(this,e[o].anchor),st(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ei(this,ko(this.cm,r,t),n)}})),addSelection:no((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new So(st(this,e),st(this,t||e))),ei(this,ko(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=qe(this,n[r].from(),n[r].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[r]=o}return t},replaceSelection:function(e,t,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:no((function(e,t,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];r[i]={from:a.from(),to:a.to(),text:this.splitLines(e[i]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],o=et(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=No(s.from,o,i),c=No(Lo(s),o,i);if(o=s.to,i=c,"around"==n){var u=e.sel.ranges[a],f=tt(u.head,u.anchor)<0;r[a]=new So(f?c:l,f?l:c)}else r[a]=new So(l,l)}return new Oo(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)ui(this,r[l]);s?Jo(this,s):this.cm&&jr(this.cm)})),undo:no((function(){di(this,"undo")})),redo:no((function(){di(this,"redo")})),undoSelection:no((function(){di(this,"undo",!0)})),redoSelection:no((function(){di(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 o=0;o<e.undone.length;o++)e.undone[o].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Wo(this.history),_o(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:qo(this.history.done),undone:qo(this.history.undone)}},setHistory:function(e){var t=this.history=new Wo(this.history);t.done=qo(e.done.slice(0),null,!0),t.undone=qo(e.undone.slice(0),null,!0)},setGutterMarker:no((function(e,t,n){return bi(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:no((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bi(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,e=Ke(this,e),!e)return null}else if(t=Ye(e),null==t)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:no((function(e,t,n){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:no((function(e,t,n){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==n)e[r]=null;else{var i=o.match(S(n));if(!i)return!1;var a=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:no((function(e,t,n){return function(e,t,n,r){var o=new Ci(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),bi(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!zt(e,t)){var r=Ut(t)<e.scrollTop;Xe(t,t.height+xn(o)),r&&Nr(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&ln(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Ye(t)),o}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ei(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=st(this,e),Ei(this,e,e,n,"bookmark")},findMarksAt:function(e){e=st(this,e);var t=[],n=Ke(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+r;if(i>e)return t=e,!0;e-=i,++n})),st(this,et(n,t))},indexFromPos:function(e){e=st(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(e){t+=e.text.length+n})),t},copy:function(e){var t=new ji($e(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;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new ji($e(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}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],o=r.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(tt(i,a)){var s=Ei(e,i,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Mi(this)),r},unlinkDoc:function(e){if(e instanceof La&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ti(Mi(this));break}}if(e.history==this.history){var r=[e.id];_o(e,(function(e){return r.push(e.id)}),!0),e.history=new Wo(null),e.history.done=qo(this.history.done,r),e.history.undone=qo(this.history.undone,r)}},iterLinkedDocs:function(e){_o(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):je(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:no((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&(t=this.cm,Jr(t,(function(){Io(t),fr(t)}))))}))}),ji.prototype.eachLine=ji.prototype.iter;var Di=0;function Pi(e){var t=this;if(Ai(t),!me(t,e)&&!Cn(t.display,e)){be(e),a&&(Di=+new Date);var n=cr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),s=0,l=function(){++s==o&&eo(t,(function(){n=st(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ui(t.doc,e),Jo(t.doc,Eo(st(t.doc,n),st(t.doc,Lo(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==F(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),ti(t.doc,Eo(n,n)),d)for(var p=0;p<d.length;++p)mi(t.doc,"",d[p].anchor,d[p].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(h){}}}}function Ai(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _i(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var o=t[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Ri=!1;function Ii(){var e;Ri||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_i(Wi)}),100))})),fe(window,"blur",(function(){return _i(kr)})),Ri=!0)}function Wi(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Hi={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"},Fi=0;Fi<10;Fi++)Hi[Fi+48]=Hi[Fi+96]=String(Fi);for(var zi=65;zi<=90;zi++)Hi[zi]=String.fromCharCode(zi);for(var Bi=1;Bi<=12;Bi++)Hi[Bi+111]=Hi[Bi+63235]="F"+Bi;var Ui={};function Vi(e){var t,n,r,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Gi(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 o=X(n.split(" "),Vi),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=r):(s=o.slice(0,i+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Ki(e,t,n,r){t=Yi(t);var o=t.call?t.call(e,r):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ki(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var a=Ki(e,t.fallthrough[i],n,r);if(a)return a}}}function qi(e){var t="string"==typeof e?e:Hi[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $i(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Xi(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Hi[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),$i(n,e,t))}function Yi(e){return"string"==typeof e?Ui[e]:e}function Zi(e,t){for(var n=e.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=t(n[o]);r.length&&tt(i.from,$(r).to)<=0;){var a=r.pop();if(tt(a.from,i.from)<0){i.from=a.from;break}}r.push(i)}Jr(e,(function(){for(var t=r.length-1;t>=0;t--)mi(e.doc,"",r[t].from,r[t].to,"+delete");jr(e)}))}function Qi(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ji(e,t,n){var r=Qi(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(n,t.doc.direction);if(i){var a,s=o<0?$(i):i[0],l=o<0==(1==s.level),c=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Dn(t,n);a=o<0?n.text.length-1:0;var f=Pn(t,u,a).top;a=ie((function(e){return Pn(t,u,e).top==f}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Qi(n,a,1))}else a=o<0?s.to:s.from;return new et(r,a,c)}}return new et(r,o<0?n.text.length:0,o<0?"before":"after")}Ui.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"},Ui.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"},Ui.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ui.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"]},Ui.default=y?Ui.macDefault:Ui.pcDefault;var ta={selectAll:li,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),B)},killLine:function(e){return Zi(e,(function(t){if(t.empty()){var n=Ke(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zi(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zi(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zi(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 Zi(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(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ke(e.doc,t),r=function(e){for(var t;t=_t(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Ye(r)),ea(!0,e,n,t,-1)}(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")}),V)},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")}),V)},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/)?ra(e,t.head):r}),V)},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("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),a=W(e.getLine(i.line),i.ch,r);t.push(q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Jr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=Ke(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new et(o.line,o.ch-1)),o.ch>0)o=new et(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ke(e.doc,o.line-1).text;a&&(o=new et(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(o.line-1,a.length-1),o,"+transpose"))}n.push(new So(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return Jr(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);jr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ke(e.doc,t),r=Wt(n);return r!=n&&(t=Ye(r)),ea(!0,e,r,t,1)}function ra(e,t){var n=na(e,t.line),r=Ke(e.doc,n.line),o=ce(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=i&&t.ch;return et(n.line,a?0:i,n.sticky)}return n}function oa(e,t,n){if("string"==typeof t&&(t=ta[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=z}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}var ia=new H;function aa(e,t,n,r){var o=e.state.keySeq;if(o){if(qi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ia.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,o+" "+t,n,r))return!0}return sa(e,t,n,r)}function sa(e,t,n,r){var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=Ki(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&Ki(t,e.options.extraKeys,n,e)||Ki(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&ln(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(be(n),xr(e)),!!o}function la(e,t){var n=Xi(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return oa(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return oa(e,t)})):aa(e,n,t,(function(t){return oa(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=D(),me(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var o=la(t,e);f&&(ca=o?r:null,o||88!=r||Pe||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!o&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}P(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}(t)}}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Cn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==ca)return ca=null,void be(e);if(!f||e.which&&!(e.which<10)||!la(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return oa(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var pa,ha,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function va(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Cn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=cr(t,e),o=Se(e),i=r?function(e,t){var n=+new Date;return ha&&ha.compare(n,e,t)?(pa=ha=null,"triple"):pa&&pa.compare(n,e,t)?(ha=new ma(n,e,t),pa=null,"double"):(pa=new ma(n,e,t),ha=null,"single")}(r,o):"single";window.focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),i=(1==t?"Left":2==t?"Middle":"Right")+i,aa(e,$i(i,o),o,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=z}finally{e.state.suppressEdits=!1}return r}))}(t,o,r,i,e)||(1==o?r?function(e,t,n,r){a?setTimeout(R(Cr,e),0):e.curOp.focus=D();var o,i=function(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(null==o.unit){var i=b?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=y?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(y?n.altKey:n.ctrlKey)),o}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Le&&!e.isReadOnly()&&"single"==n&&(o=c.contains(t))>-1&&(tt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(tt(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,c=eo(e,(function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Or(e)),pe(o.wrapper.ownerDocument,"mouseup",c),pe(o.wrapper.ownerDocument,"mousemove",u),pe(o.scroller,"dragstart",f),pe(o.scroller,"drop",c),i||(be(t),r.addNew||Xo(e.doc,n,null,null,r.extend),l&&!d||a&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,fe(o.wrapper.ownerDocument,"mouseup",c),fe(o.wrapper.ownerDocument,"mousemove",u),fe(o.scroller,"dragstart",f),fe(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,r,t,i):function(e,t,n,r){a&&Or(e);var o=e.display,i=e.doc;be(t);var s,l,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=i.sel.contains(n),s=l>-1?u[l]:new So(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new So(n,n)),n=cr(e,t,!0,!0),l=-1;else{var f=ga(e,n,r.unit);s=r.extend?$o(s,f.anchor,f.head,r.extend):f}r.addNew?-1==l?(l=u.length,ei(i,ko(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(ei(i,ko(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Zo(i,l,s,U):(l=0,ei(i,new Oo([s],0),U),c=i.sel);var d=n;function p(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var o=[],a=e.options.tabSize,u=W(Ke(i,n.line).text,n.ch,a),f=W(Ke(i,t.line).text,t.ch,a),p=Math.min(u,f),h=Math.max(u,f),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Ke(i,m).text,y=G(g,p,a);p==h?o.push(new So(et(m,y),et(m,y))):g.length>y&&o.push(new So(et(m,y),et(m,G(g,h,a))))}o.length||o.push(new So(n,n)),ei(i,ko(e,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=ga(e,t,r.unit),C=w.anchor;tt(x.anchor,C)>0?(b=x.head,C=it(w.from(),x.anchor)):(b=x.anchor,C=ot(w.to(),x.head));var O=c.ranges.slice(0);O[l]=function(e,t){var n=t.anchor,r=t.head,o=Ke(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var i=ce(o);if(!i)return t;var a=se(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(i,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var d=i[c+(l?-1:0)],p=l==(1==d.level),h=p?d.from:d.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new So(new et(n.line,h,m),r)}(e,new So(st(i,C),b)),ei(i,ko(e,O,l),U)}}var h=o.wrapper.getBoundingClientRect(),m=0;function v(t){e.state.selectingText=!1,m=1/0,t&&(be(t),o.input.focus()),pe(o.wrapper.ownerDocument,"mousemove",g),pe(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var g=eo(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var a=++m,s=cr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=D(),p(s);var l=Mr(o,i);(s.line>=l.to||s.line<l.from)&&setTimeout(eo(e,(function(){m==a&&t(n)})),150)}else{var c=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;c&&setTimeout(eo(e,(function(){m==a&&(o.scroller.scrollTop+=c,t(n))})),50)}}(t):v(t)})),y=eo(e,v);e.state.selectingText=y,fe(o.wrapper.ownerDocument,"mousemove",g),fe(o.wrapper.ownerDocument,"mouseup",y)}(e,r,t,i)}(t,r,i,e):Oe(e)==n.scroller&&be(e):2==o?(r&&Xo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(O?t.display.input.onContextMenu(e):Or(t)))}}function ga(e,t,n){if("char"==n)return new So(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new So(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new So(r.from,r.to)}function ya(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(d){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ge(e,n))return xe(t);i-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o){var u=Ze(e.doc,i),f=e.display.gutterSpecs[l];return he(e,n,e,u,f.className,t),xe(t)}}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function wa(e,t){Cn(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||O||e.display.input.onContextMenu(t)}function xa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},Oa={},Sa={};function ka(e,t,n){var r=n&&n!=Ca;if(!t!=!r){var o=e.display.dragFunctions,i=t?fe:pe;i(e.display.scroller,"dragstart",o.start),i(e.display.scroller,"dragenter",o.enter),i(e.display.scroller,"dragover",o.over),i(e.display.scroller,"dragleave",o.leave),i(e.display.scroller,"drop",o.drop)}}function Ea(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Gt(e)),lr(e),fr(e),Fn(e),setTimeout((function(){return zr(e)}),100)}function La(e,t){var n=this;if(!(this instanceof La))return new La(e,t);this.options=t=t?I(t):{},I(Oa,t,!1);var r=t.value;"string"==typeof r?r=new ji(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new La.inputStyles[t.inputStyle](this),i=this.display=new go(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,xa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vr(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 H,keySeq:null,specialChars:null},t.autofocus&&!g&&i.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",eo(e,va)),fe(t.scroller,"dblclick",a&&s<11?eo(e,(function(t){if(!me(e,t)){var n=cr(e,t);if(n&&!ba(e,t)&&!Cn(e.display,t)){be(t);var r=e.findWordAt(n);Xo(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return wa(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||wa(e,n)}));var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),r=t.activeTouch,r.end=+new Date)}function i(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(o){if(!me(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!ba(e,o)){t.input.ensurePolled(),clearTimeout(n);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Cn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||i(r,r.prev)?new So(s,s):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(s):new So(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}o()})),fe(t.scroller,"touchcancel",o),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(_r(e,t.scroller.scrollTop),Ir(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return Co(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return Co(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||Ce(t)},over:function(t){me(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,r)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Di<100))Ce(t);else if(!me(e,t)&&!Cn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("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)}}(e,t)},drop:eo(e,Pi),leave:function(t){me(e,t)||Ai(e)}};var l=t.input.getField();fe(l,"keyup",(function(t){return fa.call(e,t)})),fe(l,"keydown",eo(e,ua)),fe(l,"keypress",eo(e,da)),fe(l,"focus",(function(t){return Sr(e,t)})),fe(l,"blur",(function(t){return kr(e,t)}))}(this),Ii(),Kr(this),this.curOp.forceUpdate=!0,Ro(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):kr(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](this,t[c],Ca);po(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Ma.length;++u)Ma[u](this);qr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}La.defaults=Oa,La.optionHandlers=Sa;var Ma=[];function Ta(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=pt(e,t).state:n="prev");var a=e.options.tabSize,s=Ke(i,t),l=W(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=i.mode.indent(o,s.text.slice(u.length),s.text),c==z||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>i.first?W(Ke(i,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+="\t";if(d<c&&(f+=q(c-d)),f!=u)return mi(i,f,et(t,0),et(t,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var m=i.sel.ranges[h];if(m.head.line==t&&m.head.ch<u.length){var v=et(t,u.length);Zo(i,h,new So(v,v));break}}}La.defineInitHook=function(e){return Ma.push(e)};var Na=null;function ja(e){Na=e}function Da(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var a=+new Date-200,s="paste"==o||e.state.pasteIncoming>a,l=je(t),c=null;if(s&&r.ranges.length>1)if(Na&&Na.text.join("\n")==t){if(r.ranges.length%Na.text.length==0){c=[];for(var u=0;u<Na.text.length;u++)c.push(i.splitLines(Na.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(l,(function(e){return[e]})));for(var f=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var p=r.ranges[d],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=et(h.line,h.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min(Ke(i,m.line).text.length,m.ch+$(l).length)):s&&Na&&Na.lineWise&&Na.text.join("\n")==l.join("\n")&&(h=m=et(h.line,0)));var v={from:h,to:m,text:c?c[d%c.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ui(e.doc,v),ln(e,"inputRead",e,v)}t&&!s&&Aa(e,t),jr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Pa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jr(t,(function(){return Da(t,n,0,null,"paste")})),!0}function Aa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=Ta(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ke(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Ta(e,o.head.line,"smart"));a&&ln(e,"electricInput",e,o.head.line)}}}function _a(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var o=e.doc.sel.ranges[r].head.line,i={anchor:et(o,0),head:et(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function Ra(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ia(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ra(e),t}function Wa(e,t,n,r,o){var i=t,a=n,s=Ke(e,t.line),l=o&&"rtl"==e.direction?-n:n;function c(i){var a,c;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var f=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(f?2:1))),-n)}}else a=o?function(e,t,n,r){var o=ce(t,e.doc.direction);if(!o)return Ji(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 i=se(o,n.ch,n.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ji(t,n,r);var s,l=function(e,n){return Qi(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Dn(e,t),Qn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==r<0,d=l(n,f?1:-1);if(null!=d&&(f?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=f?"before":"after";return new et(n.line,d,p)}}var h=function(e,t,r){for(var i=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return i(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return i(c,s)}},m=h(i+r,r,u);if(m)return m;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==t.text.length||(m=h(r>0?0:o.length-1,r,c(v)),!m)?null:m}(e.cm,s,t,n):Ji(s,t,n);if(null==a){if(i||(c=t.line+l,c<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ke(e,c)))))return!1;t=ea(o,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var h=s.text.charAt(t.ch)||"\n",m=ee(h,d)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var v=ai(e,t,i,a,!0);return nt(i,v)&&(v.hitSide=!0),v}function Ha(e,t,n,r){var o,i,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*rr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;i=Yn(e,s,o),i.outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var Fa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function za(e,t){var n=jn(e,t.line);if(!n||n.hidden)return null;var r=Ke(e.doc,t.line),o=Tn(n,r,t.line),i=ce(r,e.doc.direction),a="left";if(i){var s=se(i,t.ch);a=s%2?"right":"left"}var l=Rn(o.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ba(e,t){return t&&(e.bad=!0),e}function Ua(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Ba(e.clipPos(et(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 o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==r)return Va(i,t,n)}}function Va(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!j(r,t))return Ba(et(Ye(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?$(e.rest):e.line;return Ba(et(Ye(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==t||s==n){var u=Ye(o<0?e.line:e.rest[o]),f=i[a]+r;return(r<0||s!=t)&&(f=i[a+(r?1:0)]),et(u,f)}}}var f=u(a,s,n);if(f)return Ba(f,o);for(var d=s.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(f=u(d,d.firstChild,0),f)return Ba(et(f.line,f.ch-p),o);p+=d.textContent.length}for(var h=s.previousSibling,m=n;h;h=h.previousSibling){if(f=u(h,h.firstChild,-1),f)return Ba(et(f.line,f.ch+m),o);m+=h.textContent.length}}Fa.prototype.init=function(e){var t=this,n=this,r=n.cm,o=n.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(i(e)&&!me(r,e)){if(r.somethingSelected())ja({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);ja({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,B),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Na.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ia(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Na.text.join("\n");var c=D();_(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Ra(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),fe(o,"paste",(function(e){!i(e)||me(r,e)||Pa(e,r)||s<=11&&setTimeout(eo(r,(function(){return t.updateFromDOM()})),20)})),fe(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(o,"touchstart",(function(){return n.forceCompositionEnd()})),fe(o,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(o,"copy",a),fe(o,"cut",a)},Fa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Fa.prototype.prepareSelection=function(){var e=gr(this.cm,!1);return e.focus=D()==this.div,e},Fa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fa.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),o=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ua(t,e.anchorNode,e.anchorOffset),s=Ua(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(it(a,s),o)||0!=tt(ot(a,s),i)){var l=t.display.view,c=o.line>=t.display.viewFrom&&za(t,o)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&za(t,i);if(!u){var f=l[l.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,h=e.rangeCount&&e.getRangeAt(0);try{p=k(c.node,c.offset,u.offset,u.node)}catch(Ne){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Fa.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)},Fa.prototype.showMultipleSelections=function(e){M(this.cm.display.cursorDiv,e.cursors),M(this.cm.display.selectionDiv,e.selection)},Fa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return j(this.div,t)},Fa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&D()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fa.prototype.blur=function(){this.div.blur()},Fa.prototype.getField=function(){return this.div},Fa.prototype.supportsTouch=function(){return!0},Fa.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Jr(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},Fa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fa.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ua(t,e.anchorNode,e.anchorOffset),r=Ua(t,e.focusNode,e.focusOffset);n&&r&&Jr(t,(function(){ei(t.doc,Eo(n,r),B),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Fa.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,Ke(r.doc,a.line-1).length)),s.ch==Ke(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=et(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=ur(r,a.line))?(t=Ye(o.view[0].line),n=o.view[0].node):(t=Ye(o.view[e].line),n=o.view[e-1].node.nextSibling);var l,c,u=ur(r,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Ye(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(e){e&&(c(),i+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var i,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(et(r,0),et(o+1,0),(v=+d,function(e){return e.id==v}));return void(p.length&&(i=p[0].find(0))&&u(qe(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var m=0;m<t.childNodes.length;m++)f(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),h&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;f(t),t!=n;)t=t.nextSibling,l=!1;return i}(r,n,c,t,l)),d=qe(r.doc,et(t,0),et(l,Ke(r.doc,l).text.length));f.length>1&&d.length>1;)if($(f)==$(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var p=0,h=0,m=f[0],v=d[0],g=Math.min(m.length,v.length);p<g&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=$(f),b=$(d),w=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==f.length&&1==d.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;f[f.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var x=et(t,p),C=et(l,d.length?$(d).length-h:0);return f.length>1||f[0]||tt(x,C)?(mi(r.doc,f,x,C,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Fa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jr(this.cm,(function(){return fr(e.cm)}))},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||eo(this.cm,Da)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0;var Ga=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};Ga.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!me(r,e)){if(r.somethingSelected())ja({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=_a(r);ja({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,B):(n.prevInput="",o.value=t.text.join("\n"),_(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(o.style.width="0px"),fe(o,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(o,"paste",(function(e){me(r,e)||Pa(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(o,"cut",i),fe(o,"copy",i),fe(e.scroller,"paste",(function(t){if(!Cn(e,t)&&!me(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),fe(e.lineSpace,"selectstart",(function(t){Cn(e,t)||be(t)})),fe(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ga.prototype.createField=function(e){this.wrapper=Ia(),this.textarea=this.wrapper.firstChild},Ga.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ga.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=gr(e);if(e.options.moveInputWithCursor){var o=qn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},Ga.prototype.showSelection=function(e){var t=this.cm,n=t.display;M(n.cursorDiv,e.cursors),M(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ga.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&_(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ga.prototype.getField=function(){return this.textarea},Ga.prototype.supportsTouch=function(){return!1},Ga.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||D()!=this.textarea))try{this.textarea.focus()}catch(Ne){}},Ga.prototype.blur=function(){this.textarea.blur()},Ga.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ga.prototype.receivedFocus=function(){this.slowPoll()},Ga.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ga.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Ga.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,o.length);l<c&&r.charCodeAt(l)==o.charCodeAt(l);)++l;return Jr(t,(function(){Da(t,o.slice(l),r.length-l,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ga.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ga.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ga.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cr(n,e),c=r.scroller.scrollTop;if(i&&!f){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(i)&&eo(n,ei)(n.doc,Eo(i),B);var d,p=o.style.cssText,h=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(d=window.scrollY),r.input.focus(),l&&window.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),O){Ce(e);var v=function(){pe(window,"mouseup",v),setTimeout(y,20)};fe(window,"mouseup",v)}else setTimeout(y,50)}function g(){if(null!=o.selectionStart){var e=n.somethingSelected(),i=""+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,o.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&g();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==t.prevInput?eo(n,li)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Ga.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ga.prototype.setUneditable=function(){},Ga.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=Ca&&o(e,t,n)}:o)}e.defineOption=n,e.Init=Ca,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,jo(e)}),!0),n("indentUnit",2,jo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Do(e),Fn(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(et(r,i))}r++}));for(var o=n.length-1;o>=0;o--)mi(e.doc,t,n[o],et(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ca&&e.refresh()})),n("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xa(e),vo(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yi(t),o=n!=Ca&&Yi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ea,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=ho(t,e.options.lineNumbers),vo(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return zr(e)}),!0),n("scrollbarStyle","native",(function(e){Vr(e),zr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=ho(e.options.gutters,t),vo(e)}),!0),n("firstLineNumber",1,vo,!0),n("lineNumberFormatter",(function(e){return e}),vo,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(kr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,ka),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Do,!0),n("addModeClass",!1,Do,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Do,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(La),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&eo(this,t[e])(this,n,o),he(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:to((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,o=n(t);r<e.length&&n(e[r])<=o;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,fr(this)})),removeOverlay:to((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void fr(this)}})),indentLine:to((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ta(this,e,t,n)})),indentSelection:to((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var o=t[r];if(o.empty())o.head.line>n&&(Ta(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&jr(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Ta(this,l,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[r].from().ch>0&&Zo(this.doc,r,new So(i,c[r].to()),B)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=dt(this,Ke(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]<i)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var o=n[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&r.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][a]];s&&r.push(s)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==F(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=at(n,null==e?n.first+n.size-1:e),pt(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),qn(this,n,t||"page")},charCoords:function(e,t){return Kn(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Gn(this,e,t||"page"),Yn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Gn(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=Ke(this.doc,e)}else r=e;return Vn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ut(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i=this.display;e=qn(this,st(this.doc,e));var a,s,l,c=e.bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),i.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var f=Math.max(i.wrapper.clientHeight,this.doc.height),d=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=i.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(i.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(a=this,s={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},l=Tr(a,s),null!=l.scrollTop&&_r(a,l.scrollTop),null!=l.scrollLeft&&Ir(a,l.scrollLeft))},triggerOnKeyDown:to(ua),triggerOnKeyPress:to(da),triggerOnKeyUp:fa,triggerOnMouseDown:to(va),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:to((function(e){Aa(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=st(this.doc,e),a=0;a<t&&(i=Wa(this.doc,i,o,n,r),!i.hitSide);++a);return i},moveH:to((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Wa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:to((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Zi(this,(function(n){var o=Wa(r,n.head,e,t,!1);return e<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(e,t,n,r){var o=1,i=r;t<0&&(o=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var l=qn(this,a,"div");if(null==i?i=l.left:l.left=i,a=Ha(this,l,o,n),a.hitSide)break}return a},moveV:to((function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(i)return e<0?a.from():a.to();var s=qn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=Ha(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Nr(n,Kn(n,l,"div").top-s.top),l}),V),o.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(e){var t=this.doc,n=Ke(t,e.line).text,r=e.ch,o=e.ch;if(n){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&o!=n.length||!r?++o:--r;for(var a=n.charAt(r),s=ee(a,i)?function(e){return ee(e,i)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&s(n.charAt(r-1));)--r;for(;o<n.length&&s(n.charAt(o));)++o}return new So(et(e.line,r),et(e.line,o))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:to((function(e,t){Dr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-En(this)-this.display.barHeight,width:e.scrollWidth-En(this)-this.display.barWidth,clientHeight:Mn(this),clientWidth:Ln(this)}},scrollIntoView:to((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Pr(e),e.curOp.scrollToPos=t}(this,e):Ar(this,e.from,e.to,e.margin)})),setSize:to((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Hn(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){dr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Jr(this,e)},startOperation:function(){return Kr(this)},endOperation:function(){return qr(this)},refresh:to((function(){var e=this.display.cachedTextHeight;fr(this),this.curOp.forceUpdate=!0,Fn(this),Dr(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&lr(this),he(this,"refresh",this)})),swapDoc:to((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ro(this,e),Fn(this),this.display.input.reset(),Dr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},ye(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(La);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var qa in ji.prototype)ji.prototype.hasOwnProperty(qa)&&F(Ka,qa)<0&&(La.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(ji.prototype[qa]));return ye(ji),La.inputStyles={textarea:Ga,contenteditable:Fa},La.defineMode=function(e){La.defaults.mode||"null"==e||(La.defaults.mode=e),Ie.apply(this,arguments)},La.defineMIME=function(e,t){Re[e]=t},La.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),La.defineMIME("text/plain","null"),La.defineExtension=function(e,t){La.prototype[e]=t},La.defineDocExtension=function(e,t){ji.prototype[e]=t},La.fromTextArea=function(e,t){if(t=t?I(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var o;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(Ne){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=La((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=pe,e.on=fe,e.wheelEventPixels=xo,e.Doc=ji,e.splitLines=je,e.countColumn=W,e.findColumn=G,e.isWordChar=J,e.Pass=z,e.signal=he,e.Line=Kt,e.changeEnd=Lo,e.scrollbarModel=Ur,e.Pos=et,e.cmpPos=tt,e.modes=_e,e.mimeModes=Re,e.resolveMode=We,e.getMode=He,e.modeExtensions=Fe,e.extendMode=ze,e.copyState=Be,e.startState=Ve,e.innerMode=Ue,e.commands=ta,e.keyMap=Ui,e.keyName=Xi,e.isModifierKey=qi,e.lookupKey=Ki,e.normalizeKeyMap=Gi,e.StringStream=Ge,e.SharedTextMarker=Li,e.TextMarker=ki,e.LineWidget=Ci,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=Ce,e.addClass=P,e.contains=j,e.rmClass=E,e.keyNames=Hi}(La),La.version="5.65.0",La}()},function(e,t,n){"use strict";function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(16),o=n.n(r);function i(e,t){if(t&&("object"===o()(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;var r=n(0),o=r.createContext?(0,r.createContext)({inOsSandBox:!1}):null;t.Context=o},function(e,t,n){"use strict";var r=n(46),o=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.withCompatibleSyncHistory=t.Wrapper=t.withSyncHistory=t.isOsContext=void 0;var i=o(n(22)),a=o(n(23)),s=o(n(24)),l=o(n(25)),c=o(n(26)),u=r(n(0));function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}t.isOsContext=function(){return window.__IS_CONSOLE_OS_CONTEXT__};var d=function(e,t){e&&t&&t!==location.href&&e.push(t)};t.withSyncHistory=function(e,t){var n=function(n){var r=n.path;return(0,u.useEffect)((function(){d(t,r)}),[r]),u.default.createElement(e,n)};return n.displayName="withSyncHistory(".concat(e.displayName,")"),n};var p=function(e){(0,s.default)(n,e);var t=f(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,a.default)(n,[{key:"componentDidMount",value:function(){var e=this.props.history;d(e,this.props.path)}},{key:"componentDidUpdate",value:function(e){var t=this.props.history;this.props.path!=e.path&&d(t,this.props.path)}},{key:"render",value:function(){var e=this.props.Comp;return u.default.createElement(e,this.props)}}]),n}(u.default.Component);t.Wrapper=p,p.displayName="withSyncHistory";t.withCompatibleSyncHistory=function(e,t){return function(n){return u.default.createElement(p,{Comp:e,history:t,props:n})}}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var o,i,a,s;if(c(n),i=e._events,void 0===i?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),o=u(e),o>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=d.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):v(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var c=l.length,u=v(l,c);for(n=0;n<c;++n)i(u[n],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,a;if(c(t),r=this._events,void 0===r)return this;if(n=r[e],void 0===n)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)o=i[r],"removeListener"!==o&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],"function"==typeof t)this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";(function(e){function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i,a=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.UnControlled=t.Controlled=void 0;var s,l=n(0),c="undefined"==typeof navigator||!0===e.PREVENT_CODEMIRROR_RENDER;c||(s=n(27));var u=function(){function e(){}return e.equals=function(e,t){var n=this,r=Object.keys,i=o(e),a=o(t);return e&&t&&"object"===i&&i===a?r(e).length===r(t).length&&r(e).every((function(r){return n.equals(e[r],t[r])})):e===t},e}(),f=function(){function e(e,t){this.editor=e,this.props=t}return e.prototype.delegateCursor=function(e,t,n){var r=this.editor.getDoc();n&&this.editor.focus(),t?r.setCursor(e):r.setCursor(e,null,{scroll:!1})},e.prototype.delegateScroll=function(e){this.editor.scrollTo(e.x,e.y)},e.prototype.delegateSelection=function(e,t){var n=this.editor.getDoc();n.setSelections(e),t&&this.editor.focus()},e.prototype.apply=function(e){e&&e.selection&&e.selection.ranges&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),e&&e.cursor&&this.delegateCursor(e.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1),e&&e.scroll&&this.delegateScroll(e.scroll)},e.prototype.applyNext=function(e,t,n){e&&e.selection&&e.selection.ranges&&t&&t.selection&&t.selection.ranges&&!u.equals(e.selection.ranges,t.selection.ranges)&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),e&&e.cursor&&t&&t.cursor&&!u.equals(e.cursor,t.cursor)&&this.delegateCursor(n.cursor||t.cursor,t.autoScroll||!1,t.autoCursor||!1),e&&e.scroll&&t&&t.scroll&&!u.equals(e.scroll,t.scroll)&&this.delegateScroll(t.scroll)},e.prototype.applyUserDefined=function(e,t){t&&t.cursor&&this.delegateCursor(t.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1)},e.prototype.wire=function(e){var t=this;Object.keys(e||{}).filter((function(e){return/^on/.test(e)})).forEach((function(e){switch(e){case"onBlur":t.editor.on("blur",(function(e,n){t.props.onBlur(t.editor,n)}));break;case"onContextMenu":t.editor.on("contextmenu",(function(e,n){t.props.onContextMenu(t.editor,n)}));break;case"onCopy":t.editor.on("copy",(function(e,n){t.props.onCopy(t.editor,n)}));break;case"onCursor":t.editor.on("cursorActivity",(function(e){t.props.onCursor(t.editor,t.editor.getDoc().getCursor())}));break;case"onCursorActivity":t.editor.on("cursorActivity",(function(e){t.props.onCursorActivity(t.editor)}));break;case"onCut":t.editor.on("cut",(function(e,n){t.props.onCut(t.editor,n)}));break;case"onDblClick":t.editor.on("dblclick",(function(e,n){t.props.onDblClick(t.editor,n)}));break;case"onDragEnter":t.editor.on("dragenter",(function(e,n){t.props.onDragEnter(t.editor,n)}));break;case"onDragLeave":t.editor.on("dragleave",(function(e,n){t.props.onDragLeave(t.editor,n)}));break;case"onDragOver":t.editor.on("dragover",(function(e,n){t.props.onDragOver(t.editor,n)}));break;case"onDragStart":t.editor.on("dragstart",(function(e,n){t.props.onDragStart(t.editor,n)}));break;case"onDrop":t.editor.on("drop",(function(e,n){t.props.onDrop(t.editor,n)}));break;case"onFocus":t.editor.on("focus",(function(e,n){t.props.onFocus(t.editor,n)}));break;case"onGutterClick":t.editor.on("gutterClick",(function(e,n,r,o){t.props.onGutterClick(t.editor,n,r,o)}));break;case"onInputRead":t.editor.on("inputRead",(function(e,n){t.props.onInputRead(t.editor,n)}));break;case"onKeyDown":t.editor.on("keydown",(function(e,n){t.props.onKeyDown(t.editor,n)}));break;case"onKeyHandled":t.editor.on("keyHandled",(function(e,n,r){t.props.onKeyHandled(t.editor,n,r)}));break;case"onKeyPress":t.editor.on("keypress",(function(e,n){t.props.onKeyPress(t.editor,n)}));break;case"onKeyUp":t.editor.on("keyup",(function(e,n){t.props.onKeyUp(t.editor,n)}));break;case"onMouseDown":t.editor.on("mousedown",(function(e,n){t.props.onMouseDown(t.editor,n)}));break;case"onPaste":t.editor.on("paste",(function(e,n){t.props.onPaste(t.editor,n)}));break;case"onRenderLine":t.editor.on("renderLine",(function(e,n,r){t.props.onRenderLine(t.editor,n,r)}));break;case"onScroll":t.editor.on("scroll",(function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())}));break;case"onSelection":t.editor.on("beforeSelectionChange",(function(e,n){t.props.onSelection(t.editor,n)}));break;case"onTouchStart":t.editor.on("touchstart",(function(e,n){t.props.onTouchStart(t.editor,n)}));break;case"onUpdate":t.editor.on("update",(function(e){t.props.onUpdate(t.editor)}));break;case"onViewportChange":t.editor.on("viewportChange",(function(e,n,r){t.props.onViewportChange(t.editor,n,r)}))}}))},e}(),d=function(e){function t(t){var n=e.call(this,t)||this;return c||(n.applied=!1,n.appliedNext=!1,n.appliedUserDefined=!1,n.deferred=null,n.emulating=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1),n}return a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},o=r({},s.defaults,this.editor.options,n),i=Object.keys(o).some((function(e){return t.editor.getOption(e)!==o[e]}));i&&Object.keys(o).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==o[e]&&(t.editor.setOption(e,o[e]),t.mirror.setOption(e,o[e]))})),this.hydrated||(this.deferred?this.resolveChange(e.value):this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.getDoc(),n=t.lastLine(),r=t.getLine(t.lastLine()).length;t.replaceRange(e||"",{line:0,ch:0},{line:n,ch:r}),this.mirror.setValue(e),t.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(e){this.emulating=!0;var t=this.editor.getDoc();if("undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),e&&e!==t.getValue()){var n=t.getCursor();t.setValue(e),t.setCursor(n)}this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){var t=this.editor.getDoc();return"undo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentDidMount=function(){var e=this;c||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.mirror=s((function(){}),this.props.options),this.editor.on("electricInput",(function(){e.mirror.setHistory(e.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(function(){e.mirror.setCursor(e.editor.getDoc().getCursor())})),this.editor.on("beforeChange",(function(t,n){if(!e.emulating){n.cancel(),e.deferred=n;var r=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,r)}})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,n,e.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(!c){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(e,this.props,t),this.appliedNext=!0),this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0}},t.prototype.componentWillUnmount=function(){c||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){return!c},t.prototype.render=function(){var e=this;if(c)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.Controlled=d;var p=function(e){function t(t){var n=e.call(this,t)||this;return c||(n.applied=!1,n.appliedUserDefined=!1,n.continueChange=!1,n.detached=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1,n.onBeforeChangeCb=function(){n.continueChange=!0}),n}return a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},o=r({},s.defaults,this.editor.options,n),i=Object.keys(o).some((function(e){return t.editor.getOption(e)!==o[e]}));if(i&&Object.keys(o).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==o[e]&&t.editor.setOption(e,o[e])})),!this.hydrated){var a=this.editor.getDoc(),l=a.lastLine(),c=a.getLine(a.lastLine()).length;a.replaceRange(e.value||"",{line:0,ch:0},{line:l,ch:c})}this.hydrated=!0},t.prototype.componentDidMount=function(){var e=this;c||(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.editor.on("beforeChange",(function(t,n){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,n,e.editor.getValue(),e.onBeforeChangeCb)})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&(e.props.onBeforeChange?e.continueChange&&e.props.onChange(e.editor,n,e.editor.getValue()):e.props.onChange(e.editor,n,e.editor.getValue()))})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(this.detached&&!1===this.props.detach&&(this.detached=!1,e.editorDidAttach&&e.editorDidAttach(this.editor)),this.detached||!0!==this.props.detach||(this.detached=!0,e.editorDidDetach&&e.editorDidDetach(this.editor)),!c&&!this.detached){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),e.autoCursor||void 0===e.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(e),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0)}},t.prototype.componentWillUnmount=function(){c||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){var n=!0;return c&&(n=!1),this.detached&&e.detach&&(n=!1),n},t.prototype.render=function(){var e=this;if(c)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.UnControlled=p}).call(this,n(38))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),s=d(a),l=n(51),c=d(l),u=n(7),f=d(u);function d(e){return e&&e.__esModule?e:{default:e}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h={animating:"rah-animating",animatingUp:"rah-animating--up",animatingDown:"rah-animating--down",animatingToHeightZero:"rah-animating--to-height-zero",animatingToHeightAuto:"rah-animating--to-height-auto",animatingToHeightSpecific:"rah-animating--to-height-specific",static:"rah-static",staticHeightZero:"rah-static--height-zero",staticHeightAuto:"rah-static--height-auto",staticHeightSpecific:"rah-static--height-specific"},m=["animateOpacity","animationStateClasses","applyInlineTransitions","children","contentClassName","delay","duration","easing","height","onAnimationEnd","onAnimationStart"];function v(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!n.length)return e;for(var o={},i=Object.keys(e),a=0;a<i.length;a++){var s=i[a];-1===n.indexOf(s)&&(o[s]=e[s])}return o}function g(e){e.forEach((function(e){return cancelAnimationFrame(e)}))}function y(e){return!isNaN(parseFloat(e))&&isFinite(e)}function b(e){return"string"==typeof e&&e.search("%")===e.length-1&&y(e.substr(0,e.length-1))}function w(e,t){e&&"function"==typeof e&&e(t)}var x=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.animationFrameIDs=[];var r="auto",i="visible";y(e.height)?(r=e.height<0||"0"===e.height?0:e.height,i="hidden"):b(e.height)&&(r="0%"===e.height?0:e.height,i="hidden"),n.animationStateClasses=o({},h,e.animationStateClasses);var a=n.getStaticStateClasses(r);return n.state={animationStateClasses:a,height:r,overflow:i,shouldUseTransitions:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.state.height;this.contentElement&&this.contentElement.style&&this.hideContent(e)}},{key:"componentDidUpdate",value:function(e,t){var n,r,o=this,i=this.props,a=i.delay,s=i.duration,l=i.height,c=i.onAnimationEnd,u=i.onAnimationStart;if(this.contentElement&&l!==e.height){var d;this.showContent(t.height),this.contentElement.style.overflow="hidden";var h=this.contentElement.offsetHeight;this.contentElement.style.overflow="";var m=s+a,v=null,x={height:null,overflow:"hidden"},C="auto"===t.height;y(l)?(v=l<0||"0"===l?0:l,x.height=v):b(l)?(v="0%"===l?0:l,x.height=v):(v=h,x.height="auto",x.overflow=null),C&&(x.height=v,v=h);var O=(0,f.default)((d={},p(d,this.animationStateClasses.animating,!0),p(d,this.animationStateClasses.animatingUp,"auto"===e.height||l<e.height),p(d,this.animationStateClasses.animatingDown,"auto"===l||l>e.height),p(d,this.animationStateClasses.animatingToHeightZero,0===x.height),p(d,this.animationStateClasses.animatingToHeightAuto,"auto"===x.height),p(d,this.animationStateClasses.animatingToHeightSpecific,x.height>0),d)),S=this.getStaticStateClasses(x.height);this.setState({animationStateClasses:O,height:v,overflow:"hidden",shouldUseTransitions:!C}),clearTimeout(this.timeoutID),clearTimeout(this.animationClassesTimeoutID),C?(x.shouldUseTransitions=!0,g(this.animationFrameIDs),this.animationFrameIDs=(n=function(){o.setState(x),w(u,{newHeight:x.height})},r=[],r[0]=requestAnimationFrame((function(){r[1]=requestAnimationFrame((function(){n()}))})),r),this.animationClassesTimeoutID=setTimeout((function(){o.setState({animationStateClasses:S,shouldUseTransitions:!1}),o.hideContent(x.height),w(c,{newHeight:x.height})}),m)):(w(u,{newHeight:v}),this.timeoutID=setTimeout((function(){x.animationStateClasses=S,x.shouldUseTransitions=!1,o.setState(x),"auto"!==l&&o.hideContent(v),w(c,{newHeight:v})}),m))}}},{key:"componentWillUnmount",value:function(){g(this.animationFrameIDs),clearTimeout(this.timeoutID),clearTimeout(this.animationClassesTimeoutID),this.timeoutID=null,this.animationClassesTimeoutID=null,this.animationStateClasses=null}},{key:"showContent",value:function(e){0===e&&(this.contentElement.style.display="")}},{key:"hideContent",value:function(e){0===e&&(this.contentElement.style.display="none")}},{key:"getStaticStateClasses",value:function(e){var t;return(0,f.default)((t={},p(t,this.animationStateClasses.static,!0),p(t,this.animationStateClasses.staticHeightZero,0===e),p(t,this.animationStateClasses.staticHeightSpecific,e>0),p(t,this.animationStateClasses.staticHeightAuto,"auto"===e),t))}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.animateOpacity,i=n.applyInlineTransitions,a=n.children,l=n.className,c=n.contentClassName,u=n.delay,d=n.duration,h=n.easing,g=n.id,y=n.style,b=this.state,w=b.height,x=b.overflow,C=b.animationStateClasses,O=b.shouldUseTransitions,S=o({},y,{height:w,overflow:x||y.overflow});O&&i&&(S.transition="height "+d+"ms "+h+" "+u+"ms",y.transition&&(S.transition=y.transition+", "+S.transition),S.WebkitTransition=S.transition);var k={};r&&(k.transition="opacity "+d+"ms "+h+" "+u+"ms",k.WebkitTransition=k.transition,0===w&&(k.opacity=0));var E=(0,f.default)((e={},p(e,C,!0),p(e,l,l),e)),L=void 0!==this.props["aria-hidden"],M=L?this.props["aria-hidden"]:0===w;return s.default.createElement("div",o({},v.apply(void 0,[this.props].concat(m)),{"aria-hidden":M,className:E,id:g,style:S}),s.default.createElement("div",{className:c,style:k,ref:function(e){return t.contentElement=e}},a))}}]),t}(s.default.Component);x.propTypes={"aria-hidden":c.default.bool,animateOpacity:c.default.bool,animationStateClasses:c.default.object,applyInlineTransitions:c.default.bool,children:c.default.any.isRequired,className:c.default.string,contentClassName:c.default.string,delay:c.default.number,duration:c.default.number,easing:c.default.string,height:function(e,t,n){var o=e[t];return"number"==typeof o&&o>=0||b(o)||"auto"===o?null:new TypeError('value "'+o+'" of type "'+(void 0===o?"undefined":r(o))+'" is invalid type for '+t+" in "+n+'. It needs to be a positive number, string "auto" or percentage string (e.g. "15%").')},id:c.default.string,onAnimationEnd:c.default.func,onAnimationStart:c.default.func,style:c.default.object},x.defaultProps={animateOpacity:!1,animationStateClasses:h,applyInlineTransitions:!0,duration:250,delay:0,easing:"ease",style:{}},t.default=x},function(e,t){e.exports=r},function(e,t,n){!function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(t);function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var i={error:null},a=function(e){var t,n;function a(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r))||this,t.state=i,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}t=a,n=e,t.prototype=Object.create(n.prototype),t.prototype.constructor=t,o(t,n),a.getDerivedStateFromError=function(e){return{error:e}};var s=a.prototype;return s.reset=function(){this.setState(i)},s.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},s.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(o=e.resetKeys,i=s,void 0===o&&(o=[]),void 0===i&&(i=[]),o.length!==i.length||o.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},s.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,i=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(i))return i;if("function"==typeof n)return n(a);if(o)return r.createElement(o,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},a}(r.Component);e.ErrorBoundary=a,e.useErrorHandler=function(e){var t=r.useState(null),n=t[0],o=t[1];if(null!=e)throw e;if(null!=n)throw n;return o},e.withErrorBoundary=function(e,t){var n=function(n){return r.createElement(a,t,r.createElement(e,n))},o=e.displayName||e.name||"Unknown";return n.displayName="withErrorBoundary("+o+")",n},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(0))},function(e,t,n){"use strict";e.exports=n(55)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t);var r=n(32);n.d(t,"EventEmitter",(function(){return r.EventEmitter}))},function(e,t,n){e.exports=n(61)},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.registerExposedModule=function(e,t){if(w[e])return void console.error("module has been registered in expose module map");w[e]=t},t.mount=function(e,t,n){var r=function(t){(0,a.default)(f,t);var n,r,c=(n=f,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,l.default)(n);if(r){var o=(0,l.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,s.default)(this,e)});function f(){return(0,o.default)(this,f),c.apply(this,arguments)}return(0,i.default)(f,[{key:"componentDidCatch",value:function(){}},{key:"componentDidMount",value:function(){var e=b(this.props);if(e){var t=e.emitter;!function(e){e&&e.on("main:postMessage",y)}(t)}}},{key:"componentWillUnmount",value:function(){var e=b(this.props),t=e.emitter;!function(e){e&&e.off("main:postMessage",y)}(t)}},{key:"render",value:function(){var t={inOsSandBox:(0,p.isOsContext)()};return u.default.createElement(m.default,{logger:this.props.logger,appDidCatch:this.props.appDidCatch},h.Context?u.default.createElement(h.Context.Provider,{value:t},u.default.createElement(e,Object.assign(b(this.props)||{}))):u.default.createElement(e,Object.assign(b(this.props)||{})))}}]),f}(u.default.Component);if((0,p.isOsContext)()){var c=(0,d.default)({React:u.default,ReactDOM:f.default,rootComponent:r,domElementGetter:function(){return document.getElementsByTagName(n)[0]}});return{bootstrap:[c.bootstrap],mount:[c.mount],unmount:[c.unmount],update:[c.update],exposedModule:w}}f.default.render(u.default.createElement(r,null),t)};var o=r(n(22)),i=r(n(23)),a=r(n(24)),s=r(n(25)),l=r(n(26)),c=r(n(39)),u=r(n(0)),f=r(n(11)),d=r(n(45)),p=n(31),h=n(30),m=r(n(47));function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=function(e){window.postMessage(e.data,null)},b=function(e){var t=g(g({},e),e.appProps||{});return delete t.domElement,delete t.singleSpa,delete t.mountParcel,t||{}},w={}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){!function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.SingleSpaContext=null;var o={React:null,ReactDOM:null,rootComponent:null,loadRootComponent:null,suppressComponentDidCatchWarning:!1,domElements:{},errorBoundary:null,domElementGetter:null,parcelCanUpdate:!0};function i(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function a(e,t){return new Promise((function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-react was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,t);if("function"!=typeof o)throw new Error("single-spa-react: the domElementGetter for react application '".concat(t.appName||t.name,"' is not a function"));var i=u(e,t),a=function(e,t){var n=e(t);if(!n)throw new Error("single-spa-react: domElementGetter function for application '".concat(t.appName||t.name,"' did not return a valid dom element. Please pass a valid domElement or domElementGetter via opts or props"));return n}(o,t);c({elementToRender:i,domElement:a,whenFinished:function(){n(this)},opts:e}),e.domElements[t.name]=a}))}function s(e,t){return Promise.resolve().then((function(){e.ReactDOM.unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name]}))}function l(e,t){return new Promise((function(n,r){c({elementToRender:u(e,t),domElement:e.domElements[t.name],whenFinished:function(){n(this)},opts:e})}))}function c(e){var t=e.opts,n=e.elementToRender,r=e.domElement,o=e.whenFinished;return"createRoot"===t.renderType?t.ReactDOM.createRoot(r).render(n,o):"createBlockingRoot"===t.renderType?t.ReactDOM.createBlockingRoot(r).render(n,o):"hydrate"===t.renderType?t.ReactDOM.hydrate(n,r,o):t.ReactDOM.render(n,r,o)}function u(t,n){var r=t.React.createElement(t.rootComponent,n),o=e.SingleSpaContext?t.React.createElement(e.SingleSpaContext.Provider,{value:n},r):r;return t.errorBoundary&&(t.errorBoundaryClass=t.errorBoundaryClass||function(e){function t(n){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},t.displayName="SingleSpaReactErrorBoundary(".concat(n.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.render=function(){return this.state.caughtError?e.errorBoundary(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},t.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},t}(t),o=t.React.createElement(t.errorBoundaryClass,n,o)),o}e.default=function(c){if("object"!==t(c))throw new Error("single-spa-react requires a configuration object");var u=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?r(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},o,{},c);if(!u.React)throw new Error("single-spa-react must be passed opts.React");if(!u.ReactDOM)throw new Error("single-spa-react must be passed opts.ReactDOM");if(!u.rootComponent&&!u.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(u.errorBoundary&&"function"!=typeof u.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!e.SingleSpaContext&&u.React.createContext&&(e.SingleSpaContext=u.React.createContext());var f={bootstrap:i.bind(null,u),mount:a.bind(null,u),unmount:s.bind(null,u)};return u.parcelCanUpdate&&(f.update=l.bind(null,u)),f},Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,n){var r=n(16).default;function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=a?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(i,s,l):i[s]=e[s]}return i.default=e,n&&n.set(e,i),i},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(21);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(22)),i=r(n(23)),a=r(n(24)),s=r(n(25)),l=r(n(26)),c=r(n(0));function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var f={lineHeight:"22px",color:"#d93026",fontSize:14},d=function(e){(0,a.default)(n,e);var t=u(n);function n(e){var r;return(0,o.default)(this,n),r=t.call(this,e),r.state={hasError:!1,error:null},r}return(0,i.default)(n,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e}),this.props.logger?this.props.logger.error(e,t):window.__bl&&window.__bl.error&&window.__bl.error(e,t),console.error(e),this.props.appDidCatch&&this.props.appDidCatch(e)}},{key:"render",value:function(){this.state.error;return this.state.hasError?c.default.createElement("div",{style:{padding:24}},c.default.createElement("div",{style:f},"Error")):this.props.children}}]),n}(c.default.Component),p=d;t.default=p},function(e,t,n){},function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,o,i=t.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,u=n.typescript,f=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),o=e("keyword d"),i=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,n){return r=e,o=n,t}function v(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,o=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=v,m("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||o);)o=!o&&"\\"==r;return o||(t.tokenize=v),m("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==r&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return m(r);if("="==r&&e.eat(">"))return m("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Qe(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==r)return t.tokenize=y,y(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==r&&e.eatWhile(f))return m("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?m("."):m("operator","operator",e.current());if(f.test(r)){e.eatWhile(f);var o=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(o)){var i=d[o];return m(i.type,i.style,o)}if("async"==o&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",o)}return m("variable","variable",o)}}function g(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=v;break}r="*"==n}return m("comment","comment")}function y(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=v;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var o=0,i=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!o){++a;break}if(0==--o){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(f.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;var c=e.string.charAt(a-1);if(c==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(i&&!o){++a;break}}i&&!o&&(t.fatArrowAt=a)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(e,t,n,r,o,i){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function C(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function O(e,t,n,r,o){var i=e.cc;for(S.state=e,S.stream=o,S.marked=null,S.cc=i,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=i.length?i.pop():l?z:H;if(a(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return S.marked?S.marked:"variable"==n&&C(e,r)?"variable-2":t}}}var S={state:null,column:null,marked:null,cc:null};function k(){for(var e=arguments.length-1;e>=0;e--)S.cc.push(arguments[e])}function E(){return k.apply(null,arguments),!0}function L(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function M(e){var t=S.state;if(S.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new N(r,n.vars,!0):null}return L(t,n.vars)?n:new N(n.prev,new j(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!L(e,t.localVars))return void(t.localVars=new j(e,t.localVars));n.globalVars&&!L(e,t.globalVars)&&(t.globalVars=new j(e,t.globalVars))}}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function N(e,t,n){this.prev=e,this.vars=t,this.block=n}function j(e,t){this.name=e,this.next=t}var D=new j("this",new j("arguments",null));function P(){S.state.context=new N(S.state.context,S.state.localVars,!1),S.state.localVars=D}function A(){S.state.context=new N(S.state.context,S.state.localVars,!0),S.state.localVars=null}function _(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function R(e,t){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new x(r,S.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function I(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function W(e){return function t(n){return n==e?E():";"==e||"}"==n||")"==n||"]"==n?k():E(t)}}function H(e,t){return"var"==e?E(R("vardef",t),Oe,W(";"),I):"keyword a"==e?E(R("form"),U,H,I):"keyword b"==e?E(R("form"),H,I):"keyword d"==e?S.stream.match(/^\s*$/,!1)?E():E(R("stat"),G,W(";"),I):"debugger"==e?E(W(";")):"{"==e?E(R("}"),A,se,I,_):";"==e?E():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==I&&S.state.cc.pop()(),E(R("form"),U,H,I,Te)):"function"==e?E(Pe):"for"==e?E(R("form"),A,Ne,H,_,I):"class"==e||u&&"interface"==t?(S.marked="keyword",E(R("form","class"==e?e:t),We,I)):"variable"==e?u&&"declare"==t?(S.marked="keyword",E(H)):u&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?E(Ye):"type"==t?E(_e,W("operator"),de,W(";")):E(R("form"),Se,W("{"),R("}"),se,I,I)):u&&"namespace"==t?(S.marked="keyword",E(R("form"),z,H,I)):u&&"abstract"==t?(S.marked="keyword",E(H)):E(R("stat"),ee):"switch"==e?E(R("form"),U,W("{"),R("}","switch"),A,se,I,I,_):"case"==e?E(z,W(":")):"default"==e?E(W(":")):"catch"==e?E(R("form"),P,F,H,I,_):"export"==e?E(R("stat"),Be,I):"import"==e?E(R("stat"),Ve,I):"async"==e?E(H):"@"==t?E(z,H):k(R("stat"),z,W(";"),I)}function F(e){if("("==e)return E(Re,W(")"))}function z(e,t){return V(e,t,!1)}function B(e,t){return V(e,t,!0)}function U(e){return"("!=e?k():E(R(")"),G,W(")"),I)}function V(e,t,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:Y;if("("==e)return E(P,R(")"),ie(Re,")"),I,W("=>"),r,_);if("variable"==e)return k(P,Se,W("=>"),r,_)}var o=n?q:K;return w.hasOwnProperty(e)?E(o):"function"==e?E(Pe,o):"class"==e||u&&"interface"==t?(S.marked="keyword",E(R("form"),Ie,I)):"keyword c"==e||"async"==e?E(n?B:z):"("==e?E(R(")"),G,W(")"),I,o):"operator"==e||"spread"==e?E(n?B:z):"["==e?E(R("]"),Xe,I,o):"{"==e?ae(ne,"}",null,o):"quasi"==e?k($,o):"new"==e?E(function(e){return function(t){return"."==t?E(e?J:Q):"variable"==t&&u?E(we,e?q:K):k(e?B:z)}}(n)):E()}function G(e){return e.match(/[;\}\)\],]/)?k():k(z)}function K(e,t){return","==e?E(G):q(e,t,!1)}function q(e,t,n){var r=0==n?K:q,o=0==n?z:B;return"=>"==e?E(P,n?Z:Y,_):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?E(r):u&&"<"==t&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(R(">"),ie(de,">"),I,r):"?"==t?E(z,W(":"),o):E(o):"quasi"==e?k($,r):";"!=e?"("==e?ae(B,")","call",r):"."==e?E(te,r):"["==e?E(R("]"),G,W("]"),I,r):u&&"as"==t?(S.marked="keyword",E(de,r)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),E(o)):void 0:void 0}function $(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?E($):E(G,X)}function X(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,E($)}function Y(e){return b(S.stream,S.state),k("{"==e?H:z)}function Z(e){return b(S.stream,S.state),k("{"==e?H:B)}function Q(e,t){if("target"==t)return S.marked="keyword",E(K)}function J(e,t){if("target"==t)return S.marked="keyword",E(q)}function ee(e){return":"==e?E(I,H):k(K,W(";"),I)}function te(e){if("variable"==e)return S.marked="property",E()}function ne(e,t){return"async"==e?(S.marked="property",E(ne)):"variable"==e||"keyword"==S.style?(S.marked="property","get"==t||"set"==t?E(re):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),E(oe))):"number"==e||"string"==e?(S.marked=s?"property":S.style+" property",E(oe)):"jsonld-keyword"==e?E(oe):u&&T(t)?(S.marked="keyword",E(ne)):"["==e?E(z,le,W("]"),oe):"spread"==e?E(B,oe):"*"==t?(S.marked="keyword",E(ne)):":"==e?k(oe):void 0;var n}function re(e){return"variable"!=e?k(oe):(S.marked="property",E(Pe))}function oe(e){return":"==e?E(B):"("==e?k(Pe):void 0}function ie(e,t,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var a=S.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E((function(n,r){return n==t||r==t?k():k(e)}),r)}return o==t||i==t?E():n&&n.indexOf(";")>-1?k(e):E(W(t))}return function(n,o){return n==t||o==t?E():k(e,r)}}function ae(e,t,n){for(var r=3;r<arguments.length;r++)S.cc.push(arguments[r]);return E(R(t,n),ie(e,t),I)}function se(e){return"}"==e?E():k(H,se)}function le(e,t){if(u){if(":"==e)return E(de);if("?"==t)return E(le)}}function ce(e,t){if(u&&(":"==e||"in"==t))return E(de)}function ue(e){if(u&&":"==e)return S.stream.match(/^\s*\w+\s+is\b/,!1)?E(z,fe,de):E(de)}function fe(e,t){if("is"==t)return S.marked="keyword",E()}function de(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(S.marked="keyword",E("typeof"==t?B:de)):"variable"==e||"void"==t?(S.marked="type",E(be)):"|"==t||"&"==t?E(de):"string"==e||"number"==e||"atom"==e?E(be):"["==e?E(R("]"),ie(de,"]",","),I,be):"{"==e?E(R("}"),he,I,be):"("==e?E(ie(ye,")"),pe,be):"<"==e?E(ie(de,">"),de):"quasi"==e?k(ve,be):void 0}function pe(e){if("=>"==e)return E(de)}function he(e){return e.match(/[\}\)\]]/)?E():","==e||";"==e?E(he):k(me,he)}function me(e,t){return"variable"==e||"keyword"==S.style?(S.marked="property",E(me)):"?"==t||"number"==e||"string"==e?E(me):":"==e?E(de):"["==e?E(W("variable"),ce,W("]"),me):"("==e?k(Ae,me):e.match(/[;\}\)\],]/)?void 0:E()}function ve(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?E(ve):E(de,ge)}function ge(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,E(ve)}function ye(e,t){return"variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?E(ye):":"==e?E(de):"spread"==e?E(ye):k(de)}function be(e,t){return"<"==t?E(R(">"),ie(de,">"),I,be):"|"==t||"."==e||"&"==t?E(de):"["==e?E(de,W("]"),be):"extends"==t||"implements"==t?(S.marked="keyword",E(de)):"?"==t?E(de,W(":"),de):void 0}function we(e,t){if("<"==t)return E(R(">"),ie(de,">"),I,be)}function xe(){return k(de,Ce)}function Ce(e,t){if("="==t)return E(de)}function Oe(e,t){return"enum"==t?(S.marked="keyword",E(Ye)):k(Se,le,Le,Me)}function Se(e,t){return u&&T(t)?(S.marked="keyword",E(Se)):"variable"==e?(M(t),E()):"spread"==e?E(Se):"["==e?ae(Ee,"]"):"{"==e?ae(ke,"}"):void 0}function ke(e,t){return"variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?E(Se):"}"==e?k():"["==e?E(z,W("]"),W(":"),ke):E(W(":"),Se,Le)):(M(t),E(Le))}function Ee(){return k(Se,Le)}function Le(e,t){if("="==t)return E(B)}function Me(e){if(","==e)return E(Oe)}function Te(e,t){if("keyword b"==e&&"else"==t)return E(R("form","else"),H,I)}function Ne(e,t){return"await"==t?E(Ne):"("==e?E(R(")"),je,I):void 0}function je(e){return"var"==e?E(Oe,De):"variable"==e?E(De):k(De)}function De(e,t){return")"==e?E():";"==e?E(De):"in"==t||"of"==t?(S.marked="keyword",E(z,De)):k(z,De)}function Pe(e,t){return"*"==t?(S.marked="keyword",E(Pe)):"variable"==e?(M(t),E(Pe)):"("==e?E(P,R(")"),ie(Re,")"),I,ue,H,_):u&&"<"==t?E(R(">"),ie(xe,">"),I,Pe):void 0}function Ae(e,t){return"*"==t?(S.marked="keyword",E(Ae)):"variable"==e?(M(t),E(Ae)):"("==e?E(P,R(")"),ie(Re,")"),I,ue,_):u&&"<"==t?E(R(">"),ie(xe,">"),I,Ae):void 0}function _e(e,t){return"keyword"==e||"variable"==e?(S.marked="type",E(_e)):"<"==t?E(R(">"),ie(xe,">"),I):void 0}function Re(e,t){return"@"==t&&E(z,Re),"spread"==e?E(Re):u&&T(t)?(S.marked="keyword",E(Re)):u&&"this"==e?E(le,Le):k(Se,le,Le)}function Ie(e,t){return"variable"==e?We(e,t):He(e,t)}function We(e,t){if("variable"==e)return M(t),E(He)}function He(e,t){return"<"==t?E(R(">"),ie(xe,">"),I,He):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(S.marked="keyword"),E(u?de:z,He)):"{"==e?E(R("}"),Fe,I):void 0}function Fe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&T(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",E(Fe)):"variable"==e||"keyword"==S.style?(S.marked="property",E(ze,Fe)):"number"==e||"string"==e?E(ze,Fe):"["==e?E(z,le,W("]"),ze,Fe):"*"==t?(S.marked="keyword",E(Fe)):u&&"("==e?k(Ae,Fe):";"==e||","==e?E(Fe):"}"==e?E():"@"==t?E(z,Fe):void 0}function ze(e,t){if("!"==t)return E(ze);if("?"==t)return E(ze);if(":"==e)return E(de,Le);if("="==t)return E(B);var n=S.state.lexical.prev,r=n&&"interface"==n.info;return k(r?Ae:Pe)}function Be(e,t){return"*"==t?(S.marked="keyword",E($e,W(";"))):"default"==t?(S.marked="keyword",E(z,W(";"))):"{"==e?E(ie(Ue,"}"),$e,W(";")):k(H)}function Ue(e,t){return"as"==t?(S.marked="keyword",E(W("variable"))):"variable"==e?k(B,Ue):void 0}function Ve(e){return"string"==e?E():"("==e?k(z):"."==e?k(K):k(Ge,Ke,$e)}function Ge(e,t){return"{"==e?ae(Ge,"}"):("variable"==e&&M(t),"*"==t&&(S.marked="keyword"),E(qe))}function Ke(e){if(","==e)return E(Ge,Ke)}function qe(e,t){if("as"==t)return S.marked="keyword",E(Ge)}function $e(e,t){if("from"==t)return S.marked="keyword",E(z)}function Xe(e){return"]"==e?E():k(ie(B,"]"))}function Ye(){return k(R("form"),Se,W("{"),R("}"),ie(Ze,"}"),I,I)}function Ze(){return k(Se,Le)}function Qe(e,t,n){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return _.lex=!0,I.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new x((e||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new N(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=o&&"--"!=o?r:"incdec",O(t,n,r,o,e))},indent:function(t,r){if(t.tokenize==g||t.tokenize==y)return e.Pass;if(t.tokenize!=v)return 0;var o,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==I)l=l.prev;else if(u!=Te&&u!=_)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==K||o==q)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,d=s==f;return"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==f&&"{"==s?l.indented:"form"==f?l.indented+i:"stat"==f?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||i:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:i):l.indented+(/^(?:case|default)\b/.test(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Qe,skipExpression:function(t){O(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(27))},function(e,t,n){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function o(e){return e&&e.bracketRegex||/[(){}[\]]/}function i(e,t,i){var s=e.getLineHandle(t.line),l=t.ch-1,c=i&&i.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=o(i),f=!c&&l>=0&&u.test(s.text.charAt(l))&&r[s.text.charAt(l)]||u.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!f)return null;var d=">"==f.charAt(1)?1:-1;if(i&&i.strict&&d>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),h=a(e,n(t.line,l+(d>0?1:0)),d,p,i);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:d>0}}function a(e,t,i,a,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],f=o(s),d=i>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),p=t.line;p!=d;p+=i){var h=e.getLine(p);if(h){var m=i>0?0:h.length-1,v=i>0?h.length:-1;if(!(h.length>l))for(p==t.line&&(m=t.ch-(i<0?1:0));m!=v;m+=i){var g=h.charAt(m);if(f.test(g)&&(void 0===a||(e.getTokenTypeAt(n(p,m+1))||"")==(a||""))){var y=r[g];if(y&&">"==y.charAt(1)==i>0)u.push(g);else{if(!u.length)return{pos:n(p,m),ch:g};u.pop()}}}}}return p-i!=(i>0?e.lastLine():e.firstLine())&&null}function s(e,r,o){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=o&&o.highlightNonMatching,l=[],c=e.listSelections(),u=0;u<c.length;u++){var f=c[u].empty()&&i(e,c[u].head,o);if(f&&(f.match||!1!==s)&&e.getLine(f.from.line).length<=a){var d=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(f.from,n(f.from.line,f.from.ch+1),{className:d})),f.to&&e.getLine(f.to.line).length<=a&&l.push(e.markText(f.to,n(f.to.line,f.to.ch+1),{className:d}))}}if(l.length){t&&e.state.focused&&e.focus();var p=function(){e.operation((function(){for(var e=0;e<l.length;e++)l[e].clear()}))};if(!r)return p;setTimeout(p,800)}}function l(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=s(e,!1,e.state.matchBrackets)}))}function c(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}e.defineOption("matchBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",l),t.off("focus",l),t.off("blur",c),c(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",l),t.on("focus",l),t.on("blur",c))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),i(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,n,r){return a(this,e,t,n,r)}))}(n(27))},function(e,t,n){e.exports=n(52)()},function(e,t,n){"use strict";var r=n(53);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(E){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(E){return{type:"throw",arg:E}}}e.wrap=l;var u={};function f(){}function d(){}function p(){}var h={};s(h,o,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==t&&n.call(v,o)&&(h=v);var g=p.prototype=f.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,s(g,"constructor",p),s(p,"constructor",d),d.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),s(g,a,"Generator"),s(g,o,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";
|
|
11
11
|
/** @license React v16.13.1
|
|
12
12
|
* react-is.production.min.js
|
|
13
13
|
*
|