diff --git a/home-assistant-polymer b/home-assistant-polymer index 8dd3d78f2..4d287a1f8 160000 --- a/home-assistant-polymer +++ b/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 8dd3d78f2125f45bb6c608c54fb3af3fca803acc +Subproject commit 4d287a1f83deb85c7494761f673e83d56255ecb6 diff --git a/supervisor/api/panel/entrypoint.js b/supervisor/api/panel/entrypoint.js index 4edcce69e..75aba756f 100644 --- a/supervisor/api/panel/entrypoint.js +++ b/supervisor/api/panel/entrypoint.js @@ -1,9 +1,9 @@ try { - new Function("import('/api/hassio/app/frontend_latest/entrypoint.4050b348.js')")(); + new Function("import('/api/hassio/app/frontend_latest/entrypoint.780b9fd2.js')")(); } catch (err) { var el = document.createElement('script'); - el.src = '/api/hassio/app/frontend_es5/entrypoint.bcf8e8ff.js'; + el.src = '/api/hassio/app/frontend_es5/entrypoint.c8691e19.js'; document.body.appendChild(el); } \ No newline at end of file diff --git a/supervisor/api/panel/entrypoint.js.gz b/supervisor/api/panel/entrypoint.js.gz index 5f9b673cf..ff16d1c8a 100644 Binary files a/supervisor/api/panel/entrypoint.js.gz and b/supervisor/api/panel/entrypoint.js.gz differ diff --git a/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js b/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js deleted file mode 100644 index 707525646..000000000 --- a/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[914],{92914:function(r,o,e){"use strict";e.r(o),e.d(o,{keymap:function(){return t.$f},highlightActiveLine:function(){return t.ZO},drawSelection:function(){return t.Uw},EditorView:function(){return t.tk},EditorState:function(){return l.yy},Prec:function(){return l.Wl},defaultKeymap:function(){return p.wQ},lineNumbers:function(){return d.Eu},searchKeymap:function(){return m.Lp},highlightSelectionMatches:function(){return m.sW},history:function(){return u.m8},historyKeymap:function(){return u.f$},rectangularSelection:function(){return g.Z},HighlightStyle:function(){return a.Qf},tags:function(){return a.pJ},langs:function(){return s},langCompartment:function(){return v},readonlyCompartment:function(){return b},tabKeyBindings:function(){return f},theme:function(){return y},highlightStyle:function(){return h}});var a=e(49619),t=e(19753),n=e(11163),c=e(49413),i=e(8987),p=e(86876),l=e(77885),d=e(11254),m=e(72360),u=e(62118),g=e(63637),s={jinja2:n.i.define(c.b),yaml:n.i.define(i.r)},v=new l.F6,b=new l.F6,f=[{key:"Tab",run:p.at},{key:"Shift-Tab",run:p.xi}],y=t.tk.theme({"&":{color:"var(--primary-text-color)",backgroundColor:"var(--code-editor-background-color, var(--card-background-color))","& ::selection":{backgroundColor:"rgba(var(--rgb-primary-color), 0.3)"},caretColor:"var(--secondary-text-color)",height:"var(--code-mirror-height, auto)",maxHeight:"var(--code-mirror-max-height, unset)"},"&.cm-focused":{outline:"none"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--secondary-text-color)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(var(--rgb-primary-color), 0.3)"},".cm-activeLine":{backgroundColor:"rgba(var(--rgb-secondary-text-color), 0.1)"},".cm-scroller":{outline:"none"},".cm-content":{caretColor:"var(--secondary-text-color)"},".cm-panels":{backgroundColor:"var(--primary-background-color)",color:"var(--primary-text-color)"},".cm-panels.top":{borderBottom:"1px solid var(--divider-color)"},".cm-panels.bottom":{borderTop:"1px solid var(--divider-color)"},".cm-panel.search input":{margin:"4px 4px 0"},".cm-button":{border:"1px solid var(--primary-color)",padding:"0px 16px",textTransform:"uppercase",margin:"4px",background:"none",color:"var(--primary-color)",fontFamily:"var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif))",fontSize:"var(--mdc-typography-button-font-size, 0.875rem)",height:"36px",fontWeight:"var(--mdc-typography-button-font-weight, 500)",borderRadius:"4px",letterSpacing:"var(--mdc-typography-button-letter-spacing, 0.0892857em)"},".cm-textfield":{padding:"4px 0px 5px",borderRadius:"0",fontSize:"16px",color:"var(--primary-text-color)",border:"0",background:"none",fontFamily:"Roboto",borderBottom:"1px solid var(--paper-input-container-color, var(--secondary-text-color))",margin:"4px 4px 0","& ::placeholder":{color:"var(--paper-input-container-color, var(--secondary-text-color))"},"&:focus":{outline:"none",borderBottom:"2px solid var(--primary-color)",paddingBottom:"4px"}},".cm-selectionMatch":{backgroundColor:"rgba(var(--rgb-primary-color), 0.1)"},".cm-searchMatch":{backgroundColor:"rgba(var(--rgb-accent-color), .2)",outline:"1px solid rgba(var(--rgb-accent-color), .4)"},".cm-searchMatch.selected":{backgroundColor:"rgba(var(--rgb-accent-color), .4)",outline:"1px solid var(--accent-color)"},".cm-gutters":{backgroundColor:"var(--paper-dialog-background-color, var(--primary-background-color))",color:"var(--paper-dialog-color, var(--secondary-text-color))",border:"none",borderRight:"1px solid var(--paper-input-container-color, var(--secondary-text-color))",paddingRight:"1px"},"&.cm-focused cm-gutters":{borderRight:"2px solid var(--paper-input-container-focus-color, var(--primary-color))",paddingRight:"0"},".cm-gutterElement.lineNumber":{color:"inherit"}}),h=a.Qf.define([{tag:a.pJ.keyword,color:"var(--codemirror-keyword, #6262FF)"},{tag:[a.pJ.name,a.pJ.deleted,a.pJ.character,a.pJ.propertyName,a.pJ.macroName],color:"var(--codemirror-property, #905)"},{tag:[a.pJ.function(a.pJ.variableName),a.pJ.labelName],color:"var(--codemirror-variable, #07a)"},{tag:[a.pJ.color,a.pJ.constant(a.pJ.name),a.pJ.standard(a.pJ.name)],color:"var(--codemirror-qualifier, #690)"},{tag:[a.pJ.definition(a.pJ.name),a.pJ.separator],color:"var(--codemirror-def, #8DA6CE)"},{tag:[a.pJ.typeName,a.pJ.className,a.pJ.number,a.pJ.changed,a.pJ.annotation,a.pJ.modifier,a.pJ.self,a.pJ.namespace],color:"var(--codemirror-number, #ca7841)"},{tag:[a.pJ.operator,a.pJ.operatorKeyword,a.pJ.url,a.pJ.escape,a.pJ.regexp,a.pJ.link,a.pJ.special(a.pJ.string)],color:"var(--codemirror-operator, #cda869)"},{tag:a.pJ.comment,color:"var(--codemirror-comment, #777)"},{tag:a.pJ.meta,color:"var(--codemirror-meta, var(--primary-text-color))"},{tag:a.pJ.strong,fontWeight:"bold"},{tag:a.pJ.emphasis,fontStyle:"italic"},{tag:a.pJ.link,color:"var(--primary-color)",textDecoration:"underline"},{tag:a.pJ.heading,fontWeight:"bold"},{tag:a.pJ.atom,color:"var(--codemirror-atom, #F90)"},{tag:a.pJ.bool,color:"var(--codemirror-atom, #F90)"},{tag:a.pJ.special(a.pJ.variableName),color:"var(--codemirror-variable-2, #690)"},{tag:a.pJ.processingInstruction,color:"var(--secondary-text-color)"},{tag:a.pJ.string,color:"var(--codemirror-string, #07a)"},{tag:a.pJ.inserted,color:"var(--codemirror-string2, #07a)"},{tag:a.pJ.invalid,color:"var(--error-color)"}])}}]); -//# sourceMappingURL=chunk.2e5192dd0552c13e5623.js.map \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js.gz b/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js.gz deleted file mode 100644 index 3d28c7a0c..000000000 Binary files a/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js.gz and /dev/null differ diff --git a/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js.map b/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js.map deleted file mode 100644 index 730dab17b..000000000 --- a/supervisor/api/panel/frontend_es5/chunk.2e5192dd0552c13e5623.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"chunk.2e5192dd0552c13e5623.js","sources":["webpack://home-assistant-frontend/chunk.2e5192dd0552c13e5623.js"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file diff --git a/supervisor/api/panel/frontend_es5/chunk.3ed85c75fe65f012d2ea.js b/supervisor/api/panel/frontend_es5/chunk.3ed85c75fe65f012d2ea.js new file mode 100644 index 000000000..c613e9bcb --- /dev/null +++ b/supervisor/api/panel/frontend_es5/chunk.3ed85c75fe65f012d2ea.js @@ -0,0 +1,2 @@ +(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[102],{86876:function(t,e,n){"use strict";n.d(e,{wQ:function(){return bt},xi:function(){return kt},at:function(){return yt}});var r=n(77885),i=n(23414),o=n(19753),a=n(64928),s=n(26856);function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&m(e.state,s.head-1,1,i)||i.afterCursor&&(m(e.state,s.head,1,i)||s.head-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function m(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||c,s=i.brackets||f,u=(0,a.qz)(t),h=u.resolve(e,n);return(r=g(h.type,n,s))?y(t,e,n,h,r,s):k(t,e,n,u,h.type,o,s)}function y(t,e,n,r,i,o){var a=r.parent,s={from:r.from,to:r.to},u=0,h=null==a?void 0:a.cursor;if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do{if(n<0?h.to<=r.from:h.from>=r.to){if(0==u&&i.indexOf(h.type.name)>-1)return{start:s,end:{from:h.from,to:h.to},matched:!0};if(g(h.type,n,o))u++;else if(g(h.type,-n,o)&&0==--u)return{start:s,end:{from:h.from,to:h.to},matched:!1}}}while(n<0?h.prevSibling():h.nextSibling());return{start:s,matched:!1}}function k(t,e,n,r,i,o,a){var s=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(s);if(u<0||u%2==0!=n>0)return null;for(var h={from:n<0?e-1:e,to:n>0?e+1:e},l=t.doc.iterRange(e,n>0?t.doc.length:0),c=0,f=0;!l.next().done&&f<=o;){var d=l.value;n<0&&(f+=d.length);for(var v=e+f*n,p=n>0?0:d.length-1,g=n>0?d.length:-1;p!=g;p+=n){var m=a.indexOf(d[p]);if(!(m<0||r.resolve(v+p,1).type!=i))if(m%2==0==n>0)c++;else{if(1==c)return{start:h,end:{from:v+p,to:v+p+1},matched:m>>1==u>>1};c--}}n>0&&(f+=d.length)}return l.done?{start:h,matched:!1}:null}function b(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function P(t,e,n){for(var i=(0,a.qz)(t).resolve(e.head),o=n?s.md.closedBy:s.md.openedBy,u=e.head;;){var h=n?i.childAfter(u):i.childBefore(u);if(!h)break;E(t,h,o)?i=h:u=n?h.to:h.from}var l,c;return c=i.type.prop(o)&&(l=n?m(t,i.from,1):m(t,i.to,-1))&&l.matched?n?l.end.to:l.end.from:n?i.to:i.from,r.jT.cursor(c,n?-1:1)}function R(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e):C(n,e)}))}var L=function(t){return R(t,!1)},B=function(t){return R(t,!0)};function N(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e,t.dom.clientHeight):C(n,e)}))}var I=function(t){return N(t,!1)},j=function(t){return N(t,!0)};function V(t,e,n){var i=t.visualLineAt(e.head),o=t.moveToLineBoundary(e,n);if(o.head==e.head&&o.head!=(n?i.to:i.from)&&(o=t.moveToLineBoundary(e,n,!1)),!n&&o.head==i.from&&i.length){var a=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;a&&e.head!=i.from+a&&(o=r.jT.cursor(i.from+a))}return o}var W=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from,1)}))},_=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to,-1)}))};function z(t,e,n){var i=!1,o=S(t.selection,(function(e){var o=m(t,e.head,-1)||m(t,e.head,1)||e.head>0&&m(t,e.head-1,1)||e.headh.from&&rn&&(i.empty||i.to>s.from)&&(e(s,o,i),n=s.number),a=s.to+1}var u=t.changes(o);return{changes:o,range:r.jT.range(u.mapPos(i.anchor,1),u.mapPos(i.head,1))}}))}var mt=function(t){var e=t.state,n=t.dispatch,r=Object.create(null),i=new a.Gn(e,{overrideIndentation:function(t){var e=r[t];return null==e?-1:e}}),o=gt(e,(function(t,n,o){var s=(0,a.K0)(i,t.from);if(null!=s){var u=/^\s*/.exec(t.text)[0],h=(0,a.SS)(e,s);(u!=h||o.from1?o=r.jT.create([i.main]):i.main.empty||(o=r.jT.create([r.jT.cursor(i.main.head)])),!!o&&(n(x(e,o)),!0)}},{key:"Alt-l",run:function(t){var e=t.state,n=t.dispatch,i=dt(e).map((function(t){var n=t.from,i=t.to;return r.jT.range(n,Math.min(i+1,e.doc.length))}));return n(e.update({selection:r.jT.create(i),annotations:r.YW.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(t){var e=t.state,n=t.dispatch,i=S(e.selection,(function(t){for(var n,i=(0,a.qz)(e).resolve(t.head,1);!(i.from=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent);)i=i.parent;return r.jT.range(i.to,i.from)}));return n(x(e,i)),!0}},{key:"Mod-[",run:kt},{key:"Mod-]",run:yt},{key:"Mod-Alt-\\",run:mt},{key:"Shift-Mod-k",run:function(t){var e=t.state,n=e.changes(dt(e).map((function(t){var n=t.from,r=t.to;return n>0?n--:r=e&&(n=i.type.prop(s.md.closedBy))&&n.indexOf(o.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(e,n),h=new a.Gn(e,{simulateBreak:n,simulateDoubleBreak:!!u}),l=(0,a.K0)(h,n);null==l&&(l=/^\s*/.exec(e.doc.lineAt(n).text)[0].length);for(var c=e.doc.lineAt(n);oc.from&&nn?n:Math.max(0,e-1)}))}},{mac:"Mod-Delete",run:ft}].concat([{key:"Ctrl-b",run:O,shift:F},{key:"Ctrl-f",run:T,shift:$},{key:"Ctrl-p",run:L,shift:G},{key:"Ctrl-n",run:B,shift:K},{key:"Ctrl-a",run:W,shift:Z},{key:"Ctrl-e",run:_,shift:tt},{key:"Ctrl-d",run:ut},{key:"Ctrl-h",run:function(t){return at(t,!1,!1)}},{key:"Ctrl-k",run:ft},{key:"Alt-d",run:ct},{key:"Ctrl-Alt-h",run:lt},{key:"Ctrl-o",run:function(t){var e=t.state,n=t.dispatch,o=e.changeByRange((function(t){return{changes:{from:t.from,to:t.to,insert:i.xv.of(["",""])},range:r.jT.cursor(t.from)}}));return n(e.update(o,{scrollIntoView:!0,annotations:r.YW.userEvent.of("input")})),!0}},{key:"Ctrl-t",run:function(t){var e=t.state,n=t.dispatch,o=e.changeByRange((function(t){if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};var n=t.from,o=e.doc.lineAt(n),a=n==o.from?n-1:(0,i.cp)(o.text,n-o.from,!1)+o.from,s=n==o.to?n+1:(0,i.cp)(o.text,n-o.from,!0)+o.from;return{changes:{from:a,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(a,n))},range:r.jT.cursor(s)}}));return!o.changes.empty&&(n(e.update(o,{scrollIntoView:!0})),!0)}},{key:"Alt-f",run:function(t){return D(t,!0)},shift:function(t){return U(t,!0)}},{key:"Alt-b",run:function(t){return D(t,!1)},shift:function(t){return U(t,!1)}},{key:"Alt-<",run:et},{key:"Alt->",run:nt},{key:"Ctrl-v",run:j},{key:"Alt-v",run:I}].map((function(t){return{mac:t.key,run:t.run,shift:t.shift}}))))},11254:function(t,e,n){"use strict";n.d(e,{Eu:function(){return B}});var r=n(19753),i=n(13764),o=n(77885);function a(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.i;)t.dom.removeChild(t.elements.pop().dom)}}]),t}(),O=function(){function t(e,n){var r=this;h(this,t),this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=function(t){r.dom.addEventListener(t,(function(r){var i=e.visualLineAtHeight(r.clientY,e.contentDOM.getBoundingClientRect().top);n.domEventHandlers[t](e,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=C(n.markers(e)),n.initialSpacer&&(this.spacer=new T(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return c(t,[{key:"update",value:function(t){var e=this.markers;if(this.markers=C(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],t);n!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[n])}return this.markers!=e}}]),t}(),T=function(){function t(e,n,r,i){h(this,t),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(e,n,r,i)}return c(t,[{key:"update",value:function(t,e,n,r){if(this.height!=e&&(this.dom.style.height=(this.height=e)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var i;i=this.dom.lastChild;)i.remove();var o,s="cm-gutterElement",u=a(r);try{for(u.s();!(o=u.n()).done;){var h=o.value,l=h.toDOM(t);l&&this.dom.appendChild(l);var c=h.elementClass;c&&(s+=" "+c)}}catch(f){u.e(f)}finally{u.f()}this.dom.className=s}}}]),t}();var D=o.r$.define(),E=o.r$.define({combine:function(t){return(0,o.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(t,e){var n=Object.assign({},t),r=function(t){var r=n[t],i=e[t];n[t]=r?function(t,e,n){return r(t,e,n)||i(t,e,n)}:i};for(var i in e)r(i);return n}})}}),P=function(t){f(n,t);var e=v(n);function n(t){var r;return h(this,n),(r=e.call(this)).number=t,r}return c(n,[{key:"eq",value:function(t){return this.number==t.number}},{key:"toDOM",value:function(){return document.createTextNode(this.number)}}]),n}(m);function R(t,e){return t.state.facet(E).formatNumber(e,t.state)}var L=b({class:"cm-lineNumbers",markers:function(t){return t.state.facet(D)},lineMarker:function(t,e,n){return n.length?null:new P(R(t,t.state.doc.lineAt(e.from).number))},initialSpacer:function(t){return new P(R(t,N(t.state.doc.lines)))},updateSpacer:function(t,e){var n=R(e.view,N(e.view.state.doc.lines));return n==t.number?t:new P(n)}});function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[E.of(t),L]}function N(t){for(var e=9;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?e:m.get(e.base||e,e.modified.concat(t).sort((function(t,e){return t.id-e.id})))}}}]),t}(),g=0,m=function(){function t(){c(this,t),this.instances=[],this.id=g++}return d(t,null,[{key:"get",value:function(e,n){if(!n.length)return e;var r=n[0].instances.find((function(t){return t.base==e&&(r=n,i=t.modified,r.length==i.length&&r.every((function(t,e){return t==i[e]})));var r,i}));if(r)return r;var i,o=[],a=new p(o,e,n),s=h(n);try{for(s.s();!(i=s.n()).done;){i.value.instances.push(a)}}catch(m){s.e(m)}finally{s.f()}var u,l=y(n),c=h(e.set);try{for(c.s();!(u=c.n()).done;){var f,d=u.value,v=h(l);try{for(v.s();!(f=v.n()).done;){var g=f.value;o.push(t.get(d,g))}}catch(m){v.e(m)}finally{v.f()}}}catch(m){c.e(m)}finally{c.f()}return a}}]),t}();function y(t){for(var e=[t],n=0;n0&&c+3==a.length){u=1;break}var f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+a);if(s.push("*"==f[0]?null:'"'==f[0][0]?JSON.parse(f[0]):f[0]),(c+=f[0].length)==a.length)break;var d=a[c++];if(c==a.length&&"!"==d){u=0;break}if("/"!=d)throw new RangeError("Invalid path: "+a);l=a.slice(c)}var v=s.length-1,p=s[v];if(!p)throw new RangeError("Invalid path: "+a);var g=new C(r,u,v>0?s.slice(0,v):null);e[p]=g.sort(e[p])}}}catch(m){o.e(m)}finally{o.f()}}return b.add(e)}var b=new r.md,w=a.r$.define({combine:function(t){return t.length?M.combinedMatch(t):null}}),S=a.r$.define({combine:function(t){return t.length?t[0].match:null}});function x(){return null}function A(t){return t.facet(w)||t.facet(S)||x}var C=function(){function t(e,n,r,i){c(this,t),this.tags=e,this.mode=n,this.context=r,this.next=i}return d(t,[{key:"sort",value:function(t){return!t||t.depth=n||v<=e)){D[l]=f.name,f.isTop&&(c=f);for(var p=u,g=f.prop(b),m=!1;g;){if(!g.context||P(g.context,D,l)){var y,k=h(g.tags);try{for(k.s();!(y=k.n()).done;){var w=y.value,S=r(w,c);S&&(p&&(p+=" "),p+=S,1==g.mode?u+=(u?" ":"")+S:0==g.mode&&(m=!0))}}catch(C){k.e(C)}finally{k.f()}break}g=g.next}if(p!=a&&(d>o&&a&&i(o,s.from,a),o=d,a=p),!m&&s.firstChild()){do{var x=s.to;if(t(u,l+1,c),a!=p){var A=Math.min(n,x);A>o&&a&&i(o,A,a),o=A,a=p}}while(s.nextSibling());s.parent()}}}("",0,t.type)}function P(t,e,n){if(t.length>n-1)return!1;for(var r=n-1,i=t.length-1;i>=0;i--,r--){var o=t[i];if(o&&o!=e[r])return!1}return!0}var R=p.define,L=R(),B=R(),N=R(B),I=R(),j=R(I),V=R(I),W=R(),_=R(W),z=R(),H=R(),q=R(),F=R(q),$=R(),U={comment:L,lineComment:R(L),blockComment:R(L),docComment:R(L),name:B,variableName:R(B),typeName:N,tagName:R(N),propertyName:R(B),className:R(B),labelName:R(B),namespace:R(B),macroName:R(B),literal:I,string:j,docString:R(j),character:R(j),number:V,integer:R(V),float:R(V),bool:R(I),regexp:R(I),escape:R(I),color:R(I),url:R(I),keyword:z,self:R(z),null:R(z),atom:R(z),unit:R(z),modifier:R(z),operatorKeyword:R(z),controlKeyword:R(z),definitionKeyword:R(z),operator:H,derefOperator:R(H),arithmeticOperator:R(H),logicOperator:R(H),bitwiseOperator:R(H),compareOperator:R(H),updateOperator:R(H),definitionOperator:R(H),typeOperator:R(H),controlOperator:R(H),punctuation:q,separator:R(q),bracket:F,angleBracket:R(F),squareBracket:R(F),paren:R(F),brace:R(F),content:W,heading:_,heading1:R(_),heading2:R(_),heading3:R(_),heading4:R(_),heading5:R(_),heading6:R(_),contentSeparator:R(W),list:R(W),quote:R(W),emphasis:R(W),strong:R(W),link:R(W),monospace:R(W),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:$,documentMeta:R($),annotation:R($),processingInstruction:R($),definition:p.defineModifier(),constant:p.defineModifier(),function:p.defineModifier(),standard:p.defineModifier(),local:p.defineModifier(),special:p.defineModifier()};M.define([{tag:U.link,textDecoration:"underline"},{tag:U.heading,textDecoration:"underline",fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strong,fontWeight:"bold"},{tag:U.keyword,color:"#708"},{tag:[U.atom,U.bool,U.url,U.contentSeparator,U.labelName],color:"#219"},{tag:[U.literal,U.inserted],color:"#164"},{tag:[U.string,U.deleted],color:"#a11"},{tag:[U.regexp,U.escape,U.special(U.string)],color:"#e40"},{tag:U.definition(U.variableName),color:"#00f"},{tag:U.local(U.variableName),color:"#30a"},{tag:[U.typeName,U.namespace],color:"#085"},{tag:U.className,color:"#167"},{tag:[U.special(U.variableName),U.macroName],color:"#256"},{tag:U.definition(U.propertyName),color:"#00c"},{tag:U.comment,color:"#940"},{tag:U.meta,color:"#7a757a"},{tag:U.invalid,color:"#f00"}]),M.define([{tag:U.link,class:"cmt-link"},{tag:U.heading,class:"cmt-heading"},{tag:U.emphasis,class:"cmt-emphasis"},{tag:U.strong,class:"cmt-strong"},{tag:U.keyword,class:"cmt-keyword"},{tag:U.atom,class:"cmt-atom"},{tag:U.bool,class:"cmt-bool"},{tag:U.url,class:"cmt-url"},{tag:U.labelName,class:"cmt-labelName"},{tag:U.inserted,class:"cmt-inserted"},{tag:U.deleted,class:"cmt-deleted"},{tag:U.literal,class:"cmt-literal"},{tag:U.string,class:"cmt-string"},{tag:U.number,class:"cmt-number"},{tag:[U.regexp,U.escape,U.special(U.string)],class:"cmt-string2"},{tag:U.variableName,class:"cmt-variableName"},{tag:U.local(U.variableName),class:"cmt-variableName cmt-local"},{tag:U.definition(U.variableName),class:"cmt-variableName cmt-definition"},{tag:U.special(U.variableName),class:"cmt-variableName2"},{tag:U.typeName,class:"cmt-typeName"},{tag:U.namespace,class:"cmt-namespace"},{tag:U.macroName,class:"cmt-macroName"},{tag:U.propertyName,class:"cmt-propertyName"},{tag:U.operator,class:"cmt-operator"},{tag:U.comment,class:"cmt-comment"},{tag:U.meta,class:"cmt-meta"},{tag:U.invalid,class:"cmt-invalid"},{tag:U.punctuation,class:"cmt-punctuation"}])},62118:function(t,e,n){"use strict";n.d(e,{m8:function(){return p},f$:function(){return P}});var r=n(77885),i=n(19753);function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return[v,d.of(t),i.tk.domEventHandlers({beforeinput:function(t,e){return"historyUndo"==t.inputType?m(e):"historyRedo"==t.inputType&&y(e)}})]}function g(t,e){return function(n){var r=n.state,i=n.dispatch,o=r.field(v,!1);if(!o)return!1;var a=o.pop(t,r,e);return!!a&&(i(a),!0)}}var m=g(0,!1),y=g(1,!1),k=g(0,!0),b=g(1,!0);function w(t){return function(e){var n=e.field(v,!1);if(!n)return 0;var r=0==t?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}w(0),w(1);var S=function(){function t(e,n,r,i,o){s(this,t),this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return h(t,[{key:"setSelAfter",value:function(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}},{key:"toJSON",value:function(){var t,e,n;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((function(t){return t.toJSON()}))}}}],[{key:"fromJSON",value:function(e){return new t(e.changes&&r.as.fromJSON(e.changes),[],e.mapped&&r.n0.fromJSON(e.mapped),e.startSelection&&r.jT.fromJSON(e.startSelection),e.selectionsAfter.map(r.jT.fromJSON))}},{key:"fromTransaction",value:function(e){var n,r=C,i=o(e.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var a=(0,n.value)(e);a.length&&(r=r.concat(a))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),r,void 0,e.startState.selection,C)}},{key:"selection",value:function(e){return new t(void 0,C,void 0,void 0,e)}}]),t}();function x(t,e,n,r){var i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function A(t,e){return t.length?e.length?t.concat(e):t:e}var C=[];function M(t,e){if(t.length){var n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),x(t,t.length-1,1e9,n.setSelAfter(r)))}return[S.selection([e])]}function O(t){var e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function T(t,e){if(!t.length)return t;for(var n=t.length,r=C;n;){var i=D(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=t.slice(0,n);return o[n-1]=i,o}e=i.mapped,n--,r=i.selectionsAfter}return r.length?[S.selection(r)]:C}function D(t,e,n){var i=A(t.selectionsAfter.length?t.selectionsAfter.map((function(t){return t.map(e)})):C,n);if(!t.changes)return S.selection(i);var o=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new S(o,r.Py.mapEffects(t.effects,e),s,t.startSelection.map(a),i)}var E=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;s(this,t),this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return h(t,[{key:"isolate",value:function(){return this.prevTime?new t(this.done,this.undone):this}},{key:"addChanges",value:function(e,n,r,i,o){var a=this.done,s=a[a.length-1];return new t(a=s&&s.changes&&n-this.prevTime=s&&i<=u&&(r=!0)}})),r}(s.changes,e.changes)?x(a,a.length-1,o,new S(e.changes.compose(s.changes),A(e.effects,s.effects),s.mapped,s.startSelection,C)):x(a,a.length,o,e),C,n,r)}},{key:"addSelection",value:function(e,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:C;return s.length>0&&n-this.prevTime=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];p(this,t),this.data=e,this.topNode=r,o.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(o.yy.prototype,"tree",{get:function(){return S(this)}}),this.parser=n,this.extension=[E.of(this),o.yy.languageData.of((function(t,e){return t.facet(w(t,e))}))].concat(i)}return m(t,[{key:"isActiveAt",value:function(t,e){return w(t,e)==this.data}},{key:"findRegions",value:function(t){var e=this,n=t.facet(E);if((null==n?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return S(t).iterate({enter:function(t,n,i){if(t.isTop&&t.prop(y)==e.data)return r.push({from:n,to:i}),!1}}),r}},{key:"parseString",value:function(t){for(var e,n=i.xv.of(t.split("\n")),a=this.parser.startParse(new x(n),0,new A(this.parser,o.yy.create({doc:n}),[],r.mp.empty,{from:0,to:t.length},[],null));!(e=a.advance()););return e}},{key:"allowsNesting",get:function(){return!0}}]),t}();function w(t,e){var n=t.facet(E);if(!n)return null;if(!n.allowsNesting)return n.data;for(var r=S(t).resolve(e,-1);r;){var i=r.type.prop(y);if(i)return i;r=r.parent}return n.data}b.setState=o.Py.define();function S(t){var e=t.field(b.state,!1);return e?e.tree:r.mp.empty}var x=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;p(this,t),this.doc=e,this.length=n,this.cursorPos=0,this.string="",this.prevString="",this.cursor=e.iter()}return m(t,[{key:"syncTo",value:function(t){return t=this.length)return-1;var e=this.cursorPos-this.string.length;if(t=this.cursorPos){if(t=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}},{key:"lineAfter",value:function(t){if(t>=this.length||t<0)return"";var e=this.cursorPos-this.string.length;return(t=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e,Math.min(this.length-e,this.string.length))}},{key:"read",value:function(t,e){var n=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}},{key:"clip",value:function(e){return new t(this.doc,e)}}]),t}(),A=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;p(this,t),this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.viewport=o,this.skipped=a,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}return m(t,[{key:"work",value:function(t,e){if(this.tree!=r.mp.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new x(this.state.doc),0,this));for(var n=Date.now()+t;;){var i=this.parse.advance();if(i)return this.fragments=this.withoutTempSkipped(r.i9.addTree(i)),this.parse=null,this.tree=i,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>n)return!1}}},{key:"takeTree",value:function(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)))}},{key:"withoutTempSkipped",value:function(t){for(var e;e=this.tempSkipped.pop();)t=C(t,e.from,e.to);return t}},{key:"changes",value:function(e,n){var i=this.fragments,o=this.tree,a=this.viewport,u=this.skipped;if(this.takeTree(),!e.empty){var h=[];if(e.iterChangedRanges((function(t,e,n,r){return h.push({fromA:t,toA:e,fromB:n,toB:r})})),i=r.i9.applyChanges(i,h),o=r.mp.empty,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];var l,c=s(this.skipped);try{for(c.s();!(l=c.n()).done;){var f=l.value,d=e.mapPos(f.from,1),v=e.mapPos(f.to,-1);dt.from&&(this.fragments=C(this.fragments,i,o),this.skipped.splice(n--,1))}return this.skipped.length=t}}],[{key:"getSkippingParser",value:function(t){return{startParse:function(e,n,i){return{pos:n,advance:function(){var o=i;return o.tempSkipped.push({from:n,to:e.length}),t&&(o.scheduleOn=o.scheduleOn?Promise.all([o.scheduleOn,t]):t),this.pos=e.length,new r.mp(r.Jq.none,[],[],e.length-n)},forceFinish:function(){return this.advance()}}}}}}]),t}();function C(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}A.skippingParser=A.getSkippingParser();var M=function(){function t(e){p(this,t),this.context=e,this.tree=e.tree}return m(t,[{key:"apply",value:function(e){if(!e.docChanged)return this;var n=this.context.changes(e.changes,e.state),r=this.context.tree.length==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.tree.length),n.viewport.to);return n.work(25,r)||n.takeTree(),new t(n)}}],[{key:"init",value:function(e){var n=new A(e.facet(E).parser,e,[],r.mp.empty,{from:0,to:e.doc.length},[],null);return n.work(25)||n.takeTree(),new t(n)}}]),t}();b.state=o.QQ.define({create:M.init,update:function(t,e){var n,r=s(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(b.setState))return i.value}}catch(o){r.e(o)}finally{r.f()}return e.startState.facet(E)!=e.state.facet(E)?M.init(e.state):t.apply(e)}});var O="undefined"!=typeof window&&window.requestIdleCallback||function(t,e){var n=e.timeout;return setTimeout(t,n)},T="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,D=a.lg.fromClass(function(){function t(e){p(this,t),this.view=e,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return m(t,[{key:"update",value:function(t){var e=this.view.state.field(b.state).context;t.viewportChanged&&(e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()),t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}},{key:"scheduleWork",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!(this.working>-1)){var e=this.view.state,n=e.field(b.state);!t&&n.tree.length>=e.doc.length||(this.working=O(this.work,{timeout:500}))}}},{key:"work",value:function(t){this.working=-1;var e=Date.now();if(this.chunkEnd=i+1e6)){var a=Math.min(this.chunkBudget,t?Math.max(25,t.timeRemaining()):100),s=o.context.work(a,i+1e6);this.chunkBudget-=Date.now()-e,(s||this.chunkBudget<=0||o.context.movedPast(i))&&(o.context.takeTree(),this.view.dispatch({effects:b.setState.of(new M(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(t){var e=this;t.scheduleOn&&(t.scheduleOn.then((function(){return e.scheduleWork(!0)})),t.scheduleOn=null)}},{key:"destroy",value:function(){this.working>=0&&T(this.working)}}]),t}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),E=o.r$.define({combine:function(t){return t.length?t[0]:null},enables:[b.state,D]}),P=o.r$.define(),R=o.r$.define({combine:function(t){if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function L(t){var e=t.facet(R);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function B(t,e){var n="",r=t.tabSize;if(9==t.facet(R).charCodeAt(0))for(;e>=r;)n+="\t",e-=r;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};p(this,t),this.state=e,this.options=n,this.unit=L(e)}return m(t,[{key:"textAfterPos",value:function(t){var e,n,r=null===(e=this.options)||void 0===e?void 0:e.simulateBreak;return t==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(t,Math.min(t+100,null!=r&&r>t?r:1e9,this.state.doc.lineAt(t).to))}},{key:"column",value:function(t){var e,n=this.state.doc.lineAt(t),r=n.text.slice(0,t-n.from),i=this.countColumn(r,t-n.from),o=(null===(e=this.options)||void 0===e?void 0:e.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S/))),i}},{key:"countColumn",value:function(t,e){return(0,i.IS)(e<0?t:t.slice(0,e),0,this.state.tabSize)}},{key:"lineIndent",value:function(t){var e,n=null===(e=this.options)||void 0===e?void 0:e.overrideIndentation;if(n){var r=n(t.from);if(r>-1)return r}return this.countColumn(t.text,t.text.search(/\S/))}}]),t}(),j=new r.md;function V(t){var e=t.type.prop(j);if(e)return e;var n,i=t.firstChild;if(i&&(n=i.type.prop(r.md.closedBy))){var o=t.lastChild,a=o&&n.indexOf(o.name)>-1;return function(t){return q(t,!0,1,void 0,a&&!function(t){var e,n;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&(null===(n=t.options)||void 0===n?void 0:n.simulateDoubleBreak)}(t)?o.from:void 0)}}return null==t.parent?_:null}function W(t,e,n){for(;t;t=t.parent){var r=V(t);if(r)return r(new z(n,e,t))}return null}function _(){return 0}var z=function(t){l(n,t);var e=f(n);function n(t,r,i){var o;return p(this,n),(o=e.call(this,t.state,t.options)).base=t,o.pos=r,o.node=i,o}return m(n,[{key:"continue",value:function(){var t=this.node.parent;return t?W(t,this.pos,this.base):0}},{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var t=this.state.doc.lineAt(this.node.from);;){for(var e=this.node.resolve(t.from);e.parent&&e.parent.from==e.from;)e=e.parent;if(H(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t)}}]),n}(I);function H(t,e){for(var n=e;n;n=n.parent)if(t==n)return!0;return!1}function q(t,e,n,r,i){var o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,u=e?function(t){var e,n=t.node,r=n.childAfter(n.from),i=n.lastChild;if(!r)return null;for(var o=null===(e=t.options)||void 0===e?void 0:e.simulateBreak,a=t.state.doc.lineAt(r.from),s=null==o||o<=a.from?a.to:Math.min(a.to,o),u=r.to;;){var h=n.childAfter(u);if(!h||h==i)return null;if(!h.type.isSkipped)return h.from!?|~^]/,o=/^[:\[\(\{]/,a=["true","false"],s=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function u(t,e){var n=t.peek();if(e.incomment)return t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(e.intag){if(e.operator){if(e.operator=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.sign){if(e.sign=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.instring)return n==e.instring&&(e.instring=!1),t.next(),"string";if("'"==n||'"'==n)return e.instring=n,t.next(),"string";if(t.match(e.intag+"}")||t.eat("-")&&t.match(e.intag+"}"))return e.intag=!1,"tag";if(t.match(i))return e.operator=!0,"operator";if(t.match(o))e.sign=!0;else if(t.eat(" ")||t.sol()){if(t.match(r))return"keyword";if(t.match(a))return"atom";if(t.match(s))return"number";t.sol()&&t.next()}else t.next();return"variable"}if(t.eat("{")){if(t.eat("#"))return e.incomment=!0,t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(n=t.eat(/\{|%/))return e.intag=n,"{"==n&&(e.intag="}"),t.eat("-"),"tag"}t.next()}r=new RegExp("(("+r.join(")|(")+"))\\b"),a=new RegExp("(("+a.join(")|(")+"))\\b");var h={startState:function(){return{tokenize:u}},token:function(t,e){return e.tokenize(t,e)},languageData:{commentTokens:{block:{open:"{#",close:"#}"}}}}},8987:function(t,e,n){"use strict";n.d(e,{r:function(){return i}});var r=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i"),i={token:function(t,e){var n=t.peek(),i=e.escaped;if(e.escaped=!1,"#"==n&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---"))return"def";if(t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==n?e.inlinePairs++:"}"==n?e.inlinePairs--:"["==n?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&","==n)return t.next(),"meta";if(e.inlinePairs>0&&!i&&","==n)return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(0==e.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(r))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped="\\"==n,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}}},13764:function(t,e,n){"use strict";n.d(e,{Xs:function(){return d},f_:function(){return v},uU:function(){return h}});var r=n(77885);function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;return new l(t,e,this)}}]),t}();h.prototype.startSide=h.prototype.endSide=0,h.prototype.point=!1,h.prototype.mapMode=r.gc.TrackDel;var l=function t(e,n,r){a(this,t),this.from=e,this.to=n,this.value=r};function c(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var f=function(){function t(e,n,r,i){a(this,t),this.from=e,this.to=n,this.value=r,this.maxPoint=i}return u(t,[{key:"findIndex",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e9*e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t<=0)return r;for(var i=e<0?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-t||(e<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==o)return u>=0?o:a;u>=0?a=s:o=s+1}}},{key:"between",value:function(t,e,n,r){for(var i=this.findIndex(e,-1),o=this.findIndex(n,1,void 0,i);i(d=n.mapPos(c,h.endSide))||f==d&&h.startSide>0&&h.endSide<=0)continue;(d-f||h.endSide-h.startSide)<0||(a<0&&(a=f),h.point&&(s=Math.max(s,d-f)),r.push(h),i.push(f-a),o.push(d-a))}return{mapped:r.length?new t(i,o,r,s):null,pos:a}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),t}(),d=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.empty,i=arguments.length>3?arguments[3]:void 0;a(this,t),this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return u(t,[{key:"chunkEnd",value:function(t){return this.chunkPos[t]+this.chunk[t].length}},{key:"update",value:function(e){var n=e.add,r=void 0===n?[]:n,i=e.sort,o=void 0!==i&&i,a=e.filterFrom,s=void 0===a?0:a,u=e.filterTo,h=void 0===u?this.length:u,f=e.filter;if(0==r.length&&!f)return this;if(o&&r.slice().sort(c),this==t.empty)return r.length?t.of(r):this;for(var d=new g(this,null,-1).goto(0),p=0,m=[],y=new v;d.value||p=0){var k=r[p++];y.addInner(k.from,k.to,k.value)||m.push(k)}else 1==d.rangeIndex&&d.chunkIndexthis.chunkEnd(d.chunkIndex)||hd.to||h=o&&e<=o+a.length&&!1===a.between(o,e-o,n-o,r))return}this.nextLayer.between(e,n,r)}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(t)}},{key:"length",get:function(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}},{key:"size",get:function(){if(this==t.empty)return 0;var e,n=this.nextLayer.size,r=i(this.chunk);try{for(r.s();!(e=r.n()).done;){n+=e.value.value.length}}catch(o){r.e(o)}finally{r.f()}return n}}],[{key:"iter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(t).goto(e)}},{key:"compare",value:function(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.filter((function(e){return e.maxPoint>=500||e!=t.empty&&n.indexOf(e)<0&&e.maxPoint>=o})),s=n.filter((function(n){return n.maxPoint>=500||n!=t.empty&&e.indexOf(n)<0&&n.maxPoint>=o})),u=p(a,s),h=new k(a,u,o),l=new k(s,u,o);r.iterGaps((function(t,e,n){return b(h,t,l,e,n,i)})),r.empty&&0==r.length&&b(h,0,l,0,0,i)}},{key:"spans",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new k(t,null,i).goto(e),a=e,s=o.openStart;;){var u=Math.min(o.to,n);if(o.point?(r.point(a,u,o.point,o.activeForPoint(o.to),s),s=o.openEnd(u)+(o.to>u?1:0)):u>a&&(r.span(a,u,o.active,s),s=o.openEnd(u)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new v,o=i(t instanceof l?[t]:n?t.slice().sort(c):t);try{for(o.s();!(e=o.n()).done;){var a=e.value;r.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return r.finish()}}]),t}();d.empty=new d([],[],null,-1),d.empty.nextLayer=d.empty;var v=function(){function t(){a(this,t),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return u(t,[{key:"finishChunk",value:function(t){this.chunks.push(new f(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,r)}},{key:"addInner",value:function(t,e,n){var r=t-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}},{key:"addChunk",value:function(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}},{key:"finish",value:function(){return this.finishInner(d.empty)}},{key:"finishInner",value:function(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=new d(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}]),t}();function p(t,e){var n,r=new Map,o=i(t);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;a(this,t),this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}},{key:"gotoInner",value:function(t,e,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),t}(),m=function(){function t(e){a(this,t),this.heap=e}return u(t,[{key:"goto",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9,r=i(this.heap);try{for(r.s();!(e=r.n()).done;){var o=e.value;o.goto(t,n)}}catch(s){r.e(s)}finally{r.f()}for(var a=this.heap.length>>1;a>=0;a--)y(this.heap,a);return this.next(),this}},{key:"forward",value:function(t,e){var n,r=i(this.heap);try{for(r.s();!(n=r.n()).done;){n.value.forward(t,e)}}catch(a){r.e(a)}finally{r.f()}for(var o=this.heap.length>>1;o>=0;o--)y(this.heap,o);(this.to-t||this.value.endSide-e)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),y(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new g(a,n,r,o));return 1==i.length?i[0]:new t(i)}}]),t}();function y(t,e){for(var n=t[e];;){var r=1+(e<<1);if(r>=t.length)break;var i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}var k=function(){function t(e,n,r){a(this,t),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=m.from(e,n,r)}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}},{key:"forward",value:function(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}},{key:"removeActive",value:function(t){S(this.active,t),S(this.activeTo,t),S(this.activeRank,t),this.minActive=A(this.active,this.activeTo)}},{key:"addActive",value:function(t){for(var e=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;e-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),e&&S(e,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.fromt&&this.forward(this.to,this.endSide);break}this.addActive(e),this.cursor.next()}}if(e){for(var o=0;othis.pointRank);n++)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>this.point.endSide)&&e.push(this.active[n]);return e}},{key:"openEnd",value:function(t){for(var e=0;et;)e++;return e}}]),t}();function b(t,e,n,r,i,o){t.goto(e),n.goto(r);for(var a=r+i,s=r,u=r-e;;){var h=t.to+u-n.to||t.endSide-n.endSide,l=h<0?t.to+u:n.to,c=Math.min(l,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))||o.comparePoint(s,c,t.point,n.point):c>s&&!w(t.active,n.active)&&o.compareRange(s,c,t.active,n.active),l>a)break;s=l,h<=0&&t.next(),h>=0&&n.next()}}function w(t,e){if(t.length!=e.length)return!1;for(var n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function A(t,e){for(var n=-1,r=1e9,i=0;ia?-1:i==r.length?function(t,e){var n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):(0,o.IS)(r.text.slice(0,n-r.from),0,t.state.tabSize);return{line:r.number,col:s,off:i}}function u(t,e){var n=s(t,e),i=t.state.selection;return n?{update:function(t){if(t.docChanged){var e=t.changes.mapPos(t.startState.doc.line(n.line).from),r=t.state.doc.lineAt(e);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(t.changes)}},get:function(e,u,h){var l=s(t,e);if(!l)return i;var c=function(t,e,n){var i=Math.min(e.line,n.line),s=Math.max(e.line,n.line),u=[];if(e.off>a||n.off>a||e.col<0||n.col<0)for(var h=Math.min(e.off,n.off),l=Math.max(e.off,n.off),c=i;c<=s;c++){var f=t.doc.line(c);f.length<=l&&u.push(r.jT.range(f.from+h,f.to+l))}else for(var d=Math.min(e.col,n.col),v=Math.max(e.col,n.col),p=i;p<=s;p++){var g=t.doc.line(p),m=g.length>a?g.text.slice(0,2*v):g.text,y=(0,o.Gz)(m,0,d,t.tabSize),k=(0,o.Gz)(m,0,v,t.tabSize);y.leftOver||u.push(r.jT.range(g.from+y.offset,g.from+k.offset))}return u}(t.state,n,l);return c.length?h?r.jT.create(c.concat(i.ranges)):r.jT.create(c):i}}:null}function h(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button};return i.tk.mouseSelectionStyle.of((function(t,n){return e(n)?u(t,n):null}))}},72360:function(t,e,n){"use strict";n.d(e,{sW:function(){return Y},Lp:function(){return bt}});var r=n(19753),i=n(77885);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?n.panels[r]:null}var f=r.lg.fromClass(function(){function t(e){o(this,t),this.input=e.state.facet(g),this.specs=this.input.filter((function(t){return t})),this.panels=this.specs.map((function(t){return t(e)}));var n=e.state.facet(l);this.top=new d(e,!0,n.topContainer),this.bottom=new d(e,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(t){return t.top}))),this.bottom.sync(this.panels.filter((function(t){return!t.top})));var r,i=u(this.panels);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.dom.classList.add("cm-panel"),a.class&&a.dom.classList.add(a.class),a.mount&&a.mount()}}catch(s){i.e(s)}finally{i.f()}}return s(t,[{key:"update",value:function(t){var e=t.state.facet(l);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new d(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new d(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=t.state.facet(g);if(n!=this.input){var r,i=n.filter((function(t){return t})),o=[],a=[],s=[],h=[],c=u(i);try{for(c.s();!(r=c.n()).done;){var f=r.value,v=this.specs.indexOf(f),p=void 0;v<0?(p=f(t.view),h.push(p)):(p=this.panels[v]).update&&p.update(t),o.push(p),(p.top?a:s).push(p)}}catch(x){c.e(x)}finally{c.f()}this.specs=i,this.panels=o,this.top.sync(a),this.bottom.sync(s);for(var m=0,y=h;m=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||P(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){if(t){if("string"==typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length,o=arguments.length>4?arguments[4]:void 0;L(this,t),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(t){return o(I(t))}:I,this.query=this.normalize(n)}return N(t,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,w.gm)(this.buffer,this.bufferPos)}},{key:"next",value:function(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}},{key:"nextOverlapping",value:function(){for(;;){var t=this.peek();if(t<0)return this.done=!0,this;var e=(0,w.bg)(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,w.nZ)(t);for(var r=this.normalize(e),i=0,o=n;;i++){var a=r.charCodeAt(i),s=this.match(a,o);if(s)return this.value=s,this;if(i==r.length-1)break;o==n&&i3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.length;if(L(this,t),this.to=o,this.curLine="",this.done=!1,this.value=V,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new q(e,n,r,i,o);this.re=new RegExp(n,W+((null==r?void 0:r.ignoreCase)?"i":"")),this.iter=e.iter();var a=e.lineAt(i);this.curLineStart=a.from,this.matchPos=i,this.getLine(this.curLineStart)}return N(t,[{key:"getLine",value:function(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}},{key:"nextLine",value:function(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}},{key:"next",value:function(){for(var t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;var e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){var n=this.curLineStart+e.index,r=n+e[0].length;if(this.matchPos=r+(n==r?1:0),n==this.curLine.length&&this.nextLine(),nthis.value.to)return this.value={from:n,to:r,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=r||i.to<=n){var o=new t(n,e.sliceString(n,r));return z.set(e,o),o}if(i.from==n&&i.to==r)return i;var a=i.text,s=i.from;return s>n&&(a=e.sliceString(n,s)+a,s=n),i.to=this.to?this.to:this.text.lineAt(t).to}},{key:"next",value:function(){for(;;){var t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e&&this.flat.tothis.flat.text.length-10&&(e=null),e){var n=this.flat.from+e.index,r=n+e[0].length;return this.value={from:n,to:r,match:e},this.matchPos=r+(n==r?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=H.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}]),t}();function F(t){var e=k("input",{class:"cm-textfield",name:"line"});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(n){var r=t.state,o=r.doc.lineAt(r.selection.main.head),a=E(n,5),s=a[1],u=a[2],h=a[3],l=a[4],c=h?+h.slice(1):0,f=u?+u:o.number;if(u&&l){var d=f/100;s&&(d=d*("-"==s?-1:1)+o.number/r.doc.lines),f=Math.round(r.doc.lines*d)}else u&&s&&(f=f*("-"==s?-1:1)+o.number);var v=r.doc.line(Math.max(1,Math.min(r.doc.lines,f)));t.dispatch({effects:$.of(!1),selection:i.jT.cursor(v.from+Math.max(0,Math.min(c,v.length))),scrollIntoView:!0}),t.focus()}}return{dom:k("form",{class:"cm-gotoLine",onkeydown:function(e){27==e.keyCode?(e.preventDefault(),t.dispatch({effects:$.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),n())},onsubmit:function(t){t.preventDefault(),n()}},k("label",t.state.phrase("Go to line"),": ",e)," ",k("button",{class:"cm-button",type:"submit"},t.state.phrase("go"))),pos:-10}}var $=i.Py.define(),U=i.QQ.define({create:function(){return!0},update:function(t,e){var n,r=D(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is($)&&(t=i.value)}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return g.from(t,(function(t){return t?F:null}))}}),J=r.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),G={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},K=i.r$.define({combine:function(t){return(0,i.BO)(t,G,{highlightWordAroundCursor:function(t,e){return t||e},minSelectionLength:Math.min,maxMatches:Math.min})}});function Y(t){var e=[tt,Z];return t&&e.push(K.of(t)),e}var X=r.p.mark({class:"cm-selectionMatch"}),Q=r.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"}),Z=r.lg.fromClass(function(){function t(e){L(this,t),this.decorations=this.getDeco(e)}return N(t,[{key:"update",value:function(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e=t.state.facet(K),n=t.state,o=n.selection;if(o.ranges.length>1)return r.p.none;var a,s=o.main,u=null;if(s.empty){if(!e.highlightWordAroundCursor)return r.p.none;if(u=n.charCategorizer(s.head),!(a=function(t,e,n){for(var r=t.lineAt(e),o=e-r.from,a=e-r.from;o>0;){var s=(0,w.cp)(r.text,o,!1);if(n(r.text.slice(s,o))!=i.D0.Word)break;o=s}for(;a200)return r.p.none;if(!(a=n.sliceDoc(s.from,s.to).trim()))return r.p.none}var l,c=[],f=D(t.visibleRanges);try{for(f.s();!(l=f.n()).done;)for(var d=l.value,v=new j(n.doc,a,d.from,d.to);!v.nextOverlapping().done;){var p=v.value,g=p.from,m=p.to;if((!u||(0==g||u(n.sliceDoc(g-1,g))!=i.D0.Word)&&(m==n.doc.length||u(n.sliceDoc(m,m+1))!=i.D0.Word))&&(u&&g<=s.from&&m>=s.to?c.push(Q.range(g,m)):(g>=s.to||m<=s.from)&&c.push(X.range(g,m)),c.length>e.maxMatches))return r.p.none}}catch(y){f.e(y)}finally{f.f()}return r.p.set(c)}}]),t}(),{decorations:function(t){return t.decorations}}),tt=r.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),et=function(){function t(e,n,r){L(this,t),this.search=e,this.replace=n,this.caseInsensitive=r}return N(t,[{key:"eq",value:function(t){return this.search==t.search&&this.replace==t.replace&&this.caseInsensitive==t.caseInsensitive&&this.constructor==t.constructor}}]),t}(),nt=function(t){A(n,t);var e=M(n);function n(t,r,i){var o;return L(this,n),(o=e.call(this,t,r,i)).unquoted=t.replace(/\\([nrt\\])/g,(function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"})),o}return N(n,[{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;return new j(t,this.unquoted,e,n,this.caseInsensitive?function(t){return t.toLowerCase()}:void 0)}},{key:"nextMatch",value:function(t,e,n){var r=this.cursor(t,n).nextOverlapping();return r.done&&(r=this.cursor(t,0,e).nextOverlapping()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(t,e,n){for(var r=n;;){for(var i=Math.max(e,r-1e4-this.unquoted.length),o=this.cursor(t,i,r),a=null;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(i==e)return null;r-=1e4}}},{key:"prevMatch",value:function(t,e,n){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,n,t.length)}},{key:"getReplacement",value:function(t){return this.replace}},{key:"matchAll",value:function(t,e){for(var n=this.cursor(t),r=[];!n.next().done;){if(r.length>=e)return null;r.push(n.value)}return r}},{key:"highlight",value:function(t,e,n,r){for(var i=this.cursor(t,Math.max(0,e-this.unquoted.length),Math.min(n+this.unquoted.length,t.length));!i.next().done;)r(i.value.from,i.value.to)}},{key:"valid",get:function(){return!!this.search}}]),n}(et),rt=function(t){A(n,t);var e=M(n);function n(t,r,i){var o;return L(this,n),(o=e.call(this,t,r,i)).valid=!!t&&function(t){try{return new RegExp(t,W),!0}catch(e){return!1}}(t),o}return N(n,[{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;return new _(t,this.search,this.caseInsensitive?{ignoreCase:!0}:void 0,e,n)}},{key:"nextMatch",value:function(t,e,n){var r=this.cursor(t,n).next();return r.done&&(r=this.cursor(t,0,e).next()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(t,e,n){for(var r=1;;r++){for(var i=Math.max(e,n-1e4*r),o=this.cursor(t,i,n),a=null;!o.next().done;)a=o.value;if(a&&(i==e||a.from>i+10))return a;if(i==e)return null}}},{key:"prevMatch",value:function(t,e,n){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,n,t.length)}},{key:"getReplacement",value:function(t){return this.replace.replace(/\$([$&\d+])/g,(function(e,n){return"$"==n?"$":"&"==n?t.match[0]:"0"!=n&&+n=e)return null;r.push(n.value)}return r}},{key:"highlight",value:function(t,e,n,r){for(var i=this.cursor(t,Math.max(0,e-250),Math.min(n+250,t.length));!i.next().done;)r(i.value.from,i.value.to)}}]),n}(et),it=i.Py.define(),ot=i.Py.define(),at=i.QQ.define({create:function(){return new st(new nt("","",!1),null)},update:function(t,e){var n,r=D(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(it)?t=new st(i.value,t.panel):i.is(ot)&&(t=new st(t.query,i.value?mt:null))}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return g.from(t,(function(t){return t.panel}))}}),st=function t(e,n){L(this,t),this.query=e,this.panel=n},ut=r.p.mark({class:"cm-searchMatch"}),ht=r.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lt=r.lg.fromClass(function(){function t(e){L(this,t),this.view=e,this.decorations=this.highlight(e.state.field(at))}return N(t,[{key:"update",value:function(t){var e=t.state.field(at);(e!=t.startState.field(at)||t.docChanged||t.selectionSet)&&(this.decorations=this.highlight(e))}},{key:"highlight",value:function(t){var e=t.query;if(!t.panel||!e.valid)return r.p.none;for(var n=this.view,i=new m.f_,o=0,a=n.visibleRanges,s=a.length;oa[o+1].from-500;)l=a[++o].to;e.highlight(n.state.doc,h,l,(function(t,e){var r=n.state.selection.ranges.some((function(n){return n.from==t&&n.to==e}));i.add(t,e,r?ht:ut)}))}return i.finish()}}]),t}(),{decorations:function(t){return t.decorations}});function ct(t){return function(e){var n=e.state.field(at,!1);return n&&n.query.valid?t(e,n):yt(e)}}var ft=ct((function(t,e){var n=e.query,r=t.state.selection.main,i=r.from,o=r.to,a=n.nextMatch(t.state.doc,i,o);return!(!a||a.from==i&&a.to==o)&&(t.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0,effects:xt(t,a)}),!0)})),dt=ct((function(t,e){var n=e.query,r=t.state,i=r.selection.main,o=i.from,a=i.to,s=n.prevMatch(r.doc,o,a);return!!s&&(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:xt(t,s)}),!0)})),vt=ct((function(t,e){var n=e.query.matchAll(t.state.doc,1e3);return!(!n||!n.length)&&(t.dispatch({selection:i.jT.create(n.map((function(t){return i.jT.range(t.from,t.to)})))}),!0)})),pt=ct((function(t,e){var n=e.query,r=t.state,i=r.selection.main,o=i.from,a=i.to,s=n.nextMatch(r.doc,o,o);if(!s)return!1;var u,h,l=[];if(s.from==o&&s.to==a&&(h=r.toText(n.getReplacement(s)),l.push({from:s.from,to:s.to,insert:h}),s=n.nextMatch(r.doc,s.from,s.to)),s){var c=0==l.length||l[0].from>=s.to?0:s.to-s.from-h.length;u={anchor:s.from-c,head:s.to-c}}return t.dispatch({changes:l,selection:u,scrollIntoView:!!u,effects:s?xt(t,s):void 0}),!0})),gt=ct((function(t,e){var n=e.query,r=n.matchAll(t.state.doc,1e9).map((function(t){return{from:t.from,to:t.to,insert:n.getReplacement(t)}}));return!!r.length&&(t.dispatch({changes:r}),!0)}));function mt(t){var e=t.state.field(at).query;return{dom:wt({view:t,query:e,updateQuery:function(n){e.eq(n)||(e=n,t.dispatch({effects:it.of(e)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80}}var yt=function(t){var e=t.state.field(at,!1);if(e&&e.panel){var n=c(t,mt);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else t.dispatch({effects:[ot.of(!0)].concat(S(e?[]:[i.Py.appendConfig.of(Ct)]))});return!0},kt=function(t){var e=t.state.field(at,!1);if(!e||!e.panel)return!1;var n=c(t,mt);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:ot.of(!1)}),!0},bt=[{key:"Mod-f",run:yt,scope:"editor search-panel"},{key:"F3",run:ft,shift:dt,scope:"editor search-panel"},{key:"Mod-g",run:ft,shift:dt,scope:"editor search-panel"},{key:"Escape",run:kt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(t){var e=t.state,n=t.dispatch,r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var o=r.main,a=o.from,s=o.to,u=[],h=0,l=new j(e.doc,e.sliceDoc(a,s));!l.next().done;){if(u.length>1e3)return!1;l.value.from==a&&(h=u.length),u.push(i.jT.range(l.value.from,l.value.to))}return n(e.update({selection:i.jT.create(u,h)})),!0}},{key:"Alt-g",run:function(t){var e=c(t,F);if(!e){var n=[$.of(!0)];null==t.state.field(U,!1)&&n.push(i.Py.appendConfig.of([U,J])),t.dispatch({effects:n}),e=c(t,F)}return e&&e.dom.querySelector("input").focus(),!0}}];function wt(t){function e(e){return t.view.state.phrase(e)}var n=k("input",{value:t.query.search,placeholder:e("Find"),"aria-label":e("Find"),class:"cm-textfield",name:"search",onchange:s,onkeyup:s}),i=k("input",{value:t.query.replace,placeholder:e("Replace"),"aria-label":e("Replace"),class:"cm-textfield",name:"replace",onchange:s,onkeyup:s}),o=k("input",{type:"checkbox",name:"case",checked:!t.query.caseInsensitive,onchange:s}),a=k("input",{type:"checkbox",name:"re",checked:t.query instanceof rt,onchange:s});function s(){t.updateQuery(new(a.checked?rt:nt)(n.value,i.value,!o.checked))}function u(t,e,n){return k("button",{class:"cm-button",name:t,onclick:e},n)}return k("div",{onkeydown:function(e){(0,r.$1)(t.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==n?(e.preventDefault(),(e.shiftKey?dt:ft)(t.view)):13==e.keyCode&&e.target==i&&(e.preventDefault(),pt(t.view))},class:"cm-search"},[n,u("next",(function(){return ft(t.view)}),[e("next")]),u("prev",(function(){return dt(t.view)}),[e("previous")]),u("select",(function(){return vt(t.view)}),[e("all")]),k("label",null,[o,e("match case")]),k("label",null,[a,e("regexp")]),k("br"),i,u("replace",(function(){return pt(t.view)}),[e("replace")]),u("replaceAll",(function(){return gt(t.view)}),[e("replace all")]),k("button",{name:"close",onclick:function(){return kt(t.view)},"aria-label":e("close")},["×"])])}var St=/[\s\.,:;?!]/;function xt(t,e){var n=e.from,i=e.to,o=t.state.doc.lineAt(n).from,a=t.state.doc.lineAt(i).to,s=Math.max(o,n-30),u=Math.min(a,i+30),h=t.state.sliceDoc(s,u);if(s!=o)for(var l=0;l<30;l++)if(!St.test(h[l+1])&&St.test(h[l])){h=h.slice(l);break}if(u!=a)for(var c=h.length-1;c>h.length-30;c--)if(!St.test(h[c-1])&&St.test(h[c])){h=h.slice(0,c);break}return r.tk.announce.of("".concat(t.state.phrase("current match"),". ").concat(h," ").concat(t.state.phrase("on line")," ").concat(t.state.doc.lineAt(n).number))}var At=r.tk.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Ct=[at,i.Wl.override(lt),At]},77885:function(t,e,n){"use strict";n.d(e,{q6:function(){return X},n0:function(){return g},as:function(){return m},D0:function(){return ht},F6:function(){return _},jT:function(){return C},yy:function(){return ft},r$:function(){return D},gc:function(){return p},Wl:function(){return V},Py:function(){return tt},QQ:function(){return L},YW:function(){return et},BO:function(){return dt}});var r=n(23414);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"composeDesc",value:function(t){return this.empty?t:t.empty?this:S(this,t)}},{key:"mapDesc",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e)}},{key:"mapPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p.Simple,r=0,i=0,o=0;ot)return i+(t-r);i+=a}else{if(n!=p.Simple&&u>=t&&(n==p.TrackDel&&rt||n==p.TrackBefore&&rt))return null;if(u>t||u==t&&e<0&&!a)return t==r||e<0?i:i+s;i+=s}r=u}if(t>r)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=0,r=0;n=0&&r<=e&&a>=t)return!(re)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var t="",e=0;e=0?":"+r:"")}return t}},{key:"toJSON",value:function(){return this.sections}},{key:"length",get:function(){for(var t=0,e=0;e1&&void 0!==arguments[1]&&arguments[1];return w(this,t,e,!0)}},{key:"invert",value:function(t){for(var e=this.sections.slice(),i=[],o=0,a=0;o=0){e[o]=u,e[o+1]=s;for(var h=o>>1;i.length1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e,!0)}},{key:"iterChanges",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"filter",value:function(t){var e=[],r=[],i=[],o=new x(this);t:for(var a=0,s=0;;){for(var u=a==t.length?1e9:t[a++];s0&&k(r,e,o.text),o.forward(h),s+=h}for(var c=t[a++];s>1].toJSON()))}return t}},{key:"desc",get:function(){return new g(this.sections)}}],[{key:"of",value:function(t,e,i){var a=[],s=[],u=0,h=null;function l(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||a.length){um||p<0||m>e)throw new RangeError("Invalid change range ".concat(p," to ").concat(m," (in doc of length ").concat(e,")"));var w=b?"string"==typeof b?r.xv.of(b.split(i||v)):b:r.xv.empty,S=w.length;if(p==m&&0==S)return;pu&&y(a,p-u,-1),y(a,m-p,S),k(s,a,w),u=m}}(t),l(!h),h}},{key:"empty",value:function(t){return new n(t?[t,-1]:[],[])}},{key:"fromJSON",value:function(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");for(var e=[],i=[],o=0;o3&&void 0!==arguments[3]&&arguments[3];if(!(0==e&&n<=0)){var i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:0==e&&0==t[i]?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}}function k(t,e,n){if(0!=n.length){var i=e.length-2>>1;if(i>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)u=t.sections[s++],h=t.sections[s++];e(o,l,a,c,f),o=l,a=c}}}function w(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new x(t),s=new x(e),u=0,h=0;;)if(-1==a.ins)u+=a.len,a.next();else if(-1==s.ins&&h=0&&(a.done||hh&&!a.done&&u+a.len=0)){if(a.done&&s.done)return o?new m(i,o):new g(i);throw new Error("Mismatched change set lengths")}for(var c=0,f=u+a.len;;)if(s.ins>=0&&h>u&&h+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new x(t),a=new x(e),s=!1;;){if(o.done&&a.done)return i?new m(r,i):new g(r);if(0==o.ins)y(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var u=Math.min(o.len2,a.len),h=r.length;if(-1==o.ins){var l=-1==a.ins?-1:a.off?0:a.ins;y(r,u,l,s),i&&l&&k(i,r,a.text)}else-1==a.ins?(y(r,o.off?0:o.len,u,s),i&&k(i,r,o.textBit(u))):(y(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&k(i,r,a.text));s=(o.ins>u||a.ins>=0&&a.len>u)&&(s||r.length>h),o.forward2(u),a.forward(u)}else y(r,0,a.ins,s),i&&k(i,r,a.text),a.next()}}var x=function(){function t(e){c(this,t),this.set=e,this.i=0,this.next()}return d(t,[{key:"next",value:function(){var t=this.set.sections;this.i>1;return n>=e.length&&!t?r.xv.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}},{key:"forward",value:function(t){t==this.len?this.next():(this.len-=t,this.off+=t)}},{key:"forward2",value:function(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?r.xv.empty:t[e]}}]),t}(),A=function(){function t(e,n,r){c(this,t),this.from=e,this.to=n,this.flags=r}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=e.mapPos(this.from,n),i=e.mapPos(this.to,n);return r==this.from&&i==this.to?this:new t(r,i,this.flags)}},{key:"extend",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return C.range(t,e);var n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return C.range(this.anchor,n)}},{key:"eq",value:function(t){return this.anchor==t.anchor&&this.head==t.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var t=3&this.flags;return 3==t?null:t}},{key:"goalColumn",get:function(){var t=this.flags>>5;return 33554431==t?void 0:t}}],[{key:"fromJSON",value:function(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return C.range(t.anchor,t.head)}}]),t}(),C=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;c(this,t),this.ranges=e,this.mainIndex=n}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return e.empty?this:t.create(this.ranges.map((function(t){return t.map(e,n)})),this.mainIndex)}},{key:"eq",value:function(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var e=0;e1&&void 0!==arguments[1])||arguments[1];return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=e,t.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(t){return t.toJSON()})),main:this.mainIndex}}},{key:"main",get:function(){return this.ranges[this.mainIndex]}}],[{key:"fromJSON",value:function(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map((function(t){return A.fromJSON(t)})),e.main)}},{key:"single",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new t([t.range(e,n)],0)}},{key:"create",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==e.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new A(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=r?r:33554431)<<5)}},{key:"range",value:function(t,e,n){var r=(null!=n?n:33554431)<<5;return e1&&void 0!==arguments[1]?arguments[1]:0,n=t[e];t.sort((function(t,e){return t.from-e.from})),e=t.indexOf(n);for(var r=1;ri.head?C.range(s,a):C.range(a,s))}}return new C(t,e)}function O(t,e){var n,r=o(t.ranges);try{for(r.s();!(n=r.n()).done;){if(n.value.to>e)throw new RangeError("Selection points outside of document")}}catch(i){r.e(i)}finally{r.f()}}var T=0,D=function(){function t(e,n,r,i,o){c(this,t),this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=T++,this.default=e([])}return d(t,[{key:"of",value:function(t){return new P([],this,0,t)}},{key:"compute",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,1,e)}},{key:"computeN",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,2,e)}},{key:"from",value:function(t,e){return e||(e=function(t){return t}),this.compute([t],(function(n){return e(n.field(t))}))}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new t(e.combine||function(t){return t},e.compareInput||function(t,e){return t===e},e.compare||(e.combine?function(t,e){return t===e}:E),!!e.static,e.enables)}}]),t}();function E(t,e){return t==e||t.length==e.length&&t.every((function(t,n){return t===e[n]}))}var P=function(){function t(e,n,r,i){c(this,t),this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=T++}return d(t,[{key:"dynamicSlot",value:function(t){var e,n,r=this.value,i=this.facet.compareInput,a=t[this.id]>>1,s=2==this.type,u=!1,h=!1,l=[],c=o(this.dependencies);try{for(c.s();!(n=c.n()).done;){var f=n.value;"doc"==f?u=!0:"selection"==f?h=!0:0==(1&(null!==(e=t[f.id])&&void 0!==e?e:1))&&l.push(t[f.id])}}catch(d){c.e(d)}finally{c.f()}return function(t,e){if(!e||e.reconfigured)return t.values[a]=r(t),1;if(!(u&&e.docChanged||h&&(e.docChanged||e.selection)||l.some((function(e){return(1&q(t,e))>0}))))return 0;var n=r(t),o=e.startState.values[a];return(s?function(t,e,n){if(t.length!=e.length)return!1;for(var r=0;r>1;return function(t,r){if(!r)return t.values[n]=e.create(t),1;var i,o=0;if(r.reconfigured){var a=function(t,e){var n=t.config.address[e];return null==n?null:n>>1}(r.startState,e.id);i=null==a?e.create(r.startState):r.startState.values[a],o=1}else i=r.startState.values[n];var s=e.updateF(i,r);return o||e.compareF(i,s)||(o=1),o&&(t.values[n]=s),o}}},{key:"init",value:function(t){return[this,R.of({field:this,create:t})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(e){var n=new t(T++,e.create,e.update,e.compare||function(t,e){return t===e},e);return e.provide&&(n.provides=e.provide(n)),n}}]),t}(),B=2,N=1,I=0;function j(t){return function(e){return new W(e,t)}}var V={fallback:j(3),default:j(B),extend:j(N),override:j(I)},W=function t(e,n){c(this,t),this.inner=e,this.prec=n},_=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new z(this,t)}},{key:"reconfigure",value:function(e){return t.reconfigure.of({compartment:this,extension:e})}},{key:"get",value:function(t){return t.config.compartments.get(this)}}]),t}(),z=function t(e,n){c(this,t),this.compartment=e,this.inner=n},H=function(){function t(e,n,r,i,o){for(c(this,t),this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(e,n,r){var i,a=[],s=Object.create(null),u=new Map,h=o(function(t,e,n){var r=[[],[],[],[]],i=new Map;function a(t,s){var u=i.get(t);if(null!=u){if(u>=s)return;var h=r[u].indexOf(t);h>-1&&r[u].splice(h,1),t instanceof z&&n.delete(t.compartment)}if(i.set(t,s),Array.isArray(t)){var l,c=o(t);try{for(c.s();!(l=c.n()).done;){a(l.value,s)}}catch(v){c.e(v)}finally{c.f()}}else if(t instanceof z){if(n.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");var f=e.get(t.compartment)||t.inner;n.set(t.compartment,f),a(f,s)}else if(t instanceof W)a(t.inner,t.prec);else if(t instanceof L)r[s].push(t),t.provides&&a(t.provides,s);else if(t instanceof P)r[s].push(t),t.facet.extensions&&a(t.facet.extensions,s);else{var d=t.extension;if(!d)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(d,s)}}return a(t,B),r.reduce((function(t,e){return t.concat(e)}))}(e,n,u));try{for(h.s();!(i=h.n()).done;){var l=i.value;l instanceof L?a.push(l):(s[l.facet.id]||(s[l.facet.id]=[])).push(l)}}catch(k){h.e(k)}finally{h.f()}for(var c=Object.create(null),f=[],d=[],v=function(){var t=g[p];c[t.id]=d.length<<1,d.push((function(e){return t.slot(e)}))},p=0,g=a;p>1;return function(t,n){var u,h=n?n.reconfigured?n.startState.config.address[e.id]:s<<1:null,l=null==h,c=o(a);try{for(c.s();!(u=c.n()).done;)1&q(t,u.value)&&(l=!0)}catch(k){c.e(k)}finally{c.f()}if(!l)return 0;for(var f=[],d=0;d>1,r=t.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;t.status[n]=4;var i=t.config.dynamicSlots[n](t,t.applying);return t.status[n]=2|i}function F(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}var $=D.define(),U=D.define({combine:function(t){return t.some((function(t){return t}))},static:!0}),J=D.define({combine:function(t){return t.length?t[0]:void 0},static:!0}),G=D.define(),K=D.define(),Y=D.define(),X=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,null,[{key:"define",value:function(){return new Q}}]),t}(),Q=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new X(this,t)}}]),t}(),Z=function(){function t(e){c(this,t),this.map=e}return d(t,[{key:"of",value:function(t){return new tt(this,t)}}]),t}(),tt=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,[{key:"map",value:function(e){var n=this.type.map(this.value,e);return void 0===n?void 0:n==this.value?this:new t(this.type,n)}},{key:"is",value:function(t){return this.type==t}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Z(t.map||function(t){return t})}},{key:"mapEffects",value:function(t,e){if(!t.length)return t;var n,r=[],i=o(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.map(e);a&&r.push(a)}}catch(s){i.e(s)}finally{i.f()}return r}}]),t}();tt.reconfigure=tt.define(),tt.appendConfig=tt.define();var et=function(){function t(e,n,r,i,o,a){c(this,t),this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&O(r,n.newLength),o.some((function(e){return e.type==t.time}))||(this.annotations=o.concat(t.time.of(Date.now())))}return d(t,[{key:"annotation",value:function(t){var e,n=o(this.annotations);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.type==t)return r.value}}catch(i){n.e(i)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}}]),t}();function nt(t,e){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=t[r]))o=t[r++],a=t[r++];else{if(!(i=0;i--){var o=n[i](t);o&&Object.keys(o).length&&(r=rt(t,it(e,o,t.changes.newLength),!0))}return r==t?t:new et(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(t){var e,n=t.startState,r=!0,i=o(n.facet(G));try{for(i.s();!(e=i.n()).done;){var a=(0,e.value)(t);if(!1===a){r=!1;break}Array.isArray(a)&&(r=!0===r?a:nt(r,a))}}catch(d){i.e(d)}finally{i.f()}if(!0!==r){var s,u;if(!1===r)u=t.changes.invertedDesc,s=m.empty(n.doc.length);else{var h=t.changes.filter(r);s=h.changes,u=h.filtered.invertedDesc}t=new et(n,s,t.selection&&t.selection.map(u),tt.mapEffects(t.effects,u),t.annotations,t.scrollIntoView)}for(var l=n.facet(K),c=l.length-1;c>=0;c--){var f=l[c](t);t=f instanceof et?f:Array.isArray(f)&&1==f.length&&f[0]instanceof et?f[0]:ot(n,st(f),!1)}return t}(s):s)}et.time=X.define(),et.userEvent=X.define(),et.addToHistory=X.define(),et.remote=X.define();var at=[];function st(t){return null==t?at:Array.isArray(t)?t:[t]}var ut,ht=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ht||(ht={})),lt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{ut=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(vt){}function ct(t){return function(e){if(!/\S/.test(e))return ht.Space;if(function(t){if(ut)return ut.test(t);for(var e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||lt.test(n)))return!0}return!1}(e))return ht.Word;for(var n=0;n-1)return ht.Word;return ht.Other}}var ft=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(c(this,t),this.config=e,this.doc=n,this.selection=r,this.applying=null,this.status=e.statusTemplate.slice(),i&&i.startState.config==e)this.values=i.startState.values.slice();else if(this.values=e.dynamicSlots.map((function(t){return null})),i)for(var o in e.address){var a=e.address[o],s=i.startState.config.address[o];null!=s&&0==(1&a)&&(this.values[a>>1]=F(i.startState,s))}this.applying=i,i&&(i._state=this);for(var u=0;u1&&void 0!==arguments[1])||arguments[1],n=this.config.address[t.id];if(null!=n)return q(this,n),F(this,n);if(e)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return e instanceof m?e:m.of(e,this.doc.length,this.facet(t.lineSeparator))}},{key:"toText",value:function(e){return r.xv.of(e.split(this.facet(t.lineSeparator)||v))}},{key:"sliceDoc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak)}},{key:"facet",value:function(t){var e=this.config.address[t.id];return null==e?t.default:(q(this,e),F(this,e))}},{key:"toJSON",value:function(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var n in t){var r=t[n];r instanceof L&&(e[n]=r.spec.toJSON(this.field(t[n]),this))}return e}},{key:"phrase",value:function(e){var n,r=o(this.facet(t.phrases));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(Object.prototype.hasOwnProperty.call(i,e))return i[e]}}catch(a){r.e(a)}finally{r.f()}return e}},{key:"languageDataAt",value:function(t,e){var n,r=[],i=o(this.facet($));try{for(i.s();!(n=i.n()).done;){var a,s=o((0,n.value)(this,e));try{for(s.s();!(a=s.n()).done;){var u=a.value;Object.prototype.hasOwnProperty.call(u,t)&&r.push(u[t])}}catch(h){s.e(h)}finally{s.f()}}}catch(h){i.e(h)}finally{i.f()}return r}},{key:"charCategorizer",value:function(t){return ct(this.languageDataAt("wordChars",t).join(""))}},{key:"wordAt",value:function(t){for(var e=this.doc.lineAt(t),n=e.text,i=e.from,o=e.length,a=this.charCategorizer(t),s=t-i,u=t-i;s>0;){var h=(0,r.cp)(n,s,!1);if(a(n.slice(h,s))!=ht.Word)break;s=h}for(;u1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(t){var n=r[t],o=e[t];i.push(n.init((function(t){return n.spec.fromJSON(o,t)})))};for(var a in r)o(a)}return t.create({doc:e.doc,selection:C.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=H.resolve(e.extensions||[],new Map),i=e.doc instanceof r.xv?e.doc:r.xv.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||v)),o=e.selection?e.selection instanceof C?e.selection:C.single(e.selection.anchor,e.selection.head):C.single(0);return O(o,i.length),n.staticFacet(U)||(o=o.asSingle()),new t(n,i,o)}}]),t}();function dt(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},a=o(t);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,u=0,h=Object.keys(s);u=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length),(0,a.IS)(t.slice(r,e),i,n)}var S=function(){function t(e,n,r){y(this,t),this.string=e,this.tabSize=n,this.indentUnit=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}return b(t,[{key:"eol",value:function(){return this.pos>=this.string.length}},{key:"sol",value:function(){return 0==this.pos}},{key:"peek",value:function(){return this.string.charAt(this.pos)||void 0}},{key:"next",value:function(){if(this.pose}},{key:"eatSpace",value:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}},{key:"skipToEnd",value:function(){this.pos=this.string.length}},{key:"skipTo",value:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}},{key:"backUp",value:function(t){this.pos-=t}},{key:"column",value:function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}},{key:"current",value:function(){return this.string.slice(this.start,this.pos)}}]),t}();function x(t){if("object"!=m(t))return t;var e={};for(var n in t){var r=t[n];e[n]=r instanceof Array?r.slice():r}return e}var A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(n,t);var e=d(n);function n(t){var i;y(this,n);var a,s=(0,o.kU)(t.languageData),u={token:(a=t).token,blankLine:a.blankLine||function(){},startState:a.startState||function(){return!0},copyState:a.copyState||x,indent:a.indent||function(){return null},languageData:a.languageData||{}};return(i=e.call(this,s,{startParse:function(t,e,n){return new O(p(i),t,e,n)}},function(t){var e=r.Jq.define({id:E.length,name:"Document",props:[o.mi.add((function(){return t}))]});return E.push(e),e}(s),[o.tK.of((function(t,e){return i.getIndent(t,e)}))])).streamParser=u,i.stateAfter=new WeakMap,i}return b(n,[{key:"getIndent",value:function(t,e){for(var n=(0,o.qz)(t.state),r=n.resolve(e);r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;var i,a,s=C(this,n,0,r.from,e);if(s?(a=s.state,i=s.pos+1):(a=this.streamParser.startState(t.unit),i=0),e-i>1e4)return null;for(;i=i&&n+e.length<=o&&t.stateAfter.get(e);if(a)return{state:t.streamParser.copyState(a),pos:n+e.length};for(var s=e.children.length-1;s>=0;s--){var u=e.children[s],h=n+e.positions[s],l=u instanceof r.mp&&h=e.length)return e;o||e.type!=t.topNode||(o=!0);for(var a=e.children.length-1;a>=0;a--){var s=e.positions[a]+n,u=e.children[a],h=void 0;if(sn&&C(t,u.tree,0-u.offset,n,u.to),c=void 0;if(l&&(c=M(t,u.tree,n+u.offset,l.pos+u.offset,!1)))return{state:l.state,tree:c}}}catch(f){s.e(f)}finally{s.f()}return{state:t.streamParser.startState((0,o.y1)(i)),tree:r.mp.empty}}(e,a.fragments,i,a.state),u=s.state,l=s.tree;this.state=u,this.pos=this.chunkStart=i+l.length,l.length&&(this.chunks.push(l),this.chunkPos.push(0)),this.pose.start)return i}throw new Error("Stream parser failed to advance stream.")}var D=Object.create(null),E=[r.Jq.none],P=new r.Lj(E),R=[];function L(t){return t?D[t]||(D[t]=function(t){var e,n=null,o=h(t.split("."));try{for(o.s();!(e=o.n()).done;){var a=e.value,u=i.pJ[a];u?"function"==typeof u?n?n=u(n):W(a,"Modifier ".concat(a," used at start of tag")):n?W(a,"Tag ".concat(a," used as modifier")):n=u:W(a,"Unknown highlighting tag ".concat(a))}}catch(f){o.e(f)}finally{o.f()}if(!n)return 0;var l=t.replace(/ /g,"_"),c=r.Jq.define({id:E.length,name:l,props:[(0,i.Gv)(s({},l,n))]});return E.push(c),c.id}(t)):0}for(var B=0,N=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","typeName"],["attribute","propertyName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];B-1||(R.push(t),console.warn(e))}},23414:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt)return p[e-1]<=t;return!1}function y(t){return t>=127462&&t<=127487}function k(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?b:w)(t,e)}function b(t,e){if(e==t.length)return e;e&&S(t.charCodeAt(e))&&x(t.charCodeAt(e-1))&&e--;var n=A(t,e);for(e+=M(n);e=0&&y(A(t,o));)i++,o-=2;if(i%2==0)break;e+=2}}return e}function w(t,e){for(;e>0;){var n=b(t,e-2);if(n=56320&&t<57344}function x(t){return t>=55296&&t<56320}function A(t,e){var n=t.charCodeAt(e);if(!x(n)||e+1==t.length)return n;var r=t.charCodeAt(e+1);return S(r)?r-56320+(n-55296<<10)+65536:n}function C(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function M(t){return t<65536?1:2}function O(t,e,n){for(var r=0;r=n)return{offset:i,leftOver:0};e+=9==t.charCodeAt(i)?r-e%r:1,i=k(t,i)}return{offset:t.length,leftOver:n-e}}var D=function(){function t(){f(this,t)}return v(t,[{key:"lineAt",value:function(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0)}},{key:"line",value:function(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0)}},{key:"replace",value:function(t,e,n){var r=[];return this.decompose(0,t,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(e,this.length,r,1),P.from(r,this.length-(e-t)+n.length)}},{key:"append",value:function(t){return this.replace(this.length,this.length,t)}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(t,e,n,0),P.from(n,e-t)}},{key:"eq",value:function(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;for(var e=new N(this),n=new N(t);;){if(e.next(),n.next(),e.lineBreak!=n.lineBreak||e.done!=n.done||e.value!=n.value)return!1;if(e.done)return!0}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new N(this,t)}},{key:"iterRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new I(this,t,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var t=[];return this.flatten(t),t}}],[{key:"of",value:function(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new E(e):P.from(E.split(e,[])):t.empty}}]),t}();"undefined"!=typeof Symbol&&(D.prototype[Symbol.iterator]=function(){return this.iter()});var E=function(t){s(n,t);var e=h(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R(t);return f(this,n),(r=e.call(this)).text=t,r.length=i,r}return v(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((e?n:a)>=t)return new j(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(t,e,r,i){var o=t<=0&&e>=this.length?this:new n(B(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){var a=r.pop(),s=L(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var u=s.length>>1;r.push(new n(s.slice(0,u)),new n(s.slice(u)))}}else r.push(o)}},{key:"replace",value:function(t,e,r){if(!(r instanceof n))return a(c(n.prototype),"replace",this).call(this,t,e,r);var i=L(this.text,L(r.text,B(this.text,0,t)),e),o=this.length+r.length-(e-t);return i.length<=32?new n(i,o):P.from(n.split(i,[]),o)}},{key:"sliceString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=e&&ot&&o&&(r+=n),ti&&(r+=a.slice(Math.max(0,t-i),e-i)),i=s+1}return r}},{key:"flatten",value:function(t){var e,n=i(this.text);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}}],[{key:"split",value:function(t,e){var r,o=[],a=-1,s=i(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;o.push(u),a+=u.length+1,32==o.length&&(e.push(new n(o,a)),o=[],a=-1)}}catch(h){s.e(h)}finally{s.f()}return a>-1&&e.push(new n(o,a)),e}}]),n}(D),P=function(t){s(n,t);var e=h(n);function n(t,r){var o;f(this,n),(o=e.call(this)).children=t,o.length=r,o.lines=0;var a,s=i(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.lines+=u.lines}}catch(h){s.e(h)}finally{s.f()}return o}return v(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((e?s:a)>=t)return o.lineInner(t,e,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(t,e,n,r){for(var i=0,o=0;o<=e&&i=o){var u=r&((o<=t?1:0)|(s>=e?2:0));o>=t&&s<=e&&!u?n.push(a):a.decompose(t-o,e-o,n,u)}o=s+1}}},{key:"replace",value:function(t,e,r){if(r.lines=o&&e<=u){var h=s.replace(t-o,e-o,r),l=this.lines-s.lines+h.lines;if(h.lines>4&&h.lines>l>>6){var f=this.children.slice();return f[i]=h,new n(f,this.length-(e-t)+r.length)}return a(c(n.prototype),"replace",this).call(this,o,u,h)}o=u+1}return a(c(n.prototype),"replace",this).call(this,t,e,r)}},{key:"sliceString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;it&&i&&(r+=n),to&&(r+=a.sliceString(t-o,e-o,n)),o=s+1}return r}},{key:"flatten",value:function(t){var e,n=i(this.children);try{for(n.s();!(e=n.n()).done;){e.value.flatten(t)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.reduce((function(t,e){return t+e.length+1}),-1),o=0,a=i(t);try{for(a.s();!(e=a.n()).done;){var s=e.value;o+=s.lines}}catch(A){a.e(A)}finally{a.f()}if(o<32){var u,h=[],l=i(t);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.flatten(h)}}catch(A){l.e(A)}finally{l.f()}return new E(h,r)}var f=Math.max(32,o>>5),d=f<<1,v=f>>1,p=[],g=0,m=-1,y=[];function k(t){var e;if(t.lines>d&&t instanceof n){var r,o=i(t.children);try{for(o.s();!(r=o.n()).done;){k(r.value)}}catch(A){o.e(A)}finally{o.f()}}else t.lines>v&&(g>v||!g)?(b(),p.push(t)):t instanceof E&&g&&(e=y[y.length-1])instanceof E&&t.lines+e.lines<=32?(g+=t.lines,m+=t.length+1,y[y.length-1]=new E(e.text.concat(t.text),e.length+1+t.length)):(g+t.lines>f&&b(),g+=t.lines,m+=t.length+1,y.push(t))}function b(){0!=g&&(p.push(1==y.length?y[0]:n.from(y,m)),m=-1,g=y.length=0)}var w,S=i(t);try{for(S.s();!(w=S.n()).done;){var x=w.value;k(x)}}catch(A){S.e(A)}finally{S.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(D);function R(t){var e,n=-1,r=i(t);try{for(r.s();!(e=r.n()).done;){n+=e.value.length+1}}catch(o){r.e(o)}finally{r.f()}return n}function L(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(u>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;f(this,t),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?0:e instanceof E?e.text.length:e.children.length]}return v(t,[{key:"next",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var e=this.nodes.length-1;if(e<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[e],r=this.offsets[e],i=n instanceof E?n.text.length:n.children.length;if(r==(this.dir>0?i:0))this.nodes.pop(),this.offsets.pop();else if(this.lineBreak||r==(this.dir>0?0:i))if(n instanceof E){var o=n.text[r-(this.dir<0?1:0)];if(this.offsets[e]=r+=this.dir,this.lineBreak=!1,o.length>Math.max(0,t))return this.value=0==t?o:this.dir>0?o.slice(t):o.slice(0,o.length-t),this;t-=o.length}else{var a=n.children[this.dir>0?r:r-1];this.offsets[e]=r+this.dir,this.lineBreak=!1,t>a.length?t-=a.length:(this.nodes.push(a),this.offsets.push(this.dir>0?0:a instanceof E?a.text.length:a.children.length))}else{if(this.lineBreak=!0,0==t)return this.value="\n",this;t--}}}}]),t}(),I=function(){function t(e,n,r){f(this,t),this.value="",this.cursor=new N(e,n>r?-1:1),n>r?(this.skip=e.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return v(t,[{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip+t),n=e.value,r=e.lineBreak,i=e.done;this.skip=0,this.value=n;var o=r?1:n.length;o>this.limit&&(this.value=this.cursor.dir>0?n.slice(0,this.limit):n.slice(o-this.limit)),i||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),t}(),j=function(){function t(e,n,r,i){f(this,t),this.from=e,this.to=n,this.number=r,this.text=i}return v(t,[{key:"length",get:function(){return this.to-this.from}}]),t}()},19753:function(t,e,n){"use strict";n.d(e,{kH:function(){return Ot},p:function(){return Tt},Nm:function(){return ve},tk:function(){return Qn},BF:function(){return Kt},lg:function(){return Qt},Uw:function(){return kr},ZO:function(){return Or},$f:function(){return lr},$1:function(){return dr}});for(var r=n(77885),i=n(23414),o=n(62038),a=n(13764),s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},u={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},h="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),l="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),c="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),d="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),v=h&&(f||+h[1]<57)||c&&f,p=0;p<10;p++)s[48+p]=s[96+p]=String(p);for(p=1;p<=24;p++)s[p+111]="F"+p;for(p=65;p<=90;p++)s[p]=String.fromCharCode(p+32),u[p]=String.fromCharCode(p);for(var g in s)u.hasOwnProperty(g)||(u[g]=s[g]);function m(t,e,n){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=A(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=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(t){return!1}}();return function(){var n,r=A(t);if(e){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function S(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?x(t):e}function x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||E(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=E(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2),android:/Android\b/.test(L.userAgent),webkit:z,safari:H,webkit_version:z?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=B.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function F(t){return t.getSelection?t.getSelection():document.getSelection()}function $(t,e){return!!e&&t.contains(1!=e.nodeType?e.parentNode:e)}function U(t,e){if(!e.anchorNode)return!1;try{return $(t,e.anchorNode)}catch(n){return!1}}function J(t){return 3==t.nodeType?ot(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function G(t,e,n,r){return!!n&&(Y(t,e,n,r,-1)||Y(t,e,n,r,1))}function K(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function Y(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:X(t))){if("DIV"==t.nodeName)return!1;var o=t.parentNode;if(!o||1!=o.nodeType)return!1;e=K(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(i<0?-1:0)],e=i<0?X(t):0}}}function X(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}var Q={left:0,right:0,top:0,bottom:0};function Z(t,e){var n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function tt(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}var et,nt=function(){function t(){O(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return D(t,[{key:"eq",value:function(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}},{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}]),t}(),rt=null;function it(t){if(t.setActive)return t.setActive();if(rt)return t.focus(rt);for(var e=[],n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(null==rt?{get preventScroll(){return rt={preventScroll:!0},!0}}:void 0),!rt){rt=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:e,r=et||(et=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}var at=function(){function t(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O(this,t),this.node=e,this.offset=n,this.precise=r}return D(t,null,[{key:"before",value:function(e,n){return new t(e.parentNode,K(e),n)}},{key:"after",value:function(e,n){return new t(e.parentNode,K(e)+1,n)}}]),t}(),st=[],ut=function(){function t(){O(this,t),this.parent=null,this.dom=null,this.dirty=2}return D(t,[{key:"posBefore",value:function(t){var e,n=this.posAtStart,r=M(this.children);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i==t)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(t){return this.posBefore(t)+t.length}},{key:"coordsAt",value:function(t,e){return null}},{key:"sync",value:function(e){if(2&this.dirty){var n,r=this.dom,i=null,o=M(this.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.dirty){var s=i?i.nextSibling:r.firstChild;!s||a.dom||t.get(s)||a.reuseDOM(s),a.sync(e),a.dirty=0}e&&e.node==r&&i!=a.dom&&(e.written=!0),lt(r,i,a.dom),i=a.dom}}catch(f){o.e(f)}finally{o.f()}var u=i?i.nextSibling:r.firstChild;for(u&&e&&e.node==r&&(e.written=!0);u;)u=ht(u)}else if(1&this.dirty){var h,l=M(this.children);try{for(l.s();!(h=l.n()).done;){var c=h.value;c.dirty&&(c.sync(e),c.dirty=0)}}catch(f){l.e(f)}finally{l.f()}}}},{key:"reuseDOM",value:function(t){return!1}},{key:"localPosFromDOM",value:function(e,n){var r;if(e==this.dom)r=this.dom.childNodes[n];else{for(var i=0==X(e)?0:0==n?-1:1;;){var o=e.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=e==o.firstChild?-1:1),e=o}r=i<0?e:e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!t.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var u=this.children[a];if(u.dom==r)return s;s+=u.length+u.breakAfter}}},{key:"domBoundsAround",value:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,u=n;se)return h.domBoundsAround(t,e,u);if(l>=t&&-1==r&&(r=s,i=u),l>=e&&l!=u&&-1==o){o=s,a=l;break}u=l+h.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o+1].dom:null}}},{key:"markDirty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(t))}},{key:"markParentsDirty",value:function(t){for(var e=this.parent;e;e=e.parent){if(t&&(e.dirty|=2),1&e.dirty)return;e.dirty|=1,t=!1}}},{key:"setParent",value:function(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(t){this.dom=t,t.cmView=this}},{key:"replaceChildren",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:st;this.markDirty();for(var i=t;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new ct(this.children,t,this.children.length)}},{key:"childPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(t,e)}},{key:"toString",value:function(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var t=this;;){var e=t.parent;if(!e)return t;t=e}}}],[{key:"get",value:function(t){return t.cmView}}]),t}();function ht(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function lt(t,e,n){var r=e?e.nextSibling:t.firstChild;if(n.parentNode==t)for(;r!=n;)r=ht(r);else t.insertBefore(n,r)}ut.prototype.breakAfter=0;var ct=function(){function t(e,n,r){O(this,t),this.children=e,this.pos=n,this.i=r,this.off=0}return D(t,[{key:"findPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),t}(),ft=[],dt=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"become",value:function(t){return!1}},{key:"getSide",value:function(){return 0}}]),n}(ut);dt.prototype.children=ft;var vt=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).text=t,r}return D(n,[{key:"createDOM",value:function(t){this.setDOM(t||document.createTextNode(this.text))}},{key:"sync",value:function(t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(t){return 3==t.nodeType&&(this.createDOM(t),!0)}},{key:"merge",value:function(t,e,r){return(!r||r instanceof n&&!(this.length-(e-t)+r.length>256))&&(this.text=this.text.slice(0,t)+(r?r.text:"")+this.text.slice(e),this.markDirty(),!0)}},{key:"slice",value:function(t){return new n(this.text.slice(t))}},{key:"localPosFromDOM",value:function(t,e){return t==this.dom?e:e?this.text.length:0}},{key:"domAtPos",value:function(t){return new at(this.dom,t)}},{key:"domBoundsAround",value:function(t,e,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(t,e){return gt(this.dom,t,e)}},{key:"length",get:function(){return this.text.length}}]),n}(dt),pt=function(t){k(n,t);var e=w(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;O(this,n),(r=e.call(this)).mark=t,r.children=i,r.length=o;var a,s=M(i);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.setParent(x(r))}}catch(h){s.e(h)}finally{s.f()}return r}return D(n,[{key:"createDOM",value:function(){var t=document.createElement(this.mark.tagName);if(this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(var e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);this.setDOM(t)}},{key:"sync",value:function(t){this.dom||this.createDOM(),m(A(n.prototype),"sync",this).call(this,t)}},{key:"merge",value:function(t,e,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||t&&i<=0||ee&&r.push(ir&&(e=r);var i=e,o=e,a=0;0==e&&n<0||e==r&&n>=0?q.chrome||q.gecko||(e?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=ot(t,i,o).getClientRects();if(!s.length)return Q;var u=s[(a?a<0:n>=0)?0:s.length-1];return q.safari&&!a&&0==u.width&&(u=Array.prototype.find.call(s,(function(t){return t.width}))||u),a?Z(u,a<0):u}var mt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.side=i,o}return D(n,[{key:"slice",value:function(t){return n.create(this.widget,this.length-t,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(t,e,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&i<=0||e0?n.length-1:0;r=n[i],!(t>0?0==i:i==n.length-1||r.top0?-1:1);return 0==t&&e>0||t==this.length&&e<=0?r:Z(r,0==t)}},{key:"overrideDOMText",get:function(){if(0==this.length)return i.xv.empty;for(var t=this;t.parent;)t=t.parent;var e=t.editorView,n=e&&e.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):i.xv.empty}}],[{key:"create",value:function(t,e,r){return new(t.customView||n)(t,e,r)}}]),n}(dt),yt=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"domAtPos",value:function(t){return new at(this.widget.text,t)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(t,e){return e?3==t.nodeType?Math.min(e,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(t,e){return gt(this.widget.text,t,e)}},{key:"overrideDOMText",get:function(){return null}}]),n}(mt);function kt(t,e,n,r,i,o){var a,s=t.childCursor(),u=s.findPos(n,1),h=u.i,l=u.off,c=s.findPos(e,-1),f=c.i,d=c.off,v=e-n,p=M(r);try{for(p.s();!(a=p.n()).done;){v+=a.value.length}}catch(S){p.e(S)}finally{p.f()}t.length+=v;var g=t.children;if(f==h&&d){var m=g[f];if(1==r.length&&m.merge(d,l,r[0],i,o))return;if(0==r.length)return void m.merge(d,l,null,i,o);var y=m.slice(l);y.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=y:r.push(y),h++,o=l=0}if(l){var k=g[h];r.length&&k.merge(0,l,r[r.length-1],0,o)?(r.pop(),o=0):k.merge(0,l,null,0,0)}else hi&&n0;r--){var s=e[r-1].dom;if(s.parentNode==t)return at.after(s)}return new at(t,0)}function wt(t,e,n){var r,i=t.children;n>0&&e instanceof pt&&i.length&&(r=i[i.length-1])instanceof pt&&r.mark.eq(e.mark)?wt(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function St(t,e,n){for(var r=0,i=0;i=e:a>e)return o.coordsAt(e-r,n);r=a}}return(t.dom.lastChild||t.dom).getBoundingClientRect()}function xt(t,e){for(var n in t)"class"==n&&e.class?e.class+=" "+t.class:"style"==n&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}function At(t,e){if(t==e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(t){return new Dt(t)}},{key:"widget",value:function(t){var e=t.side||0;return t.block&&(e+=200000001*(e>0?1:-1)),new Pt(t,e,e,!!t.block,t.widget||null,!1)}},{key:"replace",value:function(t){var e=!!t.block,n=Rt(t),r=n.start,i=n.end;return new Pt(t,e?-2e8*(r?2:1):1e8*(r?-1:1),e?2e8*(i?2:1):1e8*(i?1:-1),e,t.widget||null,!0)}},{key:"line",value:function(t){return new Et(t)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.Xs.of(t,e)}}]),n}(a.uU);Tt.none=a.Xs.empty;var Dt=function(t){k(n,t);var e=w(n);function n(t){var r;O(this,n);var i=Rt(t),o=i.start,a=i.end;return(r=e.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,t)).tagName=t.tagName||"span",r.class=t.class||"",r.attrs=t.attributes||null,r}return D(n,[{key:"eq",value:function(t){return this==t||t instanceof n&&this.tagName==t.tagName&&this.class==t.class&&At(this.attrs,t.attrs)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Tt);Dt.prototype.point=!1;var Et=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,-1e8,-1e8,null,t)}return D(n,[{key:"eq",value:function(t){return t instanceof n&&At(this.spec.attributes,t.spec.attributes)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Tt);Et.prototype.mapMode=r.gc.TrackBefore,Et.prototype.point=!0;var Pt=function(t){k(n,t);var e=w(n);function n(t,i,o,a,s,u){var h;return O(this,n),(h=e.call(this,i,o,s,t)).block=a,h.isReplace=u,h.mapMode=a?i<0?r.gc.TrackBefore:r.gc.TrackAfter:r.gc.TrackDel,h}return D(n,[{key:"eq",value:function(t){return t instanceof n&&(e=this.widget,r=t.widget,e==r||!!(e&&r&&e.compare(r)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,r}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return m(A(n.prototype),"range",this).call(this,t,e)}},{key:"type",get:function(){return this.startSide=5}}]),n}(Tt);function Rt(t){var e=t.inclusiveStart,n=t.inclusiveEnd;return null==e&&(e=t.inclusive),null==n&&(n=t.inclusive),{start:e||!1,end:n||!1}}function Lt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>t?n[i]=Math.max(n[i],e):n.push(t,e)}Pt.prototype.point=!0;var Bt=function(t){k(n,t);var e=w(n);function n(){var t;return O(this,n),(t=e.apply(this,arguments)).children=[],t.length=0,t.prevAttrs=void 0,t.attrs=null,t.breakAfter=0,t}return D(n,[{key:"merge",value:function(t,e,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),kt(this,t,e,r?r.children:Nt,o,a),!0}},{key:"split",value:function(t){var e=new n;if(e.breakAfter=this.breakAfter,0==this.length)return e;var r=this.childPos(t),i=r.i,o=r.off;o&&(e.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=t,e}},{key:"transferDOM",value:function(t){this.dom&&(t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(t){At(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}},{key:"append",value:function(t,e){wt(this,t,e)}},{key:"addLineDeco",value:function(t){var e=t.spec.attributes;e&&(this.attrs=xt(e,this.attrs||{}))}},{key:"domAtPos",value:function(t){return bt(this.dom,this.children,t)}},{key:"sync",value:function(t){this.dom||(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Ct(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),m(A(n.prototype),"sync",this).call(this,t);var e=this.dom.lastChild;if(!e||"BR"!=e.nodeName&&ut.get(e)instanceof mt){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var t,e=0,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!(r instanceof vt))return null;var i=J(r.dom);if(1!=i.length)return null;e+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}}},{key:"coordsAt",value:function(t,e){return St(this,t,e)}},{key:"match",value:function(t){return!1}},{key:"type",get:function(){return Ot.Text}}],[{key:"find",value:function(t,e){for(var r=0,i=0;;r++){var o=t.children[r],a=i+o.length;if(a>=e){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(ut),Nt=[],It=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.type=i,o.breakAfter=0,o}return D(n,[{key:"merge",value:function(t,e,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&o<=0||e=0;n--)t=new pt(e[n],[t],t.length);return t}},{key:"buildText",value:function(t,e,n){for(;t>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,t--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,t,512);this.getLine().append(this.wrapMarks(new vt(this.text.slice(this.textOff,this.textOff+s)),e),n),this.textOff+=s,t-=s,n=0}}},{key:"span",value:function(t,e,n,r){this.buildText(e-t,n,r),this.pos=e,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(t,e,n,r,i){var o=e-t;if(n instanceof Pt)if(n.block){var a=n.type;a!=Ot.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new It(n.widget||new Vt("div"),o,a))}else{var s=this.wrapMarks(mt.create(n.widget||new Vt("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(e,n,r,i){var o=new t(e,n,r);return o.openEnd=a.Xs.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),t}(),Vt=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).tag=t,r}return D(n,[{key:"eq",value:function(t){return t.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(t){return t.nodeName.toLowerCase()==this.tag}}]),n}(Mt),Wt=[],_t=r.r$.define(),zt=r.r$.define(),Ht=r.r$.define(),qt=r.r$.define(),Ft=r.r$.define(),$t=r.r$.define();function Ut(t,e,n){var r=t.facet(qt);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}var Jt=r.r$.define({combine:function(t){return!t.length||t[0]}}),Gt=function t(e,n){O(this,t),this.field=e,this.get=n},Kt=function(){function t(){O(this,t)}return D(t,[{key:"from",value:function(t){return new Gt(this,t)}}],[{key:"define",value:function(){return new t}}]),t}();Kt.decorations=Kt.define(),Kt.scrollMargins=Kt.define();var Yt=0,Xt=r.r$.define(),Qt=function(){function t(e,n,r){O(this,t),this.id=e,this.create=n,this.fields=r,this.extension=Xt.of(this)}return D(t,null,[{key:"define",value:function(e,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var u,h=M(Array.isArray(o)?o:[o]);try{for(h.s();!(u=h.n()).done;){var l=u.value;s.push(l)}}catch(c){h.e(c)}finally{h.f()}}return i&&s.push(Zt.from((function(t){return{plugin:t,handlers:i}}))),a&&s.push(Kt.decorations.from(a)),new t(Yt++,e,s)}},{key:"fromClass",value:function(e,n){return t.define((function(t){return new e(t)}),n)}}]),t}(),Zt=Kt.define(),te=function(){function t(e){O(this,t),this.spec=e,this.mustUpdate=null,this.value=null}return D(t,[{key:"takeField",value:function(t,e){var n,r=M(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==t&&e.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}},{key:"update",value:function(e){if(this.value){if(this.mustUpdate){var n=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(n)}catch(r){if(Ut(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}return t.dummy}}}else try{this.value=this.spec.create(e)}catch(r){return Ut(e.state,r,"CodeMirror plugin crashed"),t.dummy}return this}},{key:"destroy",value:function(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(n){Ut(t.state,n,"CodeMirror plugin crashed")}}}]),t}();te.dummy=new te(Qt.define((function(){return{}})));var ee=r.r$.define({combine:function(t){return t.reduce((function(t,e){return xt(e,t)}),{})}}),ne=r.r$.define({combine:function(t){return t.reduce((function(t,e){return xt(e,t)}),{})}}),re=r.r$.define(),ie=r.r$.define(),oe=function(){function t(e,n,r,i){O(this,t),this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}return D(t,[{key:"join",value:function(e){return new t(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}},{key:"addToSet",value:function(t){for(var e=t.length,n=this;e>0;e--){var r=t[e-1];if(!(r.fromA>n.toA)){if(r.toAl)break;o+=2}if(!u)return r;new t(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),t}(),ae=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Wt;O(this,t),this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=r.as.empty(this.startState.doc.length);var o,a=M(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.changes=this.changes.compose(s.changes)}}catch(l){a.e(l)}finally{a.f()}var u=[];this.changes.iterChangedRanges((function(t,e,n,r){return u.push(new oe(t,e,n,r))})),this.changedRanges=u;var h=e.hasFocus;h!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=h,this.flags|=1),this.docChanged&&(this.flags|=2)}return D(t,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(t){return t.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(t){return t.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),t}(),se=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).view=t,r.compositionDeco=Tt.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(t.contentDOM),r.children=[new Bt],r.children[0].setParent(x(r)),r.updateInner([new oe(0,0,0,t.state.doc.length)],r.updateDeco(),0),r}return D(n,[{key:"update",value:function(t){var e=this,n=t.changedRanges;this.minWidth>0&&n.length&&(n.every((function(t){var n=t.fromA;return t.toAe.minWidthTo}))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Tt.none:t.transactions.length&&(this.compositionDeco=function(t,e){var n=F(t.root),r=n.focusNode&&ce(n.focusNode,n.focusOffset,0);if(!r)return Tt.none;var i,o,a=t.docView.nearest(r),s=r;if(a instanceof dt){for(;a.parent instanceof dt;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Bt))return Tt.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var u=s.previousSibling;u&&!ut.get(u);)u=u.previousSibling;i=o=u?ut.get(u).posAtEnd:a.posAtStart}var h=e.mapPos(i,1),l=Math.max(h,e.mapPos(o,-1)),c=r.nodeValue,f=t.state;if(l-h=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(h,d),!1):(this.updateInner(n,c,t.startState.doc.length,h,d),!0)}},{key:"updateInner",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(t,e,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var t=q.chrome?{node:F(r.view.root).focusNode,written:!1}:void 0;r.sync(t),r.dirty=0,(null==t?void 0:t.written)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}))}},{key:"updateChildren",value:function(t,e,n){for(var r=this.childCursor(n),i=t.length-1;;i--){var o=i>=0?t[i]:null;if(!o)break;var a=o.fromA,s=o.toA,u=o.fromB,h=o.toB,l=jt.build(this.view.state.doc,u,h,e),c=l.content,f=l.breakAtStart,d=l.openStart,v=l.openEnd,p=r.findPos(s,1),g=p.i,m=p.off,y=r.findPos(a,-1),k=y.i,b=y.off;this.replaceRange(k,b,g,m,c,f,d,v)}}},{key:"replaceRange",value:function(t,e,n,r,i,o,a,s){var u=this.children[t],h=i.length?i[i.length-1]:null,l=h?h.breakAfter:o;if(t!=n||o||l||!(i.length<2)||!u.merge(e,r,i.length?h:null,0==e,a,s)){var c=this.children[n];for(r0&&(!o&&i.length&&u.merge(e,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(e0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e||this.mayControlSelection()){var n=this.view.state.selection.main,r=this.domAtPos(n.anchor),i=n.empty?r:this.domAtPos(n.head);if(q.gecko&&n.empty&&ue(r)){var o=document.createTextNode("");this.view.observer.ignore((function(){return r.node.insertBefore(o,r.node.childNodes[r.offset]||null)})),r=i=new at(o,0),t=!0}var a=F(this.root);(t||!a.focusNode||q.gecko&&n.empty&&fe(a.focusNode,a.focusOffset)||!G(r.node,r.offset,a.anchorNode,a.anchorOffset)||!G(i.node,i.offset,a.focusNode,a.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if(q.gecko){var t=fe(r.node,r.offset);if(t&&3!=t){var e=ce(r.node,r.offset,1==t?1:-1);e&&(r=new at(e,1==t?0:e.nodeValue.length))}}a.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=a.cursorBidiLevel&&(a.cursorBidiLevel=n.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(i.node,i.offset);else{var o=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}o.setEnd(i.node,i.offset),o.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(o)}})),this.impreciseAnchor=r.precise?null:new at(a.anchorNode,a.anchorOffset),this.impreciseHead=i.precise?null:new at(a.focusNode,a.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var t=this.view.state.selection.main,e=F(this.root);if(t.empty&&t.assoc&&e.modify){var n=Bt.find(this,t.head);if(n){var r=n.posAtStart;if(t.head!=r&&t.head!=r+n.length){var i=this.coordsAt(t.head,-1),o=this.coordsAt(t.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(t.head+t.assoc);e.collapse(a.node,a.offset),e.modify("move",t.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Jt)?this.root.activeElement==this.dom:U(this.dom,F(this.root))}},{key:"nearest",value:function(t){for(var e=t;e;){var n=ut.get(e);if(n&&n.rootView==this)return n;e=e.parentNode}return null}},{key:"posFromDOM",value:function(t,e){var n=this.nearest(t);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(t,e)+n.posAtStart}},{key:"domAtPos",value:function(t){for(var e=this.childCursor().findPos(t,-1),n=e.i,r=e.off;no||t==o&&(i.type==Ot.Text||!r||this.children[r-1].breakAfter))return i.coordsAt(t-o,e);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var t=[],e=this.view.viewState.viewport,n=e.from,r=e.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;ar)break;if(o>=n){t.push(s.dom.getBoundingClientRect().height);var h=s.dom.scrollWidth;h>i&&(this.minWidth=i=h,this.minWidthFrom=o,this.minWidthTo=u)}o=u+s.breakAfter}return t}},{key:"measureTextSize",value:function(){var t,e=this,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r instanceof Bt){var i=r.measureTextSize();if(i)return i}}}catch(u){n.e(u)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){e.dom.appendChild(s);var t=J(s.firstChild)[0];o=s.getBoundingClientRect().height,a=t?t.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,e=this.children.length;return e&&(t-=this.children[--e].length),new ct(this.children,t,e)}},{key:"computeBlockGapDeco",value:function(){for(var t=[],e=this.view.viewState,n=0,r=0;;r++){var i=r==e.viewports.length?null:e.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=e.lineAt(o,0).bottom-e.lineAt(n,0).top;t.push(Tt.replace({widget:new he(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Tt.set(t)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(C(this.view.state.facet(re)),C(this.view.pluginField(Kt.decorations)))}},{key:"scrollPosIntoView",value:function(t,e){var n=this.coordsAt(t,e);if(n){var r,i=0,o=0,a=0,s=0,u=M(this.view.pluginField(Kt.scrollMargins));try{for(u.s();!(r=u.n()).done;){var h=r.value;if(h){var l=h.left,c=h.right,f=h.top,d=h.bottom;null!=l&&(i=Math.max(i,l)),null!=c&&(o=Math.max(o,c)),null!=f&&(a=Math.max(a,f)),null!=d&&(s=Math.max(s,d))}}}catch(v){u.e(v)}finally{u.f()}!function(t,e){for(var n=t.ownerDocument.defaultView,r=t.parentNode;r;)if(1==r.nodeType){var i=void 0,o=r==document.body;if(o)i=tt(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var a=r.getBoundingClientRect();i={left:a.left,right:a.left+r.clientWidth,top:a.top,bottom:a.top+r.clientHeight}}var s=0,u=0;if(e.topi.bottom&&(u=e.bottom-i.bottom+5),e.lefti.right&&(s=e.right-i.right+5),s||u)if(o)n.scrollBy(s,u);else{if(u){var h=r.scrollTop;r.scrollTop+=u,u=r.scrollTop-h}if(s){var l=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-l}e={left:e.left-s,top:e.top-u,right:e.right-s,bottom:e.bottom-u}}if(o)break;r=r.assignedSlot||r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-a,right:n.right+o,bottom:n.bottom+s})}}},{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}}]),n}(ut);function ue(t){return 1==t.node.nodeType&&t.node.firstChild&&(0==t.offset||"false"==t.node.childNodes[t.offset-1].contentEditable)&&(t.offset0&&n<=0)e=X(t=t.childNodes[e-1]);else{if(!(1==t.nodeType&&e=0))return null;t=t.childNodes[e],e=0}}}function fe(t,e){return 1!=t.nodeType?0:(e&&"false"==t.childNodes[e-1].contentEditable?1:0)|(e=e){if(a.level==n)return o;(i<0||(0!=r?r<0?a.frome:t[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),t}(),Ee=[];function Pe(t,e){var n=t.length,r=e==pe?1:2,i=e==pe?2:1;if(!t||1==r&&!Te.test(t))return Re(n);for(var o=0,a=r,s=r;o=0;S-=3)if(we[S+1]==-m){var x=we[S+2],A=2&x?r:4&x?1&x?i:r:0;A&&(Ee[k]=Ee[we[S]]=A),b=S;break}}else{if(189==we.length)break;we[b++]=k,we[b++]=g,we[b++]=w}else if(2==(y=Ee[k])||1==y){var C=y==r;w=C?0:1;for(var M=b-3;M>=0;M-=3){var O=we[M+2];if(2&O)break;if(C)we[M+2]|=2;else{if(4&O)break;we[M+2]|=4}}}for(var T=0;TN;){for(var V=j,W=2!=Ee[--j];j>N&&W==(2!=Ee[j-1]);)j--;L.push(new De(j,V,W?2:1))}else L.push(new De(N,B,0))}else for(var _=0;_t?e.left-t:Math.max(0,t-e.right)}function Ie(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function je(t,e){return t.tope.top+1}function Ve(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function _e(t,e,n){for(var r,i,o,a,s,u,h,l,c=t.firstChild;c;c=c.nextSibling)for(var f=J(c),d=0;dg||a==g&&o>p)&&(r=c,i=v,o=p,a=g),0==p?n>v.bottom&&(!h||h.bottomv.top)&&(u=c,l=v):h&&je(h,v)?h=We(h,v.bottom):l&&je(l,v)&&(l=Ve(l,v.top))}if(h&&h.bottom>=n?(r=s,i=h):l&&l.top<=n&&(r=u,i=l),!r)return{node:t,offset:0};var m=Math.max(i.left,Math.min(i.right,e));return 3==r.nodeType?ze(r,m,n):o||"true"!=r.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0)}:_e(r,m,n)}function ze(t,e,n){for(var r=t.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?l.top-n:n-l.bottom)-1;if(l.left-1<=e&&l.right+1>=e&&c=(l.left+l.right)/2,d=f;if(q.chrome||q.gecko)ot(t,s).getBoundingClientRect().left==l.right&&(d=!f);if(c<=0)return{node:t,offset:s+(d?1:0)};i=s+(d?1:0),o=c}}}return{node:t,offset:i>-1?i:a>0?t.nodeValue.length:0}}function He(t,e){for(var n,r=e.x,i=e.y,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=t.contentDOM.getBoundingClientRect(),s=t.defaultLineHeight/2,u=!1;;){if((n=t.blockAtHeight(i,a.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),u)return-1;u=!0}if(n.type==Ot.Text)break;i=o>0?n.bottom+s:n.top-s}var h=n.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:null;r=Math.max(a.left+1,Math.min(a.right-1,r));var l,c=t.root,f=c.elementFromPoint(r,i),d=-1;if(f&&t.contentDOM.contains(f)&&!(t.docView.nearest(f)instanceof mt))if(c.caretPositionFromPoint){var v=c.caretPositionFromPoint(r,i);v&&(l=v.offsetNode,d=v.offset)}else if(c.caretRangeFromPoint){var p=c.caretRangeFromPoint(r,i);p&&(l=p.startContainer,d=p.startOffset,q.safari&&qe(l,d,r)&&(l=void 0))}if(!l||!t.docView.dom.contains(l)){var g=Bt.find(t.docView,h),m=_e(g.dom,r,i);l=m.node,d=m.offset}return t.docView.posFromDOM(l,d)}function qe(t,e,n){var r;if(3!=t.nodeType||e!=(r=t.nodeValue.length))return!1;for(var i=t.nextSibling;i;i=t.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return ot(t,r-1,r).getBoundingClientRect().left>n}function Fe(t,e,n,i){var o=t.state.doc.lineAt(e.head),a=i&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(a){var s=t.dom.getBoundingClientRect(),u=t.posAtCoords({x:n==(t.textDirection==ve.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(null!=u)return r.jT.cursor(u,n?-1:1)}var h=Bt.find(t.docView,e.head),l=h?n?h.posAtEnd:h.posAtStart:n?o.to:o.from;return r.jT.cursor(l,n?-1:1)}function $e(t,e,n,i){for(var o=t.state.doc.lineAt(e.head),a=t.bidiSpans(o),s=e,u=null;;){var h=Be(o,a,t.textDirection,s,n),l=Le;if(!h){if(o.number==(n?t.state.doc.lines:1))return s;l="\n",o=t.state.doc.line(o.number+(n?1:-1)),a=t.bidiSpans(o),h=r.jT.cursor(n?o.from:o.to)}if(u){if(!u(l))return s}else{if(!i)return h;u=i(l)}s=h}}var Ue=function(){function t(e){var n=this;O(this,t),this.lastKeyCode=0,this.lastKeyTime=0,this.lastIOSEnter=0,this.lastIOSBackspace=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(t){var r=Ye[t];e.contentDOM.addEventListener(t,(function(i){"keydown"==t&&n.keydown(e,i)||Ke(e,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&e.observer.forceFlush(),n.runCustomHandlers(t,e,i)?i.preventDefault():r(e,i))})),n.registeredEvents.push(t)};for(var i in Ye)r(i);this.notifiedFocused=e.hasFocus,this.ensureHandlers(e)}return D(t,[{key:"setSelectionOrigin",value:function(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(t){var e,n=this,r=M(this.customHandlers=t.pluginField(Zt));try{for(r.s();!(e=r.n()).done;){var i=e.value,o=function(e){n.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(n.registeredEvents.push(e),t.contentDOM.addEventListener(e,(function(r){Ke(t,r)&&n.runCustomHandlers(e,t,r)&&r.preventDefault()})))};for(var a in i.handlers)o(a)}}catch(s){r.e(s)}finally{r.f()}}},{key:"runCustomHandlers",value:function(t,e,n){var r,i=M(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[t],s=!1;if(a){try{s=a.call(o.plugin,n,e)}catch(u){Ut(e.state,u)}if(s||n.defaultPrevented)return q.android&&"keydown"==t&&13==n.keyCode&&e.observer.flushSoon(),!0}}}catch(h){i.e(h)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(t,e){var n,r=M(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,e,t)}catch(a){Ut(t.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"keydown",value:function(t,e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!this.screenKeyEvent(t,e))return!(!q.ios||13!=e.keyCode&&8!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.synthetic)&&(this[13==e.keyCode?"lastIOSEnter":"lastIOSBackspace"]=Date.now(),!0)}},{key:"ignoreDuringComposition",value:function(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(q.safari&&t.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(t,e){var n=9==e.keyCode&&Date.now()=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}(n,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}return D(t,[{key:"move",value:function(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}},{key:"up",value:function(t){null==this.dragging&&this.select(this.startEvent),this.dragging||t.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(t){var e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,annotations:r.YW.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}]),t}();function Ke(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n,r=e.target;r!=t.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=ut.get(r))&&n.ignoreEvent(e))return!1;return!0}var Ye=Object.create(null),Xe=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function Qe(t,e){var n,i=t.state,o=1,a=i.toText(e),s=a.lines==i.selection.ranges.length;if(hn&&i.selection.ranges.every((function(t){return t.empty}))&&hn==a.toString()){var u=-1;n=i.changeByRange((function(t){var n=i.doc.lineAt(t.from);if(n.from==u)return{range:t};u=n.from;var h=i.toText((s?a.line(o++).text:e)+i.lineBreak);return{changes:{from:n.from,insert:h},range:r.jT.cursor(t.from+h.length)}}))}else n=s?i.changeByRange((function(t){var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:r.jT.cursor(t.from+e.length)}})):i.replaceSelection(a);t.dispatch(n,{annotations:r.YW.userEvent.of("paste"),scrollIntoView:!0})}Ye.keydown=function(t,e){t.inputState.setSelectionOrigin("keyboardselection")};var Ze=0;function tn(t,e,n,o){if(1==o)return r.jT.cursor(e,n);if(2==o)return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=t.charCategorizer(e),a=t.doc.lineAt(e),s=e-a.from;if(0==a.length)return r.jT.cursor(e);0==s?n=1:s==a.length&&(n=-1);var u=s,h=s;n<0?u=(0,i.cp)(a.text,s,!1):h=(0,i.cp)(a.text,s);for(var l=o(a.text.slice(u,h));u>0;){var c=(0,i.cp)(a.text,u,!1);if(o(a.text.slice(c,u))!=l)break;u=c}for(;hDate.now()-2e3)){var n,i=null,o=M(t.state.facet(Ht));try{for(o.s();!(n=o.n()).done;){if(i=(0,n.value)(t,e))break}}catch(a){o.e(a)}finally{o.f()}i||0!=e.button||(i=function(t,e){var n=on(t,e),i=function(t){if(!an)return t.detail;var e=sn;return sn=t,un=!e||e.timeStamp>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(un+1)%3:1}(e),o=t.state.selection,a=n,s=e;return{update:function(t){t.changes&&(n&&(n.pos=t.changes.mapPos(n.pos)),o=o.map(t.changes))},get:function(e,u,h){var l;if(e.clientX==s.clientX&&e.clientY==s.clientY?l=a:(l=a=on(t,e),s=e),!l||!n)return o;var c=tn(t,l.pos,l.bias,i);if(n.pos!=l.pos&&!u){var f=tn(t,n.pos,n.bias,i),d=Math.min(f.from,c.from),v=Math.max(f.to,c.to);c=d=e.top&&t<=e.bottom},nn=function(t,e,n){return en(e,n)&&t>=n.left&&t<=n.right};function rn(t,e,n,r){var i=Bt.find(t.docView,e);if(!i)return 1;var o=e-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&nn(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&nn(n,r,s)?1:a&&en(r,a)?-1:1}function on(t,e){var n=t.posAtCoords({x:e.clientX,y:e.clientY});return null==n?null:{pos:n,bias:rn(t,n,e.clientX,e.clientY)}}var an=q.ie&&q.ie_version<=11,sn=null,un=0;Ye.dragstart=function(t,e){var n=t.state.selection.main,r=t.inputState.mouseSelection;r&&(r.dragging=n),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove")},Ye.drop=function(t,e){if(e.dataTransfer&&t.state.facet(Jt)){var n=t.posAtCoords({x:e.clientX,y:e.clientY}),i=e.dataTransfer.getData("Text");if(null!=n&&i){e.preventDefault();var o=t.inputState.mouseSelection,a=o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:n,insert:i},u=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(n,-1),head:u.mapPos(n,1)},annotations:r.YW.userEvent.of("drop")})}}},Ye.paste=function(t,e){if(t.state.facet(Jt)){t.observer.flush();var n=Xe?null:e.clipboardData,r=n&&n.getData("text/plain");r?(Qe(t,r),e.preventDefault()):function(t){var e=t.dom.parentNode;if(e){var n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){t.focus(),n.remove(),Qe(t,n.value)}),50)}}(t)}};var hn=null;function ln(t){t.docView.compositionDeco.size&&t.update([])}Ye.copy=Ye.cut=function(t,e){var n=function(t){var e,n=[],r=[],i=!1,o=M(t.selection.ranges);try{for(o.s();!(e=o.n()).done;){var a=e.value;a.empty||(n.push(t.sliceDoc(a.from,a.to)),r.push(a))}}catch(f){o.e(f)}finally{o.f()}if(!n.length){var s,u=-1,h=M(t.selection.ranges);try{for(h.s();!(s=h.n()).done;){var l=s.value.from,c=t.doc.lineAt(l);c.number>u&&(n.push(c.text),r.push({from:c.from,to:Math.min(t.doc.length,c.to+1)})),u=c.number}}catch(f){h.e(f)}finally{h.f()}i=!0}return{text:n.join(t.lineBreak),ranges:r,linewise:i}}(t.state),i=n.text,o=n.ranges,a=n.linewise;if(i){hn=a?i:null;var s=Xe?null:e.clipboardData;s?(e.preventDefault(),s.clearData(),s.setData("text/plain",i)):function(t,e){var n=t.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout((function(){r.remove(),t.focus()}),50)}}(t,i),"cut"==e.type&&t.state.facet(Jt)&&t.dispatch({changes:o,scrollIntoView:!0,annotations:r.YW.userEvent.of("cut")})}},Ye.focus=Ye.blur=function(t){setTimeout((function(){t.hasFocus!=t.inputState.notifiedFocused&&t.update([])}),10)},Ye.beforeprint=function(t){t.viewState.printing=!0,t.requestMeasure(),setTimeout((function(){t.viewState.printing=!1,t.requestMeasure()}),2e3)},Ye.compositionstart=Ye.compositionupdate=function(t){t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),ln(t)),t.inputState.composing=0)},Ye.compositionend=function(t){t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout((function(){t.inputState.composing<0&&ln(t)}),50)};var cn=["pre-wrap","normal","pre-line"],fn=function(){function t(){O(this,t),this.doc=i.xv.empty,this.lineWrapping=!1,this.direction=ve.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return D(t,[{key:"heightForGap",value:function(t,e){var n=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(n+=Math.ceil((e-t-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(t){return this.doc=t,this}},{key:"mustRefresh",value:function(t,e,n){for(var r=!1,i=0;i-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(t,e,n,r,i,o){var a=cn.indexOf(t)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=e;if(this.lineWrapping=a,this.direction=e,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:2;O(this,t),this.length=e,this.height=n,this.flags=r}return D(t,[{key:"setHeight",value:function(t,e){this.height!=e&&(Math.abs(this.height-e)>1e-4&&(t.heightChanged=!0),this.height=e)}},{key:"replace",value:function(e,n,r){return t.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(this)}},{key:"decomposeRight",value:function(t,e){e.push(this)}},{key:"applyChanges",value:function(t,e,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,u=a.toA,h=a.fromB,l=a.toB,c=i.lineAt(s,pn.ByPosNoHeight,e,0,0),f=c.to>=u?c:i.lineAt(u,pn.ByPosNoHeight,e,0,0);for(l+=f.to-u,u=f.to;o>0&&c.from<=r[o-1].toA;)s=r[o-1].fromA,h=r[o-1].fromB,o--,s0},set:function(t){this.flags=(t?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new yn(0,0)}},{key:"of",value:function(e){if(1==e.length)return e[0];for(var n=0,r=e.length,i=0,o=0;;)if(n==r)if(i>2*o){var a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(gn),yn=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this,t,r,Ot.Text)).collapsed=0,i.widgetHeight=0,i}return D(n,[{key:"replace",value:function(t,e,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof kn&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof kn?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):gn.of(r)}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=e&&r.more?this.setHeight(t,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(mn),kn=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,t,0)}return D(n,[{key:"lines",value:function(t,e){var n=t.lineAt(e).number,r=t.lineAt(e+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(t,e,n,r){var i=this.lines(e,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,u=Math.max(0,Math.min(a-o,Math.floor((t-n)/s))),h=e.line(o+u),l=h.from,c=h.length;return new vn(l,c,n+s*u,s,Ot.Text)}},{key:"lineAt",value:function(t,e,n,r,i){if(e==pn.ByHeight)return this.blockAt(t,n,r,i);if(e==pn.ByPosNoHeight){var o=n.lineAt(t),a=o.from,s=o.to;return new vn(a,s-a,0,0,Ot.Text)}var u=this.lines(n,i),h=u.firstLine,l=u.lineHeight,c=n.lineAt(t),f=c.from,d=c.length,v=c.number;return new vn(f,d,r+l*(v-h),l,Ot.Text)}},{key:"forEachLine",value:function(t,e,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,u=a.lineHeight,h=Math.max(t,i),l=Math.min(i+this.length,e);h<=l;){var c=n.lineAt(h);h==t&&(r+=u*(c.number-s)),o(new vn(c.from,c.length,r,u,Ot.Text)),r+=u,h=c.to+1}}},{key:"replace",value:function(t,e,r){var i=this.length-e;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(t>0){var a=r[0];a instanceof n?r[0]=new n(t+a.length):r.unshift(new n(t-1),null)}return gn.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(new n(t-1),null)}},{key:"decomposeRight",value:function(t,e){e.push(null,new n(this.length-t-1))}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=e+this.length;if(i&&i.from<=e+this.length&&i.more){var a=[],s=Math.max(e,i.from);for(i.from>e&&a.push(new n(i.from-e-1).updateHeight(t,e));s<=o&&i.more;){var u=t.doc.lineAt(s).length;a.length&&a.push(null);var h=new yn(u,i.heights[i.index++]);h.outdated=!1,a.push(h),s+=u+1}return s<=o&&a.push(null,new n(o-s).updateHeight(t,s)),t.heightChanged=!0,gn.of(a)}return(r||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(gn),bn=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this,t.length+r+i.length,t.height+i.height,r|(t.outdated||i.outdated?2:0))).left=t,o.right=i,o.size=t.size+i.size,o}return D(n,[{key:"blockAt",value:function(t,e,n,r){var i=n+this.left.height;return ta))return u;var h=e==pn.ByPosNoHeight?pn.ByPosNoHeight:pn.ByPos;return s?u.join(this.right.lineAt(a,h,n,o,a)):this.left.lineAt(a,h,n,r,i).join(u)}},{key:"forEachLine",value:function(t,e,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)t=s&&this.right.forEachLine(t,e,n,a,s,o);else{var u=this.lineAt(s,pn.ByPos,n,r,i);t=t&&u.from<=e&&o(u),e>u.to&&this.right.forEachLine(u.to+1,e,n,a,s,o)}}},{key:"replace",value:function(t,e,n){var r=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-r,e-r,n));var i=[];t>0&&this.decomposeLeft(t,i);var o,a=i.length,s=M(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.push(u)}}catch(l){s.e(l)}finally{s.f()}if(t>0&&wn(i,a-1),e=++n&&e.push(null),t>n&&this.right.decomposeLeft(t-n,e)}},{key:"decomposeRight",value:function(t,e){var n=this.left.length,r=n+this.break;if(t>=r)return this.right.decomposeRight(t-r,e);t2*e.size||e.size>2*t.size?gn.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=e+i.length+this.break,s=null;return r&&r.from<=e+i.length&&r.more?s=i=i.updateHeight(t,e,n,r):i.updateHeight(t,e,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(t,a,n,r):o.updateHeight(t,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}},{key:"break",get:function(){return 1&this.flags}}]),n}(gn);function wn(t,e){var n,r;null==t[e]&&(n=t[e-1])instanceof kn&&(r=t[e+1])instanceof kn&&t.splice(e-1,3,new kn(n.length+1+r.length))}var Sn=function(){function t(e,n){O(this,t),this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}return D(t,[{key:"span",value:function(t,e){if(this.lineStart>-1){var n=Math.min(e,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof yn?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new yn(n-this.pos,-1)),this.writtenTo=n,e>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}},{key:"point",value:function(t,e,n){if(t=5)&&this.addLineDeco(r,i)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)){var t=this.oracle.doc.lineAt(this.pos),e=t.from,n=t.to;this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new yn(this.pos-e,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(t,e){var n=new kn(e-t);return this.oracle.doc.lineAt(t).to==e&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof yn)return t;var e=new yn(0,-1);return this.nodes.push(e),e}},{key:"addBlock",value:function(t){this.enterLine(),t.type!=Ot.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ot.WidgetBefore&&(this.covering=t)}},{key:"addLineDeco",value:function(t,e){var n=this.ensureLine();n.length+=e,n.collapsed+=e,n.widgetHeight=Math.max(n.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}},{key:"finish",value:function(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof yn||this.isCovered?(this.writtenTo=e&&i<=n}))){var o=t.lineAt(i,0),a=o.from,s=o.to;e.push(new Tn(a,s))}},i=0;i<=1;i++)r(i);this.viewports=e.sort((function(t,e){return t.from-e.from})),this.scaler=this.heightMap.height<=7e6?Rn:new Ln(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=t.state;var i=this.state.facet(re),o=t.changedRanges,a=oe.extendWithRanges(o,xn(t.startState.facet(re),i,t?t.changes:r.as.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(i,n.doc,this.heightOracle.setDoc(this.state.doc),a),this.heightMap.height!=s&&(t.flags|=2);var u=a.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.headu.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,e)),u.eq(this.viewport)||(this.viewport=u,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(t.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes)))),this.computeVisibleRanges(),e&&(this.scrollTo=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(t,e){var n=t.dom,r="",i=ve.LTR;if(!e){var o=window.getComputedStyle(n);r=o.whiteSpace,i="rtl"==o.direction?ve.RTL:ve.LTR,this.paddingTop=parseInt(o.paddingTop)||0,this.paddingBottom=parseInt(o.paddingBottom)||0}var a=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(t,e){for(var n=t.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=t.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var u=s.getBoundingClientRect();r=Math.max(r,u.left),i=Math.min(i,u.right),o=Math.max(o,u.top),a=Math.min(a,u.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+e),bottom:a-(n.top+e)}}(n,this.paddingTop),s=a.top-this.pixelViewport.top,u=a.bottom-this.pixelViewport.bottom;if(this.pixelViewport=a,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var h=t.measureVisibleLineHeights(),l=!1,c=0,f=0,d=this.heightOracle;if(!e){var v=t.dom.clientWidth;if(d.mustRefresh(h,r,i)||d.lineWrapping&&Math.abs(v-this.contentWidth)>d.charWidth){var p=t.measureTextSize(),g=p.lineHeight,m=p.charWidth;(l=d.refresh(r,i,g,m,v/m,h))&&(t.minWidth=0,f|=16)}this.contentWidth!=v&&(this.contentWidth=v,f|=16),s>0&&u>0?c=Math.max(s,u):s<0&&u<0&&(c=Math.min(s,u))}if(d.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(d,0,l,new dn(this.viewport.from,h)),d.heightChanged&&(f|=2),!this.viewportIsAppropriate(this.viewport,c)||this.scrollTo&&(this.scrollTo.headthis.viewport.to)){var y=this.getViewport(c,this.scrollTo);y.from==this.viewport.from&&y.to==this.viewport.to||(this.viewport=y,f|=4)}return this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(f|=this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.enforceCursorAssoc()),f}},{key:"getViewport",value:function(t,e){var n=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.visibleTop,a=this.visibleBottom,s=new Tn(r.lineAt(o-1e3*n,pn.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),pn.ByHeight,i,0,0).to);if(e)if(e.heads.to){var h=r.lineAt(e.head,pn.ByPos,i,0,0).bottom;s=new Tn(r.lineAt(h-(a-o)-500,pn.ByHeight,i,0,0).from,r.lineAt(h+500,pn.ByHeight,i,0,0).to)}return s}},{key:"mapViewport",value:function(t,e){var n=e.mapPos(t.from,-1),r=e.mapPos(t.to,1);return new Tn(this.heightMap.lineAt(n,pn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,pn.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(t){var e=t.from,n=t.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(e,pn.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,pn.ByPos,this.state.doc,0,0),s=a.bottom,u=this.visibleTop,h=this.visibleBottom;return(0==e||o<=u-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=h+Math.max(10,Math.min(r,250)))&&o>u-2e3&&si&&(r.push({from:i,to:t}),o+=t-i),i=e}},20),i=r.from&&(o=h.from),h.from<=r.to&&h.to>=s&&(s=h.to);var l=o-1e4,c=s+1e4;l>r.from+5e3&&n.push(Pn(t,(function(t){return t.from==r.from&&t.to>l-5e3&&t.toc-5e3&&t.from=1)return r[r.length-1].to;for(var i=Math.floor(n*e),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function En(t,e){var n,r=0,i=M(t.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(e<=s){r+=e-a;break}r+=s-a}}catch(u){i.e(u)}finally{i.f()}return r/t.total}function Pn(t,e){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(e(i))return i}}catch(o){r.e(o)}finally{r.f()}}var Rn={toDOM:function(t){return t},fromDOM:function(t){return t},scale:1},Ln=function(){function t(e,n,r){O(this,t);var i=0,o=0,a=0;this.viewports=r.map((function(t){var r=t.from,o=t.to,a=n.lineAt(r,pn.ByPos,e,0,0).top,s=n.lineAt(o,pn.ByPos,e,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,u=M(this.viewports);try{for(u.s();!(s=u.n()).done;){var h=s.value;h.domTop=a+(h.top-o)*this.scale,a=h.domBottom=h.domTop+(h.bottom-h.top),o=h.bottom}}catch(l){u.e(l)}finally{u.f()}}return D(t,[{key:"toDOM",value:function(t,e){t-=e;for(var n=0,r=0,i=0;;n++){var o=n-1}}),jn=o.V.newName(),Vn=o.V.newName(),Wn=o.V.newName(),_n={"&light":"."+Vn,"&dark":"."+Wn};function zn(t,e,n){return new o.V(e,{finish:function(e){return/&/.test(e)?e.replace(/&\w*/,(function(e){if("&"==e)return t;if(!n||!n[e])throw new RangeError("Unsupported selector: ".concat(e));return n[e]})):t+" "+e}})}var Hn=zn("."+jn,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,flexGrow:2,overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},_n),qn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},Fn=q.ie&&q.ie_version<=11,$n=function(){function t(e,n,r){var i=this;O(this,t),this.view=e,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new nt,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((function(t){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.queue.push(o)}}catch(a){r.e(a)}finally{r.f()}(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?i.flushSoon():i.flush()})),Fn&&(this.onCharData=function(t){i.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(t){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),t[t.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.intersecting!=i.view.inView&&i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return D(t,[{key:"onScroll",value:function(t){this.intersecting&&(this.flush(),this.onScrollChanged(t))}},{key:"onSelectionChange",value:function(t){var e=this.view,n=F(e.root);if(e.state.facet(Jt)?e.root.activeElement==this.dom:U(e.dom,n)){var r=n.anchorNode&&e.docView.nearest(n.anchorNode);r&&r.ignoreEvent(t)||(q.ie&&q.ie_version<=11&&!e.state.selection.main.empty&&n.focusNode&&G(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush())}}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var t=0,e=null,n=this.dom;n;)if(1==n.nodeType)!e&&t=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var t=this;if(!(this.delayedFlush>=0)){var e,n=this.queue,r=M(this.observer.takeRecords());try{for(r.s();!(e=r.n()).done;){var i=e.value;n.push(i)}}catch(p){r.e(p)}finally{r.f()}n.length&&(this.queue=[]);var o=F(this.view.root),a=!this.ignoreSelection.eq(o)&&U(this.dom,o);if(0!=n.length||a){var s,u=-1,h=-1,l=!1,c=M(n);try{for(c.s();!(s=c.n()).done;){var f=s.value,d=this.readMutation(f);d&&(d.typeOver&&(l=!0),-1==u?(u=d.from,h=d.to):(u=Math.min(d.from,u),h=Math.max(d.to,h)))}}catch(p){c.e(p)}finally{c.f()}var v=this.view.state;(u>-1||a)&&this.onChange(u,h,l),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return t.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(),"childList"==t.type){var n=Un(e,t.previousSibling||t.target.previousSibling,-1),r=Un(e,t.nextSibling||t.target.nextSibling,1);return{from:n?e.posAfter(n):e.posAtStart,to:r?e.posBefore(r):e.posAtEnd,typeOver:!1}}return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var t,e=M(this.scrollTargets);try{for(e.s();!(t=e.n()).done;){t.value.removeEventListener("scroll",this.onScroll)}}catch(n){e.e(n)}finally{e.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),t}();function Un(t,e,n){for(;e;){var r=ut.get(e);if(r&&r.parent==t)return r;var i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Jn(t,e,n,i){var o,a,s,u=t.state.selection.main;if(e>-1&&(s=t.docView.domBoundsAround(e,n,0))){var h=s,l=h.from,c=h.to,f=t.docView.impreciseHead||t.docView.impreciseAnchor?[]:function(t,e){var n=[];if(e.activeElement!=t)return n;var r=F(e),i=r.anchorNode,o=r.anchorOffset,a=r.focusNode,s=r.focusOffset;i&&(n.push(new Yn(i,o)),a==i&&s==o||n.push(new Yn(a,s)));return n}(t.contentDOM,t.root),d=new Gn(f,t);d.readRange(s.startDOM,s.endDOM),a=function(t,e){if(0==t.length)return null;var n=t[0].pos,i=2==t.length?t[1].pos:n;return n>-1&&i>-1?r.jT.single(n+e,i+e):null}(f,l);var v=u.from,p=null;(8===t.inputState.lastKeyCode&&t.inputState.lastKeyTime>Date.now()-100||q.android&&d.text.length0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(t.state.sliceDoc(l,c),d.text,v-l,p);g&&(o={from:l+g.from,to:l+g.toA,insert:t.state.toText(d.text.slice(g.from,g.toB))})}else if(t.hasFocus||!t.state.facet(Jt)){var m=F(t.root),y=t.docView,k=y.impreciseHead,b=y.impreciseAnchor,w=k&&k.node==m.focusNode&&k.offset==m.focusOffset||!$(t.contentDOM,m.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(m.focusNode,m.focusOffset),S=b&&b.node==m.anchorNode&&b.offset==m.anchorOffset||!$(t.contentDOM,m.anchorNode)?t.state.selection.main.anchor:function(t){var e=t.isCollapsed;return e&&q.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e}(m)?w:t.docView.posFromDOM(m.anchorNode,m.anchorOffset);w==u.head&&S==u.anchor||(a=r.jT.single(S,w))}if(o||a)if(!o&&i&&!u.empty&&a&&a.main.empty?o={from:u.from,to:u.to,insert:t.state.doc.slice(u.from,u.to)}:o&&o.from>=u.from&&o.to<=u.to&&(o.from!=u.from||o.to!=u.to)&&u.to-u.from-(o.to-o.from)<=4&&(o={from:u.from,to:u.to,insert:t.state.doc.slice(u.from,o.from).append(o.insert).append(t.state.doc.slice(o.to,u.to))}),o){var x=t.state;if(q.android&&(o.from==u.from&&o.to==u.to&&1==o.insert.length&&2==o.insert.lines&&Xn(t,"Enter",13)||o.from==u.from-1&&o.to==u.to&&0==o.insert.length&&Xn(t,"Backspace",8)||o.from==u.from&&o.to==u.to+1&&0==o.insert.length&&Xn(t,"Delete",46))||q.ios&&(t.inputState.lastIOSEnter>Date.now()-225&&o.insert.lines>1&&Xn(t,"Enter",13)||t.inputState.lastIOSBackspace>Date.now()-225&&!o.insert.length&&Xn(t,"Backspace",8)))return;var A,C=o.insert.toString();if(t.state.facet($t).some((function(e){return e(t,o.from,o.to,C)})))return;if(t.inputState.composing>=0&&t.inputState.composing++,o.from>=u.from&&o.to<=u.to&&o.to-o.from>=(u.to-u.from)/3&&(!a||a.main.empty&&a.main.from==o.from+o.insert.length)){var M=u.fromo.to?x.sliceDoc(o.to,u.to):"";A=x.replaceSelection(t.state.toText(M+o.insert.sliceString(0,void 0,t.state.lineBreak)+O))}else{var T=x.changes(o);A={changes:T,selection:a&&!x.selection.main.eq(a.main)&&a.main.to<=T.newLength?x.selection.replaceRange(a.main):void 0}}t.dispatch(A,{scrollIntoView:!0,annotations:r.YW.userEvent.of("input")})}else if(a&&!a.main.eq(u)){var D,E=!1;t.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==t.inputState.lastSelectionOrigin?E=!0:D=r.YW.userEvent.of(t.inputState.lastSelectionOrigin)),t.dispatch({selection:a,scrollIntoView:E,annotations:D})}}var Gn=function(){function t(e,n){O(this,t),this.points=e,this.view=n,this.text="",this.lineBreak=n.state.lineBreak}return D(t,[{key:"readRange",value:function(t,e){if(t){for(var n=t.parentNode,r=t;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==e)break;var o=ut.get(r),a=ut.get(i);((o?o.breakAfter:Kn(r))||(a?a.breakAfter:Kn(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=this.lineBreak),r=i}this.findPointBefore(n,e)}}},{key:"readNode",value:function(t){if(!t.cmIgnore){var e,n=ut.get(t),r=n&&n.overrideDOMText;null!=r?e=r.sliceString(0,void 0,this.lineBreak):3==t.nodeType?e=t.nodeValue:"BR"==t.nodeName?e=t.nextSibling?this.lineBreak:"":1==t.nodeType&&this.readRange(t.firstChild,null),null!=e&&(this.findPointIn(t,e.length),this.text+=e,q.chrome&&13==this.view.inputState.lastKeyCode&&!t.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}},{key:"findPointBefore",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}catch(o){r.e(o)}finally{r.f()}}}]),t}();function Kn(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}var Yn=function t(e,n){O(this,t),this.node=e,this.offset=n,this.pos=-1};function Xn(t,e,n){var r={key:e,code:e,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,t.contentDOM.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.contentDOM.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}var Qn=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,t),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(t){return e.update([t])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new On(n.state||r.yy.create()),this.plugins=this.state.facet(Xt).map((function(t){return new te(t).update(e)})),this.observer=new $n(this,(function(t,n,r){Jn(e,t,n,r)}),(function(t){e.inputState.runScrollHandlers(e,t),e.measure()})),this.inputState=new Ue(this),this.docView=new se(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,nr(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return D(t,[{key:"dispatch",value:function(){var t;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof r.YW?arguments.length<=0?void 0:arguments[0]:(t=this.state).update.apply(t,arguments))}},{key:"update",value:function(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,n,i=!1,o=this.state,a=M(t);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=s.state}}catch(c){a.e(c)}finally{a.f()}if(o.facet(r.yy.phrases)!=this.state.facet(r.yy.phrases))return this.setState(o);e=new ae(this,o,t);try{this.updateState=2;var u=t.some((function(t){return t.scrollIntoView}))?o.selection.main:null;this.viewState.update(e,u),this.bidiCache=or.update(this.bidiCache,e.changes),e.empty||this.updatePlugins(e),i=this.docView.update(e),this.state.facet(ie)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((i||scrollTo||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!e.empty){var h,l=M(this.state.facet(Ft));try{for(l.s();!(h=l.n()).done;){(0,h.value)(e)}}catch(c){l.e(c)}finally{l.f()}}}},{key:"setState",value:function(t){var e=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;try{var n,r=M(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new On(t),this.plugins=t.facet(Xt).map((function(t){return new te(t).update(e)})),this.docView=new se(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}},{key:"updatePlugins",value:function(t){var e=t.startState.facet(Xt),n=t.state.facet(Xt);if(e!=n){var r,i=[],o=M(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.indexOf(a);if(s<0)i.push(new te(a));else{var u=this.plugins[s];u.mustUpdate=t,i.push(u)}}}catch(p){o.e(p)}finally{o.f()}var h,l=M(this.plugins);try{for(l.s();!(h=l.n()).done;){var c=h.value;c.mustUpdate!=t&&c.destroy(this)}}catch(p){l.e(p)}finally{l.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else{var f,d=M(this.plugins);try{for(d.s();!(f=d.n()).done;){f.value.mustUpdate=t}}catch(p){d.e(p)}finally{d.f()}}for(var v=0;v-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;var e=null;try{for(var n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var o=i.map((function(e){try{return e.read(t)}catch(n){return Ut(t.state,n),ir}})),a=new ae(this,this.state);a.flags|=r,e?e.flags|=r:e=a,this.updateState=2,a.empty||this.updatePlugins(a),this.updateAttrs(),r&&this.docView.update(a);for(var s=0;s-1&&this.measure()}},{key:"requestMeasure",value:function(t){var e=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return e.measure()}))),t){if(null!=t.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(t,e)}},{key:"moveByChar",value:function(t,e,n){return $e(this,t,e,n)}},{key:"moveByGroup",value:function(t,e){var n=this;return $e(this,t,e,(function(e){return function(t,e,n){var i=t.state.charCategorizer(e),o=i(n);return function(t){var e=i(t);return o==r.D0.Space&&(o=e),o==e}}(n,t.head,e)}))}},{key:"moveToLineBoundary",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Fe(this,t,e,n)}},{key:"moveVertically",value:function(t,e,n){return function(t,e,n,o){var a,s=e.head,u=n?1:-1;if(s==(n?t.state.doc.length:0))return r.jT.cursor(s);var h=t.coordsAtPos(s);if(h)for(var l=t.dom.getBoundingClientRect(),c=null!==(a=e.goalColumn)&&void 0!==a?a:h.left-l.left,f=l.left+c,d=null!=o?o:t.defaultLineHeight>>1,v=u<0?h.top:h.bottom,p=0;p<50;p+=10){var g=He(t,{x:f,y:v+(d+p)*u},u);if(null==g)break;if(g!=s)return r.jT.cursor(g,void 0,void 0,c)}var m=t.state.doc,y=m.lineAt(s),k=t.state.tabSize,b=e.goalColumn,w=0;if(null==b){for(var S=m.iterRange(y.from,s);!S.next().done;)w=(0,i.IS)(S.value,w,k);b=w*t.defaultCharacterWidth}else w=Math.round(b/t.defaultCharacterWidth);if(u<0&&0==y.from)return r.jT.cursor(0);if(u>0&&y.to==m.length)return r.jT.cursor(y.to);for(var x=m.line(y.number+u),A=x.from,C=0,M=m.iterRange(x.from,x.to);C>=w&&!M.next().done;){var O=(0,i.Gz)(M.value,C,w,k),T=O.offset;C=w-O.leftOver,A+=T}return r.jT.cursor(A,void 0,void 0,b)}(this,t,e,n)}},{key:"scrollPosIntoView",value:function(t){this.viewState.scrollTo=r.jT.cursor(t),this.requestMeasure()}},{key:"domAtPos",value:function(t){return this.docView.domAtPos(t)}},{key:"posAtDOM",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(t,e)}},{key:"posAtCoords",value:function(t){return this.readMeasured(),He(this,t)}},{key:"coordsAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(t,e);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(t),i=this.bidiSpans(r),o=i[De.find(i,t-r.from,-1,e)];return Z(n,o.dir==ve.LTR==e>0)}},{key:"bidiSpans",value:function(t){if(t.length>Zn)return Re(t.length);var e,n=this.textDirection,r=M(this.bidiCache);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.from==t.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=Pe(t.text,this.textDirection);return this.bidiCache.push(new or(t.from,t.to,n,o)),o}},{key:"focus",value:function(){var t=this;this.observer.ignore((function(){it(t.contentDOM),t.docView.updateSelection()}))}},{key:"destroy",value:function(){var t,e=M(this.plugins);try{for(e.s();!(t=e.n()).done;){t.value.destroy(this)}}catch(n){e.e(n)}finally{e.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"themeClasses",get:function(){return jn+" "+(this.state.facet(In)?Wn:Vn)+" "+this.state.facet(Nn)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return document.hasFocus()&&this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(t){return Qt.define((function(){return{}}),{eventHandlers:t})}},{key:"theme",value:function(t,e){var n=o.V.newName(),r=[Nn.of(n),ie.of(zn(".".concat(n),t))];return e&&e.dark&&r.push(In.of(!0)),r}},{key:"baseTheme",value:function(t){return r.Wl.fallback(ie.of(zn("."+jn,t,_n)))}}]),t}();Qn.styleModule=ie,Qn.inputHandler=$t,Qn.exceptionSink=qt,Qn.updateListener=Ft,Qn.editable=Jt,Qn.mouseSelectionStyle=Ht,Qn.dragMovesSelection=zt,Qn.clickAddsSelectionRange=_t,Qn.decorations=re,Qn.contentAttributes=ne,Qn.editorAttributes=ee,Qn.lineWrapping=Qn.contentAttributes.of({class:"cm-lineWrapping"}),Qn.announce=r.Py.define();var Zn=4096;function tr(t,e){return null==t?e.getBoundingClientRect().top:t}var er=-1;function nr(){window.addEventListener("resize",(function(){-1==er&&(er=setTimeout(rr,50))}))}function rr(){er=-1;for(var t=document.querySelectorAll(".cm-content"),e=0;e1&&void 0!==arguments[1]?arguments[1]:ar,r=Object.create(null),i=Object.create(null),o=function(t,e){var n=i[t];if(null==n)i[t]=e;else if(n!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},a=function(t,e,i,a){for(var s=r[t]||(r[t]=Object.create(null)),u=e.split(/ (?!$)/).map((function(t){return sr(t,n)})),h=function(e){var n=u.slice(0,e).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(e){var r=vr={view:e,prefix:n,scope:t};return setTimeout((function(){vr==r&&(vr=null)}),pr),!0}]})},l=1;l0&&void 0!==arguments[0]?arguments[0]:{};return[yr.of(t),wr,xr]}var br=function(){function t(e,n,r,i,o){O(this,t),this.left=e,this.top=n,this.width=r,this.height=i,this.className=o}return D(t,[{key:"draw",value:function(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t}},{key:"adjust",value:function(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width>=0&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}},{key:"eq",value:function(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}}]),t}(),wr=Qt.fromClass(function(){function t(e){O(this,t),this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}return D(t,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(yr).cursorBlinkRate+"ms"}},{key:"update",value:function(t){var e=t.startState.facet(yr)!=t.state.facet(yr);(e||t.selectionSet||t.geometryChanged||t.viewportChanged)&&this.view.requestMeasure(this.measureReq),t.transactions.some((function(t){return t.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}},{key:"readPos",value:function(){var t,e=this,n=this.view.state,r=n.facet(yr),i=n.selection.ranges.map((function(t){return t.empty?[]:function(t,e){if(e.to<=t.viewport.from||e.from>=t.viewport.to)return[];var n=Math.max(e.from,t.viewport.from),r=Math.min(e.to,t.viewport.to),i=t.textDirection==ve.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),s=Ar(t),u=window.getComputedStyle(o.firstChild),h=a.left+parseInt(u.paddingLeft),l=a.right-parseInt(u.paddingRight),c=t.visualLineAt(n),f=t.visualLineAt(r);t.lineWrapping&&(c=Cr(t,n,c),f=Cr(t,r,f));if(c.from==f.from)return m(y(e.from,e.to,c));var d=y(e.from,null,c),v=y(null,e.to,f),p=[];return c.tof&&p.from=m)break;x>g&&u(Math.max(S,g),null==e&&S<=f,Math.min(x,m),null==n&&x>=d,w.dir)}}catch(A){b.e(A)}finally{b.f()}if((g=k.to+1)>=m)break}}}catch(A){v.e(A)}finally{v.f()}return 0==s.length&&u(f,null==e,d,null==n,t.textDirection),{top:o,bottom:a,horizontal:s}}}(e.view,t)})).reduce((function(t,e){return t.concat(e)})),o=[],a=M(n.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value,u=s==n.selection.main;if(s.empty?!u||mr:r.drawRangeCursor){var h=Mr(this.view,s,u);h&&o.push(h)}}}catch(l){a.e(l)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(t){var e=this,n=t.rangePieces,r=t.cursors;if(n.length!=this.rangePieces.length||n.some((function(t,n){return!t.eq(e.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(c){o.e(c)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(t,n){return!t.eq(e.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var u,h=M(r);try{for(h.s();!(u=h.n()).done;){var l=u.value;this.cursorLayer.appendChild(l.draw())}}catch(c){h.e(c)}finally{h.f()}}else r.forEach((function(t,e){return t.adjust(s[e])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),t}()),Sr={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};mr&&(Sr[".cm-line"].caretColor="transparent !important");var xr=r.Wl.override(Qn.theme(Sr));function Ar(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ve.LTR?e.left:e.right-t.scrollDOM.clientWidth)-t.scrollDOM.scrollLeft,top:e.top-t.scrollDOM.scrollTop}}function Cr(t,e,n){var i=r.jT.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(i,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(i,!0,!0).from)}}function Mr(t,e,n){var r=t.coordsAtPos(e.head,e.assoc||1);if(!r)return null;var i=Ar(t);return new br(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}function Or(){return Dr}var Tr=Tt.line({attributes:{class:"cm-activeLine"}}),Dr=Qt.fromClass(function(){function t(e){O(this,t),this.decorations=this.getDeco(e)}return D(t,[{key:"update",value:function(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e,n=-1,r=[],i=M(t.state.selection.ranges);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(!o.empty)return Tt.none;var a=t.visualLineAt(o.head);a.from>n&&(r.push(Tr.range(a.from)),n=a.from)}}catch(s){i.e(s)}finally{i.f()}return Tt.set(r)}}]),t}(),{decorations:function(t){return t.decorations}})},26856:function(t,e,n){"use strict";function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=e.deserialize;o(this,t),this.id=h++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return s(t,[{key:"set",value:function(t,e){return t[this.id]=e,t}},{key:"add",value:function(t){var e=this;return"function"!=typeof t&&(t=d.match(t)),function(n){var r=t(n);return void 0===r?null:[e,r]}}}],[{key:"string",value:function(){return new t({deserialize:function(t){return t}})}},{key:"number",value:function(){return new t({deserialize:Number})}},{key:"flag",value:function(){return new t({deserialize:function(){return!0}})}}]),t}();c.closedBy=new c({deserialize:function(t){return t.split(" ")}}),c.openedBy=new c({deserialize:function(t){return t.split(" ")}}),c.group=new c({deserialize:function(t){return t.split(" ")}});var f=Object.create(null),d=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o(this,t),this.name=e,this.props=n,this.id=r,this.flags=i}return s(t,[{key:"prop",value:function(t){return this.props[t.id]}},{key:"is",value:function(t){if("string"==typeof t){if(this.name==t)return!0;var e=this.prop(c.group);return!!e&&e.indexOf(t)>-1}return this.id==t}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}}],[{key:"define",value:function(e){var n=e.props&&e.props.length?Object.create(null):f,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new t(e.name||"",n,e.id,i);if(e.props){var a,s=r(e.props);try{for(s.s();!(a=s.n()).done;){var u=a.value;Array.isArray(u)||(u=u(o)),u&&u[0].set(n,u[1])}}catch(h){s.e(h)}finally{s.f()}}return o}},{key:"match",value:function(t){var e=Object.create(null);for(var n in t){var i,o=r(n.split(" "));try{for(o.s();!(i=o.n()).done;){var a=i.value;e[a]=t[n]}}catch(s){o.e(s)}finally{o.f()}}return function(t){for(var n=t.prop(c.group),r=-1;r<(n?n.length:0);r++){var i=e[r<0?t.name:n[r]];if(i)return i}}}}]),t}();d.none=new d("",Object.create(null),0,8);var v=function(){function t(e){o(this,t),this.types=e;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=null!=t&&l.get(this)||this.topNode,r=new S(n);return null!=t&&(r.moveTo(t,e),l.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new S(this.topNode,!0)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor(t,e).node}},{key:"iterate",value:function(t){for(var e=t.enter,n=t.leave,r=t.from,i=void 0===r?0:r,o=t.to,a=void 0===o?this.length:o,s=this.cursor();;){var u=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==e(s.type,s.from,s.to))){if(s.firstChild())continue;s.type.isAnonymous||(u=!0)}for(;u&&n&&n(s.type,s.from,s.to),u=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;u=!0}}}},{key:"balance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return this.children.length<=C?this:O(this.type,d.none,this.children,this.positions,0,this.children.length,0,t,this.length,0)}},{key:"topNode",get:function(){return new y(this,0,0,null)}}],[{key:"build",value:function(t){return M(t)}}]),t}();function g(t,e){return e&&(t.contextHash=e),t}p.empty=new p(d.none,[],[],0);var m=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.none;o(this,t),this.buffer=e,this.length=n,this.set=r,this.type=i}return s(t,[{key:"toString",value:function(){for(var t=[],e=0;e0){if(u>r&&(o=a),u>r)break}else if(s=r)break}else if(o=a,n>0)break;return o}}]),t}(),y=function(){function t(e,n,r,i){o(this,t),this.node=e,this.from=n,this.index=r,this._parent=i}return s(t,[{key:"nextChild",value:function(e,n,r){for(var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this;;){for(var a=o.node,s=a.children,u=a.positions,h=n>0?s.length:-1;e!=h;e+=n){var l=s[e],c=u[e]+o.from;if(-1e8==r||!(n<0?c>=r:c+l.length<=r))if(l instanceof m){var f=l.findChild(0,l.buffer.length,n,-1e8==r?-1e8:r-c);if(f>-1)return new w(new b(o,l,e,c),null,f)}else if(i||!l.type.isAnonymous||x(l)){var d=new t(l,c,e,o);return i||!d.type.isAnonymous?d:d.nextChild(n<0?l.children.length-1:0,n,r)}}if(i||!o.type.isAnonymous)return null;if(e=o.index+n,!(o=o._parent))return null}}},{key:"childAfter",value:function(t){return this.nextChild(0,1,t)}},{key:"childBefore",value:function(t){return this.nextChild(this.node.children.length-1,-1,t)}},{key:"nextSignificantParent",value:function(){for(var t=this;t.type.isAnonymous&&t._parent;)t=t._parent;return t}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,t,e,n)}},{key:"toString",value:function(){return this.node.toString()}},{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"to",get:function(){return this.from+this.node.length}},{key:"firstChild",get:function(){return this.nextChild(0,1,-1e8)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,-1e8)}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent?this._parent.nextChild(this.index+1,1,-1):null}},{key:"prevSibling",get:function(){return this._parent?this._parent.nextChild(this.index-1,-1,-1):null}},{key:"cursor",get:function(){return new S(this)}}]),t}();function k(t,e,n,r){var i=t.cursor,o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var b=function t(e,n,r,i){o(this,t),this.parent=e,this.buffer=n,this.index=r,this.start=i},w=function(){function t(e,n,r){o(this,t),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}return s(t,[{key:"child",value:function(e,n){var r=this.context.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,-1e8==n?-1e8:n-this.context.start);return i<0?null:new t(this.context,this,i)}},{key:"childAfter",value:function(t){return this.child(1,t)}},{key:"childBefore",value:function(t){return this.child(-1,t)}},{key:"externalSibling",value:function(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,-1)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,t,e,n)}},{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"firstChild",get:function(){return this.child(1,-1e8)}},{key:"lastChild",get:function(){return this.child(-1,-1e8)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"nextSibling",get:function(){var e=this.context.buffer,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var e=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,-1e8))}},{key:"cursor",get:function(){return new S(this)}}]),t}(),S=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(this,t),this.full=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof y)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(var r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}return s(t,[{key:"yieldNode",value:function(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}},{key:"yieldBuf",value:function(t,e){this.index=t;var n=this.buffer,r=n.start,i=n.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}},{key:"yield",value:function(t){return!!t&&(t instanceof y?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enter",value:function(t,e){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree.node.children.length-1:0,t,e,this.full));var n=this.buffer.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,-1e8==e?-1e8:e-this.buffer.start);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}},{key:"firstChild",value:function(){return this.enter(1,-1e8)}},{key:"lastChild",value:function(){return this.enter(-1,-1e8)}},{key:"childAfter",value:function(t){return this.enter(1,t)}},{key:"childBefore",value:function(t){return this.enter(-1,t)}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(this.full?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=this.full?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}},{key:"sibling",value:function(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree._parent.nextChild(this._tree.index+t,t,-1e8,this.full));var e=this.buffer.buffer,n=this.stack.length-1;if(t<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(e.findChild(r,this.index,-1,-1e8))}else{var i=e.buffer[this.index+3];if(i<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,-1e8,this.full))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(t){var e,n,r=this.buffer;if(r){if(t>0){if(this.index1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(var o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;e=o,n=i+1;break t}r=this.stack[--i]}for(var a=n;ah;)if(n.id!=e){var l=n.size,c=n.pos-l;if(l<0||c=f?4:0,p=n.start;for(n.next();n.pos>c;){if(n.size<0)break t;n.id>=f&&(d+=4),n.next()}i=p,r+=l,o+=d}else u.size=r,u.start=i,u.skip=o,o+=4,r+=4,n.next();(e<0||r==t)&&(u.size=r,u.start=i,u.skip=o);return u.size>4?u:void 0}(v.pos-e,o))){for(var T=new Uint16Array(A.size-A.skip),D=v.pos-A.size,E=T.length;v.pos>D;)E=w(A.start,T,E,o);x=new m(T,h-A.start,r,o<0?d.none:y[o]),S=A.start-t}else{var P=v.pos-c;v.next();for(var R=[],L=[],B=a>=f?a:-1;v.pos>P;)v.id==B?v.next():b(u,P,R,L,B);R.reverse(),L.reverse(),x=B>-1&&R.length>C?O(M,M,R,L,0,R.length,0,s,h-u,k):g(new p(M,R,L,h-u),k)}n.push(x),i.push(S)}function w(t,e,n,r){var i=v.id,o=v.start,a=v.end,s=v.size;if(v.next(),i==r)return n;var u=n;if(s>4)for(var h=v.pos-(s-4);v.pos>h;)n=w(t,e,n,r);return i0;)b(t.start||0,0,S,x,-1);var M=null!==(e=t.length)&&void 0!==e?e:S.length?x[0]+S[0].length:0;return new p(y[o],S.reverse(),x.reverse(),M)}function O(t,e,n,r,i,o,a,s,u,h){var l=[],c=[];if(u<=s)for(var f=i;fv)break}if(m==y+1){var b=n[y];if(b instanceof p&&b.type==e&&b.length>v<<1){for(var w=0;w0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"applyChanges",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return e;for(var i=[],o=1,a=e.length?e[0]:null,s=0,u=0,h=0;;){var l=s=r)for(;a&&a.from=f.from||c<=f.to||h){var d=Math.max(f.from,u)-h,v=Math.min(f.to,c)-h;f=d>=v?null:new t(d,v,f.tree,f.offset+h,(s>0?1:0)|(l?2:0))}if(f&&i.push(f),a.to>c)break;a=o1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[new t(0,e.length,e,0,o?2:0)],s=r(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.to>e.length&&a.push(u)}}catch(h){s.e(h)}finally{s.f()}return a}}]),t}()},62038:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),e)for(var s=0;s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&m(e.state,s.head-1,1,i)||i.afterCursor&&(m(e.state,s.head,1,i)||s.head-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function m(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||c,s=i.brackets||f,u=(0,a.qz)(t),l=u.resolve(e,n);return(r=g(l.type,n,s))?y(t,e,n,l,r,s):k(t,e,n,u,l.type,o,s)}function y(t,e,n,r,i,o){var a=r.parent,s={from:r.from,to:r.to},u=0,l=null==a?void 0:a.cursor;if(l&&(n<0?l.childBefore(r.from):l.childAfter(r.to)))do{if(n<0?l.to<=r.from:l.from>=r.to){if(0==u&&i.indexOf(l.type.name)>-1)return{start:s,end:{from:l.from,to:l.to},matched:!0};if(g(l.type,n,o))u++;else if(g(l.type,-n,o)&&0==--u)return{start:s,end:{from:l.from,to:l.to},matched:!1}}}while(n<0?l.prevSibling():l.nextSibling());return{start:s,matched:!1}}function k(t,e,n,r,i,o,a){var s=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(s);if(u<0||u%2==0!=n>0)return null;for(var l={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),c=0,f=0;!h.next().done&&f<=o;){var d=h.value;n<0&&(f+=d.length);for(var v=e+f*n,p=n>0?0:d.length-1,g=n>0?d.length:-1;p!=g;p+=n){var m=a.indexOf(d[p]);if(!(m<0||r.resolve(v+p,1).type!=i))if(m%2==0==n>0)c++;else{if(1==c)return{start:l,end:{from:v+p,to:v+p+1},matched:m>>1==u>>1};c--}}n>0&&(f+=d.length)}return h.done?{start:l,matched:!1}:null}function b(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function P(t,e,n){for(var i=(0,a.qz)(t).resolve(e.head),o=n?s.md.closedBy:s.md.openedBy,u=e.head;;){var l=n?i.childAfter(u):i.childBefore(u);if(!l)break;E(t,l,o)?i=l:u=n?l.to:l.from}var h,c;return c=i.type.prop(o)&&(h=n?m(t,i.from,1):m(t,i.to,-1))&&h.matched?n?h.end.to:h.end.from:n?i.to:i.from,r.jT.cursor(c,n?-1:1)}function R(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e):C(n,e)}))}var B=function(t){return R(t,!1)},L=function(t){return R(t,!0)};function N(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e,t.dom.clientHeight):C(n,e)}))}var j=function(t){return N(t,!1)},I=function(t){return N(t,!0)};function V(t,e,n){var i=t.visualLineAt(e.head),o=t.moveToLineBoundary(e,n);if(o.head==e.head&&o.head!=(n?i.to:i.from)&&(o=t.moveToLineBoundary(e,n,!1)),!n&&o.head==i.from&&i.length){var a=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;a&&e.head!=i.from+a&&(o=r.jT.cursor(i.from+a))}return o}var W=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from,1)}))},z=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to,-1)}))};function H(t,e,n){var i=!1,o=S(t.selection,(function(e){var o=m(t,e.head,-1)||m(t,e.head,1)||e.head>0&&m(t,e.head-1,1)||e.headl.from&&rn&&(i.empty||i.to>s.from)&&(e(s,o,i),n=s.number),a=s.to+1}var u=t.changes(o);return{changes:o,range:r.jT.range(u.mapPos(i.anchor,1),u.mapPos(i.head,1))}}))}var pt=function(t){var e=t.state,n=t.dispatch,r=Object.create(null),i=new a.Gn(e,{overrideIndentation:function(t){var e=r[t];return null==e?-1:e}}),o=vt(e,(function(t,n,o){var s=(0,a.K0)(i,t.from);if(null!=s){var u=/^\s*/.exec(t.text)[0],l=(0,a.SS)(e,s);(u!=l||o.from=e&&(n=i.type.prop(s.md.closedBy))&&n.indexOf(o.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(e,n),l=new a.Gn(e,{simulateBreak:n,simulateDoubleBreak:!!u}),h=(0,a.K0)(l,n);null==h&&(h=/^\s*/.exec(e.doc.lineAt(n).text)[0].length);for(var c=e.doc.lineAt(n);oc.from&&n",run:nt},{key:"Ctrl-v",run:I},{key:"Alt-v",run:j}].map((function(t){return{mac:t.key,run:t.run,shift:t.shift}}))),kt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(t){return A(t,(function(e){return P(t.state,e,t.textDirection!=o.Nm.LTR)}))},shift:function(t){return _(t,(function(e){return P(t.state,e,t.textDirection!=o.Nm.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(t){return A(t,(function(e){return P(t.state,e,t.textDirection==o.Nm.LTR)}))},shift:function(t){return _(t,(function(e){return P(t.state,e,t.textDirection==o.Nm.LTR)}))}},{key:"Alt-ArrowUp",run:function(t){return ft(t.state,t.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(t){return dt(t.state,t.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(t){return ft(t.state,t.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(t){return dt(t.state,t.dispatch,!0)}},{key:"Escape",run:function(t){var e=t.state,n=t.dispatch,i=e.selection,o=null;return i.ranges.length>1?o=r.jT.create([i.main]):i.main.empty||(o=r.jT.create([r.jT.cursor(i.main.head)])),!!o&&(n(x(e,o)),!0)}},{key:"Alt-l",run:function(t){var e=t.state,n=t.dispatch,i=ct(e).map((function(t){var n=t.from,i=t.to;return r.jT.range(n,Math.min(i+1,e.doc.length))}));return n(e.update({selection:r.jT.create(i),annotations:r.YW.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(t){var e=t.state,n=t.dispatch,i=S(e.selection,(function(t){for(var n,i=(0,a.qz)(e).resolve(t.head,1);!(i.from=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent);)i=i.parent;return r.jT.range(i.to,i.from)}));return n(x(e,i)),!0}},{key:"Mod-[",run:mt},{key:"Mod-]",run:gt},{key:"Mod-Alt-\\",run:pt},{key:"Shift-Mod-k",run:function(t){var e=t.state,n=e.changes(ct(e).map((function(t){var n=t.from,r=t.to;return n>0?n--:r=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.i;)t.dom.removeChild(t.elements.pop().dom)}}]),t}(),M=function(){function t(e,n){var r=this;l(this,t),this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=function(t){r.dom.addEventListener(t,(function(r){var i=e.visualLineAtHeight(r.clientY,e.contentDOM.getBoundingClientRect().top);n.domEventHandlers[t](e,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=A(n.markers(e)),n.initialSpacer&&(this.spacer=new O(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return c(t,[{key:"update",value:function(t){var e=this.markers;if(this.markers=A(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],t);n!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[n])}return this.markers!=e}}]),t}(),O=function(){function t(e,n,r,i){l(this,t),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(e,n,r,i)}return c(t,[{key:"update",value:function(t,e,n,r){if(this.height!=e&&(this.dom.style.height=(this.height=e)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var i;i=this.dom.lastChild;)i.remove();var o,s="cm-gutterElement",u=a(r);try{for(u.s();!(o=u.n()).done;){var l=o.value,h=l.toDOM(t);h&&this.dom.appendChild(h);var c=l.elementClass;c&&(s+=" "+c)}}catch(f){u.e(f)}finally{u.f()}this.dom.className=s}}}]),t}();var T=o.r$.define(),D=o.r$.define({combine:function(t){return(0,o.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(t,e){var n=Object.assign({},t),r=function(t){var r=n[t],i=e[t];n[t]=r?function(t,e,n){return r(t,e,n)||i(t,e,n)}:i};for(var i in e)r(i);return n}})}}),E=function(t){f(n,t);var e=v(n);function n(t){var r;return l(this,n),(r=e.call(this)).number=t,r}return c(n,[{key:"eq",value:function(t){return this.number==t.number}},{key:"toDOM",value:function(){return document.createTextNode(this.number)}}]),n}(m);function P(t,e){return t.state.facet(D).formatNumber(e,t.state)}var R,B=(R={class:"cm-lineNumbers",markers:function(t){return t.state.facet(T)},lineMarker:function(t,e,n){return n.length?null:new E(P(t,t.state.doc.lineAt(e.from).number))},initialSpacer:function(t){return new E(P(t,N(t.state.doc.lines)))},updateSpacer:function(t,e){var n=P(e.view,N(e.view.state.doc.lines));return n==t.number?t:new E(n)}},[S(),k.of(Object.assign(Object.assign({},y),R))]);function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[D.of(t),B]}function N(t){for(var e=9;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?e:m.get(e.base||e,e.modified.concat(t).sort((function(t,e){return t.id-e.id})))}}}]),t}(),g=0,m=function(){function t(){c(this,t),this.instances=[],this.id=g++}return d(t,null,[{key:"get",value:function(e,n){if(!n.length)return e;var r=n[0].instances.find((function(t){return t.base==e&&(r=n,i=t.modified,r.length==i.length&&r.every((function(t,e){return t==i[e]})));var r,i}));if(r)return r;var i,o=[],a=new p(o,e,n),s=l(n);try{for(s.s();!(i=s.n()).done;){i.value.instances.push(a)}}catch(m){s.e(m)}finally{s.f()}var u,h=y(n),c=l(e.set);try{for(c.s();!(u=c.n()).done;){var f,d=u.value,v=l(h);try{for(v.s();!(f=v.n()).done;){var g=f.value;o.push(t.get(d,g))}}catch(m){v.e(m)}finally{v.f()}}}catch(m){c.e(m)}finally{c.f()}return a}}]),t}();function y(t){for(var e=[t],n=0;n0&&c+3==a.length){u=1;break}var f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(h);if(!f)throw new RangeError("Invalid path: "+a);if(s.push("*"==f[0]?null:'"'==f[0][0]?JSON.parse(f[0]):f[0]),(c+=f[0].length)==a.length)break;var d=a[c++];if(c==a.length&&"!"==d){u=0;break}if("/"!=d)throw new RangeError("Invalid path: "+a);h=a.slice(c)}var v=s.length-1,p=s[v];if(!p)throw new RangeError("Invalid path: "+a);var g=new C(r,u,v>0?s.slice(0,v):null);e[p]=g.sort(e[p])}}}catch(m){o.e(m)}finally{o.f()}}return b.add(e)}var b=new r.md,w=a.r$.define({combine:function(t){return t.length?M.combinedMatch(t):null}}),S=a.r$.define({combine:function(t){return t.length?t[0].match:null}});function x(){return null}function A(t){return t.facet(w)||t.facet(S)||x}var C=function(){function t(e,n,r,i){c(this,t),this.tags=e,this.mode=n,this.context=r,this.next=i}return d(t,[{key:"sort",value:function(t){return!t||t.depth=n||v<=e)){D[h]=f.name,f.isTop&&(c=f);for(var p=u,g=f.prop(b),m=!1;g;){if(!g.context||P(g.context,D,h)){var y,k=l(g.tags);try{for(k.s();!(y=k.n()).done;){var w=y.value,S=r(w,c);S&&(p&&(p+=" "),p+=S,1==g.mode?u+=(u?" ":"")+S:0==g.mode&&(m=!0))}}catch(C){k.e(C)}finally{k.f()}break}g=g.next}if(p!=a&&(d>o&&a&&i(o,s.from,a),o=d,a=p),!m&&s.firstChild()){do{var x=s.to;if(t(u,h+1,c),a!=p){var A=Math.min(n,x);A>o&&a&&i(o,A,a),o=A,a=p}}while(s.nextSibling());s.parent()}}}("",0,t.type)}function P(t,e,n){if(t.length>n-1)return!1;for(var r=n-1,i=t.length-1;i>=0;i--,r--){var o=t[i];if(o&&o!=e[r])return!1}return!0}var R=p.define,B=R(),L=R(),N=R(L),j=R(),I=R(j),V=R(j),W=R(),z=R(W),H=R(),_=R(),q=R(),F=R(q),$=R(),U={comment:B,lineComment:R(B),blockComment:R(B),docComment:R(B),name:L,variableName:R(L),typeName:N,tagName:R(N),propertyName:R(L),className:R(L),labelName:R(L),namespace:R(L),macroName:R(L),literal:j,string:I,docString:R(I),character:R(I),number:V,integer:R(V),float:R(V),bool:R(j),regexp:R(j),escape:R(j),color:R(j),url:R(j),keyword:H,self:R(H),null:R(H),atom:R(H),unit:R(H),modifier:R(H),operatorKeyword:R(H),controlKeyword:R(H),definitionKeyword:R(H),operator:_,derefOperator:R(_),arithmeticOperator:R(_),logicOperator:R(_),bitwiseOperator:R(_),compareOperator:R(_),updateOperator:R(_),definitionOperator:R(_),typeOperator:R(_),controlOperator:R(_),punctuation:q,separator:R(q),bracket:F,angleBracket:R(F),squareBracket:R(F),paren:R(F),brace:R(F),content:W,heading:z,heading1:R(z),heading2:R(z),heading3:R(z),heading4:R(z),heading5:R(z),heading6:R(z),contentSeparator:R(W),list:R(W),quote:R(W),emphasis:R(W),strong:R(W),link:R(W),monospace:R(W),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:$,documentMeta:R($),annotation:R($),processingInstruction:R($),definition:p.defineModifier(),constant:p.defineModifier(),function:p.defineModifier(),standard:p.defineModifier(),local:p.defineModifier(),special:p.defineModifier()};M.define([{tag:U.link,textDecoration:"underline"},{tag:U.heading,textDecoration:"underline",fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strong,fontWeight:"bold"},{tag:U.keyword,color:"#708"},{tag:[U.atom,U.bool,U.url,U.contentSeparator,U.labelName],color:"#219"},{tag:[U.literal,U.inserted],color:"#164"},{tag:[U.string,U.deleted],color:"#a11"},{tag:[U.regexp,U.escape,U.special(U.string)],color:"#e40"},{tag:U.definition(U.variableName),color:"#00f"},{tag:U.local(U.variableName),color:"#30a"},{tag:[U.typeName,U.namespace],color:"#085"},{tag:U.className,color:"#167"},{tag:[U.special(U.variableName),U.macroName],color:"#256"},{tag:U.definition(U.propertyName),color:"#00c"},{tag:U.comment,color:"#940"},{tag:U.meta,color:"#7a757a"},{tag:U.invalid,color:"#f00"}]),M.define([{tag:U.link,class:"cmt-link"},{tag:U.heading,class:"cmt-heading"},{tag:U.emphasis,class:"cmt-emphasis"},{tag:U.strong,class:"cmt-strong"},{tag:U.keyword,class:"cmt-keyword"},{tag:U.atom,class:"cmt-atom"},{tag:U.bool,class:"cmt-bool"},{tag:U.url,class:"cmt-url"},{tag:U.labelName,class:"cmt-labelName"},{tag:U.inserted,class:"cmt-inserted"},{tag:U.deleted,class:"cmt-deleted"},{tag:U.literal,class:"cmt-literal"},{tag:U.string,class:"cmt-string"},{tag:U.number,class:"cmt-number"},{tag:[U.regexp,U.escape,U.special(U.string)],class:"cmt-string2"},{tag:U.variableName,class:"cmt-variableName"},{tag:U.local(U.variableName),class:"cmt-variableName cmt-local"},{tag:U.definition(U.variableName),class:"cmt-variableName cmt-definition"},{tag:U.special(U.variableName),class:"cmt-variableName2"},{tag:U.typeName,class:"cmt-typeName"},{tag:U.namespace,class:"cmt-namespace"},{tag:U.macroName,class:"cmt-macroName"},{tag:U.propertyName,class:"cmt-propertyName"},{tag:U.operator,class:"cmt-operator"},{tag:U.comment,class:"cmt-comment"},{tag:U.meta,class:"cmt-meta"},{tag:U.invalid,class:"cmt-invalid"},{tag:U.punctuation,class:"cmt-punctuation"}])},62118:function(t,e,n){"use strict";n.d(e,{m8:function(){return p},f$:function(){return P}});var r=n(77885),i=n(19753);function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return[v,d.of(t),i.tk.domEventHandlers({beforeinput:function(t,e){return"historyUndo"==t.inputType?m(e):"historyRedo"==t.inputType&&y(e)}})]}function g(t,e){return function(n){var r=n.state,i=n.dispatch,o=r.field(v,!1);if(!o)return!1;var a=o.pop(t,r,e);return!!a&&(i(a),!0)}}var m=g(0,!1),y=g(1,!1),k=g(0,!0),b=g(1,!0);function w(t){return function(e){var n=e.field(v,!1);if(!n)return 0;var r=0==t?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}w(0),w(1);var S=function(){function t(e,n,r,i,o){s(this,t),this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return l(t,[{key:"setSelAfter",value:function(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}}],[{key:"fromTransaction",value:function(e){var n,r=C,i=o(e.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var a=(0,n.value)(e);a.length&&(r=r.concat(a))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),r,void 0,e.startState.selection,C)}},{key:"selection",value:function(e){return new t(void 0,C,void 0,void 0,e)}}]),t}();function x(t,e,n,r){var i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function A(t,e){return t.length?e.length?t.concat(e):t:e}var C=[];function M(t,e){if(t.length){var n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),x(t,t.length-1,1e9,n.setSelAfter(r)))}return[S.selection([e])]}function O(t){var e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function T(t,e){if(!t.length)return t;for(var n=t.length,r=C;n;){var i=D(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=t.slice(0,n);return o[n-1]=i,o}e=i.mapped,n--,r=i.selectionsAfter}return r.length?[S.selection(r)]:C}function D(t,e,n){var i=A(t.selectionsAfter.length?t.selectionsAfter.map((function(t){return t.map(e)})):C,n);if(!t.changes)return S.selection(i);var o=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new S(o,r.Py.mapEffects(t.effects,e),s,t.startSelection.map(a),i)}var E=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;s(this,t),this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return l(t,[{key:"isolate",value:function(){return this.prevTime?new t(this.done,this.undone):this}},{key:"addChanges",value:function(e,n,r,i,o){var a=this.done,s=a[a.length-1];return new t(a=s&&s.changes&&n-this.prevTime=s&&i<=u&&(r=!0)}})),r}(s.changes,e.changes)?x(a,a.length-1,o,new S(e.changes.compose(s.changes),A(e.effects,s.effects),s.mapped,s.startSelection,C)):x(a,a.length,o,e),C,n,r)}},{key:"addSelection",value:function(e,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:C;return s.length>0&&n-this.prevTime=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:[];p(this,t),this.data=e,this.topNode=r,o.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(o.yy.prototype,"tree",{get:function(){return S(this)}}),this.parser=n,this.extension=[E.of(this),o.yy.languageData.of((function(t,e){return t.facet(w(t,e))}))].concat(i)}return m(t,[{key:"isActiveAt",value:function(t,e){return w(t,e)==this.data}},{key:"findRegions",value:function(t){var e=this,n=t.facet(E);if((null==n?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return S(t).iterate({enter:function(t,n,i){if(t.isTop&&t.prop(y)==e.data)return r.push({from:n,to:i}),!1}}),r}},{key:"parseString",value:function(t){for(var e,n=i.xv.of(t.split("\n")),a=this.parser.startParse(new x(n),0,new A(this.parser,o.yy.create({doc:n}),[],r.mp.empty,{from:0,to:t.length},[]));!(e=a.advance()););return e}},{key:"allowsNesting",get:function(){return!0}}]),t}();function w(t,e){var n=t.facet(E);if(!n)return null;if(!n.allowsNesting)return n.data;for(var r=S(t).resolve(e,-1);r;){var i=r.type.prop(y);if(i)return i;r=r.parent}return n.data}b.setState=o.Py.define();function S(t){var e=t.field(b.state,!1);return e?e.tree:r.mp.empty}var x=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;p(this,t),this.doc=e,this.length=n,this.cursorPos=0,this.string="",this.prevString="",this.cursor=e.iter()}return m(t,[{key:"syncTo",value:function(t){return t=this.length)return-1;var e=this.cursorPos-this.string.length;if(t=this.cursorPos){if(t=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}},{key:"lineAfter",value:function(t){if(t>=this.length||t<0)return"";var e=this.cursorPos-this.string.length;return(t=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e)}},{key:"read",value:function(t,e){var n=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}},{key:"clip",value:function(e){return new t(this.doc,e)}}]),t}(),A=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;p(this,t),this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.viewport=o,this.skipped=a,this.parse=null,this.tempSkipped=[]}return m(t,[{key:"work",value:function(t,e){if(this.tree!=r.mp.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new x(this.state.doc),0,this));for(var n=Date.now()+t;;){var i=this.parse.advance();if(i)return this.fragments=this.withoutTempSkipped(r.i9.addTree(i)),this.parse=null,this.tree=i,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>n)return!1}}},{key:"takeTree",value:function(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)))}},{key:"withoutTempSkipped",value:function(t){for(var e;e=this.tempSkipped.pop();)t=C(t,e.from,e.to);return t}},{key:"changes",value:function(e,n){var i=this.fragments,o=this.tree,a=this.viewport,u=this.skipped;if(this.takeTree(),!e.empty){var l=[];if(e.iterChangedRanges((function(t,e,n,r){return l.push({fromA:t,toA:e,fromB:n,toB:r})})),i=r.i9.applyChanges(i,l),o=r.mp.empty,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];var h,c=s(this.skipped);try{for(c.s();!(h=c.n()).done;){var f=h.value,d=e.mapPos(f.from,1),v=e.mapPos(f.to,-1);dt.from&&(this.fragments=C(this.fragments,i,o),this.skipped.splice(n--,1))}return this.skipped.length=t}}]),t}();function C(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}A.skippingParser={startParse:function(t,e,n){return{pos:e,advance:function(){return n.tempSkipped.push({from:e,to:t.length}),this.pos=t.length,new r.mp(r.Jq.none,[],[],t.length-e)},forceFinish:function(){return this.advance()}}}};var M=function(){function t(e){p(this,t),this.context=e,this.tree=e.tree}return m(t,[{key:"apply",value:function(e){if(!e.docChanged)return this;var n=this.context.changes(e.changes,e.state),r=this.context.tree.length==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.tree.length),n.viewport.to);return n.work(25,r)||n.takeTree(),new t(n)}}],[{key:"init",value:function(e){var n=new A(e.facet(E).parser,e,[],r.mp.empty,{from:0,to:e.doc.length},[]);return n.work(25)||n.takeTree(),new t(n)}}]),t}();b.state=o.QQ.define({create:M.init,update:function(t,e){var n,r=s(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(b.setState))return i.value}}catch(o){r.e(o)}finally{r.f()}return e.startState.facet(E)!=e.state.facet(E)?M.init(e.state):t.apply(e)}});var O="undefined"!=typeof window&&window.requestIdleCallback||function(t,e){var n=e.timeout;return setTimeout(t,n)},T="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,D=a.lg.fromClass(function(){function t(e){p(this,t),this.view=e,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return m(t,[{key:"update",value:function(t){if(t.viewportChanged){var e=this.view.state.field(b.state).context;e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()}t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork())}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var t=this.view.state;t.field(b.state).tree.length>=t.doc.length||(this.working=O(this.work,{timeout:500}))}}},{key:"work",value:function(t){this.working=-1;var e=Date.now();if(this.chunkEnd=i+1e6)){var a=Math.min(this.chunkBudget,t?Math.max(25,t.timeRemaining()):100),s=o.context.work(a,i+1e6);this.chunkBudget-=Date.now()-e,(s||this.chunkBudget<=0||o.context.movedPast(i))&&(o.context.takeTree(),this.view.dispatch({effects:b.setState.of(new M(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork()}}}},{key:"destroy",value:function(){this.working>=0&&T(this.working)}}]),t}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),E=o.r$.define({combine:function(t){return t.length?t[0]:null},enables:[b.state,D]}),P=o.r$.define(),R=o.r$.define({combine:function(t){if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function B(t){var e=t.facet(R);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function L(t,e){var n="",r=t.tabSize;if(9==t.facet(R).charCodeAt(0))for(;e>=r;)n+="\t",e-=r;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};p(this,t),this.state=e,this.options=n,this.unit=B(e)}return m(t,[{key:"textAfterPos",value:function(t){var e,n,r=null===(e=this.options)||void 0===e?void 0:e.simulateBreak;return t==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(t,Math.min(t+100,null!=r&&r>t?r:1e9,this.state.doc.lineAt(t).to))}},{key:"column",value:function(t){var e,n=this.state.doc.lineAt(t),r=n.text.slice(0,t-n.from),i=this.countColumn(r,t-n.from),o=(null===(e=this.options)||void 0===e?void 0:e.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S/))),i}},{key:"countColumn",value:function(t,e){return(0,i.IS)(e<0?t:t.slice(0,e),0,this.state.tabSize)}},{key:"lineIndent",value:function(t){var e,n=null===(e=this.options)||void 0===e?void 0:e.overrideIndentation;if(n){var r=n(t.from);if(r>-1)return r}return this.countColumn(t.text,t.text.search(/\S/))}}]),t}(),I=new r.md;function V(t){var e=t.type.prop(I);if(e)return e;var n,i=t.firstChild;if(i&&(n=i.type.prop(r.md.closedBy))){var o=t.lastChild,a=o&&n.indexOf(o.name)>-1;return function(t){return q(t,!0,1,void 0,a&&!function(t){var e,n;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&(null===(n=t.options)||void 0===n?void 0:n.simulateDoubleBreak)}(t)?o.from:void 0)}}return null==t.parent?z:null}function W(t,e,n){for(;t;t=t.parent){var r=V(t);if(r)return r(new H(n,e,t))}return null}function z(){return 0}var H=function(t){h(n,t);var e=f(n);function n(t,r,i){var o;return p(this,n),(o=e.call(this,t.state,t.options)).base=t,o.pos=r,o.node=i,o}return m(n,[{key:"continue",value:function(){var t=this.node.parent;return t?W(t,this.pos,this.base):0}},{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var t=this.state.doc.lineAt(this.node.from);;){for(var e=this.node.resolve(t.from);e.parent&&e.parent.from==e.from;)e=e.parent;if(_(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t)}}]),n}(j);function _(t,e){for(var n=e;n;n=n.parent)if(t==n)return!0;return!1}function q(t,e,n,r,i){var o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,u=e?function(t){var e,n=t.node,r=n.childAfter(n.from),i=n.lastChild;if(!r)return null;for(var o=null===(e=t.options)||void 0===e?void 0:e.simulateBreak,a=t.state.doc.lineAt(r.from),s=null==o||o<=a.from?a.to:Math.min(a.to,o),u=r.to;;){var l=n.childAfter(u);if(!l||l==i)return null;if(!l.type.isSkipped)return l.from!?|~^]/,o=/^[:\[\(\{]/,a=["true","false"],s=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function u(t,e){var n=t.peek();if(e.incomment)return t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(e.intag){if(e.operator){if(e.operator=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.sign){if(e.sign=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.instring)return n==e.instring&&(e.instring=!1),t.next(),"string";if("'"==n||'"'==n)return e.instring=n,t.next(),"string";if(t.match(e.intag+"}")||t.eat("-")&&t.match(e.intag+"}"))return e.intag=!1,"tag";if(t.match(i))return e.operator=!0,"operator";if(t.match(o))e.sign=!0;else if(t.eat(" ")||t.sol()){if(t.match(r))return"keyword";if(t.match(a))return"atom";if(t.match(s))return"number";t.sol()&&t.next()}else t.next();return"variable"}if(t.eat("{")){if(t.eat("#"))return e.incomment=!0,t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(n=t.eat(/\{|%/))return e.intag=n,"{"==n&&(e.intag="}"),t.eat("-"),"tag"}t.next()}r=new RegExp("(("+r.join(")|(")+"))\\b"),a=new RegExp("(("+a.join(")|(")+"))\\b");var l={startState:function(){return{tokenize:u}},token:function(t,e){return e.tokenize(t,e)},languageData:{commentTokens:{block:{open:"{#",close:"#}"}}}}},8987:function(t,e,n){"use strict";n.d(e,{r:function(){return i}});var r=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i"),i={token:function(t,e){var n=t.peek(),i=e.escaped;if(e.escaped=!1,"#"==n&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---"))return"def";if(t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==n?e.inlinePairs++:"}"==n?e.inlinePairs--:"["==n?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&","==n)return t.next(),"meta";if(e.inlinePairs>0&&!i&&","==n)return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(0==e.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(r))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped="\\"==n,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}}},13764:function(t,e,n){"use strict";n.d(e,{Xs:function(){return d},f_:function(){return v},uU:function(){return l}});var r=n(77885);function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:t;return new h(t,e,this)}}]),t}();l.prototype.startSide=l.prototype.endSide=0,l.prototype.point=!1,l.prototype.mapMode=r.gc.TrackDel;var h=function t(e,n,r){a(this,t),this.from=e,this.to=n,this.value=r};function c(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var f=function(){function t(e,n,r,i){a(this,t),this.from=e,this.to=n,this.value=r,this.maxPoint=i}return u(t,[{key:"findIndex",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e9*e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t<=0)return r;for(var i=e<0?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-t||(e<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==o)return u>=0?o:a;u>=0?a=s:o=s+1}}},{key:"between",value:function(t,e,n,r){for(var i=this.findIndex(e,-1),o=this.findIndex(n,1,void 0,i);i(d=n.mapPos(c,l.endSide))||f==d&&l.startSide>0&&l.endSide<=0)continue;(d-f||l.endSide-l.startSide)<0||(a<0&&(a=f),l.point&&(s=Math.max(s,d-f)),r.push(l),i.push(f-a),o.push(d-a))}return{mapped:r.length?new t(i,o,r,s):null,pos:a}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),t}(),d=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.empty,i=arguments.length>3?arguments[3]:void 0;a(this,t),this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return u(t,[{key:"chunkEnd",value:function(t){return this.chunkPos[t]+this.chunk[t].length}},{key:"update",value:function(e){var n=e.add,r=void 0===n?[]:n,i=e.sort,o=void 0!==i&&i,a=e.filterFrom,s=void 0===a?0:a,u=e.filterTo,l=void 0===u?this.length:u,f=e.filter;if(0==r.length&&!f)return this;if(o&&r.slice().sort(c),this==t.empty)return r.length?t.of(r):this;for(var d=new g(this,null,-1).goto(0),p=0,m=[],y=new v;d.value||p=0){var k=r[p++];y.addInner(k.from,k.to,k.value)||m.push(k)}else 1==d.rangeIndex&&d.chunkIndexthis.chunkEnd(d.chunkIndex)||ld.to||l=o&&e<=o+a.length&&!1===a.between(o,e-o,n-o,r))return}this.nextLayer.between(e,n,r)}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(t)}},{key:"length",get:function(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}},{key:"size",get:function(){if(this==t.empty)return 0;var e,n=this.nextLayer.size,r=i(this.chunk);try{for(r.s();!(e=r.n()).done;){n+=e.value.value.length}}catch(o){r.e(o)}finally{r.f()}return n}}],[{key:"iter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(t).goto(e)}},{key:"compare",value:function(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.filter((function(e){return e.maxPoint>=500||e!=t.empty&&n.indexOf(e)<0&&e.maxPoint>=o})),s=n.filter((function(n){return n.maxPoint>=500||n!=t.empty&&e.indexOf(n)<0&&n.maxPoint>=o})),u=p(a,s),l=new k(a,u,o),h=new k(s,u,o);r.iterGaps((function(t,e,n){return b(l,t,h,e,n,i)})),r.empty&&0==r.length&&b(l,0,h,0,0,i)}},{key:"spans",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new k(t,null,i).goto(e),a=e,s=o.openStart;;){var u=Math.min(o.to,n);if(o.point?(r.point(a,u,o.point,o.activeForPoint(o.to),s),s=o.openEnd(u)+(o.to>u?1:0)):u>a&&(r.span(a,u,o.active,s),s=o.openEnd(u)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new v,o=i(t instanceof h?[t]:n?t.slice().sort(c):t);try{for(o.s();!(e=o.n()).done;){var a=e.value;r.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return r.finish()}}]),t}();d.empty=new d([],[],null,-1),d.empty.nextLayer=d.empty;var v=function(){function t(){a(this,t),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return u(t,[{key:"finishChunk",value:function(t){this.chunks.push(new f(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,r)}},{key:"addInner",value:function(t,e,n){var r=t-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}},{key:"addChunk",value:function(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}},{key:"finish",value:function(){return this.finishInner(d.empty)}},{key:"finishInner",value:function(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=new d(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}]),t}();function p(t,e){var n,r=new Map,o=i(t);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;a(this,t),this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}},{key:"gotoInner",value:function(t,e,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),t}(),m=function(){function t(e){a(this,t),this.heap=e}return u(t,[{key:"goto",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9,r=i(this.heap);try{for(r.s();!(e=r.n()).done;){var o=e.value;o.goto(t,n)}}catch(s){r.e(s)}finally{r.f()}for(var a=this.heap.length>>1;a>=0;a--)y(this.heap,a);return this.next(),this}},{key:"forward",value:function(t,e){var n,r=i(this.heap);try{for(r.s();!(n=r.n()).done;){n.value.forward(t,e)}}catch(a){r.e(a)}finally{r.f()}for(var o=this.heap.length>>1;o>=0;o--)y(this.heap,o);(this.to-t||this.value.endSide-e)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),y(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new g(a,n,r,o));return 1==i.length?i[0]:new t(i)}}]),t}();function y(t,e){for(var n=t[e];;){var r=1+(e<<1);if(r>=t.length)break;var i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}var k=function(){function t(e,n,r){a(this,t),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=m.from(e,n,r)}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}},{key:"forward",value:function(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}},{key:"removeActive",value:function(t){S(this.active,t),S(this.activeTo,t),S(this.activeRank,t),this.minActive=A(this.active,this.activeTo)}},{key:"addActive",value:function(t){for(var e=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;e-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),e&&S(e,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.fromt&&this.forward(this.to,this.endSide);break}this.addActive(e),this.cursor.next()}}if(e){for(var o=0;othis.pointRank);n++)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>this.point.endSide)&&e.push(this.active[n]);return e}},{key:"openEnd",value:function(t){for(var e=0;et;)e++;return e}}]),t}();function b(t,e,n,r,i,o){t.goto(e),n.goto(r);for(var a=r+i,s=r,u=r-e;;){var l=t.to+u-n.to||t.endSide-n.endSide,h=l<0?t.to+u:n.to,c=Math.min(h,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))||o.comparePoint(s,c,t.point,n.point):c>s&&!w(t.active,n.active)&&o.compareRange(s,c,t.active,n.active),h>a)break;s=h,l<=0&&t.next(),l>=0&&n.next()}}function w(t,e){if(t.length!=e.length)return!1;for(var n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function A(t,e){for(var n=-1,r=1e9,i=0;ia?-1:i==r.length?function(t,e){var n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):(0,o.IS)(r.text.slice(0,n-r.from),0,t.state.tabSize);return{line:r.number,col:s,off:i}}function u(t,e){var n=s(t,e),i=t.state.selection;return n?{update:function(t){if(t.docChanged){var e=t.changes.mapPos(t.startState.doc.line(n.line).from),r=t.state.doc.lineAt(e);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(t.changes)}},get:function(e,u,l){var h=s(t,e);if(!h)return i;var c=function(t,e,n){var i=Math.min(e.line,n.line),s=Math.max(e.line,n.line),u=[];if(e.off>a||n.off>a||e.col<0||n.col<0)for(var l=Math.min(e.off,n.off),h=Math.max(e.off,n.off),c=i;c<=s;c++){var f=t.doc.line(c);f.length<=h&&u.push(r.jT.range(f.from+l,f.to+h))}else for(var d=Math.min(e.col,n.col),v=Math.max(e.col,n.col),p=i;p<=s;p++){var g=t.doc.line(p),m=g.length>a?g.text.slice(0,2*v):g.text,y=(0,o.Gz)(m,0,d,t.tabSize),k=(0,o.Gz)(m,0,v,t.tabSize);y.leftOver||u.push(r.jT.range(g.from+y.offset,g.from+k.offset))}return u}(t.state,n,h);return c.length?l?r.jT.create(c.concat(i.ranges)):r.jT.create(c):i}}:null}function l(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button};return i.tk.mouseSelectionStyle.of((function(t,n){return e(n)?u(t,n):null}))}},72360:function(t,e,n){"use strict";n.d(e,{sW:function(){return W},Lp:function(){return lt}});var r=n(19753),i=n(77885);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?n.panels[r]:null}var v=r.lg.fromClass(function(){function t(e){o(this,t),this.specs=e.state.facet(f),this.panels=this.specs.map((function(t){return t(e)}));var n=e.state.facet(h);this.top=new p(e,!0,n.topContainer),this.bottom=new p(e,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(t){return t.top}))),this.bottom.sync(this.panels.filter((function(t){return!t.top})));var r,i=u(this.panels);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.dom.classList.add("cm-panel"),a.class&&a.dom.classList.add(a.class),a.mount&&a.mount()}}catch(s){i.e(s)}finally{i.f()}}return s(t,[{key:"update",value:function(t){var e=t.state.facet(h);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new p(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new p(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=t.state.facet(f);if(n!=this.specs){var r,i=[],o=[],a=[],s=[],l=u(n);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=this.specs.indexOf(c),v=void 0;d<0?(v=c(t.view),s.push(v)):(v=this.panels[d]).update&&v.update(t),i.push(v),(v.top?o:a).push(v)}}catch(S){l.e(S)}finally{l.f()}this.specs=n,this.panels=i,this.top.sync(o),this.bottom.sync(a);for(var g=0,m=s;g=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||M(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){if(t){if("string"==typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length,o=arguments.length>4?arguments[4]:void 0;T(this,t),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(t){return o(P(t))}:P,this.query=this.normalize(n)}return E(t,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var t=this.peek();if(t<0)return this.done=!0,this;var e=String.fromCharCode(t),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,e+=String.fromCharCode(r)}for(var i=this.normalize(e),o=0,a=n;;o++){var s=i.charCodeAt(o),u=this.match(s,a);if(u)return this.value=u,this;if(o==i.length-1)break;a==n&&o1)return r.p.none;var a,s=o.main,u=null;if(s.empty){if(!e.highlightWordAroundCursor)return r.p.none;if(u=n.charCategorizer(s.head),!(a=function(t,e,n){for(var r=t.lineAt(e),o=e-r.from,a=e-r.from;o>0;){var s=(0,S.cp)(r.text,o,!1);if(n(r.text.slice(s,o))!=i.D0.Word)break;o=s}for(;a200)return r.p.none;if(!(a=n.sliceDoc(s.from,s.to).trim()))return r.p.none}var h,c=[],f=A(t.visibleRanges);try{for(f.s();!(h=f.n()).done;)for(var d=h.value,v=new R(n.doc,a,d.from,d.to);!v.next().done;){var p=v.value,g=p.from,m=p.to;if((!u||(0==g||u(n.sliceDoc(g-1,g))!=i.D0.Word)&&(m==n.doc.length||u(n.sliceDoc(m,m+1))!=i.D0.Word))&&(u&&g<=s.from&&m>=s.to?c.push(H.range(g,m)):(g>=s.to||m<=s.from)&&c.push(z.range(g,m)),c.length>e.maxMatches))return r.p.none}}catch(y){f.e(y)}finally{f.f()}return r.p.set(c)}}]),t}(),{decorations:function(t){return t.decorations}}),q=r.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),F=function(){function t(e,n,r){T(this,t),this.search=e,this.replace=n,this.caseInsensitive=r}return E(t,[{key:"eq",value:function(t){return this.search==t.search&&this.replace==t.replace&&this.caseInsensitive==t.caseInsensitive}},{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;return new R(t,this.search,e,n,this.caseInsensitive?function(t){return t.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),t}(),$=i.Py.define(),U=i.Py.define(),G=i.QQ.define({create:function(){return new K(new F("","",!1),[])},update:function(t,e){var n,r=A(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is($)?t=new K(i.value,t.panel):i.is(U)&&(t=new K(t.query,i.value?[at]:[]))}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return f.computeN([t],(function(e){return e.field(t).panel}))}}),K=function t(e,n){T(this,t),this.query=e,this.panel=n},J=r.p.mark({class:"cm-searchMatch"}),Y=r.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),X=r.lg.fromClass(function(){function t(e){T(this,t),this.view=e,this.decorations=this.highlight(e.state.field(G))}return E(t,[{key:"update",value:function(t){var e=t.state.field(G);(e!=t.startState.field(G)||t.docChanged||t.selectionSet)&&(this.decorations=this.highlight(e))}},{key:"highlight",value:function(t){var e=t.query;if(!t.panel.length||!e.valid)return r.p.none;for(var n=this.view.state,i=this.view.viewport,o=e.cursor(n.doc,Math.max(0,i.from-e.search.length),Math.min(i.to+e.search.length,n.doc.length)),a=new y.f_,s=function(){var t=o.value,e=t.from,r=t.to,i=n.selection.ranges.some((function(t){return t.from==e&&t.to==r}));a.add(e,r,i?Y:J)};!o.next().done;)s();return a.finish()}}]),t}(),{decorations:function(t){return t.decorations}});function Q(t){return function(e){var n=e.state.field(G,!1);return n&&n.query.valid?t(e,n):st(e)}}function Z(t,e,n){var r=n.cursor(t,e).next();return r.done&&(r=n.cursor(t,0,e+n.search.length-1).next()).done?null:r.value}var tt=Q((function(t,e){var n=t.state.selection.main,r=n.from,i=n.to,o=Z(t.state.doc,t.state.selection.main.from+1,e.query);return!(!o||o.from==r&&o.to==i)&&(t.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0,effects:ft(t,o)}),!0)}));function et(t,e,n,r){for(var i=r;;){for(var o=Math.max(n,i-1e4-t.search.length),a=t.cursor(e,o,i),s=null;!a.next().done;)s=a.value;if(s)return s;if(o==n)return null;i-=1e4}}var nt=Q((function(t,e){var n=e.query,r=t.state,i=et(n,r.doc,0,r.selection.main.to-1)||et(n,r.doc,r.selection.main.from+1,r.doc.length);return!!i&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:ft(t,i)}),!0)})),rt=Q((function(t,e){for(var n=e.query.cursor(t.state.doc),r=[];!n.next().done;)r.push(i.jT.range(n.value.from,n.value.to));return!!r.length&&(t.dispatch({selection:i.jT.create(r)}),!0)})),it=Q((function(t,e){var n=e.query,r=t.state,i=Z(r.doc,r.selection.main.from,n);if(!i)return!1;var o,a=r.selection.main,s=a.from,u=a.to,l=[];if(i.from==s&&i.to==u&&(l.push({from:i.from,to:i.to,insert:n.replace}),i=Z(r.doc,i.to,n)),i){var h=0==l.length||l[0].from>=i.to?0:i.to-i.from-n.replace.length;o={anchor:i.from-h,head:i.to-h}}return t.dispatch({changes:l,selection:o,scrollIntoView:!!o,effects:i?ft(t,i):void 0}),!0})),ot=Q((function(t,e){for(var n=e.query,r=n.cursor(t.state.doc),i=[];!r.next().done;){var o=r.value,a=o.from,s=o.to;i.push({from:a,to:s,insert:n.replace})}return!!i.length&&(t.dispatch({changes:i}),!0)}));function at(t){var e=t.state.field(G).query;return{dom:ht({view:t,query:e,updateQuery:function(n){e.eq(n)||(e=n,t.dispatch({effects:$.of(e)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,class:"cm-search"}}var st=function(t){var e=t.state.field(G,!1);if(e&&e.panel.length){var n=d(t,at);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else t.dispatch({effects:[U.of(!0)].concat(x(e?[]:[i.Py.appendConfig.of(vt)]))});return!0},ut=function(t){var e=t.state.field(G,!1);if(!e||!e.panel.length)return!1;var n=d(t,at);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:U.of(!1)}),!0},lt=[{key:"Mod-f",run:st,scope:"editor search-panel"},{key:"F3",run:tt,shift:nt,scope:"editor search-panel"},{key:"Mod-g",run:tt,shift:nt,scope:"editor search-panel"},{key:"Escape",run:ut,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(t){var e=t.state,n=t.dispatch,r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var o=r.main,a=o.from,s=o.to,u=[],l=0,h=new R(e.doc,e.sliceDoc(a,s));!h.next().done;){if(u.length>1e3)return!1;h.value.from==a&&(l=u.length),u.push(i.jT.range(h.value.from,h.value.to))}return n(e.update({selection:i.jT.create(u,l)})),!0}},{key:"Alt-g",run:function(t){var e=d(t,B);if(!e){var n=[L.of(!0)];null==t.state.field(N,!1)&&n.push(i.Py.appendConfig.of([c(),N,j])),t.dispatch({effects:n}),e=d(t,B)}return e&&e.dom.querySelector("input").focus(),!0}}];function ht(t){function e(e){return t.view.state.phrase(e)}var n=b("input",{value:t.query.search,placeholder:e("Find"),"aria-label":e("Find"),class:"cm-textfield",name:"search",onchange:a,onkeyup:a}),i=b("input",{value:t.query.replace,placeholder:e("Replace"),"aria-label":e("Replace"),class:"cm-textfield",name:"replace",onchange:a,onkeyup:a}),o=b("input",{type:"checkbox",name:"case",checked:!t.query.caseInsensitive,onchange:a});function a(){t.updateQuery(new F(n.value,i.value,!o.checked))}function s(t,e,n){return b("button",{class:"cm-button",name:t,onclick:e},n)}return b("div",{onkeydown:function(e){(0,r.$1)(t.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==n?(e.preventDefault(),(e.shiftKey?nt:tt)(t.view)):13==e.keyCode&&e.target==i&&(e.preventDefault(),it(t.view))}},[n,s("next",(function(){return tt(t.view)}),[e("next")]),s("prev",(function(){return nt(t.view)}),[e("previous")]),s("select",(function(){return rt(t.view)}),[e("all")]),b("label",null,[o,"match case"]),b("br"),i,s("replace",(function(){return it(t.view)}),[e("replace")]),s("replaceAll",(function(){return ot(t.view)}),[e("replace all")]),b("button",{name:"close",onclick:function(){return ut(t.view)},"aria-label":e("close")},["×"])])}var ct=/[\s\.,:;?!]/;function ft(t,e){var n=e.from,i=e.to;if(!t.hasFocus){var o=t.state.doc.lineAt(n).from,a=t.state.doc.lineAt(i).to,s=Math.max(o,n-30),u=Math.min(a,i+30),l=t.state.sliceDoc(s,u);if(s!=o)for(var h=0;h<30;h++)if(!ct.test(l[h+1])&&ct.test(l[h])){l=l.slice(h);break}if(u!=a)for(var c=l.length-1;c>l.length-30;c--)if(!ct.test(l[c-1])&&ct.test(l[c])){l=l.slice(0,c);break}return r.tk.announce.of("".concat(t.state.phrase("current match"),". ").concat(l," ").concat(t.state.phrase("on line")," ").concat(t.state.doc.lineAt(n).number))}}var dt=r.tk.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vt=[G,i.Wl.override(X),c(),dt]},77885:function(t,e,n){"use strict";n.d(e,{q6:function(){return X},as:function(){return m},D0:function(){return at},F6:function(){return z},jT:function(){return C},yy:function(){return ft},r$:function(){return D},gc:function(){return v},Wl:function(){return V},Py:function(){return tt},QQ:function(){return B},YW:function(){return et},BO:function(){return dt}});var r=n(23414);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"composeDesc",value:function(t){return this.empty?t:t.empty?this:S(this,t)}},{key:"mapDesc",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e)}},{key:"mapPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.Simple,r=0,i=0,o=0;ot)return i+(t-r);i+=a}else{if(n!=v.Simple&&u>=t&&(n==v.TrackDel&&rt||n==v.TrackBefore&&rt))return null;if(u>t||u==t&&e<0&&!a)return t==r||e<0?i:i+s;i+=s}r=u}if(t>r)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=0,r=0;n=0&&r<=e&&a>=t)return!(re)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var t="",e=0;e=0?":"+r:"")}return t}},{key:"length",get:function(){for(var t=0,e=0;e1&&void 0!==arguments[1]&&arguments[1];return w(this,t,e,!0)}},{key:"invert",value:function(t){for(var e=this.sections.slice(),i=[],o=0,a=0;o=0){e[o]=u,e[o+1]=s;for(var l=o>>1;i.length1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e,!0)}},{key:"iterChanges",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"filter",value:function(t){var e=[],r=[],i=[],o=new x(this);t:for(var a=0,s=0;;){for(var u=a==t.length?1e9:t[a++];s0&&k(r,e,o.text),o.forward(l),s+=l}for(var c=t[a++];s>1].toJSON()))}return t}},{key:"desc",get:function(){return new g(this.sections)}}],[{key:"of",value:function(t,e,i){var a=[],s=[],u=0,l=null;function h(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||a.length){um||v<0||m>e)throw new RangeError("Invalid change range ".concat(v," to ").concat(m," (in doc of length ").concat(e,")"));var w=b?"string"==typeof b?r.xv.of(b.split(i||p)):b:r.xv.empty,S=w.length;if(v==m&&0==S)return;vu&&y(a,v-u,-1),y(a,m-v,S),k(s,a,w),u=m}}(t),h(!l),l}},{key:"empty",value:function(t){return new n(t?[t,-1]:[],[])}},{key:"fromJSON",value:function(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");for(var e=[],i=[],o=0;o3&&void 0!==arguments[3]&&arguments[3];if(!(0==e&&n<=0)){var i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:0==e&&0==t[i]?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}}function k(t,e,n){if(0!=n.length){var i=e.length-2>>1;if(i>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)u=t.sections[s++],l=t.sections[s++];e(o,h,a,c,f),o=h,a=c}}}function w(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new x(t),s=new x(e),u=0,l=0;;)if(-1==a.ins)u+=a.len,a.next();else if(-1==s.ins&&l=0&&(a.done||ll&&!a.done&&u+a.len=0)){if(a.done&&s.done)return o?new m(i,o):new g(i);throw new Error("Mismatched change set lengths")}for(var c=0,f=u+a.len;;)if(s.ins>=0&&l>u&&l+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new x(t),a=new x(e),s=!1;;){if(o.done&&a.done)return i?new m(r,i):new g(r);if(0==o.ins)y(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var u=Math.min(o.len2,a.len),l=r.length;if(-1==o.ins){var h=-1==a.ins?-1:a.off?0:a.ins;y(r,u,h,s),i&&h&&k(i,r,a.text)}else-1==a.ins?(y(r,o.off?0:o.len,u,s),i&&k(i,r,o.textBit(u))):(y(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&k(i,r,a.text));s=(o.ins>u||a.ins>=0&&a.len>u)&&(s||r.length>l),o.forward2(u),a.forward(u)}else y(r,0,a.ins,s),i&&k(i,r,a.text),a.next()}}var x=function(){function t(e){c(this,t),this.set=e,this.i=0,this.next()}return d(t,[{key:"next",value:function(){var t=this.set.sections;this.i>1;return n>=e.length&&!t?r.xv.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}},{key:"forward",value:function(t){t==this.len?this.next():(this.len-=t,this.off+=t)}},{key:"forward2",value:function(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?r.xv.empty:t[e]}}]),t}(),A=function(){function t(e,n,r){c(this,t),this.from=e,this.to=n,this.flags=r}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=e.mapPos(this.from,n),i=e.mapPos(this.to,n);return r==this.from&&i==this.to?this:new t(r,i,this.flags)}},{key:"extend",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return C.range(t,e);var n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return C.range(this.anchor,n)}},{key:"eq",value:function(t){return this.anchor==t.anchor&&this.head==t.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var t=3&this.flags;return 3==t?null:t}},{key:"goalColumn",get:function(){var t=this.flags>>5;return 33554431==t?void 0:t}}],[{key:"fromJSON",value:function(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return C.range(t.anchor,t.head)}}]),t}(),C=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;c(this,t),this.ranges=e,this.mainIndex=n}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return e.empty?this:t.create(this.ranges.map((function(t){return t.map(e,n)})),this.mainIndex)}},{key:"eq",value:function(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var e=0;e1&&void 0!==arguments[1])||arguments[1];return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=e,t.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(t){return t.toJSON()})),main:this.mainIndex}}},{key:"main",get:function(){return this.ranges[this.mainIndex]}}],[{key:"fromJSON",value:function(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map((function(t){return A.fromJSON(t)})),e.main)}},{key:"single",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new t([t.range(e,n)],0)}},{key:"create",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==e.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new A(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=r?r:33554431)<<5)}},{key:"range",value:function(t,e,n){var r=(null!=n?n:33554431)<<5;return e1&&void 0!==arguments[1]?arguments[1]:0,n=t[e];t.sort((function(t,e){return t.from-e.from})),e=t.indexOf(n);for(var r=1;ri.head?C.range(s,a):C.range(a,s))}}return new C(t,e)}function O(t,e){var n,r=o(t.ranges);try{for(r.s();!(n=r.n()).done;){if(n.value.to>e)throw new RangeError("Selection points outside of document")}}catch(i){r.e(i)}finally{r.f()}}var T=0,D=function(){function t(e,n,r,i,o){c(this,t),this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=T++,this.default=e([])}return d(t,[{key:"of",value:function(t){return new P([],this,0,t)}},{key:"compute",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,1,e)}},{key:"computeN",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,2,e)}},{key:"from",value:function(t,e){return e||(e=function(t){return t}),this.compute([t],(function(n){return e(n.field(t))}))}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new t(e.combine||function(t){return t},e.compareInput||function(t,e){return t===e},e.compare||(e.combine?function(t,e){return t===e}:E),!!e.static,e.enables)}}]),t}();function E(t,e){return t==e||t.length==e.length&&t.every((function(t,n){return t===e[n]}))}var P=function(){function t(e,n,r,i){c(this,t),this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=T++}return d(t,[{key:"dynamicSlot",value:function(t){var e,n,r=this.value,i=this.facet.compareInput,a=t[this.id]>>1,s=2==this.type,u=!1,l=!1,h=[],c=o(this.dependencies);try{for(c.s();!(n=c.n()).done;){var f=n.value;"doc"==f?u=!0:"selection"==f?l=!0:0==(1&(null!==(e=t[f.id])&&void 0!==e?e:1))&&h.push(t[f.id])}}catch(d){c.e(d)}finally{c.f()}return function(t,e){if(!e||e.reconfigured)return t.values[a]=r(t),1;if(!(u&&e.docChanged||l&&(e.docChanged||e.selection)||h.some((function(e){return(1&q(t,e))>0}))))return 0;var n=r(t),o=e.startState.values[a];return(s?function(t,e,n){if(t.length!=e.length)return!1;for(var r=0;r>1;return function(t,r){if(!r)return t.values[n]=e.create(t),1;var i,o=0;if(r.reconfigured){var a=function(t,e){var n=t.config.address[e];return null==n?null:n>>1}(r.startState,e.id);i=null==a?e.create(r.startState):r.startState.values[a],o=1}else i=r.startState.values[n];var s=e.updateF(i,r);return o||e.compareF(i,s)||(o=1),o&&(t.values[n]=s),o}}},{key:"init",value:function(t){return[this,R.of({field:this,create:t})]}}],[{key:"define",value:function(e){var n=new t(T++,e.create,e.update,e.compare||function(t,e){return t===e},e);return e.provide&&(n.provides=e.provide(n)),n}}]),t}(),L=2,N=1,j=0;function I(t){return function(e){return new W(e,t)}}var V={fallback:I(3),default:I(L),extend:I(N),override:I(j)},W=function t(e,n){c(this,t),this.inner=e,this.prec=n},z=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new H(this,t)}},{key:"reconfigure",value:function(e){return t.reconfigure.of({compartment:this,extension:e})}}]),t}(),H=function t(e,n){c(this,t),this.compartment=e,this.inner=n},_=function(){function t(e,n,r,i,o){for(c(this,t),this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(e,n,r){var i,a=[],s=Object.create(null),u=new Set,l=o(function(t,e,n){var r=[[],[],[],[]],i=new Map;function a(t,s){var u=i.get(t);if(null!=u){if(u>=s)return;var l=r[u].indexOf(t);l>-1&&r[u].splice(l,1),t instanceof H&&n.delete(t.compartment)}if(i.set(t,s),Array.isArray(t)){var h,c=o(t);try{for(c.s();!(h=c.n()).done;){a(h.value,s)}}catch(d){c.e(d)}finally{c.f()}}else if(t instanceof H){if(n.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");n.add(t.compartment),a(e.get(t.compartment)||t.inner,s)}else if(t instanceof W)a(t.inner,t.prec);else if(t instanceof B)r[s].push(t),t.provides&&a(t.provides,s);else if(t instanceof P)r[s].push(t),t.facet.extensions&&a(t.facet.extensions,s);else{var f=t.extension;if(!f)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(f,s)}}return a(t,L),r.reduce((function(t,e){return t.concat(e)}))}(e,n,u));try{for(l.s();!(i=l.n()).done;){var h=i.value;h instanceof B?a.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h)}}catch(k){l.e(k)}finally{l.f()}for(var c=Object.create(null),f=[],d=[],v=function(){var t=g[p];c[t.id]=d.length<<1,d.push((function(e){return t.slot(e)}))},p=0,g=a;p>1;return function(t,n){var u,l=n?n.reconfigured?n.startState.config.address[e.id]:s<<1:null,h=null==l,c=o(a);try{for(c.s();!(u=c.n()).done;)1&q(t,u.value)&&(h=!0)}catch(k){c.e(k)}finally{c.f()}if(!h)return 0;for(var f=[],d=0;d>1,r=t.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;t.status[n]=4;var i=t.config.dynamicSlots[n](t,t.applying);return t.status[n]=2|i}function F(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}var $=D.define(),U=D.define({combine:function(t){return t.some((function(t){return t}))},static:!0}),G=D.define({combine:function(t){return t.length?t[0]:void 0},static:!0}),K=D.define(),J=D.define(),Y=D.define(),X=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,null,[{key:"define",value:function(){return new Q}}]),t}(),Q=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new X(this,t)}}]),t}(),Z=function(){function t(e){c(this,t),this.map=e}return d(t,[{key:"of",value:function(t){return new tt(this,t)}}]),t}(),tt=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,[{key:"map",value:function(e){var n=this.type.map(this.value,e);return void 0===n?void 0:n==this.value?this:new t(this.type,n)}},{key:"is",value:function(t){return this.type==t}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Z(t.map||function(t){return t})}},{key:"mapEffects",value:function(t,e){if(!t.length)return t;var n,r=[],i=o(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.map(e);a&&r.push(a)}}catch(s){i.e(s)}finally{i.f()}return r}}]),t}();tt.reconfigure=tt.define(),tt.appendConfig=tt.define();var et=function(){function t(e,n,r,i,o,a){c(this,t),this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&O(r,n.newLength),o.some((function(e){return e.type==t.time}))||(this.annotations=o.concat(t.time.of(Date.now())))}return d(t,[{key:"annotation",value:function(t){var e,n=o(this.annotations);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.type==t)return r.value}}catch(i){n.e(i)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}}]),t}();function nt(t,e){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=t[r]))o=t[r++],a=t[r++];else{if(!(i=0;i--){var o=n[i](t);o&&Object.keys(o).length&&(r=rt(t,it(e,o,t.changes.newLength),!0))}return r==t?t:new et(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(t){var e,n=t.startState,r=!0,i=o(n.facet(K));try{for(i.s();!(e=i.n()).done;){var a=(0,e.value)(t);if(!1===a){r=!1;break}Array.isArray(a)&&(r=!0===r?a:nt(r,a))}}catch(d){i.e(d)}finally{i.f()}if(!0!==r){var s,u;if(!1===r)u=t.changes.invertedDesc,s=m.empty(n.doc.length);else{var l=t.changes.filter(r);s=l.changes,u=l.filtered.invertedDesc}t=new et(n,s,t.selection&&t.selection.map(u),tt.mapEffects(t.effects,u),t.annotations,t.scrollIntoView)}for(var h=n.facet(J),c=h.length-1;c>=0;c--){var f=h[c](t);t=f instanceof et?f:Array.isArray(f)&&1==f.length&&f[0]instanceof et?f[0]:ot(n,ut(f),!1)}return t}(s):s)}et.time=X.define(),et.userEvent=X.define(),et.addToHistory=X.define();var at,st=[];function ut(t){return null==t?st:Array.isArray(t)?t:[t]}!function(t){t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other"}(at||(at={}));var lt,ht=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{lt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(vt){}function ct(t){return function(e){if(!/\S/.test(e))return at.Space;if(function(t){if(lt)return lt.test(t);for(var e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||ht.test(n)))return!0}return!1}(e))return at.Word;for(var n=0;n-1)return at.Word;return at.Other}}var ft=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(c(this,t),this.config=e,this.doc=n,this.selection=r,this.applying=null,this.status=e.statusTemplate.slice(),i&&i.startState.config==e)this.values=i.startState.values.slice();else if(this.values=e.dynamicSlots.map((function(t){return null})),i)for(var o in e.address){var a=e.address[o],s=i.startState.config.address[o];null!=s&&0==(1&a)&&(this.values[a>>1]=F(i.startState,s))}this.applying=i,i&&(i._state=this);for(var u=0;u1&&void 0!==arguments[1])||arguments[1],n=this.config.address[t.id];if(null!=n)return q(this,n),F(this,n);if(e)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return e instanceof m?e:m.of(e,this.doc.length,this.facet(t.lineSeparator))}},{key:"toText",value:function(e){return r.xv.of(e.split(this.facet(t.lineSeparator)||p))}},{key:"sliceDoc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak)}},{key:"facet",value:function(t){var e=this.config.address[t.id];return null==e?t.default:(q(this,e),F(this,e))}},{key:"toJSON",value:function(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var n in t)e[n]=t[n].spec.toJSON(this.field(t[n]),this);return e}},{key:"phrase",value:function(e){var n,r=o(this.facet(t.phrases));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(Object.prototype.hasOwnProperty.call(i,e))return i[e]}}catch(a){r.e(a)}finally{r.f()}return e}},{key:"languageDataAt",value:function(t,e){var n,r=[],i=o(this.facet($));try{for(i.s();!(n=i.n()).done;){var a,s=o((0,n.value)(this,e));try{for(s.s();!(a=s.n()).done;){var u=a.value;Object.prototype.hasOwnProperty.call(u,t)&&r.push(u[t])}}catch(l){s.e(l)}finally{s.f()}}}catch(l){i.e(l)}finally{i.f()}return r}},{key:"charCategorizer",value:function(t){return ct(this.languageDataAt("wordChars",t).join(""))}},{key:"tabSize",get:function(){return this.facet(t.tabSize)}},{key:"lineBreak",get:function(){return this.facet(t.lineSeparator)||"\n"}}],[{key:"fromJSON",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(t){var n=r[t],o=e[t];i.push(n.init((function(t){return n.spec.fromJSON(o,t)})))};for(var a in r)o(a)}return t.create({doc:e.doc,selection:C.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=_.resolve(e.extensions||[],new Map),i=e.doc instanceof r.xv?e.doc:r.xv.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||p)),o=e.selection?e.selection instanceof C?e.selection:C.single(e.selection.anchor,e.selection.head):C.single(0);return O(o,i.length),n.staticFacet(U)||(o=o.asSingle()),new t(n,i,o)}}]),t}();function dt(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},a=o(t);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,u=0,l=Object.keys(s);u=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length),(0,a.IS)(t.slice(r,e),i,n)}var S=function(){function t(e,n,r){y(this,t),this.string=e,this.tabSize=n,this.indentUnit=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}return b(t,[{key:"eol",value:function(){return this.pos>=this.string.length}},{key:"sol",value:function(){return 0==this.pos}},{key:"peek",value:function(){return this.string.charAt(this.pos)||void 0}},{key:"next",value:function(){if(this.pose}},{key:"eatSpace",value:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}},{key:"skipToEnd",value:function(){this.pos=this.string.length}},{key:"skipTo",value:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}},{key:"backUp",value:function(t){this.pos-=t}},{key:"column",value:function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}},{key:"current",value:function(){return this.string.slice(this.start,this.pos)}}]),t}();function x(t){if("object"!=m(t))return t;var e={};for(var n in t){var r=t[n];e[n]=r instanceof Array?r.slice():r}return e}var A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(n,t);var e=d(n);function n(t){var i;y(this,n);var a,s=(0,o.kU)(t.languageData),u={token:(a=t).token,blankLine:a.blankLine||function(){},startState:a.startState||function(){return!0},copyState:a.copyState||x,indent:a.indent||function(){return null},languageData:a.languageData||{}};return(i=e.call(this,s,{startParse:function(t,e,n){return new O(p(i),t,e,n)}},function(t){var e=r.Jq.define({id:E.length,name:"Document",props:[o.mi.add((function(){return t}))]});return E.push(e),e}(s),[o.tK.of((function(t,e){return i.getIndent(t,e)}))])).streamParser=u,i.stateAfter=new WeakMap,i}return b(n,[{key:"getIndent",value:function(t,e){for(var n=(0,o.qz)(t.state),r=n.resolve(e);r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;var i,a,s=C(this,n,0,r.from,e);if(s?(a=s.state,i=s.pos+1):(a=this.streamParser.startState(t.unit),i=0),e-i>1e4)return null;for(;i=i&&n+e.length<=o&&t.stateAfter.get(e);if(a)return{state:t.streamParser.copyState(a),pos:n+e.length};for(var s=e.children.length-1;s>=0;s--){var u=e.children[s],l=n+e.positions[s],h=u instanceof r.mp&&l=e.length)return e;o||e.type!=t.topNode||(o=!0);for(var a=e.children.length-1;a>=0;a--){var s=e.positions[a]+n,u=e.children[a],l=void 0;if(sn&&C(t,u.tree,0-u.offset,n,u.to),c=void 0;if(h&&(c=M(t,u.tree,n+u.offset,h.pos+u.offset,!1)))return{state:h.state,tree:c}}}catch(f){s.e(f)}finally{s.f()}return{state:t.streamParser.startState((0,o.y1)(i)),tree:r.mp.empty}}(e,a.fragments,i,a.state),u=s.state,h=s.tree;this.state=u,this.pos=this.chunkStart=i+h.length,h.length&&(this.chunks.push(h),this.chunkPos.push(i)),this.pose.start)return i}throw new Error("Stream parser failed to advance stream.")}var D=Object.create(null),E=[r.Jq.none],P=new r.Lj(E),R=[];function B(t){return t?D[t]||(D[t]=function(t){var e,n=null,o=l(t.split("."));try{for(o.s();!(e=o.n()).done;){var a=e.value,u=i.pJ[a];u?"function"==typeof u?n?n=u(n):W(a,"Modifier ".concat(a," used at start of tag")):n?W(a,"Tag ".concat(a," used as modifier")):n=u:W(a,"Unknown highlighting tag ".concat(a))}}catch(f){o.e(f)}finally{o.f()}if(!n)return 0;var h=t.replace(/ /g,"_"),c=r.Jq.define({id:E.length,name:h,props:[(0,i.Gv)(s({},h,n))]});return E.push(c),c.id}(t)):0}for(var L=0,N=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","typeName"],["attribute","propertyName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];L-1||(R.push(t),console.warn(e))}},23414:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt)return p[e-1]<=t;return!1}function y(t){return t>=127462&&t<=127487}function k(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?b:w)(t,e)}function b(t,e){if(e==t.length)return e;e&&S(t.charCodeAt(e))&&x(t.charCodeAt(e-1))&&e--;var n=A(t,e);for(e+=C(n);e=0&&y(A(t,o));)i++,o-=2;if(i%2==0)break;e+=2}}return e}function w(t,e){for(;e>0;){var n=b(t,e-2);if(n=56320&&t<57344}function x(t){return t>=55296&&t<56320}function A(t,e){var n=t.charCodeAt(e);if(!x(n)||e+1==t.length)return n;var r=t.charCodeAt(e+1);return S(r)?r-56320+(n-55296<<10)+65536:n}function C(t){return t<65536?1:2}function M(t,e,n){for(var r=0;r=n)return{offset:i,leftOver:0};e+=9==t.charCodeAt(i)?r-e%r:1,i=k(t,i)}return{offset:t.length,leftOver:n-e}}var T=function(){function t(){f(this,t)}return v(t,[{key:"lineAt",value:function(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0)}},{key:"line",value:function(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0)}},{key:"replace",value:function(t,e,n){var r=[];return this.decompose(0,t,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(e,this.length,r,1),E.from(r,this.length-(e-t)+n.length)}},{key:"append",value:function(t){return this.replace(this.length,this.length,t)}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(t,e,n,0),E.from(n,e-t)}},{key:"eq",value:function(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;for(var e=new L(this),n=new L(t);;){if(e.next(),n.next(),e.lineBreak!=n.lineBreak||e.done!=n.done||e.value!=n.value)return!1;if(e.done)return!0}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new L(this,t)}},{key:"iterRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new N(this,t,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var t=[];return this.flatten(t),t}}],[{key:"of",value:function(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new D(e):E.from(D.split(e,[])):t.empty}}]),t}();"undefined"!=typeof Symbol&&(T.prototype[Symbol.iterator]=function(){return this.iter()});var D=function(t){s(n,t);var e=l(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P(t);return f(this,n),(r=e.call(this)).text=t,r.length=i,r}return v(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((e?n:a)>=t)return new j(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(t,e,r,i){var o=t<=0&&e>=this.length?this:new n(B(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){var a=r.pop(),s=R(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var u=s.length>>1;r.push(new n(s.slice(0,u)),new n(s.slice(u)))}}else r.push(o)}},{key:"replace",value:function(t,e,r){if(!(r instanceof n))return a(c(n.prototype),"replace",this).call(this,t,e,r);var i=R(this.text,R(r.text,B(this.text,0,t)),e),o=this.length+r.length-(e-t);return i.length<=32?new n(i,o):E.from(n.split(i,[]),o)}},{key:"sliceString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=e&&ot&&o&&(r+=n),ti&&(r+=a.slice(Math.max(0,t-i),e-i)),i=s+1}return r}},{key:"flatten",value:function(t){var e,n=i(this.text);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}}],[{key:"split",value:function(t,e){var r,o=[],a=-1,s=i(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;o.push(u),a+=u.length+1,32==o.length&&(e.push(new n(o,a)),o=[],a=-1)}}catch(l){s.e(l)}finally{s.f()}return a>-1&&e.push(new n(o,a)),e}}]),n}(T),E=function(t){s(n,t);var e=l(n);function n(t,r){var o;f(this,n),(o=e.call(this)).children=t,o.length=r,o.lines=0;var a,s=i(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.lines+=u.lines}}catch(l){s.e(l)}finally{s.f()}return o}return v(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((e?s:a)>=t)return o.lineInner(t,e,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(t,e,n,r){for(var i=0,o=0;o<=e&&i=o){var u=r&((o<=t?1:0)|(s>=e?2:0));o>=t&&s<=e&&!u?n.push(a):a.decompose(t-o,e-o,n,u)}o=s+1}}},{key:"replace",value:function(t,e,r){if(r.lines=o&&e<=u){var l=s.replace(t-o,e-o,r),h=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>h>>6){var f=this.children.slice();return f[i]=l,new n(f,this.length-(e-t)+r.length)}return a(c(n.prototype),"replace",this).call(this,o,u,l)}o=u+1}return a(c(n.prototype),"replace",this).call(this,t,e,r)}},{key:"sliceString",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;it&&i&&(r+=n),to&&(r+=a.sliceString(t-o,e-o,n)),o=s+1}return r}},{key:"flatten",value:function(t){var e,n=i(this.children);try{for(n.s();!(e=n.n()).done;){e.value.flatten(t)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.reduce((function(t,e){return t+e.length+1}),-1),o=0,a=i(t);try{for(a.s();!(e=a.n()).done;){var s=e.value;o+=s.lines}}catch(A){a.e(A)}finally{a.f()}if(o<32){var u,l=[],h=i(t);try{for(h.s();!(u=h.n()).done;){var c=u.value;c.flatten(l)}}catch(A){h.e(A)}finally{h.f()}return new D(l,r)}var f=Math.max(32,o>>5),d=f<<1,v=f>>1,p=[],g=0,m=-1,y=[];function k(t){var e;if(t.lines>d&&t instanceof n){var r,o=i(t.children);try{for(o.s();!(r=o.n()).done;){k(r.value)}}catch(A){o.e(A)}finally{o.f()}}else t.lines>v&&(g>v||!g)?(b(),p.push(t)):t instanceof D&&g&&(e=y[y.length-1])instanceof D&&t.lines+e.lines<=32?(g+=t.lines,m+=t.length+1,y[y.length-1]=new D(e.text.concat(t.text),e.length+1+t.length)):(g+t.lines>f&&b(),g+=t.lines,m+=t.length+1,y.push(t))}function b(){0!=g&&(p.push(1==y.length?y[0]:n.from(y,m)),m=-1,g=y.length=0)}var w,S=i(t);try{for(S.s();!(w=S.n()).done;){var x=w.value;k(x)}}catch(A){S.e(A)}finally{S.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(T);function P(t){var e,n=-1,r=i(t);try{for(r.s();!(e=r.n()).done;){n+=e.value.length+1}}catch(o){r.e(o)}finally{r.f()}return n}function R(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(u>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;f(this,t),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?0:e instanceof D?e.text.length:e.children.length]}return v(t,[{key:"next",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var e=this.nodes.length-1;if(e<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[e],r=this.offsets[e],i=n instanceof D?n.text.length:n.children.length;if(r==(this.dir>0?i:0))this.nodes.pop(),this.offsets.pop();else if(this.lineBreak||r==(this.dir>0?0:i))if(n instanceof D){var o=n.text[r-(this.dir<0?1:0)];if(this.offsets[e]=r+=this.dir,this.lineBreak=!1,o.length>Math.max(0,t))return this.value=0==t?o:this.dir>0?o.slice(t):o.slice(0,o.length-t),this;t-=o.length}else{var a=n.children[this.dir>0?r:r-1];this.offsets[e]=r+this.dir,this.lineBreak=!1,t>a.length?t-=a.length:(this.nodes.push(a),this.offsets.push(this.dir>0?0:a instanceof D?a.text.length:a.children.length))}else{if(this.lineBreak=!0,0==t)return this.value="\n",this;t--}}}}]),t}(),N=function(){function t(e,n,r){f(this,t),this.value="",this.cursor=new L(e,n>r?-1:1),n>r?(this.skip=e.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return v(t,[{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip+t),n=e.value,r=e.lineBreak,i=e.done;this.skip=0,this.value=n;var o=r?1:n.length;o>this.limit&&(this.value=this.cursor.dir>0?n.slice(0,this.limit):n.slice(o-this.limit)),i||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),t}(),j=function(){function t(e,n,r,i){f(this,t),this.from=e,this.to=n,this.number=r,this.text=i}return v(t,[{key:"length",get:function(){return this.to-this.from}}]),t}()},19753:function(t,e,n){"use strict";n.d(e,{kH:function(){return Ct},p:function(){return Ot},Nm:function(){return fe},tk:function(){return _n},BF:function(){return Kt},lg:function(){return Xt},Uw:function(){return lr},ZO:function(){return br},$f:function(){return tr},$1:function(){return rr}});for(var r=n(77885),i=n(23414),o=n(62038),a=n(13764),s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},u={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},l="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),h="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),c="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),d="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),v=l&&(f||+l[1]<57)||c&&f,p=0;p<10;p++)s[48+p]=s[96+p]=String(p);for(p=1;p<=24;p++)s[p+111]="F"+p;for(p=65;p<=90;p++)s[p]=String.fromCharCode(p+32),u[p]=String.fromCharCode(p);for(var g in s)u.hasOwnProperty(g)||(u[g]=s[g]);function m(t,e,n){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=A(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=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(t){return!1}}();return function(){var n,r=A(t);if(e){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function S(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?x(t):e}function x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||E(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=E(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2),android:/Android\b/.test(B.userAgent),webkit:H,safari:_,webkit_version:H?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=L.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function F(t){return t.getSelection?t.getSelection():document.getSelection()}function $(t,e){if(!e.anchorNode)return!1;try{return t.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)}catch(n){return!1}}function U(t){if(3==t.nodeType){var e=it();return e.setEnd(t,t.nodeValue.length),e.setStart(t,0),e.getClientRects()}return 1==t.nodeType?t.getClientRects():[]}function G(t,e,n,r){return!!n&&(J(t,e,n,r,-1)||J(t,e,n,r,1))}function K(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function J(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Y(t))){if("DIV"==t.nodeName)return!1;var o=t.parentNode;if(!o||1!=o.nodeType)return!1;e=K(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(i<0?-1:0)],e=i<0?Y(t):0}}}function Y(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}var X={left:0,right:0,top:0,bottom:0};function Q(t,e){var n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Z(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}var tt,et=function(){function t(){O(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return D(t,[{key:"eq",value:function(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}},{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}]),t}(),nt=null;function rt(t){if(t.setActive)return t.setActive();if(nt)return t.focus(nt);for(var e=[],n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(null==nt?{get preventScroll(){return nt={preventScroll:!0},!0}}:void 0),!nt){nt=!1;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];O(this,t),this.node=e,this.offset=n,this.precise=r}return D(t,null,[{key:"before",value:function(e,n){return new t(e.parentNode,K(e),n)}},{key:"after",value:function(e,n){return new t(e.parentNode,K(e)+1,n)}}]),t}(),at=[],st=function(){function t(){O(this,t),this.parent=null,this.dom=null,this.dirty=2}return D(t,[{key:"posBefore",value:function(t){var e,n=this.posAtStart,r=M(this.children);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i==t)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(t){return this.posBefore(t)+t.length}},{key:"coordsAt",value:function(t,e){return null}},{key:"sync",value:function(e){if(2&this.dirty){var n,r=this.dom,i=null,o=M(this.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.dirty){var s=i?i.nextSibling:r.firstChild;!s||a.dom||t.get(s)||a.reuseDOM(s),a.sync(e),a.dirty=0}e&&e.node==r&&i!=a.dom&&(e.written=!0),lt(r,i,a.dom),i=a.dom}}catch(f){o.e(f)}finally{o.f()}var u=i?i.nextSibling:r.firstChild;for(u&&e&&e.node==r&&(e.written=!0);u;)u=ut(u)}else if(1&this.dirty){var l,h=M(this.children);try{for(h.s();!(l=h.n()).done;){var c=l.value;c.dirty&&(c.sync(e),c.dirty=0)}}catch(f){h.e(f)}finally{h.f()}}}},{key:"reuseDOM",value:function(t){return!1}},{key:"localPosFromDOM",value:function(e,n){var r;if(e==this.dom)r=this.dom.childNodes[n];else{for(var i=0==Y(e)?0:0==n?-1:1;;){var o=e.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=e==o.firstChild?-1:1),e=o}r=i<0?e:e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!t.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var u=this.children[a];if(u.dom==r)return s;s+=u.length+u.breakAfter}}},{key:"domBoundsAround",value:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,u=n;se)return l.domBoundsAround(t,e,u);if(h>=t&&-1==r&&(r=s,i=u),h>=e&&h!=u&&-1==o){o=s,a=h;break}u=h+l.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o+1].dom:null}}},{key:"markDirty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(t))}},{key:"markParentsDirty",value:function(t){for(var e=this.parent;e;e=e.parent){if(t&&(e.dirty|=2),1&e.dirty)return;e.dirty|=1,t=!1}}},{key:"setParent",value:function(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(t){this.dom=t,t.cmView=this}},{key:"replaceChildren",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at;this.markDirty();for(var i=t;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new ht(this.children,t,this.children.length)}},{key:"childPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(t,e)}},{key:"toString",value:function(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var t=this;;){var e=t.parent;if(!e)return t;t=e}}}],[{key:"get",value:function(t){return t.cmView}}]),t}();function ut(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function lt(t,e,n){var r=e?e.nextSibling:t.firstChild;if(n.parentNode==t)for(;r!=n;)r=ut(r);else t.insertBefore(n,r)}st.prototype.breakAfter=0;var ht=function(){function t(e,n,r){O(this,t),this.children=e,this.pos=n,this.i=r,this.off=0}return D(t,[{key:"findPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),t}(),ct=[],ft=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"become",value:function(t){return!1}},{key:"getSide",value:function(){return 0}}]),n}(st);ft.prototype.children=ct;var dt=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).text=t,r}return D(n,[{key:"createDOM",value:function(t){this.setDOM(t||document.createTextNode(this.text))}},{key:"sync",value:function(t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(t){return 3==t.nodeType&&(this.createDOM(t),!0)}},{key:"merge",value:function(t,e,r){return(!r||r instanceof n&&!(this.length-(e-t)+r.length>256))&&(this.text=this.text.slice(0,t)+(r?r.text:"")+this.text.slice(e),this.markDirty(),!0)}},{key:"slice",value:function(t){return new n(this.text.slice(t))}},{key:"localPosFromDOM",value:function(t,e){return t==this.dom?e:e?this.text.length:0}},{key:"domAtPos",value:function(t){return new ot(this.dom,t)}},{key:"domBoundsAround",value:function(t,e,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(t,e){return pt(this.dom,t,e)}},{key:"length",get:function(){return this.text.length}}]),n}(ft),vt=function(t){k(n,t);var e=w(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;O(this,n),(r=e.call(this)).mark=t,r.children=i,r.length=o;var a,s=M(i);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.setParent(x(r))}}catch(l){s.e(l)}finally{s.f()}return r}return D(n,[{key:"createDOM",value:function(){var t=document.createElement(this.mark.tagName);if(this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(var e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);this.setDOM(t)}},{key:"sync",value:function(t){this.dom||this.createDOM(),m(A(n.prototype),"sync",this).call(this,t)}},{key:"merge",value:function(t,e,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||t&&i<=0||ee&&r.push(ir&&(e=r);var i=e,o=e,a=0;0==e&&n<0||e==r&&n>=0?q.chrome||q.gecko||(e?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=it();s.setEnd(t,o),s.setStart(t,i);var u=s.getClientRects();if(!u.length)return X;var l=u[(a?a<0:n>=0)?0:u.length-1];return q.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(u,(function(t){return t.width}))||l),a?Q(l,a<0):l}var gt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.side=i,o}return D(n,[{key:"slice",value:function(t){return n.create(this.widget,this.length-t,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(t,e,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&i<=0||e0?n.length-1:0;r=n[i],!(t>0?0==i:i==n.length-1||r.top0?-1:1);return 0==t&&e>0||t==this.length&&e<=0?r:Q(r,0==t)}},{key:"overrideDOMText",get:function(){if(0==this.length)return i.xv.empty;for(var t=this;t.parent;)t=t.parent;var e=t.editorView,n=e&&e.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):i.xv.empty}}],[{key:"create",value:function(t,e,r){return new(t.customView||n)(t,e,r)}}]),n}(ft),mt=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"domAtPos",value:function(t){return new ot(this.widget.text,t)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(t,e){return e?3==t.nodeType?Math.min(e,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(t,e){return pt(this.widget.text,t,e)}},{key:"overrideDOMText",get:function(){return null}}]),n}(gt);function yt(t,e,n,r,i,o){var a,s=t.childCursor(),u=s.findPos(n,1),l=u.i,h=u.off,c=s.findPos(e,-1),f=c.i,d=c.off,v=e-n,p=M(r);try{for(p.s();!(a=p.n()).done;){v+=a.value.length}}catch(S){p.e(S)}finally{p.f()}t.length+=v;var g=t.children;if(f==l&&d){var m=g[f];if(1==r.length&&m.merge(d,h,r[0],i,o))return;if(0==r.length)return void m.merge(d,h,null,i,o);var y=m.slice(h);y.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=y:r.push(y),l++,o=h=0}if(h){var k=g[l];r.length&&k.merge(0,h,r[r.length-1],0,o)?(r.pop(),o=0):k.merge(0,h,null,0,0)}else li&&n0;r--){var s=e[r-1].dom;if(s.parentNode==t)return ot.after(s)}return new ot(t,0)}function bt(t,e,n){var r,i=t.children;n>0&&e instanceof vt&&i.length&&(r=i[i.length-1])instanceof vt&&r.mark.eq(e.mark)?bt(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function wt(t,e,n){for(var r=0,i=0;i=e:a>e)return o.coordsAt(e-r,n);r=a}}return(t.dom.lastChild||t.dom).getBoundingClientRect()}function St(t,e){for(var n in t)"class"==n&&e.class?e.class+=" "+t.class:"style"==n&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}function xt(t,e){if(t==e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(t){return new Tt(t)}},{key:"widget",value:function(t){var e=t.side||0;return t.block&&(e+=200000001*(e>0?1:-1)),new Et(t,e,e,!!t.block,t.widget||null,!1)}},{key:"replace",value:function(t){var e=!!t.block,n=Pt(t),r=n.start,i=n.end;return new Et(t,e?-2e8*(r?2:1):1e8*(r?-1:1),e?2e8*(i?2:1):1e8*(i?1:-1),e,t.widget||null,!0)}},{key:"line",value:function(t){return new Dt(t)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.Xs.of(t,e)}}]),n}(a.uU);Ot.none=a.Xs.empty;var Tt=function(t){k(n,t);var e=w(n);function n(t){var r;O(this,n);var i=Pt(t),o=i.start,a=i.end;return(r=e.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,t)).tagName=t.tagName||"span",r.class=t.class||"",r.attrs=t.attributes||null,r}return D(n,[{key:"eq",value:function(t){return this==t||t instanceof n&&this.tagName==t.tagName&&this.class==t.class&&xt(this.attrs,t.attrs)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Ot);Tt.prototype.point=!1;var Dt=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,-1e8,-1e8,null,t)}return D(n,[{key:"eq",value:function(t){return t instanceof n&&xt(this.spec.attributes,t.spec.attributes)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Ot);Dt.prototype.mapMode=r.gc.TrackBefore,Dt.prototype.point=!0;var Et=function(t){k(n,t);var e=w(n);function n(t,i,o,a,s,u){var l;return O(this,n),(l=e.call(this,i,o,s,t)).block=a,l.isReplace=u,l.mapMode=a?i<0?r.gc.TrackBefore:r.gc.TrackAfter:r.gc.TrackDel,l}return D(n,[{key:"eq",value:function(t){return t instanceof n&&(e=this.widget,r=t.widget,e==r||!!(e&&r&&e.compare(r)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,r}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return m(A(n.prototype),"range",this).call(this,t,e)}},{key:"type",get:function(){return this.startSide=5}}]),n}(Ot);function Pt(t){var e=t.inclusiveStart,n=t.inclusiveEnd;return null==e&&(e=t.inclusive),null==n&&(n=t.inclusive),{start:e||!1,end:n||!1}}function Rt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>t?n[i]=Math.max(n[i],e):n.push(t,e)}Et.prototype.point=!0;var Bt=function(t){k(n,t);var e=w(n);function n(){var t;return O(this,n),(t=e.apply(this,arguments)).children=[],t.length=0,t.prevAttrs=void 0,t.attrs=null,t.breakAfter=0,t}return D(n,[{key:"merge",value:function(t,e,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),yt(this,t,e,r?r.children:Lt,o,a),!0}},{key:"split",value:function(t){var e=new n;if(e.breakAfter=this.breakAfter,0==this.length)return e;var r=this.childPos(t),i=r.i,o=r.off;o&&(e.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=t,e}},{key:"transferDOM",value:function(t){this.dom&&(t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(t){xt(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}},{key:"append",value:function(t,e){bt(this,t,e)}},{key:"addLineDeco",value:function(t){var e=t.spec.attributes;e&&(this.attrs=St(e,this.attrs||{}))}},{key:"domAtPos",value:function(t){return kt(this.dom,this.children,t)}},{key:"sync",value:function(t){this.dom||(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(At(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),m(A(n.prototype),"sync",this).call(this,t);var e=this.dom.lastChild;if(!e||"BR"!=e.nodeName&&st.get(e)instanceof gt){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var t,e=0,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!(r instanceof dt))return null;var i=U(r.dom);if(1!=i.length)return null;e+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}}},{key:"coordsAt",value:function(t,e){return wt(this,t,e)}},{key:"match",value:function(t){return!1}},{key:"type",get:function(){return Ct.Text}}],[{key:"find",value:function(t,e){for(var r=0,i=0;;r++){var o=t.children[r],a=i+o.length;if(a>=e){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(st),Lt=[],Nt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.type=i,o.breakAfter=0,o}return D(n,[{key:"merge",value:function(t,e,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&o<=0||e=0;n--)t=new vt(e[n],[t],t.length);return t}},{key:"buildText",value:function(t,e,n){for(;t>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,t--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,t,512);this.getLine().append(this.wrapMarks(new dt(this.text.slice(this.textOff,this.textOff+s)),e),n),this.textOff+=s,t-=s,n=0}}},{key:"span",value:function(t,e,n,r){this.buildText(e-t,n,r),this.pos=e,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(t,e,n,r,i){var o=e-t;if(n instanceof Et)if(n.block){var a=n.type;a!=Ct.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new Nt(n.widget||new It("div"),o,a))}else{var s=this.wrapMarks(gt.create(n.widget||new It("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(e,n,r,i){var o=new t(e,n,r);return o.openEnd=a.Xs.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),t}(),It=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).tag=t,r}return D(n,[{key:"eq",value:function(t){return t.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(t){return t.nodeName.toLowerCase()==this.tag}}]),n}(Mt),Vt=[],Wt=r.r$.define(),zt=r.r$.define(),Ht=r.r$.define(),_t=r.r$.define(),qt=r.r$.define(),Ft=r.r$.define();function $t(t,e,n){var r=t.facet(_t);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}var Ut=r.r$.define({combine:function(t){return!t.length||t[0]}}),Gt=function t(e,n){O(this,t),this.field=e,this.get=n},Kt=function(){function t(){O(this,t)}return D(t,[{key:"from",value:function(t){return new Gt(this,t)}}],[{key:"define",value:function(){return new t}}]),t}();Kt.decorations=Kt.define(),Kt.scrollMargins=Kt.define();var Jt=0,Yt=r.r$.define(),Xt=function(){function t(e,n,r){O(this,t),this.id=e,this.create=n,this.fields=r,this.extension=Yt.of(this)}return D(t,null,[{key:"define",value:function(e,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var u,l=M(Array.isArray(o)?o:[o]);try{for(l.s();!(u=l.n()).done;){var h=u.value;s.push(h)}}catch(c){l.e(c)}finally{l.f()}}return i&&s.push(Qt.from((function(t){return{plugin:t,handlers:i}}))),a&&s.push(Kt.decorations.from(a)),new t(Jt++,e,s)}},{key:"fromClass",value:function(e,n){return t.define((function(t){return new e(t)}),n)}}]),t}(),Qt=Kt.define(),Zt=function(){function t(e){O(this,t),this.spec=e,this.mustUpdate=null,this.value=null}return D(t,[{key:"takeField",value:function(t,e){var n,r=M(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==t&&e.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}},{key:"update",value:function(e){if(this.value){if(this.mustUpdate){var n=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(n)}catch(r){if($t(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}return t.dummy}}}else try{this.value=this.spec.create(e)}catch(r){return $t(e.state,r,"CodeMirror plugin crashed"),t.dummy}return this}},{key:"destroy",value:function(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(n){$t(t.state,n,"CodeMirror plugin crashed")}}}]),t}();Zt.dummy=new Zt(Xt.define((function(){return{}})));var te=r.r$.define({combine:function(t){return t.reduce((function(t,e){return St(e,t)}),{})}}),ee=r.r$.define({combine:function(t){return t.reduce((function(t,e){return St(e,t)}),{})}}),ne=r.r$.define(),re=r.r$.define(),ie=function(){function t(e,n,r,i){O(this,t),this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}return D(t,[{key:"join",value:function(e){return new t(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}},{key:"addToSet",value:function(t){for(var e=t.length,n=this;e>0;e--){var r=t[e-1];if(!(r.fromA>n.toA)){if(r.toAh)break;o+=2}if(!u)return r;new t(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),t}(),oe=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Vt;O(this,t),this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=r.as.empty(this.startState.doc.length);var o,a=M(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.changes=this.changes.compose(s.changes)}}catch(h){a.e(h)}finally{a.f()}var u=[];this.changes.iterChangedRanges((function(t,e,n,r){return u.push(new ie(t,e,n,r))})),this.changedRanges=u;var l=e.hasFocus;l!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=l,this.flags|=1),this.docChanged&&(this.flags|=2)}return D(t,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(t){return t.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(t){return t.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),t}(),ae=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).view=t,r.compositionDeco=Ot.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(t.contentDOM),r.children=[new Bt],r.children[0].setParent(x(r)),r.updateInner([new ie(0,0,0,t.state.doc.length)],r.updateDeco(),0),r}return D(n,[{key:"update",value:function(t){var e=this,n=t.changedRanges;this.minWidth>0&&n.length&&(n.every((function(t){var n=t.fromA;return t.toAe.minWidthTo}))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Ot.none:t.transactions.length&&(this.compositionDeco=function(t,e){var n=F(t.root),r=n.focusNode&&he(n.focusNode,n.focusOffset,0);if(!r)return Ot.none;var i,o,a=t.docView.nearest(r),s=r;if(a instanceof ft){for(;a.parent instanceof ft;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Bt))return Ot.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var u=s.previousSibling;u&&!st.get(u);)u=u.previousSibling;i=o=u?st.get(u).posAtEnd:a.posAtStart}var l=e.mapPos(i,1),h=Math.max(l,e.mapPos(o,-1)),c=r.nodeValue,f=t.state;if(h-l=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(l,d),!1):(this.updateInner(n,c,t.startState.doc.length,l,d),!0)}},{key:"updateInner",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(t,e,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var t=q.chrome?{node:F(r.view.root).focusNode,written:!1}:void 0;r.sync(t),r.dirty=0,(null==t?void 0:t.written)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}))}},{key:"updateChildren",value:function(t,e,n){for(var r=this.childCursor(n),i=t.length-1;;i--){var o=i>=0?t[i]:null;if(!o)break;var a=o.fromA,s=o.toA,u=o.fromB,l=o.toB,h=jt.build(this.view.state.doc,u,l,e),c=h.content,f=h.breakAtStart,d=h.openStart,v=h.openEnd,p=r.findPos(s,1),g=p.i,m=p.off,y=r.findPos(a,-1),k=y.i,b=y.off;this.replaceRange(k,b,g,m,c,f,d,v)}}},{key:"replaceRange",value:function(t,e,n,r,i,o,a,s){var u=this.children[t],l=i.length?i[i.length-1]:null,h=l?l.breakAfter:o;if(t!=n||o||h||!(i.length<2)||!u.merge(e,r,i.length?l:null,0==e,a,s)){var c=this.children[n];for(r0&&(!o&&i.length&&u.merge(e,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(e0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e||this.mayControlSelection()){var n=this.view.state.selection.main,r=this.domAtPos(n.anchor),i=n.empty?r:this.domAtPos(n.head);if(q.gecko&&n.empty&&se(r)){var o=document.createTextNode("");this.view.observer.ignore((function(){return r.node.insertBefore(o,r.node.childNodes[r.offset]||null)})),r=i=new ot(o,0),t=!0}var a=F(this.root);(t||!a.focusNode||q.gecko&&n.empty&&ce(a.focusNode,a.focusOffset)||!G(r.node,r.offset,a.anchorNode,a.anchorOffset)||!G(i.node,i.offset,a.focusNode,a.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if(q.gecko){var t=ce(r.node,r.offset);if(t&&3!=t){var e=he(r.node,r.offset,1==t?1:-1);e&&(r=new ot(e,1==t?0:e.nodeValue.length))}}a.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=a.cursorBidiLevel&&(a.cursorBidiLevel=n.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(i.node,i.offset);else{var o=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}o.setEnd(i.node,i.offset),o.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(o)}})),this.impreciseAnchor=r.precise?null:new ot(a.anchorNode,a.anchorOffset),this.impreciseHead=i.precise?null:new ot(a.focusNode,a.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var t=this.view.state.selection.main,e=F(this.root);if(t.empty&&t.assoc&&e.modify){var n=Bt.find(this,t.head);if(n){var r=n.posAtStart;if(t.head!=r&&t.head!=r+n.length){var i=this.coordsAt(t.head,-1),o=this.coordsAt(t.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(t.head+t.assoc);e.collapse(a.node,a.offset),e.modify("move",t.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Ut)?this.root.activeElement==this.dom:$(this.dom,F(this.root))}},{key:"nearest",value:function(t){for(var e=t;e;){var n=st.get(e);if(n&&n.rootView==this)return n;e=e.parentNode}return null}},{key:"posFromDOM",value:function(t,e){var n=this.nearest(t);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(t,e)+n.posAtStart}},{key:"domAtPos",value:function(t){for(var e=this.childCursor().findPos(t,-1),n=e.i,r=e.off;no||t==o&&(i.type==Ct.Text||!r||this.children[r-1].breakAfter))return i.coordsAt(t-o,e);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var t=[],e=this.view.viewState.viewport,n=e.from,r=e.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;ar)break;if(o>=n){t.push(s.dom.getBoundingClientRect().height);var l=s.dom.scrollWidth;l>i&&(this.minWidth=i=l,this.minWidthFrom=o,this.minWidthTo=u)}o=u+s.breakAfter}return t}},{key:"measureTextSize",value:function(){var t,e=this,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r instanceof Bt){var i=r.measureTextSize();if(i)return i}}}catch(u){n.e(u)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){e.dom.appendChild(s);var t=U(s.firstChild)[0];o=s.getBoundingClientRect().height,a=t?t.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,e=this.children.length;return e&&(t-=this.children[--e].length),new ht(this.children,t,e)}},{key:"computeBlockGapDeco",value:function(){for(var t=[],e=this.view.viewState,n=0,r=0;;r++){var i=r==e.viewports.length?null:e.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=e.lineAt(o,0).bottom-e.lineAt(n,0).top;t.push(Ot.replace({widget:new ue(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Ot.set(t)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(C(this.view.state.facet(ne)),C(this.view.pluginField(Kt.decorations)))}},{key:"scrollPosIntoView",value:function(t,e){var n=this.coordsAt(t,e);if(n){var r,i=0,o=0,a=0,s=0,u=M(this.view.pluginField(Kt.scrollMargins));try{for(u.s();!(r=u.n()).done;){var l=r.value;if(l){var h=l.left,c=l.right,f=l.top,d=l.bottom;null!=h&&(i=Math.max(i,h)),null!=c&&(o=Math.max(o,c)),null!=f&&(a=Math.max(a,f)),null!=d&&(s=Math.max(s,d))}}}catch(v){u.e(v)}finally{u.f()}!function(t,e){for(var n=t.ownerDocument.defaultView,r=t.parentNode;r;)if(1==r.nodeType){var i=void 0,o=r==document.body;if(o)i=Z(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var a=r.getBoundingClientRect();i={left:a.left,right:a.left+r.clientWidth,top:a.top,bottom:a.top+r.clientHeight}}var s=0,u=0;if(e.topi.bottom&&(u=e.bottom-i.bottom+5),e.lefti.right&&(s=e.right-i.right+5),s||u)if(o)n.scrollBy(s,u);else{if(u){var l=r.scrollTop;r.scrollTop+=u,u=r.scrollTop-l}if(s){var h=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-h}e={left:e.left-s,top:e.top-u,right:e.right-s,bottom:e.bottom-u}}if(o)break;r=r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-a,right:n.right+o,bottom:n.bottom+s})}}},{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}}]),n}(st);function se(t){return 1==t.node.nodeType&&t.node.firstChild&&(0==t.offset||"false"==t.node.childNodes[t.offset-1].contentEditable)&&(t.offset0&&n<=0)e=Y(t=t.childNodes[e-1]);else{if(!(1==t.nodeType&&e=0))return null;t=t.childNodes[e],e=0}}}function ce(t,e){return 1!=t.nodeType?0:(e&&"false"==t.childNodes[e-1].contentEditable?1:0)|(e=e){if(a.level==n)return o;(i<0||(0!=r?r<0?a.frome:t[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),t}(),we=[];function Se(t,e){var n,r=t.length,i=e==ve?1:2;if(!t||1==i&&!ke.test(t))return xe(r);for(var o=0,a=i,s=i;ox;){for(var M=C,O=2!=we[--C];C>x&&O==(2!=we[C-1]);)C--;w.push(new be(C,M,O?2:1))}else w.push(new be(x,S,0))}else for(var T=0;Tt?e.left-t:Math.max(0,t-e.right)}function Oe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Te(t,e){return t.tope.top+1}function De(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Pe(t,e,n){for(var r,i,o,a,s,u,l,h,c=t.firstChild;c;c=c.nextSibling)for(var f=U(c),d=0;dg||a==g&&o>p)&&(r=c,i=v,o=p,a=g),0==p?n>v.bottom&&(!l||l.bottomv.top)&&(u=c,h=v):l&&Te(l,v)?l=Ee(l,v.bottom):h&&Te(h,v)&&(h=De(h,v.top))}if(l&&l.bottom>=n?(r=s,i=l):h&&h.top<=n&&(r=u,i=h),!r)return{node:t,offset:0};var m=Math.max(i.left,Math.min(i.right,e));return 3==r.nodeType?Re(r,m,n):o||"true"!=r.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0)}:Pe(r,m,n)}function Re(t,e,n){for(var r=t.nodeValue.length,i=it(),o=0;o=e&&u.top-1<=n&&u.bottom+1>=n)){var l=e>=(u.left+u.right)/2,h=l;if(q.chrome||q.gecko)i.setEnd(t,o),i.getBoundingClientRect().left==u.right&&(h=!l);return{node:t,offset:o+(h?1:0)}}}}return{node:t,offset:0}}function Be(t,e){for(var n,r=e.x,i=e.y,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=t.contentDOM.getBoundingClientRect(),s=t.defaultLineHeight/2,u=!1;;){if((n=t.blockAtHeight(i,a.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),u)return-1;u=!0}if(n.type==Ct.Text)break;i=o>0?n.bottom+s:n.top-s}var l=n.from;if(lt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:null;r=Math.max(a.left+1,Math.min(a.right-1,r));var h,c=t.root,f=c.elementFromPoint(r,i),d=-1;if(f&&t.contentDOM.contains(f)&&!(t.docView.nearest(f)instanceof gt))if(c.caretPositionFromPoint){var v=c.caretPositionFromPoint(r,i);v&&(h=v.offsetNode,d=v.offset)}else if(c.caretRangeFromPoint){var p=c.caretRangeFromPoint(r,i);p&&(h=p.startContainer,d=p.startOffset)}if(!h||!t.docView.dom.contains(h)){var g=Bt.find(t.docView,l),m=Pe(g.dom,r,i);h=m.node,d=m.offset}return t.docView.posFromDOM(h,d)}function Le(t,e,n,i){var o=t.state.doc.lineAt(e.head),a=i&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(a){var s=t.dom.getBoundingClientRect(),u=t.posAtCoords({x:n==(t.textDirection==fe.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(null!=u)return r.jT.cursor(u,n?-1:1)}var l=Bt.find(t.docView,e.head),h=l?n?l.posAtEnd:l.posAtStart:n?o.to:o.from;return r.jT.cursor(h,n?-1:1)}function Ne(t,e,n,i){for(var o=t.state.doc.lineAt(e.head),a=t.bidiSpans(o),s=e,u=null;;){var l=Ce(o,a,t.textDirection,s,n),h=Ae;if(!l){if(o.number==(n?t.state.doc.lines:1))return s;h="\n",o=t.state.doc.line(o.number+(n?1:-1)),a=t.bidiSpans(o),l=r.jT.cursor(n?o.from:o.to)}if(u){if(!u(h))return s}else{if(!i)return l;u=i(h)}s=l}}var je=function(){function t(e){var n=this;O(this,t),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(t){var r=ze[t];e.contentDOM.addEventListener(t,(function(i){!We(e,i)||n.ignoreDuringComposition(i)||"keydown"==t&&n.screenKeyEvent(e,i)||(n.mustFlushObserver(i)&&e.observer.forceFlush(),n.runCustomHandlers(t,e,i)?i.preventDefault():r(e,i))})),n.registeredEvents.push(t)};for(var i in ze)r(i);e.contentDOM.addEventListener("keydown",(function(t){e.inputState.lastKeyCode=t.keyCode,e.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=e.hasFocus,this.ensureHandlers(e)}return D(t,[{key:"setSelectionOrigin",value:function(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(t){var e,n=this,r=M(this.customHandlers=t.pluginField(Qt));try{for(r.s();!(e=r.n()).done;){var i=e.value,o=function(e){n.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(n.registeredEvents.push(e),t.contentDOM.addEventListener(e,(function(r){We(t,r)&&n.runCustomHandlers(e,t,r)&&r.preventDefault()})))};for(var a in i.handlers)o(a)}}catch(s){r.e(s)}finally{r.f()}}},{key:"runCustomHandlers",value:function(t,e,n){var r,i=M(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[t],s=!1;if(a){try{s=a.call(o.plugin,n,e)}catch(u){$t(e.state,u)}if(s||n.defaultPrevented)return q.android&&"keydown"==t&&13==n.keyCode&&e.observer.flushSoon(),!0}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(t,e){var n,r=M(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,e,t)}catch(a){$t(t.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(q.safari&&t.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(t,e){var n=9==e.keyCode&&Date.now()=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}(n,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}return D(t,[{key:"move",value:function(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}},{key:"up",value:function(t){null==this.dragging&&this.select(this.startEvent),this.dragging||t.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(t){var e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,annotations:r.YW.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}]),t}();function We(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n,r=e.target;r!=t.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=st.get(r))&&n.ignoreEvent(e))return!1;return!0}var ze=Object.create(null),He=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function _e(t,e){var n,i=t.state,o=1,a=i.toText(e),s=a.lines==i.selection.ranges.length;if(Qe&&i.selection.ranges.every((function(t){return t.empty}))&&Qe==a.toString()){var u=-1;n=i.changeByRange((function(t){var n=i.doc.lineAt(t.from);if(n.from==u)return{range:t};u=n.from;var l=i.toText((s?a.line(o++).text:e)+i.lineBreak);return{changes:{from:n.from,insert:l},range:r.jT.cursor(t.from+l.length)}}))}else n=s?i.changeByRange((function(t){var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:r.jT.cursor(t.from+e.length)}})):i.replaceSelection(a);t.dispatch(n,{annotations:r.YW.userEvent.of("paste"),scrollIntoView:!0})}ze.keydown=function(t,e){(function(t){var e=(t.ctrlKey?1:0)|(t.metaKey?8:0)|(t.altKey?2:0)|(t.shiftKey?4:0),n=t.keyCode,r=q.mac&&1==e;return 8==n||r&&72==n||46==n||r&&68==n||27==n||e==(q.mac?8:1)&&(66==n||73==n||89==n||90==n)})(e)&&e.preventDefault(),t.inputState.setSelectionOrigin("keyboardselection")};var qe=0;function Fe(t,e,n,o){if(1==o)return r.jT.cursor(e,n);if(2==o)return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=t.charCategorizer(e),a=t.doc.lineAt(e),s=e-a.from;if(0==a.length)return r.jT.cursor(e);0==s?n=1:s==a.length&&(n=-1);var u=s,l=s;n<0?u=(0,i.cp)(a.text,s,!1):l=(0,i.cp)(a.text,s);for(var h=o(a.text.slice(u,l));u>0;){var c=(0,i.cp)(a.text,u,!1);if(o(a.text.slice(c,u))!=h)break;u=c}for(;lDate.now()-2e3)){var n,i=null,o=M(t.state.facet(Ht));try{for(o.s();!(n=o.n()).done;){if(i=(0,n.value)(t,e))break}}catch(a){o.e(a)}finally{o.f()}i||0!=e.button||(i=function(t,e){var n=Ke(t,e),i=function(t){if(!Je)return t.detail;var e=Ye;return Ye=t,Xe=!e||e.timeStamp>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Xe+1)%3:1}(e),o=t.state.selection,a=n,s=e;return{update:function(t){t.changes&&(n&&(n.pos=t.changes.mapPos(n.pos)),o=o.map(t.changes))},get:function(e,u,l){var h;if(e.clientX==s.clientX&&e.clientY==s.clientY?h=a:(h=a=Ke(t,e),s=e),!h||!n)return o;var c=Fe(t,h.pos,h.bias,i);if(n.pos!=h.pos&&!u){var f=Fe(t,n.pos,n.bias,i),d=Math.min(f.from,c.from),v=Math.max(f.to,c.to);c=d=e.top&&t<=e.bottom},Ue=function(t,e,n){return $e(e,n)&&t>=n.left&&t<=n.right};function Ge(t,e,n,r){var i=Bt.find(t.docView,e);if(!i)return 1;var o=e-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&Ue(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&Ue(n,r,s)?1:a&&$e(r,a)?-1:1}function Ke(t,e){var n=t.posAtCoords({x:e.clientX,y:e.clientY});return null==n?null:{pos:n,bias:Ge(t,n,e.clientX,e.clientY)}}var Je=q.ie&&q.ie_version<=11,Ye=null,Xe=0;ze.dragstart=function(t,e){var n=t.state.selection.main,r=t.inputState.mouseSelection;r&&(r.dragging=n),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove")},ze.drop=function(t,e){if(e.dataTransfer){var n=t.posAtCoords({x:e.clientX,y:e.clientY}),i=e.dataTransfer.getData("Text");if(null!=n&&i){e.preventDefault();var o=t.inputState.mouseSelection,a=o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:n,insert:i},u=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(n,-1),head:u.mapPos(n,1)},annotations:r.YW.userEvent.of("drop")})}}},ze.paste=function(t,e){t.observer.flush();var n=He?null:e.clipboardData,r=n&&n.getData("text/plain");r?(_e(t,r),e.preventDefault()):function(t){var e=t.dom.parentNode;if(e){var n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){t.focus(),n.remove(),_e(t,n.value)}),50)}}(t)};var Qe=null;function Ze(t){t.docView.compositionDeco.size&&t.update([])}ze.copy=ze.cut=function(t,e){var n=function(t){var e,n=[],r=[],i=!1,o=M(t.selection.ranges);try{for(o.s();!(e=o.n()).done;){var a=e.value;a.empty||(n.push(t.sliceDoc(a.from,a.to)),r.push(a))}}catch(f){o.e(f)}finally{o.f()}if(!n.length){var s,u=-1,l=M(t.selection.ranges);try{for(l.s();!(s=l.n()).done;){var h=s.value.from,c=t.doc.lineAt(h);c.number>u&&(n.push(c.text),r.push({from:c.from,to:Math.min(t.doc.length,c.to+1)})),u=c.number}}catch(f){l.e(f)}finally{l.f()}i=!0}return{text:n.join(t.lineBreak),ranges:r,linewise:i}}(t.state),i=n.text,o=n.ranges,a=n.linewise;if(i){Qe=a?i:null;var s=He?null:e.clipboardData;s?(e.preventDefault(),s.clearData(),s.setData("text/plain",i)):function(t,e){var n=t.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout((function(){r.remove(),t.focus()}),50)}}(t,i),"cut"==e.type&&t.dispatch({changes:o,scrollIntoView:!0,annotations:r.YW.userEvent.of("cut")})}},ze.focus=ze.blur=function(t){setTimeout((function(){t.hasFocus!=t.inputState.notifiedFocused&&t.update([])}),10)},ze.beforeprint=function(t){t.viewState.printing=!0,t.requestMeasure(),setTimeout((function(){t.viewState.printing=!1,t.requestMeasure()}),2e3)},ze.compositionstart=ze.compositionupdate=function(t){t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),Ze(t)),t.inputState.composing=0)},ze.compositionend=function(t){t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout((function(){t.inputState.composing<0&&Ze(t)}),50)};var tn,en=["pre-wrap","normal","pre-line"],nn=function(){function t(){O(this,t),this.doc=i.xv.empty,this.lineWrapping=!1,this.direction=fe.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return D(t,[{key:"heightForGap",value:function(t,e){var n=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(n+=Math.ceil((e-t-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(t){return this.doc=t,this}},{key:"mustRefresh",value:function(t,e,n){for(var r=!1,i=0;i-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(t,e,n,r,i,o){var a=en.indexOf(t)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=e;if(this.lineWrapping=a,this.direction=e,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:2;O(this,t),this.length=e,this.height=n,this.flags=r}return D(t,[{key:"setHeight",value:function(t,e){this.height!=e&&(Math.abs(this.height-e)>1e-4&&(t.heightChanged=!0),this.height=e)}},{key:"replace",value:function(e,n,r){return t.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(this)}},{key:"decomposeRight",value:function(t,e){e.push(this)}},{key:"applyChanges",value:function(t,e,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,u=a.toA,l=a.fromB,h=a.toB,c=i.lineAt(s,tn.ByPosNoHeight,e,0,0),f=c.to>=u?c:i.lineAt(u,tn.ByPosNoHeight,e,0,0);for(h+=f.to-u,u=f.to;o>0&&c.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s0},set:function(t){this.flags=(t?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new un(0,0)}},{key:"of",value:function(e){if(1==e.length)return e[0];for(var n=0,r=e.length,i=0,o=0;;)if(n==r)if(i>2*o){var a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(an),un=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this,t,r,Ct.Text)).collapsed=0,i.widgetHeight=0,i}return D(n,[{key:"replace",value:function(t,e,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof ln&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof ln?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):an.of(r)}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=e&&r.more?this.setHeight(t,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(sn),ln=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,t,0)}return D(n,[{key:"lines",value:function(t,e){var n=t.lineAt(e).number,r=t.lineAt(e+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(t,e,n,r){var i=this.lines(e,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,u=Math.max(0,Math.min(a-o,Math.floor((t-n)/s))),l=e.line(o+u),h=l.from,c=l.length;return new on(h,c,n+s*u,s,Ct.Text)}},{key:"lineAt",value:function(t,e,n,r,i){if(e==tn.ByHeight)return this.blockAt(t,n,r,i);if(e==tn.ByPosNoHeight){var o=n.lineAt(t),a=o.from,s=o.to;return new on(a,s-a,0,0,Ct.Text)}var u=this.lines(n,i),l=u.firstLine,h=u.lineHeight,c=n.lineAt(t),f=c.from,d=c.length,v=c.number;return new on(f,d,r+h*(v-l),h,Ct.Text)}},{key:"forEachLine",value:function(t,e,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,u=a.lineHeight,l=Math.max(t,i),h=Math.min(i+this.length,e);l<=h;){var c=n.lineAt(l);l==t&&(r+=u*(c.number-s)),o(new on(c.from,c.length,r,r+=u,Ct.Text)),l=c.to+1}}},{key:"replace",value:function(t,e,r){var i=this.length-e;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(t>0){var a=r[0];a instanceof n?r[0]=new n(t+a.length):r.unshift(new n(t-1),null)}return an.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(new n(t-1),null)}},{key:"decomposeRight",value:function(t,e){e.push(null,new n(this.length-t-1))}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=e+this.length;if(i&&i.from<=e+this.length&&i.more){var a=[],s=Math.max(e,i.from);for(i.from>e&&a.push(new n(i.from-e-1).updateHeight(t,e));s<=o&&i.more;){var u=t.doc.lineAt(s).length;a.length&&a.push(null);var l=new un(u,i.heights[i.index++]);l.outdated=!1,a.push(l),s+=u+1}return s<=o&&a.push(null,new n(o-s).updateHeight(t,s)),t.heightChanged=!0,an.of(a)}return(r||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(an),hn=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this,t.length+r+i.length,t.height+i.height,r|(t.outdated||i.outdated?2:0))).left=t,o.right=i,o.size=t.size+i.size,o}return D(n,[{key:"blockAt",value:function(t,e,n,r){var i=n+this.left.height;return ta))return u;var l=e==tn.ByPosNoHeight?tn.ByPosNoHeight:tn.ByPos;return s?u.join(this.right.lineAt(a,l,n,o,a)):this.left.lineAt(a,l,n,r,i).join(u)}},{key:"forEachLine",value:function(t,e,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)t=s&&this.right.forEachLine(t,e,n,a,s,o);else{var u=this.lineAt(s,tn.ByPos,n,r,i);t=t&&u.from<=e&&o(u),e>u.to&&this.right.forEachLine(u.to+1,e,n,a,s,o)}}},{key:"replace",value:function(t,e,n){var r=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-r,e-r,n));var i=[];t>0&&this.decomposeLeft(t,i);var o,a=i.length,s=M(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.push(u)}}catch(h){s.e(h)}finally{s.f()}if(t>0&&cn(i,a-1),e=++n&&e.push(null),t>n&&this.right.decomposeLeft(t-n,e)}},{key:"decomposeRight",value:function(t,e){var n=this.left.length,r=n+this.break;if(t>=r)return this.right.decomposeRight(t-r,e);t2*e.size||e.size>2*t.size?an.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=e+i.length+this.break,s=null;return r&&r.from<=e+i.length&&r.more?s=i=i.updateHeight(t,e,n,r):i.updateHeight(t,e,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(t,a,n,r):o.updateHeight(t,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}},{key:"break",get:function(){return 1&this.flags}}]),n}(an);function cn(t,e){var n,r;null==t[e]&&(n=t[e-1])instanceof ln&&(r=t[e+1])instanceof ln&&t.splice(e-1,3,new ln(n.length+1+r.length))}var fn=function(){function t(e,n){O(this,t),this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}return D(t,[{key:"span",value:function(t,e){if(this.lineStart>-1){var n=Math.min(e,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof un?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new un(n-this.pos,-1)),this.writtenTo=n,e>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}},{key:"point",value:function(t,e,n){if(t=5)&&this.addLineDeco(r,i)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)){var t=this.oracle.doc.lineAt(this.pos),e=t.from,n=t.to;this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new un(this.pos-e,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(t,e){var n=new ln(e-t);return this.oracle.doc.lineAt(t).to==e&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof un)return t;var e=new un(0,-1);return this.nodes.push(e),e}},{key:"addBlock",value:function(t){this.enterLine(),t.type!=Ct.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ct.WidgetBefore&&(this.covering=t)}},{key:"addLineDeco",value:function(t,e){var n=this.ensureLine();n.length+=e,n.collapsed+=e,n.widgetHeight=Math.max(n.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}},{key:"finish",value:function(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof un||this.isCovered?(this.writtenTo=e&&i<=n}))){var o=t.lineAt(i,0),a=o.from,s=o.to;e.push(new yn(a,s))}},i=0;i<=1;i++)r(i);this.viewports=e.sort((function(t,e){return t.from-e.from})),this.scaler=this.heightMap.height<=7e6?Sn:new xn(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=t.state;var i=this.state.facet(ne),o=t.changedRanges,a=ie.extendWithRanges(o,dn(t.startState.facet(ne),i,t?t.changes:r.as.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(i,n.doc,this.heightOracle.setDoc(this.state.doc),a),this.heightMap.height!=s&&(t.flags|=2);var u=a.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.headu.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,e)),u.eq(this.viewport)||(this.viewport=u,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(t.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes)))),this.computeVisibleRanges(),e&&(this.scrollTo=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(t,e){var n=t.dom,r="",i=fe.LTR;if(!e){var o=window.getComputedStyle(n);r=o.whiteSpace,i="rtl"==o.direction?fe.RTL:fe.LTR,this.paddingTop=parseInt(o.paddingTop)||0,this.paddingBottom=parseInt(o.paddingBottom)||0}var a=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(t,e){for(var n=t.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=t.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var u=s.getBoundingClientRect();r=Math.max(r,u.left),i=Math.min(i,u.right),o=Math.max(o,u.top),a=Math.min(a,u.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+e),bottom:a-(n.top+e)}}(n,this.paddingTop),s=a.top-this.pixelViewport.top,u=a.bottom-this.pixelViewport.bottom;if(this.pixelViewport=a,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var l=t.measureVisibleLineHeights(),h=!1,c=0,f=0,d=this.heightOracle;if(!e){var v=t.dom.clientWidth;if(d.mustRefresh(l,r,i)||d.lineWrapping&&Math.abs(v-this.contentWidth)>d.charWidth){var p=t.measureTextSize(),g=p.lineHeight,m=p.charWidth;(h=d.refresh(r,i,g,m,v/m,l))&&(t.minWidth=0,f|=16)}this.contentWidth!=v&&(this.contentWidth=v,f|=16),s>0&&u>0?c=Math.max(s,u):s<0&&u<0&&(c=Math.min(s,u))}if(d.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(d,0,h,new rn(this.viewport.from,l)),d.heightChanged&&(f|=2),!this.viewportIsAppropriate(this.viewport,c)||this.scrollTo&&(this.scrollTo.headthis.viewport.to)){var y=this.getViewport(c,this.scrollTo);y.from==this.viewport.from&&y.to==this.viewport.to||(this.viewport=y,f|=4)}return this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(f|=this.updateLineGaps(this.ensureLineGaps(h?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.enforceCursorAssoc()),f}},{key:"getViewport",value:function(t,e){var n=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.visibleTop,a=this.visibleBottom,s=new yn(r.lineAt(o-1e3*n,tn.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),tn.ByHeight,i,0,0).to);if(e)if(e.heads.to){var l=r.lineAt(e.head,tn.ByPos,i,0,0).bottom;s=new yn(r.lineAt(l-(a-o)-500,tn.ByHeight,i,0,0).from,r.lineAt(l+500,tn.ByHeight,i,0,0).to)}return s}},{key:"mapViewport",value:function(t,e){var n=e.mapPos(t.from,-1),r=e.mapPos(t.to,1);return new yn(this.heightMap.lineAt(n,tn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,tn.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(t){var e=t.from,n=t.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(e,tn.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,tn.ByPos,this.state.doc,0,0),s=a.bottom,u=this.visibleTop,l=this.visibleBottom;return(0==e||o<=u-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(r,250)))&&o>u-2e3&&si&&(r.push({from:i,to:t}),o+=t-i),i=e}},20),i=r.from&&(o=l.from),l.from<=r.to&&l.to>=s&&(s=l.to);var h=o-1e4,c=s+1e4;h>r.from+5e3&&n.push(wn(t,(function(t){return t.from==r.from&&t.to>h-5e3&&t.toc-5e3&&t.from=1)return r[r.length-1].to;for(var i=Math.floor(n*e),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function bn(t,e){var n,r=0,i=M(t.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(e<=s){r+=e-a;break}r+=s-a}}catch(u){i.e(u)}finally{i.f()}return r/t.total}function wn(t,e){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(e(i))return i}}catch(o){r.e(o)}finally{r.f()}}var Sn={toDOM:function(t){return t},fromDOM:function(t){return t},scale:1},xn=function(){function t(e,n,r){O(this,t);var i=0,o=0,a=0;this.viewports=r.map((function(t){var r=t.from,o=t.to,a=n.lineAt(r,tn.ByPos,e,0,0).top,s=n.lineAt(o,tn.ByPos,e,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,u=M(this.viewports);try{for(u.s();!(s=u.n()).done;){var l=s.value;l.domTop=a+(l.top-o)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}}catch(h){u.e(h)}finally{u.f()}}return D(t,[{key:"toDOM",value:function(t,e){t-=e;for(var n=0,r=0,i=0;;n++){var o=n-1}}),On=o.V.newName(),Tn=o.V.newName(),Dn=o.V.newName(),En={"&light":"."+Tn,"&dark":"."+Dn};function Pn(t,e,n){return new o.V(e,{finish:function(e){return/&/.test(e)?e.replace(/&\w*/,(function(e){if("&"==e)return t;if(!n||!n[e])throw new RangeError("Unsupported selector: ".concat(e));return n[e]})):t+" "+e}})}var Rn=Pn("."+On,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},En),Bn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},Ln=q.ie&&q.ie_version<=11,Nn=function(){function t(e,n,r){var i=this;O(this,t),this.view=e,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new et,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((function(t){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.queue.push(o)}}catch(a){r.e(a)}finally{r.f()}(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?i.flushSoon():i.flush()})),Ln&&(this.onCharData=function(t){i.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(t){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),t[t.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return D(t,[{key:"onScroll",value:function(t){this.intersecting&&(this.flush(),this.onScrollChanged(t))}},{key:"onSelectionChange",value:function(t){var e=this.view,n=F(e.root);if(e.state.facet(Ut)?e.root.activeElement==this.dom:$(e.dom,n)){var r=n.anchorNode&&e.docView.nearest(n.anchorNode);r&&r.ignoreEvent(t)||(q.ie&&q.ie_version<=11&&!e.state.selection.main.empty&&n.focusNode&&G(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush())}}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var t=0,e=null,n=this.dom;n;)if(1==n.nodeType)!e&&t=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var t=this;if(!(this.delayedFlush>=0)){var e,n=this.queue,r=M(this.observer.takeRecords());try{for(r.s();!(e=r.n()).done;){var i=e.value;n.push(i)}}catch(p){r.e(p)}finally{r.f()}n.length&&(this.queue=[]);var o=F(this.view.root),a=!this.ignoreSelection.eq(o)&&$(this.dom,o);if(0!=n.length||a){var s,u=-1,l=-1,h=!1,c=M(n);try{for(c.s();!(s=c.n()).done;){var f=s.value,d=this.readMutation(f);d&&(d.typeOver&&(h=!0),-1==u?(u=d.from,l=d.to):(u=Math.min(d.from,u),l=Math.max(d.to,l)))}}catch(p){c.e(p)}finally{c.f()}var v=this.view.state;(u>-1||a)&&this.onChange(u,l,h),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return t.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(),"childList"==t.type){var n=jn(e,t.previousSibling||t.target.previousSibling,-1),r=jn(e,t.nextSibling||t.target.nextSibling,1);return{from:n?e.posAfter(n):e.posAtStart,to:r?e.posBefore(r):e.posAtEnd,typeOver:!1}}return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var t,e=M(this.scrollTargets);try{for(e.s();!(t=e.n()).done;){t.value.removeEventListener("scroll",this.onScroll)}}catch(n){e.e(n)}finally{e.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),t}();function jn(t,e,n){for(;e;){var r=st.get(e);if(r&&r.parent==t)return r;var i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function In(t,e,n,i){var o,a,s,u=t.state.selection.main;if(e>-1&&(s=t.docView.domBoundsAround(e,n,0))){var l=s,h=l.from,c=l.to,f=t.docView.impreciseHead||t.docView.impreciseAnchor?[]:function(t,e){var n=[];if(e.activeElement!=t)return n;var r=F(e),i=r.anchorNode,o=r.anchorOffset,a=r.focusNode,s=r.focusOffset;i&&(n.push(new zn(i,o)),a==i&&s==o||n.push(new zn(a,s)));return n}(t.contentDOM,t.root),d=new Vn(f,t);d.readRange(s.startDOM,s.endDOM),a=function(t,e){if(0==t.length)return null;var n=t[0].pos,i=2==t.length?t[1].pos:n;return n>-1&&i>-1?r.jT.single(n+e,i+e):null}(f,h);var v=u.from,p=null;(8===t.inputState.lastKeyCode&&t.inputState.lastKeyTime>Date.now()-100||q.android&&d.text.length0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(t.state.sliceDoc(h,c),d.text,v-h,p);g&&(o={from:h+g.from,to:h+g.toA,insert:t.state.toText(d.text.slice(g.from,g.toB))})}else if(t.hasFocus||!t.state.facet(Ut)){var m=F(t.root),y=t.docView,k=y.impreciseHead,b=y.impreciseAnchor,w=k&&k.node==m.focusNode&&k.offset==m.focusOffset?t.state.selection.main.head:t.docView.posFromDOM(m.focusNode,m.focusOffset),S=b&&b.node==m.anchorNode&&b.offset==m.anchorOffset?t.state.selection.main.anchor:function(t){var e=t.isCollapsed;return e&&q.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e}(m)?w:t.docView.posFromDOM(m.anchorNode,m.anchorOffset);w==u.head&&S==u.anchor||(a=r.jT.single(S,w))}if(o||a)if(!o&&i&&!u.empty&&a&&a.main.empty&&(o={from:u.from,to:u.to,insert:t.state.doc.slice(u.from,u.to)}),o){var x=t.state;if(q.android&&(o.from==u.from&&o.to==u.to&&1==o.insert.length&&2==o.insert.lines&&Hn(t,"Enter",10)||o.from==u.from-1&&o.to==u.to&&0==o.insert.length&&Hn(t,"Backspace",8)||o.from==u.from&&o.to==u.to+1&&0==o.insert.length&&Hn(t,"Delete",46)))return;var A,C=o.insert.toString();if(t.state.facet(Ft).some((function(e){return e(t,o.from,o.to,C)})))return;if(t.inputState.composing>=0&&t.inputState.composing++,o.from>=u.from&&o.to<=u.to&&o.to-o.from>=(u.to-u.from)/3&&(!a||a.main.empty&&a.main.from==o.from+o.insert.length)){var M=u.fromo.to?x.sliceDoc(o.to,u.to):"";A=x.replaceSelection(t.state.toText(M+o.insert.sliceString(0,void 0,t.state.lineBreak)+O))}else{var T=x.changes(o);A={changes:T,selection:a&&!x.selection.main.eq(a.main)&&a.main.to<=T.newLength?x.selection.replaceRange(a.main):void 0}}t.dispatch(A,{scrollIntoView:!0,annotations:r.YW.userEvent.of("input")})}else if(a&&!a.main.eq(u)){var D,E=!1;t.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==t.inputState.lastSelectionOrigin?E=!0:D=r.YW.userEvent.of(t.inputState.lastSelectionOrigin)),t.dispatch({selection:a,scrollIntoView:E,annotations:D})}}var Vn=function(){function t(e,n){O(this,t),this.points=e,this.view=n,this.text="",this.lineBreak=n.state.lineBreak}return D(t,[{key:"readRange",value:function(t,e){if(t){for(var n=t.parentNode,r=t;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==e)break;var o=st.get(r),a=st.get(i);((o?o.breakAfter:Wn(r))||(a?a.breakAfter:Wn(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=this.lineBreak),r=i}this.findPointBefore(n,e)}}},{key:"readNode",value:function(t){if(!t.cmIgnore){var e,n=st.get(t),r=n&&n.overrideDOMText;null!=r?e=r.sliceString(0,void 0,this.lineBreak):3==t.nodeType?e=t.nodeValue:"BR"==t.nodeName?e=t.nextSibling?this.lineBreak:"":1==t.nodeType&&this.readRange(t.firstChild,null),null!=e&&(this.findPointIn(t,e.length),this.text+=e,q.chrome&&13==this.view.inputState.lastKeyCode&&!t.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}},{key:"findPointBefore",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}catch(o){r.e(o)}finally{r.f()}}}]),t}();function Wn(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}var zn=function t(e,n){O(this,t),this.node=e,this.offset=n,this.pos=-1};function Hn(t,e,n){var r={key:e,code:e,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);t.contentDOM.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return t.contentDOM.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}var _n=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,t),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(t){return e.update([t])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new mn(n.state||r.yy.create()),this.plugins=this.state.facet(Yt).map((function(t){return new Zt(t).update(e)})),this.observer=new Nn(this,(function(t,n,r){In(e,t,n,r)}),(function(t){e.inputState.runScrollHandlers(e,t),e.measure()})),this.inputState=new je(this),this.docView=new ae(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,Un(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return D(t,[{key:"dispatch",value:function(){var t;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof r.YW?arguments.length<=0?void 0:arguments[0]:(t=this.state).update.apply(t,arguments))}},{key:"update",value:function(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,n,i=!1,o=this.state,a=M(t);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=s.state}}catch(c){a.e(c)}finally{a.f()}if(o.facet(r.yy.phrases)!=this.state.facet(r.yy.phrases))return this.setState(o);e=new oe(this,o,t);try{this.updateState=2;var u=t.some((function(t){return t.scrollIntoView}))?o.selection.main:null;this.viewState.update(e,u),this.bidiCache=Jn.update(this.bidiCache,e.changes),e.empty||this.updatePlugins(e),i=this.docView.update(e),this.state.facet(re)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((i||scrollTo||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!e.empty){var l,h=M(this.state.facet(qt));try{for(h.s();!(l=h.n()).done;){(0,l.value)(e)}}catch(c){h.e(c)}finally{h.f()}}}},{key:"setState",value:function(t){var e=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;try{var n,r=M(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new mn(t),this.plugins=t.facet(Yt).map((function(t){return new Zt(t).update(e)})),this.docView=new ae(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}},{key:"updatePlugins",value:function(t){var e=t.startState.facet(Yt),n=t.state.facet(Yt);if(e!=n){var r,i=[],o=M(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.indexOf(a);if(s<0)i.push(new Zt(a));else{var u=this.plugins[s];u.mustUpdate=t,i.push(u)}}}catch(p){o.e(p)}finally{o.f()}var l,h=M(this.plugins);try{for(h.s();!(l=h.n()).done;){var c=l.value;c.mustUpdate!=t&&c.destroy(this)}}catch(p){h.e(p)}finally{h.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else{var f,d=M(this.plugins);try{for(d.s();!(f=d.n()).done;){f.value.mustUpdate=t}}catch(p){d.e(p)}finally{d.f()}}for(var v=0;v-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;var e=null;try{for(var n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var o=i.map((function(e){try{return e.read(t)}catch(n){return $t(t.state,n),Kn}})),a=new oe(this,this.state);a.flags|=r,e?e.flags|=r:e=a,this.updateState=2,a.empty||this.updatePlugins(a),this.updateAttrs(),r&&this.docView.update(a);for(var s=0;s-1&&this.measure()}},{key:"requestMeasure",value:function(t){var e=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return e.measure()}))),t){if(null!=t.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(t,e)}},{key:"moveByChar",value:function(t,e,n){return Ne(this,t,e,n)}},{key:"moveByGroup",value:function(t,e){var n=this;return Ne(this,t,e,(function(e){return function(t,e,n){var i=t.state.charCategorizer(e),o=i(n);return function(t){var e=i(t);return o==r.D0.Space&&(o=e),o==e}}(n,t.head,e)}))}},{key:"moveToLineBoundary",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Le(this,t,e,n)}},{key:"moveVertically",value:function(t,e,n){return function(t,e,n,o){var a,s=e.head,u=n?1:-1;if(s==(n?t.state.doc.length:0))return r.jT.cursor(s);var l=t.coordsAtPos(s);if(l)for(var h=t.dom.getBoundingClientRect(),c=null!==(a=e.goalColumn)&&void 0!==a?a:l.left-h.left,f=h.left+c,d=null!=o?o:t.defaultLineHeight>>1,v=u<0?l.top:l.bottom,p=0;p<50;p+=10){var g=Be(t,{x:f,y:v+(d+p)*u},u);if(null==g)break;if(g!=s)return r.jT.cursor(g,void 0,void 0,c)}var m=t.state.doc,y=m.lineAt(s),k=t.state.tabSize,b=e.goalColumn,w=0;if(null==b){for(var S=m.iterRange(y.from,s);!S.next().done;)w=(0,i.IS)(S.value,w,k);b=w*t.defaultCharacterWidth}else w=Math.round(b/t.defaultCharacterWidth);if(u<0&&0==y.from)return r.jT.cursor(0);if(u>0&&y.to==m.length)return r.jT.cursor(y.to);for(var x=m.line(y.number+u),A=x.from,C=0,M=m.iterRange(x.from,x.to);C>=w&&!M.next().done;){var O=(0,i.Gz)(M.value,C,w,k),T=O.offset;C=w-O.leftOver,A+=T}return r.jT.cursor(A,void 0,void 0,b)}(this,t,e,n)}},{key:"scrollPosIntoView",value:function(t){this.viewState.scrollTo=r.jT.cursor(t),this.requestMeasure()}},{key:"domAtPos",value:function(t){return this.docView.domAtPos(t)}},{key:"posAtDOM",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(t,e)}},{key:"posAtCoords",value:function(t){return this.readMeasured(),Be(this,t)}},{key:"coordsAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(t,e);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(t),i=this.bidiSpans(r),o=i[be.find(i,t-r.from,-1,e)];return Q(n,o.dir==fe.LTR==e>0)}},{key:"bidiSpans",value:function(t){if(t.length>qn)return xe(t.length);var e,n=this.textDirection,r=M(this.bidiCache);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.from==t.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=Se(t.text,this.textDirection);return this.bidiCache.push(new Jn(t.from,t.to,n,o)),o}},{key:"focus",value:function(){var t=this;this.observer.ignore((function(){rt(t.contentDOM),t.docView.updateSelection()}))}},{key:"destroy",value:function(){var t,e=M(this.plugins);try{for(e.s();!(t=e.n()).done;){t.value.destroy(this)}}catch(n){e.e(n)}finally{e.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"themeClasses",get:function(){return On+" "+(this.state.facet(Mn)?Dn:Tn)+" "+this.state.facet(Cn)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return document.hasFocus()&&this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(t){return Xt.define((function(){return{}}),{eventHandlers:t})}},{key:"theme",value:function(t,e){var n=o.V.newName(),r=[Cn.of(n),re.of(Pn(".".concat(n),t))];return e&&e.dark&&r.push(Mn.of(!0)),r}},{key:"baseTheme",value:function(t){return r.Wl.fallback(re.of(Pn("."+On,t,En)))}}]),t}();_n.styleModule=re,_n.inputHandler=Ft,_n.exceptionSink=_t,_n.updateListener=qt,_n.editable=Ut,_n.mouseSelectionStyle=Ht,_n.dragMovesSelection=zt,_n.clickAddsSelectionRange=Wt,_n.decorations=ne,_n.contentAttributes=ee,_n.editorAttributes=te,_n.lineWrapping=_n.contentAttributes.of({class:"cm-lineWrapping"}),_n.announce=r.Py.define();var qn=4096;function Fn(t,e){return null==t?e.getBoundingClientRect().top:t}var $n=-1;function Un(){window.addEventListener("resize",(function(){-1==$n&&($n=setTimeout(Gn,50))}))}function Gn(){$n=-1;for(var t=document.querySelectorAll(".cm-content"),e=0;e1&&void 0!==arguments[1]?arguments[1]:Yn,r=Object.create(null),i=Object.create(null),o=function(t,e){var n=i[t];if(null==n)i[t]=e;else if(n!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},a=function(t,e,i,a){for(var s=r[t]||(r[t]=Object.create(null)),u=e.split(/ (?!$)/).map((function(t){return Xn(t,n)})),l=function(e){var n=u.slice(0,e).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(e){var r=ir={view:e,prefix:n,scope:t};return setTimeout((function(){ir==r&&(ir=null)}),or),!0}]})},h=1;h0&&void 0!==arguments[0]?arguments[0]:{};return[ur.of(t),cr,dr]}var hr=function(){function t(e,n,r,i,o){O(this,t),this.left=e,this.top=n,this.width=r,this.height=i,this.className=o}return D(t,[{key:"draw",value:function(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t}},{key:"adjust",value:function(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width>=0&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}},{key:"eq",value:function(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}}]),t}(),cr=Xt.fromClass(function(){function t(e){O(this,t),this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}return D(t,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(ur).cursorBlinkRate+"ms"}},{key:"update",value:function(t){var e=t.startState.facet(ur)!=t.state.facet(ur);(e||t.selectionSet||t.geometryChanged||t.viewportChanged)&&this.view.requestMeasure(this.measureReq),t.transactions.some((function(t){return t.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}},{key:"readPos",value:function(){var t,e=this,n=this.view.state,r=n.facet(ur),i=n.selection.ranges.map((function(t){return t.empty?[]:function(t,e){if(e.to<=t.viewport.from||e.from>=t.viewport.to)return[];var n=Math.max(e.from,t.viewport.from),r=Math.min(e.to,t.viewport.to),i=t.textDirection==fe.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),s=vr(t),u=window.getComputedStyle(o.firstChild),l=a.left+parseInt(u.paddingLeft),h=a.right-parseInt(u.paddingRight),c=t.visualLineAt(n),f=t.visualLineAt(r);t.lineWrapping&&(c=pr(t,n,c),f=pr(t,r,f));if(c.from==f.from)return m(y(e.from,e.to,c));var d=y(e.from,null,c),v=y(null,e.to,f),p=[];return c.tof&&p.from=m)break;x>g&&u(Math.max(S,g),null==e&&S<=f,Math.min(x,m),null==n&&x>=d,w.dir)}}catch(C){b.e(C)}finally{b.f()}if((g=k.to+1)>=m)break}}}catch(C){v.e(C)}finally{v.f()}if(0==s.length){var A=t.coordsAtPos(f,-1);o=Math.min(A.top,o),a=Math.max(A.bottom,a)}return{top:o,bottom:a,horizontal:s}}}(e.view,t)})).reduce((function(t,e){return t.concat(e)})),o=[],a=M(n.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value,u=s==n.selection.main;if(s.empty?!u||sr:r.drawRangeCursor){var l=gr(this.view,s,u);l&&o.push(l)}}}catch(h){a.e(h)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(t){var e=this,n=t.rangePieces,r=t.cursors;if(n.length!=this.rangePieces.length||n.some((function(t,n){return!t.eq(e.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(c){o.e(c)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(t,n){return!t.eq(e.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var u,l=M(r);try{for(l.s();!(u=l.n()).done;){var h=u.value;this.cursorLayer.appendChild(h.draw())}}catch(c){l.e(c)}finally{l.f()}}else r.forEach((function(t,e){return t.adjust(s[e])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),t}()),fr={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};sr&&(fr[".cm-line"].caretColor="transparent !important");var dr=r.Wl.override(_n.theme(fr));function vr(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==fe.LTR?e.left:e.right-t.scrollDOM.clientWidth)-t.scrollDOM.scrollLeft,top:e.top-t.scrollDOM.scrollTop}}function pr(t,e,n){var i=r.jT.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(i,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(i,!0,!0).from)}}function gr(t,e,n){var r=t.coordsAtPos(e.head,e.assoc||1);if(!r)return null;var i=vr(t);return new hr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}var mr=null!=/x/.unicode?"gu":"g",yr=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029\ufeff-]",mr),kr=null;r.r$.define({combine:function(t){var e=(0,r.BO)(t,{render:null,specialChars:yr,addSpecialChars:null});return(e.replaceTabs=!function(){if(null==kr&&"undefined"!=typeof document&&document.body){var t=document.body.style;kr=null!=(t.tabSize||t.MozTabSize)}return kr||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,mr)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,mr)),e}});function br(){return Sr}var wr=Ot.line({attributes:{class:"cm-activeLine"}}),Sr=Xt.fromClass(function(){function t(e){O(this,t),this.decorations=this.getDeco(e)}return D(t,[{key:"update",value:function(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e,n=-1,r=[],i=M(t.state.selection.ranges);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(o.empty){var a=t.visualLineAt(o.head);a.from>n&&(r.push(wr.range(a.from)),n=a.from)}}}catch(s){i.e(s)}finally{i.f()}return Ot.set(r)}}]),t}(),{decorations:function(t){return t.decorations}})},26856:function(t,e,n){"use strict";function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=e.deserialize;o(this,t),this.id=l++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return s(t,[{key:"set",value:function(t,e){return t[this.id]=e,t}},{key:"add",value:function(t){var e=this;return"function"!=typeof t&&(t=d.match(t)),function(n){var r=t(n);return void 0===r?null:[e,r]}}}],[{key:"string",value:function(){return new t({deserialize:function(t){return t}})}},{key:"number",value:function(){return new t({deserialize:Number})}},{key:"flag",value:function(){return new t({deserialize:function(){return!0}})}}]),t}();c.closedBy=new c({deserialize:function(t){return t.split(" ")}}),c.openedBy=new c({deserialize:function(t){return t.split(" ")}}),c.group=new c({deserialize:function(t){return t.split(" ")}});var f=Object.create(null),d=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o(this,t),this.name=e,this.props=n,this.id=r,this.flags=i}return s(t,[{key:"prop",value:function(t){return this.props[t.id]}},{key:"is",value:function(t){if("string"==typeof t){if(this.name==t)return!0;var e=this.prop(c.group);return!!e&&e.indexOf(t)>-1}return this.id==t}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}}],[{key:"define",value:function(e){var n=e.props&&e.props.length?Object.create(null):f,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new t(e.name||"",n,e.id,i);if(e.props){var a,s=r(e.props);try{for(s.s();!(a=s.n()).done;){var u=a.value;Array.isArray(u)||(u=u(o)),u&&u[0].set(n,u[1])}}catch(l){s.e(l)}finally{s.f()}}return o}},{key:"match",value:function(t){var e=Object.create(null);for(var n in t){var i,o=r(n.split(" "));try{for(o.s();!(i=o.n()).done;){var a=i.value;e[a]=t[n]}}catch(s){o.e(s)}finally{o.f()}}return function(t){for(var n=t.prop(c.group),r=-1;r<(n?n.length:0);r++){var i=e[r<0?t.name:n[r]];if(i)return i}}}}]),t}();d.none=new d("",Object.create(null),0,8);var v=function(){function t(e){o(this,t),this.types=e;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=null!=t&&h.get(this)||this.topNode,r=new S(n);return null!=t&&(r.moveTo(t,e),h.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new S(this.topNode,!0)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor(t,e).node}},{key:"iterate",value:function(t){for(var e=t.enter,n=t.leave,r=t.from,i=void 0===r?0:r,o=t.to,a=void 0===o?this.length:o,s=this.cursor();;){var u=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==e(s.type,s.from,s.to))){if(s.firstChild())continue;s.type.isAnonymous||(u=!0)}for(;u&&n&&n(s.type,s.from,s.to),u=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;u=!0}}}},{key:"balance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return this.children.length<=C?this:O(this.type,d.none,this.children,this.positions,0,this.children.length,0,t,this.length,0)}},{key:"topNode",get:function(){return new y(this,0,0,null)}}],[{key:"build",value:function(t){return M(t)}}]),t}();function g(t,e){return e&&(t.contextHash=e),t}p.empty=new p(d.none,[],[],0);var m=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.none;o(this,t),this.buffer=e,this.length=n,this.set=r,this.type=i}return s(t,[{key:"toString",value:function(){for(var t=[],e=0;e0){if(u>r&&(o=a),u>r)break}else if(s=r)break}else if(o=a,n>0)break;return o}}]),t}(),y=function(){function t(e,n,r,i){o(this,t),this.node=e,this.from=n,this.index=r,this._parent=i}return s(t,[{key:"nextChild",value:function(e,n,r){for(var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this;;){for(var a=o.node,s=a.children,u=a.positions,l=n>0?s.length:-1;e!=l;e+=n){var h=s[e],c=u[e]+o.from;if(-1e8==r||!(n<0?c>=r:c+h.length<=r))if(h instanceof m){var f=h.findChild(0,h.buffer.length,n,-1e8==r?-1e8:r-c);if(f>-1)return new w(new b(o,h,e,c),null,f)}else if(i||!h.type.isAnonymous||x(h)){var d=new t(h,c,e,o);return i||!d.type.isAnonymous?d:d.nextChild(n<0?h.children.length-1:0,n,r)}}if(i||!o.type.isAnonymous)return null;if(e=o.index+n,!(o=o._parent))return null}}},{key:"childAfter",value:function(t){return this.nextChild(0,1,t)}},{key:"childBefore",value:function(t){return this.nextChild(this.node.children.length-1,-1,t)}},{key:"nextSignificantParent",value:function(){for(var t=this;t.type.isAnonymous&&t._parent;)t=t._parent;return t}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,t,e,n)}},{key:"toString",value:function(){return this.node.toString()}},{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"to",get:function(){return this.from+this.node.length}},{key:"firstChild",get:function(){return this.nextChild(0,1,-1e8)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,-1e8)}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent?this._parent.nextChild(this.index+1,1,-1):null}},{key:"prevSibling",get:function(){return this._parent?this._parent.nextChild(this.index-1,-1,-1):null}},{key:"cursor",get:function(){return new S(this)}}]),t}();function k(t,e,n,r){var i=t.cursor,o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var b=function t(e,n,r,i){o(this,t),this.parent=e,this.buffer=n,this.index=r,this.start=i},w=function(){function t(e,n,r){o(this,t),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}return s(t,[{key:"child",value:function(e,n){var r=this.context.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,-1e8==n?-1e8:n-this.context.start);return i<0?null:new t(this.context,this,i)}},{key:"childAfter",value:function(t){return this.child(1,t)}},{key:"childBefore",value:function(t){return this.child(-1,t)}},{key:"externalSibling",value:function(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,-1)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,t,e,n)}},{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"firstChild",get:function(){return this.child(1,-1e8)}},{key:"lastChild",get:function(){return this.child(-1,-1e8)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"nextSibling",get:function(){var e=this.context.buffer,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var e=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,-1e8))}},{key:"cursor",get:function(){return new S(this)}}]),t}(),S=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(this,t),this.full=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof y)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(var r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}return s(t,[{key:"yieldNode",value:function(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}},{key:"yieldBuf",value:function(t,e){this.index=t;var n=this.buffer,r=n.start,i=n.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}},{key:"yield",value:function(t){return!!t&&(t instanceof y?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enter",value:function(t,e){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree.node.children.length-1:0,t,e,this.full));var n=this.buffer.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,-1e8==e?-1e8:e-this.buffer.start);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}},{key:"firstChild",value:function(){return this.enter(1,-1e8)}},{key:"lastChild",value:function(){return this.enter(-1,-1e8)}},{key:"childAfter",value:function(t){return this.enter(1,t)}},{key:"childBefore",value:function(t){return this.enter(-1,t)}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(this.full?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=this.full?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}},{key:"sibling",value:function(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree._parent.nextChild(this._tree.index+t,t,-1e8,this.full));var e=this.buffer.buffer,n=this.stack.length-1;if(t<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(e.findChild(r,this.index,-1,-1e8))}else{var i=e.buffer[this.index+3];if(i<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,-1e8,this.full))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(t){var e,n,r=this.buffer;if(r){if(t>0){if(this.index1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(var o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;e=o,n=i+1;break t}r=this.stack[--i]}for(var a=n;al;)if(n.id!=e){var h=n.size,c=n.pos-h;if(h<0||c=f?4:0,p=n.start;for(n.next();n.pos>c;){if(n.size<0)break t;n.id>=f&&(d+=4),n.next()}i=p,r+=h,o+=d}else u.size=r,u.start=i,u.skip=o,o+=4,r+=4,n.next();(e<0||r==t)&&(u.size=r,u.start=i,u.skip=o);return u.size>4?u:void 0}(v.pos-e,o))){for(var T=new Uint16Array(A.size-A.skip),D=v.pos-A.size,E=T.length;v.pos>D;)E=w(A.start,T,E,o);x=new m(T,l-A.start,r,o<0?d.none:y[o]),S=A.start-t}else{var P=v.pos-c;v.next();for(var R=[],B=[],L=a>=f?a:-1;v.pos>P;)v.id==L?v.next():b(u,P,R,B,L);R.reverse(),B.reverse(),x=L>-1&&R.length>C?O(M,M,R,B,0,R.length,0,s,l-u,k):g(new p(M,R,B,l-u),k)}n.push(x),i.push(S)}function w(t,e,n,r){var i=v.id,o=v.start,a=v.end,s=v.size;if(v.next(),i==r)return n;var u=n;if(s>4)for(var l=v.pos-(s-4);v.pos>l;)n=w(t,e,n,r);return i0;)b(t.start||0,0,S,x,-1);var M=null!==(e=t.length)&&void 0!==e?e:S.length?x[0]+S[0].length:0;return new p(y[o],S.reverse(),x.reverse(),M)}function O(t,e,n,r,i,o,a,s,u,l){var h=[],c=[];if(u<=s)for(var f=i;fv)break}if(m==y+1){var b=n[y];if(b instanceof p&&b.type==e&&b.length>v<<1){for(var w=0;w0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"applyChanges",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return e;for(var i=[],o=1,a=e.length?e[0]:null,s=0,u=0,l=0;;){var h=s=r)for(;a&&a.from=f.from||c<=f.to||l){var d=Math.max(f.from,u)-l,v=Math.min(f.to,c)-l;f=d>=v?null:new t(d,v,f.tree,f.offset+l,(s>0?1:0)|(h?2:0))}if(f&&i.push(f),a.to>c)break;a=o1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[new t(0,e.length,e,0,o?2:0)],s=r(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.to>e.length&&a.push(u)}}catch(l){s.e(l)}finally{s.f()}return a}}]),t}()},62038:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),e)for(var s=0;s","\n "]);return E=function(){return e},e}function _(){var e=O(["\n \n ","\n \n "]);return _=function(){return e},e}function P(){var e=O(['
',"
"]);return P=function(){return e},e}function x(){var e=O(["\n \n ',"\n\n \n \n \n \n
\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n "]);return X=function(){return e},e}function Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(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 r,n=ne(e);if(t){var i=ne(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return te(this,r)}}function te(e,t){return!t||"object"!==Q(t)&&"function"!=typeof t?re(e):t}function re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(){ie=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!se(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r',": ",""]);return he=function(){return e},e}function me(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){return(ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function be(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 r,n=je(e);if(t){var i=je(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ge(this,r)}}function ge(e,t){return!t||"object"!==fe(t)&&"function"!=typeof t?we(e):t}function we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ke(){ke=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Pe(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r',"\n \n "]);return ze=function(){return e},e}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Re(e,t){return(Re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fe(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 r,n=Be(e);if(t){var i=Be(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ie(this,r)}}function Ie(e,t){return!t||"object"!==Ae(t)&&"function"!=typeof t?Me(e):t}function Me(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Be(e){return(Be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $e(){$e=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Le(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r .slider-knob > .slider-knob-inner::after {\n -webkit-transform: scale(1) translate(0, -17px) scaleX(-1) !important;\n transform: scale(1) translate(0, -17px) scaleX(-1) !important;\n }\n\n .pin > .slider-knob > .slider-knob-inner {\n font-size: var(--ha-slider-pin-font-size, 10px);\n line-height: normal;\n cursor: pointer;\n }\n\n .disabled.ring > .slider-knob > .slider-knob-inner {\n background-color: var(--paper-slider-disabled-knob-color, var(--paper-grey-400));\n border: 2px solid var(--paper-slider-disabled-knob-color, var(--paper-grey-400));\n }\n\n .pin > .slider-knob > .slider-knob-inner::before {\n top: unset;\n margin-left: unset;\n\n bottom: calc(15px + var(--calculated-paper-slider-height)/2);\n left: 50%;\n width: 2.2em;\n height: 2.2em;\n\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n -webkit-transform: rotate(-45deg) scale(0) translate(0);\n transform: rotate(-45deg) scale(0) translate(0);\n }\n\n .pin.expand > .slider-knob > .slider-knob-inner::before {\n -webkit-transform: rotate(-45deg) scale(1) translate(7px, -7px);\n transform: rotate(-45deg) scale(1) translate(7px, -7px);\n }\n\n .pin > .slider-knob > .slider-knob-inner::after {\n top: unset;\n font-size: unset;\n\n bottom: calc(15px + var(--calculated-paper-slider-height)/2);\n left: 50%;\n margin-left: -1.1em;\n width: 2.2em;\n height: 2.1em;\n\n -webkit-transform-origin: center bottom;\n transform-origin: center bottom;\n -webkit-transform: scale(0) translate(0);\n transform: scale(0) translate(0);\n }\n\n .pin.expand > .slider-knob > .slider-knob-inner::after {\n -webkit-transform: scale(1) translate(0, -10px);\n transform: scale(1) translate(0, -10px);\n }\n\n .slider-input {\n width: 54px;\n }\n ')),tt}}],(r=[{key:"_setImmediateValue",value:function(e){Xe(et(o.prototype),"_setImmediateValue",this).call(this,this.step>=1?Math.round(e):Math.round(100*e)/100)}},{key:"_calcStep",value:function(e){if(!this.step)return parseFloat(e);var t=Math.round((e-this.min)/this.step),r=this.step.toString(),n=r.indexOf(".");if(-1!==n){var i=Math.pow(10,r.length-n-1);return Math.round((t*this.step+this.min)*i)/i}return t*this.step+this.min}}])&&We(t.prototype,r),n&&We(t,n),o}(rt);function it(e){return(it="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 ot(){var e=lt(["\n .flex {\n display: flex;\n }\n ha-slider {\n width: 100%;\n margin-right: 16px;\n }\n "]);return ot=function(){return e},e}function at(){var e=lt(['\n \n ',"\n \n
\n \n "]);return ct=function(){return e},e}function lt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dt(e,t){return(dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ft(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 r,n=mt(e);if(t){var i=mt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pt(this,r)}}function pt(e,t){return!t||"object"!==it(t)&&"function"!=typeof t?ht(e):t}function ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yt(){yt=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!gt(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n \n ',"\n \n "]);return Ot=function(){return e},e}function St(){var e=Ct(['\n \n \n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n :host {\n display: block;\n @apply --paper-font-common-base;\n }\n\n paper-input {\n width: 30px;\n text-align: center;\n --paper-input-container-input: {\n /* Damn you firefox\n * Needed to hide spin num in firefox\n * http://stackoverflow.com/questions/3790935/can-i-hide-the-html5-number-input-s-spin-box\n */\n -moz-appearance: textfield;\n @apply --paper-time-input-cotnainer;\n }\n --paper-input-container-input-webkit-spinner: {\n -webkit-appearance: none;\n margin: 0;\n display: none;\n }\n --paper-input-container-shared-input-style_-_-webkit-appearance: textfield;\n }\n\n paper-dropdown-menu {\n width: 55px;\n padding: 0;\n /* Force ripple to use the whole container */\n --paper-dropdown-menu-ripple: {\n color: var(\n --paper-time-input-dropdown-ripple-color,\n var(--primary-color)\n );\n }\n --paper-input-container-input: {\n @apply --paper-font-button;\n text-align: center;\n padding-left: 5px;\n @apply --paper-time-dropdown-input-cotnainer;\n }\n --paper-input-container-underline: {\n border-color: transparent;\n }\n --paper-input-container-underline-focus: {\n border-color: transparent;\n }\n }\n\n paper-item {\n cursor: pointer;\n text-align: center;\n font-size: 14px;\n }\n\n paper-listbox {\n padding: 0;\n }\n\n label {\n @apply --paper-font-caption;\n color: var(\n --paper-input-container-color,\n var(--secondary-text-color)\n );\n }\n\n .time-input-wrap {\n @apply --layout-horizontal;\n @apply --layout-no-wrap;\n justify-content: var(--paper-time-input-justify-content, normal);\n }\n\n [hidden] {\n display: none !important;\n }\n\n #millisec {\n width: 38px;\n }\n\n .no-suffix {\n margin-left: -2px;\n }\n \n\n \n
\n \x3c!-- Hour Input --\x3e\n \n :\n \n\n \x3c!-- Min Input --\x3e\n \n :\n \n\n \x3c!-- Sec Input --\x3e\n \n :\n \n\n \x3c!-- Millisec Input --\x3e\n \n \n\n \x3c!-- Dropdown Menu --\x3e\n \n \n AM\n PM\n \n \n
\n ']);return Ht=function(){return e},e}function Yt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kt(e,t){for(var r=0;r\n ']);return tr=function(){return e},e}function rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nr(e,t){return(nr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ir(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 r,n=sr(e);if(t){var i=sr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return or(this,r)}}function or(e,t){return!t||"object"!==Jt(t)&&"function"!=typeof t?ar(e):t}function ar(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sr(e){return(sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cr(){cr=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!dr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r59&&(i+=Math.floor(r/60),r%=60),"minutes"===t&&r>59&&(n+=Math.floor(r/60),r%=60),(0,a.B)(this,"value-changed",{value:Object.assign({hours:n,minutes:i,seconds:this._seconds,milliseconds:this._milliseconds},er({},t,r))})}}}]}}),i.oi);function yr(e){return(yr="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 vr(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n \n "]);return vr=function(){return e},e}function br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wr(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 r,n=_r(e);if(t){var i=_r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kr(this,r)}}function kr(e,t){return!t||"object"!==yr(t)&&"function"!=typeof t?Er(e):t}function Er(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _r(e){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pr(){Pr=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Sr(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n "]);return Vr=function(){return e},e}function qr(){var e=Hr(["\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ',"\n \n "]);return Cn=function(){return e},e}function Dn(){var e=Tn(["\n ","\n ","\n "]);return Dn=function(){return e},e}function jn(){var e=Tn(["\n \n "]);return jn=function(){return e},e}function An(){var e=Tn(['\n
\n ',"\n
\n "]);return An=function(){return e},e}function zn(){var e=Tn(["\n ","\n ","\n "]);return zn=function(){return e},e}function Tn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function In(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 r,n=$n(e);if(t){var i=$n(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Mn(this,r)}}function Mn(e,t){return!t||"object"!==On(t)&&"function"!=typeof t?Bn(e):t}function Bn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Nn(){Nn=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Vn(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n :host(.error-state) div.cm-wrap .cm-gutters {\n border-color: var(--error-state-color, red);\n }\n ",r=document.createElement("span"),t.appendChild(r),this.codemirror=new this._loadedCodeMirror.EditorView({state:this._loadedCodeMirror.EditorState.create({doc:this._value,extensions:[this._loadedCodeMirror.lineNumbers(),this._loadedCodeMirror.EditorState.allowMultipleSelections.of(!0),this._loadedCodeMirror.history(),this._loadedCodeMirror.highlightSelectionMatches(),this._loadedCodeMirror.highlightActiveLine(),this._loadedCodeMirror.drawSelection(),this._loadedCodeMirror.rectangularSelection(),this._loadedCodeMirror.keymap.of([].concat(Jn(this._loadedCodeMirror.defaultKeymap),Jn(this._loadedCodeMirror.searchKeymap),Jn(this._loadedCodeMirror.historyKeymap),Jn(this._loadedCodeMirror.tabKeyBindings),[bi])),this._loadedCodeMirror.langCompartment.of(this._mode),this._loadedCodeMirror.theme,this._loadedCodeMirror.Prec.fallback(this._loadedCodeMirror.highlightStyle),this._loadedCodeMirror.readonlyCompartment.of(this._loadedCodeMirror.EditorView.editable.of(!this.readOnly)),this._loadedCodeMirror.EditorView.updateListener.of((function(e){return n._onUpdate(e)}))]}),root:t,parent:r});case 8:case"end":return e.stop()}}),e,this)})),n=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){ei(o,n,i,a,s,"next",e)}function s(e){ei(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return n.apply(this,arguments)})},{kind:"method",key:"_blockKeyboardShortcuts",value:function(){this.addEventListener("keydown",(function(e){return e.stopPropagation()}))}},{kind:"method",key:"_onUpdate",value:function(e){if(e.docChanged){var t=this.value;t!==this._value&&(this._value=t,(0,a.B)(this,"value-changed",{value:this._value}))}}}]}}),i.f4);function gi(){var e=Ei(["

","

"]);return gi=function(){return e},e}function wi(){var e=Ei(["\n ","\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ',"\n \n "]);return Vi=function(){return e},e}function qi(){var e=Qi(['
',"
"]);return qi=function(){return e},e}function Hi(){var e=Qi([" "]);return Hi=function(){return e},e}function Yi(){var e=Qi([""]);return Yi=function(){return e},e}function Ki(){var e=Qi(["\n

",'

\n \n
\n

\n ','\n

\n
\n \n \n \n \n ','\n \n \n
\n
\n\n
\n ',"\n ","\n ","\n
\n ",'\n
\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r\n ","\n \n ',"
"]);return vo=function(){return e},e}function bo(){var e=wo(["\n \n ',"\n\n \n \n \n \n \n \n \n ",'\n \n
\n ","\n \n ","\n \n ","\n
\n \n
\n =0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);rt.container?1:-1}))}},{kind:"method",key:"_configChanged",value:(o=mo(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.target,this._config.forEach((function(e){e.container===r.container&&e.host!==parseInt(String(r.value),10)&&(e.host=r.value?parseInt(String(r.value),10):null)}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{kind:"method",key:"_resetTapped",value:(n=mo(regeneratorRuntime.mark((function e(t){var r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,n={network:null},e.prev=3,e.next=6,(0,l.d3)(this.hass,this.addon.slug,n);case 6:if(o={success:!0,response:void 0,path:"option"},(0,a.B)(this,"hass-api-called",o),"started"!==(null===(i=this.addon)||void 0===i?void 0:i.state)){e.next=11;break}return e.next=11,y(this,this.hass,this.supervisor,this.addon);case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),this._error=this.supervisor.localize("addon.failed_to_reset","error",(0,u.js)(e.t0));case 16:r.progress=!1;case 17:case"end":return e.stop()}}),e,this,[[3,13]])}))),function(e){return n.apply(this,arguments)})},{kind:"method",key:"_saveTapped",value:(r=mo(regeneratorRuntime.mark((function e(t){var r,n,i,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=t.currentTarget).progress=!0,this._error=void 0,n={},this._config.forEach((function(e){n[e.container]=parseInt(String(e.host),10)})),i={network:n},e.prev=6,e.next=9,(0,l.d3)(this.hass,this.addon.slug,i);case 9:if(s={success:!0,response:void 0,path:"option"},(0,a.B)(this,"hass-api-called",s),"started"!==(null===(o=this.addon)||void 0===o?void 0:o.state)){e.next=14;break}return e.next=14,y(this,this.hass,this.supervisor,this.addon);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),this._error=this.supervisor.localize("addon.failed_to_save","error",(0,u.js)(e.t0));case 19:r.progress=!1;case 20:case"end":return e.stop()}}),e,this,[[6,16]])}))),function(e){return r.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,f.l,(0,i.iv)(po())]}}]}}),i.oi);var Io=r(18199);function Mo(e){return(Mo="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 Bo(){var e=Ho(["\n .content {\n margin: auto;\n padding: 8px;\n max-width: 1024px;\n }\n hassio-addon-network,\n hassio-addon-audio,\n hassio-addon-config {\n margin-bottom: 24px;\n }\n "]);return Bo=function(){return e},e}function $o(){var e=Ho(["\n \n "]);return $o=function(){return e},e}function No(){var e=Ho(["\n \n "]);return No=function(){return e},e}function Uo(){var e=Ho(["\n \n "]);return Uo=function(){return e},e}function Lo(){var e=Ho(["\n ","\n ","\n ","\n "]);return Lo=function(){return e},e}function Vo(){var e=Ho(['\n
\n ',"\n
\n "]);return Vo=function(){return e},e}function qo(){var e=Ho([""]);return qo=function(){return e},e}function Ho(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ko(e,t){return(Ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qo(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 r,n=Zo(e);if(t){var i=Zo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wo(this,r)}}function Wo(e,t){return!t||"object"!==Mo(t)&&"function"!=typeof t?Xo(e):t}function Xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zo(e){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Go(){Go=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ta(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r"]);return ca=function(){return e},e}function la(){var e=pa([""]);return la=function(){return e},e}function ua(){var e=pa(['
',"
"]);return ua=function(){return e},e}function da(){var e=pa(['\n
\n \n ','\n
\n ',"\n
\n
\n
\n "]);return da=function(){return e},e}function fa(){var e=pa([""]);return fa=function(){return e},e}function pa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ha(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function ma(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){ha(o,n,i,a,s,"next",e)}function s(e){ha(o,n,i,a,s,"throw",e)}a(void 0)}))}}function ya(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function va(e,t){return(va=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ba(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 r,n=ja(e);if(t){var i=ja(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ga(this,r)}}function ga(e,t){return!t||"object"!==aa(t)&&"function"!=typeof t?wa(e):t}function wa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ka(){ka=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Pa(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r
\n "]);return Ia=function(){return e},e}function Ma(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ba(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $a(e,t){return($a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Na(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 r,n=Va(e);if(t){var i=Va(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ua(this,r)}}function Ua(e,t){return!t||"object"!==Ta(t)&&"function"!=typeof t?La(e):t}function La(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Va(e){return(Va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qa(){qa=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Ka(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r bit more top margin */\n font-weight: 500;\n overflow: hidden;\n text-transform: uppercase;\n text-overflow: ellipsis;\n transition: background-color 0.3s ease-in-out;\n text-transform: var(--ha-label-badge-label-text-transform, uppercase);\n }\n .label-badge .label.big span {\n font-size: 90%;\n padding: 10% 12% 7% 12%; /* push smaller text a bit down to center vertically */\n }\n .badge-container .title {\n margin-top: 1em;\n font-size: var(--ha-label-badge-title-font-size, 0.9em);\n width: var(--ha-label-badge-title-width, 5em);\n font-weight: var(--ha-label-badge-title-font-weight, 400);\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n }\n "]);return es=function(){return e},e}function ts(){var e=as(['
',"
"]);return ts=function(){return e},e}function rs(){var e=as(['\n \n ',"\n
\n "]);return rs=function(){return e},e}function ns(){var e=as([" "," "]);return ns=function(){return e},e}function is(){var e=as([" "]);return is=function(){return e},e}function os(){var e=as(['\n
\n
\n \n \n ',"\n ","\n \n
\n ","\n
\n ","\n \n "]);return os=function(){return e},e}function as(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ss(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cs(e,t){return(cs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ls(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 r,n=ks(e);if(t){var i=ks(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return us(this,r)}}function us(e,t){return!t||"object"!==Ja(t)&&"function"!=typeof t?ds(e):t}function ds(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fs(){fs=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ms(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r4)}),!this.icon||this.value||this.image?"":(0,i.dy)(is(),this.icon),this.value&&!this.image?(0,i.dy)(ns(),this.value):"",this.label?(0,i.dy)(rs(),(0,Aa.$)({label:!0,big:this.label.length>5}),this.label):"",this.description?(0,i.dy)(ts(),this.description):"")}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,i.iv)(es())]}},{kind:"method",key:"updated",value:function(e){ws(ks(r.prototype),"updated",this).call(this,e),e.has("image")&&(this.shadowRoot.getElementById("badge").style.backgroundImage=this.image?"url(".concat(this.image,")"):"")}}]}}),i.oi);customElements.define("ha-label-badge",Es);r(14089);var _s=r(70203),Ps=(r(79603),r(21050),r(66903)),xs=r(7628),Os=(0,o.Z)((function(e,t){return t.some((function(t){return e.includes(t)}))}));function Ss(e){return(Ss="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 Cs(){var e=gc(['\n :host {\n display: block;\n }\n ha-card {\n display: block;\n margin-bottom: 16px;\n }\n ha-card.warning {\n background-color: var(--error-color);\n color: white;\n }\n ha-card.warning .card-header {\n color: white;\n }\n ha-card.warning .card-content {\n color: white;\n }\n ha-card.warning mwc-button {\n --mdc-theme-primary: white !important;\n }\n .warning {\n color: var(--error-color);\n --mdc-theme-primary: var(--error-color);\n }\n .light-color {\n color: var(--secondary-text-color);\n }\n .addon-header {\n padding-left: 8px;\n font-size: 24px;\n color: var(--ha-card-header-color, --primary-text-color);\n }\n .addon-version {\n float: right;\n font-size: 15px;\n vertical-align: middle;\n }\n .errors {\n color: var(--error-color);\n margin-bottom: 16px;\n }\n .description {\n margin-bottom: 16px;\n }\n img.logo {\n max-height: 60px;\n margin: 16px 0;\n display: block;\n }\n\n ha-switch {\n display: flex;\n }\n ha-svg-icon.running {\n color: var(--paper-green-400);\n }\n ha-svg-icon.stopped {\n color: var(--google-red-300);\n }\n ha-call-api-button {\n font-weight: 500;\n color: var(--primary-color);\n }\n protection-enable mwc-button {\n --mdc-theme-primary: white;\n }\n .description a {\n color: var(--primary-color);\n }\n .red {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n .blue {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n .green {\n --ha-label-badge-color: var(--label-badge-green, #0da035);\n }\n .yellow {\n --ha-label-badge-color: var(--label-badge-yellow, #f4b400);\n }\n .security {\n margin-bottom: 16px;\n }\n .card-actions {\n justify-content: space-between;\n display: flex;\n }\n .security h3 {\n margin-bottom: 8px;\n font-weight: normal;\n }\n .security ha-label-badge {\n cursor: pointer;\n margin-right: 4px;\n --ha-label-badge-padding: 8px 0 0 0;\n }\n .changelog {\n display: contents;\n }\n .changelog-link {\n color: var(--primary-color);\n text-decoration: underline;\n cursor: pointer;\n }\n ha-markdown {\n padding: 16px;\n }\n ha-settings-row {\n padding: 0;\n height: 54px;\n width: 100%;\n }\n ha-settings-row > span[slot="description"] {\n white-space: normal;\n color: var(--secondary-text-color);\n }\n ha-settings-row[three-line] {\n height: 74px;\n }\n\n .addon-options {\n max-width: 90%;\n }\n\n .addon-container {\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 60% 40%;\n }\n\n .addon-container > div:last-of-type {\n align-self: end;\n }\n\n @media (max-width: 720px) {\n .addon-options {\n max-width: 100%;\n }\n .addon-container {\n display: block;\n }\n }\n ']);return Cs=function(){return e},e}function Ds(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,i)}function js(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Ds(o,n,i,a,s,"next",e)}function s(e){Ds(o,n,i,a,s,"throw",e)}a(void 0)}))}}function As(){var e=gc(['\n \n
\n \n ',"\n \n "]);return zs=function(){return e},e}function Ts(){var e=gc(["\n \n ","\n \n "]);return Ts=function(){return e},e}function Rs(){var e=gc(["\n \n \n ',"\n \n \n "]);return Rs=function(){return e},e}function Fs(){var e=gc([" ","\n ",'\n \n \n ',"\n

\n "]);return $s=function(){return e},e}function Ns(){var e=gc(['\n

\n ',"\n

\n "]);return Ns=function(){return e},e}function Us(){var e=gc(['
',"
"]);return Us=function(){return e},e}function Ls(){var e=gc(["\n \n "]);return Ls=function(){return e},e}function Vs(){var e=gc(["\n ','\n \n \n ',"\n \n \n ",""]);return Vs=function(){return e},e}function qs(){var e=gc(["\n \n ','\n \n \n ',"\n \n \n \n "]);return qs=function(){return e},e}function Hs(){var e=gc(["\n \n ','\n \n \n ',"\n \n \n \n "]);return Hs=function(){return e},e}function Ys(){var e=gc(["\n \n ','\n \n \n ',"\n \n \n \n "]);return Ys=function(){return e},e}function Ks(){var e=gc(["\n \n ','\n \n \n ',"\n \n \n \n "]);return Ks=function(){return e},e}function Qs(){var e=gc(['\n \n \n \n ','\n \n \n ',"\n \n \n \n\n ","\n ","\n ","\n ","\n
\n "]);return Qs=function(){return e},e}function Ws(){var e=gc(["\n \n \n \n \n \n \n \n \n \n