From fe5e189ebc0bd751ed6ec95367d0345ac2007d11 Mon Sep 17 00:00:00 2001 From: gabek Date: Tue, 15 Nov 2022 00:36:28 +0000 Subject: [PATCH] Bundle embedded web app --- static/web/404.html | 4 ++-- static/web/404/index.html | 4 ++-- .../{1943-00ec23568327ea33.js => 1943-59cf60c8459758f9.js} | 2 +- .../{2069-45eeb5cd16bd7089.js => 2069-a148391615083e0c.js} | 2 +- ...82c5e-f4c5e1bb80225462.js => 4ad82c5e-fc50c092be65fd31.js} | 2 +- .../_buildManifest.js | 2 +- .../_ssgManifest.js | 0 static/web/admin/access-tokens/index.html | 2 +- static/web/admin/actions/index.html | 2 +- static/web/admin/chat/messages/index.html | 2 +- static/web/admin/chat/users/index.html | 2 +- static/web/admin/config-chat/index.html | 2 +- static/web/admin/config-federation/index.html | 2 +- static/web/admin/config-notify/index.html | 2 +- static/web/admin/config-public-details/index.html | 2 +- static/web/admin/config-server-details/index.html | 2 +- static/web/admin/config-social-items/index.html | 2 +- static/web/admin/config-storage/index.html | 2 +- static/web/admin/config-video/index.html | 2 +- static/web/admin/config/appearance/index.html | 2 +- static/web/admin/federation/actions/index.html | 2 +- static/web/admin/federation/followers/index.html | 2 +- static/web/admin/hardware-info/index.html | 2 +- static/web/admin/help/index.html | 2 +- static/web/admin/index.html | 2 +- static/web/admin/logs/index.html | 2 +- static/web/admin/stream-health/index.html | 2 +- static/web/admin/upgrade/index.html | 2 +- static/web/admin/viewer-info/index.html | 2 +- static/web/admin/webhooks/index.html | 2 +- static/web/embed/chat/readonly/index.html | 2 +- static/web/embed/chat/readwrite/index.html | 2 +- static/web/embed/video/index.html | 2 +- static/web/index.html | 4 ++-- 34 files changed, 36 insertions(+), 36 deletions(-) rename static/web/_next/static/chunks/{1943-00ec23568327ea33.js => 1943-59cf60c8459758f9.js} (65%) rename static/web/_next/static/chunks/{2069-45eeb5cd16bd7089.js => 2069-a148391615083e0c.js} (96%) rename static/web/_next/static/chunks/{4ad82c5e-f4c5e1bb80225462.js => 4ad82c5e-fc50c092be65fd31.js} (51%) rename static/web/_next/static/{mkGTx9lVMlIhwJiHQzE-9 => f7TnkO0yIOPf5jnSXGKBM}/_buildManifest.js (96%) rename static/web/_next/static/{mkGTx9lVMlIhwJiHQzE-9 => f7TnkO0yIOPf5jnSXGKBM}/_ssgManifest.js (100%) diff --git a/static/web/404.html b/static/web/404.html index 6dc0ec604..0b22e2960 100644 --- a/static/web/404.html +++ b/static/web/404.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/static/web/404/index.html b/static/web/404/index.html index 6dc0ec604..0b22e2960 100644 --- a/static/web/404/index.html +++ b/static/web/404/index.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/static/web/_next/static/chunks/1943-00ec23568327ea33.js b/static/web/_next/static/chunks/1943-59cf60c8459758f9.js similarity index 65% rename from static/web/_next/static/chunks/1943-00ec23568327ea33.js rename to static/web/_next/static/chunks/1943-59cf60c8459758f9.js index 984749635..69480267b 100644 --- a/static/web/_next/static/chunks/1943-00ec23568327ea33.js +++ b/static/web/_next/static/chunks/1943-59cf60c8459758f9.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1943],{58909:function(e,t,n){n.d(t,{F:function(){return o}});var i=n(35524),r=n(47421),s=n(59119),o=(e=>{var{theme:t,settings:n,styles:i}=e,o={"&":{backgroundColor:n.background,color:n.foreground},".cm-gutters":{}};n.gutterBackground&&(o[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(o[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(o[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(o[".cm-content"]={caretColor:n.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret}),n.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:n.lineHighlight},o[".cm-activeLineGutter"]={backgroundColor:n.lineHighlight}),n.selection&&(o["&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection"]={backgroundColor:n.selection}),n.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var l=r.tk.theme(o,{dark:"dark"===t}),a=s.Qf.define(i);return[l,(0,s.nF)(a)]})({theme:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#FBAC52",selection:"#FFD420",selectionMatch:"#FFD420",gutterBackground:"#f5f5f5",gutterForeground:"#4D4D4C",lineHighlight:"#00000012"},styles:[{tag:[i.pJ.meta,i.pJ.comment],color:"#804000"},{tag:[i.pJ.keyword,i.pJ.strong],color:"#0000FF"},{tag:[i.pJ.number],color:"#FF0080"},{tag:[i.pJ.string],color:"#FF0080"},{tag:[i.pJ.variableName],color:"#006600"},{tag:[i.pJ.escape],color:"#33CC33"},{tag:[i.pJ.tagName],color:"#1C02FF"},{tag:[i.pJ.heading],color:"#0C07FF"},{tag:[i.pJ.quote],color:"#000000"},{tag:[i.pJ.list],color:"#B90690"},{tag:[i.pJ.documentMeta],color:"#888888"},{tag:[i.pJ.function(i.pJ.variableName)],color:"#0000A2"},{tag:[i.pJ.definition(i.pJ.typeName),i.pJ.typeName],color:"#6D79DE"}]})},87685:function(e,t,n){n.d(t,{ZP:function(){return n_}});var i=n(87462),r=n(63366),s=n(67294),o=n(78120),l=n(47421),a=n(59119),h=n(41113);let c=e=>{let t=m(e.state);return t.line?f(e):!!t.block&&p(e)};function u(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}let f=u(function(e,t,n=t.selection.ranges){let i=[],r=-1;for(let{from:s,to:o}of n){let l=i.length,a=1e9;for(let h=s;h<=o;){let c=t.doc.lineAt(h);if(c.from>r&&(s==o||o>c.from)){r=c.from;let u=m(t,h).line;if(!u)continue;let f=/^\s*/.exec(c.text)[0].length,d=f==c.length,p=c.text.slice(f,f+u.length)==u?f:-1;fe.comment<0&&(!e.empty||e.single))){let k=[];for(let{line:y,token:v,indent:b,empty:x,single:O}of i)(O||!x)&&k.push({from:y.from+b,insert:v+" "});let w=t.changes(k);return{changes:w,selection:t.selection.map(w,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let S=[];for(let{line:Q,comment:P,token:C}of i)if(P>=0){let A=Q.from+P,T=A+C.length;" "==Q.text[T-Q.from]&&T++,S.push({from:A,to:T})}return{changes:S}}return null},0),d=u(g,0),p=u((e,t)=>g(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to),s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from,to:r.to})}return t}(t)),0);function m(e,t=e.selection.main.head){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function g(e,t,n=t.selection.ranges){let i=n.map(e=>m(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let s,o,l=e.sliceDoc(i-50,i),a=e.sliceDoc(r,r+50),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?s=o=e.sliceDoc(i,r):(s=e.sliceDoc(i,i+50),o=e.sliceDoc(r-50,r));let f=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-n.length;return s.slice(f,f+t.length)==t&&o.slice(p,p+n.length)==n?{open:{pos:i+f+t.length,margin:/\s/.test(s.charAt(f+t.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let s=[];for(let o=0,l;o(0,o.BO)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}),x=o.QQ.define({create:()=>M.empty,update(e,t){let n=t.state.facet(b),i=t.annotation(k);if(i){var r;let s;let l=t.docChanged?o.jT.single((r=t.changes,s=0,r.iterChangedRanges((e,t)=>s=t),s)):void 0,a=C.fromTransaction(t,l),h=i.side,c=0==h?e.undone:e.done;return c=a?A(c,c.length,n.minDepth,a):R(c,t.startState.selection),new M(0==h?i.rest:c,0==h?c:i.rest)}let u=t.annotation(y);if(("full"==u||"before"==u)&&(e=e.isolate()),!1===t.annotation(o.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let f=C.fromTransaction(t),d=t.annotation(o.YW.time),p=t.annotation(o.YW.userEvent);return f?e=e.addChanges(f,d,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,d,p,n.newGroupDelay)),("full"==u||"after"==u)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new M(e.done.map(C.fromJSON),e.undone.map(C.fromJSON))});function O(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(x,!1);if(!r)return!1;let s=r.pop(e,n,t);return!!s&&(i(s),!0)}}let w=O(0,!1),S=O(1,!1),Q=O(0,!0),P=O(1,!0);class C{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new C(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new C(e.changes&&o.as.fromJSON(e.changes),[],e.mapped&&o.n0.fromJSON(e.mapped),e.startSelection&&o.jT.fromJSON(e.startSelection),e.selectionsAfter.map(o.jT.fromJSON))}static fromTransaction(e,t){let n=I;for(let i of e.startState.facet(v)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new C(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,I)}static selection(e){return new C(void 0,I,void 0,void 0,e)}}function A(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function T(e,t){return e.length?t.length?e.concat(t):e:t}let I=[];function R(e,t){if(!e.length)return[C.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),A(e,e.length-1,1e9,n.setSelAfter(i)))}}function z(e,t){if(!e.length)return e;let n=e.length,i=I;for(;n;){let r=function(e,t,n){let i=T(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):I,n);if(!e.changes)return C.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(s):s;return new C(r,o.Py.mapEffects(e.effects,t),l,e.startSelection.map(s),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[C.selection(i)]:I}let D=/^(input\.type|delete)($|\.)/;class M{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new M(this.done,this.undone):this}addChanges(e,t,n,i,r){var s,o;let l,a,h=this.done,c=h[h.length-1];return h=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||D.test(n))&&(!c.selectionsAfter.length&&t-this.prevTimel.push(e,t)),o.iterChangedRanges((e,t,n,i)=>{for(let r=0;r=s&&n<=o&&(a=!0)}}),a)||"input.type.compose"==n)?A(h,h.length-1,r,new C(e.changes.compose(c.changes),T(e.effects,c.effects),c.mapped,c.startSelection,I)):A(h,h.length,r,e),new M(h,I,t,n)}addSelection(e,t,n,i){var r;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:I;return s.length>0&&t-this.prevTimet.empty!=e.ranges[n].empty).length?this:new M(R(this.done,e),this.undone,t,n)}addMapping(e){return new M(z(this.done,e),z(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1];if(n&&r.selectionsAfter.length){var s;let o,l;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:k.of({side:e,rest:(o=(s=i)[s.length-1],(l=s.slice())[s.length-1]=o.setSelAfter(o.selectionsAfter.slice(0,o.selectionsAfter.length-1)),l)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}if(!r.changes)return null;{let a=1==i.length?I:i.slice(0,i.length-1);return r.mapped&&(a=z(a,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:k.of({side:e,rest:a}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}M.empty=new M(I,I);let $=[{key:"Mod-z",run:w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:S,preventDefault:!0},{linux:"Ctrl-Shift-z",run:S,preventDefault:!0},{key:"Mod-u",run:Q,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:P,preventDefault:!0}];function N(e,t){return o.jT.create(e.ranges.map(t),e.mainIndex)}function E(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function W({state:e,dispatch:t},n){let i=N(e.selection,n);return!i.eq(e.selection)&&(t(E(e,i)),!0)}function B(e,t){return o.jT.cursor(t?e.to:e.from)}function J(e,t){return W(e,n=>n.empty?e.moveByChar(n,t):B(n,t))}function L(e){return e.textDirectionAt(e.state.selection.main.head)==l.Nm.LTR}let j=e=>J(e,!L(e)),_=e=>J(e,L(e));function F(e,t){return W(e,n=>n.empty?e.moveByGroup(n,t):B(n,t))}let q=e=>F(e,!L(e)),U=e=>F(e,L(e));function X(e,t,n){let i,r,s=(0,a.qz)(e).resolveInner(t.head),l=n?h.md.closedBy:h.md.openedBy;for(let c=t.head;;){let u=n?s.childAfter(c):s.childBefore(c);if(!u)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,u,l)?c=n?u.to:u.from:s=u}return r=s.type.prop(l)&&(i=n?(0,a.Um)(e,s.from,1):(0,a.Um)(e,s.to,-1))&&i.matched?n?i.end.to:i.end.from:n?s.to:s.from,o.jT.cursor(r,n?-1:1)}let V=e=>W(e,t=>X(e.state,t,!L(e))),Z=e=>W(e,t=>X(e.state,t,L(e)));function G(e,t){return W(e,n=>{if(!n.empty)return B(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}let Y=e=>G(e,!1),H=e=>G(e,!0);function K(e){return Math.max(e.defaultLineHeight,Math.min(e.dom.clientHeight,innerHeight)-5)}function ee(e,t){let n,{state:i}=e,r=N(i.selection,n=>n.empty?e.moveVertically(n,t,K(e)):B(n,t));if(r.eq(i.selection))return!1;let s=e.coordsAtPos(i.selection.main.head),o=e.scrollDOM.getBoundingClientRect();return s&&s.top>o.top&&s.bottomee(e,!1),en=e=>ee(e,!0);function ei(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=o.jT.cursor(i.from+s))}return r}let er=e=>W(e,t=>ei(e,t,!0)),es=e=>W(e,t=>ei(e,t,!1)),eo=e=>W(e,t=>ei(e,t,!L(e))),el=e=>W(e,t=>ei(e,t,L(e))),ea=e=>W(e,t=>o.jT.cursor(e.lineBlockAt(t.head).from,1)),eh=e=>W(e,t=>o.jT.cursor(e.lineBlockAt(t.head).to,-1)),ec=({state:e,dispatch:t})=>{let n,i;return n=!1,i=N(e.selection,t=>{let i=(0,a.Um)(e,t.head,-1)||(0,a.Um)(e,t.head,1)||t.head>0&&(0,a.Um)(e,t.head-1,1)||t.head{let n=t(e);return o.jT.range(e.anchor,n.head,n.goalColumn)});return!n.eq(e.state.selection)&&(e.dispatch(E(e.state,n)),!0)}function ef(e,t){return eu(e,n=>e.moveByChar(n,t))}let ed=e=>ef(e,!L(e)),ep=e=>ef(e,L(e));function em(e,t){return eu(e,n=>e.moveByGroup(n,t))}let eg=e=>em(e,!L(e)),ek=e=>em(e,L(e)),ey=e=>eu(e,t=>X(e.state,t,!L(e))),ev=e=>eu(e,t=>X(e.state,t,L(e)));function eb(e,t){return eu(e,n=>e.moveVertically(n,t))}let ex=e=>eb(e,!1),eO=e=>eb(e,!0);function ew(e,t){return eu(e,n=>e.moveVertically(n,t,K(e)))}let eS=e=>ew(e,!1),eQ=e=>ew(e,!0),eP=e=>eu(e,t=>ei(e,t,!0)),eC=e=>eu(e,t=>ei(e,t,!1)),eA=e=>eu(e,t=>ei(e,t,!L(e))),eT=e=>eu(e,t=>ei(e,t,L(e))),eI=e=>eu(e,t=>o.jT.cursor(e.lineBlockAt(t.head).from)),eR=e=>eu(e,t=>o.jT.cursor(e.lineBlockAt(t.head).to)),ez=({state:e,dispatch:t})=>(t(E(e,{anchor:0})),!0),eD=({state:e,dispatch:t})=>(t(E(e,{anchor:e.doc.length})),!0),eM=({state:e,dispatch:t})=>(t(E(e,{anchor:e.selection.main.anchor,head:0})),!0),e$=({state:e,dispatch:t})=>(t(E(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),eN=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),eE=({state:e,dispatch:t})=>{let n=eH(e).map(({from:t,to:n})=>o.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:o.jT.create(n),userEvent:"select"})),!0},eW=({state:e,dispatch:t})=>{let n=N(e.selection,t=>{var n;let i=(0,a.qz)(e).resolveInner(t.head,1);for(;!(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 o.jT.range(i.to,i.from)});return t(E(e,n)),!0},eB=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=o.jT.create([n.main]):n.main.empty||(i=o.jT.create([o.jT.cursor(n.main.head)])),!!i&&(t(E(e,i)),!0)};function eJ(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:s}=i;if(r==s){let l=t(r);lr&&(n="delete.forward",l=eL(e,l,!0)),r=Math.min(r,l),s=Math.max(s,l)}else r=eL(e,r,!1),s=eL(e,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.jT.cursor(r)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?l.tk.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function eL(e,t,n){if(e instanceof l.tk)for(let i of e.state.facet(l.tk.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{et&&(t=n?i:e)});return t}let ej=(e,t)=>eJ(e,n=>{let{state:i}=e,r=i.doc.lineAt(n),s,l;if(!t&&n>r.from&&nej(e,!1),eF=e=>ej(e,!0),eq=(e,t)=>eJ(e,n=>{let i=n,{state:r}=e,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let a=null;;){if(i==(t?s.to:s.from)){i==n&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let h=(0,o.cp)(s.text,i-s.from,t)+s.from,c=s.text.slice(Math.min(i,h)-s.from,Math.max(i,h)-s.from),u=l(c);if(null!=a&&u!=a)break;(" "!=c||i!=n)&&(a=u),i=h}return i}),eU=e=>eq(e,!1),eX=e=>eq(e,!0),eV=e=>eJ(e,t=>{let n=e.lineBlockAt(t).to;return teJ(e,t=>{let n=e.lineBlockAt(t).from;return t>n?n:Math.max(0,t-1)}),eG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:o.xv.of(["",""])},range:o.jT.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},eY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,o.cp)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.cp)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(r,n))},range:o.jT.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function eH(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(i.empty||i.to!=s.from||(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function eK(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of eH(e)){if(n?s.to==e.doc.length:0==s.from)continue;let l=e.doc.lineAt(n?s.to+1:s.from-1),a=l.length+1;if(n)for(let h of(i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+e.lineBreak}),s.ranges))r.push(o.jT.range(Math.min(e.doc.length,h.anchor+a),Math.min(e.doc.length,h.head+a)));else for(let c of(i.push({from:l.from,to:s.from},{from:s.to,insert:e.lineBreak+l.text}),s.ranges))r.push(o.jT.range(c.anchor-a,c.head-a))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:o.jT.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}let e0=({state:e,dispatch:t})=>eK(e,t,!1),e1=({state:e,dispatch:t})=>eK(e,t,!0);function e2(e,t,n){if(e.readOnly)return!1;let i=[];for(let r of eH(e))n?i.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):i.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let e5=({state:e,dispatch:t})=>e2(e,t,!1),e3=({state:e,dispatch:t})=>e2(e,t,!0),e4=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(eH(t).map(({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0)).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0},e9=e8(!1),e6=e8(!0);function e8(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,s=t.doc.lineAt(i),l=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,a.qz)(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(h.md.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=s.to?s:t.doc.lineAt(r)).to);let c=new a.Gn(t,{simulateBreak:i,simulateDoubleBreak:!!l}),u=(0,a.K0)(c,i);for(null==u&&(u=/^\s*/.exec(t.doc.lineAt(i).text)[0].length);rs.from&&i{let r=[];for(let s=i.from;s<=i.to;){let l=e.doc.lineAt(s);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),s=l.to+1}let a=e.changes(r);return{changes:r,range:o.jT.range(a.mapPos(i.anchor,1),a.mapPos(i.head,1))}})}let te=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new a.Gn(e,{overrideIndentation(e){let t=n[e];return null==t?-1:t}}),r=e7(e,(t,r,s)=>{let o=(0,a.K0)(i,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let l=/^\s*/.exec(t.text)[0],h=(0,a.SS)(e,o);(l!=h||s.from!e.readOnly&&(t(e.update(e7(e,(t,n)=>{n.push({from:t.from,insert:e.facet(a.c)})}),{userEvent:"input.indent"})),!0),tn=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(e7(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=(0,o.IS)(i,e.tabSize),s=0,l=(0,a.SS)(e,Math.max(0,r-(0,a.y1)(e)));for(;s({mac:e.key,run:e.run,shift:e.shift}))),tr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:V,shift:ey},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Z,shift:ev},{key:"Alt-ArrowUp",run:e0},{key:"Shift-Alt-ArrowUp",run:e5},{key:"Alt-ArrowDown",run:e1},{key:"Shift-Alt-ArrowDown",run:e3},{key:"Escape",run:eB},{key:"Mod-Enter",run:e6},{key:"Alt-l",mac:"Ctrl-l",run:eE},{key:"Mod-i",run:eW,preventDefault:!0},{key:"Mod-[",run:tn},{key:"Mod-]",run:tt},{key:"Mod-Alt-\\",run:te},{key:"Shift-Mod-k",run:e4},{key:"Shift-Mod-\\",run:ec},{key:"Mod-/",run:c},{key:"Alt-A",run:d}].concat(ti),ts={key:"Tab",run:tt,shift:tn};function to(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;te.normalize("NFKD"):e=>e;class ta{constructor(e,t,n=0,i=e.length,r,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(tl(e)):tl,this.query=this.normalize(t)}peek(){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,o.gm)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,o.bg)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,o.nZ)(e);let i=this.normalize(t);for(let r=0,s=n;;r++){let l=i.charCodeAt(r),a=this.match(l,s);if(a)return this.value=a,this;if(r==i.length-1)break;s==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=tm(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||i.to<=t){let r=new td(t,e.sliceString(t,n));return tf.set(e,r),r}if(i.from==t&&i.to==n)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,i=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this.matchPos=tm(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=td.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function tm(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}function tg(e){let t=to("input",{class:"cm-textfield",name:"line"}),n=to("form",{class:"cm-gotoLine",onkeydown(t){27==t.keyCode?(t.preventDefault(),e.dispatch({effects:tk.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),i())},onsubmit(e){e.preventDefault(),i()}},to("label",e.state.phrase("Go to line"),": ",t)," ",to("button",{class:"cm-button",type:"submit"},e.state.phrase("go")));function i(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:i}=e,r=i.doc.lineAt(i.selection.main.head),[,s,l,a,h]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&h){let f=u/100;s&&(f=f*("-"==s?-1:1)+r.number/i.doc.lines),u=Math.round(i.doc.lines*f)}else l&&s&&(u=u*("-"==s?-1:1)+r.number);let d=i.doc.line(Math.max(1,Math.min(i.doc.lines,u)));e.dispatch({effects:tk.of(!1),selection:o.jT.cursor(d.from+Math.max(0,Math.min(c,d.length))),scrollIntoView:!0}),e.focus()}return{dom:n}}"undefined"!=typeof Symbol&&(tu.prototype[Symbol.iterator]=tp.prototype[Symbol.iterator]=function(){return this});let tk=o.Py.define(),ty=o.QQ.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(tk)&&(e=n.value);return e},provide:e=>l.mH.from(e,e=>e?tg:null)}),tv=e=>{let t=(0,l.Sd)(e,tg);if(!t){let n=[tk.of(!0)];null==e.state.field(ty,!1)&&n.push(o.Py.appendConfig.of([ty,tb])),e.dispatch({effects:n}),t=(0,l.Sd)(e,tg)}return t&&t.dom.querySelector("input").focus(),!0},tb=l.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tx={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},tO=o.r$.define({combine:e=>(0,o.BO)(e,tx,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),tw=l.p.mark({class:"cm-selectionMatch"}),tS=l.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function tQ(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=o.D0.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=o.D0.Word)}let tP=l.lg.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(tO),{state:n}=e,i=n.selection;if(i.ranges.length>1)return l.p.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return l.p.none;let h=n.wordAt(r.head);if(!h)return l.p.none;a=n.charCategorizer(r.head),s=n.sliceDoc(h.from,h.to)}else{let c=r.to-r.from;if(c200)return l.p.none;if(t.wholeWords){var u,f,d;if(s=n.sliceDoc(r.from,r.to),!(tQ(a=n.charCategorizer(r.head),n,r.from,r.to)&&(u=a,f=r.from,d=r.to,u(n.sliceDoc(f,f+1))==o.D0.Word&&u(n.sliceDoc(d-1,d))==o.D0.Word)))return l.p.none}else if(!(s=n.sliceDoc(r.from,r.to).trim()))return l.p.none}let p=[];for(let m of e.visibleRanges){let g=new ta(n.doc,s,m.from,m.to);for(;!g.next().done;){let{from:k,to:y}=g.value;if((!a||tQ(a,n,k,y))&&(r.empty&&k<=r.from&&y>=r.to?p.push(tS.range(k,y)):(k>=r.to||y<=r.from)&&p.push(tw.range(k,y)),p.length>t.maxMatches))return l.p.none}}return l.p.set(p)}},{decorations:e=>e.decorations}),tC=l.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),tA=({state:e,dispatch:t})=>{let{selection:n}=e,i=o.jT.create(n.ranges.map(t=>e.wordAt(t.head)||o.jT.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)},tT=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return tA({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new ta(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ta(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(e=>e.from==l.value.from))continue;if(s){let a=e.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(o.jT.range(r.from,r.to),!1),effects:l.tk.scrollIntoView(r.to)})),!0)},tI=o.r$.define({combine:e=>(0,o.BO)(e,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:e=>new t3(e)})});class tR{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return RegExp(e,tc),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new tW(this):new tM(this)}getCursor(e,t=0,n){let i=e.doc?e:o.yy.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?t$(this,i,t,n):tD(this,i,t,n)}}class tz{constructor(e){this.spec=e}}function tD(e,t,n,i){var r,s;return new ta(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,n,i)=>((i>e||i+n.length=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=tD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function t$(e,t,n,i){var r;return new tu(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(tN(n.input,n.index))!=o.D0.Word||r(tE(n.input,n.index))!=o.D0.Word)&&(r(tE(n.input,n.index+n[0].length))!=o.D0.Word||r(tN(n.input,n.index+n[0].length))!=o.D0.Word)):void 0},n,i)}function tN(e,t){return e.slice((0,o.cp)(e,t,!1),t)}function tE(e,t){return e.slice(t,(0,o.cp)(e,t))}class tW extends tz{nextMatch(e,t,n){let i=t$(this.spec,e,n,e.doc.length).next();return i.done&&(i=t$(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),s=t$(this.spec,e,r,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==t||o.from>r+10))return o;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=t$(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let tB=o.Py.define(),tJ=o.Py.define(),tL=o.QQ.define({create:e=>new tj(t0(e).create(),null),update(e,t){for(let n of t.effects)n.is(tB)?e=new tj(n.value.create(),e.panel):n.is(tJ)&&(e=new tj(e.query,n.value?tK:null));return e},provide:e=>l.mH.from(e,e=>e.panel)});class tj{constructor(e,t){this.query=e,this.panel=t}}let t_=l.p.mark({class:"cm-searchMatch"}),tF=l.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),tq=l.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(tL))}update(e){let t=e.state.field(tL);(t!=e.startState.field(tL)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return l.p.none;let{view:n}=this,i=new o.f_;for(let r=0,s=n.visibleRanges,a=s.length;rs[r+1].from-500;)c=s[++r].to;e.highlight(n.state,h,c,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?tF:t_)})}return i.finish()}},{decorations:e=>e.decorations});function tU(e){return t=>{let n=t.state.field(tL,!1);return n&&n.query.spec.valid?e(t,n):t1(t)}}let tX=tU((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:t6(e,i),userEvent:"select.search"}),!0)}),tV=tU((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);return!!r&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:t6(e,r),userEvent:"select.search"}),!0)}),tZ=tU((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:o.jT.create(n.map(e=>o.jT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),tG=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],l=0;for(let a=new ta(e.doc,e.sliceDoc(i,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==i&&(l=s.length),s.push(o.jT.range(a.value.from,a.value.to))}return t(e.update({selection:o.jT.create(s,l),userEvent:"select.search.matches"})),!0},tY=tU((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=[],a,h,c=[];if(s.from==i&&s.to==r&&(h=n.toText(t.getReplacement(s)),o.push({from:s.from,to:s.to,insert:h}),s=t.nextMatch(n,s.from,s.to),c.push(l.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),s){let u=0==o.length||o[0].from>=s.to?0:s.to-s.from-h.length;a={anchor:s.from-u,head:s.to-u},c.push(t6(e,s))}return e.dispatch({changes:o,selection:a,scrollIntoView:!!a,effects:c,userEvent:"input.replace"}),!0}),tH=tU((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:i}=e;return{from:n,to:i,insert:t.getReplacement(e)}});if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:l.tk.announce.of(i),userEvent:"input.replace.all"}),!0});function tK(e){return e.state.facet(tI).createPanel(e)}function t0(e,t){var n,i,r,s;let o=e.selection.main,l=o.empty||o.to>o.from+100?"":e.sliceDoc(o.from,o.to);if(t&&!l)return t;let a=e.facet(tI);return new tR({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:a.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:a.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:a.literal,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:a.wholeWord})}let t1=e=>{let t=e.state.field(tL,!1);if(t&&t.panel){let n=(0,l.Sd)(e,tK);if(!n)return!1;let i=n.dom.querySelector("[main-field]");if(i&&i!=e.root.activeElement){let r=t0(e.state,t.query.spec);r.valid&&e.dispatch({effects:tB.of(r)}),i.focus(),i.select()}}else e.dispatch({effects:[tJ.of(!0),t?tB.of(t0(e.state,t.query.spec)):o.Py.appendConfig.of(t7)]});return!0},t2=e=>{let t=e.state.field(tL,!1);if(!t||!t.panel)return!1;let n=(0,l.Sd)(e,tK);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:tJ.of(!1)}),!0},t5=[{key:"Mod-f",run:t1,scope:"editor search-panel"},{key:"F3",run:tX,shift:tV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tX,shift:tV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:t2,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tG},{key:"Alt-g",run:tv},{key:"Mod-d",run:tT,preventDefault:!0}];class t3{constructor(e){this.view=e;let t=this.query=e.state.field(tL).query.spec;function n(e,t,n){return to("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=to("input",{value:t.search,placeholder:t4(e,"Find"),"aria-label":t4(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=to("input",{value:t.replace,placeholder:t4(e,"Replace"),"aria-label":t4(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=to("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=to("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=to("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=to("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>tX(e),[t4(e,"next")]),n("prev",()=>tV(e),[t4(e,"previous")]),n("select",()=>tZ(e),[t4(e,"all")]),to("label",null,[this.caseField,t4(e,"match case")]),to("label",null,[this.reField,t4(e,"regexp")]),to("label",null,[this.wordField,t4(e,"by word")]),...e.state.readOnly?[]:[to("br"),this.replaceField,n("replace",()=>tY(e),[t4(e,"replace")]),n("replaceAll",()=>tH(e),[t4(e,"replace all")]),to("button",{name:"close",onclick:()=>t2(e),"aria-label":t4(e,"close"),type:"button"},["\xd7"])]])}commit(){let e=new tR({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:tB.of(e)}))}keydown(e){(0,l.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?tV:tX)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),tY(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(tB)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(tI).top}}function t4(e,t){return e.state.phrase(t)}let t9=/[\s\.,:;?!]/;function t6(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-30),o=Math.min(r,n+30),a=e.state.sliceDoc(s,o);if(s!=i.from){for(let h=0;h<30;h++)if(!t9.test(a[h+1])&&t9.test(a[h])){a=a.slice(h);break}}if(o!=r){for(let c=a.length-1;c>a.length-30;c--)if(!t9.test(a[c-1])&&t9.test(a[c])){a=a.slice(0,c);break}}return l.tk.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${i.number}.`)}let t8=l.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%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),t7=[tL,o.Wl.lowest(tq),t8];var ne=n(34790);class nt{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class nn{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,r=n.facet(nk).markerFilter;r&&(i=r(i));let s=l.p.set(i.map(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?l.p.widget({widget:new nb(e),diagnostic:e}).range(e.from):l.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity},diagnostic:e}).range(e.from,e.to)),!0);return new nn(s,t,ni(s))}}function ni(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!t||r.diagnostic==t)return i=new nt(e,n,r.diagnostic),!1}),i}function nr(e,t){return!!(e.effects.some(e=>e.is(no))||e.changes.touchesRange(t.pos))}function ns(e,t){return e.field(nh,!1)?t:t.concat(o.Py.appendConfig.of([nh,l.tk.decorations.compute([nh],e=>{let{selected:t,panel:n}=e.field(nh);return t&&n&&t.from!=t.to?l.p.set([nc.range(t.from,t.to)]):l.p.none}),(0,l.bF)(nu,{hideOn:nr}),nS]))}let no=o.Py.define(),nl=o.Py.define(),na=o.Py.define(),nh=o.QQ.define({create:()=>new nn(l.p.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),i=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=ni(n,e.selected.diagnostic,r)||ni(n,null,r)}e=new nn(n,e.panel,i)}for(let s of t.effects)s.is(no)?e=nn.init(s.value,e.panel,t.state):s.is(nl)?e=new nn(e.diagnostics,s.value?nO.open:null,e.selected):s.is(na)&&(e=new nn(e.diagnostics,e.panel,s.value));return e},provide:e=>[l.mH.from(e,e=>e.panel),l.tk.decorations.from(e,e=>e.diagnostics)]}),nc=l.p.mark({class:"cm-lintRange cm-lintRange-active"});function nu(e,t,n){let{diagnostics:i}=e.state.field(nh),r=[],s=2e8,o=0;i.between(t-(n<0?1:0),t+(n>0?1:0),(e,i,{spec:l})=>{t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t({dom:function(e,t){return to("ul",{class:"cm-tooltip-lint"},t.map(t=>nv(e,t,!1)))}(e,r)})}:null}let nf=e=>{let t=e.state.field(nh,!1);t&&t.panel||e.dispatch({effects:ns(e.state,[nl.of(!0)])});let n=(0,l.Sd)(e,nO.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},nd=e=>{let t=e.state.field(nh,!1);return!!t&&!!t.panel&&(e.dispatch({effects:nl.of(!1)}),!0)},np=e=>{let t=e.state.field(nh,!1);if(!t)return!1;let n=e.state.selection.main,i=t.diagnostics.iter(n.to+1);return(!!i.value||!!(i=t.diagnostics.iter(0)).value&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},nm=[{key:"Mod-Shift-m",run:nf},{key:"F8",run:np}],ng=l.lg.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(nk);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view)))).then(e=>{let n=e.reduce((e,t)=>e.concat(t));this.view.state.doc==t.doc&&this.view.dispatch({effects:ns(this.view.state,[no.of(n)])})},e=>{(0,l.OO)(this.view.state,e)})}}update(e){let t=e.state.facet(nk);(e.docChanged||t!=e.startState.facet(nk))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),nk=o.r$.define({combine:e=>Object.assign({sources:e.map(e=>e.source)},(0,o.BO)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null})),enables:ng});function ny(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;ie.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function nv(e,t,n){var i;let r=n?ny(t.actions):[];return to("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},to("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let s=i=>{i.preventDefault();let r=ni(e.state.field(nh).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:o}=n,l=r[i]?o.indexOf(r[i]):-1,a=l<0?o:[o.slice(0,l),to("u",o.slice(l,l+1)),o.slice(l+1)];return to("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${o}${l<0?"":` (access key "${r[i]})"`}.`},a)}),t.source&&to("div",{class:"cm-diagnosticSource"},t.source))}class nb extends l.l9{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return to("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class nx{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=nv(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class nO{constructor(e){this.view=e,this.items=[];let t=t=>{if(27==t.keyCode)nd(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=ny(n.actions);for(let r=0;r{for(let t=0;tnd(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(nh).selected;if(!e)return -1;for(let t=0;t{let l=-1,a;for(let h=n;hn&&(this.items.splice(n,l-n),i=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++});n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{e.topt.bottom&&(this.list.scrollTop+=e.bottom-t.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=ni(this.view.state.field(nh).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:na.of(t)})}static open(e){return new nO(e)}}function nw(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}(``,'width="6" height="3"')}let nS=l.tk.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:nw("#d11")},".cm-lintRange-warning":{backgroundImage:nw("orange")},".cm-lintRange-info":{backgroundImage:nw("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});l.SJ;let nQ=o.Py.define();var nP=function(e){void 0===e&&(e={});var t,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(ne.GA)),!1!==e.defaultKeymap&&(n=n.concat(tr)),!1!==e.searchKeymap&&(n=n.concat(t5)),!1!==e.historyKeymap&&(n=n.concat($)),!1!==e.foldKeymap&&(n=n.concat(a.e7)),!1!==e.completionKeymap&&(n=n.concat(ne.B1)),!1!==e.lintKeymap&&(n=n.concat(nm));var i=[];if(!1!==e.lineNumbers&&i.push((0,l.Eu)()),!1!==e.highlightActiveLineGutter&&i.push((0,l.HQ)()),!1!==e.highlightSpecialChars&&i.push((0,l.AE)()),!1!==e.history&&i.push(function(e={}){return[x,b.of(e),l.tk.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?w:"historyRedo"==e.inputType?S:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push((0,a.mi)()),!1!==e.drawSelection&&i.push((0,l.Uw)()),!1!==e.dropCursor&&i.push((0,l.qr)()),!1!==e.allowMultipleSelections&&i.push(o.yy.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push((0,a.nY)()),!1!==e.syntaxHighlighting&&i.push((0,a.nF)(a.R_,{fallback:!0})),!1!==e.bracketMatching&&i.push((0,a.n$)()),!1!==e.closeBrackets&&i.push((0,ne.vQ)()),!1!==e.autocompletion&&i.push((0,ne.ys)()),!1!==e.rectangularSelection&&i.push((0,l.Zs)()),!1!==e.crosshairCursor&&i.push((0,l.S2)()),!1!==e.highlightActiveLine&&i.push((0,l.ZO)()),!1!==e.highlightSelectionMatches){let r;i.push((r=[tC,tP],t&&r.push(tO.of(t)),r))}return e.tabSize&&"number"==typeof e.tabSize&&i.push(a.c.of(" ".repeat(e.tabSize))),i.concat([l.$f.of(n.flat())]).filter(Boolean)},nC=n(35524);let nA="#e06c75",nT="#abb2bf",nI="#7d8799",nR="#d19a66",nz="#2c313a",nD="#282c34",nM="#353a42",n$="#528bff",nN=l.tk.theme({"&":{color:nT,backgroundColor:nD},".cm-content":{caretColor:n$},".cm-cursor, .cm-dropCursor":{borderLeftColor:n$},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:nT},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{backgroundColor:nD,color:nI,border:"none"},".cm-activeLineGutter":{backgroundColor:nz},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:nM},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nM,borderBottomColor:nM},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:nz,color:nT}}},{dark:!0}),nE=a.Qf.define([{tag:nC.pJ.keyword,color:"#c678dd"},{tag:[nC.pJ.name,nC.pJ.deleted,nC.pJ.character,nC.pJ.propertyName,nC.pJ.macroName],color:nA},{tag:[nC.pJ.function(nC.pJ.variableName),nC.pJ.labelName],color:"#61afef"},{tag:[nC.pJ.color,nC.pJ.constant(nC.pJ.name),nC.pJ.standard(nC.pJ.name)],color:nR},{tag:[nC.pJ.definition(nC.pJ.name),nC.pJ.separator],color:nT},{tag:[nC.pJ.typeName,nC.pJ.className,nC.pJ.number,nC.pJ.changed,nC.pJ.annotation,nC.pJ.modifier,nC.pJ.self,nC.pJ.namespace],color:"#e5c07b"},{tag:[nC.pJ.operator,nC.pJ.operatorKeyword,nC.pJ.url,nC.pJ.escape,nC.pJ.regexp,nC.pJ.link,nC.pJ.special(nC.pJ.string)],color:"#56b6c2"},{tag:[nC.pJ.meta,nC.pJ.comment],color:nI},{tag:nC.pJ.strong,fontWeight:"bold"},{tag:nC.pJ.emphasis,fontStyle:"italic"},{tag:nC.pJ.strikethrough,textDecoration:"line-through"},{tag:nC.pJ.link,color:nI,textDecoration:"underline"},{tag:nC.pJ.heading,fontWeight:"bold",color:nA},{tag:[nC.pJ.atom,nC.pJ.bool,nC.pJ.special(nC.pJ.variableName)],color:nR},{tag:[nC.pJ.processingInstruction,nC.pJ.string,nC.pJ.inserted],color:"#98c379"},{tag:nC.pJ.invalid,color:"#ffffff"}]),nW=[nN,(0,a.nF)(nE)];var nB=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),nJ=n(85893),nL=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nj=(0,s.forwardRef)((e,t)=>{var{className:n,value:a="",selection:h,extensions:c=[],onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,autoFocus:m,theme:g="light",height:k,minHeight:y,maxHeight:v,width:b,minWidth:x,maxWidth:O,basicSetup:w,placeholder:S,indentWithTab:Q,editable:P,readOnly:C,root:A,initialState:T}=e,I=(0,r.Z)(e,nL),R=(0,s.useRef)(null),{state:z,view:D,container:M,setContainer:$}=function(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:a,onUpdate:h,extensions:c=[],autoFocus:u,theme:f="light",height:d="",minHeight:p="",maxHeight:m="",placeholder:g="",width:k="",minWidth:y="",maxWidth:v="",editable:b=!0,readOnly:x=!1,indentWithTab:O=!0,basicSetup:w=!0,root:S,initialState:Q}=e,[P,C]=(0,s.useState)(),[A,T]=(0,s.useState)(),[I,R]=(0,s.useState)(),z=l.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),D=l.tk.theme({"&":{height:d,minHeight:p,maxHeight:m,width:k,minWidth:y,maxWidth:v}}),M=[l.tk.updateListener.of(e=>{e.docChanged&&"function"==typeof i&&i(e.state.doc.toString(),e),r&&r(nB(e))}),D];switch(O&&M.unshift(l.$f.of([ts])),w&&("boolean"==typeof w?M.unshift(nP()):M.unshift(nP(w))),g&&M.unshift((0,l.W$)(g)),f){case"light":M.push(z);break;case"dark":M.push(nW);break;default:M.push(f)}return!1===b&&M.push(l.tk.editable.of(!1)),x&&M.push(o.yy.readOnly.of(!0)),h&&"function"==typeof h&&M.push(l.tk.updateListener.of(h)),M=M.concat(c),(0,s.useEffect)(()=>{if(P&&!I){var e={doc:t,selection:n,extensions:M},i=Q?o.yy.fromJSON(Q.json,e,Q.fields):o.yy.create(e);if(R(i),!A){var r=new l.tk({state:i,parent:P,root:S});T(r),a&&a(r,i)}}return()=>{A&&(R(void 0),T(void 0))}},[P,I]),(0,s.useEffect)(()=>C(e.container),[e.container]),(0,s.useEffect)(()=>()=>{A&&(A.destroy(),T(void 0))},[A]),(0,s.useEffect)(()=>{u&&A&&A.focus()},[u,A]),(0,s.useEffect)(()=>{A&&A.dispatch({effects:o.Py.reconfigure.of(M)})},[f,c,d,p,m,k,y,v,g,b,x,O,w,i,h]),(0,s.useEffect)(()=>{var e=A?A.state.doc.toString():"";A&&t!==e&&A.dispatch({changes:{from:0,to:e.length,insert:t||""}})},[t,A]),{state:I,setState:R,view:A,setView:T,container:P,setContainer:C}}({container:R.current,root:A,value:a,autoFocus:m,theme:g,height:k,minHeight:y,maxHeight:v,width:b,minWidth:x,maxWidth:O,basicSetup:w,placeholder:S,indentWithTab:Q,editable:P,readOnly:C,selection:h,onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:c,initialState:T});if((0,s.useImperativeHandle)(t,()=>({editor:R.current,state:z,view:D}),[R,M,z,D]),"string"!=typeof a)throw Error("value must be typeof string but got "+typeof a);return(0,nJ.jsx)("div",(0,i.Z)({ref:R,className:("string"==typeof g?"cm-theme-"+g:"cm-theme")+(n?" "+n:"")},I))});nj.displayName="CodeMirror";var n_=nj},34790:function(e,t,n){n.d(t,{B1:function(){return eS},GA:function(){return ey},Gn:function(){return er},Mb:function(){return a},eC:function(){return h},vQ:function(){return eu},ys:function(){return ew}});var i=n(78120),r=n(47421),s=n(59119);class o{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=(0,s.qz)(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(f(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function l(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function a(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let r=1;r{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}function h(e,t){return n=>{for(let i=(0,s.qz)(n.state).resolveInner(n.pos,-1);i;i=i.parent)if(e.indexOf(i.name)>-1)return null;return t(n)}}class c{constructor(e,t,n){this.completion=e,this.source=t,this.match=n}}function u(e){return e.selection.main.head}function f(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],s="$"!=i[i.length-1];return r||s?RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function d(e,t){let n=t.completion.apply||t.completion.label,r=t.source;if("string"==typeof n){var s,o,l;e.dispatch((s=e.state,o=r.from,l=r.to,Object.assign(Object.assign({},s.changeByRange(e=>{if(e==s.selection.main)return{changes:{from:o,to:l,insert:n},range:i.jT.cursor(o+n.length)};let t=l-o;return!e.empty||t&&s.sliceDoc(e.from-t,e.from)!=s.sliceDoc(o,l)?{range:e}:{changes:{from:e.from-t,to:e.from,insert:n},range:i.jT.cursor(e.from-t+n.length)}})),{userEvent:"input.complete"})))}else n(e,t.completion,r.from,r.to)}let p=new WeakMap;function m(e){if(!Array.isArray(e))return e;let t=p.get(e);return t||p.set(e,t=a(e)),t}class g{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&Q<=57||Q>=97&&Q<=122?2:Q>=65&&Q<=90?1:0:(P=(0,i.bg)(Q))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!O||1==C&&b||0==S&&0!=C)&&(t[m]==Q||n[m]==Q&&(g=!0)?o[m++]=O:o.length&&(x=!1)),S=C,O+=(0,i.nZ)(Q)}return m==h&&0==o[0]&&x?this.result(-100+(g?-200:0),o,e):k==h&&0==y?[-200-e.length,0,v]:a>-1?[-700-e.length,a,a+this.pattern.length]:k==h?[-900-e.length,y,v]:m==h?this.result(-100+(g?-200:0)+-700+(x?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[e-n.length],s=1;for(let o of t){let l=o+(this.astral?(0,i.nZ)((0,i.gm)(n,o)):1);s>1&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return r}}let k=i.r$.define({combine:e=>(0,i.BO)(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>n=>{var i,r;return i=e(n),r=t(n),i?r?i+" "+r:i:r},addToOptions:(e,t)=>e.concat(t)})});function y(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class v{constructor(e,t){let n;this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:e=>this.positionInfo(e),key:this};let i=e.state.field(t),{options:r,selected:s}=i.open,o=e.state.facet(k);this.optionContent=(n=o.addToOptions.slice(),o.icons&&n.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),n.push({render(e,t,n){let i=document.createElement("span");i.className="cm-completionLabel";let{label:r}=e,s=0;for(let o=1;os&&i.appendChild(document.createTextNode(r.slice(s,l)));let h=i.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(r.slice(l,a))),h.className="cm-completionMatchedText",s=a}return se.position-t.position).map(e=>e.render)),this.optionClass=o.optionClass,this.range=y(r.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",t=>{for(let n=t.target,i;n&&n!=this.dom;n=n.parentNode)if("LI"==n.nodeName&&(i=/-(\d+)$/.exec(n.id))&&+i[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=y(t.options.length,t.selected,this.view.state.facet(k).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let s="string"==typeof i?document.createTextNode(i):i(n);if(!s)return;"then"in s?s.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t)}).catch(e=>(0,r.OO)(this.view.state,e,"completion info")):this.addInfoPane(s)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){var t,n;let i,r,s=null;for(let o=this.list.firstChild,l=this.range.from;o;o=o.nextSibling,l++)l==e?o.hasAttribute("aria-selected")||(o.setAttribute("aria-selected","true"),s=o):o.hasAttribute("aria-selected")&&o.removeAttribute("aria-selected");return s&&(t=this.list,n=s,i=t.getBoundingClientRect(),(r=n.getBoundingClientRect()).topi.bottom&&(t.scrollTop+=r.bottom-i.bottom)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.ownerDocument.defaultView||window,n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect();if(s.top>Math.min(t.innerHeight,n.bottom)-10||s.bottom=i.height||p>n.top?c=s.bottom-n.top+"px":u=n.bottom-s.top+"px"}return{top:c,bottom:u,maxWidth:h,class:a?o?"left-narrow":"right-narrow":l?"left":"right"}}positionInfo(e){this.info&&(e?(this.info.style.top=e.top,this.info.style.bottom=e.bottom,this.info.style.maxWidth=e.maxWidth,this.info.className="cm-tooltip cm-completionInfo cm-completionInfo-"+e.class):this.info.style.top="-1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));for(let r=n.from;r=this.options.length?this:new x(this.options,S(t,e),this.tooltip,this.timestamp,e)}static build(e,t,n,i,r){let s=function(e,t){let n=[],i=0;for(let r of e)if(r.hasResult()){if(!1===r.result.filter){let s=r.result.getMatch;for(let o of r.result.options){let l=[1e9-i++];if(s)for(let a of s(o))l.push(a);n.push(new c(o,r,l))}}else{let h=new g(t.sliceDoc(r.from,r.to)),u;for(let f of r.result.options)(u=h.match(f.label))&&(null!=f.boost&&(u[0]+=f.boost),n.push(new c(f,r,u)))}}let d=[],p=null,m=t.facet(k).compareCompletions;for(let y of n.sort((e,t)=>t.match[0]-e.match[0]||m(e.completion,t.completion)))p&&p.label==y.completion.label&&p.detail==y.completion.detail&&(null==p.type||null==y.completion.type||p.type==y.completion.type)&&p.apply==y.completion.apply?b(y.completion)>b(p)&&(d[d.length-1]=y):d.push(y),p=y.completion;return d}(e,t);if(!s.length)return null;let o=t.facet(k).selectOnOpen?0:-1;if(i&&i.selected!=o&&-1!=i.selected){let l=i.options[i.selected].completion;for(let a=0;at.hasResult()?Math.min(e,t.from):e,1e8),create:e=>new v(e,D),above:r.aboveCursor},i?i.timestamp:Date.now(),o)}map(e){return new x(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class O{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new O(Q,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(k),i=(n.override||t.languageDataAt("autocomplete",u(t)).map(m)).map(t=>(this.active.find(e=>e.source==t)||new C(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n1!=e.state)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new C(e.source,0):e)),e.effects))s.is(z)&&(r=r&&r.setSelected(s.value,this.id));return i==this.active&&r==this.open?this:new O(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:w}}let w={"aria-autocomplete":"list"};function S(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let Q=[];function P(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class C{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=P(e),i=this;for(let r of(n?i=i.handleUserEvent(e,n,t):e.docChanged?i=i.handleChange(e):e.selection&&0!=i.state&&(i=new C(i.source,0)),e.effects))if(r.is(T))i=new C(i.source,1,r.value?u(e.state):-1);else if(r.is(I))i=new C(i.source,0);else if(r.is(R))for(let s of r.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new C(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(u(e.startState))?new C(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new C(this.source,this.state,e.mapPos(this.explicitPos))}}class A extends C{constructor(e,t,n,i,r){super(e,2,t),this.result=n,this.from=i,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var i;let r=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),l=u(e.state);if((this.explicitPos<0?l<=r:ls||"delete"==t&&u(e.startState)==this.from)return new C(this.source,"input"==t&&n.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):f(e,!0).test(r)}(this.result.validFor,e.state,r,s)?this.result.update&&(h=this.result.update(this.result,r,s,new o(e.state,l,a>=0)))?new A(this.source,a,h,h.from,null!==(i=h.to)&&void 0!==i?i:u(e.state)):new C(this.source,1,a):new A(this.source,a,this.result,r,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new C(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new A(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}let T=i.Py.define(),I=i.Py.define(),R=i.Py.define({map:(e,t)=>e.map(e=>e.map(t))}),z=i.Py.define(),D=i.QQ.define({create:()=>O.start(),update:(e,t)=>e.update(t),provide:e=>[r.hJ.from(e,e=>e.tooltip),r.tk.contentAttributes.from(e,e=>e.attrs)]});function M(e,t="option"){return n=>{let i=n.state.field(D,!1);if(!i||!i.open||Date.now()-i.open.timestamp-1?i.open.selected+s*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:z.of(a)}),!0}}let $=e=>{let t=e.state.field(D,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||Date.now()-t.open.timestamp!!e.state.field(D,!1)&&(e.dispatch({effects:T.of(!0)}),!0),E=e=>{let t=e.state.field(D,!1);return!!(t&&t.active.some(e=>0!=e.state))&&(e.dispatch({effects:I.of(null)}),!0)};class W{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let B=r.lg.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0,e.state.field(D).active))1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(D);if(!e.selectionSet&&!e.docChanged&&e.startState.field(D)==t)return;let n=e.transactions.some(e=>(e.selection||e.docChanged)&&!P(e));for(let i=0;i50&&Date.now()-s.time>1e3){for(let o of s.context.abortListeners)try{o()}catch(l){(0,r.OO)(this.view.state,l)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some(e=>1==e.state&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),50):-1,0!=this.composing)for(let a of e.transactions)"input"==P(a)?this.composing=2:2==this.composing&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(D);for(let n of t.active)1!=n.state||this.running.some(e=>e.active.source==n.source)||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=u(t),i=new o(t,n,e.explicitPos==n),s=new W(e,i);this.running.push(s),Promise.resolve(e.source(i)).then(e=>{s.context.aborted||(s.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:I.of(null)}),(0,r.OO)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),50))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(k);for(let i=0;ie.source==r.active.source);if(l&&1==l.state){if(null==r.done){let a=new C(r.active.source,0);for(let h of r.updates)a=a.update(h,n);1!=a.state&&t.push(a)}else this.startQuery(l)}}t.length&&this.view.dispatch({effects:R.of(t)})}},{eventHandlers:{blur(){let e=this.view.state.field(D,!1);e&&e.tooltip&&this.view.state.facet(k).closeOnBlur&&this.view.dispatch({effects:I.of(null)})},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:T.of(!1)}),20),this.composing=0}}}),J=r.tk.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class L{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}}class j{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,i.gc.TrackDel),n=e.mapPos(this.to,1,i.gc.TrackDel);return null==t||null==n?null:new j(this.field,t,n)}}class _{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let a=o,h=/^\t*/.exec(l)[0].length;for(let c=0;cnew j(e.field,i[e.line]+e.from,i[e.line]+e.to));return{text:n,ranges:u}}static parse(e){let t=[],n=[],i=[],r;for(let s of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let o=r[1]?+r[1]:null,l=r[2]||r[3]||"",a=-1;for(let h=0;h=a&&u.field++}i.push(new L(a,n.length,r.index,r.index+l.length)),s=s.slice(0,r.index)+l+s.slice(r.index+r[0].length)}for(let f;f=/([$#])\\{/.exec(s);)for(let d of(s=s.slice(0,f.index)+f[1]+"{"+s.slice(f.index+f[0].length),i))d.line==n.length&&d.from>f.index&&(d.from--,d.to--);n.push(s)}return new _(n,i)}}let F=r.p.widget({widget:new class extends r.l9{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),q=r.p.mark({class:"cm-snippetField"});class U{constructor(e,t){this.ranges=e,this.active=t,this.deco=r.p.set(e.map(e=>(e.from==e.to?F:q).range(e.from,e.to)))}map(e){let t=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;t.push(i)}return new U(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}let X=i.Py.define({map:(e,t)=>e&&e.map(t)}),V=i.Py.define(),Z=i.QQ.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(X))return n.value;if(n.is(V)&&e)return new U(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>r.tk.decorations.from(e,e=>e?e.deco:r.p.none)});function G(e,t){return i.jT.create(e.filter(e=>e.field==t).map(e=>i.jT.range(e.from,e.to)))}function Y(e){return({state:t,dispatch:n})=>{let i=t.field(Z,!1);if(!i||e<0&&0==i.active)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(t=>t.field==r+e);return n(t.update({selection:G(i.ranges,r),effects:X.of(s?null:new U(i.ranges,r))})),!0}}let H=({state:e,dispatch:t})=>!!e.field(Z,!1)&&(t(e.update({effects:X.of(null)})),!0),K=Y(1),ee=Y(-1),et=[{key:"Tab",run:K,shift:ee},{key:"Escape",run:H}],en=i.r$.define({combine:e=>e.length?e[0]:et}),ei=i.Wl.highest(r.$f.compute([en],e=>e.facet(en)));function er(e,t){let n;return Object.assign(Object.assign({},t),{apply:(n=_.parse(e),(e,t,r,s)=>{let{text:o,ranges:l}=n.instantiate(e.state,r),a={changes:{from:r,to:s,insert:i.xv.of(o)},scrollIntoView:!0};if(l.length&&(a.selection=G(l,0)),l.length>1){let h=new U(l,0),c=a.effects=[X.of(h)];void 0===e.state.field(Z,!1)&&c.push(i.Py.appendConfig.of([Z,ei,es,J]))}e.dispatch(e.state.update(a))})})}let es=r.tk.domEventHandlers({mousedown(e,t){let n=t.state.field(Z,!1),i;if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=n.ranges.find(e=>e.from<=i&&e.to>=i);return!!r&&r.field!=n.active&&(t.dispatch({selection:G(n.ranges,r.field),effects:X.of(n.ranges.some(e=>e.field>r.field)?new U(n.ranges,r.field):null)}),!0)}}),eo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},el=i.Py.define({map(e,t){let n=t.mapPos(e,-1,i.gc.TrackAfter);return null==n?void 0:n}}),ea=i.Py.define({map:(e,t)=>t.mapPos(e)}),eh=new class extends i.uU{};eh.startSide=1,eh.endSide=-1;let ec=i.QQ.define({create:()=>i.Xs.empty,update(e,t){if(t.selection){let n=t.state.doc.lineAt(t.selection.main.head).from,r=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(r,-1)&&(e=i.Xs.empty)}for(let s of(e=e.map(t.changes),t.effects))s.is(el)?e=e.update({add:[eh.range(s.value,s.value+1)]}):s.is(ea)&&(e=e.update({filter:e=>e!=s.value}));return e}});function eu(){return[eg,ec]}let ef="()[]{}<>";function ed(e){for(let t=0;t{if((em?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==(0,i.nZ)((0,i.gm)(r,0))||t!=o.from||n!=o.to)return!1;let l=function(e,t){let n=ep(e,e.selection.main.head),r=n.brackets||eo.brackets;for(let o of r){let l=ed((0,i.gm)(o,0));if(t==o)return l==o?function(e,t,n,r){let o=r.stringPrefixes||eo.stringPrefixes,l=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:el.of(r.to+t.length),range:i.jT.range(r.anchor+t.length,r.head+t.length)};let a=r.head,h=eb(e.doc,a),c;if(h==t){if(ex(e,a))return{changes:{insert:t+t,from:a},effects:el.of(a+t.length),range:i.jT.cursor(a+t.length)};if(ev(e,a)){let u=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:i.jT.cursor(a+t.length*(u?3:1)),effects:ea.of(a)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(c=eO(e,a-2*t.length,o))>-1&&ex(e,c))return{changes:{insert:t+t+t+t,from:a},effects:el.of(a+t.length),range:i.jT.cursor(a+t.length)};else if(e.charCategorizer(a)(h)!=i.D0.Word&&eO(e,a,o)>-1&&!function(e,t,n,i){let r=(0,s.qz)(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let l=0;l<5;l++){let a=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),h=a.indexOf(n);if(!h||h>-1&&i.indexOf(a.slice(0,h))>-1){let c=r.firstChild;for(;c&&c.from==r.from&&c.to-c.from>n.length+h;){if(e.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}(e,a,t,o))return{changes:{insert:t+t,from:a},effects:el.of(a+t.length),range:i.jT.cursor(a+t.length)};return{range:l=r}});return l?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,r.indexOf(o+o+o)>-1,n):function(e,t,n,r){let s=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:el.of(o.to+t.length),range:i.jT.range(o.anchor+t.length,o.head+t.length)};let l=eb(e.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:el.of(o.head+t.length),range:i.jT.cursor(o.head+t.length)}:{range:s=o}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,l,n.before||eo.before);if(t==l&&ev(e,e.selection.main.from))return function(e,t,n){let r=null,s=e.selection.ranges.map(t=>t.empty&&eb(e.doc,t.head)==n?i.jT.cursor(t.head+n.length):r=t);return r?null:e.update({selection:i.jT.create(s,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map(({from:e})=>ea.of(e))})}(e,0,l)}return null}(e.state,r);return!!l&&(e.dispatch(l),!0)}),ek=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=ep(e,e.selection.main.head).brackets||eo.brackets,r=null,s=e.changeByRange(t=>{if(t.empty){var s,o;let l;let a=(s=e.doc,o=t.head,l=s.sliceString(o-2,o),(0,i.nZ)((0,i.gm)(l,0))==l.length?l:l.slice(1));for(let h of n)if(h==a&&eb(e.doc,t.head)==ed((0,i.gm)(h,0)))return{changes:{from:t.head-h.length,to:t.head+h.length},range:i.jT.cursor(t.head-h.length)}}return{range:r=t}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},ey=[{key:"Backspace",run:ek}];function ev(e,t){let n=!1;return e.field(ec).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function eb(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,i.nZ)((0,i.gm)(n,0)))}function ex(e,t){let n=(0,s.qz)(e).resolveInner(t+1);return n.parent&&n.from==t}function eO(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=i.D0.Word)return t;for(let s of n){let o=t-s.length;if(e.sliceDoc(o,t)==s&&r(e.sliceDoc(o-1,o))!=i.D0.Word)return o}return -1}function ew(e={}){return[D,k.of(e),B,eQ,J]}let eS=[{key:"Ctrl-Space",run:N},{key:"Escape",run:E},{key:"ArrowDown",run:M(!0)},{key:"ArrowUp",run:M(!1)},{key:"PageDown",run:M(!0,"page")},{key:"PageUp",run:M(!1,"page")},{key:"Enter",run:$}],eQ=i.Wl.highest(r.$f.computeN([k],e=>e.facet(k).defaultKeymap?[eS]:[]))},61426:function(e,t,n){n.r(t),n.d(t,{css:function(){return S},cssCompletionSource:function(){return O},cssLanguage:function(){return w}});var i=n(53105),r=n(35524);let s=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function o(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}let l=new i.Jq((e,t)=>{for(let n=!1,i=0,r=0;;r++){var s;let{next:l}=e;if(o(l)||45==l||95==l||n&&(s=l)>=48&&s<=57)!n&&(45!=l||r>0)&&(n=!0),i===r&&45==l&&i++,e.advance();else{n&&e.acceptToken(40==l?94:2==i&&t.canShift(2)?2:95);break}}}),a=new i.Jq(e=>{if(s.includes(e.peek(-1))){let{next:t}=e;(o(t)||95==t||35==t||46==t||91==t||58==t||45==t)&&e.acceptToken(93)}}),h=new i.Jq(e=>{if(!s.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),o(t)){do e.advance();while(o(e.next));e.acceptToken(1)}}}),c=(0,r.Gv)({"AtKeyword import charset namespace keyframes media supports":r.pJ.definitionKeyword,"from to selector":r.pJ.keyword,NamespaceName:r.pJ.namespace,KeyframeName:r.pJ.labelName,TagName:r.pJ.tagName,ClassName:r.pJ.className,PseudoClassName:r.pJ.constant(r.pJ.className),IdName:r.pJ.labelName,"FeatureName PropertyName":r.pJ.propertyName,AttributeName:r.pJ.attributeName,NumberLiteral:r.pJ.number,KeywordQuery:r.pJ.keyword,UnaryQueryOp:r.pJ.operatorKeyword,"CallTag ValueName":r.pJ.atom,VariableName:r.pJ.variableName,Callee:r.pJ.operatorKeyword,Unit:r.pJ.unit,"UniversalSelector NestingSelector":r.pJ.definitionOperator,MatchOp:r.pJ.compareOperator,"ChildOp SiblingOp, LogicOp":r.pJ.logicOperator,BinOp:r.pJ.arithmeticOperator,Important:r.pJ.modifier,Comment:r.pJ.blockComment,ParenthesizedContent:r.pJ.special(r.pJ.name),ColorLiteral:r.pJ.color,StringLiteral:r.pJ.string,":":r.pJ.punctuation,"PseudoOp #":r.pJ.derefOperator,"; ,":r.pJ.separator,"( )":r.pJ.paren,"[ ]":r.pJ.squareBracket,"{ }":r.pJ.brace}),u={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},f={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},d={__proto__:null,not:128,only:128,from:158,to:160},p=i.WQ.deserialize({version:14,states:"7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[O,59sO%_Q[O,59uO%_Q[O,59vO'bQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO'iQWO,59SO'nQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO'sQ`O,59oOOQS'#Cp'#CpO#kQdO'#CqO'{QvO'#CsO)VQtO,5:POOQO'#Cx'#CxO'nQWO'#CwO)kQWO'#CyOOQS'#Ef'#EfOOQO'#Dh'#DhO)pQ[O'#DoO*OQWO'#EiO$xQ[O'#DmO*^QWO'#DpOOQO'#Ej'#EjO%|QWO,5:^O*cQpO,5:`OOQS'#Dx'#DxO*kQWO,5:bO*pQ[O,5:bOOQO'#D{'#D{O*xQWO,5:eO*}QWO,5:kO+VQWO,5:mOOQS-E8Q-E8QOOQP1G.l1G.lO+yQXO,5:qOOQO-E8T-E8TOOQS1G.g1G.gOOQP1G.n1G.nO'iQWO1G.nO'nQWO1G.nOOQP1G/V1G/VO,WQ`O1G/ZO,qQXO1G/_O-XQXO1G/aO-oQXO1G/bO.VQXO'#CdO.zQWO'#DaOOQS,59z,59zO/PQWO,59zO/XQ[O,59zO/`Q[O'#DOO/gQdO'#CoOOQP1G/Z1G/ZO#kQdO1G/ZO/nQpO,59]OOQS,59_,59_O#kQdO,59aO/vQWO1G/kOOQS,59c,59cO/{Q!bO,59eO0TQWO'#DhO0`QWO,5:TO0eQWO,5:ZO$xQ[O,5:VO$xQ[O'#EYO0mQWO,5;TO0xQWO,5:XO%_Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O1ZQWO1G/|O1`QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XOOQP7+$Y7+$YOOQP7+$u7+$uO#kQdO7+$uO#kQdO,59{O1nQ[O'#EXO1xQWO1G/fOOQS1G/f1G/fO1xQWO1G/fO2QQXO'#EhO2XQWO,59jO2^QtO'#ETO3RQdO'#EeO3]QWO,59ZO3bQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO3jQWO1G/PO#kQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO3oQWO,5:tOOQO-E8W-E8WO3}QXO1G/vOOQS7+%h7+%hO4UQYO'#CsO%|QWO'#EZO4^QdO,5:hOOQS,5:h,5:hO4lQpO<O!c!}$w!}#O?[#O#P$w#P#Q?g#Q#R2U#R#T$w#T#U?r#U#c$w#c#d@q#d#o$w#o#pAQ#p#q2U#q#rA]#r#sAh#s#y$w#y#z%]#z$f$w$f$g%]$g#BY$w#BY#BZ%]#BZ$IS$w$IS$I_%]$I_$I|$w$I|$JO%]$JO$JT$w$JT$JU%]$JU$KV$w$KV$KW%]$KW&FU$w&FU&FV%]&FV~$wW$zQOy%Qz~%QW%VQoWOy%Qz~%Q~%bf#T~OX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q~&}f#T~oWOX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q^(fSOy%Qz#]%Q#]#^(r#^~%Q^(wSoWOy%Qz#a%Q#a#b)T#b~%Q^)YSoWOy%Qz#d%Q#d#e)f#e~%Q^)kSoWOy%Qz#c%Q#c#d)w#d~%Q^)|SoWOy%Qz#f%Q#f#g*Y#g~%Q^*_SoWOy%Qz#h%Q#h#i*k#i~%Q^*pSoWOy%Qz#T%Q#T#U*|#U~%Q^+RSoWOy%Qz#b%Q#b#c+_#c~%Q^+dSoWOy%Qz#h%Q#h#i+p#i~%Q^+wQ!VUoWOy%Qz~%Q~,QUOY+}Zr+}rs,ds#O+}#O#P,i#P~+}~,iOh~~,lPO~+}_,tWtPOy%Qz!Q%Q!Q![-^![!c%Q!c!i-^!i#T%Q#T#Z-^#Z~%Q^-cWoWOy%Qz!Q%Q!Q![-{![!c%Q!c!i-{!i#T%Q#T#Z-{#Z~%Q^.QWoWOy%Qz!Q%Q!Q![.j![!c%Q!c!i.j!i#T%Q#T#Z.j#Z~%Q^.qWfUoWOy%Qz!Q%Q!Q![/Z![!c%Q!c!i/Z!i#T%Q#T#Z/Z#Z~%Q^/bWfUoWOy%Qz!Q%Q!Q![/z![!c%Q!c!i/z!i#T%Q#T#Z/z#Z~%Q^0PWoWOy%Qz!Q%Q!Q![0i![!c%Q!c!i0i!i#T%Q#T#Z0i#Z~%Q^0pWfUoWOy%Qz!Q%Q!Q![1Y![!c%Q!c!i1Y!i#T%Q#T#Z1Y#Z~%Q^1_WoWOy%Qz!Q%Q!Q![1w![!c%Q!c!i1w!i#T%Q#T#Z1w#Z~%Q^2OQfUoWOy%Qz~%QY2XSOy%Qz!_%Q!_!`2e!`~%QY2lQzQoWOy%Qz~%QX2wQXPOy%Qz~%Q~3QUOY2}Zw2}wx,dx#O2}#O#P3d#P~2}~3gPO~2}_3oQbVOy%Qz~%Q~3zOa~_4RSUPjSOy%Qz!_%Q!_!`2e!`~%Q_4fUjS!PPOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q^4}SoWOy%Qz!Q%Q!Q![5Z![~%Q^5bWoW#ZUOy%Qz!Q%Q!Q![5Z![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q^6PWoWOy%Qz{%Q{|6i|}%Q}!O6i!O!Q%Q!Q![6z![~%Q^6nSoWOy%Qz!Q%Q!Q![6z![~%Q^7RSoW#ZUOy%Qz!Q%Q!Q![6z![~%Q^7fYoW#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q_8ZQpVOy%Qz~%Q^8fUjSOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_8}S#WPOy%Qz!Q%Q!Q![5Z![~%Q~9`RjSOy%Qz{9i{~%Q~9nSoWOy9iyz9zz{:o{~9i~9}ROz9zz{:W{~9z~:ZTOz9zz{:W{!P9z!P!Q:j!Q~9z~:oOR~~:tUoWOy9iyz9zz{:o{!P9i!P!Q;W!Q~9i~;_QoWR~Oy%Qz~%Q^;jY#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[a,h,l,0,1,2,3],topRules:{StyleSheet:[0,4]},specialized:[{term:94,get:e=>u[e]||-1},{term:56,get:e=>f[e]||-1},{term:95,get:e=>d[e]||-1}],tokenPrec:1078});var m=n(59119);let g=null;function k(){if(!g&&"object"==typeof document&&document.body){let e=[];for(let t in document.body.style)/[A-Z]|^-|^(item|length)$/.test(t)||e.push(t);g=e.sort().map(e=>({type:"property",label:e}))}return g||[]}let y=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),v=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),b=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),x=/^[\w-]*/,O=e=>{let{state:t,pos:n}=e,i=(0,m.qz)(t).resolveInner(n,-1);if("PropertyName"==i.name)return{from:i.from,options:k(),validFor:x};if("ValueName"==i.name)return{from:i.from,options:v,validFor:x};if("PseudoClassName"==i.name)return{from:i.from,options:y,validFor:x};if("TagName"==i.name){for(let{parent:r}=i;r;r=r.parent)if("Block"==r.name)return{from:i.from,options:k(),validFor:x};return{from:i.from,options:b,validFor:x}}if(!e.explicit)return null;let s=i.resolve(n),o=s.childBefore(n);return o&&":"==o.name&&"PseudoClassSelector"==s.name?{from:n,options:y,validFor:x}:o&&":"==o.name&&"Declaration"==s.name||"ArgList"==s.name?{from:n,options:v,validFor:x}:"Block"==s.name?{from:n,options:k(),validFor:x}:null},w=m.qp.define({name:"css",parser:p.configure({props:[m.uj.add({Declaration:(0,m.tC)()}),m.x0.add({Block:m.Dv})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function S(){return new m.ri(w,w.data.of({autocomplete:O}))}},59119:function(e,t,n){n.d(t,{Be:function(){return k},Dv:function(){return _},Gn:function(){return R},K0:function(){return I},Qf:function(){return ef},R_:function(){return ey},SQ:function(){return u},SS:function(){return T},Um:function(){return eT},c:function(){return C},c6:function(){return Q},e7:function(){return ei},il:function(){return eD},kU:function(){return c},mi:function(){return ec},n$:function(){return eC},nF:function(){return eg},nY:function(){return J},pp:function(){return h},qp:function(){return d},qz:function(){return p},ri:function(){return S},tC:function(){return B},uj:function(){return z},vw:function(){return N},x0:function(){return j},y1:function(){return A},ze:function(){return W}});var i,r=n(41113),s=n(78120),o=n(47421),l=n(35524),a=n(28699);let h=new r.md;function c(e){return s.r$.define({combine:e?t=>t.concat(e):void 0})}class u{constructor(e,t,n=[],i=""){this.data=e,this.name=i,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[w.of(this),s.yy.languageData.of((e,t,n)=>e.facet(f(e,t,n)))].concat(n)}isActiveAt(e,t,n=-1){return f(e,t,n)==this.data}findRegions(e){let t=e.facet(w);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(h)==this.data){n.push({from:t,to:t+e.length});return}let s=e.prop(r.md.mounted);if(s){if(s.tree.prop(h)==this.data){if(s.overlay)for(let o of s.overlay)n.push({from:o.from+t,to:o.to+t});else n.push({from:t,to:t+e.length});return}if(s.overlay){let l=n.length;if(i(s.tree,s.overlay[0].from+t),n.length>l)return}}for(let a=0;ae.isTop?t:void 0)]}),e.name)}configure(e,t){return new d(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(u.state,!1);return t?t.tree:r.mp.empty}class m{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let g=null;class k{constructor(e,t,n=[],i,r,s,o,l){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new k(e,t,[],r.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new m(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=r.mp.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=g;g=this;try{return e()}finally{g=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=y(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((e,t,n,i)=>a.push({fromA:e,toA:t,fromB:n,toB:i})),n=r.i9.applyChanges(n,a),i=r.mp.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let h of(l=[],this.skipped)){let c=e.mapPos(h.from,1),u=e.mapPos(h.to,-1);ce.from&&(this.fragments=y(this.fragments,i,r),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends r._b{createParse(t,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let t=g;if(t){for(let n of i)t.tempSkipped.push(n);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new r.mp(r.Jq.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return g}}function y(e,t,n){return r.i9.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class v{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new v(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=k.create(e.facet(w).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new v(n)}}u.state=s.QQ.define({create:v.init,update(e,t){for(let n of t.effects)if(n.is(u.setState))return n.value;return t.startState.facet(w)!=t.state.facet(w)?v.init(t.state):e.apply(t)}});let b=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(b=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let x="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,O=o.lg.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(u.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=b(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,l=r.context.work(()=>x&&x()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:u.setState.of(new v(r.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,o.OO)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),w=s.r$.define({combine:e=>e.length?e[0]:null,enables:e=>[u.state,O,o.tk.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class S{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Q{constructor(e,t,n,i,r,s){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new Q(e.name,(e.alias||[]).concat(e.name).map(e=>e.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){for(let i of(t=t.toLowerCase(),e))if(i.alias.some(e=>e==t))return i;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}let P=s.r$.define(),C=s.r$.define({combine(e){if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function A(e){let t=e.facet(C);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function T(e,t){let n="",i=e.tabSize;if(9==e.facet(C).charCodeAt(0))for(;t>=i;)n+=" ",t-=i;for(let r=0;r=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=s-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return(0,s.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let s=r(i);if(s>-1)return s}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let z=new r.md;function D(e,t,n){for(;e;e=e.parent){let i=function(e){let t=e.type.prop(z);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(r.md.closedBy))){let s=e.lastChild,o=s&&i.indexOf(s.name)>-1;return e=>E(e,!0,1,void 0,o&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?s.from:void 0)}return null==e.parent?M:null}(e);if(i)return i($.create(n,t,e))}return null}function M(){return 0}class $ extends R{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.node=n}static create(e,t,n){return new $(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?D(e,this.pos,this.base):0}}function N({closing:e,align:t=!0,units:n=1}){return i=>E(i,t,n,e)}function E(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,a=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.frome.baseIndent;function B({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}function J(){return s.yy.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let s=n.sliceString(r.from,i);if(!t.some(e=>e.test(s)))return e;let{state:o}=e,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let u=I(o,c.from);if(null==u)continue;let f=/^\s*/.exec(c.text)[0],d=T(o,u);f!=d&&a.push({from:c.from,to:c.from+f.length,insert:d})}return a.length?[e,{changes:a,sequential:!0}]:e})}let L=s.r$.define(),j=new r.md;function _(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&o.from=t&&a.to>n&&(s=a)}}return s}(e,t,n)}function q(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let U=s.Py.define({map:q}),X=s.Py.define({map:q});function V(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let Z=s.QQ.define({create:()=>o.p.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))n.is(U)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,n.value.from,n.value.to)?e=e.update({add:[el.range(n.value.from,n.value.to)]}):n.is(X)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let i=!1,{head:r}=t.selection.main;e.between(r,r,(e,t)=>{er&&(i=!0)}),i&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>o.tk.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})}),r}function Y(e,t){return e.field(Z,!1)?t:t.concat(s.Py.appendConfig.of(eo()))}let H=e=>{for(let t of V(e)){let n=F(e.state,t.from,t.to);if(n)return e.dispatch({effects:Y(e.state,[U.of(n),ee(e,n)])}),!0}return!1},K=e=>{if(!e.state.field(Z,!1))return!1;let t=[];for(let n of V(e)){let i=G(e.state,n.from,n.to);i&&t.push(X.of(i),ee(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function ee(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return o.tk.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let et=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Z,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(X.of({from:e,to:t}))}),e.dispatch({effects:n}),!0},ei=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:H},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:K},{key:"Ctrl-Alt-[",run:et},{key:"Ctrl-Alt-]",run:en}],er={placeholderDOM:null,placeholderText:"…"},es=s.r$.define({combine:e=>(0,s.BO)(e,er)});function eo(e){let t=[Z,eu];return e&&t.push(es.of(e)),t}let el=o.p.replace({widget:new class extends o.l9{toDOM(e){let{state:t}=e,n=t.facet(es),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=G(e.state,n.from,n.to);i&&e.dispatch({effects:X.of(i)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,i);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}}}),ea={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class eh extends o.SJ{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function ec(e={}){let t=Object.assign(Object.assign({},ea),e),n=new eh(t,!0),i=new eh(t,!1),r=o.lg.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(w)!=e.state.facet(w)||e.startState.field(Z,!1)!=e.state.field(Z,!1)||p(e.startState)!=p(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new s.f_;for(let r of e.viewportLineBlocks){let o=G(e.state,r.from,r.to)?i:F(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:l}=t;return[r,(0,o.v5)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||s.Xs.empty},initialSpacer:()=>new eh(t,!1),domEventHandlers:Object.assign(Object.assign({},l),{click(e,t,n){if(l.click&&l.click(e,t,n))return!0;let i=G(e.state,t.from,t.to);if(i)return e.dispatch({effects:X.of(i)}),!0;let r=F(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:U.of(r)}),!0)}})}),eo()]}let eu=o.tk.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ef{constructor(e,t){let n;function i(e){let t=a.V.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof u?e=>e.prop(h)==s.data:s?e=>e==s:void 0,this.style=(0,l.QR)(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new a.V(n):null,this.themeType=t.themeType}static define(e,t){return new ef(e,t||{})}}let ed=s.r$.define(),ep=s.r$.define({combine:e=>e.length?[e[0]]:null});function em(e){let t=e.facet(ed);return t.length?t:e.facet(ep)}function eg(e,t){let n=[ek],i;return e instanceof ef&&(e.module&&n.push(o.tk.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(ep.of(e)):i?n.push(ed.computeN([o.tk.darkTheme],t=>t.facet(o.tk.darkTheme)==("dark"==i)?[e]:[])):n.push(ed.of(e)),n}let ek=s.Wl.high(o.lg.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,em(e.state))}update(e){let t=p(e.state),n=em(e.state),i=n!=em(e.startState);t.length{n.add(e,t,this.markCache[i]||(this.markCache[i]=o.p.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),ey=ef.define([{tag:l.pJ.meta,color:"#7a757a"},{tag:l.pJ.link,textDecoration:"underline"},{tag:l.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:l.pJ.emphasis,fontStyle:"italic"},{tag:l.pJ.strong,fontWeight:"bold"},{tag:l.pJ.strikethrough,textDecoration:"line-through"},{tag:l.pJ.keyword,color:"#708"},{tag:[l.pJ.atom,l.pJ.bool,l.pJ.url,l.pJ.contentSeparator,l.pJ.labelName],color:"#219"},{tag:[l.pJ.literal,l.pJ.inserted],color:"#164"},{tag:[l.pJ.string,l.pJ.deleted],color:"#a11"},{tag:[l.pJ.regexp,l.pJ.escape,l.pJ.special(l.pJ.string)],color:"#e40"},{tag:l.pJ.definition(l.pJ.variableName),color:"#00f"},{tag:l.pJ.local(l.pJ.variableName),color:"#30a"},{tag:[l.pJ.typeName,l.pJ.namespace],color:"#085"},{tag:l.pJ.className,color:"#167"},{tag:[l.pJ.special(l.pJ.variableName),l.pJ.macroName],color:"#256"},{tag:l.pJ.definition(l.pJ.propertyName),color:"#00c"},{tag:l.pJ.comment,color:"#940"},{tag:l.pJ.invalid,color:"#f00"}]),ev=o.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),eb="()[]{}",ex=s.r$.define({combine:e=>(0,s.BO)(e,{afterCursor:!0,brackets:eb,maxScanDistance:1e4,renderMatch:eS})}),eO=o.p.mark({class:"cm-matchingBracket"}),ew=o.p.mark({class:"cm-nonmatchingBracket"});function eS(e){let t=[],n=e.matched?eO:ew;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let eQ=s.QQ.define({create:()=>o.p.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],i=t.state.facet(ex);for(let r of t.state.selection.ranges){if(!r.empty)continue;let s=eT(t.state,r.head,-1,i)||r.head>0&&eT(t.state,r.head-1,1,i)||i.afterCursor&&(eT(t.state,r.head,1,i)||r.heado.tk.decorations.from(e)}),eP=[eQ,ev];function eC(e={}){return[ex.of(e),eP]}function eA(e,t,n){let i=e.prop(t<0?r.md.openedBy:r.md.closedBy);if(i)return i;if(1==e.name.length){let s=n.indexOf(e.name);if(s>-1&&s%2==(t<0?1:0))return[n[s+t]]}return null}function eT(e,t,n,i={}){let r=i.maxScanDistance||1e4,s=i.brackets||eb,o=p(e),l=o.resolveInner(t,n);for(let a=l;a;a=a.parent){let h=eA(a.type,n,s);if(h&&a.from=i.to){if(0==a&&r.indexOf(h.type.name)>-1&&h.from0)return null;let h={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let f=0;!c.next().done&&f<=s;){let d=c.value;n<0&&(f+=d.length);let p=t+f*n;for(let m=n>0?0:d.length-1,g=n>0?d.length:-1;m!=g;m+=n){let k=o.indexOf(d[m]);if(!(k<0)&&i.resolveInner(p+m,1).type==r){if(k%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:p+m,to:p+m+1},matched:k>>1==a>>1};u--}}}n>0&&(f+=d.length)}return c.done?{start:h,matched:!1}:null}(e,t,n,o,l.type,r,s)}function eI(e,t,n,i=0,r=0){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);let s=r;for(let o=i;o=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?e.toLowerCase():e;return i(this.string.substr(this.pos,e.length))==i(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function ez(e){if("object"!=typeof e)return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}class eD extends u{constructor(e){let t,n=c(e.languageData),i={name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||ez,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||eE},s;super(n,new class extends r._b{createParse(e,t,n){return new e$(s,e,t,n)}},[P.of((e,t)=>this.getIndent(e,t))],e.name),this.topNode=(t=r.Jq.define({id:eW.length,name:"Document",props:[h.add(()=>n)]}),eW.push(t),t),s=this,this.streamParser=i,this.stateAfter=new r.md({perNode:!0}),this.tokenTable=e.tokenTable?new eF(i.tokenTable):eq}static define(e){return new eD(e)}getIndent(e,t){let n=p(e.state),i=n.resolve(t);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let r=eM(this,n,0,i.from,t),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(e.unit),s=0),t-s>1e4)return null;for(;s=i&&n+t.length<=s&&t.prop(e.stateAfter);if(o)return{state:e.streamParser.copyState(o),pos:n+t.length};for(let l=t.children.length-1;l>=0;l--){let a=t.children[l],h=n+t.positions[l],c=a instanceof r.mp&&hn&&eM(e,s.tree,0-s.offset,n,l),h;if(a&&(h=function e(t,n,i,s,o){if(o&&i<=0&&s>=n.length)return n;o||n.type!=t.topNode||(o=!0);for(let l=n.children.length-1;l>=0;l--){let a=n.positions[l],h=n.children[l],c;if(a=t)?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let n=t.indexOf("\n");n>-1&&(t=t.slice(0,n))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let i=this.rangeIndex;;){let r=this.ranges[i].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),++i==this.ranges.length))break;let s=this.ranges[i].from,o=this.lineAfter(s);t+=o,n=s+o.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let i=this.ranges[this.rangeIndex].to,r=e+t;if(n>0?i>r:i>=r)break;t+=this.ranges[++this.rangeIndex].from-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let s=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-s}return this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),i=0,{streamParser:r}=this.lang,s=new eR(t,e?e.state.tabSize:4,e?A(e.state):2);if(s.eol())r.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let o=eN(r.token,s,this.state);if(o&&(i=this.emitToken(this.lang.tokenTable.resolve(o),this.parsedPos+s.start,this.parsedPos+s.pos,4,i)),s.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPost.start)return r}throw Error("Stream parser failed to advance stream.")}let eE=Object.create(null),eW=[r.Jq.none],eB=new r.Lj(eW),eJ=[],eL=Object.create(null);for(let[ej,e_]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])eL[ej]=eX(eE,e_);class eF{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),eL)}resolve(e){return e?this.table[e]||(this.table[e]=eX(this.extra,e)):0}}let eq=new eF(eE);function eU(e,t){eJ.indexOf(e)>-1||(eJ.push(e),console.warn(t))}function eX(e,t){let n=null;for(let i of t.split(".")){let s=e[i]||l.pJ[i];s?"function"==typeof s?n?n=s(n):eU(i,`Modifier ${i} used at start of tag`):n?eU(i,`Tag ${i} used as modifier`):n=s:eU(i,`Unknown highlighting tag ${i}`)}if(!n)return 0;let o=t.replace(/ /g,"_"),a=r.Jq.define({id:eW.length,name:o,props:[(0,l.Gv)({[o]:n})]});return eW.push(a),a.id}},78120:function(e,t,n){let i;n.d(t,{BO:function(){return ex},D0:function(){return ek},Gz:function(){return eB},IS:function(){return eW},Py:function(){return eu},QQ:function(){return q},Wl:function(){return V},Xs:function(){return eP},YW:function(){return ef},as:function(){return A},bg:function(){return x},cp:function(){return m},f_:function(){return eC},gc:function(){return P},gm:function(){return b},jT:function(){return N},n0:function(){return C},nZ:function(){return O},q6:function(){return ea},r$:function(){return B},uU:function(){return eO},xv:function(){return r},yy:function(){return eb}});class r{constructor(){}lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),o.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),o.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new a(this),r=new a(e);for(let s=t,o=t;;){if(i.next(s),r.next(s),s=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new a(this,e)}iterRange(e,t=this.length){return new h(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new s(e):o.from(s.split(e,[])):r.empty}}class s extends r{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.text[r],o=i+s.length;if((t?n:o)>=e)return new u(i,o,n,s);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new s(l(this.text,[""],e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let o=n.pop(),a=l(r.text,o.text.slice(),0,r.length);if(a.length<=32)n.push(new s(a,o.length+r.length));else{let h=a.length>>1;n.push(new s(a.slice(0,h)),new s(a.slice(h)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof s))return super.replace(e,t,n);let i=l(this.text,l(n.text,l(this.text,[""],0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new s(i,r):o.from(s.split(i,[]),r)}sliceString(e,t=this.length,n="\n"){let i="";for(let r=0,s=0;r<=t&&se&&s&&(i+=n),er&&(i+=o.slice(Math.max(0,e-r),t-r)),r=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new s(n,i)),n=[],i=-1);return i>-1&&t.push(new s(n,i)),t}}class o extends r{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.children[r],o=i+s.length,l=n+s.lines-1;if((t?l:o)>=e)return s.lineInner(e,t,n,i);i=o+1,n=l+1}}decompose(e,t,n,i){for(let r=0,s=0;s<=t&&r=s){let a=i&((s<=e?1:0)|(l>=t?2:0));s>=e&&l<=t&&!a?n.push(o):o.decompose(e-s,t-s,n,a)}s=l+1}}replace(e,t,n){if(n.lines=r&&t<=l){let a=s.replace(e-r,t-r,n),h=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[i]=a,new o(c,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){let i="";for(let r=0,s=0;re&&r&&(i+=n),es&&(i+=o.sliceString(e-s,t-s,n)),s=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof o))return 0;let n=0,[i,r,s,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==s||r==l)return n;let a=this.children[i],h=e.children[r];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let i of e)n+=i.lines;if(n<32){let r=[];for(let l of e)l.flatten(r);return new s(r,t)}let a=Math.max(32,n>>5),h=a<<1,c=a>>1,u=[],f=0,d=-1,p=[];function m(){0!=f&&(u.push(1==p.length?p[0]:o.from(p,d)),d=-1,f=p.length=0)}for(let g of e)!function e(t){let n;if(t.lines>h&&t instanceof o)for(let i of t.children)e(i);else t.lines>c&&(f>c||!f)?(m(),u.push(t)):t instanceof s&&f&&(n=p[p.length-1])instanceof s&&t.lines+n.lines<=32?(f+=t.lines,d+=t.length+1,p[p.length-1]=new s(n.text.concat(t.text),n.length+1+t.length)):(f+t.lines>a&&m(),f+=t.lines,d+=t.length+1,p.push(t))}(g);return m(),1==u.length?u[0]:new o(u,t)}}function l(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(a>i&&(l=l.slice(0,i-r)),r0?1:(e instanceof s?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,l=i instanceof s?i.text.length:i.children.length;if(o==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof s){let a=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=0==e?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let h=i.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof s?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class h{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new a(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(r.prototype[Symbol.iterator]=function(){return this.iter()},a.prototype[Symbol.iterator]=h.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class u{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}let f="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let d=1;d=127462&&e<=127487}function m(e,t,n=!0,i=!0){return(n?g:k)(e,t,i)}function g(e,t,n){if(t==e.length)return t;t&&y(e.charCodeAt(t))&&v(e.charCodeAt(t-1))&&t--;let i=b(e,t);for(t+=O(i);te)return f[t-1]<=e;return!1}(r))t+=O(r),i=r;else if(p(r)){let s=0,o=t-2;for(;o>=0&&p(b(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function k(e,t,n){for(;t>0;){let i=g(e,t-2,n);if(i=56320&&e<57344}function v(e){return e>=55296&&e<56320}function b(e,t){let n=e.charCodeAt(t);if(!v(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return y(i)?(n-55296<<10)+(i-56320)+65536:n}function x(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function O(e){return e<65536?1:2}let w=/\r\n?|\n/;var S,Q,P=((S=P||(P={}))[S.Simple=0]="Simple",S[S.TrackDel=1]="TrackDel",S[S.TrackBefore=2]="TrackBefore",S[S.TrackAfter=3]="TrackAfter",S);class C{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-i);r+=o}else{if(n!=P.Simple&&a>=e&&(n==P.TrackDel&&ie||n==P.TrackBefore&&ie))return null;if(a>e||a==e&&t<0&&!o)return e==i||t<0?r:r+l;r+=l}i=a}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&o>=e)return!(it)||"cover";i=o}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new C(e)}static create(e){return new C(e)}}class A extends C{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return R(this,(t,n,i,r,s)=>e=e.replace(i,i+(n-t),s),!1),e}mapDesc(e,t=!1){return z(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,s=0;i=0){t[i]=l,t[i+1]=o;let a=i>>1;for(;n.length0&&I(n,t,r.text),r.forward(a),o+=a}let c=e[s++];for(;o>1].toJSON()))}return e}static of(e,t,n){let i=[],s=[],o=0,l=null;function a(e=!1){if(!e&&!i.length)return;of||u<0||f>t)throw RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let p=d?"string"==typeof d?r.of(d.split(n||w)):d:r.empty,m=p.length;if(u==f&&0==m)return;uo&&T(i,u-o,-1),T(i,f-u,m),I(s,i,p),o=f}}(e),a(!l),l}static empty(e){return new A(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;it&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==s.length)t.push(s[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function I(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i>1])),!n&&l!=e.sections.length&&!(e.sections[l+1]<0);)a=e.sections[l++],h=e.sections[l++];t(s,c,o,u,f),s=c,o=u}}}function z(e,t,n,i=!1){let r=[],s=i?[]:null,o=new M(e),l=new M(t);for(let a=-1;;)if(-1==o.ins&&-1==l.ins){let h=Math.min(o.len,l.len);T(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||0==o.off&&(l.len=0&&a=0){let f=0,d=o.len;for(;d;)if(-1==l.ins){let p=Math.min(d,l.len);f+=p,d-=p,l.forward(p)}else if(0==l.ins&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}else T(i,0,o.ins,l),r&&I(r,i,o.text),o.next()}}class M{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?r.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?r.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ${constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let e=3&this.flags;return 3==e?null:e}get goalColumn(){let e=this.flags>>5;return 33554431==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new $(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return N.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return N.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return N.range(e.anchor,e.head)}static create(e,t,n){return new $(e,t,n)}}class N{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:N.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new N(e.ranges.map(e=>$.fromJSON(e)),e.main)}static single(e,t=e){return new N([N.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;ie?4:0))}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let i=1;ir.head?N.range(l,o):N.range(o,l))}}return new N(e,t)}}function E(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let W=0;class B{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=W++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}static define(e={}){return new B(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:J),!!e.static,e.enables)}of(e){return new L([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new L(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new L(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function J(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class L{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=W++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,s=e[r]>>1,o=2==this.type,l=!1,a=!1,h=[];for(let c of this.dependencies)"doc"==c?l=!0:"selection"==c?a=!0:((null!==(t=e[c.id])&&void 0!==t?t:1)&1)==0&&h.push(e[c.id]);return{create:e=>(e.values[s]=n(e),1),update(e,t){if(l&&t.docChanged||a&&(t.docChanged||t.selection)||_(e,h)){let r=n(e);if(o?!j(r,e.values[s],i):!i(r,e.values[s]))return e.values[s]=r,1}return 0},reconfigure:(e,t)=>{let l=n(e),a=t.config.address[r];if(null!=a){let h=ee(t,a);if(this.dependencies.every(n=>n instanceof B?t.facet(n)===e.facet(n):!(n instanceof q)||t.field(n,!1)==e.field(n,!1))||(o?j(l,h,i):i(l,h)))return e.values[s]=h,0}return e.values[s]=l,1}}}}function j(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(F).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,F.of({field:this,create:e})]}get extension(){return this}}let U={lowest:4,low:3,default:2,high:1,highest:0};function X(e){return t=>new Z(t,e)}let V={highest:X(U.highest),high:X(U.high),default:X(U.default),low:X(U.low),lowest:X(U.lowest)};class Z{constructor(e,t){this.inner=e,this.prec=t}}class G{of(e){return new Y(this,e)}reconfigure(e){return G.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Y{constructor(e,t){this.compartment=e,this.inner=t}}class H{constructor(e,t,n,i,r,s){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i,r,s=[],o=Object.create(null),l=new Map;for(let a of(i=[[],[],[],[],[]],r=new Map,!function e(n,s){let o=r.get(n);if(null!=o){if(o<=s)return;let a=i[o].indexOf(n);a>-1&&i[o].splice(a,1),n instanceof Y&&l.delete(n.compartment)}if(r.set(n,s),Array.isArray(n))for(let h of n)e(h,s);else if(n instanceof Y){if(l.has(n.compartment))throw RangeError("Duplicate use of compartment in extensions");let c=t.get(n.compartment)||n.inner;l.set(n.compartment,c),e(c,s)}else if(n instanceof Z)e(n.inner,n.prec);else if(n instanceof q)i[s].push(n),n.provides&&e(n.provides,s);else if(n instanceof L)i[s].push(n),n.facet.extensions&&e(n.facet.extensions,U.default);else{let u=n.extension;if(!u)throw Error(`Unrecognized extension value in extension set (${n}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(u,s)}}(e,U.default),i.reduce((e,t)=>e.concat(t))))a instanceof q?s.push(a):(o[a.facet.id]||(o[a.facet.id]=[])).push(a);let h=Object.create(null),c=[],u=[];for(let f of s)h[f.id]=u.length<<1,u.push(e=>f.slot(e));let d=null==n?void 0:n.config.facets;for(let p in o){let m=o[p],g=m[0].facet,k=d&&d[p]||[];if(m.every(e=>0==e.type)){if(h[g.id]=c.length<<1|1,J(k,m))c.push(n.facet(g));else{let y=g.combine(m.map(e=>e.value));c.push(n&&g.compare(y,n.facet(g))?n.facet(g):y)}}else{for(let v of m)0==v.type?(h[v.id]=c.length<<1|1,c.push(v.value)):(h[v.id]=u.length<<1,u.push(e=>v.dynamicSlot(e)));h[g.id]=u.length<<1,u.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),s=i.filter(e=>!(1&e)),o=e[t.id]>>1;function l(e){let n=[];for(let s=0;se(h));return new H(e,l,b,h,c,o)}}function K(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function ee(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let et=B.define(),en=B.define({combine:e=>e.some(e=>e),static:!0}),ei=B.define({combine:e=>e.length?e[0]:void 0,static:!0}),er=B.define(),es=B.define(),eo=B.define(),el=B.define({combine:e=>!!e.length&&e[0]});class ea{constructor(e,t){this.type=e,this.value=t}static define(){return new eh}}class eh{of(e){return new ea(this,e)}}class ec{constructor(e){this.map=e}of(e){return new eu(this,e)}}class eu{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new eu(this.type,t)}is(e){return this.type==e}static define(e={}){return new ec(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let r=i.map(t);r&&n.push(r)}return n}}eu.reconfigure=eu.define(),eu.appendConfig=eu.define();class ef{constructor(e,t,n,i,r,s){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,n&&E(n,t.newLength),r.some(e=>e.type==ef.time)||(this.annotations=r.concat(ef.time.of(Date.now())))}static create(e,t,n,i,r,s){return new ef(e,t,n,i,r,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ef.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function ed(e,t,n){var i;let r,s,o;return n?(r=t.changes,s=A.empty(t.changes.length),o=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),s=e.changes.mapDesc(t.changes,!0),o=e.changes.compose(r)),{changes:o,selection:t.selection?t.selection.map(s):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:eu.mapEffects(e.effects,r).concat(eu.mapEffects(t.effects,s)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ep(e,t,n){let i=t.selection,r=eg(t.annotations);return t.userEvent&&(r=r.concat(ef.userEvent.of(t.userEvent))),{changes:t.changes instanceof A?t.changes:A.of(t.changes||[],n,e.facet(ei)),selection:i&&(i instanceof N?i:N.single(i.anchor,i.head)),effects:eg(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}ef.time=ea.define(),ef.userEvent=ea.define(),ef.addToHistory=ea.define(),ef.remote=ea.define();let em=[];function eg(e){return null==e?em:Array.isArray(e)?e:[e]}var ek=((Q=ek||(ek={}))[Q.Word=0]="Word",Q[Q.Space=1]="Space",Q[Q.Other=2]="Other",Q);let ey=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(ev){}class eb{constructor(e,t,n,i,r,s){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let o=0;o=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=ed(i,ep(t,s,e.changes.newLength),!0))}return i==e?e:ef.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(t){let n=t.startState,i=!0;for(let r of n.facet(er)){let s=r(t);if(!1===s){i=!1;break}Array.isArray(s)&&(i=!0===i?s:function(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else{if(!(r=0;c--){let u=h[c](t);t=u instanceof ef?u:Array.isArray(u)&&1==u.length&&u[0]instanceof ef?u[0]:e(n,eg(u),!1)}return t}(l):l)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let s of e.effects)s.is(G.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(s.value.compartment,s.value.extension)):s.is(eu.reconfigure)?(n=null,i=s.value):s.is(eu.appendConfig)&&(n=null,i=eg(i).concat(s.value));n?t=e.startState.values.slice():(n=H.resolve(i,r,this),t=new eb(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values),new eb(n,e.newDoc,e.newSelection,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:N.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],s=eg(n.effects);for(let o=1;os.spec.fromJSON(o,e)))}}return eb.create({doc:e.doc,selection:N.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=H.resolve(e.extensions||[],new Map),n=e.doc instanceof r?e.doc:r.of((e.doc||"").split(t.staticFacet(eb.lineSeparator)||w)),i=e.selection?e.selection instanceof N?e.selection:N.single(e.selection.anchor,e.selection.head):N.single(0);return E(i,n.length),t.staticFacet(en)||(i=i.asSingle()),new eb(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(eb.tabSize)}get lineBreak(){return this.facet(eb.lineSeparator)||"\n"}get readOnly(){return this.facet(el)}phrase(e,...t){for(let n of this.facet(eb.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(et))for(let s of r(this,t,n))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){var t;return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return ek.Space;if(function(e){if(i)return i.test(e);for(let t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ey.test(n)))return!0}return!1}(e))return ek.Word;for(let n=0;n-1)return ek.Word;return ek.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let l=m(t,s,!1);if(r(t.slice(l,s))!=ek.Word)break;s=l}for(;oe.length?e[0]:4}),eb.lineSeparator=ei,eb.readOnly=el,eb.phrases=B.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),eb.languageData=et,eb.changeFilter=er,eb.transactionFilter=es,eb.transactionExtender=eo,G.reconfigure=eu.define();class eO{eq(e){return this==e}range(e,t=e){return ew.create(e,t,this)}}eO.prototype.startSide=eO.prototype.endSide=0,eO.prototype.point=!1,eO.prototype.mapMode=P.TrackDel;class ew{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new ew(e,t,n)}}function eS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class eQ{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let s=i,o=r.length;;){if(s==o)return s;let l=s+o>>1,a=r[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-t;if(l==s)return a>=0?s:o;a>=0?o=l:s=l+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),s=this.findIndex(n,1e9,!1,r);r(f=t.mapPos(c,a.endSide))||u==f&&a.startSide>0&&a.endSide<=0)continue;0>(f-u||a.endSide-a.startSide)||(s<0&&(s=u),a.point&&(o=Math.max(o,f-u)),n.push(a),i.push(u-s),r.push(f-s))}return{mapped:n.length?new eQ(i,r,n,o):null,pos:s}}}class eP{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new eP(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(n&&(t=t.slice().sort(eS)),this.isEmpty)return t.length?eP.of(t):this;let o=new eT(this,null,-1).goto(0),l=0,a=[],h=new eC;for(;o.value||l=0){let c=t[l++];h.addInner(c.from,c.to,c.value)||a.push(c)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+s.length&&!1===s.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return eI.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return eI.from(e).goto(t)}static compare(e,t,n,i,r=-1){let s=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),l=eA(s,o,n),a=new ez(s,l,r),h=new ez(o,l,r);n.iterGaps((e,t,n)=>eD(a,e,h,t,n,i)),n.empty&&0==n.length&&eD(a,0,h,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=1e9);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),s=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=eA(r,s),l=new ez(r,o,0).goto(n),a=new ez(s,o,0).goto(n);for(;;){if(l.to!=a.to||!eM(l.active,a.active)||l.point&&(!a.point||!l.point.eq(a.point)))return!1;if(l.to>i)return!0;l.next(),a.next()}}static spans(e,t,n,i,r=-1){let s=new ez(e,null,r).goto(t),o=t,l=s.openStart;for(;;){let a=Math.min(s.to,n);if(s.point?(i.point(o,a,s.point,s.activeForPoint(s.to),l,s.pointRank),l=s.openEnd(a)+(s.to>a?1:0)):a>o&&(i.span(o,a,s.active,l),l=s.openEnd(a)),s.to>n)break;o=s.to,s.next()}return l}static of(e,t=!1){let n=new eC;for(let i of e instanceof ew?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(eS);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}}eP.empty=new eP([],[],null,-1),eP.empty.nextLayer=eP.empty;class eC{constructor(){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}finishChunk(e){this.chunks.push(new eQ(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,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new eC)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(eP.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=eP.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function eA(e,t,n){let i=new Map;for(let r of e)for(let s=0;s(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new eT(s,t,n,r));return 1==i.length?i[0]:new eI(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)eR(this.heap,i);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)eR(this.heap,i);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),eR(this.heap,0)}}}function eR(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}class ez{constructor(e,t,n){this.minPoint=n,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=eI.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){e$(this.active,e),e$(this.activeTo,e),e$(this.activeRank,e),this.minActive=eE(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&e$(n,r)}else if(this.cursor.value){if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let s=this.cursor.value;if(s.point){if(t&&this.cursor.to==this.to&&this.cursor.frome&&i++,this.cursor.next()}}else{this.to=this.endSide=1e9;break}}if(n){let o=0;for(;o=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function eD(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,a=i-t;for(;;){let h=e.to+a-n.to||e.endSide-n.endSide,c=h<0?e.to+a:n.to,u=Math.min(c,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&eM(e.activeForPoint(e.to+a),n.activeForPoint(n.to))||s.comparePoint(l,u,e.point,n.point):u>l&&!eM(e.active,n.active)&&s.compareRange(l,u,e.active,n.active),c>o)break;l=c,h<=0&&e.next(),h>=0&&n.next()}}function eM(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function eE(e,t){let n=-1,i=1e9;for(let r=0;r(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function eW(e,t,n=e.length){let i=0;for(let r=0;r=t)return r;if(r==e.length)break;s+=9==e.charCodeAt(r)?n-s%n:1,r=m(e,r)}return!0===i?-1:e.length}},41113:function(e,t,n){var i,r;n.d(t,{FE:function(){return $},Jq:function(){return u},L3:function(){return s},Lj:function(){return f},_b:function(){return D},hr:function(){return R},i9:function(){return z},md:function(){return a},mp:function(){return m},vj:function(){return i}});let s=1024,o=0;class l{constructor(e,t){this.from=e,this.to=t}}class a{constructor(e={}){this.id=o++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=u.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}a.closedBy=new a({deserialize:e=>e.split(" ")}),a.openedBy=new a({deserialize:e=>e.split(" ")}),a.group=new a({deserialize:e=>e.split(" ")}),a.contextHash=new a({perNode:!0}),a.lookAhead=new a({perNode:!0}),a.mounted=new a({perNode:!0});class h{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}let c=Object.create(null);class u{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):c,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new u(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(a.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(a.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}u.none=new u("",Object.create(null),0,8);class f{constructor(e){this.types=e;for(let t=0;t=r&&(o.type.isAnonymous||!1!==t(o))){if(o.firstChild())continue;l=!0}for(;l&&n&&!o.type.isAnonymous&&n(o),!o.nextSibling();){if(!o.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:I(u.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new m(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new m(u.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=s,reused:o=[],minRepeatType:l=i.types.length}=e,h=Array.isArray(n)?new g(n,n.length):n,c=i.types,u=0,f=0;function d(e,t,n,r,s,o,l,a){let h=[],c=[];for(;e.length>r;)h.push(e.pop()),c.push(t.pop()+n-s);e.push(p(i.types[l],h,c,o-s,a-o)),t.push(s-n)}function p(e,t,n,i,r=0,s){if(u){let o=[a.contextHash,u];s=s?[o].concat(s):[o]}if(r>25){let l=[a.lookAhead,r];s=s?[l].concat(s):[l]}return new m(e,t,n,i,s)}let y=[],v=[];for(;h.pos>0;)!function e(t,n,s,g,y){let{id:v,start:b,end:x,size:O}=h,w=f;for(;O<0;){if(h.next(),-1==O){let S=o[v];s.push(S),g.push(b-t);return}if(-3==O){u=v;return}if(-4==O){f=v;return}throw RangeError(`Unrecognized record size: ${O}`)}let Q=c[v],P,C,A=b-t;if(x-b<=r&&(C=function(e,t){let n=h.fork(),i=0,s=0,o=0,a=n.end-r,c={size:0,start:0,skip:0};n:for(let u=n.pos-e;n.pos>u;){let f=n.size;if(n.id==t&&f>=0){c.size=i,c.start=s,c.skip=o,o+=4,i+=4,n.next();continue}let d=n.pos-f;if(f<0||d=l?4:0,m=n.start;for(n.next();n.pos>d;){if(n.size<0){if(-3==n.size)p+=4;else break n}else n.id>=l&&(p+=4);n.next()}s=m,i+=f,o+=p}return(t<0||i==e)&&(c.size=i,c.start=s,c.skip=o),c.size>4?c:void 0}(h.pos-n,y))){let T=new Uint16Array(C.size-C.skip),R=h.pos-C.size,z=T.length;for(;h.pos>R;)z=function e(t,n,i){let{id:r,start:s,end:o,size:a}=h;if(h.next(),a>=0&&r4){let d=h.pos-(a-4);for(;h.pos>d;)i=e(t,n,i)}n[--i]=c,n[--i]=o-t,n[--i]=s-t,n[--i]=r}else -3==a?u=r:-4==a&&(f=r);return i}(C.start,T,z);P=new k(T,x-C.start,i),A=C.start-t}else{let D=h.pos-O;h.next();let M=[],$=[],N=v>=l?v:-1,E=0,W=x;for(;h.pos>D;)N>=0&&h.id==N&&h.size>=0?(h.end<=W-r&&(d(M,$,b,E,h.end,W,N,w),E=M.length,W=h.end),h.next()):e(b,D,M,$,N);if(N>=0&&E>0&&E-1&&E>0){let B=function(e){return(t,n,i)=>{let r=0,s=t.length-1,o,l;if(s>=0&&(o=t[s])instanceof m){if(!s&&o.type==e&&o.length==i)return o;(l=o.prop(a.lookAhead))&&(r=n[s]+o.length+l)}return p(e,t,n,i,r)}}(Q);P=I(Q,M,$,0,M.length,0,x-b,B,B)}else P=p(Q,M,$,x-b,w-x)}s.push(P),g.push(A)}(e.start||0,e.bufferStart||0,y,v,-1);let b=null!==(t=e.length)&&void 0!==t?t:y.length?v[0]+y[0].length:0;return new m(c[e.topID],y.reverse(),v.reverse(),b)}(e)}}m.empty=new m(u.none,[],[],0);class g{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new g(this.buffer,this.index)}}class k{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return u.none}toString(){let e=[];for(let t=0;t0)));l=s[l+3]);return o}slice(e,t,n,i){let r=this.buffer,s=new Uint16Array(t-e);for(let o=e,l=0;o=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function v(e,t){let n=e.childBefore(t);for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(e=n,n=i.prevSibling):n=i}return e}function b(e,t,n,r){for(var s;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=c;e+=t){let u=l[e],f=h[e]+o.from;if(y(r,n,f,f+u.length)){if(u instanceof k){if(s&i.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,t,n-f,r);if(d>-1)return new Q(new S(o,u,e,f),null,d)}else if(s&i.IncludeAnonymous||!u.type.isAnonymous||C(u)){let p;if(!(s&i.IgnoreMounts)&&u.props&&(p=u.prop(a.mounted))&&!p.overlay)return new x(p.tree,f,e,o);let m=new x(u,f,e,o);return s&i.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,n,r)}}}if(s&i.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&i.IgnoreOverlays)&&(r=this._tree.prop(a.mounted))&&r.overlay){let s=e-this.from;for(let{from:o,to:l}of r.overlay)if((t>0?o<=s:o=s:l>s))return new x(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new P(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return b(this,e,t,!1)}resolveInner(e,t=0){return b(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}getChild(e,t=null,n=null){let i=O(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return O(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return w(this,e)}}function O(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(null!=n){for(;!r.type.is(n);)if(!r.nextSibling())return s}for(;;){if(null!=i&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return null==i?s:[]}}function w(e,t,n=t.length-1){for(let i=e.parent;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class S{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class Q{constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new Q(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&i.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Q(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Q(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Q(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new P(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let s=n.buffer[this.index+1],o=n.buffer[this.index+2];e.push(n.slice(i,r,s,o)),t.push(0)}return new m(this.type,e,t,this.to-this.from)}resolve(e,t=0){return b(this,e,t,!1)}resolveInner(e,t=0){return b(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let i=O(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return O(this,e,t,n)}get node(){return this}matchContext(e){return w(this,e)}}class P{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof x)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof x?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&i.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&i.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&i.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let o=t+e,l=e<0?-1:n._tree.children.length;o!=l;o+=e){let a=n._tree.children[o];if(this.mode&i.IncludeAnonymous||a instanceof k||!a.type.isAnonymous||C(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,n=r+1;break n}i=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return w(this.node,e,i);let s=n[t.buffer[this.stack[r]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function C(e){return e.children.some(e=>e instanceof k||!e.type.isAnonymous||C(e))}let A=new WeakMap;function T(e,t){if(!e.isAnonymous||t instanceof k||t.type!=e)return 1;let n=A.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof m)){n=1;break}n+=T(e,i)}A.set(t,n)}return n}function I(e,t,n,i,r,s,o,l,a){let h=0;for(let c=i;c=u)break;m+=g}if(h==c+1){if(m>u){let k=n[c];t(k.children,k.positions,0,k.children.length,i[c]+l);continue}f.push(n[c])}else{let y=i[h-1]+n[h-1].length-p;f.push(I(e,n,i,c,h,p,y,null,a))}d.push(p+l-s)}}(t,n,i,r,0),(l||a)(f,d,o)}class R{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Q?this.setBuffer(e.context.buffer,e.index,t):e instanceof x&&this.map.set(e.tree,t)}get(e){return e instanceof Q?this.getBuffer(e.context.buffer,e.index):e instanceof x?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class z{constructor(e,t,n,i,r=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new z(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,s=e.length?e[0]:null;for(let o=0,l=0,a=0;;o++){let h=o=n)for(;s&&s.from=u.from||c<=u.to||a){let f=Math.max(u.from,l)-a,d=Math.min(u.to,c)-a;u=f>=d?null:new z(f,d,u.tree,u.offset+a,o>0,!!h)}if(u&&i.push(u),s.to>c)break;s=rnew l(e.from,e.to)):[new l(0,0)]:[new l(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}}class M{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function $(e){return(t,n,i,r)=>new B(t,e,n,i,r)}class N{constructor(e,t,n,i,r){this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=r}}class E{constructor(e,t,n,i,r,s,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}let W=new a({perNode:!0});class B{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return null!=this.stoppedAt&&(n=new m(n.type,n.children,n.positions,n.length,n.propValues.concat([[W,this.stoppedAt]]))),n}let i=this.inner[this.innerDone],r=i.parse.advance();if(r){this.innerDone++;let s=Object.assign(Object.create(null),i.target.props);s[a.mounted.id]=new h(r,i.overlay,i.parser),i.target.props=s}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;te.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay);if(c)for(let f of c.mount.overlay){let d=f.from+c.pos,p=f.to+c.pos;d>=r.from&&p<=r.to&&!t.ranges.some(e=>e.fromd)&&t.ranges.push({from:d,to:p})}}a=!1}else if(n&&(o=function(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}(n.ranges,r.from,r.to)))a=2!=o;else if(!r.type.isAnonymous&&r.from=t.to);i++);let o=r.children[i],l=o.buffer;r.children[i]=function e(n,i,r,a,h){let c=n;for(;l[c+2]+s<=t.from;)c=l[c+3];let u=[],f=[];J(o,n,c,u,f,a);let d=l[c+1],p=l[c+2],g=d+s==t.from&&p+s==t.to&&l[c]==t.type.id;return u.push(g?t.toTree():e(c+4,l[c+3],o.set.types[l[c]],d,p-d)),f.push(d-a),J(o,l[c+3],i,u,f,a),new m(r,u,f,h)}(0,l.length,u.none,0,o.length);for(let a=0;a<=n;a++)e.childAfter(t.from)}(r);let g=e.findMounts(r.from,s.parser);if("function"==typeof s.overlay)t=new E(s.parser,s.overlay,g,this.inner.length,r.from,r.tree,t);else{let k=_(this.ranges,s.overlay||[new l(r.from,r.to)]);k.length&&this.inner.push(new N(s.parser,s.parser.startParse(this.input,F(g,k),k),s.overlay?s.overlay.map(e=>new l(e.from-r.from,e.to-r.from)):null,r.tree,k)),s.overlay?k.length&&(n={ranges:k,depth:0,prev:n}):a=!1}}else t&&(h=t.predicate(r))&&(!0===h&&(h=new l(r.from,r.to)),h.fromnew l(e.from-t.start,e.to-t.start)),t.target,y)),t=t.prev}!n||--n.depth||(n=n.prev)}}}}function J(e,t,n,i,r,s){if(t=e&&t.enter(n,1,i.IgnoreOverlays|i.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&0==t.positions[0]&&t.children[0]instanceof m)t=t.children[0];else break}return!1}}class j{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=null!==(t=n.tree.prop(W))&&void 0!==t?t:n.to,this.inner=new L(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(W))&&void 0!==e?e:t.to,this.inner=new L(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let s=null===(n=r.tree)||void 0===n?void 0:n.prop(a.mounted);if(s&&s.parser==t)for(let o=this.fragI;o=r.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:r.from-l.offset,mount:s})}}}return i}}function _(e,t){let n=null,i=t;for(let r=1,s=0;r=a)break;!(h.to<=o)&&(n||(i=n=t.slice()),h.froma&&n.splice(s+1,0,new l(a,h.to))):h.to>a?n[s--]=new l(a,h.to):n.splice(s--,1))}}return i}function F(e,t){let n=[];for(let{pos:i,mount:r,frag:s}of e){let o=i+(r.overlay?r.overlay[0].from:0),a=o+r.tree.length,h=Math.max(s.from,o),c=Math.min(s.to,a);if(r.overlay){let u=function(e,t,n,i){let r=0,s=0,o=!1,a=!1,h=-1e9,c=[];for(;;){let u=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:a?t[s].to:t[s].from;if(o!=a){let d=Math.max(h,n),p=Math.min(u,f,i);dnew l(e.from+i,e.to+i)),h,c);for(let f=0,d=h;;f++){let p=f==u.length,m=p?c:u[f].from;if(m>d&&n.push(new z(d,m,r.tree,-o,s.from>=d||s.openStart,s.to<=m||s.openEnd)),p)break;d=u[f].to}}else n.push(new z(h,c,r.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return n}},35524:function(e,t,n){n.d(t,{Gv:function(){return a},QR:function(){return u},Vp:function(){return s},bW:function(){return f},pJ:function(){return T}});var i=n(41113);let r=0;class s{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=r++}static define(e){if(null==e?void 0:e.base)throw Error("Can not derive from a modified tag");let t=new s([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new l;return t=>t.modified.indexOf(e)>-1?t:l.get(t.base||t,t.modified.concat(e).sort((e,t)=>e.id-t.id))}}let o=0;class l{constructor(){this.instances=[],this.id=o++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i;return n.base==e&&(i=n.modified,t.length==i.length&&t.every((e,t)=>e==i[t]))});if(n)return n;let i=[],r=new s(i,e,t);for(let o of t)o.instances.push(r);let a=function(e){let t=[[]];for(let n=0;nt.length-e.length)}(t);for(let h of e.set)if(!h.modified.length)for(let c of a)i.push(l.get(h,c));return r}}function a(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let r of(Array.isArray(i)||(i=[i]),n.split(" ")))if(r){let s=[],o=2,l=r;for(let a=0;;){if("..."==l&&a>0&&a+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw RangeError("Invalid path: "+r);if(s.push("*"==u[0]?"":'"'==u[0][0]?JSON.parse(u[0]):u[0]),(a+=u[0].length)==r.length)break;let f=r[a++];if(a==r.length&&"!"==f){o=0;break}if("/"!=f)throw RangeError("Invalid path: "+r);l=r.slice(a)}let d=s.length-1,p=s[d];if(!p)throw RangeError("Invalid path: "+r);let m=new c(i,o,d>0?s.slice(0,d):null);t[p]=m.sort(t[p])}}return h.add(t)}let h=new i.md;class c{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depththis.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(e=>!e.scope||e.scope(o)));let u=r,f=function(e){let t=e.type.prop(h);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||c.empty,d=function(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}(s,f.tags);if(d&&(u&&(u+=" "),u+=d,1==f.mode&&(r+=(r?" ":"")+d)),this.startSpan(e.from,u),f.opaque)return;let p=e.tree&&e.tree.prop(i.md.mounted);if(p&&p.overlay){let m=e.node.enter(p.overlay[0].from+l,1),g=this.highlighters.filter(e=>!e.scope||e.scope(p.tree.type)),k=e.firstChild();for(let y=0,v=l;;y++){let b=y=x)&&e.nextSibling()););if(!b||x>n)break;(v=b.to+l)>t&&(this.highlightRange(m.cursor(),Math.max(t,b.from+l),Math.min(n,v),r,g),this.startSpan(v,u))}k&&e.parent()}else if(e.firstChild()){do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}let p=s.define,m=p(),g=p(),k=p(g),y=p(g),v=p(),b=p(v),x=p(v),O=p(),w=p(O),S=p(),Q=p(),P=p(),C=p(P),A=p(),T={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:k,tagName:p(k),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:v,string:b,docString:p(b),character:p(b),attributeValue:p(b),number:x,integer:p(x),float:p(x),bool:p(v),regexp:p(v),escape:p(v),color:p(v),url:p(v),keyword:S,self:p(S),null:p(S),atom:p(S),unit:p(S),modifier:p(S),operatorKeyword:p(S),controlKeyword:p(S),definitionKeyword:p(S),moduleKeyword:p(S),operator:Q,derefOperator:p(Q),arithmeticOperator:p(Q),logicOperator:p(Q),bitwiseOperator:p(Q),compareOperator:p(Q),updateOperator:p(Q),definitionOperator:p(Q),typeOperator:p(Q),controlOperator:p(Q),punctuation:P,separator:p(P),bracket:C,angleBracket:p(C),squareBracket:p(C),paren:p(C),brace:p(C),content:O,heading:w,heading1:p(w),heading2:p(w),heading3:p(w),heading4:p(w),heading5:p(w),heading6:p(w),contentSeparator:p(O),list:p(O),quote:p(O),emphasis:p(O),strong:p(O),link:p(O),monospace:p(O),strikethrough:p(O),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:A,documentMeta:p(A),annotation:p(A),processingInstruction:p(A),definition:s.defineModifier(),constant:s.defineModifier(),function:s.defineModifier(),standard:s.defineModifier(),local:s.defineModifier(),special:s.defineModifier()};u([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}])},53105:function(e,t,n){n.d(t,{IK:function(){return I},Jq:function(){return v},WQ:function(){return R}});var i,r,s,o,l,a,h=n(41113),c=n(34155);class u{constructor(e,t,n,i,r,s,o,l,a,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=a,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new u(e,[],t,n,n,0,[],0,i?new f(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=65535&e,{parser:i}=this.p,r=i.dynamicPrecedence(n);if(r&&(this.score+=r),0==t){this.pushState(i.getGoto(this.state,n,!0),this.reducePos),ns;)this.stack.pop();this.reduceContext(n,o)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==s.buffer[o-4]&&s.buffer[o-1]>-1){if(t==n)return;if(s.buffer[o-2]>=t){s.buffer[o-2]=n;return}}}if(r&&this.pos!=n){let l=this.buffer.length;if(l>0&&0!=this.buffer[l-4])for(;l>0&&this.buffer[l-2]>n;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4);this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=n,this.buffer[l+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n){let i=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;(n>this.pos||t<=r.maxNode)&&(this.pos=n,r.stateFlag(e,1)||(this.reducePos=n)),this.pushState(e,i),this.shiftContext(t,i),t<=r.maxNode&&this.buffer.push(t,i,n,4)}else this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4)}apply(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new u(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new d(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if((65536&n)==0)return!0;if(0==n)return!1;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i1&t&&e==o)||n.push(t[s],o)}t=n}let l=[];for(let a=0;a>19);if(n<0||0>t.getGoto(this.stack[n],65535&e,!1))return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class f{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}(i=o||(o={}))[i.Insert=200]="Insert",i[i.Delete=190]="Delete",i[i.Reduce=100]="Reduce",i[i.MaxNext=4]="MaxNext",i[i.MaxInsertStackDepth=300]="MaxInsertStackDepth",i[i.DampenInsertStackDepth=120]="DampenInsertStackDepth";class d{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class p{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new p(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new p(this.stack,this.pos,this.index)}}class m{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let g=new m;class k{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=g,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t=this.chunk2Pos&&no.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=g,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class y{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,n,i){let r=0,s=1<0){let c=e[h];if(l.allows(c)&&(-1==t.token.value||t.token.value==c||o.overrides(c,t.token.value))){t.acceptToken(c);break}}let u=t.next,f=0,d=e[r+2];if(t.next<0&&d>f&&65535==e[a+3*d-3]&&65535==e[a+3*d-3]){r=e[a+3*d-1];continue n}for(;f>1,m=a+p+(p<<1),g=e[m],k=e[m+1]||65536;if(u=k)f=p+1;else{r=e[m+2],t.advance();continue n}}break}}(this.data,e,t,this.id)}}y.prototype.contextual=y.prototype.fallback=y.prototype.extend=!1;class v{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function b(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}let x=void 0!==c&&c.env&&/\bparse\b/.test(c.env.LOG),O=null;function w(e,t,n){let i=e.cursor(h.vj.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.tot)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}(r=l||(l={}))[r.Margin=25]="Margin";class S{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?w(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?w(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof h.mp){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class Q{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new m)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,l=0;for(let a=0;ac.end+25&&(l=Math.max(c.lookAhead,l)),0!=c.value)){let u=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),n||e.pos!=this.stream.end||((n=new m).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new m,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:r}=n.p;for(let s=0;s=0&&n.p.parser.dialect.allows(o>>1)){(1&o)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let r=0;r4*e.bufferLength?new S(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];for(let s=0;si)r.push(o);else{if(this.advanceStack(o,r,n))continue;e||(e=[],t=[]),e.push(o);let l=this.tokens.getMainToken(o);t.push(l.value,l.end)}break}}if(!r.length){let a=e&&function(e){let t=null;for(let n of e){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=i&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(h)return this.stackToTree(h.forceAll())}if(this.recovering){let c=1==this.recovering?1:3*this.recovering;if(r.length>c)for(r.sort((e,t)=>t.score-e.score);r.length>c;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1)i:for(let u=0;u500&&p.buffer.length>500){if((f.score-p.score||f.buffer.length-p.buffer.length)>0)r.splice(d--,1);else{r.splice(u--,1);continue i}}}}this.minStackPos=r[0].pos;for(let m=1;m ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let o=e.curContext&&e.curContext.tracker.strict,l=o?e.curContext.hash:0;for(let a=this.fragments.nodeAt(i);a;){let c=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(e.state,a.type.id):-1;if(c>-1&&a.length&&(!o||(a.prop(h.md.contextHash)||0)==l))return e.useNode(a,c),x&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof h.mp)||0==a.children.length||a.positions[0]>0)break;let u=a.children[0];if(u instanceof h.mp&&0==a.positions[0])a=u;else break}}let f=r.stateSlot(e.state,4);if(f>0)return e.reduce(f),x&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&f)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let d=this.tokens.getActions(e);for(let p=0;pi?t.push(v):n.push(v)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return C(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let s=0;s ":"";if(o.deadEnd&&(r||(r=!0,o.restart(),x&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let c=o.split(),u=h;for(let f=0;c.forceReduce()&&f<10&&(x&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));f++)x&&(u=this.stackID(c)+" -> ");for(let d of o.recoverByInsert(l))x&&console.log(h+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>o.pos?(a==o.pos&&(a++,l=0),o.recoverByDelete(l,a),x&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),C(o,n)):(!i||i.scoree;class I{constructor(e){this.start=e.start,this.shift=e.shift||T,this.reduce=e.reduce||T,this.reuse=e.reuse||T,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}class R extends h._b{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;ne.topRules[t][1]),r=[];for(let s=0;s=0)o(u,a,l[c++]);else{let f=l[c+-u];for(let d=-u;d>0;d--)o(l[c++],a,f);c++}}}this.nodeSet=new h.Lj(t.map((t,n)=>h.Jq.define({name:n>=this.minRepeatTerm?void 0:t,id:n,props:r[n],top:i.indexOf(n)>-1,error:0==n,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=h.L3;let p=b(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let m=0;m"number"==typeof e?new y(p,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new P(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let s=i[r++],o=1&s,l=i[r++];if(o&&n)return l;for(let a=r+(s>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=z(this.data,n+2)}if(t==z(this.data,n+1))return!0}}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=z(this.data,n+2);else break}if((1&this.data[n+2])==0){let i=this.data[n+1];t.some((e,t)=>1&t&&e==i)||t.push(this.data[n],i)}}return t}overrides(e,t){let n=D(this.data,this.tokenPrecTable,t);return n<0||D(this.data,this.tokenPrecTable,e){let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let s=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=M(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let r=t.indexOf(i);r>=0&&(n[r]=!0)}let s=null;for(let o=0;oe.external(n,i)<<1|t}return e.get}},28699:function(e,t,n){n.d(t,{V:function(){return o}});let i="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let r in e)!function e(t,r,s,o){let l=[],a=/^@(\w+)\b/.exec(t[0]),h=a&&"keyframes"==a[1];if(a&&null==r)return s.push(t[0]+";");for(let c in r){let u=r[c];if(/&/.test(c))e(c.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),u,s);else if(u&&"object"==typeof u){if(!a)throw RangeError("The value of a property ("+c+") should be a primitive value.");e(i(c),u,l,h)}else null!=u&&l.push(c.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+u+";")}(l.length||h)&&s.push((!n||a||o?t:t.map(n)).join(", ")+" {"+l.join(" ")+"}")}(i(r),e[r],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=s[i]||1;return s[i]=e+1,"ͼ"+e.toString(36)}static mount(e,t){(e[r]||new a(e)).mount(Array.isArray(t)?t:[t])}}let l=null;class a{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(l)return e.adoptedStyleSheets=[l.sheet].concat(e.adoptedStyleSheets),e[r]=l;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),l=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[r]=this}mount(e){let t=this.sheet,n=0,i=0;for(let r=0;r-1&&(this.modules.splice(o,1),i--,o=-1),-1==o){if(this.modules.splice(i++,0,s),t)for(let l=0;l",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=o||s&&57>+s[1],h=0;h<10;h++)i[48+h]=i[96+h]=String(h);for(var h=1;h<=24;h++)i[h+111]="F"+h;for(var h=65;h<=90;h++)i[h]=String.fromCharCode(h+32),r[h]=String.fromCharCode(h);for(var c in i)r.hasOwnProperty(c)||(r[c]=i[c]);function u(e){var t=!(a&&(e.ctrlKey||e.altKey||e.metaKey)||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?r:i)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1943],{58909:function(e,t,n){n.d(t,{F:function(){return o}});var i=n(35524),r=n(47421),s=n(59119),o=(e=>{var{theme:t,settings:n,styles:i}=e,o={"&":{backgroundColor:n.background,color:n.foreground},".cm-gutters":{}};n.gutterBackground&&(o[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(o[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(o[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(o[".cm-content"]={caretColor:n.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret}),n.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:n.lineHighlight},o[".cm-activeLineGutter"]={backgroundColor:n.lineHighlight}),n.selection&&(o["&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection"]={backgroundColor:n.selection}),n.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var l=r.tk.theme(o,{dark:"dark"===t}),a=s.Qf.define(i);return[l,(0,s.nF)(a)]})({theme:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#FBAC52",selection:"#FFD420",selectionMatch:"#FFD420",gutterBackground:"#f5f5f5",gutterForeground:"#4D4D4C",lineHighlight:"#00000012"},styles:[{tag:[i.pJ.meta,i.pJ.comment],color:"#804000"},{tag:[i.pJ.keyword,i.pJ.strong],color:"#0000FF"},{tag:[i.pJ.number],color:"#FF0080"},{tag:[i.pJ.string],color:"#FF0080"},{tag:[i.pJ.variableName],color:"#006600"},{tag:[i.pJ.escape],color:"#33CC33"},{tag:[i.pJ.tagName],color:"#1C02FF"},{tag:[i.pJ.heading],color:"#0C07FF"},{tag:[i.pJ.quote],color:"#000000"},{tag:[i.pJ.list],color:"#B90690"},{tag:[i.pJ.documentMeta],color:"#888888"},{tag:[i.pJ.function(i.pJ.variableName)],color:"#0000A2"},{tag:[i.pJ.definition(i.pJ.typeName),i.pJ.typeName],color:"#6D79DE"}]})},87685:function(e,t,n){n.d(t,{ZP:function(){return n_}});var i=n(87462),r=n(63366),s=n(67294),o=n(78120),l=n(47421),a=n(59119),h=n(41113);let c=e=>{let t=m(e.state);return t.line?f(e):!!t.block&&p(e)};function u(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}let f=u(function(e,t,n=t.selection.ranges){let i=[],r=-1;for(let{from:s,to:o}of n){let l=i.length,a=1e9;for(let h=s;h<=o;){let c=t.doc.lineAt(h);if(c.from>r&&(s==o||o>c.from)){r=c.from;let u=m(t,h).line;if(!u)continue;let f=/^\s*/.exec(c.text)[0].length,d=f==c.length,p=c.text.slice(f,f+u.length)==u?f:-1;fe.comment<0&&(!e.empty||e.single))){let k=[];for(let{line:y,token:v,indent:b,empty:x,single:O}of i)(O||!x)&&k.push({from:y.from+b,insert:v+" "});let w=t.changes(k);return{changes:w,selection:t.selection.map(w,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let S=[];for(let{line:Q,comment:P,token:C}of i)if(P>=0){let A=Q.from+P,T=A+C.length;" "==Q.text[T-Q.from]&&T++,S.push({from:A,to:T})}return{changes:S}}return null},0),d=u(g,0),p=u((e,t)=>g(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to),s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from,to:r.to})}return t}(t)),0);function m(e,t=e.selection.main.head){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function g(e,t,n=t.selection.ranges){let i=n.map(e=>m(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let s,o,l=e.sliceDoc(i-50,i),a=e.sliceDoc(r,r+50),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?s=o=e.sliceDoc(i,r):(s=e.sliceDoc(i,i+50),o=e.sliceDoc(r-50,r));let f=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-n.length;return s.slice(f,f+t.length)==t&&o.slice(p,p+n.length)==n?{open:{pos:i+f+t.length,margin:/\s/.test(s.charAt(f+t.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let s=[];for(let o=0,l;o(0,o.BO)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}),x=o.QQ.define({create:()=>M.empty,update(e,t){let n=t.state.facet(b),i=t.annotation(k);if(i){var r;let s;let l=t.docChanged?o.jT.single((r=t.changes,s=0,r.iterChangedRanges((e,t)=>s=t),s)):void 0,a=C.fromTransaction(t,l),h=i.side,c=0==h?e.undone:e.done;return c=a?A(c,c.length,n.minDepth,a):R(c,t.startState.selection),new M(0==h?i.rest:c,0==h?c:i.rest)}let u=t.annotation(y);if(("full"==u||"before"==u)&&(e=e.isolate()),!1===t.annotation(o.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let f=C.fromTransaction(t),d=t.annotation(o.YW.time),p=t.annotation(o.YW.userEvent);return f?e=e.addChanges(f,d,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,d,p,n.newGroupDelay)),("full"==u||"after"==u)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new M(e.done.map(C.fromJSON),e.undone.map(C.fromJSON))});function O(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(x,!1);if(!r)return!1;let s=r.pop(e,n,t);return!!s&&(i(s),!0)}}let w=O(0,!1),S=O(1,!1),Q=O(0,!0),P=O(1,!0);class C{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new C(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new C(e.changes&&o.as.fromJSON(e.changes),[],e.mapped&&o.n0.fromJSON(e.mapped),e.startSelection&&o.jT.fromJSON(e.startSelection),e.selectionsAfter.map(o.jT.fromJSON))}static fromTransaction(e,t){let n=I;for(let i of e.startState.facet(v)){let r=i(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new C(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,I)}static selection(e){return new C(void 0,I,void 0,void 0,e)}}function A(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function T(e,t){return e.length?t.length?e.concat(t):e:t}let I=[];function R(e,t){if(!e.length)return[C.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),A(e,e.length-1,1e9,n.setSelAfter(i)))}}function z(e,t){if(!e.length)return e;let n=e.length,i=I;for(;n;){let r=function(e,t,n){let i=T(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):I,n);if(!e.changes)return C.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(s):s;return new C(r,o.Py.mapEffects(e.effects,t),l,e.startSelection.map(s),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[C.selection(i)]:I}let D=/^(input\.type|delete)($|\.)/;class M{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new M(this.done,this.undone):this}addChanges(e,t,n,i,r){var s,o;let l,a,h=this.done,c=h[h.length-1];return h=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||D.test(n))&&(!c.selectionsAfter.length&&t-this.prevTimel.push(e,t)),o.iterChangedRanges((e,t,n,i)=>{for(let r=0;r=s&&n<=o&&(a=!0)}}),a)||"input.type.compose"==n)?A(h,h.length-1,r,new C(e.changes.compose(c.changes),T(e.effects,c.effects),c.mapped,c.startSelection,I)):A(h,h.length,r,e),new M(h,I,t,n)}addSelection(e,t,n,i){var r;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:I;return s.length>0&&t-this.prevTimet.empty!=e.ranges[n].empty).length?this:new M(R(this.done,e),this.undone,t,n)}addMapping(e){return new M(z(this.done,e),z(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1];if(n&&r.selectionsAfter.length){var s;let o,l;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:k.of({side:e,rest:(o=(s=i)[s.length-1],(l=s.slice())[s.length-1]=o.setSelAfter(o.selectionsAfter.slice(0,o.selectionsAfter.length-1)),l)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}if(!r.changes)return null;{let a=1==i.length?I:i.slice(0,i.length-1);return r.mapped&&(a=z(a,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:k.of({side:e,rest:a}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}M.empty=new M(I,I);let $=[{key:"Mod-z",run:w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:S,preventDefault:!0},{linux:"Ctrl-Shift-z",run:S,preventDefault:!0},{key:"Mod-u",run:Q,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:P,preventDefault:!0}];function N(e,t){return o.jT.create(e.ranges.map(t),e.mainIndex)}function E(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function W({state:e,dispatch:t},n){let i=N(e.selection,n);return!i.eq(e.selection)&&(t(E(e,i)),!0)}function B(e,t){return o.jT.cursor(t?e.to:e.from)}function J(e,t){return W(e,n=>n.empty?e.moveByChar(n,t):B(n,t))}function L(e){return e.textDirectionAt(e.state.selection.main.head)==l.Nm.LTR}let j=e=>J(e,!L(e)),_=e=>J(e,L(e));function F(e,t){return W(e,n=>n.empty?e.moveByGroup(n,t):B(n,t))}let q=e=>F(e,!L(e)),U=e=>F(e,L(e));function X(e,t,n){let i,r,s=(0,a.qz)(e).resolveInner(t.head),l=n?h.md.closedBy:h.md.openedBy;for(let c=t.head;;){let u=n?s.childAfter(c):s.childBefore(c);if(!u)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,u,l)?c=n?u.to:u.from:s=u}return r=s.type.prop(l)&&(i=n?(0,a.Um)(e,s.from,1):(0,a.Um)(e,s.to,-1))&&i.matched?n?i.end.to:i.end.from:n?s.to:s.from,o.jT.cursor(r,n?-1:1)}let V=e=>W(e,t=>X(e.state,t,!L(e))),Z=e=>W(e,t=>X(e.state,t,L(e)));function G(e,t){return W(e,n=>{if(!n.empty)return B(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}let Y=e=>G(e,!1),H=e=>G(e,!0);function K(e){return Math.max(e.defaultLineHeight,Math.min(e.dom.clientHeight,innerHeight)-5)}function ee(e,t){let n,{state:i}=e,r=N(i.selection,n=>n.empty?e.moveVertically(n,t,K(e)):B(n,t));if(r.eq(i.selection))return!1;let s=e.coordsAtPos(i.selection.main.head),o=e.scrollDOM.getBoundingClientRect();return s&&s.top>o.top&&s.bottomee(e,!1),en=e=>ee(e,!0);function ei(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=o.jT.cursor(i.from+s))}return r}let er=e=>W(e,t=>ei(e,t,!0)),es=e=>W(e,t=>ei(e,t,!1)),eo=e=>W(e,t=>ei(e,t,!L(e))),el=e=>W(e,t=>ei(e,t,L(e))),ea=e=>W(e,t=>o.jT.cursor(e.lineBlockAt(t.head).from,1)),eh=e=>W(e,t=>o.jT.cursor(e.lineBlockAt(t.head).to,-1)),ec=({state:e,dispatch:t})=>{let n,i;return n=!1,i=N(e.selection,t=>{let i=(0,a.Um)(e,t.head,-1)||(0,a.Um)(e,t.head,1)||t.head>0&&(0,a.Um)(e,t.head-1,1)||t.head{let n=t(e);return o.jT.range(e.anchor,n.head,n.goalColumn)});return!n.eq(e.state.selection)&&(e.dispatch(E(e.state,n)),!0)}function ef(e,t){return eu(e,n=>e.moveByChar(n,t))}let ed=e=>ef(e,!L(e)),ep=e=>ef(e,L(e));function em(e,t){return eu(e,n=>e.moveByGroup(n,t))}let eg=e=>em(e,!L(e)),ek=e=>em(e,L(e)),ey=e=>eu(e,t=>X(e.state,t,!L(e))),ev=e=>eu(e,t=>X(e.state,t,L(e)));function eb(e,t){return eu(e,n=>e.moveVertically(n,t))}let ex=e=>eb(e,!1),eO=e=>eb(e,!0);function ew(e,t){return eu(e,n=>e.moveVertically(n,t,K(e)))}let eS=e=>ew(e,!1),eQ=e=>ew(e,!0),eP=e=>eu(e,t=>ei(e,t,!0)),eC=e=>eu(e,t=>ei(e,t,!1)),eA=e=>eu(e,t=>ei(e,t,!L(e))),eT=e=>eu(e,t=>ei(e,t,L(e))),eI=e=>eu(e,t=>o.jT.cursor(e.lineBlockAt(t.head).from)),eR=e=>eu(e,t=>o.jT.cursor(e.lineBlockAt(t.head).to)),ez=({state:e,dispatch:t})=>(t(E(e,{anchor:0})),!0),eD=({state:e,dispatch:t})=>(t(E(e,{anchor:e.doc.length})),!0),eM=({state:e,dispatch:t})=>(t(E(e,{anchor:e.selection.main.anchor,head:0})),!0),e$=({state:e,dispatch:t})=>(t(E(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),eN=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),eE=({state:e,dispatch:t})=>{let n=eH(e).map(({from:t,to:n})=>o.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:o.jT.create(n),userEvent:"select"})),!0},eW=({state:e,dispatch:t})=>{let n=N(e.selection,t=>{var n;let i=(0,a.qz)(e).resolveInner(t.head,1);for(;!(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 o.jT.range(i.to,i.from)});return t(E(e,n)),!0},eB=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=o.jT.create([n.main]):n.main.empty||(i=o.jT.create([o.jT.cursor(n.main.head)])),!!i&&(t(E(e,i)),!0)};function eJ(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:s}=i;if(r==s){let l=t(r);lr&&(n="delete.forward",l=eL(e,l,!0)),r=Math.min(r,l),s=Math.max(s,l)}else r=eL(e,r,!1),s=eL(e,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.jT.cursor(r)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?l.tk.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function eL(e,t,n){if(e instanceof l.tk)for(let i of e.state.facet(l.tk.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{et&&(t=n?i:e)});return t}let ej=(e,t)=>eJ(e,n=>{let{state:i}=e,r=i.doc.lineAt(n),s,l;if(!t&&n>r.from&&nej(e,!1),eF=e=>ej(e,!0),eq=(e,t)=>eJ(e,n=>{let i=n,{state:r}=e,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let a=null;;){if(i==(t?s.to:s.from)){i==n&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let h=(0,o.cp)(s.text,i-s.from,t)+s.from,c=s.text.slice(Math.min(i,h)-s.from,Math.max(i,h)-s.from),u=l(c);if(null!=a&&u!=a)break;(" "!=c||i!=n)&&(a=u),i=h}return i}),eU=e=>eq(e,!1),eX=e=>eq(e,!0),eV=e=>eJ(e,t=>{let n=e.lineBlockAt(t).to;return teJ(e,t=>{let n=e.lineBlockAt(t).from;return t>n?n:Math.max(0,t-1)}),eG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:o.xv.of(["",""])},range:o.jT.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},eY=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,o.cp)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.cp)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(r,n))},range:o.jT.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function eH(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(i.empty||i.to!=s.from||(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function eK(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of eH(e)){if(n?s.to==e.doc.length:0==s.from)continue;let l=e.doc.lineAt(n?s.to+1:s.from-1),a=l.length+1;if(n)for(let h of(i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+e.lineBreak}),s.ranges))r.push(o.jT.range(Math.min(e.doc.length,h.anchor+a),Math.min(e.doc.length,h.head+a)));else for(let c of(i.push({from:l.from,to:s.from},{from:s.to,insert:e.lineBreak+l.text}),s.ranges))r.push(o.jT.range(c.anchor-a,c.head-a))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:o.jT.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}let e0=({state:e,dispatch:t})=>eK(e,t,!1),e1=({state:e,dispatch:t})=>eK(e,t,!0);function e2(e,t,n){if(e.readOnly)return!1;let i=[];for(let r of eH(e))n?i.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):i.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let e5=({state:e,dispatch:t})=>e2(e,t,!1),e3=({state:e,dispatch:t})=>e2(e,t,!0),e4=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(eH(t).map(({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0)).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0},e9=e8(!1),e6=e8(!0);function e8(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,s=t.doc.lineAt(i),l=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,a.qz)(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(h.md.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=s.to?s:t.doc.lineAt(r)).to);let c=new a.Gn(t,{simulateBreak:i,simulateDoubleBreak:!!l}),u=(0,a.K0)(c,i);for(null==u&&(u=/^\s*/.exec(t.doc.lineAt(i).text)[0].length);rs.from&&i{let r=[];for(let s=i.from;s<=i.to;){let l=e.doc.lineAt(s);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),s=l.to+1}let a=e.changes(r);return{changes:r,range:o.jT.range(a.mapPos(i.anchor,1),a.mapPos(i.head,1))}})}let te=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new a.Gn(e,{overrideIndentation(e){let t=n[e];return null==t?-1:t}}),r=e7(e,(t,r,s)=>{let o=(0,a.K0)(i,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let l=/^\s*/.exec(t.text)[0],h=(0,a.SS)(e,o);(l!=h||s.from!e.readOnly&&(t(e.update(e7(e,(t,n)=>{n.push({from:t.from,insert:e.facet(a.c)})}),{userEvent:"input.indent"})),!0),tn=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(e7(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=(0,o.IS)(i,e.tabSize),s=0,l=(0,a.SS)(e,Math.max(0,r-(0,a.y1)(e)));for(;s({mac:e.key,run:e.run,shift:e.shift}))),tr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:V,shift:ey},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Z,shift:ev},{key:"Alt-ArrowUp",run:e0},{key:"Shift-Alt-ArrowUp",run:e5},{key:"Alt-ArrowDown",run:e1},{key:"Shift-Alt-ArrowDown",run:e3},{key:"Escape",run:eB},{key:"Mod-Enter",run:e6},{key:"Alt-l",mac:"Ctrl-l",run:eE},{key:"Mod-i",run:eW,preventDefault:!0},{key:"Mod-[",run:tn},{key:"Mod-]",run:tt},{key:"Mod-Alt-\\",run:te},{key:"Shift-Mod-k",run:e4},{key:"Shift-Mod-\\",run:ec},{key:"Mod-/",run:c},{key:"Alt-A",run:d}].concat(ti),ts={key:"Tab",run:tt,shift:tn};function to(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;te.normalize("NFKD"):e=>e;class ta{constructor(e,t,n=0,i=e.length,r,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(tl(e)):tl,this.query=this.normalize(t)}peek(){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,o.gm)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,o.bg)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,o.nZ)(e);let i=this.normalize(t);for(let r=0,s=n;;r++){let l=i.charCodeAt(r),a=this.match(l,s);if(a)return this.value=a,this;if(r==i.length-1)break;s==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=tm(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||i.to<=t){let r=new td(t,e.sliceString(t,n));return tf.set(e,r),r}if(i.from==t&&i.to==n)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,i=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this.matchPos=tm(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=td.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function tm(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}function tg(e){let t=to("input",{class:"cm-textfield",name:"line"}),n=to("form",{class:"cm-gotoLine",onkeydown(t){27==t.keyCode?(t.preventDefault(),e.dispatch({effects:tk.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),i())},onsubmit(e){e.preventDefault(),i()}},to("label",e.state.phrase("Go to line"),": ",t)," ",to("button",{class:"cm-button",type:"submit"},e.state.phrase("go")));function i(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:i}=e,r=i.doc.lineAt(i.selection.main.head),[,s,l,a,h]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&h){let f=u/100;s&&(f=f*("-"==s?-1:1)+r.number/i.doc.lines),u=Math.round(i.doc.lines*f)}else l&&s&&(u=u*("-"==s?-1:1)+r.number);let d=i.doc.line(Math.max(1,Math.min(i.doc.lines,u)));e.dispatch({effects:tk.of(!1),selection:o.jT.cursor(d.from+Math.max(0,Math.min(c,d.length))),scrollIntoView:!0}),e.focus()}return{dom:n}}"undefined"!=typeof Symbol&&(tu.prototype[Symbol.iterator]=tp.prototype[Symbol.iterator]=function(){return this});let tk=o.Py.define(),ty=o.QQ.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(tk)&&(e=n.value);return e},provide:e=>l.mH.from(e,e=>e?tg:null)}),tv=e=>{let t=(0,l.Sd)(e,tg);if(!t){let n=[tk.of(!0)];null==e.state.field(ty,!1)&&n.push(o.Py.appendConfig.of([ty,tb])),e.dispatch({effects:n}),t=(0,l.Sd)(e,tg)}return t&&t.dom.querySelector("input").focus(),!0},tb=l.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tx={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},tO=o.r$.define({combine:e=>(0,o.BO)(e,tx,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),tw=l.p.mark({class:"cm-selectionMatch"}),tS=l.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function tQ(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=o.D0.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=o.D0.Word)}let tP=l.lg.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(tO),{state:n}=e,i=n.selection;if(i.ranges.length>1)return l.p.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return l.p.none;let h=n.wordAt(r.head);if(!h)return l.p.none;a=n.charCategorizer(r.head),s=n.sliceDoc(h.from,h.to)}else{let c=r.to-r.from;if(c200)return l.p.none;if(t.wholeWords){var u,f,d;if(s=n.sliceDoc(r.from,r.to),!(tQ(a=n.charCategorizer(r.head),n,r.from,r.to)&&(u=a,f=r.from,d=r.to,u(n.sliceDoc(f,f+1))==o.D0.Word&&u(n.sliceDoc(d-1,d))==o.D0.Word)))return l.p.none}else if(!(s=n.sliceDoc(r.from,r.to).trim()))return l.p.none}let p=[];for(let m of e.visibleRanges){let g=new ta(n.doc,s,m.from,m.to);for(;!g.next().done;){let{from:k,to:y}=g.value;if((!a||tQ(a,n,k,y))&&(r.empty&&k<=r.from&&y>=r.to?p.push(tS.range(k,y)):(k>=r.to||y<=r.from)&&p.push(tw.range(k,y)),p.length>t.maxMatches))return l.p.none}}return l.p.set(p)}},{decorations:e=>e.decorations}),tC=l.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),tA=({state:e,dispatch:t})=>{let{selection:n}=e,i=o.jT.create(n.ranges.map(t=>e.wordAt(t.head)||o.jT.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)},tT=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return tA({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new ta(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ta(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(e=>e.from==l.value.from))continue;if(s){let a=e.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(o.jT.range(r.from,r.to),!1),effects:l.tk.scrollIntoView(r.to)})),!0)},tI=o.r$.define({combine:e=>(0,o.BO)(e,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:e=>new t3(e)})});class tR{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return RegExp(e,tc),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new tW(this):new tM(this)}getCursor(e,t=0,n){let i=e.doc?e:o.yy.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?t$(this,i,t,n):tD(this,i,t,n)}}class tz{constructor(e){this.spec=e}}function tD(e,t,n,i){var r,s;return new ta(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,n,i)=>((i>e||i+n.length=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=tD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function t$(e,t,n,i){var r;return new tu(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(tN(n.input,n.index))!=o.D0.Word||r(tE(n.input,n.index))!=o.D0.Word)&&(r(tE(n.input,n.index+n[0].length))!=o.D0.Word||r(tN(n.input,n.index+n[0].length))!=o.D0.Word)):void 0},n,i)}function tN(e,t){return e.slice((0,o.cp)(e,t,!1),t)}function tE(e,t){return e.slice(t,(0,o.cp)(e,t))}class tW extends tz{nextMatch(e,t,n){let i=t$(this.spec,e,n,e.doc.length).next();return i.done&&(i=t$(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),s=t$(this.spec,e,r,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==t||o.from>r+10))return o;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=t$(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let tB=o.Py.define(),tJ=o.Py.define(),tL=o.QQ.define({create:e=>new tj(t0(e).create(),null),update(e,t){for(let n of t.effects)n.is(tB)?e=new tj(n.value.create(),e.panel):n.is(tJ)&&(e=new tj(e.query,n.value?tK:null));return e},provide:e=>l.mH.from(e,e=>e.panel)});class tj{constructor(e,t){this.query=e,this.panel=t}}let t_=l.p.mark({class:"cm-searchMatch"}),tF=l.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),tq=l.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(tL))}update(e){let t=e.state.field(tL);(t!=e.startState.field(tL)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return l.p.none;let{view:n}=this,i=new o.f_;for(let r=0,s=n.visibleRanges,a=s.length;rs[r+1].from-500;)c=s[++r].to;e.highlight(n.state,h,c,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?tF:t_)})}return i.finish()}},{decorations:e=>e.decorations});function tU(e){return t=>{let n=t.state.field(tL,!1);return n&&n.query.spec.valid?e(t,n):t1(t)}}let tX=tU((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:t6(e,i),userEvent:"select.search"}),!0)}),tV=tU((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);return!!r&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:t6(e,r),userEvent:"select.search"}),!0)}),tZ=tU((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:o.jT.create(n.map(e=>o.jT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),tG=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],l=0;for(let a=new ta(e.doc,e.sliceDoc(i,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==i&&(l=s.length),s.push(o.jT.range(a.value.from,a.value.to))}return t(e.update({selection:o.jT.create(s,l),userEvent:"select.search.matches"})),!0},tY=tU((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=[],a,h,c=[];if(s.from==i&&s.to==r&&(h=n.toText(t.getReplacement(s)),o.push({from:s.from,to:s.to,insert:h}),s=t.nextMatch(n,s.from,s.to),c.push(l.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),s){let u=0==o.length||o[0].from>=s.to?0:s.to-s.from-h.length;a={anchor:s.from-u,head:s.to-u},c.push(t6(e,s))}return e.dispatch({changes:o,selection:a,scrollIntoView:!!a,effects:c,userEvent:"input.replace"}),!0}),tH=tU((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:i}=e;return{from:n,to:i,insert:t.getReplacement(e)}});if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:l.tk.announce.of(i),userEvent:"input.replace.all"}),!0});function tK(e){return e.state.facet(tI).createPanel(e)}function t0(e,t){var n,i,r,s;let o=e.selection.main,l=o.empty||o.to>o.from+100?"":e.sliceDoc(o.from,o.to);if(t&&!l)return t;let a=e.facet(tI);return new tR({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:a.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:a.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:a.literal,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:a.wholeWord})}let t1=e=>{let t=e.state.field(tL,!1);if(t&&t.panel){let n=(0,l.Sd)(e,tK);if(!n)return!1;let i=n.dom.querySelector("[main-field]");if(i&&i!=e.root.activeElement){let r=t0(e.state,t.query.spec);r.valid&&e.dispatch({effects:tB.of(r)}),i.focus(),i.select()}}else e.dispatch({effects:[tJ.of(!0),t?tB.of(t0(e.state,t.query.spec)):o.Py.appendConfig.of(t7)]});return!0},t2=e=>{let t=e.state.field(tL,!1);if(!t||!t.panel)return!1;let n=(0,l.Sd)(e,tK);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:tJ.of(!1)}),!0},t5=[{key:"Mod-f",run:t1,scope:"editor search-panel"},{key:"F3",run:tX,shift:tV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tX,shift:tV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:t2,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tG},{key:"Alt-g",run:tv},{key:"Mod-d",run:tT,preventDefault:!0}];class t3{constructor(e){this.view=e;let t=this.query=e.state.field(tL).query.spec;function n(e,t,n){return to("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=to("input",{value:t.search,placeholder:t4(e,"Find"),"aria-label":t4(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=to("input",{value:t.replace,placeholder:t4(e,"Replace"),"aria-label":t4(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=to("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=to("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=to("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=to("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>tX(e),[t4(e,"next")]),n("prev",()=>tV(e),[t4(e,"previous")]),n("select",()=>tZ(e),[t4(e,"all")]),to("label",null,[this.caseField,t4(e,"match case")]),to("label",null,[this.reField,t4(e,"regexp")]),to("label",null,[this.wordField,t4(e,"by word")]),...e.state.readOnly?[]:[to("br"),this.replaceField,n("replace",()=>tY(e),[t4(e,"replace")]),n("replaceAll",()=>tH(e),[t4(e,"replace all")]),to("button",{name:"close",onclick:()=>t2(e),"aria-label":t4(e,"close"),type:"button"},["\xd7"])]])}commit(){let e=new tR({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:tB.of(e)}))}keydown(e){(0,l.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?tV:tX)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),tY(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(tB)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(tI).top}}function t4(e,t){return e.state.phrase(t)}let t9=/[\s\.,:;?!]/;function t6(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-30),o=Math.min(r,n+30),a=e.state.sliceDoc(s,o);if(s!=i.from){for(let h=0;h<30;h++)if(!t9.test(a[h+1])&&t9.test(a[h])){a=a.slice(h);break}}if(o!=r){for(let c=a.length-1;c>a.length-30;c--)if(!t9.test(a[c-1])&&t9.test(a[c])){a=a.slice(0,c);break}}return l.tk.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${i.number}.`)}let t8=l.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%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),t7=[tL,o.Wl.lowest(tq),t8];var ne=n(34790);class nt{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class nn{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,r=n.facet(nk).markerFilter;r&&(i=r(i));let s=l.p.set(i.map(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?l.p.widget({widget:new nb(e),diagnostic:e}).range(e.from):l.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity},diagnostic:e}).range(e.from,e.to)),!0);return new nn(s,t,ni(s))}}function ni(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!t||r.diagnostic==t)return i=new nt(e,n,r.diagnostic),!1}),i}function nr(e,t){return!!(e.effects.some(e=>e.is(no))||e.changes.touchesRange(t.pos))}function ns(e,t){return e.field(nh,!1)?t:t.concat(o.Py.appendConfig.of([nh,l.tk.decorations.compute([nh],e=>{let{selected:t,panel:n}=e.field(nh);return t&&n&&t.from!=t.to?l.p.set([nc.range(t.from,t.to)]):l.p.none}),(0,l.bF)(nu,{hideOn:nr}),nS]))}let no=o.Py.define(),nl=o.Py.define(),na=o.Py.define(),nh=o.QQ.define({create:()=>new nn(l.p.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),i=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=ni(n,e.selected.diagnostic,r)||ni(n,null,r)}e=new nn(n,e.panel,i)}for(let s of t.effects)s.is(no)?e=nn.init(s.value,e.panel,t.state):s.is(nl)?e=new nn(e.diagnostics,s.value?nO.open:null,e.selected):s.is(na)&&(e=new nn(e.diagnostics,e.panel,s.value));return e},provide:e=>[l.mH.from(e,e=>e.panel),l.tk.decorations.from(e,e=>e.diagnostics)]}),nc=l.p.mark({class:"cm-lintRange cm-lintRange-active"});function nu(e,t,n){let{diagnostics:i}=e.state.field(nh),r=[],s=2e8,o=0;i.between(t-(n<0?1:0),t+(n>0?1:0),(e,i,{spec:l})=>{t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t({dom:function(e,t){return to("ul",{class:"cm-tooltip-lint"},t.map(t=>nv(e,t,!1)))}(e,r)})}:null}let nf=e=>{let t=e.state.field(nh,!1);t&&t.panel||e.dispatch({effects:ns(e.state,[nl.of(!0)])});let n=(0,l.Sd)(e,nO.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},nd=e=>{let t=e.state.field(nh,!1);return!!t&&!!t.panel&&(e.dispatch({effects:nl.of(!1)}),!0)},np=e=>{let t=e.state.field(nh,!1);if(!t)return!1;let n=e.state.selection.main,i=t.diagnostics.iter(n.to+1);return(!!i.value||!!(i=t.diagnostics.iter(0)).value&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},nm=[{key:"Mod-Shift-m",run:nf},{key:"F8",run:np}],ng=l.lg.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(nk);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view)))).then(e=>{let n=e.reduce((e,t)=>e.concat(t));this.view.state.doc==t.doc&&this.view.dispatch({effects:ns(this.view.state,[no.of(n)])})},e=>{(0,l.OO)(this.view.state,e)})}}update(e){let t=e.state.facet(nk);(e.docChanged||t!=e.startState.facet(nk))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),nk=o.r$.define({combine:e=>Object.assign({sources:e.map(e=>e.source)},(0,o.BO)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null})),enables:ng});function ny(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;ie.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function nv(e,t,n){var i;let r=n?ny(t.actions):[];return to("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},to("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let s=i=>{i.preventDefault();let r=ni(e.state.field(nh).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:o}=n,l=r[i]?o.indexOf(r[i]):-1,a=l<0?o:[o.slice(0,l),to("u",o.slice(l,l+1)),o.slice(l+1)];return to("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${o}${l<0?"":` (access key "${r[i]})"`}.`},a)}),t.source&&to("div",{class:"cm-diagnosticSource"},t.source))}class nb extends l.l9{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return to("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class nx{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=nv(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class nO{constructor(e){this.view=e,this.items=[];let t=t=>{if(27==t.keyCode)nd(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=ny(n.actions);for(let r=0;r{for(let t=0;tnd(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(nh).selected;if(!e)return -1;for(let t=0;t{let l=-1,a;for(let h=n;hn&&(this.items.splice(n,l-n),i=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++});n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{e.topt.bottom&&(this.list.scrollTop+=e.bottom-t.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=ni(this.view.state.field(nh).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:na.of(t)})}static open(e){return new nO(e)}}function nw(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}(``,'width="6" height="3"')}let nS=l.tk.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:nw("#d11")},".cm-lintRange-warning":{backgroundImage:nw("orange")},".cm-lintRange-info":{backgroundImage:nw("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});l.SJ;let nQ=o.Py.define();var nP=function(e){void 0===e&&(e={});var t,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(ne.GA)),!1!==e.defaultKeymap&&(n=n.concat(tr)),!1!==e.searchKeymap&&(n=n.concat(t5)),!1!==e.historyKeymap&&(n=n.concat($)),!1!==e.foldKeymap&&(n=n.concat(a.e7)),!1!==e.completionKeymap&&(n=n.concat(ne.B1)),!1!==e.lintKeymap&&(n=n.concat(nm));var i=[];if(!1!==e.lineNumbers&&i.push((0,l.Eu)()),!1!==e.highlightActiveLineGutter&&i.push((0,l.HQ)()),!1!==e.highlightSpecialChars&&i.push((0,l.AE)()),!1!==e.history&&i.push(function(e={}){return[x,b.of(e),l.tk.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?w:"historyRedo"==e.inputType?S:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push((0,a.mi)()),!1!==e.drawSelection&&i.push((0,l.Uw)()),!1!==e.dropCursor&&i.push((0,l.qr)()),!1!==e.allowMultipleSelections&&i.push(o.yy.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push((0,a.nY)()),!1!==e.syntaxHighlighting&&i.push((0,a.nF)(a.R_,{fallback:!0})),!1!==e.bracketMatching&&i.push((0,a.n$)()),!1!==e.closeBrackets&&i.push((0,ne.vQ)()),!1!==e.autocompletion&&i.push((0,ne.ys)()),!1!==e.rectangularSelection&&i.push((0,l.Zs)()),!1!==e.crosshairCursor&&i.push((0,l.S2)()),!1!==e.highlightActiveLine&&i.push((0,l.ZO)()),!1!==e.highlightSelectionMatches){let r;i.push((r=[tC,tP],t&&r.push(tO.of(t)),r))}return e.tabSize&&"number"==typeof e.tabSize&&i.push(a.c.of(" ".repeat(e.tabSize))),i.concat([l.$f.of(n.flat())]).filter(Boolean)},nC=n(35524);let nA="#e06c75",nT="#abb2bf",nI="#7d8799",nR="#d19a66",nz="#2c313a",nD="#282c34",nM="#353a42",n$="#528bff",nN=l.tk.theme({"&":{color:nT,backgroundColor:nD},".cm-content":{caretColor:n$},".cm-cursor, .cm-dropCursor":{borderLeftColor:n$},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:nT},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{backgroundColor:nD,color:nI,border:"none"},".cm-activeLineGutter":{backgroundColor:nz},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:nM},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nM,borderBottomColor:nM},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:nz,color:nT}}},{dark:!0}),nE=a.Qf.define([{tag:nC.pJ.keyword,color:"#c678dd"},{tag:[nC.pJ.name,nC.pJ.deleted,nC.pJ.character,nC.pJ.propertyName,nC.pJ.macroName],color:nA},{tag:[nC.pJ.function(nC.pJ.variableName),nC.pJ.labelName],color:"#61afef"},{tag:[nC.pJ.color,nC.pJ.constant(nC.pJ.name),nC.pJ.standard(nC.pJ.name)],color:nR},{tag:[nC.pJ.definition(nC.pJ.name),nC.pJ.separator],color:nT},{tag:[nC.pJ.typeName,nC.pJ.className,nC.pJ.number,nC.pJ.changed,nC.pJ.annotation,nC.pJ.modifier,nC.pJ.self,nC.pJ.namespace],color:"#e5c07b"},{tag:[nC.pJ.operator,nC.pJ.operatorKeyword,nC.pJ.url,nC.pJ.escape,nC.pJ.regexp,nC.pJ.link,nC.pJ.special(nC.pJ.string)],color:"#56b6c2"},{tag:[nC.pJ.meta,nC.pJ.comment],color:nI},{tag:nC.pJ.strong,fontWeight:"bold"},{tag:nC.pJ.emphasis,fontStyle:"italic"},{tag:nC.pJ.strikethrough,textDecoration:"line-through"},{tag:nC.pJ.link,color:nI,textDecoration:"underline"},{tag:nC.pJ.heading,fontWeight:"bold",color:nA},{tag:[nC.pJ.atom,nC.pJ.bool,nC.pJ.special(nC.pJ.variableName)],color:nR},{tag:[nC.pJ.processingInstruction,nC.pJ.string,nC.pJ.inserted],color:"#98c379"},{tag:nC.pJ.invalid,color:"#ffffff"}]),nW=[nN,(0,a.nF)(nE)];var nB=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),nJ=n(85893),nL=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nj=(0,s.forwardRef)((e,t)=>{var{className:n,value:a="",selection:h,extensions:c=[],onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,autoFocus:m,theme:g="light",height:k,minHeight:y,maxHeight:v,width:b,minWidth:x,maxWidth:O,basicSetup:w,placeholder:S,indentWithTab:Q,editable:P,readOnly:C,root:A,initialState:T}=e,I=(0,r.Z)(e,nL),R=(0,s.useRef)(null),{state:z,view:D,container:M,setContainer:$}=function(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:a,onUpdate:h,extensions:c=[],autoFocus:u,theme:f="light",height:d="",minHeight:p="",maxHeight:m="",placeholder:g="",width:k="",minWidth:y="",maxWidth:v="",editable:b=!0,readOnly:x=!1,indentWithTab:O=!0,basicSetup:w=!0,root:S,initialState:Q}=e,[P,C]=(0,s.useState)(),[A,T]=(0,s.useState)(),[I,R]=(0,s.useState)(),z=l.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),D=l.tk.theme({"&":{height:d,minHeight:p,maxHeight:m,width:k,minWidth:y,maxWidth:v}}),M=[l.tk.updateListener.of(e=>{e.docChanged&&"function"==typeof i&&i(e.state.doc.toString(),e),r&&r(nB(e))}),D];switch(O&&M.unshift(l.$f.of([ts])),w&&("boolean"==typeof w?M.unshift(nP()):M.unshift(nP(w))),g&&M.unshift((0,l.W$)(g)),f){case"light":M.push(z);break;case"dark":M.push(nW);break;default:M.push(f)}return!1===b&&M.push(l.tk.editable.of(!1)),x&&M.push(o.yy.readOnly.of(!0)),h&&"function"==typeof h&&M.push(l.tk.updateListener.of(h)),M=M.concat(c),(0,s.useEffect)(()=>{if(P&&!I){var e={doc:t,selection:n,extensions:M},i=Q?o.yy.fromJSON(Q.json,e,Q.fields):o.yy.create(e);if(R(i),!A){var r=new l.tk({state:i,parent:P,root:S});T(r),a&&a(r,i)}}return()=>{A&&(R(void 0),T(void 0))}},[P,I]),(0,s.useEffect)(()=>C(e.container),[e.container]),(0,s.useEffect)(()=>()=>{A&&(A.destroy(),T(void 0))},[A]),(0,s.useEffect)(()=>{u&&A&&A.focus()},[u,A]),(0,s.useEffect)(()=>{A&&A.dispatch({effects:o.Py.reconfigure.of(M)})},[f,c,d,p,m,k,y,v,g,b,x,O,w,i,h]),(0,s.useEffect)(()=>{var e=A?A.state.doc.toString():"";A&&t!==e&&A.dispatch({changes:{from:0,to:e.length,insert:t||""}})},[t,A]),{state:I,setState:R,view:A,setView:T,container:P,setContainer:C}}({container:R.current,root:A,value:a,autoFocus:m,theme:g,height:k,minHeight:y,maxHeight:v,width:b,minWidth:x,maxWidth:O,basicSetup:w,placeholder:S,indentWithTab:Q,editable:P,readOnly:C,selection:h,onChange:u,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:c,initialState:T});if((0,s.useImperativeHandle)(t,()=>({editor:R.current,state:z,view:D}),[R,M,z,D]),"string"!=typeof a)throw Error("value must be typeof string but got "+typeof a);return(0,nJ.jsx)("div",(0,i.Z)({ref:R,className:("string"==typeof g?"cm-theme-"+g:"cm-theme")+(n?" "+n:"")},I))});nj.displayName="CodeMirror";var n_=nj},34790:function(e,t,n){n.d(t,{B1:function(){return eS},GA:function(){return ey},Gn:function(){return er},Mb:function(){return a},eC:function(){return h},vQ:function(){return eu},ys:function(){return ew}});var i=n(78120),r=n(47421),s=n(59119);class o{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=(0,s.qz)(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(f(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function l(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function a(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let r=1;r{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}function h(e,t){return n=>{for(let i=(0,s.qz)(n.state).resolveInner(n.pos,-1);i;i=i.parent)if(e.indexOf(i.name)>-1)return null;return t(n)}}class c{constructor(e,t,n){this.completion=e,this.source=t,this.match=n}}function u(e){return e.selection.main.head}function f(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],s="$"!=i[i.length-1];return r||s?RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function d(e,t){let n=t.completion.apply||t.completion.label,r=t.source;if("string"==typeof n){var s,o,l;e.dispatch((s=e.state,o=r.from,l=r.to,Object.assign(Object.assign({},s.changeByRange(e=>{if(e==s.selection.main)return{changes:{from:o,to:l,insert:n},range:i.jT.cursor(o+n.length)};let t=l-o;return!e.empty||t&&s.sliceDoc(e.from-t,e.from)!=s.sliceDoc(o,l)?{range:e}:{changes:{from:e.from-t,to:e.from,insert:n},range:i.jT.cursor(e.from-t+n.length)}})),{userEvent:"input.complete"})))}else n(e,t.completion,r.from,r.to)}let p=new WeakMap;function m(e){if(!Array.isArray(e))return e;let t=p.get(e);return t||p.set(e,t=a(e)),t}class g{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&Q<=57||Q>=97&&Q<=122?2:Q>=65&&Q<=90?1:0:(P=(0,i.bg)(Q))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!O||1==C&&b||0==S&&0!=C)&&(t[m]==Q||n[m]==Q&&(g=!0)?o[m++]=O:o.length&&(x=!1)),S=C,O+=(0,i.nZ)(Q)}return m==h&&0==o[0]&&x?this.result(-100+(g?-200:0),o,e):k==h&&0==y?[-200-e.length,0,v]:a>-1?[-700-e.length,a,a+this.pattern.length]:k==h?[-900-e.length,y,v]:m==h?this.result(-100+(g?-200:0)+-700+(x?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[e-n.length],s=1;for(let o of t){let l=o+(this.astral?(0,i.nZ)((0,i.gm)(n,o)):1);s>1&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return r}}let k=i.r$.define({combine:e=>(0,i.BO)(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>n=>{var i,r;return i=e(n),r=t(n),i?r?i+" "+r:i:r},addToOptions:(e,t)=>e.concat(t)})});function y(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class v{constructor(e,t){let n;this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:e=>this.positionInfo(e),key:this};let i=e.state.field(t),{options:r,selected:s}=i.open,o=e.state.facet(k);this.optionContent=(n=o.addToOptions.slice(),o.icons&&n.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),n.push({render(e,t,n){let i=document.createElement("span");i.className="cm-completionLabel";let{label:r}=e,s=0;for(let o=1;os&&i.appendChild(document.createTextNode(r.slice(s,l)));let h=i.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(r.slice(l,a))),h.className="cm-completionMatchedText",s=a}return se.position-t.position).map(e=>e.render)),this.optionClass=o.optionClass,this.range=y(r.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",t=>{for(let n=t.target,i;n&&n!=this.dom;n=n.parentNode)if("LI"==n.nodeName&&(i=/-(\d+)$/.exec(n.id))&&+i[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=y(t.options.length,t.selected,this.view.state.facet(k).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let s="string"==typeof i?document.createTextNode(i):i(n);if(!s)return;"then"in s?s.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t)}).catch(e=>(0,r.OO)(this.view.state,e,"completion info")):this.addInfoPane(s)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){var t,n;let i,r,s=null;for(let o=this.list.firstChild,l=this.range.from;o;o=o.nextSibling,l++)l==e?o.hasAttribute("aria-selected")||(o.setAttribute("aria-selected","true"),s=o):o.hasAttribute("aria-selected")&&o.removeAttribute("aria-selected");return s&&(t=this.list,n=s,i=t.getBoundingClientRect(),(r=n.getBoundingClientRect()).topi.bottom&&(t.scrollTop+=r.bottom-i.bottom)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.ownerDocument.defaultView||window,n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect();if(s.top>Math.min(t.innerHeight,n.bottom)-10||s.bottom=i.height||p>n.top?c=s.bottom-n.top+"px":u=n.bottom-s.top+"px"}return{top:c,bottom:u,maxWidth:h,class:a?o?"left-narrow":"right-narrow":l?"left":"right"}}positionInfo(e){this.info&&(e?(this.info.style.top=e.top,this.info.style.bottom=e.bottom,this.info.style.maxWidth=e.maxWidth,this.info.className="cm-tooltip cm-completionInfo cm-completionInfo-"+e.class):this.info.style.top="-1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));for(let r=n.from;r=this.options.length?this:new x(this.options,S(t,e),this.tooltip,this.timestamp,e)}static build(e,t,n,i,r){let s=function(e,t){let n=[],i=0;for(let r of e)if(r.hasResult()){if(!1===r.result.filter){let s=r.result.getMatch;for(let o of r.result.options){let l=[1e9-i++];if(s)for(let a of s(o))l.push(a);n.push(new c(o,r,l))}}else{let h=new g(t.sliceDoc(r.from,r.to)),u;for(let f of r.result.options)(u=h.match(f.label))&&(null!=f.boost&&(u[0]+=f.boost),n.push(new c(f,r,u)))}}let d=[],p=null,m=t.facet(k).compareCompletions;for(let y of n.sort((e,t)=>t.match[0]-e.match[0]||m(e.completion,t.completion)))p&&p.label==y.completion.label&&p.detail==y.completion.detail&&(null==p.type||null==y.completion.type||p.type==y.completion.type)&&p.apply==y.completion.apply?b(y.completion)>b(p)&&(d[d.length-1]=y):d.push(y),p=y.completion;return d}(e,t);if(!s.length)return null;let o=t.facet(k).selectOnOpen?0:-1;if(i&&i.selected!=o&&-1!=i.selected){let l=i.options[i.selected].completion;for(let a=0;at.hasResult()?Math.min(e,t.from):e,1e8),create:e=>new v(e,D),above:r.aboveCursor},i?i.timestamp:Date.now(),o)}map(e){return new x(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class O{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new O(Q,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(k),i=(n.override||t.languageDataAt("autocomplete",u(t)).map(m)).map(t=>(this.active.find(e=>e.source==t)||new C(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n1!=e.state)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new C(e.source,0):e)),e.effects))s.is(z)&&(r=r&&r.setSelected(s.value,this.id));return i==this.active&&r==this.open?this:new O(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:w}}let w={"aria-autocomplete":"list"};function S(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let Q=[];function P(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class C{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=P(e),i=this;for(let r of(n?i=i.handleUserEvent(e,n,t):e.docChanged?i=i.handleChange(e):e.selection&&0!=i.state&&(i=new C(i.source,0)),e.effects))if(r.is(T))i=new C(i.source,1,r.value?u(e.state):-1);else if(r.is(I))i=new C(i.source,0);else if(r.is(R))for(let s of r.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new C(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(u(e.startState))?new C(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new C(this.source,this.state,e.mapPos(this.explicitPos))}}class A extends C{constructor(e,t,n,i,r){super(e,2,t),this.result=n,this.from=i,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var i;let r=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),l=u(e.state);if((this.explicitPos<0?l<=r:ls||"delete"==t&&u(e.startState)==this.from)return new C(this.source,"input"==t&&n.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):f(e,!0).test(r)}(this.result.validFor,e.state,r,s)?this.result.update&&(h=this.result.update(this.result,r,s,new o(e.state,l,a>=0)))?new A(this.source,a,h,h.from,null!==(i=h.to)&&void 0!==i?i:u(e.state)):new C(this.source,1,a):new A(this.source,a,this.result,r,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new C(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new A(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}let T=i.Py.define(),I=i.Py.define(),R=i.Py.define({map:(e,t)=>e.map(e=>e.map(t))}),z=i.Py.define(),D=i.QQ.define({create:()=>O.start(),update:(e,t)=>e.update(t),provide:e=>[r.hJ.from(e,e=>e.tooltip),r.tk.contentAttributes.from(e,e=>e.attrs)]});function M(e,t="option"){return n=>{let i=n.state.field(D,!1);if(!i||!i.open||Date.now()-i.open.timestamp-1?i.open.selected+s*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:z.of(a)}),!0}}let $=e=>{let t=e.state.field(D,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||Date.now()-t.open.timestamp!!e.state.field(D,!1)&&(e.dispatch({effects:T.of(!0)}),!0),E=e=>{let t=e.state.field(D,!1);return!!(t&&t.active.some(e=>0!=e.state))&&(e.dispatch({effects:I.of(null)}),!0)};class W{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let B=r.lg.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0,e.state.field(D).active))1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(D);if(!e.selectionSet&&!e.docChanged&&e.startState.field(D)==t)return;let n=e.transactions.some(e=>(e.selection||e.docChanged)&&!P(e));for(let i=0;i50&&Date.now()-s.time>1e3){for(let o of s.context.abortListeners)try{o()}catch(l){(0,r.OO)(this.view.state,l)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some(e=>1==e.state&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),50):-1,0!=this.composing)for(let a of e.transactions)"input"==P(a)?this.composing=2:2==this.composing&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(D);for(let n of t.active)1!=n.state||this.running.some(e=>e.active.source==n.source)||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=u(t),i=new o(t,n,e.explicitPos==n),s=new W(e,i);this.running.push(s),Promise.resolve(e.source(i)).then(e=>{s.context.aborted||(s.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:I.of(null)}),(0,r.OO)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),50))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(k);for(let i=0;ie.source==r.active.source);if(l&&1==l.state){if(null==r.done){let a=new C(r.active.source,0);for(let h of r.updates)a=a.update(h,n);1!=a.state&&t.push(a)}else this.startQuery(l)}}t.length&&this.view.dispatch({effects:R.of(t)})}},{eventHandlers:{blur(){let e=this.view.state.field(D,!1);e&&e.tooltip&&this.view.state.facet(k).closeOnBlur&&this.view.dispatch({effects:I.of(null)})},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:T.of(!1)}),20),this.composing=0}}}),J=r.tk.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class L{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}}class j{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,i.gc.TrackDel),n=e.mapPos(this.to,1,i.gc.TrackDel);return null==t||null==n?null:new j(this.field,t,n)}}class _{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let a=o,h=/^\t*/.exec(l)[0].length;for(let c=0;cnew j(e.field,i[e.line]+e.from,i[e.line]+e.to));return{text:n,ranges:u}}static parse(e){let t=[],n=[],i=[],r;for(let s of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let o=r[1]?+r[1]:null,l=r[2]||r[3]||"",a=-1;for(let h=0;h=a&&u.field++}i.push(new L(a,n.length,r.index,r.index+l.length)),s=s.slice(0,r.index)+l+s.slice(r.index+r[0].length)}for(let f;f=/([$#])\\{/.exec(s);)for(let d of(s=s.slice(0,f.index)+f[1]+"{"+s.slice(f.index+f[0].length),i))d.line==n.length&&d.from>f.index&&(d.from--,d.to--);n.push(s)}return new _(n,i)}}let F=r.p.widget({widget:new class extends r.l9{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),q=r.p.mark({class:"cm-snippetField"});class U{constructor(e,t){this.ranges=e,this.active=t,this.deco=r.p.set(e.map(e=>(e.from==e.to?F:q).range(e.from,e.to)))}map(e){let t=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;t.push(i)}return new U(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}let X=i.Py.define({map:(e,t)=>e&&e.map(t)}),V=i.Py.define(),Z=i.QQ.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(X))return n.value;if(n.is(V)&&e)return new U(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>r.tk.decorations.from(e,e=>e?e.deco:r.p.none)});function G(e,t){return i.jT.create(e.filter(e=>e.field==t).map(e=>i.jT.range(e.from,e.to)))}function Y(e){return({state:t,dispatch:n})=>{let i=t.field(Z,!1);if(!i||e<0&&0==i.active)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(t=>t.field==r+e);return n(t.update({selection:G(i.ranges,r),effects:X.of(s?null:new U(i.ranges,r))})),!0}}let H=({state:e,dispatch:t})=>!!e.field(Z,!1)&&(t(e.update({effects:X.of(null)})),!0),K=Y(1),ee=Y(-1),et=[{key:"Tab",run:K,shift:ee},{key:"Escape",run:H}],en=i.r$.define({combine:e=>e.length?e[0]:et}),ei=i.Wl.highest(r.$f.compute([en],e=>e.facet(en)));function er(e,t){let n;return Object.assign(Object.assign({},t),{apply:(n=_.parse(e),(e,t,r,s)=>{let{text:o,ranges:l}=n.instantiate(e.state,r),a={changes:{from:r,to:s,insert:i.xv.of(o)},scrollIntoView:!0};if(l.length&&(a.selection=G(l,0)),l.length>1){let h=new U(l,0),c=a.effects=[X.of(h)];void 0===e.state.field(Z,!1)&&c.push(i.Py.appendConfig.of([Z,ei,es,J]))}e.dispatch(e.state.update(a))})})}let es=r.tk.domEventHandlers({mousedown(e,t){let n=t.state.field(Z,!1),i;if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=n.ranges.find(e=>e.from<=i&&e.to>=i);return!!r&&r.field!=n.active&&(t.dispatch({selection:G(n.ranges,r.field),effects:X.of(n.ranges.some(e=>e.field>r.field)?new U(n.ranges,r.field):null)}),!0)}}),eo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},el=i.Py.define({map(e,t){let n=t.mapPos(e,-1,i.gc.TrackAfter);return null==n?void 0:n}}),ea=i.Py.define({map:(e,t)=>t.mapPos(e)}),eh=new class extends i.uU{};eh.startSide=1,eh.endSide=-1;let ec=i.QQ.define({create:()=>i.Xs.empty,update(e,t){if(t.selection){let n=t.state.doc.lineAt(t.selection.main.head).from,r=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(r,-1)&&(e=i.Xs.empty)}for(let s of(e=e.map(t.changes),t.effects))s.is(el)?e=e.update({add:[eh.range(s.value,s.value+1)]}):s.is(ea)&&(e=e.update({filter:e=>e!=s.value}));return e}});function eu(){return[eg,ec]}let ef="()[]{}<>";function ed(e){for(let t=0;t{if((em?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==(0,i.nZ)((0,i.gm)(r,0))||t!=o.from||n!=o.to)return!1;let l=function(e,t){let n=ep(e,e.selection.main.head),r=n.brackets||eo.brackets;for(let o of r){let l=ed((0,i.gm)(o,0));if(t==o)return l==o?function(e,t,n,r){let o=r.stringPrefixes||eo.stringPrefixes,l=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:el.of(r.to+t.length),range:i.jT.range(r.anchor+t.length,r.head+t.length)};let a=r.head,h=eb(e.doc,a),c;if(h==t){if(ex(e,a))return{changes:{insert:t+t,from:a},effects:el.of(a+t.length),range:i.jT.cursor(a+t.length)};if(ev(e,a)){let u=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:i.jT.cursor(a+t.length*(u?3:1)),effects:ea.of(a)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(c=eO(e,a-2*t.length,o))>-1&&ex(e,c))return{changes:{insert:t+t+t+t,from:a},effects:el.of(a+t.length),range:i.jT.cursor(a+t.length)};else if(e.charCategorizer(a)(h)!=i.D0.Word&&eO(e,a,o)>-1&&!function(e,t,n,i){let r=(0,s.qz)(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let l=0;l<5;l++){let a=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),h=a.indexOf(n);if(!h||h>-1&&i.indexOf(a.slice(0,h))>-1){let c=r.firstChild;for(;c&&c.from==r.from&&c.to-c.from>n.length+h;){if(e.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}(e,a,t,o))return{changes:{insert:t+t,from:a},effects:el.of(a+t.length),range:i.jT.cursor(a+t.length)};return{range:l=r}});return l?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,r.indexOf(o+o+o)>-1,n):function(e,t,n,r){let s=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:el.of(o.to+t.length),range:i.jT.range(o.anchor+t.length,o.head+t.length)};let l=eb(e.doc,o.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:el.of(o.head+t.length),range:i.jT.cursor(o.head+t.length)}:{range:s=o}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,l,n.before||eo.before);if(t==l&&ev(e,e.selection.main.from))return function(e,t,n){let r=null,s=e.selection.ranges.map(t=>t.empty&&eb(e.doc,t.head)==n?i.jT.cursor(t.head+n.length):r=t);return r?null:e.update({selection:i.jT.create(s,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map(({from:e})=>ea.of(e))})}(e,0,l)}return null}(e.state,r);return!!l&&(e.dispatch(l),!0)}),ek=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=ep(e,e.selection.main.head).brackets||eo.brackets,r=null,s=e.changeByRange(t=>{if(t.empty){var s,o;let l;let a=(s=e.doc,o=t.head,l=s.sliceString(o-2,o),(0,i.nZ)((0,i.gm)(l,0))==l.length?l:l.slice(1));for(let h of n)if(h==a&&eb(e.doc,t.head)==ed((0,i.gm)(h,0)))return{changes:{from:t.head-h.length,to:t.head+h.length},range:i.jT.cursor(t.head-h.length)}}return{range:r=t}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},ey=[{key:"Backspace",run:ek}];function ev(e,t){let n=!1;return e.field(ec).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function eb(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,i.nZ)((0,i.gm)(n,0)))}function ex(e,t){let n=(0,s.qz)(e).resolveInner(t+1);return n.parent&&n.from==t}function eO(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=i.D0.Word)return t;for(let s of n){let o=t-s.length;if(e.sliceDoc(o,t)==s&&r(e.sliceDoc(o-1,o))!=i.D0.Word)return o}return -1}function ew(e={}){return[D,k.of(e),B,eQ,J]}let eS=[{key:"Ctrl-Space",run:N},{key:"Escape",run:E},{key:"ArrowDown",run:M(!0)},{key:"ArrowUp",run:M(!1)},{key:"PageDown",run:M(!0,"page")},{key:"PageUp",run:M(!1,"page")},{key:"Enter",run:$}],eQ=i.Wl.highest(r.$f.computeN([k],e=>e.facet(k).defaultKeymap?[eS]:[]))},61426:function(e,t,n){n.r(t),n.d(t,{css:function(){return S},cssCompletionSource:function(){return O},cssLanguage:function(){return w}});var i=n(53105),r=n(35524);let s=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function o(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}let l=new i.Jq((e,t)=>{for(let n=!1,i=0,r=0;;r++){var s;let{next:l}=e;if(o(l)||45==l||95==l||n&&(s=l)>=48&&s<=57)!n&&(45!=l||r>0)&&(n=!0),i===r&&45==l&&i++,e.advance();else{n&&e.acceptToken(40==l?94:2==i&&t.canShift(2)?2:95);break}}}),a=new i.Jq(e=>{if(s.includes(e.peek(-1))){let{next:t}=e;(o(t)||95==t||35==t||46==t||91==t||58==t||45==t)&&e.acceptToken(93)}}),h=new i.Jq(e=>{if(!s.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),o(t)){do e.advance();while(o(e.next));e.acceptToken(1)}}}),c=(0,r.Gv)({"AtKeyword import charset namespace keyframes media supports":r.pJ.definitionKeyword,"from to selector":r.pJ.keyword,NamespaceName:r.pJ.namespace,KeyframeName:r.pJ.labelName,TagName:r.pJ.tagName,ClassName:r.pJ.className,PseudoClassName:r.pJ.constant(r.pJ.className),IdName:r.pJ.labelName,"FeatureName PropertyName":r.pJ.propertyName,AttributeName:r.pJ.attributeName,NumberLiteral:r.pJ.number,KeywordQuery:r.pJ.keyword,UnaryQueryOp:r.pJ.operatorKeyword,"CallTag ValueName":r.pJ.atom,VariableName:r.pJ.variableName,Callee:r.pJ.operatorKeyword,Unit:r.pJ.unit,"UniversalSelector NestingSelector":r.pJ.definitionOperator,MatchOp:r.pJ.compareOperator,"ChildOp SiblingOp, LogicOp":r.pJ.logicOperator,BinOp:r.pJ.arithmeticOperator,Important:r.pJ.modifier,Comment:r.pJ.blockComment,ParenthesizedContent:r.pJ.special(r.pJ.name),ColorLiteral:r.pJ.color,StringLiteral:r.pJ.string,":":r.pJ.punctuation,"PseudoOp #":r.pJ.derefOperator,"; ,":r.pJ.separator,"( )":r.pJ.paren,"[ ]":r.pJ.squareBracket,"{ }":r.pJ.brace}),u={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},f={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},d={__proto__:null,not:128,only:128,from:158,to:160},p=i.WQ.deserialize({version:14,states:"7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[O,59sO%_Q[O,59uO%_Q[O,59vO'bQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO'iQWO,59SO'nQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO'sQ`O,59oOOQS'#Cp'#CpO#kQdO'#CqO'{QvO'#CsO)VQtO,5:POOQO'#Cx'#CxO'nQWO'#CwO)kQWO'#CyOOQS'#Ef'#EfOOQO'#Dh'#DhO)pQ[O'#DoO*OQWO'#EiO$xQ[O'#DmO*^QWO'#DpOOQO'#Ej'#EjO%|QWO,5:^O*cQpO,5:`OOQS'#Dx'#DxO*kQWO,5:bO*pQ[O,5:bOOQO'#D{'#D{O*xQWO,5:eO*}QWO,5:kO+VQWO,5:mOOQS-E8Q-E8QOOQP1G.l1G.lO+yQXO,5:qOOQO-E8T-E8TOOQS1G.g1G.gOOQP1G.n1G.nO'iQWO1G.nO'nQWO1G.nOOQP1G/V1G/VO,WQ`O1G/ZO,qQXO1G/_O-XQXO1G/aO-oQXO1G/bO.VQXO'#CdO.zQWO'#DaOOQS,59z,59zO/PQWO,59zO/XQ[O,59zO/`Q[O'#DOO/gQdO'#CoOOQP1G/Z1G/ZO#kQdO1G/ZO/nQpO,59]OOQS,59_,59_O#kQdO,59aO/vQWO1G/kOOQS,59c,59cO/{Q!bO,59eO0TQWO'#DhO0`QWO,5:TO0eQWO,5:ZO$xQ[O,5:VO$xQ[O'#EYO0mQWO,5;TO0xQWO,5:XO%_Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O1ZQWO1G/|O1`QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XOOQP7+$Y7+$YOOQP7+$u7+$uO#kQdO7+$uO#kQdO,59{O1nQ[O'#EXO1xQWO1G/fOOQS1G/f1G/fO1xQWO1G/fO2QQXO'#EhO2XQWO,59jO2^QtO'#ETO3RQdO'#EeO3]QWO,59ZO3bQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO3jQWO1G/PO#kQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO3oQWO,5:tOOQO-E8W-E8WO3}QXO1G/vOOQS7+%h7+%hO4UQYO'#CsO%|QWO'#EZO4^QdO,5:hOOQS,5:h,5:hO4lQpO<O!c!}$w!}#O?[#O#P$w#P#Q?g#Q#R2U#R#T$w#T#U?r#U#c$w#c#d@q#d#o$w#o#pAQ#p#q2U#q#rA]#r#sAh#s#y$w#y#z%]#z$f$w$f$g%]$g#BY$w#BY#BZ%]#BZ$IS$w$IS$I_%]$I_$I|$w$I|$JO%]$JO$JT$w$JT$JU%]$JU$KV$w$KV$KW%]$KW&FU$w&FU&FV%]&FV~$wW$zQOy%Qz~%QW%VQoWOy%Qz~%Q~%bf#T~OX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q~&}f#T~oWOX%QX^&v^p%Qpq&vqy%Qz#y%Q#y#z&v#z$f%Q$f$g&v$g#BY%Q#BY#BZ&v#BZ$IS%Q$IS$I_&v$I_$I|%Q$I|$JO&v$JO$JT%Q$JT$JU&v$JU$KV%Q$KV$KW&v$KW&FU%Q&FU&FV&v&FV~%Q^(fSOy%Qz#]%Q#]#^(r#^~%Q^(wSoWOy%Qz#a%Q#a#b)T#b~%Q^)YSoWOy%Qz#d%Q#d#e)f#e~%Q^)kSoWOy%Qz#c%Q#c#d)w#d~%Q^)|SoWOy%Qz#f%Q#f#g*Y#g~%Q^*_SoWOy%Qz#h%Q#h#i*k#i~%Q^*pSoWOy%Qz#T%Q#T#U*|#U~%Q^+RSoWOy%Qz#b%Q#b#c+_#c~%Q^+dSoWOy%Qz#h%Q#h#i+p#i~%Q^+wQ!VUoWOy%Qz~%Q~,QUOY+}Zr+}rs,ds#O+}#O#P,i#P~+}~,iOh~~,lPO~+}_,tWtPOy%Qz!Q%Q!Q![-^![!c%Q!c!i-^!i#T%Q#T#Z-^#Z~%Q^-cWoWOy%Qz!Q%Q!Q![-{![!c%Q!c!i-{!i#T%Q#T#Z-{#Z~%Q^.QWoWOy%Qz!Q%Q!Q![.j![!c%Q!c!i.j!i#T%Q#T#Z.j#Z~%Q^.qWfUoWOy%Qz!Q%Q!Q![/Z![!c%Q!c!i/Z!i#T%Q#T#Z/Z#Z~%Q^/bWfUoWOy%Qz!Q%Q!Q![/z![!c%Q!c!i/z!i#T%Q#T#Z/z#Z~%Q^0PWoWOy%Qz!Q%Q!Q![0i![!c%Q!c!i0i!i#T%Q#T#Z0i#Z~%Q^0pWfUoWOy%Qz!Q%Q!Q![1Y![!c%Q!c!i1Y!i#T%Q#T#Z1Y#Z~%Q^1_WoWOy%Qz!Q%Q!Q![1w![!c%Q!c!i1w!i#T%Q#T#Z1w#Z~%Q^2OQfUoWOy%Qz~%QY2XSOy%Qz!_%Q!_!`2e!`~%QY2lQzQoWOy%Qz~%QX2wQXPOy%Qz~%Q~3QUOY2}Zw2}wx,dx#O2}#O#P3d#P~2}~3gPO~2}_3oQbVOy%Qz~%Q~3zOa~_4RSUPjSOy%Qz!_%Q!_!`2e!`~%Q_4fUjS!PPOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q^4}SoWOy%Qz!Q%Q!Q![5Z![~%Q^5bWoW#ZUOy%Qz!Q%Q!Q![5Z![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q^6PWoWOy%Qz{%Q{|6i|}%Q}!O6i!O!Q%Q!Q![6z![~%Q^6nSoWOy%Qz!Q%Q!Q![6z![~%Q^7RSoW#ZUOy%Qz!Q%Q!Q![6z![~%Q^7fYoW#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q_8ZQpVOy%Qz~%Q^8fUjSOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_8}S#WPOy%Qz!Q%Q!Q![5Z![~%Q~9`RjSOy%Qz{9i{~%Q~9nSoWOy9iyz9zz{:o{~9i~9}ROz9zz{:W{~9z~:ZTOz9zz{:W{!P9z!P!Q:j!Q~9z~:oOR~~:tUoWOy9iyz9zz{:o{!P9i!P!Q;W!Q~9i~;_QoWR~Oy%Qz~%Q^;jY#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[a,h,l,0,1,2,3],topRules:{StyleSheet:[0,4]},specialized:[{term:94,get:e=>u[e]||-1},{term:56,get:e=>f[e]||-1},{term:95,get:e=>d[e]||-1}],tokenPrec:1078});var m=n(59119);let g=null;function k(){if(!g&&"object"==typeof document&&document.body){let e=[];for(let t in document.body.style)/[A-Z]|^-|^(item|length)$/.test(t)||e.push(t);g=e.sort().map(e=>({type:"property",label:e}))}return g||[]}let y=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),v=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),b=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),x=/^[\w-]*/,O=e=>{let{state:t,pos:n}=e,i=(0,m.qz)(t).resolveInner(n,-1);if("PropertyName"==i.name)return{from:i.from,options:k(),validFor:x};if("ValueName"==i.name)return{from:i.from,options:v,validFor:x};if("PseudoClassName"==i.name)return{from:i.from,options:y,validFor:x};if("TagName"==i.name){for(let{parent:r}=i;r;r=r.parent)if("Block"==r.name)return{from:i.from,options:k(),validFor:x};return{from:i.from,options:b,validFor:x}}if(!e.explicit)return null;let s=i.resolve(n),o=s.childBefore(n);return o&&":"==o.name&&"PseudoClassSelector"==s.name?{from:n,options:y,validFor:x}:o&&":"==o.name&&"Declaration"==s.name||"ArgList"==s.name?{from:n,options:v,validFor:x}:"Block"==s.name?{from:n,options:k(),validFor:x}:null},w=m.qp.define({name:"css",parser:p.configure({props:[m.uj.add({Declaration:(0,m.tC)()}),m.x0.add({Block:m.Dv})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function S(){return new m.ri(w,w.data.of({autocomplete:O}))}},59119:function(e,t,n){n.d(t,{Be:function(){return k},Dv:function(){return _},Gn:function(){return R},K0:function(){return I},Qf:function(){return ef},R_:function(){return ey},SQ:function(){return u},SS:function(){return T},Um:function(){return eT},c:function(){return C},c6:function(){return Q},e7:function(){return ei},il:function(){return eD},kU:function(){return c},mi:function(){return ec},n$:function(){return eC},nF:function(){return eg},nY:function(){return J},pp:function(){return h},qp:function(){return d},qz:function(){return p},ri:function(){return S},tC:function(){return B},uj:function(){return z},vw:function(){return N},x0:function(){return j},y1:function(){return A},ze:function(){return W}});var i,r=n(41113),s=n(78120),o=n(47421),l=n(35524),a=n(28699);let h=new r.md;function c(e){return s.r$.define({combine:e?t=>t.concat(e):void 0})}class u{constructor(e,t,n=[],i=""){this.data=e,this.name=i,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[w.of(this),s.yy.languageData.of((e,t,n)=>e.facet(f(e,t,n)))].concat(n)}isActiveAt(e,t,n=-1){return f(e,t,n)==this.data}findRegions(e){let t=e.facet(w);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(h)==this.data){n.push({from:t,to:t+e.length});return}let s=e.prop(r.md.mounted);if(s){if(s.tree.prop(h)==this.data){if(s.overlay)for(let o of s.overlay)n.push({from:o.from+t,to:o.to+t});else n.push({from:t,to:t+e.length});return}if(s.overlay){let l=n.length;if(i(s.tree,s.overlay[0].from+t),n.length>l)return}}for(let a=0;ae.isTop?t:void 0)]}),e.name)}configure(e,t){return new d(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(u.state,!1);return t?t.tree:r.mp.empty}class m{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let g=null;class k{constructor(e,t,n=[],i,r,s,o,l){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new k(e,t,[],r.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new m(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=r.mp.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=g;g=this;try{return e()}finally{g=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=y(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((e,t,n,i)=>a.push({fromA:e,toA:t,fromB:n,toB:i})),n=r.i9.applyChanges(n,a),i=r.mp.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let h of(l=[],this.skipped)){let c=e.mapPos(h.from,1),u=e.mapPos(h.to,-1);ce.from&&(this.fragments=y(this.fragments,i,r),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends r._b{createParse(t,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let t=g;if(t){for(let n of i)t.tempSkipped.push(n);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new r.mp(r.Jq.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return g}}function y(e,t,n){return r.i9.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class v{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new v(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=k.create(e.facet(w).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new v(n)}}u.state=s.QQ.define({create:v.init,update(e,t){for(let n of t.effects)if(n.is(u.setState))return n.value;return t.startState.facet(w)!=t.state.facet(w)?v.init(t.state):e.apply(t)}});let b=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(b=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let x="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,O=o.lg.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(u.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=b(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,l=r.context.work(()=>x&&x()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:u.setState.of(new v(r.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,o.OO)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),w=s.r$.define({combine:e=>e.length?e[0]:null,enables:e=>[u.state,O,o.tk.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class S{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Q{constructor(e,t,n,i,r,s){this.name=e,this.alias=t,this.extensions=n,this.filename=i,this.loadFunc=r,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new Q(e.name,(e.alias||[]).concat(e.name).map(e=>e.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){for(let i of(t=t.toLowerCase(),e))if(i.alias.some(e=>e==t))return i;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}let P=s.r$.define(),C=s.r$.define({combine(e){if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function A(e){let t=e.facet(C);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function T(e,t){let n="",i=e.tabSize;if(9==e.facet(C).charCodeAt(0))for(;t>=i;)n+=" ",t-=i;for(let r=0;r=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i-1&&(r+=s-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return(0,s.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let s=r(i);if(s>-1)return s}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let z=new r.md;function D(e,t,n){for(;e;e=e.parent){let i=function(e){let t=e.type.prop(z);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(r.md.closedBy))){let s=e.lastChild,o=s&&i.indexOf(s.name)>-1;return e=>E(e,!0,1,void 0,o&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?s.from:void 0)}return null==e.parent?M:null}(e);if(i)return i($.create(n,t,e))}return null}function M(){return 0}class $ extends R{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.node=n}static create(e,t,n){return new $(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?D(e,this.pos,this.base):0}}function N({closing:e,align:t=!0,units:n=1}){return i=>E(i,t,n,e)}function E(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,a=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.frome.baseIndent;function B({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}function J(){return s.yy.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let s=n.sliceString(r.from,i);if(!t.some(e=>e.test(s)))return e;let{state:o}=e,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let u=I(o,c.from);if(null==u)continue;let f=/^\s*/.exec(c.text)[0],d=T(o,u);f!=d&&a.push({from:c.from,to:c.from+f.length,insert:d})}return a.length?[e,{changes:a,sequential:!0}]:e})}let L=s.r$.define(),j=new r.md;function _(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&o.from=t&&a.to>n&&(s=a)}}return s}(e,t,n)}function q(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let U=s.Py.define({map:q}),X=s.Py.define({map:q});function V(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let Z=s.QQ.define({create:()=>o.p.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))n.is(U)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,n.value.from,n.value.to)?e=e.update({add:[el.range(n.value.from,n.value.to)]}):n.is(X)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let i=!1,{head:r}=t.selection.main;e.between(r,r,(e,t)=>{er&&(i=!0)}),i&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>o.tk.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})}),r}function Y(e,t){return e.field(Z,!1)?t:t.concat(s.Py.appendConfig.of(eo()))}let H=e=>{for(let t of V(e)){let n=F(e.state,t.from,t.to);if(n)return e.dispatch({effects:Y(e.state,[U.of(n),ee(e,n)])}),!0}return!1},K=e=>{if(!e.state.field(Z,!1))return!1;let t=[];for(let n of V(e)){let i=G(e.state,n.from,n.to);i&&t.push(X.of(i),ee(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function ee(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return o.tk.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let et=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Z,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(X.of({from:e,to:t}))}),e.dispatch({effects:n}),!0},ei=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:H},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:K},{key:"Ctrl-Alt-[",run:et},{key:"Ctrl-Alt-]",run:en}],er={placeholderDOM:null,placeholderText:"…"},es=s.r$.define({combine:e=>(0,s.BO)(e,er)});function eo(e){let t=[Z,eu];return e&&t.push(es.of(e)),t}let el=o.p.replace({widget:new class extends o.l9{toDOM(e){let{state:t}=e,n=t.facet(es),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=G(e.state,n.from,n.to);i&&e.dispatch({effects:X.of(i)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,i);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=i,r}}}),ea={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class eh extends o.SJ{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function ec(e={}){let t=Object.assign(Object.assign({},ea),e),n=new eh(t,!0),i=new eh(t,!1),r=o.lg.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(w)!=e.state.facet(w)||e.startState.field(Z,!1)!=e.state.field(Z,!1)||p(e.startState)!=p(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new s.f_;for(let r of e.viewportLineBlocks){let o=G(e.state,r.from,r.to)?i:F(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:l}=t;return[r,(0,o.v5)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||s.Xs.empty},initialSpacer:()=>new eh(t,!1),domEventHandlers:Object.assign(Object.assign({},l),{click(e,t,n){if(l.click&&l.click(e,t,n))return!0;let i=G(e.state,t.from,t.to);if(i)return e.dispatch({effects:X.of(i)}),!0;let r=F(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:U.of(r)}),!0)}})}),eo()]}let eu=o.tk.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ef{constructor(e,t){let n;function i(e){let t=a.V.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof u?e=>e.prop(h)==s.data:s?e=>e==s:void 0,this.style=(0,l.QR)(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new a.V(n):null,this.themeType=t.themeType}static define(e,t){return new ef(e,t||{})}}let ed=s.r$.define(),ep=s.r$.define({combine:e=>e.length?[e[0]]:null});function em(e){let t=e.facet(ed);return t.length?t:e.facet(ep)}function eg(e,t){let n=[ek],i;return e instanceof ef&&(e.module&&n.push(o.tk.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(ep.of(e)):i?n.push(ed.computeN([o.tk.darkTheme],t=>t.facet(o.tk.darkTheme)==("dark"==i)?[e]:[])):n.push(ed.of(e)),n}let ek=s.Wl.high(o.lg.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,em(e.state))}update(e){let t=p(e.state),n=em(e.state),i=n!=em(e.startState);t.length{n.add(e,t,this.markCache[i]||(this.markCache[i]=o.p.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),ey=ef.define([{tag:l.pJ.meta,color:"#7a757a"},{tag:l.pJ.link,textDecoration:"underline"},{tag:l.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:l.pJ.emphasis,fontStyle:"italic"},{tag:l.pJ.strong,fontWeight:"bold"},{tag:l.pJ.strikethrough,textDecoration:"line-through"},{tag:l.pJ.keyword,color:"#708"},{tag:[l.pJ.atom,l.pJ.bool,l.pJ.url,l.pJ.contentSeparator,l.pJ.labelName],color:"#219"},{tag:[l.pJ.literal,l.pJ.inserted],color:"#164"},{tag:[l.pJ.string,l.pJ.deleted],color:"#a11"},{tag:[l.pJ.regexp,l.pJ.escape,l.pJ.special(l.pJ.string)],color:"#e40"},{tag:l.pJ.definition(l.pJ.variableName),color:"#00f"},{tag:l.pJ.local(l.pJ.variableName),color:"#30a"},{tag:[l.pJ.typeName,l.pJ.namespace],color:"#085"},{tag:l.pJ.className,color:"#167"},{tag:[l.pJ.special(l.pJ.variableName),l.pJ.macroName],color:"#256"},{tag:l.pJ.definition(l.pJ.propertyName),color:"#00c"},{tag:l.pJ.comment,color:"#940"},{tag:l.pJ.invalid,color:"#f00"}]),ev=o.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),eb="()[]{}",ex=s.r$.define({combine:e=>(0,s.BO)(e,{afterCursor:!0,brackets:eb,maxScanDistance:1e4,renderMatch:eS})}),eO=o.p.mark({class:"cm-matchingBracket"}),ew=o.p.mark({class:"cm-nonmatchingBracket"});function eS(e){let t=[],n=e.matched?eO:ew;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let eQ=s.QQ.define({create:()=>o.p.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],i=t.state.facet(ex);for(let r of t.state.selection.ranges){if(!r.empty)continue;let s=eT(t.state,r.head,-1,i)||r.head>0&&eT(t.state,r.head-1,1,i)||i.afterCursor&&(eT(t.state,r.head,1,i)||r.heado.tk.decorations.from(e)}),eP=[eQ,ev];function eC(e={}){return[ex.of(e),eP]}function eA(e,t,n){let i=e.prop(t<0?r.md.openedBy:r.md.closedBy);if(i)return i;if(1==e.name.length){let s=n.indexOf(e.name);if(s>-1&&s%2==(t<0?1:0))return[n[s+t]]}return null}function eT(e,t,n,i={}){let r=i.maxScanDistance||1e4,s=i.brackets||eb,o=p(e),l=o.resolveInner(t,n);for(let a=l;a;a=a.parent){let h=eA(a.type,n,s);if(h&&a.from=i.to){if(0==a&&r.indexOf(h.type.name)>-1&&h.from0)return null;let h={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let f=0;!c.next().done&&f<=s;){let d=c.value;n<0&&(f+=d.length);let p=t+f*n;for(let m=n>0?0:d.length-1,g=n>0?d.length:-1;m!=g;m+=n){let k=o.indexOf(d[m]);if(!(k<0)&&i.resolveInner(p+m,1).type==r){if(k%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:p+m,to:p+m+1},matched:k>>1==a>>1};u--}}}n>0&&(f+=d.length)}return c.done?{start:h,matched:!1}:null}(e,t,n,o,l.type,r,s)}function eI(e,t,n,i=0,r=0){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);let s=r;for(let o=i;o=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?e.toLowerCase():e;return i(this.string.substr(this.pos,e.length))==i(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function ez(e){if("object"!=typeof e)return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}class eD extends u{constructor(e){let t,n=c(e.languageData),i={name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||ez,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||eE},s;super(n,new class extends r._b{createParse(e,t,n){return new e$(s,e,t,n)}},[P.of((e,t)=>this.getIndent(e,t))],e.name),this.topNode=(t=r.Jq.define({id:eW.length,name:"Document",props:[h.add(()=>n)]}),eW.push(t),t),s=this,this.streamParser=i,this.stateAfter=new r.md({perNode:!0}),this.tokenTable=e.tokenTable?new eF(i.tokenTable):eq}static define(e){return new eD(e)}getIndent(e,t){let n=p(e.state),i=n.resolve(t);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let r=eM(this,n,0,i.from,t),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(e.unit),s=0),t-s>1e4)return null;for(;s=i&&n+t.length<=s&&t.prop(e.stateAfter);if(o)return{state:e.streamParser.copyState(o),pos:n+t.length};for(let l=t.children.length-1;l>=0;l--){let a=t.children[l],h=n+t.positions[l],c=a instanceof r.mp&&hn&&eM(e,s.tree,0-s.offset,n,l),h;if(a&&(h=function e(t,n,i,s,o){if(o&&i<=0&&s>=n.length)return n;o||n.type!=t.topNode||(o=!0);for(let l=n.children.length-1;l>=0;l--){let a=n.positions[l],h=n.children[l],c;if(a=t)?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let n=t.indexOf("\n");n>-1&&(t=t.slice(0,n))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let i=this.rangeIndex;;){let r=this.ranges[i].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),++i==this.ranges.length))break;let s=this.ranges[i].from,o=this.lineAfter(s);t+=o,n=s+o.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let i=this.ranges[this.rangeIndex].to,r=e+t;if(n>0?i>r:i>=r)break;t+=this.ranges[++this.rangeIndex].from-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let s=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-s}return this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),i=0,{streamParser:r}=this.lang,s=new eR(t,e?e.state.tabSize:4,e?A(e.state):2);if(s.eol())r.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let o=eN(r.token,s,this.state);if(o&&(i=this.emitToken(this.lang.tokenTable.resolve(o),this.parsedPos+s.start,this.parsedPos+s.pos,4,i)),s.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPost.start)return r}throw Error("Stream parser failed to advance stream.")}let eE=Object.create(null),eW=[r.Jq.none],eB=new r.Lj(eW),eJ=[],eL=Object.create(null);for(let[ej,e_]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])eL[ej]=eX(eE,e_);class eF{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),eL)}resolve(e){return e?this.table[e]||(this.table[e]=eX(this.extra,e)):0}}let eq=new eF(eE);function eU(e,t){eJ.indexOf(e)>-1||(eJ.push(e),console.warn(t))}function eX(e,t){let n=null;for(let i of t.split(".")){let s=e[i]||l.pJ[i];s?"function"==typeof s?n?n=s(n):eU(i,`Modifier ${i} used at start of tag`):n?eU(i,`Tag ${i} used as modifier`):n=s:eU(i,`Unknown highlighting tag ${i}`)}if(!n)return 0;let o=t.replace(/ /g,"_"),a=r.Jq.define({id:eW.length,name:o,props:[(0,l.Gv)({[o]:n})]});return eW.push(a),a.id}},78120:function(e,t,n){let i;n.d(t,{BO:function(){return ex},D0:function(){return ek},Gz:function(){return eB},IS:function(){return eW},Py:function(){return eu},QQ:function(){return q},Wl:function(){return V},Xs:function(){return eP},YW:function(){return ef},as:function(){return A},bg:function(){return x},cp:function(){return m},f_:function(){return eC},gc:function(){return P},gm:function(){return b},jT:function(){return N},n0:function(){return C},nZ:function(){return O},q6:function(){return ea},r$:function(){return B},uU:function(){return eO},xv:function(){return r},yy:function(){return eb}});class r{constructor(){}lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),o.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),o.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new a(this),r=new a(e);for(let s=t,o=t;;){if(i.next(s),r.next(s),s=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new a(this,e)}iterRange(e,t=this.length){return new h(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new s(e):o.from(s.split(e,[])):r.empty}}class s extends r{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.text[r],o=i+s.length;if((t?n:o)>=e)return new u(i,o,n,s);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new s(l(this.text,[""],e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let o=n.pop(),a=l(r.text,o.text.slice(),0,r.length);if(a.length<=32)n.push(new s(a,o.length+r.length));else{let h=a.length>>1;n.push(new s(a.slice(0,h)),new s(a.slice(h)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof s))return super.replace(e,t,n);let i=l(this.text,l(n.text,l(this.text,[""],0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new s(i,r):o.from(s.split(i,[]),r)}sliceString(e,t=this.length,n="\n"){let i="";for(let r=0,s=0;r<=t&&se&&s&&(i+=n),er&&(i+=o.slice(Math.max(0,e-r),t-r)),r=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new s(n,i)),n=[],i=-1);return i>-1&&t.push(new s(n,i)),t}}class o extends r{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.children[r],o=i+s.length,l=n+s.lines-1;if((t?l:o)>=e)return s.lineInner(e,t,n,i);i=o+1,n=l+1}}decompose(e,t,n,i){for(let r=0,s=0;s<=t&&r=s){let a=i&((s<=e?1:0)|(l>=t?2:0));s>=e&&l<=t&&!a?n.push(o):o.decompose(e-s,t-s,n,a)}s=l+1}}replace(e,t,n){if(n.lines=r&&t<=l){let a=s.replace(e-r,t-r,n),h=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[i]=a,new o(c,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){let i="";for(let r=0,s=0;re&&r&&(i+=n),es&&(i+=o.sliceString(e-s,t-s,n)),s=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof o))return 0;let n=0,[i,r,s,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==s||r==l)return n;let a=this.children[i],h=e.children[r];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let i of e)n+=i.lines;if(n<32){let r=[];for(let l of e)l.flatten(r);return new s(r,t)}let a=Math.max(32,n>>5),h=a<<1,c=a>>1,u=[],f=0,d=-1,p=[];function m(){0!=f&&(u.push(1==p.length?p[0]:o.from(p,d)),d=-1,f=p.length=0)}for(let g of e)!function e(t){let n;if(t.lines>h&&t instanceof o)for(let i of t.children)e(i);else t.lines>c&&(f>c||!f)?(m(),u.push(t)):t instanceof s&&f&&(n=p[p.length-1])instanceof s&&t.lines+n.lines<=32?(f+=t.lines,d+=t.length+1,p[p.length-1]=new s(n.text.concat(t.text),n.length+1+t.length)):(f+t.lines>a&&m(),f+=t.lines,d+=t.length+1,p.push(t))}(g);return m(),1==u.length?u[0]:new o(u,t)}}function l(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(a>i&&(l=l.slice(0,i-r)),r0?1:(e instanceof s?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,l=i instanceof s?i.text.length:i.children.length;if(o==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof s){let a=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=0==e?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let h=i.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof s?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class h{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new a(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(r.prototype[Symbol.iterator]=function(){return this.iter()},a.prototype[Symbol.iterator]=h.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class u{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}let f="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let d=1;d=127462&&e<=127487}function m(e,t,n=!0,i=!0){return(n?g:k)(e,t,i)}function g(e,t,n){if(t==e.length)return t;t&&y(e.charCodeAt(t))&&v(e.charCodeAt(t-1))&&t--;let i=b(e,t);for(t+=O(i);te)return f[t-1]<=e;return!1}(r))t+=O(r),i=r;else if(p(r)){let s=0,o=t-2;for(;o>=0&&p(b(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function k(e,t,n){for(;t>0;){let i=g(e,t-2,n);if(i=56320&&e<57344}function v(e){return e>=55296&&e<56320}function b(e,t){let n=e.charCodeAt(t);if(!v(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return y(i)?(n-55296<<10)+(i-56320)+65536:n}function x(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function O(e){return e<65536?1:2}let w=/\r\n?|\n/;var S,Q,P=((S=P||(P={}))[S.Simple=0]="Simple",S[S.TrackDel=1]="TrackDel",S[S.TrackBefore=2]="TrackBefore",S[S.TrackAfter=3]="TrackAfter",S);class C{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-i);r+=o}else{if(n!=P.Simple&&a>=e&&(n==P.TrackDel&&ie||n==P.TrackBefore&&ie))return null;if(a>e||a==e&&t<0&&!o)return e==i||t<0?r:r+l;r+=l}i=a}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&o>=e)return!(it)||"cover";i=o}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new C(e)}static create(e){return new C(e)}}class A extends C{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return R(this,(t,n,i,r,s)=>e=e.replace(i,i+(n-t),s),!1),e}mapDesc(e,t=!1){return z(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,s=0;i=0){t[i]=l,t[i+1]=o;let a=i>>1;for(;n.length0&&I(n,t,r.text),r.forward(a),o+=a}let c=e[s++];for(;o>1].toJSON()))}return e}static of(e,t,n){let i=[],s=[],o=0,l=null;function a(e=!1){if(!e&&!i.length)return;of||u<0||f>t)throw RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let p=d?"string"==typeof d?r.of(d.split(n||w)):d:r.empty,m=p.length;if(u==f&&0==m)return;uo&&T(i,u-o,-1),T(i,f-u,m),I(s,i,p),o=f}}(e),a(!l),l}static empty(e){return new A(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;it&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==s.length)t.push(s[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function I(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i>1])),!n&&l!=e.sections.length&&!(e.sections[l+1]<0);)a=e.sections[l++],h=e.sections[l++];t(s,c,o,u,f),s=c,o=u}}}function z(e,t,n,i=!1){let r=[],s=i?[]:null,o=new M(e),l=new M(t);for(let a=-1;;)if(-1==o.ins&&-1==l.ins){let h=Math.min(o.len,l.len);T(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||0==o.off&&(l.len=0&&a=0){let f=0,d=o.len;for(;d;)if(-1==l.ins){let p=Math.min(d,l.len);f+=p,d-=p,l.forward(p)}else if(0==l.ins&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}else T(i,0,o.ins,l),r&&I(r,i,o.text),o.next()}}class M{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?r.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?r.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ${constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let e=3&this.flags;return 3==e?null:e}get goalColumn(){let e=this.flags>>5;return 33554431==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new $(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return N.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return N.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return N.range(e.anchor,e.head)}static create(e,t,n){return new $(e,t,n)}}class N{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:N.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new N(e.ranges.map(e=>$.fromJSON(e)),e.main)}static single(e,t=e){return new N([N.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;ie?4:0))}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let i=1;ir.head?N.range(l,o):N.range(o,l))}}return new N(e,t)}}function E(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let W=0;class B{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=W++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}static define(e={}){return new B(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:J),!!e.static,e.enables)}of(e){return new L([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new L(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new L(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function J(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class L{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=W++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,s=e[r]>>1,o=2==this.type,l=!1,a=!1,h=[];for(let c of this.dependencies)"doc"==c?l=!0:"selection"==c?a=!0:((null!==(t=e[c.id])&&void 0!==t?t:1)&1)==0&&h.push(e[c.id]);return{create:e=>(e.values[s]=n(e),1),update(e,t){if(l&&t.docChanged||a&&(t.docChanged||t.selection)||_(e,h)){let r=n(e);if(o?!j(r,e.values[s],i):!i(r,e.values[s]))return e.values[s]=r,1}return 0},reconfigure:(e,t)=>{let l,a=t.config.address[r];if(null!=a){let h=ee(t,a);if(this.dependencies.every(n=>n instanceof B?t.facet(n)===e.facet(n):!(n instanceof q)||t.field(n,!1)==e.field(n,!1))||(o?j(l=n(e),h,i):i(l=n(e),h)))return e.values[s]=h,0}else l=n(e);return e.values[s]=l,1}}}}function j(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(F).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,F.of({field:this,create:e})]}get extension(){return this}}let U={lowest:4,low:3,default:2,high:1,highest:0};function X(e){return t=>new Z(t,e)}let V={highest:X(U.highest),high:X(U.high),default:X(U.default),low:X(U.low),lowest:X(U.lowest)};class Z{constructor(e,t){this.inner=e,this.prec=t}}class G{of(e){return new Y(this,e)}reconfigure(e){return G.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Y{constructor(e,t){this.compartment=e,this.inner=t}}class H{constructor(e,t,n,i,r,s){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i,r,s=[],o=Object.create(null),l=new Map;for(let a of(i=[[],[],[],[],[]],r=new Map,!function e(n,s){let o=r.get(n);if(null!=o){if(o<=s)return;let a=i[o].indexOf(n);a>-1&&i[o].splice(a,1),n instanceof Y&&l.delete(n.compartment)}if(r.set(n,s),Array.isArray(n))for(let h of n)e(h,s);else if(n instanceof Y){if(l.has(n.compartment))throw RangeError("Duplicate use of compartment in extensions");let c=t.get(n.compartment)||n.inner;l.set(n.compartment,c),e(c,s)}else if(n instanceof Z)e(n.inner,n.prec);else if(n instanceof q)i[s].push(n),n.provides&&e(n.provides,s);else if(n instanceof L)i[s].push(n),n.facet.extensions&&e(n.facet.extensions,U.default);else{let u=n.extension;if(!u)throw Error(`Unrecognized extension value in extension set (${n}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(u,s)}}(e,U.default),i.reduce((e,t)=>e.concat(t))))a instanceof q?s.push(a):(o[a.facet.id]||(o[a.facet.id]=[])).push(a);let h=Object.create(null),c=[],u=[];for(let f of s)h[f.id]=u.length<<1,u.push(e=>f.slot(e));let d=null==n?void 0:n.config.facets;for(let p in o){let m=o[p],g=m[0].facet,k=d&&d[p]||[];if(m.every(e=>0==e.type)){if(h[g.id]=c.length<<1|1,J(k,m))c.push(n.facet(g));else{let y=g.combine(m.map(e=>e.value));c.push(n&&g.compare(y,n.facet(g))?n.facet(g):y)}}else{for(let v of m)0==v.type?(h[v.id]=c.length<<1|1,c.push(v.value)):(h[v.id]=u.length<<1,u.push(e=>v.dynamicSlot(e)));h[g.id]=u.length<<1,u.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),s=i.filter(e=>!(1&e)),o=e[t.id]>>1;function l(e){let n=[];for(let s=0;se(h));return new H(e,l,b,h,c,o)}}function K(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function ee(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let et=B.define(),en=B.define({combine:e=>e.some(e=>e),static:!0}),ei=B.define({combine:e=>e.length?e[0]:void 0,static:!0}),er=B.define(),es=B.define(),eo=B.define(),el=B.define({combine:e=>!!e.length&&e[0]});class ea{constructor(e,t){this.type=e,this.value=t}static define(){return new eh}}class eh{of(e){return new ea(this,e)}}class ec{constructor(e){this.map=e}of(e){return new eu(this,e)}}class eu{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new eu(this.type,t)}is(e){return this.type==e}static define(e={}){return new ec(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let r=i.map(t);r&&n.push(r)}return n}}eu.reconfigure=eu.define(),eu.appendConfig=eu.define();class ef{constructor(e,t,n,i,r,s){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,n&&E(n,t.newLength),r.some(e=>e.type==ef.time)||(this.annotations=r.concat(ef.time.of(Date.now())))}static create(e,t,n,i,r,s){return new ef(e,t,n,i,r,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ef.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function ed(e,t,n){var i;let r,s,o;return n?(r=t.changes,s=A.empty(t.changes.length),o=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),s=e.changes.mapDesc(t.changes,!0),o=e.changes.compose(r)),{changes:o,selection:t.selection?t.selection.map(s):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:eu.mapEffects(e.effects,r).concat(eu.mapEffects(t.effects,s)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ep(e,t,n){let i=t.selection,r=eg(t.annotations);return t.userEvent&&(r=r.concat(ef.userEvent.of(t.userEvent))),{changes:t.changes instanceof A?t.changes:A.of(t.changes||[],n,e.facet(ei)),selection:i&&(i instanceof N?i:N.single(i.anchor,i.head)),effects:eg(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}ef.time=ea.define(),ef.userEvent=ea.define(),ef.addToHistory=ea.define(),ef.remote=ea.define();let em=[];function eg(e){return null==e?em:Array.isArray(e)?e:[e]}var ek=((Q=ek||(ek={}))[Q.Word=0]="Word",Q[Q.Space=1]="Space",Q[Q.Other=2]="Other",Q);let ey=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(ev){}class eb{constructor(e,t,n,i,r,s){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let o=0;o=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=ed(i,ep(t,s,e.changes.newLength),!0))}return i==e?e:ef.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(t){let n=t.startState,i=!0;for(let r of n.facet(er)){let s=r(t);if(!1===s){i=!1;break}Array.isArray(s)&&(i=!0===i?s:function(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else{if(!(r=0;c--){let u=h[c](t);t=u instanceof ef?u:Array.isArray(u)&&1==u.length&&u[0]instanceof ef?u[0]:e(n,eg(u),!1)}return t}(l):l)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let s of e.effects)s.is(G.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(s.value.compartment,s.value.extension)):s.is(eu.reconfigure)?(n=null,i=s.value):s.is(eu.appendConfig)&&(n=null,i=eg(i).concat(s.value));n?t=e.startState.values.slice():(n=H.resolve(i,r,this),t=new eb(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values),new eb(n,e.newDoc,e.newSelection,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:N.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],s=eg(n.effects);for(let o=1;os.spec.fromJSON(o,e)))}}return eb.create({doc:e.doc,selection:N.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=H.resolve(e.extensions||[],new Map),n=e.doc instanceof r?e.doc:r.of((e.doc||"").split(t.staticFacet(eb.lineSeparator)||w)),i=e.selection?e.selection instanceof N?e.selection:N.single(e.selection.anchor,e.selection.head):N.single(0);return E(i,n.length),t.staticFacet(en)||(i=i.asSingle()),new eb(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(eb.tabSize)}get lineBreak(){return this.facet(eb.lineSeparator)||"\n"}get readOnly(){return this.facet(el)}phrase(e,...t){for(let n of this.facet(eb.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(et))for(let s of r(this,t,n))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){var t;return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return ek.Space;if(function(e){if(i)return i.test(e);for(let t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ey.test(n)))return!0}return!1}(e))return ek.Word;for(let n=0;n-1)return ek.Word;return ek.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let l=m(t,s,!1);if(r(t.slice(l,s))!=ek.Word)break;s=l}for(;oe.length?e[0]:4}),eb.lineSeparator=ei,eb.readOnly=el,eb.phrases=B.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),eb.languageData=et,eb.changeFilter=er,eb.transactionFilter=es,eb.transactionExtender=eo,G.reconfigure=eu.define();class eO{eq(e){return this==e}range(e,t=e){return ew.create(e,t,this)}}eO.prototype.startSide=eO.prototype.endSide=0,eO.prototype.point=!1,eO.prototype.mapMode=P.TrackDel;class ew{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new ew(e,t,n)}}function eS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class eQ{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let s=i,o=r.length;;){if(s==o)return s;let l=s+o>>1,a=r[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-t;if(l==s)return a>=0?s:o;a>=0?o=l:s=l+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),s=this.findIndex(n,1e9,!1,r);r(f=t.mapPos(c,a.endSide))||u==f&&a.startSide>0&&a.endSide<=0)continue;0>(f-u||a.endSide-a.startSide)||(s<0&&(s=u),a.point&&(o=Math.max(o,f-u)),n.push(a),i.push(u-s),r.push(f-s))}return{mapped:n.length?new eQ(i,r,n,o):null,pos:s}}}class eP{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new eP(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(n&&(t=t.slice().sort(eS)),this.isEmpty)return t.length?eP.of(t):this;let o=new eT(this,null,-1).goto(0),l=0,a=[],h=new eC;for(;o.value||l=0){let c=t[l++];h.addInner(c.from,c.to,c.value)||a.push(c)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+s.length&&!1===s.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return eI.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return eI.from(e).goto(t)}static compare(e,t,n,i,r=-1){let s=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),l=eA(s,o,n),a=new ez(s,l,r),h=new ez(o,l,r);n.iterGaps((e,t,n)=>eD(a,e,h,t,n,i)),n.empty&&0==n.length&&eD(a,0,h,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=999999999);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),s=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=eA(r,s),l=new ez(r,o,0).goto(n),a=new ez(s,o,0).goto(n);for(;;){if(l.to!=a.to||!eM(l.active,a.active)||l.point&&(!a.point||!l.point.eq(a.point)))return!1;if(l.to>i)return!0;l.next(),a.next()}}static spans(e,t,n,i,r=-1){let s=new ez(e,null,r).goto(t),o=t,l=s.openStart;for(;;){let a=Math.min(s.to,n);if(s.point?(i.point(o,a,s.point,s.activeForPoint(s.to),l,s.pointRank),l=s.openEnd(a)+(s.to>a?1:0)):a>o&&(i.span(o,a,s.active,l),l=s.openEnd(a)),s.to>n)break;o=s.to,s.next()}return l}static of(e,t=!1){let n=new eC;for(let i of e instanceof ew?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(eS);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}}eP.empty=new eP([],[],null,-1),eP.empty.nextLayer=eP.empty;class eC{constructor(){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}finishChunk(e){this.chunks.push(new eQ(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,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new eC)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(eP.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=eP.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function eA(e,t,n){let i=new Map;for(let r of e)for(let s=0;s(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new eT(s,t,n,r));return 1==i.length?i[0]:new eI(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)eR(this.heap,i);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)eR(this.heap,i);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),eR(this.heap,0)}}}function eR(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}class ez{constructor(e,t,n){this.minPoint=n,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=eI.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){e$(this.active,e),e$(this.activeTo,e),e$(this.activeRank,e),this.minActive=eE(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&e$(n,r)}else if(this.cursor.value){if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let s=this.cursor.value;if(s.point){if(t&&this.cursor.to==this.to&&this.cursor.frome&&i++,this.cursor.next()}}else{this.to=this.endSide=1e9;break}}if(n){let o=0;for(;o=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function eD(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,a=i-t;for(;;){let h=e.to+a-n.to||e.endSide-n.endSide,c=h<0?e.to+a:n.to,u=Math.min(c,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&eM(e.activeForPoint(e.to+a),n.activeForPoint(n.to))||s.comparePoint(l,u,e.point,n.point):u>l&&!eM(e.active,n.active)&&s.compareRange(l,u,e.active,n.active),c>o)break;l=c,h<=0&&e.next(),h>=0&&n.next()}}function eM(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function eE(e,t){let n=-1,i=1e9;for(let r=0;r(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function eW(e,t,n=e.length){let i=0;for(let r=0;r=t)return r;if(r==e.length)break;s+=9==e.charCodeAt(r)?n-s%n:1,r=m(e,r)}return!0===i?-1:e.length}},41113:function(e,t,n){var i,r;n.d(t,{FE:function(){return $},Jq:function(){return u},L3:function(){return s},Lj:function(){return f},_b:function(){return D},hr:function(){return R},i9:function(){return z},md:function(){return a},mp:function(){return m},vj:function(){return i}});let s=1024,o=0;class l{constructor(e,t){this.from=e,this.to=t}}class a{constructor(e={}){this.id=o++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=u.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}a.closedBy=new a({deserialize:e=>e.split(" ")}),a.openedBy=new a({deserialize:e=>e.split(" ")}),a.group=new a({deserialize:e=>e.split(" ")}),a.contextHash=new a({perNode:!0}),a.lookAhead=new a({perNode:!0}),a.mounted=new a({perNode:!0});class h{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}let c=Object.create(null);class u{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):c,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new u(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(a.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(a.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}u.none=new u("",Object.create(null),0,8);class f{constructor(e){this.types=e;for(let t=0;t=r&&(o.type.isAnonymous||!1!==t(o))){if(o.firstChild())continue;l=!0}for(;l&&n&&!o.type.isAnonymous&&n(o),!o.nextSibling();){if(!o.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:I(u.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new m(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new m(u.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=s,reused:o=[],minRepeatType:l=i.types.length}=e,h=Array.isArray(n)?new g(n,n.length):n,c=i.types,u=0,f=0;function d(e,t,n,r,s,o,l,a){let h=[],c=[];for(;e.length>r;)h.push(e.pop()),c.push(t.pop()+n-s);e.push(p(i.types[l],h,c,o-s,a-o)),t.push(s-n)}function p(e,t,n,i,r=0,s){if(u){let o=[a.contextHash,u];s=s?[o].concat(s):[o]}if(r>25){let l=[a.lookAhead,r];s=s?[l].concat(s):[l]}return new m(e,t,n,i,s)}let y=[],v=[];for(;h.pos>0;)!function e(t,n,s,g,y){let{id:v,start:b,end:x,size:O}=h,w=f;for(;O<0;){if(h.next(),-1==O){let S=o[v];s.push(S),g.push(b-t);return}if(-3==O){u=v;return}if(-4==O){f=v;return}throw RangeError(`Unrecognized record size: ${O}`)}let Q=c[v],P,C,A=b-t;if(x-b<=r&&(C=function(e,t){let n=h.fork(),i=0,s=0,o=0,a=n.end-r,c={size:0,start:0,skip:0};n:for(let u=n.pos-e;n.pos>u;){let f=n.size;if(n.id==t&&f>=0){c.size=i,c.start=s,c.skip=o,o+=4,i+=4,n.next();continue}let d=n.pos-f;if(f<0||d=l?4:0,m=n.start;for(n.next();n.pos>d;){if(n.size<0){if(-3==n.size)p+=4;else break n}else n.id>=l&&(p+=4);n.next()}s=m,i+=f,o+=p}return(t<0||i==e)&&(c.size=i,c.start=s,c.skip=o),c.size>4?c:void 0}(h.pos-n,y))){let T=new Uint16Array(C.size-C.skip),R=h.pos-C.size,z=T.length;for(;h.pos>R;)z=function e(t,n,i){let{id:r,start:s,end:o,size:a}=h;if(h.next(),a>=0&&r4){let d=h.pos-(a-4);for(;h.pos>d;)i=e(t,n,i)}n[--i]=c,n[--i]=o-t,n[--i]=s-t,n[--i]=r}else -3==a?u=r:-4==a&&(f=r);return i}(C.start,T,z);P=new k(T,x-C.start,i),A=C.start-t}else{let D=h.pos-O;h.next();let M=[],$=[],N=v>=l?v:-1,E=0,W=x;for(;h.pos>D;)N>=0&&h.id==N&&h.size>=0?(h.end<=W-r&&(d(M,$,b,E,h.end,W,N,w),E=M.length,W=h.end),h.next()):e(b,D,M,$,N);if(N>=0&&E>0&&E-1&&E>0){let B=function(e){return(t,n,i)=>{let r=0,s=t.length-1,o,l;if(s>=0&&(o=t[s])instanceof m){if(!s&&o.type==e&&o.length==i)return o;(l=o.prop(a.lookAhead))&&(r=n[s]+o.length+l)}return p(e,t,n,i,r)}}(Q);P=I(Q,M,$,0,M.length,0,x-b,B,B)}else P=p(Q,M,$,x-b,w-x)}s.push(P),g.push(A)}(e.start||0,e.bufferStart||0,y,v,-1);let b=null!==(t=e.length)&&void 0!==t?t:y.length?v[0]+y[0].length:0;return new m(c[e.topID],y.reverse(),v.reverse(),b)}(e)}}m.empty=new m(u.none,[],[],0);class g{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new g(this.buffer,this.index)}}class k{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return u.none}toString(){let e=[];for(let t=0;t0)));l=s[l+3]);return o}slice(e,t,n,i){let r=this.buffer,s=new Uint16Array(t-e);for(let o=e,l=0;o=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function v(e,t){let n=e.childBefore(t);for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(e=n,n=i.prevSibling):n=i}return e}function b(e,t,n,r){for(var s;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=c;e+=t){let u=l[e],f=h[e]+o.from;if(y(r,n,f,f+u.length)){if(u instanceof k){if(s&i.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,t,n-f,r);if(d>-1)return new Q(new S(o,u,e,f),null,d)}else if(s&i.IncludeAnonymous||!u.type.isAnonymous||C(u)){let p;if(!(s&i.IgnoreMounts)&&u.props&&(p=u.prop(a.mounted))&&!p.overlay)return new x(p.tree,f,e,o);let m=new x(u,f,e,o);return s&i.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,n,r)}}}if(s&i.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&i.IgnoreOverlays)&&(r=this._tree.prop(a.mounted))&&r.overlay){let s=e-this.from;for(let{from:o,to:l}of r.overlay)if((t>0?o<=s:o=s:l>s))return new x(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new P(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return b(this,e,t,!1)}resolveInner(e,t=0){return b(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}getChild(e,t=null,n=null){let i=O(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return O(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return w(this,e)}}function O(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(null!=n){for(;!r.type.is(n);)if(!r.nextSibling())return s}for(;;){if(null!=i&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return null==i?s:[]}}function w(e,t,n=t.length-1){for(let i=e.parent;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class S{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class Q{constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new Q(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&i.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Q(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Q(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Q(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new P(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let s=n.buffer[this.index+1],o=n.buffer[this.index+2];e.push(n.slice(i,r,s,o)),t.push(0)}return new m(this.type,e,t,this.to-this.from)}resolve(e,t=0){return b(this,e,t,!1)}resolveInner(e,t=0){return b(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let i=O(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return O(this,e,t,n)}get node(){return this}matchContext(e){return w(this,e)}}class P{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof x)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof x?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&i.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&i.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&i.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let o=t+e,l=e<0?-1:n._tree.children.length;o!=l;o+=e){let a=n._tree.children[o];if(this.mode&i.IncludeAnonymous||a instanceof k||!a.type.isAnonymous||C(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,n=r+1;break n}i=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return w(this.node,e,i);let s=n[t.buffer[this.stack[r]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function C(e){return e.children.some(e=>e instanceof k||!e.type.isAnonymous||C(e))}let A=new WeakMap;function T(e,t){if(!e.isAnonymous||t instanceof k||t.type!=e)return 1;let n=A.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof m)){n=1;break}n+=T(e,i)}A.set(t,n)}return n}function I(e,t,n,i,r,s,o,l,a){let h=0;for(let c=i;c=u)break;m+=g}if(h==c+1){if(m>u){let k=n[c];t(k.children,k.positions,0,k.children.length,i[c]+l);continue}f.push(n[c])}else{let y=i[h-1]+n[h-1].length-p;f.push(I(e,n,i,c,h,p,y,null,a))}d.push(p+l-s)}}(t,n,i,r,0),(l||a)(f,d,o)}class R{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Q?this.setBuffer(e.context.buffer,e.index,t):e instanceof x&&this.map.set(e.tree,t)}get(e){return e instanceof Q?this.getBuffer(e.context.buffer,e.index):e instanceof x?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class z{constructor(e,t,n,i,r=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new z(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&i.push(r);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,s=e.length?e[0]:null;for(let o=0,l=0,a=0;;o++){let h=o=n)for(;s&&s.from=u.from||c<=u.to||a){let f=Math.max(u.from,l)-a,d=Math.min(u.to,c)-a;u=f>=d?null:new z(f,d,u.tree,u.offset+a,o>0,!!h)}if(u&&i.push(u),s.to>c)break;s=rnew l(e.from,e.to)):[new l(0,0)]:[new l(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let r=i.advance();if(r)return r}}}class M{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function $(e){return(t,n,i,r)=>new B(t,e,n,i,r)}class N{constructor(e,t,n,i,r){this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=r}}class E{constructor(e,t,n,i,r,s,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}let W=new a({perNode:!0});class B{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return null!=this.stoppedAt&&(n=new m(n.type,n.children,n.positions,n.length,n.propValues.concat([[W,this.stoppedAt]]))),n}let i=this.inner[this.innerDone],r=i.parse.advance();if(r){this.innerDone++;let s=Object.assign(Object.create(null),i.target.props);s[a.mounted.id]=new h(r,i.overlay,i.parser),i.target.props=s}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;te.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay);if(c)for(let f of c.mount.overlay){let d=f.from+c.pos,p=f.to+c.pos;d>=r.from&&p<=r.to&&!t.ranges.some(e=>e.fromd)&&t.ranges.push({from:d,to:p})}}a=!1}else if(n&&(o=function(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}(n.ranges,r.from,r.to)))a=2!=o;else if(!r.type.isAnonymous&&r.from=t.to);i++);let o=r.children[i],l=o.buffer;r.children[i]=function e(n,i,r,a,h){let c=n;for(;l[c+2]+s<=t.from;)c=l[c+3];let u=[],f=[];J(o,n,c,u,f,a);let d=l[c+1],p=l[c+2],g=d+s==t.from&&p+s==t.to&&l[c]==t.type.id;return u.push(g?t.toTree():e(c+4,l[c+3],o.set.types[l[c]],d,p-d)),f.push(d-a),J(o,l[c+3],i,u,f,a),new m(r,u,f,h)}(0,l.length,u.none,0,o.length);for(let a=0;a<=n;a++)e.childAfter(t.from)}(r);let g=e.findMounts(r.from,s.parser);if("function"==typeof s.overlay)t=new E(s.parser,s.overlay,g,this.inner.length,r.from,r.tree,t);else{let k=_(this.ranges,s.overlay||[new l(r.from,r.to)]);k.length&&this.inner.push(new N(s.parser,s.parser.startParse(this.input,F(g,k),k),s.overlay?s.overlay.map(e=>new l(e.from-r.from,e.to-r.from)):null,r.tree,k)),s.overlay?k.length&&(n={ranges:k,depth:0,prev:n}):a=!1}}else t&&(h=t.predicate(r))&&(!0===h&&(h=new l(r.from,r.to)),h.fromnew l(e.from-t.start,e.to-t.start)),t.target,y)),t=t.prev}!n||--n.depth||(n=n.prev)}}}}function J(e,t,n,i,r,s){if(t=e&&t.enter(n,1,i.IgnoreOverlays|i.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&0==t.positions[0]&&t.children[0]instanceof m)t=t.children[0];else break}return!1}}class j{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=null!==(t=n.tree.prop(W))&&void 0!==t?t:n.to,this.inner=new L(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(W))&&void 0!==e?e:t.to,this.inner=new L(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let s=null===(n=r.tree)||void 0===n?void 0:n.prop(a.mounted);if(s&&s.parser==t)for(let o=this.fragI;o=r.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:r.from-l.offset,mount:s})}}}return i}}function _(e,t){let n=null,i=t;for(let r=1,s=0;r=a)break;!(h.to<=o)&&(n||(i=n=t.slice()),h.froma&&n.splice(s+1,0,new l(a,h.to))):h.to>a?n[s--]=new l(a,h.to):n.splice(s--,1))}}return i}function F(e,t){let n=[];for(let{pos:i,mount:r,frag:s}of e){let o=i+(r.overlay?r.overlay[0].from:0),a=o+r.tree.length,h=Math.max(s.from,o),c=Math.min(s.to,a);if(r.overlay){let u=function(e,t,n,i){let r=0,s=0,o=!1,a=!1,h=-1e9,c=[];for(;;){let u=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:a?t[s].to:t[s].from;if(o!=a){let d=Math.max(h,n),p=Math.min(u,f,i);dnew l(e.from+i,e.to+i)),h,c);for(let f=0,d=h;;f++){let p=f==u.length,m=p?c:u[f].from;if(m>d&&n.push(new z(d,m,r.tree,-o,s.from>=d||s.openStart,s.to<=m||s.openEnd)),p)break;d=u[f].to}}else n.push(new z(h,c,r.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return n}},35524:function(e,t,n){n.d(t,{Gv:function(){return a},QR:function(){return u},Vp:function(){return s},bW:function(){return f},pJ:function(){return T}});var i=n(41113);let r=0;class s{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=r++}static define(e){if(null==e?void 0:e.base)throw Error("Can not derive from a modified tag");let t=new s([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new l;return t=>t.modified.indexOf(e)>-1?t:l.get(t.base||t,t.modified.concat(e).sort((e,t)=>e.id-t.id))}}let o=0;class l{constructor(){this.instances=[],this.id=o++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i;return n.base==e&&(i=n.modified,t.length==i.length&&t.every((e,t)=>e==i[t]))});if(n)return n;let i=[],r=new s(i,e,t);for(let o of t)o.instances.push(r);let a=function(e){let t=[[]];for(let n=0;nt.length-e.length)}(t);for(let h of e.set)if(!h.modified.length)for(let c of a)i.push(l.get(h,c));return r}}function a(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let r of(Array.isArray(i)||(i=[i]),n.split(" ")))if(r){let s=[],o=2,l=r;for(let a=0;;){if("..."==l&&a>0&&a+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw RangeError("Invalid path: "+r);if(s.push("*"==u[0]?"":'"'==u[0][0]?JSON.parse(u[0]):u[0]),(a+=u[0].length)==r.length)break;let f=r[a++];if(a==r.length&&"!"==f){o=0;break}if("/"!=f)throw RangeError("Invalid path: "+r);l=r.slice(a)}let d=s.length-1,p=s[d];if(!p)throw RangeError("Invalid path: "+r);let m=new c(i,o,d>0?s.slice(0,d):null);t[p]=m.sort(t[p])}}return h.add(t)}let h=new i.md;class c{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depththis.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(e=>!e.scope||e.scope(o)));let u=r,f=function(e){let t=e.type.prop(h);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||c.empty,d=function(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}(s,f.tags);if(d&&(u&&(u+=" "),u+=d,1==f.mode&&(r+=(r?" ":"")+d)),this.startSpan(e.from,u),f.opaque)return;let p=e.tree&&e.tree.prop(i.md.mounted);if(p&&p.overlay){let m=e.node.enter(p.overlay[0].from+l,1),g=this.highlighters.filter(e=>!e.scope||e.scope(p.tree.type)),k=e.firstChild();for(let y=0,v=l;;y++){let b=y=x)&&e.nextSibling()););if(!b||x>n)break;(v=b.to+l)>t&&(this.highlightRange(m.cursor(),Math.max(t,b.from+l),Math.min(n,v),r,g),this.startSpan(v,u))}k&&e.parent()}else if(e.firstChild()){do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}let p=s.define,m=p(),g=p(),k=p(g),y=p(g),v=p(),b=p(v),x=p(v),O=p(),w=p(O),S=p(),Q=p(),P=p(),C=p(P),A=p(),T={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:k,tagName:p(k),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:v,string:b,docString:p(b),character:p(b),attributeValue:p(b),number:x,integer:p(x),float:p(x),bool:p(v),regexp:p(v),escape:p(v),color:p(v),url:p(v),keyword:S,self:p(S),null:p(S),atom:p(S),unit:p(S),modifier:p(S),operatorKeyword:p(S),controlKeyword:p(S),definitionKeyword:p(S),moduleKeyword:p(S),operator:Q,derefOperator:p(Q),arithmeticOperator:p(Q),logicOperator:p(Q),bitwiseOperator:p(Q),compareOperator:p(Q),updateOperator:p(Q),definitionOperator:p(Q),typeOperator:p(Q),controlOperator:p(Q),punctuation:P,separator:p(P),bracket:C,angleBracket:p(C),squareBracket:p(C),paren:p(C),brace:p(C),content:O,heading:w,heading1:p(w),heading2:p(w),heading3:p(w),heading4:p(w),heading5:p(w),heading6:p(w),contentSeparator:p(O),list:p(O),quote:p(O),emphasis:p(O),strong:p(O),link:p(O),monospace:p(O),strikethrough:p(O),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:A,documentMeta:p(A),annotation:p(A),processingInstruction:p(A),definition:s.defineModifier(),constant:s.defineModifier(),function:s.defineModifier(),standard:s.defineModifier(),local:s.defineModifier(),special:s.defineModifier()};u([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}])},53105:function(e,t,n){n.d(t,{IK:function(){return I},Jq:function(){return v},WQ:function(){return R}});var i,r,s,o,l,a,h=n(41113),c=n(34155);class u{constructor(e,t,n,i,r,s,o,l,a,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=a,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new u(e,[],t,n,n,0,[],0,i?new f(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=65535&e,{parser:i}=this.p,r=i.dynamicPrecedence(n);if(r&&(this.score+=r),0==t){this.pushState(i.getGoto(this.state,n,!0),this.reducePos),ns;)this.stack.pop();this.reduceContext(n,o)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==s.buffer[o-4]&&s.buffer[o-1]>-1){if(t==n)return;if(s.buffer[o-2]>=t){s.buffer[o-2]=n;return}}}if(r&&this.pos!=n){let l=this.buffer.length;if(l>0&&0!=this.buffer[l-4])for(;l>0&&this.buffer[l-2]>n;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4);this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=n,this.buffer[l+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n){let i=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;(n>this.pos||t<=r.maxNode)&&(this.pos=n,r.stateFlag(e,1)||(this.reducePos=n)),this.pushState(e,i),this.shiftContext(t,i),t<=r.maxNode&&this.buffer.push(t,i,n,4)}else this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4)}apply(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new u(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new d(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if((65536&n)==0)return!0;if(0==n)return!1;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i1&t&&e==o)||n.push(t[s],o)}t=n}let l=[];for(let a=0;a>19);if(n<0||0>t.getGoto(this.stack[n],65535&e,!1))return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class f{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}(i=o||(o={}))[i.Insert=200]="Insert",i[i.Delete=190]="Delete",i[i.Reduce=100]="Reduce",i[i.MaxNext=4]="MaxNext",i[i.MaxInsertStackDepth=300]="MaxInsertStackDepth",i[i.DampenInsertStackDepth=120]="DampenInsertStackDepth";class d{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class p{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new p(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new p(this.stack,this.pos,this.index)}}class m{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let g=new m;class k{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=g,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t=this.chunk2Pos&&no.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=g,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class y{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,n,i){let r=0,s=1<0){let c=e[h];if(l.allows(c)&&(-1==t.token.value||t.token.value==c||o.overrides(c,t.token.value))){t.acceptToken(c);break}}let u=t.next,f=0,d=e[r+2];if(t.next<0&&d>f&&65535==e[a+3*d-3]&&65535==e[a+3*d-3]){r=e[a+3*d-1];continue n}for(;f>1,m=a+p+(p<<1),g=e[m],k=e[m+1]||65536;if(u=k)f=p+1;else{r=e[m+2],t.advance();continue n}}break}}(this.data,e,t,this.id)}}y.prototype.contextual=y.prototype.fallback=y.prototype.extend=!1;class v{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function b(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}let x=void 0!==c&&c.env&&/\bparse\b/.test(c.env.LOG),O=null;function w(e,t,n){let i=e.cursor(h.vj.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.tot)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}(r=l||(l={}))[r.Margin=25]="Margin";class S{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?w(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?w(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof h.mp){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class Q{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new m)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,l=0;for(let a=0;ac.end+25&&(l=Math.max(c.lookAhead,l)),0!=c.value)){let u=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),n||e.pos!=this.stream.end||((n=new m).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new m,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:r}=n.p;for(let s=0;s=0&&n.p.parser.dialect.allows(o>>1)){(1&o)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let r=0;r4*e.bufferLength?new S(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];for(let s=0;si)r.push(o);else{if(this.advanceStack(o,r,n))continue;e||(e=[],t=[]),e.push(o);let l=this.tokens.getMainToken(o);t.push(l.value,l.end)}break}}if(!r.length){let a=e&&function(e){let t=null;for(let n of e){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=i&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(h)return this.stackToTree(h.forceAll())}if(this.recovering){let c=1==this.recovering?1:3*this.recovering;if(r.length>c)for(r.sort((e,t)=>t.score-e.score);r.length>c;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1)i:for(let u=0;u500&&p.buffer.length>500){if((f.score-p.score||f.buffer.length-p.buffer.length)>0)r.splice(d--,1);else{r.splice(u--,1);continue i}}}}this.minStackPos=r[0].pos;for(let m=1;m ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let o=e.curContext&&e.curContext.tracker.strict,l=o?e.curContext.hash:0;for(let a=this.fragments.nodeAt(i);a;){let c=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(e.state,a.type.id):-1;if(c>-1&&a.length&&(!o||(a.prop(h.md.contextHash)||0)==l))return e.useNode(a,c),x&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof h.mp)||0==a.children.length||a.positions[0]>0)break;let u=a.children[0];if(u instanceof h.mp&&0==a.positions[0])a=u;else break}}let f=r.stateSlot(e.state,4);if(f>0)return e.reduce(f),x&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&f)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let d=this.tokens.getActions(e);for(let p=0;pi?t.push(v):n.push(v)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return C(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let s=0;s ":"";if(o.deadEnd&&(r||(r=!0,o.restart(),x&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let c=o.split(),u=h;for(let f=0;c.forceReduce()&&f<10&&(x&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));f++)x&&(u=this.stackID(c)+" -> ");for(let d of o.recoverByInsert(l))x&&console.log(h+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>o.pos?(a==o.pos&&(a++,l=0),o.recoverByDelete(l,a),x&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),C(o,n)):(!i||i.scoree;class I{constructor(e){this.start=e.start,this.shift=e.shift||T,this.reduce=e.reduce||T,this.reuse=e.reuse||T,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}class R extends h._b{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;ne.topRules[t][1]),r=[];for(let s=0;s=0)o(u,a,l[c++]);else{let f=l[c+-u];for(let d=-u;d>0;d--)o(l[c++],a,f);c++}}}this.nodeSet=new h.Lj(t.map((t,n)=>h.Jq.define({name:n>=this.minRepeatTerm?void 0:t,id:n,props:r[n],top:i.indexOf(n)>-1,error:0==n,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=h.L3;let p=b(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let m=0;m"number"==typeof e?new y(p,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new P(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let s=i[r++],o=1&s,l=i[r++];if(o&&n)return l;for(let a=r+(s>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=z(this.data,n+2)}if(t==z(this.data,n+1))return!0}}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=z(this.data,n+2);else break}if((1&this.data[n+2])==0){let i=this.data[n+1];t.some((e,t)=>1&t&&e==i)||t.push(this.data[n],i)}}return t}overrides(e,t){let n=D(this.data,this.tokenPrecTable,t);return n<0||D(this.data,this.tokenPrecTable,e){let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let s=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=M(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let r=t.indexOf(i);r>=0&&(n[r]=!0)}let s=null;for(let o=0;oe.external(n,i)<<1|t}return e.get}},28699:function(e,t,n){n.d(t,{V:function(){return o}});let i="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let r in e)!function e(t,r,s,o){let l=[],a=/^@(\w+)\b/.exec(t[0]),h=a&&"keyframes"==a[1];if(a&&null==r)return s.push(t[0]+";");for(let c in r){let u=r[c];if(/&/.test(c))e(c.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),u,s);else if(u&&"object"==typeof u){if(!a)throw RangeError("The value of a property ("+c+") should be a primitive value.");e(i(c),u,l,h)}else null!=u&&l.push(c.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+u+";")}(l.length||h)&&s.push((!n||a||o?t:t.map(n)).join(", ")+" {"+l.join(" ")+"}")}(i(r),e[r],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=s[i]||1;return s[i]=e+1,"ͼ"+e.toString(36)}static mount(e,t){(e[r]||new a(e)).mount(Array.isArray(t)?t:[t])}}let l=null;class a{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(l)return e.adoptedStyleSheets=[l.sheet].concat(e.adoptedStyleSheets),e[r]=l;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),l=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[r]=this}mount(e){let t=this.sheet,n=0,i=0;for(let r=0;r-1&&(this.modules.splice(o,1),i--,o=-1),-1==o){if(this.modules.splice(i++,0,s),t)for(let l=0;l",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=o||s&&57>+s[1],h=0;h<10;h++)i[48+h]=i[96+h]=String(h);for(var h=1;h<=24;h++)i[h+111]="F"+h;for(var h=65;h<=90;h++)i[h]=String.fromCharCode(h+32),r[h]=String.fromCharCode(h);for(var c in i)r.hasOwnProperty(c)||(r[c]=i[c]);function u(e){var t=!(a&&(e.ctrlKey||e.altKey||e.metaKey)||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?r:i)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/2069-45eeb5cd16bd7089.js b/static/web/_next/static/chunks/2069-a148391615083e0c.js similarity index 96% rename from static/web/_next/static/chunks/2069-45eeb5cd16bd7089.js rename to static/web/_next/static/chunks/2069-a148391615083e0c.js index 68916cec6..1827c1a90 100644 --- a/static/web/_next/static/chunks/2069-45eeb5cd16bd7089.js +++ b/static/web/_next/static/chunks/2069-a148391615083e0c.js @@ -11,4 +11,4 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */ var t,r=Symbol.for("react.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function y(e){if("object"==typeof e&&null!==e){var n=e.$$typeof;switch(n){case r:switch(e=e.type){case i:case u:case o:case p:case d:return e;default:switch(e=e&&e.$$typeof){case c:case s:case f:case m:case h:case a:return e;default:return n}}case l:return n}}}t=Symbol.for("react.module.reference"),n.ContextConsumer=s,n.ContextProvider=a,n.Element=r,n.ForwardRef=f,n.Fragment=i,n.Lazy=m,n.Memo=h,n.Portal=l,n.Profiler=u,n.StrictMode=o,n.Suspense=p,n.SuspenseList=d,n.isAsyncMode=function(){return!1},n.isConcurrentMode=function(){return!1},n.isContextConsumer=function(e){return y(e)===s},n.isContextProvider=function(e){return y(e)===a},n.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},n.isForwardRef=function(e){return y(e)===f},n.isFragment=function(e){return y(e)===i},n.isLazy=function(e){return y(e)===m},n.isMemo=function(e){return y(e)===h},n.isPortal=function(e){return y(e)===l},n.isProfiler=function(e){return y(e)===u},n.isStrictMode=function(e){return y(e)===o},n.isSuspense=function(e){return y(e)===p},n.isSuspenseList=function(e){return y(e)===d},n.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===o||e===p||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===f||e.$$typeof===t||void 0!==e.getModuleId)},n.typeOf=y},82143:function(e,n,t){"use strict";e.exports=t(71471)},57848:function(e,n,t){var r=t(18139);e.exports=function(e,n){var t,l,i,o=null;if(!e||"string"!=typeof e)return o;for(var u=r(e),a="function"==typeof n,s=0,c=u.length;se.length){for(;i--;)if(47===e.charCodeAt(i)){if(t){r=i+1;break}}else l<0&&(t=!0,l=i+1);return l<0?"":e.slice(r,l)}if(n===e)return"";let o=-1,u=n.length-1;for(;i--;)if(47===e.charCodeAt(i)){if(t){r=i+1;break}}else o<0&&(t=!0,o=i+1),u>-1&&(e.charCodeAt(i)===n.charCodeAt(u--)?u<0&&(l=i):(u=-1,l=o));return r===l?l=o:l<0&&(l=e.length),e.slice(r,l)},dirname:function(e){let n;if(d(e),0===e.length)return".";let t=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(n){t=r;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},extname:function(e){let n;d(e);let t=e.length,r=-1,l=0,i=-1,o=0;for(;t--;){let u=e.charCodeAt(t);if(47===u){if(n){l=t+1;break}continue}r<0&&(n=!0,r=t+1),46===u?i<0?i=t:1!==o&&(o=1):i>-1&&(o=-1)}return i<0||r<0||0===o||1===o&&i===r-1&&i===l+1?"":e.slice(i,r)},join:function(...e){let n,t=-1;for(;++t2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),o=a,u=0;continue}}else if(l.length>0){l="",i=0,o=a,u=0;continue}}n&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(o+1,a):l=e.slice(o+1,a),i=a-o-1;o=a,u=0}else 46===t&&u>-1?u++:u=-1}return l}(e,!n);return 0!==t.length||n||(t="."),t.length>0&&47===e.charCodeAt(e.length-1)&&(t+="/"),n?"/"+t:t}(n)},sep:"/"};function d(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}let h={cwd:function(){return"/"}};function m(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}let g=["history","path","basename","stem","extname","dirname"];class y{constructor(e){let n,t;n=e?"string"==typeof e||o(e)?{value:e}:m(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=h.cwd(),this.value,this.stored,this.result,this.map;let r=-1;for(;++rn.length;o&&n.push(r);try{i=e.apply(this,n)}catch(u){if(o&&t)throw u;return r(u)}o||(i instanceof Promise?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...r){t||(t=!0,n(e,...r))}function l(e){r(null,e)}})(u,l)(...o):r(null,...o)}(null,...n)},use:function(t){if("function"!=typeof t)throw TypeError("Expected `middelware` to be a function, not "+t);return e.push(t),n}};return n}(),r=[],l={},i=-1;return u.data=function(e,t){return"string"==typeof e?2==arguments.length?(P("data",n),l[e]=t,u):E.call(l,e)&&l[e]||null:e?(P("data",n),l=e,u):l},u.Parser=void 0,u.Compiler=void 0,u.freeze=function(){if(n)return u;for(;++i{if(!e&&n&&t){let r=u.stringify(n,t);null==r||("string"==typeof r||o(r)?t.value=r:t.result=r),i(e,t)}else i(e)})}t(null,n)},u.processSync=function(e){let n;u.freeze(),F("processSync",u.Parser),T("processSync",u.Compiler);let t=I(e);return u.process(t,function(e){n=!0,b(e)}),L("processSync","process",n),t},u;function u(){let n=e(),t=-1;for(;++ti?0:i+n:n>i?i:n,t=t>0?t:0,r.length<1e4)(l=Array.from(r)).unshift(n,t),[].splice.apply(e,l);else for(t&&[].splice.apply(e,[n,t]);o0?(M(e,e.length,0,n),e):n}let B={}.hasOwnProperty,j=X(/[A-Za-z]/),_=X(/\d/),N=X(/[\dA-Fa-f]/),H=X(/[\dA-Za-z]/),U=X(/[!-/:-@[-`{-~]/),V=X(/[#-'*+\--9=?A-Z^-~]/);function q(e){return null!==e&&(e<32||127===e)}function $(e){return null!==e&&(e<0||32===e)}function W(e){return null!==e&&e<-2}function Q(e){return -2===e||-1===e||32===e}let Y=X(/\s/),K=X(/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/);function X(e){return function(n){return null!==n&&e.test(String.fromCharCode(n))}}function Z(e,n,t,r){let l=r?r-1:Number.POSITIVE_INFINITY,i=0;return function(r){return Q(r)?(e.enter(t),function r(o){return Q(o)&&i++r))return;let f=l.events.length,p=f;for(;p--;)if("exit"===l.events[p][0]&&"chunkFlow"===l.events[p][1].type){if(a){s=l.events[p][1].end;break}a=!0}for(g(o),c=f;cn;){let r=i[t];l.containerState=r[1],r[0].exit.call(l,e)}i.length=n}function y(){n.write([null]),t=void 0,n=void 0,l.containerState._closeFlow=void 0}}},ee={tokenize:function(e,n,t){return Z(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},en={tokenize:function(e,n,t){return Z(e,function(e){return null===e||W(e)?n(e):t(e)},"linePrefix")},partial:!0};function et(e){let n,t,r,l,i,o,u;let a={},s=-1;for(;++s=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}},partial:!0},ei={tokenize:function(e){let n=this,t=e.attempt(en,function(r){if(null===r){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t},e.attempt(this.parser.constructs.flowInitial,r,Z(e,e.attempt(this.parser.constructs.flow,r,e.attempt(er,r)),"linePrefix")));return t;function r(r){if(null===r){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n.currentConstruct=void 0,t}}},eo={resolveAll:ec()},eu=es("string"),ea=es("text");function es(e){return{tokenize:function(n){let t=this,r=this.parser.constructs[e],l=n.attempt(r,i,o);return i;function i(e){return a(e)?l(e):o(e)}function o(e){if(null===e){n.consume(e);return}return n.enter("data"),n.consume(e),u}function u(e){return a(e)?(n.exit("data"),l(e)):(n.consume(e),u)}function a(e){if(null===e)return!0;let n=r[e],l=-1;if(n)for(;++ls?t(l):(e.consume(l),h):41===l?c--?(e.consume(l),h):(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),n(l)):null===l||$(l)?c?t(l):(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),n(l)):q(l)?t(l):(e.consume(l),92===l?m:h)}function m(n){return 40===n||41===n||92===n?(e.consume(n),h):h(n)}}function ek(e,n,t,r,l,i){let o;let u=this,a=0;return function(n){return e.enter(r),e.enter(l),e.consume(n),e.exit(l),e.enter(i),s};function s(f){return null===f||91===f||93===f&&!o||94===f&&!a&&"_hiddenFootnoteSupport"in u.parser.constructs||a>999?t(f):93===f?(e.exit(i),e.enter(l),e.consume(f),e.exit(l),e.exit(r),n):W(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(n){return null===n||91===n||93===n||W(n)||a++>999?(e.exit("chunkString"),s(n)):(e.consume(n),o=o||!Q(n),92===n?f:c)}function f(n){return 91===n||92===n||93===n?(e.consume(n),a++,c):c(n)}}function ev(e,n,t,r,l,i){let o;return function(n){return e.enter(r),e.enter(l),e.consume(n),e.exit(l),o=40===n?41:n,u};function u(t){return t===o?(e.enter(l),e.consume(t),e.exit(l),e.exit(r),n):(e.enter(i),a(t))}function a(n){return n===o?(e.exit(i),u(o)):null===n?t(n):W(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Z(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(n))}function s(n){return n===o||null===n||W(n)?(e.exit("chunkString"),a(n)):(e.consume(n),92===n?c:s)}function c(n){return n===o||92===n?(e.consume(n),s):s(n)}}function eb(e,n){let t;return function r(l){return W(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t=!0,r):Q(l)?Z(e,r,t?"linePrefix":"lineSuffix")(l):n(l)}}function eS(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let ew={tokenize:function(e,n,t){return function(n){return $(n)?eb(e,r)(n):t(n)};function r(n){return 34===n||39===n||40===n?ev(e,Z(e,l,"whitespace"),t,"definitionTitle","definitionTitleMarker","definitionTitleString")(n):t(n)}function l(e){return null===e||W(e)?n(e):t(e)}},partial:!0},eC={name:"codeIndented",tokenize:function(e,n,t){let r=this;return function(n){return e.enter("codeIndented"),Z(e,l,"linePrefix",5)(n)};function l(n){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function n(t){return null===t?i(t):W(t)?e.attempt(eE,n,i)(t):(e.enter("codeFlowValue"),function t(r){return null===r||W(r)?(e.exit("codeFlowValue"),n(r)):(e.consume(r),t)}(t))}(n):t(n)}function i(t){return e.exit("codeIndented"),n(t)}}},eE={tokenize:function(e,n,t){let r=this;return l;function l(n){return r.parser.lazy[r.now().line]?t(n):W(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),l):Z(e,i,"linePrefix",5)(n)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?n(e):W(e)?l(e):t(e)}},partial:!0},eA={name:"setextUnderline",tokenize:function(e,n,t){let r;let l=this,i=l.events.length;for(;i--;)if("lineEnding"!==l.events[i][1].type&&"linePrefix"!==l.events[i][1].type&&"content"!==l.events[i][1].type){r="paragraph"===l.events[i][1].type;break}return function(n){return!l.parser.lazy[l.now().line]&&(l.interrupt||r)?(e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),Z(e,o,"lineSuffix")(r))}(n)):t(n)};function o(r){return null===r||W(r)?(e.exit("setextHeadingLine"),n(r)):t(r)}},resolveTo:function(e,n){let t,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){t=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let o={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",o,n]),e.splice(l+1,0,["exit",e[t][1],n]),e[t][1].end=Object.assign({},e[l][1].end)):e[t][1]=o,e.push(["exit",o,n]),e}},eF=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eT=["pre","script","style","textarea"],eP={tokenize:function(e,n,t){return function(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(en,n,t)}},partial:!0},eO={name:"codeFenced",tokenize:function(e,n,t){let r;let l=this,i={tokenize:function(e,n,t){let l=0;return Z(e,function(n){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function n(o){return o===r?(e.consume(o),l++,n):l1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let f=Object.assign({},e[t][1].end),p=Object.assign({},e[c][1].start);eV(f,-u),eV(p,u),i={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[t][1].end)},o={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[c][1].start),end:p},l={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[t][1].end),end:Object.assign({},e[c][1].start)},r={type:u>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},o.end)},e[t][1].end=Object.assign({},i.start),e[c][1].start=Object.assign({},o.end),a=[],e[t][1].end.offset-e[t][1].start.offset&&(a=R(a,[["enter",e[t][1],n],["exit",e[t][1],n]])),a=R(a,[["enter",r,n],["enter",i,n],["exit",i,n],["enter",l,n]]),a=R(a,ep(n.parser.constructs.insideSpan.null,e.slice(t+1,c),n)),a=R(a,[["exit",l,n],["enter",o,n],["exit",o,n],["exit",r,n]]),e[c][1].end.offset-e[c][1].start.offset?(s=2,a=R(a,[["enter",e[c][1],n],["exit",e[c][1],n]])):s=0,M(e,t-1,c-t+3,a),c=t+a.length-s-2;break}}for(c=-1;++ci&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(t={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},M(e,i,l-i+1,[["enter",t,n],["enter",r,n],["exit",r,n],["exit",t,n]])),e}},42:ed,45:[eA,ed],60:{name:"htmlFlow",tokenize:function(e,n,t){let r,l,i,o,u;let a=this;return function(n){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),s};function s(o){return 33===o?(e.consume(o),c):47===o?(e.consume(o),d):63===o?(e.consume(o),r=3,a.interrupt?n:L):j(o)?(e.consume(o),i=String.fromCharCode(o),l=!0,h):t(o)}function c(l){return 45===l?(e.consume(l),r=2,f):91===l?(e.consume(l),r=5,i="CDATA[",o=0,p):j(l)?(e.consume(l),r=4,a.interrupt?n:L):t(l)}function f(r){return 45===r?(e.consume(r),a.interrupt?n:L):t(r)}function p(r){return r===i.charCodeAt(o++)?(e.consume(r),o===i.length?a.interrupt?n:C:p):t(r)}function d(n){return j(n)?(e.consume(n),i=String.fromCharCode(n),h):t(n)}function h(o){return null===o||47===o||62===o||$(o)?47!==o&&l&&eT.includes(i.toLowerCase())?(r=1,a.interrupt?n(o):C(o)):eF.includes(i.toLowerCase())?(r=6,47===o)?(e.consume(o),m):a.interrupt?n(o):C(o):(r=7,a.interrupt&&!a.parser.lazy[a.now().line]?t(o):l?g(o):function n(t){return Q(t)?(e.consume(t),n):S(t)}(o)):45===o||H(o)?(e.consume(o),i+=String.fromCharCode(o),h):t(o)}function m(r){return 62===r?(e.consume(r),a.interrupt?n:C):t(r)}function g(n){return 47===n?(e.consume(n),S):58===n||95===n||j(n)?(e.consume(n),y):Q(n)?(e.consume(n),g):S(n)}function y(n){return 45===n||46===n||58===n||95===n||H(n)?(e.consume(n),y):x(n)}function x(n){return 61===n?(e.consume(n),k):Q(n)?(e.consume(n),x):g(n)}function k(n){return null===n||60===n||61===n||62===n||96===n?t(n):34===n||39===n?(e.consume(n),u=n,v):Q(n)?(e.consume(n),k):(u=null,function n(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||$(t)?x(t):(e.consume(t),n)}(n))}function v(n){return null===n||W(n)?t(n):n===u?(e.consume(n),b):(e.consume(n),v)}function b(e){return 47===e||62===e||Q(e)?g(e):t(e)}function S(n){return 62===n?(e.consume(n),w):t(n)}function w(n){return Q(n)?(e.consume(n),w):null===n||W(n)?C(n):t(n)}function C(n){return 45===n&&2===r?(e.consume(n),F):60===n&&1===r?(e.consume(n),T):62===n&&4===r?(e.consume(n),I):63===n&&3===r?(e.consume(n),L):93===n&&5===r?(e.consume(n),O):W(n)&&(6===r||7===r)?e.check(eP,I,E)(n):null===n||W(n)?E(n):(e.consume(n),C)}function E(n){return e.exit("htmlFlowData"),function n(t){return null===t?D(t):W(t)?e.attempt({tokenize:A,partial:!0},n,D)(t):(e.enter("htmlFlowData"),C(t))}(n)}function A(e,n,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r};function r(e){return a.parser.lazy[a.now().line]?t(e):n(e)}}function F(n){return 45===n?(e.consume(n),L):C(n)}function T(n){return 47===n?(e.consume(n),i="",P):C(n)}function P(n){return 62===n&&eT.includes(i.toLowerCase())?(e.consume(n),I):j(n)&&i.length<8?(e.consume(n),i+=String.fromCharCode(n),P):C(n)}function O(n){return 93===n?(e.consume(n),L):C(n)}function L(n){return 62===n?(e.consume(n),I):45===n&&2===r?(e.consume(n),L):C(n)}function I(n){return null===n||W(n)?(e.exit("htmlFlowData"),D(n)):(e.consume(n),I)}function D(t){return e.exit("htmlFlow"),n(t)}},resolveTo:function(e){let n=e.length;for(;n--&&("enter"!==e[n][0]||"htmlFlow"!==e[n][1].type););return n>1&&"linePrefix"===e[n-2][1].type&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e},concrete:!0},61:eA,95:ed,96:eO,126:eO},eK={38:eD,92:ez},eX={[-5]:eM,[-4]:eM,[-3]:eM,33:eN,38:eD,42:eU,60:[{name:"autolink",tokenize:function(e,n,t){let r=1;return function(n){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(n){return j(n)?(e.consume(n),i):V(n)?u(n):t(n)}function i(n){return 43===n||45===n||46===n||H(n)?function n(t){return 58===t?(e.consume(t),o):(43===t||45===t||46===t||H(t))&&r++<32?(e.consume(t),n):u(t)}(n):u(n)}function o(n){return 62===n?(e.exit("autolinkProtocol"),s(n)):null===n||32===n||60===n||q(n)?t(n):(e.consume(n),o)}function u(n){return 64===n?(e.consume(n),r=0,a):V(n)?(e.consume(n),u):t(n)}function a(n){return H(n)?function n(l){return 46===l?(e.consume(l),r=0,a):62===l?(e.exit("autolinkProtocol").type="autolinkEmail",s(l)):function l(i){return(45===i||H(i))&&r++<63?(e.consume(i),45===i?l:n):t(i)}(l)}(n):t(n)}function s(t){return e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.exit("autolink"),n}}},{name:"htmlText",tokenize:function(e,n,t){let r,l,i,o;let u=this;return function(n){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(n),a};function a(n){return 33===n?(e.consume(n),s):47===n?(e.consume(n),S):63===n?(e.consume(n),v):j(n)?(e.consume(n),C):t(n)}function s(n){return 45===n?(e.consume(n),c):91===n?(e.consume(n),l="CDATA[",i=0,m):j(n)?(e.consume(n),k):t(n)}function c(n){return 45===n?(e.consume(n),f):t(n)}function f(n){return null===n||62===n?t(n):45===n?(e.consume(n),p):d(n)}function p(e){return null===e||62===e?t(e):d(e)}function d(n){return null===n?t(n):45===n?(e.consume(n),h):W(n)?(o=d,L(n)):(e.consume(n),d)}function h(n){return 45===n?(e.consume(n),D):d(n)}function m(n){return n===l.charCodeAt(i++)?(e.consume(n),i===l.length?g:m):t(n)}function g(n){return null===n?t(n):93===n?(e.consume(n),y):W(n)?(o=g,L(n)):(e.consume(n),g)}function y(n){return 93===n?(e.consume(n),x):g(n)}function x(n){return 62===n?D(n):93===n?(e.consume(n),x):g(n)}function k(n){return null===n||62===n?D(n):W(n)?(o=k,L(n)):(e.consume(n),k)}function v(n){return null===n?t(n):63===n?(e.consume(n),b):W(n)?(o=v,L(n)):(e.consume(n),v)}function b(e){return 62===e?D(e):v(e)}function S(n){return j(n)?(e.consume(n),w):t(n)}function w(n){return 45===n||H(n)?(e.consume(n),w):function n(t){return W(t)?(o=n,L(t)):Q(t)?(e.consume(t),n):D(t)}(n)}function C(n){return 45===n||H(n)?(e.consume(n),C):47===n||62===n||$(n)?E(n):t(n)}function E(n){return 47===n?(e.consume(n),D):58===n||95===n||j(n)?(e.consume(n),A):W(n)?(o=E,L(n)):Q(n)?(e.consume(n),E):D(n)}function A(n){return 45===n||46===n||58===n||95===n||H(n)?(e.consume(n),A):function n(t){return 61===t?(e.consume(t),F):W(t)?(o=n,L(t)):Q(t)?(e.consume(t),n):E(t)}(n)}function F(n){return null===n||60===n||61===n||62===n||96===n?t(n):34===n||39===n?(e.consume(n),r=n,T):W(n)?(o=F,L(n)):Q(n)?(e.consume(n),F):(e.consume(n),r=void 0,O)}function T(n){return n===r?(e.consume(n),P):null===n?t(n):W(n)?(o=T,L(n)):(e.consume(n),T)}function P(e){return 62===e||47===e||$(e)?E(e):t(e)}function O(n){return null===n||34===n||39===n||60===n||61===n||96===n?t(n):62===n||$(n)?E(n):(e.consume(n),O)}function L(n){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Z(e,I,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function I(n){return e.enter("htmlTextData"),o(n)}function D(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),n):t(r)}}}],91:eq,92:[{name:"hardBreakEscape",tokenize:function(e,n,t){return function(n){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(n),r};function r(r){return W(r)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),n(r)):t(r)}}},ez],93:eR,95:eU,96:{name:"codeText",tokenize:function(e,n,t){let r,l,i=0;return function(n){return e.enter("codeText"),e.enter("codeTextSequence"),function n(t){return 96===t?(e.consume(t),i++,n):(e.exit("codeTextSequence"),o(t))}(n)};function o(a){return null===a?t(a):96===a?(l=e.enter("codeTextSequence"),r=0,function t(o){return 96===o?(e.consume(o),r++,t):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),n(o)):(l.type="codeTextData",u(o))}(a)):32===a?(e.enter("space"),e.consume(a),e.exit("space"),o):W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):(e.enter("codeTextData"),u(a))}function u(n){return null===n||32===n||96===n||W(n)?(e.exit("codeTextData"),o(n)):(e.consume(n),u)}},resolve:function(e){let n,t,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(n=l;++n13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(65535&t)==65535||(65535&t)==65534||t>1114111?"�":String.fromCharCode(t)}let e2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e4(e,n,t){if(n)return n;let r=t.charCodeAt(0);if(35===r){let l=t.charCodeAt(1),i=120===l||88===l;return e0(t.slice(i?2:1),i?16:10)}return eI(t)||e}let e3={}.hasOwnProperty,e6=function(e,n,t){let l,i,o,a;return"string"!=typeof n&&(t=n,n=void 0),(function(e={}){let n=function e(n,t){let r=-1;for(;++r0){let y=u[u.length-1],x=y[1]||e5;x.call(d,void 0,y[0])}for(t.position={start:i(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:i(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},h=-1;++h-1&&(t[0]=t[0].slice(l)),o>0&&t.push(e[i].slice(0,o))),t}(o,e)}function p(){return Object.assign({},r)}function d(e,n){n.restore()}function h(e,n){return function(t,l,i){let o,c,f,d;return Array.isArray(t)?h(t):"tokenize"in t?h([t]):function(e){let n=null!==e&&t[e],r=null!==e&&t.null,l=[...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]];return h(l)(e)};function h(e){return(o=e,c=0,0===e.length)?i:m(e[c])}function m(e){return function(t){return(d=function(){let e=p(),n=s.previous,t=s.currentConstruct,l=s.events.length,i=Array.from(u);return{restore:function(){r=e,s.previous=n,s.currentConstruct=t,s.events.length=l,u=i,g()},from:l}}(),f=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name))?x(t):e.tokenize.call(n?Object.assign(Object.create(s),n):s,a,y,x)(t)}}function y(n){return e(f,d),l}function x(e){return(d.restore(),++c{let t=this.data("settings");return e6(n,Object.assign({},t,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))};Object.assign(this,{Parser:n})},e7=function(e,n,t){var r={type:String(e)};return null==t&&("string"==typeof n||Array.isArray(n))?t=n:Object.assign(r,n),Array.isArray(t)?r.children=t:null!=t&&(r.value=String(t)),r};let e8=function(e){if(null==e)return nn;if("string"==typeof e)return ne(function(n){return n&&n.type===e});if("object"==typeof e)return Array.isArray(e)?function(e){let n=[],t=-1;for(;++t":"")+")"})),f;function f(){var s;let c,f,p,d=[];if((!n||l(o,u,a[a.length-1]||null))&&!1===(d=Array.isArray(s=t(o,a))?s:"number"==typeof s?[!0,s]:[s])[0])return d;if(o.children&&"skip"!==d[0])for(f=(r?o.children.length:-1)+i,p=a.concat(o);f>-1&&f-1?t.offset:null}}}let nu={}.hasOwnProperty;function na(e){return String(e||"").toUpperCase()}let ns={}.hasOwnProperty;function nc(e,n){let t=n.data||{};return"value"in n&&!(ns.call(t,"hName")||ns.call(t,"hProperties")||ns.call(t,"hChildren"))?e.augment(n,e7("text",n.value)):e(n,"div",nd(e,n))}function nf(e,n,t){let r;let l=n&&n.type;if(!l)throw Error("Expected node, got `"+n+"`");return("function"==typeof(r=ns.call(e.handlers,l)?e.handlers[l]:e.passThrough&&e.passThrough.includes(l)?np:e.unknownHandler)?r:nc)(e,n,t)}function np(e,n){return"children"in n?{...n,children:nd(e,n)}:n}function nd(e,n){let t=[];if("children"in n){let r=n.children,l=-1;for(;++l55295&&i<57344){let u=e.charCodeAt(t+1);i<56320&&u>56319&&u<57344?(o=String.fromCharCode(i,u),l=1):o="�"}else o=String.fromCharCode(i);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+l+1,o=""),l&&(t+=l,l=0)}return n.join("")+e.slice(r)}function nm(e,n){let t=[],r=-1;for(n&&t.push(e7("text","\n"));++r0&&t.push(e7("text","\n")),t}function ng(e,n){let t;let r=String(n.identifier),l=nh(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);-1===i?(e.footnoteOrder.push(r),e.footnoteCounts[r]=1,t=e.footnoteOrder.length):(e.footnoteCounts[r]++,t=i+1);let o=e.footnoteCounts[r];return e(n,"sup",[e(n.position,"a",{href:"#"+e.clobberPrefix+"fn-"+l,id:e.clobberPrefix+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[e7("text",String(t))])])}function ny(e,n){let t=n.referenceType,r="]";if("collapsed"===t?r+="[]":"full"===t&&(r+="["+(n.label||n.identifier)+"]"),"imageReference"===n.type)return e7("text","!["+n.alt+r);let l=nd(e,n),i=l[0];i&&"text"===i.type?i.value="["+i.value:l.unshift(e7("text","["));let o=l[l.length-1];return o&&"text"===o.type?o.value+=r:l.push(e7("text",r)),l}function nx(e){let n=e.spread;return null==n?e.children.length>1:n}function nk(e,n,t){let r=0,l=e.length;if(n){let i=e.codePointAt(r);for(;9===i||32===i;)r++,i=e.codePointAt(r)}if(t){let o=e.codePointAt(l-1);for(;9===o||32===o;)l--,o=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nv={blockquote:function(e,n){return e(n,"blockquote",nm(nd(e,n),!0))},break:function(e,n){return[e(n,"br"),e7("text","\n")]},code:function(e,n){let t=n.value?n.value+"\n":"",r=n.lang&&n.lang.match(/^[^ \t]+(?=[ \t]|$)/),l={};r&&(l.className=["language-"+r]);let i=e(n,"code",l,[e7("text",t)]);return n.meta&&(i.data={meta:n.meta}),e(n.position,"pre",[i])},delete:function(e,n){return e(n,"del",nd(e,n))},emphasis:function(e,n){return e(n,"em",nd(e,n))},footnoteReference:ng,footnote:function(e,n){let t=e.footnoteById,r=1;for(;(r in t);)r++;let l=String(r);return t[l]={type:"footnoteDefinition",identifier:l,children:[{type:"paragraph",children:n.children}],position:n.position},ng(e,{type:"footnoteReference",identifier:l,position:n.position})},heading:function(e,n){return e(n,"h"+n.depth,nd(e,n))},html:function(e,n){return e.dangerous?e.augment(n,e7("raw",n.value)):null},imageReference:function(e,n){let t=e.definition(n.identifier);if(!t)return ny(e,n);let r={src:nh(t.url||""),alt:n.alt};return null!==t.title&&void 0!==t.title&&(r.title=t.title),e(n,"img",r)},image:function(e,n){let t={src:nh(n.url),alt:n.alt};return null!==n.title&&void 0!==n.title&&(t.title=n.title),e(n,"img",t)},inlineCode:function(e,n){return e(n,"code",[e7("text",n.value.replace(/\r?\n|\r/g," "))])},linkReference:function(e,n){let t=e.definition(n.identifier);if(!t)return ny(e,n);let r={href:nh(t.url||"")};return null!==t.title&&void 0!==t.title&&(r.title=t.title),e(n,"a",r,nd(e,n))},link:function(e,n){let t={href:nh(n.url)};return null!==n.title&&void 0!==n.title&&(t.title=n.title),e(n,"a",t,nd(e,n))},listItem:function(e,n,t){let r=nd(e,n),l=t?function(e){let n=e.spread,t=e.children,r=-1;for(;!n&&++r0&&u.children.unshift(e7("text"," ")),u.children.unshift(e(null,"input",{type:"checkbox",checked:n.checked,disabled:!0})),i.className=["task-list-item"]}let a=-1;for(;++a0,!0),r[0]),l=r.index+r[0].length,r=t.exec(n);return i.push(nk(n.slice(l),l>0,!1)),i.join("")}(String(n.value))))},thematicBreak:function(e,n){return e(n,"hr")},toml:nb,yaml:nb,definition:nb,footnoteDefinition:nb};function nb(){return null}let nS={}.hasOwnProperty;function nw(e,n){let t=function(e,n){let t=n||{},r=t.allowDangerousHtml||!1,l={};return o.dangerous=r,o.clobberPrefix=void 0===t.clobberPrefix||null===t.clobberPrefix?"user-content-":t.clobberPrefix,o.footnoteLabel=t.footnoteLabel||"Footnotes",o.footnoteLabelTagName=t.footnoteLabelTagName||"h2",o.footnoteLabelProperties=t.footnoteLabelProperties||{className:["sr-only"]},o.footnoteBackLabel=t.footnoteBackLabel||"Back to content",o.definition=function(e){let n=Object.create(null);if(!e||!e.type)throw Error("mdast-util-definitions expected node");return nr(e,"definition",e=>{let t=na(e.identifier);t&&!nu.call(n,t)&&(n[t]=e)}),function(e){let t=na(e);return t&&nu.call(n,t)?n[t]:null}}(e),o.footnoteById=l,o.footnoteOrder=[],o.footnoteCounts={},o.augment=i,o.handlers={...nv,...t.handlers},o.unknownHandler=t.unknownHandler,o.passThrough=t.passThrough,nr(e,"footnoteDefinition",e=>{let n=String(e.identifier).toUpperCase();nS.call(l,n)||(l[n]=e)}),o;function i(e,n){if(e&&"data"in e&&e.data){let t=e.data;t.hName&&("element"!==n.type&&(n={type:"element",tagName:"",properties:{},children:[]}),n.tagName=t.hName),"element"===n.type&&t.hProperties&&(n.properties={...n.properties,...t.hProperties}),"children"in n&&n.children&&t.hChildren&&(n.children=t.hChildren)}if(e){let r="type"in e?e:{position:e};!r||!r.position||!r.position.start||!r.position.start.line||!r.position.start.column||!r.position.end||!r.position.end.line||!r.position.end.column||(n.position={start:nl(r),end:ni(r)})}return n}function o(e,n,t,r){return Array.isArray(t)&&(r=t,t={}),i(e,{type:"element",tagName:n,properties:t||{},children:r||[]})}}(e,n),r=nf(t,e,null),l=function(e){let n=-1,t=[];for(;++n1?"-"+u:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};u>1&&s.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(u)}]}),a.length>0&&a.push({type:"text",value:" "}),a.push(s)}let c=l[l.length-1];if(c&&"element"===c.type&&"p"===c.tagName){let f=c.children[c.children.length-1];f&&"text"===f.type?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...a)}else l.push(...a);let p={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+o},children:nm(l,!0)};r.position&&(p.position=r.position),t.push(p)}return 0===t.length?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[e7("text",e.footnoteLabel)]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:nm(t,!0)},{type:"text",value:"\n"}]}}(t);return l&&r.children.push(e7("text","\n"),l),Array.isArray(r)?{type:"root",children:r}:r}let nC=function(e,n){var t;return e&&"run"in e?(t,r,l)=>{e.run(nw(t,n),r,e=>{l(e)})}:(t=e||n,e=>nw(e,t))};var nE=t(45697);class nA{constructor(e,n,t){this.property=e,this.normal=n,t&&(this.space=t)}}function nF(e,n){let t={},r={},l=-1;for(;++l"xlink:"+n.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),nq=nU({space:"xml",transform:(e,n)=>"xml:"+n.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function n$(e,n){return n in e?e[n]:n}function nW(e,n){return n$(e,n.toLowerCase())}let nQ=nU({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:nW,properties:{xmlns:null,xmlnsXLink:null}}),nY=nU({transform:(e,n)=>"role"===n?n:"aria-"+n.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:nI,ariaAutoComplete:null,ariaBusy:nI,ariaChecked:nI,ariaColCount:nz,ariaColIndex:nz,ariaColSpan:nz,ariaControls:nM,ariaCurrent:null,ariaDescribedBy:nM,ariaDetails:null,ariaDisabled:nI,ariaDropEffect:nM,ariaErrorMessage:null,ariaExpanded:nI,ariaFlowTo:nM,ariaGrabbed:nI,ariaHasPopup:null,ariaHidden:nI,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nM,ariaLevel:nz,ariaLive:null,ariaModal:nI,ariaMultiLine:nI,ariaMultiSelectable:nI,ariaOrientation:null,ariaOwns:nM,ariaPlaceholder:null,ariaPosInSet:nz,ariaPressed:nI,ariaReadOnly:nI,ariaRelevant:null,ariaRequired:nI,ariaRoleDescription:nM,ariaRowCount:nz,ariaRowIndex:nz,ariaRowSpan:nz,ariaSelected:nI,ariaSetSize:nz,ariaSort:null,ariaValueMax:nz,ariaValueMin:nz,ariaValueNow:nz,ariaValueText:null,role:null}}),nK=nU({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:nW,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nR,acceptCharset:nM,accessKey:nM,action:null,allow:null,allowFullScreen:nL,allowPaymentRequest:nL,allowUserMedia:nL,alt:null,as:null,async:nL,autoCapitalize:null,autoComplete:nM,autoFocus:nL,autoPlay:nL,capture:nL,charSet:null,checked:nL,cite:null,className:nM,cols:nz,colSpan:null,content:null,contentEditable:nI,controls:nL,controlsList:nM,coords:nz|nR,crossOrigin:null,data:null,dateTime:null,decoding:null,default:nL,defer:nL,dir:null,dirName:null,disabled:nL,download:nD,draggable:nI,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:nL,formTarget:null,headers:nM,height:nz,hidden:nL,high:nz,href:null,hrefLang:null,htmlFor:nM,httpEquiv:nM,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:nL,itemId:null,itemProp:nM,itemRef:nM,itemScope:nL,itemType:nM,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:nL,low:nz,manifest:null,max:null,maxLength:nz,media:null,method:null,min:null,minLength:nz,multiple:nL,muted:nL,name:null,nonce:null,noModule:nL,noValidate:nL,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:nL,optimum:nz,pattern:null,ping:nM,placeholder:null,playsInline:nL,poster:null,preload:null,readOnly:nL,referrerPolicy:null,rel:nM,required:nL,reversed:nL,rows:nz,rowSpan:nz,sandbox:nM,scope:null,scoped:nL,seamless:nL,selected:nL,shape:null,size:nz,sizes:null,slot:null,span:nz,spellCheck:nI,src:null,srcDoc:null,srcLang:null,srcSet:null,start:nz,step:null,style:null,tabIndex:nz,target:null,title:null,translate:null,type:null,typeMustMatch:nL,useMap:null,value:nI,width:nz,wrap:null,align:null,aLink:null,archive:nM,axis:null,background:null,bgColor:null,border:nz,borderColor:null,bottomMargin:nz,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:nL,declare:nL,event:null,face:null,frame:null,frameBorder:null,hSpace:nz,leftMargin:nz,link:null,longDesc:null,lowSrc:null,marginHeight:nz,marginWidth:nz,noResize:nL,noHref:nL,noShade:nL,noWrap:nL,object:null,profile:null,prompt:null,rev:null,rightMargin:nz,rules:null,scheme:null,scrolling:nI,standby:null,summary:null,text:null,topMargin:nz,valueType:null,version:null,vAlign:null,vLink:null,vSpace:nz,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:nL,disableRemotePlayback:nL,prefix:null,property:null,results:nz,security:null,unselectable:null}}),nX=nU({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:n$,properties:{about:nB,accentHeight:nz,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:nz,amplitude:nz,arabicForm:null,ascent:nz,attributeName:null,attributeType:null,azimuth:nz,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:nz,by:null,calcMode:null,capHeight:nz,className:nM,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:nz,diffuseConstant:nz,direction:null,display:null,dur:null,divisor:nz,dominantBaseline:null,download:nL,dx:null,dy:null,edgeMode:null,editable:null,elevation:nz,enableBackground:null,end:null,event:null,exponent:nz,externalResourcesRequired:null,fill:null,fillOpacity:nz,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:nR,g2:nR,glyphName:nR,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:nz,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:nz,horizOriginX:nz,horizOriginY:nz,id:null,ideographic:nz,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:nz,k:nz,k1:nz,k2:nz,k3:nz,k4:nz,kernelMatrix:nB,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:nz,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:nz,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:nz,overlineThickness:nz,paintOrder:null,panose1:null,path:null,pathLength:nz,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nM,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:nz,pointsAtY:nz,pointsAtZ:nz,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nB,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nB,rev:nB,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nB,requiredFeatures:nB,requiredFonts:nB,requiredFormats:nB,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:nz,specularExponent:nz,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:nz,strikethroughThickness:nz,string:null,stroke:null,strokeDashArray:nB,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:nz,strokeOpacity:nz,strokeWidth:null,style:null,surfaceScale:nz,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nB,tabIndex:nz,tableValues:null,target:null,targetX:nz,targetY:nz,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nB,to:null,transform:null,u1:null,u2:null,underlinePosition:nz,underlineThickness:nz,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:nz,values:null,vAlphabetic:nz,vMathematical:nz,vectorEffect:null,vHanging:nz,vIdeographic:nz,version:null,vertAdvY:nz,vertOriginX:nz,vertOriginY:nz,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:nz,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),nZ=nF([nq,nV,nQ,nY,nK],"html"),nJ=nF([nq,nV,nQ,nY,nX],"svg"),nG=function(e){if(null==e)return n0;if("string"==typeof e)return n1(function(n){return n&&n.type===e});if("object"==typeof e)return Array.isArray(e)?function(e){let n=[],t=-1;for(;++t":"")+")"})),f;function f(){var s;let c,f,p,d=[];if((!n||l(o,u,a[a.length-1]||null))&&!1===(d=Array.isArray(s=t(o,a))?s:"number"==typeof s?[!0,s]:[s])[0])return d;if(o.children&&"skip"!==d[0])for(f=(r?o.children.length:-1)+i,p=a.concat(o);f>-1&&f{n4(n,"element",(n,t,r)=>{let l;if(e.allowedElements?l=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(l=e.disallowedElements.includes(n.tagName)),!l&&e.allowElement&&"number"==typeof t&&(l=!e.allowElement(n,t,r)),l&&"number"==typeof t)return e.unwrapDisallowed&&n.children?r.children.splice(t,1,...n.children):r.children.splice(t,1),t})}}let n6=["http","https","mailto","tel"];var n5=t(82143);let n9=/^data[-\w.:]+$/i,n7=/-[a-z]/g,n8=/[A-Z]/g;function te(e){return"-"+e.toLowerCase()}function tn(e){return e.charAt(1).toUpperCase()}let tt={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var tr=t(57848);let tl={}.hasOwnProperty,ti=new Set(["table","thead","tbody","tfoot","tr"]);function to(e,n){let t=-1,r=0;for(;++t for more info)`),delete ts[n]}let r=C().use(e9).use(e.remarkPlugins||[]).use(nC,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(n3,e),l=new y;"string"==typeof e.children?l.value=e.children:void 0!==e.children&&null!==e.children&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);let o=r.runSync(r.parse(l),l);if("root"!==o.type)throw TypeError("Expected a `root` node");let u=i.createElement(i.Fragment,{},function e(n,t){let r;let l=[],o=-1;for(;++o4&&"data"===t.slice(0,4)&&n9.test(n)){if("-"===n.charAt(4)){let i=n.slice(5).replace(n7,tn);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let o=n.slice(4);if(!n7.test(o)){let u=o.replace(n8,te);"-"!==u.charAt(0)&&(u="-"+u),n="data"+u}}l=nN}return new l(r,n)}(r.schema,n),i=t;if(null!=i&&i==i){if(Array.isArray(i)){var o,u;i=l.commaSeparated?(u={},""===(o=i)[o.length-1]&&(o=o.concat("")),o.join((u.padRight?" ":"")+","+(!1===u.padLeft?"":" ")).trim()):i.join(" ").trim()}"style"===l.property&&"string"==typeof i&&(i=function(e){let n={};try{tr(e,function(e,t){let r="-ms-"===e.slice(0,4)?`ms-${e.slice(4)}`:e;n[r.replace(/-([a-z])/g,tu)]=t})}catch{}return n}(i)),l.space&&l.property?e[tl.call(tt,l.property)?tt[l.property]:l.property]=i:l.attribute&&(e[l.attribute]=i)}}(c,o,t.properties[o],n);("ol"===s||"ul"===s)&&n.listDepth++;let p=e(n,t);("ol"===s||"ul"===s)&&n.listDepth--,n.schema=a;let d=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},h=u.components&&tl.call(u.components,s)?u.components[s]:s,m="string"==typeof h||h===i.Fragment;if(!n5.isValidElementType(h))throw TypeError(`Component for name \`${s}\` not defined or is not renderable`);if(c.key=[s,d.start.line,d.start.column,r].join("-"),"a"===s&&u.linkTarget&&(c.target="function"==typeof u.linkTarget?u.linkTarget(String(c.href||""),t.children,"string"==typeof c.title?c.title:null):u.linkTarget),"a"===s&&u.transformLinkUri&&(c.href=u.transformLinkUri(String(c.href||""),t.children,"string"==typeof c.title?c.title:null)),m||"code"!==s||"element"!==l.type||"pre"===l.tagName||(c.inline=!0),m||"h1"!==s&&"h2"!==s&&"h3"!==s&&"h4"!==s&&"h5"!==s&&"h6"!==s||(c.level=Number.parseInt(s.charAt(1),10)),"img"===s&&u.transformImageUri&&(c.src=u.transformImageUri(String(c.src||""),String(c.alt||""),"string"==typeof c.title?c.title:null)),!m&&"li"===s&&"element"===l.type){let g=function(e){let n=-1;for(;++nString(e)).join("")),!m&&u.rawSourcePos&&(c.sourcePosition=t.position),!m&&u.includeElementIndex&&(c.index=to(l,t),c.siblingCount=to(l)),m||(c.node=t),p.length>0?i.createElement(h,c,p):i.createElement(h,c)}(n,r,o,t)):"text"===r.type?"element"===t.type&&ti.has(t.tagName)&&function(e){var n=e&&"object"==typeof e&&"text"===e.type?e.value||"":e;return"string"==typeof n&&""===n.replace(/[ \t\n\f\r]/g,"")}(r)||l.push(r.value):"raw"!==r.type||n.options.skipHtml||l.push(r.value);return l}({options:e,schema:nZ,listDepth:0},o));return e.className&&(u=i.createElement("div",{className:e.className},u)),u}tc.defaultProps={transformLinkUri:function(e){let n=(e||"").trim(),t=n.charAt(0);if("#"===t||"/"===t)return n;let r=n.indexOf(":");if(-1===r)return n;let l=-1;for(;++ll||-1!==(l=n.indexOf("#"))&&r>l?n:"javascript:void(0)"}},tc.propTypes={children:nE.string,className:nE.string,allowElement:nE.func,allowedElements:nE.arrayOf(nE.string),disallowedElements:nE.arrayOf(nE.string),unwrapDisallowed:nE.bool,remarkPlugins:nE.arrayOf(nE.oneOfType([nE.object,nE.func,nE.arrayOf(nE.oneOfType([nE.bool,nE.string,nE.object,nE.func,nE.arrayOf(nE.any)]))])),rehypePlugins:nE.arrayOf(nE.oneOfType([nE.object,nE.func,nE.arrayOf(nE.oneOfType([nE.bool,nE.string,nE.object,nE.func,nE.arrayOf(nE.any)]))])),sourcePos:nE.bool,rawSourcePos:nE.bool,skipHtml:nE.bool,includeElementIndex:nE.bool,transformLinkUri:nE.oneOfType([nE.func,nE.bool]),linkTarget:nE.oneOfType([nE.func,nE.string]),transformImageUri:nE.func,components:nE.object}}}]); \ No newline at end of file + */ var t,r=Symbol.for("react.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function y(e){if("object"==typeof e&&null!==e){var n=e.$$typeof;switch(n){case r:switch(e=e.type){case i:case u:case o:case p:case d:return e;default:switch(e=e&&e.$$typeof){case c:case s:case f:case m:case h:case a:return e;default:return n}}case l:return n}}}t=Symbol.for("react.module.reference"),n.ContextConsumer=s,n.ContextProvider=a,n.Element=r,n.ForwardRef=f,n.Fragment=i,n.Lazy=m,n.Memo=h,n.Portal=l,n.Profiler=u,n.StrictMode=o,n.Suspense=p,n.SuspenseList=d,n.isAsyncMode=function(){return!1},n.isConcurrentMode=function(){return!1},n.isContextConsumer=function(e){return y(e)===s},n.isContextProvider=function(e){return y(e)===a},n.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},n.isForwardRef=function(e){return y(e)===f},n.isFragment=function(e){return y(e)===i},n.isLazy=function(e){return y(e)===m},n.isMemo=function(e){return y(e)===h},n.isPortal=function(e){return y(e)===l},n.isProfiler=function(e){return y(e)===u},n.isStrictMode=function(e){return y(e)===o},n.isSuspense=function(e){return y(e)===p},n.isSuspenseList=function(e){return y(e)===d},n.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===o||e===p||e===d||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===f||e.$$typeof===t||void 0!==e.getModuleId)},n.typeOf=y},82143:function(e,n,t){"use strict";e.exports=t(71471)},57848:function(e,n,t){var r=t(18139);e.exports=function(e,n){var t,l,i,o=null;if(!e||"string"!=typeof e)return o;for(var u=r(e),a="function"==typeof n,s=0,c=u.length;se.length){for(;i--;)if(47===e.charCodeAt(i)){if(t){r=i+1;break}}else l<0&&(t=!0,l=i+1);return l<0?"":e.slice(r,l)}if(n===e)return"";let o=-1,u=n.length-1;for(;i--;)if(47===e.charCodeAt(i)){if(t){r=i+1;break}}else o<0&&(t=!0,o=i+1),u>-1&&(e.charCodeAt(i)===n.charCodeAt(u--)?u<0&&(l=i):(u=-1,l=o));return r===l?l=o:l<0&&(l=e.length),e.slice(r,l)},dirname:function(e){let n;if(d(e),0===e.length)return".";let t=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(n){t=r;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},extname:function(e){let n;d(e);let t=e.length,r=-1,l=0,i=-1,o=0;for(;t--;){let u=e.charCodeAt(t);if(47===u){if(n){l=t+1;break}continue}r<0&&(n=!0,r=t+1),46===u?i<0?i=t:1!==o&&(o=1):i>-1&&(o=-1)}return i<0||r<0||0===o||1===o&&i===r-1&&i===l+1?"":e.slice(i,r)},join:function(...e){let n,t=-1;for(;++t2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),o=a,u=0;continue}}else if(l.length>0){l="",i=0,o=a,u=0;continue}}n&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(o+1,a):l=e.slice(o+1,a),i=a-o-1;o=a,u=0}else 46===t&&u>-1?u++:u=-1}return l}(e,!n);return 0!==t.length||n||(t="."),t.length>0&&47===e.charCodeAt(e.length-1)&&(t+="/"),n?"/"+t:t}(n)},sep:"/"};function d(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}let h={cwd:function(){return"/"}};function m(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}let g=["history","path","basename","stem","extname","dirname"];class y{constructor(e){let n,t;n=e?"string"==typeof e||o(e)?{value:e}:m(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=h.cwd(),this.value,this.stored,this.result,this.map;let r=-1;for(;++rn.length;o&&n.push(r);try{i=e.apply(this,n)}catch(u){if(o&&t)throw u;return r(u)}o||(i instanceof Promise?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...r){t||(t=!0,n(e,...r))}function l(e){r(null,e)}})(u,l)(...o):r(null,...o)}(null,...n)},use:function(t){if("function"!=typeof t)throw TypeError("Expected `middelware` to be a function, not "+t);return e.push(t),n}};return n}(),r=[],l={},i=-1;return u.data=function(e,t){return"string"==typeof e?2==arguments.length?(P("data",n),l[e]=t,u):E.call(l,e)&&l[e]||null:e?(P("data",n),l=e,u):l},u.Parser=void 0,u.Compiler=void 0,u.freeze=function(){if(n)return u;for(;++i{if(!e&&n&&t){let r=u.stringify(n,t);null==r||("string"==typeof r||o(r)?t.value=r:t.result=r),i(e,t)}else i(e)})}t(null,n)},u.processSync=function(e){let n;u.freeze(),F("processSync",u.Parser),T("processSync",u.Compiler);let t=I(e);return u.process(t,function(e){n=!0,b(e)}),L("processSync","process",n),t},u;function u(){let n=e(),t=-1;for(;++ti?0:i+n:n>i?i:n,t=t>0?t:0,r.length<1e4)(l=Array.from(r)).unshift(n,t),[].splice.apply(e,l);else for(t&&[].splice.apply(e,[n,t]);o0?(M(e,e.length,0,n),e):n}let B={}.hasOwnProperty,j=X(/[A-Za-z]/),_=X(/\d/),N=X(/[\dA-Fa-f]/),H=X(/[\dA-Za-z]/),U=X(/[!-/:-@[-`{-~]/),V=X(/[#-'*+\--9=?A-Z^-~]/);function q(e){return null!==e&&(e<32||127===e)}function $(e){return null!==e&&(e<0||32===e)}function W(e){return null!==e&&e<-2}function Q(e){return -2===e||-1===e||32===e}let Y=X(/\s/),K=X(/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/);function X(e){return function(n){return null!==n&&e.test(String.fromCharCode(n))}}function Z(e,n,t,r){let l=r?r-1:Number.POSITIVE_INFINITY,i=0;return function(r){return Q(r)?(e.enter(t),function r(o){return Q(o)&&i++r))return;let f=l.events.length,p=f;for(;p--;)if("exit"===l.events[p][0]&&"chunkFlow"===l.events[p][1].type){if(a){s=l.events[p][1].end;break}a=!0}for(g(o),c=f;cn;){let r=i[t];l.containerState=r[1],r[0].exit.call(l,e)}i.length=n}function y(){n.write([null]),t=void 0,n=void 0,l.containerState._closeFlow=void 0}}},ee={tokenize:function(e,n,t){return Z(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},en={tokenize:function(e,n,t){return Z(e,function(e){return null===e||W(e)?n(e):t(e)},"linePrefix")},partial:!0};function et(e){let n,t,r,l,i,o,u;let a={},s=-1;for(;++s=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}},partial:!0},ei={tokenize:function(e){let n=this,t=e.attempt(en,function(r){if(null===r){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t},e.attempt(this.parser.constructs.flowInitial,r,Z(e,e.attempt(this.parser.constructs.flow,r,e.attempt(er,r)),"linePrefix")));return t;function r(r){if(null===r){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n.currentConstruct=void 0,t}}},eo={resolveAll:ec()},eu=es("string"),ea=es("text");function es(e){return{tokenize:function(n){let t=this,r=this.parser.constructs[e],l=n.attempt(r,i,o);return i;function i(e){return a(e)?l(e):o(e)}function o(e){if(null===e){n.consume(e);return}return n.enter("data"),n.consume(e),u}function u(e){return a(e)?(n.exit("data"),l(e)):(n.consume(e),u)}function a(e){if(null===e)return!0;let n=r[e],l=-1;if(n)for(;++ls?t(l):(e.consume(l),h):41===l?c--?(e.consume(l),h):(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),n(l)):null===l||$(l)?c?t(l):(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),n(l)):q(l)?t(l):(e.consume(l),92===l?m:h)}function m(n){return 40===n||41===n||92===n?(e.consume(n),h):h(n)}}function ek(e,n,t,r,l,i){let o;let u=this,a=0;return function(n){return e.enter(r),e.enter(l),e.consume(n),e.exit(l),e.enter(i),s};function s(f){return null===f||91===f||93===f&&!o||94===f&&!a&&"_hiddenFootnoteSupport"in u.parser.constructs||a>999?t(f):93===f?(e.exit(i),e.enter(l),e.consume(f),e.exit(l),e.exit(r),n):W(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(n){return null===n||91===n||93===n||W(n)||a++>999?(e.exit("chunkString"),s(n)):(e.consume(n),o=o||!Q(n),92===n?f:c)}function f(n){return 91===n||92===n||93===n?(e.consume(n),a++,c):c(n)}}function ev(e,n,t,r,l,i){let o;return function(n){return e.enter(r),e.enter(l),e.consume(n),e.exit(l),o=40===n?41:n,u};function u(t){return t===o?(e.enter(l),e.consume(t),e.exit(l),e.exit(r),n):(e.enter(i),a(t))}function a(n){return n===o?(e.exit(i),u(o)):null===n?t(n):W(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Z(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(n))}function s(n){return n===o||null===n||W(n)?(e.exit("chunkString"),a(n)):(e.consume(n),92===n?c:s)}function c(n){return n===o||92===n?(e.consume(n),s):s(n)}}function eb(e,n){let t;return function r(l){return W(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t=!0,r):Q(l)?Z(e,r,t?"linePrefix":"lineSuffix")(l):n(l)}}function eS(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let ew={tokenize:function(e,n,t){return function(n){return $(n)?eb(e,r)(n):t(n)};function r(n){return 34===n||39===n||40===n?ev(e,Z(e,l,"whitespace"),t,"definitionTitle","definitionTitleMarker","definitionTitleString")(n):t(n)}function l(e){return null===e||W(e)?n(e):t(e)}},partial:!0},eC={name:"codeIndented",tokenize:function(e,n,t){let r=this;return function(n){return e.enter("codeIndented"),Z(e,l,"linePrefix",5)(n)};function l(n){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function n(t){return null===t?i(t):W(t)?e.attempt(eE,n,i)(t):(e.enter("codeFlowValue"),function t(r){return null===r||W(r)?(e.exit("codeFlowValue"),n(r)):(e.consume(r),t)}(t))}(n):t(n)}function i(t){return e.exit("codeIndented"),n(t)}}},eE={tokenize:function(e,n,t){let r=this;return l;function l(n){return r.parser.lazy[r.now().line]?t(n):W(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),l):Z(e,i,"linePrefix",5)(n)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?n(e):W(e)?l(e):t(e)}},partial:!0},eA={name:"setextUnderline",tokenize:function(e,n,t){let r;let l=this,i=l.events.length;for(;i--;)if("lineEnding"!==l.events[i][1].type&&"linePrefix"!==l.events[i][1].type&&"content"!==l.events[i][1].type){r="paragraph"===l.events[i][1].type;break}return function(n){return!l.parser.lazy[l.now().line]&&(l.interrupt||r)?(e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),Z(e,o,"lineSuffix")(r))}(n)):t(n)};function o(r){return null===r||W(r)?(e.exit("setextHeadingLine"),n(r)):t(r)}},resolveTo:function(e,n){let t,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){t=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let o={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",o,n]),e.splice(l+1,0,["exit",e[t][1],n]),e[t][1].end=Object.assign({},e[l][1].end)):e[t][1]=o,e.push(["exit",o,n]),e}},eF=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eT=["pre","script","style","textarea"],eP={tokenize:function(e,n,t){return function(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(en,n,t)}},partial:!0},eO={name:"codeFenced",tokenize:function(e,n,t){let r;let l=this,i={tokenize:function(e,n,t){let l=0;return Z(e,function(n){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function n(o){return o===r?(e.consume(o),l++,n):l1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let f=Object.assign({},e[t][1].end),p=Object.assign({},e[c][1].start);eV(f,-u),eV(p,u),i={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[t][1].end)},o={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[c][1].start),end:p},l={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[t][1].end),end:Object.assign({},e[c][1].start)},r={type:u>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},o.end)},e[t][1].end=Object.assign({},i.start),e[c][1].start=Object.assign({},o.end),a=[],e[t][1].end.offset-e[t][1].start.offset&&(a=R(a,[["enter",e[t][1],n],["exit",e[t][1],n]])),a=R(a,[["enter",r,n],["enter",i,n],["exit",i,n],["enter",l,n]]),a=R(a,ep(n.parser.constructs.insideSpan.null,e.slice(t+1,c),n)),a=R(a,[["exit",l,n],["enter",o,n],["exit",o,n],["exit",r,n]]),e[c][1].end.offset-e[c][1].start.offset?(s=2,a=R(a,[["enter",e[c][1],n],["exit",e[c][1],n]])):s=0,M(e,t-1,c-t+3,a),c=t+a.length-s-2;break}}for(c=-1;++ci&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(t={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},M(e,i,l-i+1,[["enter",t,n],["enter",r,n],["exit",r,n],["exit",t,n]])),e}},42:ed,45:[eA,ed],60:{name:"htmlFlow",tokenize:function(e,n,t){let r,l,i,o,u;let a=this;return function(n){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),s};function s(o){return 33===o?(e.consume(o),c):47===o?(e.consume(o),d):63===o?(e.consume(o),r=3,a.interrupt?n:L):j(o)?(e.consume(o),i=String.fromCharCode(o),l=!0,h):t(o)}function c(l){return 45===l?(e.consume(l),r=2,f):91===l?(e.consume(l),r=5,i="CDATA[",o=0,p):j(l)?(e.consume(l),r=4,a.interrupt?n:L):t(l)}function f(r){return 45===r?(e.consume(r),a.interrupt?n:L):t(r)}function p(r){return r===i.charCodeAt(o++)?(e.consume(r),o===i.length?a.interrupt?n:C:p):t(r)}function d(n){return j(n)?(e.consume(n),i=String.fromCharCode(n),h):t(n)}function h(o){return null===o||47===o||62===o||$(o)?47!==o&&l&&eT.includes(i.toLowerCase())?(r=1,a.interrupt?n(o):C(o)):eF.includes(i.toLowerCase())?(r=6,47===o)?(e.consume(o),m):a.interrupt?n(o):C(o):(r=7,a.interrupt&&!a.parser.lazy[a.now().line]?t(o):l?g(o):function n(t){return Q(t)?(e.consume(t),n):S(t)}(o)):45===o||H(o)?(e.consume(o),i+=String.fromCharCode(o),h):t(o)}function m(r){return 62===r?(e.consume(r),a.interrupt?n:C):t(r)}function g(n){return 47===n?(e.consume(n),S):58===n||95===n||j(n)?(e.consume(n),y):Q(n)?(e.consume(n),g):S(n)}function y(n){return 45===n||46===n||58===n||95===n||H(n)?(e.consume(n),y):x(n)}function x(n){return 61===n?(e.consume(n),k):Q(n)?(e.consume(n),x):g(n)}function k(n){return null===n||60===n||61===n||62===n||96===n?t(n):34===n||39===n?(e.consume(n),u=n,v):Q(n)?(e.consume(n),k):(u=null,function n(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||$(t)?x(t):(e.consume(t),n)}(n))}function v(n){return null===n||W(n)?t(n):n===u?(e.consume(n),b):(e.consume(n),v)}function b(e){return 47===e||62===e||Q(e)?g(e):t(e)}function S(n){return 62===n?(e.consume(n),w):t(n)}function w(n){return Q(n)?(e.consume(n),w):null===n||W(n)?C(n):t(n)}function C(n){return 45===n&&2===r?(e.consume(n),F):60===n&&1===r?(e.consume(n),T):62===n&&4===r?(e.consume(n),I):63===n&&3===r?(e.consume(n),L):93===n&&5===r?(e.consume(n),O):W(n)&&(6===r||7===r)?e.check(eP,I,E)(n):null===n||W(n)?E(n):(e.consume(n),C)}function E(n){return e.exit("htmlFlowData"),function n(t){return null===t?D(t):W(t)?e.attempt({tokenize:A,partial:!0},n,D)(t):(e.enter("htmlFlowData"),C(t))}(n)}function A(e,n,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r};function r(e){return a.parser.lazy[a.now().line]?t(e):n(e)}}function F(n){return 45===n?(e.consume(n),L):C(n)}function T(n){return 47===n?(e.consume(n),i="",P):C(n)}function P(n){return 62===n&&eT.includes(i.toLowerCase())?(e.consume(n),I):j(n)&&i.length<8?(e.consume(n),i+=String.fromCharCode(n),P):C(n)}function O(n){return 93===n?(e.consume(n),L):C(n)}function L(n){return 62===n?(e.consume(n),I):45===n&&2===r?(e.consume(n),L):C(n)}function I(n){return null===n||W(n)?(e.exit("htmlFlowData"),D(n)):(e.consume(n),I)}function D(t){return e.exit("htmlFlow"),n(t)}},resolveTo:function(e){let n=e.length;for(;n--&&("enter"!==e[n][0]||"htmlFlow"!==e[n][1].type););return n>1&&"linePrefix"===e[n-2][1].type&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e},concrete:!0},61:eA,95:ed,96:eO,126:eO},eK={38:eD,92:ez},eX={[-5]:eM,[-4]:eM,[-3]:eM,33:eN,38:eD,42:eU,60:[{name:"autolink",tokenize:function(e,n,t){let r=1;return function(n){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(n){return j(n)?(e.consume(n),i):V(n)?u(n):t(n)}function i(n){return 43===n||45===n||46===n||H(n)?function n(t){return 58===t?(e.consume(t),o):(43===t||45===t||46===t||H(t))&&r++<32?(e.consume(t),n):u(t)}(n):u(n)}function o(n){return 62===n?(e.exit("autolinkProtocol"),s(n)):null===n||32===n||60===n||q(n)?t(n):(e.consume(n),o)}function u(n){return 64===n?(e.consume(n),r=0,a):V(n)?(e.consume(n),u):t(n)}function a(n){return H(n)?function n(l){return 46===l?(e.consume(l),r=0,a):62===l?(e.exit("autolinkProtocol").type="autolinkEmail",s(l)):function l(i){return(45===i||H(i))&&r++<63?(e.consume(i),45===i?l:n):t(i)}(l)}(n):t(n)}function s(t){return e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.exit("autolink"),n}}},{name:"htmlText",tokenize:function(e,n,t){let r,l,i,o;let u=this;return function(n){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(n),a};function a(n){return 33===n?(e.consume(n),s):47===n?(e.consume(n),S):63===n?(e.consume(n),v):j(n)?(e.consume(n),C):t(n)}function s(n){return 45===n?(e.consume(n),c):91===n?(e.consume(n),l="CDATA[",i=0,m):j(n)?(e.consume(n),k):t(n)}function c(n){return 45===n?(e.consume(n),f):t(n)}function f(n){return null===n||62===n?t(n):45===n?(e.consume(n),p):d(n)}function p(e){return null===e||62===e?t(e):d(e)}function d(n){return null===n?t(n):45===n?(e.consume(n),h):W(n)?(o=d,L(n)):(e.consume(n),d)}function h(n){return 45===n?(e.consume(n),D):d(n)}function m(n){return n===l.charCodeAt(i++)?(e.consume(n),i===l.length?g:m):t(n)}function g(n){return null===n?t(n):93===n?(e.consume(n),y):W(n)?(o=g,L(n)):(e.consume(n),g)}function y(n){return 93===n?(e.consume(n),x):g(n)}function x(n){return 62===n?D(n):93===n?(e.consume(n),x):g(n)}function k(n){return null===n||62===n?D(n):W(n)?(o=k,L(n)):(e.consume(n),k)}function v(n){return null===n?t(n):63===n?(e.consume(n),b):W(n)?(o=v,L(n)):(e.consume(n),v)}function b(e){return 62===e?D(e):v(e)}function S(n){return j(n)?(e.consume(n),w):t(n)}function w(n){return 45===n||H(n)?(e.consume(n),w):function n(t){return W(t)?(o=n,L(t)):Q(t)?(e.consume(t),n):D(t)}(n)}function C(n){return 45===n||H(n)?(e.consume(n),C):47===n||62===n||$(n)?E(n):t(n)}function E(n){return 47===n?(e.consume(n),D):58===n||95===n||j(n)?(e.consume(n),A):W(n)?(o=E,L(n)):Q(n)?(e.consume(n),E):D(n)}function A(n){return 45===n||46===n||58===n||95===n||H(n)?(e.consume(n),A):function n(t){return 61===t?(e.consume(t),F):W(t)?(o=n,L(t)):Q(t)?(e.consume(t),n):E(t)}(n)}function F(n){return null===n||60===n||61===n||62===n||96===n?t(n):34===n||39===n?(e.consume(n),r=n,T):W(n)?(o=F,L(n)):Q(n)?(e.consume(n),F):(e.consume(n),r=void 0,O)}function T(n){return n===r?(e.consume(n),P):null===n?t(n):W(n)?(o=T,L(n)):(e.consume(n),T)}function P(e){return 62===e||47===e||$(e)?E(e):t(e)}function O(n){return null===n||34===n||39===n||60===n||61===n||96===n?t(n):62===n||$(n)?E(n):(e.consume(n),O)}function L(n){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Z(e,I,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function I(n){return e.enter("htmlTextData"),o(n)}function D(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),n):t(r)}}}],91:eq,92:[{name:"hardBreakEscape",tokenize:function(e,n,t){return function(n){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(n),r};function r(r){return W(r)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),n(r)):t(r)}}},ez],93:eR,95:eU,96:{name:"codeText",tokenize:function(e,n,t){let r,l,i=0;return function(n){return e.enter("codeText"),e.enter("codeTextSequence"),function n(t){return 96===t?(e.consume(t),i++,n):(e.exit("codeTextSequence"),o(t))}(n)};function o(a){return null===a?t(a):96===a?(l=e.enter("codeTextSequence"),r=0,function t(o){return 96===o?(e.consume(o),r++,t):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),n(o)):(l.type="codeTextData",u(o))}(a)):32===a?(e.enter("space"),e.consume(a),e.exit("space"),o):W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):(e.enter("codeTextData"),u(a))}function u(n){return null===n||32===n||96===n||W(n)?(e.exit("codeTextData"),o(n)):(e.consume(n),u)}},resolve:function(e){let n,t,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(n=l;++n13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(65535&t)==65535||(65535&t)==65534||t>1114111?"�":String.fromCharCode(t)}let e2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e4(e,n,t){if(n)return n;let r=t.charCodeAt(0);if(35===r){let l=t.charCodeAt(1),i=120===l||88===l;return e0(t.slice(i?2:1),i?16:10)}return eI(t)||e}let e3={}.hasOwnProperty,e6=function(e,n,t){let l,i,o,a;return"string"!=typeof n&&(t=n,n=void 0),(function(e={}){let n=function e(n,t){let r=-1;for(;++r0){let y=u[u.length-1],x=y[1]||e5;x.call(d,void 0,y[0])}for(t.position={start:i(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:i(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},h=-1;++h-1&&(t[0]=t[0].slice(l)),o>0&&t.push(e[i].slice(0,o))),t}(o,e)}function p(){return Object.assign({},r)}function d(e,n){n.restore()}function h(e,n){return function(t,l,i){let o,c,f,d;return Array.isArray(t)?h(t):"tokenize"in t?h([t]):function(e){let n=null!==e&&t[e],r=null!==e&&t.null,l=[...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]];return h(l)(e)};function h(e){return(o=e,c=0,0===e.length)?i:m(e[c])}function m(e){return function(t){return(d=function(){let e=p(),n=s.previous,t=s.currentConstruct,l=s.events.length,i=Array.from(u);return{restore:function(){r=e,s.previous=n,s.currentConstruct=t,s.events.length=l,u=i,g()},from:l}}(),f=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name))?x(t):e.tokenize.call(n?Object.assign(Object.create(s),n):s,a,y,x)(t)}}function y(n){return e(f,d),l}function x(e){return(d.restore(),++c{let t=this.data("settings");return e6(n,Object.assign({},t,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))};Object.assign(this,{Parser:n})},e7=function(e,n,t){var r={type:String(e)};return null==t&&("string"==typeof n||Array.isArray(n))?t=n:Object.assign(r,n),Array.isArray(t)?r.children=t:null!=t&&(r.value=String(t)),r};let e8=function(e){if(null==e)return nn;if("string"==typeof e)return ne(function(n){return n&&n.type===e});if("object"==typeof e)return Array.isArray(e)?function(e){let n=[],t=-1;for(;++t":"")+")"})),f;function f(){var s;let c,f,p,d=[];if((!n||l(o,u,a[a.length-1]||null))&&!1===(d=Array.isArray(s=t(o,a))?s:"number"==typeof s?[!0,s]:[s])[0])return d;if(o.children&&"skip"!==d[0])for(f=(r?o.children.length:-1)+i,p=a.concat(o);f>-1&&f-1?t.offset:null}}}let nu={}.hasOwnProperty;function na(e){return String(e||"").toUpperCase()}let ns={}.hasOwnProperty;function nc(e,n){let t=n.data||{};return"value"in n&&!(ns.call(t,"hName")||ns.call(t,"hProperties")||ns.call(t,"hChildren"))?e.augment(n,e7("text",n.value)):e(n,"div",nd(e,n))}function nf(e,n,t){let r;let l=n&&n.type;if(!l)throw Error("Expected node, got `"+n+"`");return("function"==typeof(r=ns.call(e.handlers,l)?e.handlers[l]:e.passThrough&&e.passThrough.includes(l)?np:e.unknownHandler)?r:nc)(e,n,t)}function np(e,n){return"children"in n?{...n,children:nd(e,n)}:n}function nd(e,n){let t=[];if("children"in n){let r=n.children,l=-1;for(;++l55295&&i<57344){let u=e.charCodeAt(t+1);i<56320&&u>56319&&u<57344?(o=String.fromCharCode(i,u),l=1):o="�"}else o=String.fromCharCode(i);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+l+1,o=""),l&&(t+=l,l=0)}return n.join("")+e.slice(r)}function nm(e,n){let t=[],r=-1;for(n&&t.push(e7("text","\n"));++r0&&t.push(e7("text","\n")),t}function ng(e,n){let t;let r=String(n.identifier),l=nh(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);-1===i?(e.footnoteOrder.push(r),e.footnoteCounts[r]=1,t=e.footnoteOrder.length):(e.footnoteCounts[r]++,t=i+1);let o=e.footnoteCounts[r];return e(n,"sup",[e(n.position,"a",{href:"#"+e.clobberPrefix+"fn-"+l,id:e.clobberPrefix+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[e7("text",String(t))])])}function ny(e,n){let t=n.referenceType,r="]";if("collapsed"===t?r+="[]":"full"===t&&(r+="["+(n.label||n.identifier)+"]"),"imageReference"===n.type)return e7("text","!["+n.alt+r);let l=nd(e,n),i=l[0];i&&"text"===i.type?i.value="["+i.value:l.unshift(e7("text","["));let o=l[l.length-1];return o&&"text"===o.type?o.value+=r:l.push(e7("text",r)),l}function nx(e){let n=e.spread;return null==n?e.children.length>1:n}function nk(e,n,t){let r=0,l=e.length;if(n){let i=e.codePointAt(r);for(;9===i||32===i;)r++,i=e.codePointAt(r)}if(t){let o=e.codePointAt(l-1);for(;9===o||32===o;)l--,o=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nv={blockquote:function(e,n){return e(n,"blockquote",nm(nd(e,n),!0))},break:function(e,n){return[e(n,"br"),e7("text","\n")]},code:function(e,n){let t=n.value?n.value+"\n":"",r=n.lang&&n.lang.match(/^[^ \t]+(?=[ \t]|$)/),l={};r&&(l.className=["language-"+r]);let i=e(n,"code",l,[e7("text",t)]);return n.meta&&(i.data={meta:n.meta}),e(n.position,"pre",[i])},delete:function(e,n){return e(n,"del",nd(e,n))},emphasis:function(e,n){return e(n,"em",nd(e,n))},footnoteReference:ng,footnote:function(e,n){let t=e.footnoteById,r=1;for(;(r in t);)r++;let l=String(r);return t[l]={type:"footnoteDefinition",identifier:l,children:[{type:"paragraph",children:n.children}],position:n.position},ng(e,{type:"footnoteReference",identifier:l,position:n.position})},heading:function(e,n){return e(n,"h"+n.depth,nd(e,n))},html:function(e,n){return e.dangerous?e.augment(n,e7("raw",n.value)):null},imageReference:function(e,n){let t=e.definition(n.identifier);if(!t)return ny(e,n);let r={src:nh(t.url||""),alt:n.alt};return null!==t.title&&void 0!==t.title&&(r.title=t.title),e(n,"img",r)},image:function(e,n){let t={src:nh(n.url),alt:n.alt};return null!==n.title&&void 0!==n.title&&(t.title=n.title),e(n,"img",t)},inlineCode:function(e,n){return e(n,"code",[e7("text",n.value.replace(/\r?\n|\r/g," "))])},linkReference:function(e,n){let t=e.definition(n.identifier);if(!t)return ny(e,n);let r={href:nh(t.url||"")};return null!==t.title&&void 0!==t.title&&(r.title=t.title),e(n,"a",r,nd(e,n))},link:function(e,n){let t={href:nh(n.url)};return null!==n.title&&void 0!==n.title&&(t.title=n.title),e(n,"a",t,nd(e,n))},listItem:function(e,n,t){let r=nd(e,n),l=t?function(e){let n=e.spread,t=e.children,r=-1;for(;!n&&++r0&&u.children.unshift(e7("text"," ")),u.children.unshift(e(null,"input",{type:"checkbox",checked:n.checked,disabled:!0})),i.className=["task-list-item"]}let a=-1;for(;++a0,!0),r[0]),l=r.index+r[0].length,r=t.exec(n);return i.push(nk(n.slice(l),l>0,!1)),i.join("")}(String(n.value))))},thematicBreak:function(e,n){return e(n,"hr")},toml:nb,yaml:nb,definition:nb,footnoteDefinition:nb};function nb(){return null}let nS={}.hasOwnProperty;function nw(e,n){let t=function(e,n){let t=n||{},r=t.allowDangerousHtml||!1,l={};return o.dangerous=r,o.clobberPrefix=void 0===t.clobberPrefix||null===t.clobberPrefix?"user-content-":t.clobberPrefix,o.footnoteLabel=t.footnoteLabel||"Footnotes",o.footnoteLabelTagName=t.footnoteLabelTagName||"h2",o.footnoteLabelProperties=t.footnoteLabelProperties||{className:["sr-only"]},o.footnoteBackLabel=t.footnoteBackLabel||"Back to content",o.definition=function(e){let n=Object.create(null);if(!e||!e.type)throw Error("mdast-util-definitions expected node");return nr(e,"definition",e=>{let t=na(e.identifier);t&&!nu.call(n,t)&&(n[t]=e)}),function(e){let t=na(e);return t&&nu.call(n,t)?n[t]:null}}(e),o.footnoteById=l,o.footnoteOrder=[],o.footnoteCounts={},o.augment=i,o.handlers={...nv,...t.handlers},o.unknownHandler=t.unknownHandler,o.passThrough=t.passThrough,nr(e,"footnoteDefinition",e=>{let n=String(e.identifier).toUpperCase();nS.call(l,n)||(l[n]=e)}),o;function i(e,n){if(e&&"data"in e&&e.data){let t=e.data;t.hName&&("element"!==n.type&&(n={type:"element",tagName:"",properties:{},children:[]}),n.tagName=t.hName),"element"===n.type&&t.hProperties&&(n.properties={...n.properties,...t.hProperties}),"children"in n&&n.children&&t.hChildren&&(n.children=t.hChildren)}if(e){let r="type"in e?e:{position:e};!r||!r.position||!r.position.start||!r.position.start.line||!r.position.start.column||!r.position.end||!r.position.end.line||!r.position.end.column||(n.position={start:nl(r),end:ni(r)})}return n}function o(e,n,t,r){return Array.isArray(t)&&(r=t,t={}),i(e,{type:"element",tagName:n,properties:t||{},children:r||[]})}}(e,n),r=nf(t,e,null),l=function(e){let n=-1,t=[];for(;++n1?"-"+u:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};u>1&&s.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(u)}]}),a.length>0&&a.push({type:"text",value:" "}),a.push(s)}let c=l[l.length-1];if(c&&"element"===c.type&&"p"===c.tagName){let f=c.children[c.children.length-1];f&&"text"===f.type?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...a)}else l.push(...a);let p={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+o},children:nm(l,!0)};r.position&&(p.position=r.position),t.push(p)}return 0===t.length?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[e7("text",e.footnoteLabel)]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:nm(t,!0)},{type:"text",value:"\n"}]}}(t);return l&&r.children.push(e7("text","\n"),l),Array.isArray(r)?{type:"root",children:r}:r}let nC=function(e,n){var t;return e&&"run"in e?(t,r,l)=>{e.run(nw(t,n),r,e=>{l(e)})}:(t=e||n,e=>nw(e,t))};var nE=t(45697);class nA{constructor(e,n,t){this.property=e,this.normal=n,t&&(this.space=t)}}function nF(e,n){let t={},r={},l=-1;for(;++l"xlink:"+n.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),nq=nU({space:"xml",transform:(e,n)=>"xml:"+n.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function n$(e,n){return n in e?e[n]:n}function nW(e,n){return n$(e,n.toLowerCase())}let nQ=nU({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:nW,properties:{xmlns:null,xmlnsXLink:null}}),nY=nU({transform:(e,n)=>"role"===n?n:"aria-"+n.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:nI,ariaAutoComplete:null,ariaBusy:nI,ariaChecked:nI,ariaColCount:nz,ariaColIndex:nz,ariaColSpan:nz,ariaControls:nM,ariaCurrent:null,ariaDescribedBy:nM,ariaDetails:null,ariaDisabled:nI,ariaDropEffect:nM,ariaErrorMessage:null,ariaExpanded:nI,ariaFlowTo:nM,ariaGrabbed:nI,ariaHasPopup:null,ariaHidden:nI,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nM,ariaLevel:nz,ariaLive:null,ariaModal:nI,ariaMultiLine:nI,ariaMultiSelectable:nI,ariaOrientation:null,ariaOwns:nM,ariaPlaceholder:null,ariaPosInSet:nz,ariaPressed:nI,ariaReadOnly:nI,ariaRelevant:null,ariaRequired:nI,ariaRoleDescription:nM,ariaRowCount:nz,ariaRowIndex:nz,ariaRowSpan:nz,ariaSelected:nI,ariaSetSize:nz,ariaSort:null,ariaValueMax:nz,ariaValueMin:nz,ariaValueNow:nz,ariaValueText:null,role:null}}),nK=nU({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:nW,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nR,acceptCharset:nM,accessKey:nM,action:null,allow:null,allowFullScreen:nL,allowPaymentRequest:nL,allowUserMedia:nL,alt:null,as:null,async:nL,autoCapitalize:null,autoComplete:nM,autoFocus:nL,autoPlay:nL,capture:nL,charSet:null,checked:nL,cite:null,className:nM,cols:nz,colSpan:null,content:null,contentEditable:nI,controls:nL,controlsList:nM,coords:nz|nR,crossOrigin:null,data:null,dateTime:null,decoding:null,default:nL,defer:nL,dir:null,dirName:null,disabled:nL,download:nD,draggable:nI,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:nL,formTarget:null,headers:nM,height:nz,hidden:nL,high:nz,href:null,hrefLang:null,htmlFor:nM,httpEquiv:nM,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:nL,itemId:null,itemProp:nM,itemRef:nM,itemScope:nL,itemType:nM,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:nL,low:nz,manifest:null,max:null,maxLength:nz,media:null,method:null,min:null,minLength:nz,multiple:nL,muted:nL,name:null,nonce:null,noModule:nL,noValidate:nL,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:nL,optimum:nz,pattern:null,ping:nM,placeholder:null,playsInline:nL,poster:null,preload:null,readOnly:nL,referrerPolicy:null,rel:nM,required:nL,reversed:nL,rows:nz,rowSpan:nz,sandbox:nM,scope:null,scoped:nL,seamless:nL,selected:nL,shape:null,size:nz,sizes:null,slot:null,span:nz,spellCheck:nI,src:null,srcDoc:null,srcLang:null,srcSet:null,start:nz,step:null,style:null,tabIndex:nz,target:null,title:null,translate:null,type:null,typeMustMatch:nL,useMap:null,value:nI,width:nz,wrap:null,align:null,aLink:null,archive:nM,axis:null,background:null,bgColor:null,border:nz,borderColor:null,bottomMargin:nz,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:nL,declare:nL,event:null,face:null,frame:null,frameBorder:null,hSpace:nz,leftMargin:nz,link:null,longDesc:null,lowSrc:null,marginHeight:nz,marginWidth:nz,noResize:nL,noHref:nL,noShade:nL,noWrap:nL,object:null,profile:null,prompt:null,rev:null,rightMargin:nz,rules:null,scheme:null,scrolling:nI,standby:null,summary:null,text:null,topMargin:nz,valueType:null,version:null,vAlign:null,vLink:null,vSpace:nz,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:nL,disableRemotePlayback:nL,prefix:null,property:null,results:nz,security:null,unselectable:null}}),nX=nU({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:n$,properties:{about:nB,accentHeight:nz,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:nz,amplitude:nz,arabicForm:null,ascent:nz,attributeName:null,attributeType:null,azimuth:nz,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:nz,by:null,calcMode:null,capHeight:nz,className:nM,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:nz,diffuseConstant:nz,direction:null,display:null,dur:null,divisor:nz,dominantBaseline:null,download:nL,dx:null,dy:null,edgeMode:null,editable:null,elevation:nz,enableBackground:null,end:null,event:null,exponent:nz,externalResourcesRequired:null,fill:null,fillOpacity:nz,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:nR,g2:nR,glyphName:nR,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:nz,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:nz,horizOriginX:nz,horizOriginY:nz,id:null,ideographic:nz,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:nz,k:nz,k1:nz,k2:nz,k3:nz,k4:nz,kernelMatrix:nB,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:nz,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:nz,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:nz,overlineThickness:nz,paintOrder:null,panose1:null,path:null,pathLength:nz,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nM,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:nz,pointsAtY:nz,pointsAtZ:nz,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nB,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nB,rev:nB,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nB,requiredFeatures:nB,requiredFonts:nB,requiredFormats:nB,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:nz,specularExponent:nz,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:nz,strikethroughThickness:nz,string:null,stroke:null,strokeDashArray:nB,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:nz,strokeOpacity:nz,strokeWidth:null,style:null,surfaceScale:nz,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nB,tabIndex:nz,tableValues:null,target:null,targetX:nz,targetY:nz,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nB,to:null,transform:null,u1:null,u2:null,underlinePosition:nz,underlineThickness:nz,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:nz,values:null,vAlphabetic:nz,vMathematical:nz,vectorEffect:null,vHanging:nz,vIdeographic:nz,version:null,vertAdvY:nz,vertOriginX:nz,vertOriginY:nz,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:nz,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),nZ=nF([nq,nV,nQ,nY,nK],"html"),nJ=nF([nq,nV,nQ,nY,nX],"svg"),nG=function(e){if(null==e)return n0;if("string"==typeof e)return n1(function(n){return n&&n.type===e});if("object"==typeof e)return Array.isArray(e)?function(e){let n=[],t=-1;for(;++t":"")+")"})),f;function f(){var s;let c,f,p,d=[];if((!n||l(o,u,a[a.length-1]||null))&&!1===(d=Array.isArray(s=t(o,a))?s:"number"==typeof s?[!0,s]:[s])[0])return d;if(o.children&&"skip"!==d[0])for(f=(r?o.children.length:-1)+i,p=a.concat(o);f>-1&&f{n4(n,"element",(n,t,r)=>{let l;if(e.allowedElements?l=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(l=e.disallowedElements.includes(n.tagName)),!l&&e.allowElement&&"number"==typeof t&&(l=!e.allowElement(n,t,r)),l&&"number"==typeof t)return e.unwrapDisallowed&&n.children?r.children.splice(t,1,...n.children):r.children.splice(t,1),t})}}let n6=["http","https","mailto","tel"];var n5=t(82143);let n9=/^data[-\w.:]+$/i,n7=/-[a-z]/g,n8=/[A-Z]/g;function te(e){return"-"+e.toLowerCase()}function tn(e){return e.charAt(1).toUpperCase()}let tt={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var tr=t(57848);let tl={}.hasOwnProperty,ti=new Set(["table","thead","tbody","tfoot","tr"]);function to(e,n){let t=-1,r=0;for(;++t for more info)`),delete ts[n]}let r=C().use(e9).use(e.remarkPlugins||[]).use(nC,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(n3,e),l=new y;"string"==typeof e.children?l.value=e.children:void 0!==e.children&&null!==e.children&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);let o=r.runSync(r.parse(l),l);if("root"!==o.type)throw TypeError("Expected a `root` node");let u=i.createElement(i.Fragment,{},function e(n,t){let r;let l=[],o=-1;for(;++o4&&"data"===t.slice(0,4)&&n9.test(n)){if("-"===n.charAt(4)){let i=n.slice(5).replace(n7,tn);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let o=n.slice(4);if(!n7.test(o)){let u=o.replace(n8,te);"-"!==u.charAt(0)&&(u="-"+u),n="data"+u}}l=nN}return new l(r,n)}(r.schema,n),i=t;null!=i&&i==i&&(Array.isArray(i)&&(i=l.commaSeparated?function(e,n){let t={},r=""===e[e.length-1]?[...e,""]:e;return r.join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(i):i.join(" ").trim()),"style"===l.property&&"string"==typeof i&&(i=function(e){let n={};try{tr(e,function(e,t){let r="-ms-"===e.slice(0,4)?`ms-${e.slice(4)}`:e;n[r.replace(/-([a-z])/g,tu)]=t})}catch{}return n}(i)),l.space&&l.property?e[tl.call(tt,l.property)?tt[l.property]:l.property]=i:l.attribute&&(e[l.attribute]=i))}(c,o,t.properties[o],n);("ol"===s||"ul"===s)&&n.listDepth++;let p=e(n,t);("ol"===s||"ul"===s)&&n.listDepth--,n.schema=a;let d=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},h=u.components&&tl.call(u.components,s)?u.components[s]:s,m="string"==typeof h||h===i.Fragment;if(!n5.isValidElementType(h))throw TypeError(`Component for name \`${s}\` not defined or is not renderable`);if(c.key=[s,d.start.line,d.start.column,r].join("-"),"a"===s&&u.linkTarget&&(c.target="function"==typeof u.linkTarget?u.linkTarget(String(c.href||""),t.children,"string"==typeof c.title?c.title:null):u.linkTarget),"a"===s&&u.transformLinkUri&&(c.href=u.transformLinkUri(String(c.href||""),t.children,"string"==typeof c.title?c.title:null)),m||"code"!==s||"element"!==l.type||"pre"===l.tagName||(c.inline=!0),m||"h1"!==s&&"h2"!==s&&"h3"!==s&&"h4"!==s&&"h5"!==s&&"h6"!==s||(c.level=Number.parseInt(s.charAt(1),10)),"img"===s&&u.transformImageUri&&(c.src=u.transformImageUri(String(c.src||""),String(c.alt||""),"string"==typeof c.title?c.title:null)),!m&&"li"===s&&"element"===l.type){let g=function(e){let n=-1;for(;++nString(e)).join("")),!m&&u.rawSourcePos&&(c.sourcePosition=t.position),!m&&u.includeElementIndex&&(c.index=to(l,t),c.siblingCount=to(l)),m||(c.node=t),p.length>0?i.createElement(h,c,p):i.createElement(h,c)}(n,r,o,t)):"text"===r.type?"element"===t.type&&ti.has(t.tagName)&&function(e){var n=e&&"object"==typeof e&&"text"===e.type?e.value||"":e;return"string"==typeof n&&""===n.replace(/[ \t\n\f\r]/g,"")}(r)||l.push(r.value):"raw"!==r.type||n.options.skipHtml||l.push(r.value);return l}({options:e,schema:nZ,listDepth:0},o));return e.className&&(u=i.createElement("div",{className:e.className},u)),u}tc.defaultProps={transformLinkUri:function(e){let n=(e||"").trim(),t=n.charAt(0);if("#"===t||"/"===t)return n;let r=n.indexOf(":");if(-1===r)return n;let l=-1;for(;++ll||-1!==(l=n.indexOf("#"))&&r>l?n:"javascript:void(0)"}},tc.propTypes={children:nE.string,className:nE.string,allowElement:nE.func,allowedElements:nE.arrayOf(nE.string),disallowedElements:nE.arrayOf(nE.string),unwrapDisallowed:nE.bool,remarkPlugins:nE.arrayOf(nE.oneOfType([nE.object,nE.func,nE.arrayOf(nE.oneOfType([nE.bool,nE.string,nE.object,nE.func,nE.arrayOf(nE.any)]))])),rehypePlugins:nE.arrayOf(nE.oneOfType([nE.object,nE.func,nE.arrayOf(nE.oneOfType([nE.bool,nE.string,nE.object,nE.func,nE.arrayOf(nE.any)]))])),sourcePos:nE.bool,rawSourcePos:nE.bool,skipHtml:nE.bool,includeElementIndex:nE.bool,transformLinkUri:nE.oneOfType([nE.func,nE.bool]),linkTarget:nE.oneOfType([nE.func,nE.string]),transformImageUri:nE.func,components:nE.object}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/4ad82c5e-f4c5e1bb80225462.js b/static/web/_next/static/chunks/4ad82c5e-fc50c092be65fd31.js similarity index 51% rename from static/web/_next/static/chunks/4ad82c5e-f4c5e1bb80225462.js rename to static/web/_next/static/chunks/4ad82c5e-fc50c092be65fd31.js index 3ba3de39a..c6b28d30d 100644 --- a/static/web/_next/static/chunks/4ad82c5e-f4c5e1bb80225462.js +++ b/static/web/_next/static/chunks/4ad82c5e-fc50c092be65fd31.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5762],{47421:function(t,e,i){let s;i.d(e,{$1:function(){return iw},$f:function(){return im},AE:function(){return iq},Eu:function(){return sE},HQ:function(){return sH},Nm:function(){return tF},OO:function(){return tA},S2:function(){return i1},SJ:function(){return sf},Sd:function(){return sh},Uw:function(){return iM},W$:function(){return iY},ZO:function(){return iG},Zs:function(){return iZ},bF:function(){return so},gB:function(){return sn},hJ:function(){return i7},l9:function(){return ts},lg:function(){return tR},mH:function(){return su},p:function(){return tn},qr:function(){return iV},tk:function(){return ir},v5:function(){return sv}});var o,n,r,l=i(78120),h=i(28699),a=i(33952);function c(t){return(11==t.nodeType?t.getSelection?t:t.ownerDocument:t).getSelection()}function d(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function u(t,e){if(!e.anchorNode)return!1;try{return d(t,e.anchorNode)}catch(i){return!1}}function f(t){return 3==t.nodeType?M(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function p(t,e,i,s){return!!i&&(g(t,e,i,s,-1)||g(t,e,i,s,1))}function m(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function g(t,e,i,s,o){for(;;){if(t==i&&e==s)return!0;if(e==(o<0?0:v(t))){if("DIV"==t.nodeName)return!1;let n=t.parentNode;if(!n||1!=n.nodeType)return!1;e=m(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType||1==(t=t.childNodes[e+(o<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=o<0?v(t):0}}}function v(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}let w={left:0,right:0,top:0,bottom:0};function y(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}class b{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){this.set(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let x=null;function S(t){if(t.setActive)return t.setActive();if(x)return t.focus(x);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==x?{get preventScroll(){return x={preventScroll:!0},!0}}:void 0),!x){x=!1;for(let s=0;se)return c.domBoundsAround(t,e,h);if(d>=t&&-1==s&&(s=l,o=h),h>e&&c.dom.parentNode==this.dom){n=l,r=a;break}a=d,h=d+c.breakAfter}return{from:o,to:r<0?i+this.length:r,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:n=0?this.children[n].dom:null}}markDirty(t=!1){this.dirty|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.dirty|=2),1&e.dirty)return;e.dirty|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}setDOM(t){this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=D){this.markDirty();for(let s=t;sthis.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function E(t,e,i,s,o,n,r,l,h){let{children:a}=t,c=a.length?a[e]:null,d=n.length?n[n.length-1]:null,u=d?d.breakAfter:r;if(!(e==s&&c&&!r&&!u&&n.length<2&&c.merge(i,o,n.length?d:null,0==i,l,h))){if(s0&&(!r&&n.length&&c.merge(i,c.length,n[0],!1,l,0)?c.breakAfter=n.shift().breakAfter:(i2);var K={mac:j||/Mac/.test(L.platform),windows:/Win/.test(L.platform),linux:/Linux|X11/.test(L.platform),ie:W,ie_version:N?V.documentMode||6:P?+P[1]:H?+H[1]:0,gecko:z,gecko_version:z?+(/Firefox\/(\d+)/.exec(L.userAgent)||[0,0])[1]:0,chrome:!!F,chrome_version:F?+F[1]:0,ios:j,android:/Android\b/.test(L.userAgent),webkit:I,safari:q,webkit_version:I?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=V.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class $ extends T{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return(!i||i instanceof $&&!(this.length-(e-t)+i.length>256))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new $(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new A(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return X(this.dom,t,e)}}class G extends T{constructor(t,e=[],i=0){for(let s of(super(),this.mark=t,this.children=e,this.length=i,e))s.setParent(this)}setAttrs(t){if(C(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.dirty|=6)}sync(t){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t)}merge(t,e,i,s,o,n){return(!i||!!(i instanceof G&&i.mark.eq(this.mark))&&(!t||!(o<=0))&&(!(et&&e.push(i=t&&(s=o),i=r,o++}let l=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new G(this.mark,e,l)}domAtPos(t){return Z(this,t)}coordsAt(t,e){return J(this,t,e)}}function X(t,e,i){let s=t.nodeValue.length;e>s&&(e=s);let o=e,n=e,r=0;0==e&&i<0||e==s&&i>=0?!(K.chrome||K.gecko)&&(e?(o--,r=1):n=0)?0:l.length-1];return K.safari&&!r&&0==h.width&&(h=Array.prototype.find.call(l,t=>t.width)||h),r?y(h,r<0):h||null}class _ extends T{constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}static create(t,e,i){return new(t.customView||_)(t,e,i)}split(t){let e=_.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(t,e,i,s,o,n){return(!i||i instanceof _&&!!this.widget.compare(i.widget)&&(!(t>0)||!(o<=0))&&(!(e0?i.length-1:0;s=i[o],t>0?0!=o:o!=i.length-1&&!(s.top0?-1:1);return this.length?s:y(s,this.side>0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class U extends _{domAtPos(t){let{topView:e,text:i}=this.widget;return e?Y(t,0,e,i,(t,e)=>t.domAtPos(e),t=>new A(i,Math.min(t,i.nodeValue.length))):new A(i,Math.min(t,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(t,e){let{topView:i,text:s}=this.widget;return i?function t(e,i,s,o){if(s instanceof G)for(let n of s.children){let r=0,l=d(n.dom,o);if(d(n.dom,e))return r+(l?t(e,i,n,o):n.localPosFromDOM(e,i));r+=l?o.nodeValue.length:n.length}else if(s.dom==o)return Math.min(i,o.nodeValue.length);return s.localPosFromDOM(e,i)}(t,e,i,s):Math.min(e,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(t,e){let{topView:i,text:s}=this.widget;return i?Y(t,e,i,s,(t,e,i)=>t.coordsAt(e,i),(t,e)=>X(s,t,e)):X(s,t,e)}destroy(){var t;super.destroy(),null===(t=this.widget.topView)||void 0===t||t.destroy()}get isEditable(){return!0}canReuseDOM(){return!0}}function Y(t,e,i,s,o,n){if(i instanceof G){for(let r=i.dom.firstChild;r;r=r.nextSibling){let l=T.get(r);if(!l)return n(t,e);let h=d(r,s),a=l.length+(h?s.nodeValue.length:0);if(t=l.getSide())return h?Y(t,e,l,s,o,n):o(l,t,e);t-=a}return o(i,i.length,-1)}return i.dom==s?n(t,e):o(i,t,e)}class Q extends T{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof Q&&t.side==this.side}split(){return new Q(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return A.before(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){let e=this.dom.getBoundingClientRect(),i=function(t,e){let i=t.parent,s=i?i.children.indexOf(t):-1;for(;i&&s>=0;)if(e<0?s>0:s0?-1:1);return i&&i.tope.top?{left:e.left,right:e.right,top:i.top,bottom:i.bottom}:e}get overrideDOMText(){return l.xv.empty}}function Z(t,e){let i=t.dom,{children:s}=t,o=0;for(let n=0;o=r.getSide())){if(e>n&&e0;h--){let a=s[h-1];if(a.dom.parentNode==i)return a.domAtPos(a.length)}for(let c=o;c=i&&(a.children.length?t(a,i-h):!n&&(c>i||h==c&&a.getSide()>0)?(n=a,r=i-h):(ha.getSide())&&(s=a,o=i-h)),h=c}}(t,e);let l=(i<0?s:n)||s||n;return l?l.coordsAt(Math.max(0,l==s?o:r),i):function(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=f(e);return i[i.length-1]||null}(t)}function tt(t,e){for(let i in t)"class"==i&&e.class?e.class+=" "+t.class:"style"==i&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}function te(t,e){if(t==e)return!0;if(!t||!e)return!1;let i=Object.keys(t),s=Object.keys(e);if(i.length!=s.length)return!1;for(let o of i)if(-1==s.indexOf(o)||t[o]!==e[o])return!1;return!0}function ti(t,e,i){let s=null;if(e)for(let o in e)i&&o in i||t.removeAttribute(s=o);if(i)for(let n in i)e&&e[n]==i[n]||t.setAttribute(s=n,i[n]);return!!s}$.prototype.children=_.prototype.children=Q.prototype.children=D;class ts{eq(t){return!1}updateDOM(t){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return -1}ignoreEvent(t){return!0}get customView(){return null}destroy(t){}}var to=((o=to||(to={}))[o.Text=0]="Text",o[o.WidgetBefore=1]="WidgetBefore",o[o.WidgetAfter=2]="WidgetAfter",o[o.WidgetRange=3]="WidgetRange",o);class tn extends l.uU{constructor(t,e,i,s){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(t){return new tr(t)}static widget(t){let e=t.side||0,i=!!t.block;return e+=i?e>0?3e8:-4e8:e>0?1e8:-1e8,new th(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap)i=-5e8,s=4e8;else{let{start:o,end:n}=ta(t,e);i=(o?e?-3e8:-1:5e8)-1,s=(n?e?2e8:1:-6e8)+1}return new th(t,i,s,e,t.widget||null,!0)}static line(t){return new tl(t)}static set(t,e=!1){return l.Xs.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}tn.none=l.Xs.empty;class tr extends tn{constructor(t){let{start:e,end:i}=ta(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){return this==t||t instanceof tr&&this.tagName==t.tagName&&this.class==t.class&&te(this.attrs,t.attrs)}range(t,e=t){if(t>=e)throw RangeError("Mark decorations may not be empty");return super.range(t,e)}}tr.prototype.point=!1;class tl extends tn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof tl&&te(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}tl.prototype.mapMode=l.gc.TrackBefore,tl.prototype.point=!0;class th extends tn{constructor(t,e,i,s,o,n){super(e,i,o,t),this.block=s,this.isReplace=n,this.mapMode=s?e<=0?l.gc.TrackBefore:l.gc.TrackAfter:l.gc.TrackDel}get type(){return this.startSide=5}eq(t){var e,i;return t instanceof th&&((e=this.widget)==(i=t.widget)||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function ta(t,e=!1){let{inclusiveStart:i,inclusiveEnd:s}=t;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e}}function tc(t,e,i,s=0){let o=i.length-1;o>=0&&i[o]+s>=t?i[o]=Math.max(i[o],e):i.push(t,e)}th.prototype.point=!0;class td extends T{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,s,o,n){if(i){if(!(i instanceof td))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),B(this,t,e,i?i.children:[],o,n),!0}split(t){let e=new td;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:s}=this.childPos(t);s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let o=i;o0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){te(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){!function t(e,i,s){let o,{children:n}=e;s>0&&i instanceof G&&n.length&&(o=n[n.length-1])instanceof G&&o.mark.eq(i.mark)?t(o,i.children[0],s-1):(n.push(i),i.setParent(e)),e.length+=i.length}(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=tt(e,this.attrs||{})),i&&(this.attrs=tt({class:i},this.attrs||{}))}domAtPos(t){return Z(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.dirty|=6)}sync(t){var e;this.dom?4&this.dirty&&(C(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ti(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t);let i=this.dom.lastChild;for(;i&&T.get(i) instanceof G;)i=i.lastChild;if(!i||!this.length||"BR"!=i.nodeName&&(null===(e=T.get(i))||void 0===e?void 0:e.isEditable)==!1&&(!K.ios||!this.children.some(t=>t instanceof $))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t=0;for(let e of this.children){if(!(e instanceof $)||/[^ -~]/.test(e.text))return null;let i=f(e.dom);if(1!=i.length)return null;t+=i[0].width}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}:null}coordsAt(t,e){return J(this,t,e)}become(t){return!1}get type(){return to.Text}static find(t,e){for(let i=0,s=0;i=e){if(o instanceof td)return o;if(n>e)break}s=n+o.breakAfter}return null}}class tu extends T{constructor(t,e,i){super(),this.widget=t,this.length=e,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,s,o,n){return(!i||i instanceof tu&&!!this.widget.compare(i.widget)&&(!(t>0)||!(o<=0))&&(!(e0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw 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.flushBuffer([]),this.curLine=null,t--;continue}this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(0,i)),this.getLine().append(tp(new $(this.text.slice(this.textOff,this.textOff+r)),e),i),this.atCursorPos=!0,this.textOff+=r,t-=r,i=0}}span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s)}point(t,e,i,s,o,n){if(this.disallowBlockEffectsFor[n]&&i instanceof th){if(i.block)throw RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}let r=e-t;if(i instanceof th){if(i.block){let{type:l}=i;l!=to.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new tu(i.widget||new tm("div"),r,l))}else{let h=_.create(i.widget||new tm("span"),r,r?0:i.startSide),a=this.atCursorPos&&!h.isEditable&&o<=s.length&&(t0),c=!h.isEditable&&(tt.some(t=>t)}),tM=l.r$.define({combine:t=>t.some(t=>t)});class tk{constructor(t,e="nearest",i="nearest",s=5,o=5){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=o}map(t){return t.empty?this:new tk(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin)}}let tC=l.Py.define({map:(t,e)=>t.map(e)});function tA(t,e,i){let s=t.facet(ty);s.length?s[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e)}let tD=l.r$.define({combine:t=>!t.length||t[0]}),tT=0,tO=l.r$.define();class tR{constructor(t,e,i,s){this.id=t,this.create=e,this.domEventHandlers=i,this.extension=s(this)}static define(t,e){let{eventHandlers:i,provide:s,decorations:o}=e||{};return new tR(tT++,t,i,t=>{let e=[tO.of(t)];return o&&e.push(tV.of(e=>{let i=e.plugin(t);return i?o(i):tn.none})),s&&e.push(s(t)),e})}static fromClass(t,e){return tR.define(e=>new t(e),e)}}class tE{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(s){if(tA(e.state,s,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(o){tA(t.state,o,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(i){tA(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let tB=l.r$.define(),tL=l.r$.define(),tV=l.r$.define(),tH=l.r$.define(),tN=l.r$.define(),tP=l.r$.define();class tW{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new tW(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toAa)break;o+=2}if(!l)return i;new tW(l.fromA,l.toA,l.fromB,l.toB).addToSet(i),n=l.toA,r=l.toB}}}class tz{constructor(t,e,i){for(let s of(this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=l.as.empty(this.startState.doc.length),i))this.changes=this.changes.compose(s.changes);let o=[];this.changes.iterChangedRanges((t,e,i,s)=>o.push(new tW(t,e,i,s))),this.changedRanges=o;let n=t.hasFocus;n!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=n,this.flags|=1)}static create(t,e,i){return new tz(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}var tF=((n=tF||(tF={}))[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n);let tI=tF.LTR,tq=tF.RTL;function tj(t){let e=[];for(let i=0;i=e){if(r.level==i)return n;(o<0||(0!=s?s<0?r.frome:t[o].level>r.level))&&(o=n)}}if(o<0)throw RangeError("Index out of range");return o}}let tJ=[];function t0(t){return[new tZ(0,t,0)]}let t1="";class t2{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(l.yy.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+="￿"}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s),this.readNode(s);let o=s.nextSibling;if(o==e)break;let n=T.get(s),r=T.get(o);(n&&r?n.breakAfter:(n?n.breakAfter:t8(s))||t8(o)&&("BR"!=s.nodeName||s.cmIgnore))&&this.lineBreak(),s=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let s=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let n=-1,r=1,l;if(this.lineSeparator?(n=e.indexOf(this.lineSeparator,s),r=this.lineSeparator.length):(l=o.exec(e))&&(n=l.index,r=l[0].length),this.append(e.slice(s,n<0?e.length:n)),n<0)break;if(this.lineBreak(),r>1)for(let h of this.points)h.node==t&&h.pos>this.text.length&&(h.pos-=r-1);s=n+r}}readNode(t){if(t.cmIgnore)return;let e=T.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+Math.min(e,i.offset))}}function t8(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class t3{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class t9 extends T{constructor(t){super(),this.view=t,this.compositionDeco=tn.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new td],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new tW(0,0,0,t.state.doc.length)],0)}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(t){var e,i,s;let o,n=t.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:t,toA:e})=>ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=tn.none:(t.transactions.length||this.dirty)&&(this.compositionDeco=function(t,e){let i=t4(t);if(!i)return tn.none;let{from:s,to:o,node:n,text:r}=i,l=e.mapPos(s,1),h=Math.max(l,e.mapPos(o,-1)),{state:a}=t,c=3==n.nodeType?n.nodeValue:new t2([],a).readRange(n.firstChild,null).text;if(h-l{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=K.chrome||K.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(t),this.dirty=0,t&&(t.written||i.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?t[s]:null;if(!o)break;let{fromA:n,toA:r,fromB:l,toB:h}=o,{content:a,breakAtStart:c,openStart:d,openEnd:u}=tf.build(this.view.state.doc,l,h,this.decorations,this.dynamicDecorationMap),{i:f,off:p}=i.findPos(r,1),{i:m,off:g}=i.findPos(n,-1);E(this,m,g,f,p,a,c,d,u)}}updateSelection(t=!1,e=!1){var i;if((t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(e||this.mayControlSelection()))return;let s=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,n=this.domAtPos(o.anchor),r=o.empty?n:this.domAtPos(o.head);if(K.gecko&&o.empty&&1==(i=n).node.nodeType&&i.node.firstChild&&(0==i.offset||"false"==i.node.childNodes[i.offset-1].contentEditable)&&(i.offset==i.node.childNodes.length||"false"==i.node.childNodes[i.offset].contentEditable)){let l=document.createTextNode("");this.view.observer.ignore(()=>n.node.insertBefore(l,n.node.childNodes[n.offset]||null)),n=r=new A(l,0),s=!0}let h=this.view.observer.selectionRange;!s&&h.focusNode&&p(n.node,n.offset,h.anchorNode,h.anchorOffset)&&p(r.node,r.offset,h.focusNode,h.focusOffset)||(this.view.observer.ignore(()=>{K.android&&K.chrome&&this.dom.contains(h.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=c(this.view.root);if(t){if(o.empty){if(K.gecko){var e,i;let s=(e=n.node,i=n.offset,1!=e.nodeType?0:(i&&"false"==e.childNodes[i-1].contentEditable?1:0)|(io.head&&([n,r]=[r,n]),d.setEnd(r.node,r.offset),d.setStart(n.node,n.offset),t.removeAllRanges(),t.addRange(d)}}}),this.view.observer.setSelectionRange(n,r)),this.impreciseAnchor=n.precise?null:new A(h.anchorNode,h.anchorOffset),this.impreciseHead=r.precise?null:new A(h.focusNode,h.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:t}=this,e=t.state.selection.main,i=c(t.root),{anchorNode:s,anchorOffset:o}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let n=td.find(this,e.head);if(!n)return;let r=n.posAtStart;if(e.head==r||e.head==r+n.length)return;let l=this.coordsAt(e.head,-1),h=this.coordsAt(e.head,1);if(!l||!h||l.bottom>h.top)return;let a=this.domAtPos(e.head+e.assoc);i.collapse(a.node,a.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let d=t.observer.selectionRange;t.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=e.from&&i.collapse(s,o)}mayControlSelection(){let t=this.view.root.activeElement;return t==this.dom||u(this.dom,this.view.observer.selectionRange)&&!(t&&this.dom.contains(t))}nearest(t){for(let e=t;e;){let i=T.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;en||t==n&&o.type!=to.WidgetBefore&&o.type!=to.WidgetAfter&&(!s||2==e||this.children[s-1].breakAfter||this.children[s-1].type==to.WidgetBefore&&e>-2))return o.coordsAt(t-n,e);i=n}}measureVisibleLineHeights(t){let e=[],{from:i,to:s}=t,o=this.view.contentDOM.clientWidth,n=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,r=-1,l=this.view.textDirection==tF.LTR;for(let h=0,a=0;as)break;if(h>=i){let u=c.dom.getBoundingClientRect();if(e.push(u.height),n){let p=c.dom.lastChild,m=p?f(p):[];if(m.length){let g=m[m.length-1],v=l?g.right-u.left:u.right-g.left;v>r&&(r=v,this.minWidth=o,this.minWidthFrom=h,this.minWidthTo=d)}}}h=d+c.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?tF.RTL:tF.LTR}measureTextSize(){for(let t of this.children)if(t instanceof td){let e=t.measureTextSize();if(e)return e}let i=document.createElement("div"),s,o;return i.className="cm-line",i.style.width="99999px",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(i);let t=f(i.firstChild)[0];s=i.getBoundingClientRect().height,o=t?t.width/27:7,i.remove()}),{lineHeight:s,charWidth:o}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new R(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let o=s==e.viewports.length?null:e.viewports[s],n=o?o.from-1:this.length;if(n>i){let r=e.lineBlockAt(n).bottom-e.lineBlockAt(i).top;t.push(tn.replace({widget:new t5(r),block:!0,inclusive:!0,isBlockGap:!0}).range(i,n))}if(!o)break;i=o.to+1}return tn.set(t)}updateDeco(){let t=this.view.state.facet(tV).map((t,e)=>(this.dynamicDecorationMap[e]="function"==typeof t)?t(this.view):t);for(let e=t.length;ee.anchor?-1:1),s;if(!i)return;!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=0,n=0,r=0,l=0;for(let h of this.view.state.facet(tN).map(t=>t(this.view)))if(h){let{left:a,right:c,top:d,bottom:u}=h;null!=a&&(o=Math.max(o,a)),null!=c&&(n=Math.max(n,c)),null!=d&&(r=Math.max(r,d)),null!=u&&(l=Math.max(l,u))}let f={left:i.left-o,top:i.top-r,right:i.right+n,bottom:i.bottom+l};!function(t,e,i,s,o,n,r,l){let h=t.ownerDocument,a=h.defaultView||window;for(let c=t;c;)if(1==c.nodeType){let d,u=c==h.body;if(u)d={left:0,right:a.innerWidth,top:0,bottom:a.innerHeight};else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let f=c.getBoundingClientRect();d={left:f.left,right:f.left+c.clientWidth,top:f.top,bottom:f.top+c.clientHeight}}let p=0,m=0;if("nearest"==o)e.top0&&e.bottom>d.bottom+m&&(m=e.bottom-d.bottom+m+r)):e.bottom>d.bottom&&(m=e.bottom-d.bottom+r,i<0&&e.top-m0&&e.right>d.right+p&&(p=e.right-d.right+p+n)):e.right>d.right&&(p=e.right-d.right+n,i<0&&e.leftMath.abs(w-p)&&(s="nearest"),y&&1>Math.abs(y-m)&&(o="nearest")}}if(u)break;c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,f,e.head0&&i<=0)e=v(t=t.childNodes[e-1]);else{if(1!=t.nodeType||!(e=0))return null;t=t.childNodes[e],e=0}}}class et{constructor(){this.changes=[]}compareRange(t,e){tc(t,e,this.changes)}comparePoint(t,e){tc(t,e,this.changes)}}function ee(t,e){return t.tope.top+1}function ei(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function eo(t,e,i){let s=t.nodeValue.length,o=-1,n=1e9,r=0;for(let l=0;li?c.top-i:i-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&d=(c.left+c.right)/2,f=u;if((K.chrome||K.gecko)&&M(t,l).getBoundingClientRect().left==c.right&&(f=!u),d<=0)return{node:t,offset:l+(f?1:0)};o=l+(f?1:0),n=d}}}return{node:t,offset:o>-1?o:r>0?t.nodeValue.length:0}}function en(t,{x:e,y:i},s,o=-1){var n;let r=t.contentDOM.getBoundingClientRect(),l=r.top+t.viewState.paddingTop,h,{docHeight:a}=t.viewState,c=i-l;if(c<0)return 0;if(c>a)return t.state.doc.length;for(let d=t.defaultLineHeight/2,u=!1;(h=t.elementAtHeight(c)).type!=to.Text;)for(;!((c=o>0?h.bottom+d:h.top-d)>=0)||!(c<=a);){if(u)return s?null:0;u=!0,o=-o}i=l+c;let p=h.from;if(pt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:s?null:er(t,r,h,e,i);let m=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:m,v=g.elementFromPoint(e,i);v&&!t.contentDOM.contains(v)&&(v=null),!v&&(e=Math.max(r.left+1,Math.min(r.right-1,e)),(v=g.elementFromPoint(e,i))&&!t.contentDOM.contains(v)&&(v=null));let w,y=-1;if(v&&(null===(n=t.docView.nearest(v))||void 0===n?void 0:n.isEditable)!=!1){if(m.caretPositionFromPoint){let b=m.caretPositionFromPoint(e,i);b&&({offsetNode:w,offset:y}=b)}else if(m.caretRangeFromPoint){let x=m.caretRangeFromPoint(e,i);x&&({startContainer:w,startOffset:y}=x,(!t.contentDOM.contains(w)||K.safari&&function(t,e,i){let s;if(3!=t.nodeType||e!=(s=t.nodeValue.length))return!1;for(let o=t.nextSibling;o;o=o.nextSibling)if(1!=o.nodeType||"BR"!=o.nodeName)return!1;return M(t,s-1,s).getBoundingClientRect().left>i}(w,y,e)||K.chrome&&function(t,e,i){if(0!=e)return!1;for(let s=t;;){let o=s.parentNode;if(!o||1!=o.nodeType||o.firstChild!=s)return!1;if(o.classList.contains("cm-line"))break;s=o}return i-(1==t.nodeType?t.getBoundingClientRect():M(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect()).left>5}(w,y,e))&&(w=void 0))}}if(!w||!t.docView.dom.contains(w)){let S=td.find(t.docView,p);if(!S)return c>h.top+h.height/2?h.to:h.from;({node:w,offset:y}=function t(e,i,s){let o,n,r,l,h,a,c,d,u=!1;for(let p=e.firstChild;p;p=p.nextSibling){let m=f(p);for(let g=0;gi?v.left-i:Math.max(0,i-v.right),x=(w=y).top>s?w.top-s:Math.max(0,s-w.bottom);if(0==b&&0==x)return 3==p.nodeType?eo(p,i,s):t(p,i,s);(!h||d>x||d==x&&c>b)&&(h=p,a=y,c=b,d=x,u=!b||(b>0?g0)),0==b?s>y.bottom&&(!r||r.bottomy.top)&&(n=p,l=y):r&&ee(r,y)?r=es(r,y.bottom):l&&ee(l,y)&&(l=ei(l,y.top))}}if(r&&r.bottom>=s?(h=o,a=r):l&&l.top<=s&&(h=n,a=l),!h)return{node:e,offset:0};let S=Math.max(a.left,Math.min(a.right,i));if(3==h.nodeType)return eo(h,S,s);if(u&&"false"!=h.contentEditable)return t(h,S,s);let M=Array.prototype.indexOf.call(e.childNodes,h)+(i>=(a.left+a.right)/2?1:0);return{node:e,offset:M}}(S.dom,e,i))}return t.docView.posFromDOM(w,y)}function er(t,e,i,s,o){let n=Math.round((s-e.left)*t.defaultCharacterWidth);t.lineWrapping&&i.height>1.5*t.defaultLineHeight&&(n+=Math.floor((o-i.top)/t.defaultLineHeight)*t.viewState.heightOracle.lineLength);let r=t.state.sliceDoc(i.from,i.to);return i.from+(0,l.Gz)(r,n,t.state.tabSize)}function el(t,e,i,s){let o=t.state.doc.lineAt(e.head),n=t.bidiSpans(o),r=t.textDirectionAt(o.from);for(let h=e,a=null;;){let c=function(t,e,i,s,o){var n;let r=s.head-t.from,h=-1;if(0==r){if(!o||!t.length)return null;e[0].level!=i&&(r=e[0].side(!1,i),h=0)}else if(r==t.length){if(o)return null;let a=e[e.length-1];a.level!=i&&(r=a.side(!0,i),h=e.length-1)}h<0&&(h=tZ.find(e,r,null!==(n=s.bidiLevel)&&void 0!==n?n:-1,s.assoc));let c=e[h];r==c.side(o,i)&&(r=(c=e[h+=o?1:-1]).side(!o,i));let d=o==(c.dir==i),u=(0,l.cp)(t.text,r,d);if(t1=t.text.slice(Math.min(r,u),Math.max(r,u)),u!=c.side(o,i))return l.jT.cursor(u+t.from,d?-1:1,c.level);let f=h==(o?e.length-1:0)?null:e[h+(o?1:-1)];return f||c.level==i?f&&f.levele(t));for(;;){let o=!1;for(let n of s)n.between(i.from-1,i.from+1,(t,s,n)=>{i.from>t&&i.fromi.from?l.jT.cursor(t,1):l.jT.cursor(s,-1),o=!0)});if(!o)return i}}class ea{constructor(t){for(let e in this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null,em){let i=em[e];t.contentDOM.addEventListener(e,s=>{!(!ep(t,s)||this.ignoreDuringComposition(s))&&("keydown"==e&&this.keydown(t,s)||(this.mustFlushObserver(s)&&t.observer.forceFlush(),this.runCustomHandlers(e,t,s)?s.preventDefault():i(t,s)))},eg[e]),this.registeredEvents.push(e)}K.chrome&&102==K.chrome_version&&t.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?t.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,t.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=t.hasFocus,K.safari&&t.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}ensureHandlers(t,e){var i;let s;for(let o of(this.customHandlers=[],e))if(s=null===(i=o.update(t).spec)||void 0===i?void 0:i.domEventHandlers)for(let n in this.customHandlers.push({plugin:o.value,handlers:s}),s)0>this.registeredEvents.indexOf(n)&&"scroll"!=n&&(this.registeredEvents.push(n),t.contentDOM.addEventListener(n,e=>{ep(t,e)&&this.runCustomHandlers(n,t,e)&&e.preventDefault()}))}runCustomHandlers(t,e,i){for(let s of this.customHandlers){let o=s.handlers[t];if(o)try{if(o.call(s.plugin,i,e)||i.defaultPrevented)return!0}catch(n){tA(e.state,n)}}return!1}runScrollHandlers(t,e){for(let i of(this.lastScrollTop=t.scrollDOM.scrollTop,this.lastScrollLeft=t.scrollDOM.scrollLeft,this.customHandlers)){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,e,t)}catch(o){tA(t.state,o)}}}keydown(t,e){let i;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&Date.now()t.keyCode==e.keyCode))&&!e.ctrlKey||ed.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey))&&(this.pendingIOSKey=i||e,setTimeout(()=>this.flushIOSKey(t),250),!0))}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,k(t.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(K.safari&&!K.ios&&Date.now()-this.compositionEndedAt<100)&&(this.compositionEndedAt=0,!0))}mustFlushObserver(t){return"keydown"==t.type&&229!=t.keyCode}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.mouseSelection&&this.mouseSelection.update(t),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}let ec=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ed="dthko",eu=[16,17,18,20,91,92,224,225];class ef{constructor(t,e,i,s){let o,n;this.view=t,this.style=i,this.mustSelect=s,this.lastEvent=e;let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(l.yy.allowMultipleSelections)&&((o=t.state.facet(tg)).length?o[0](e):K.mac?e.metaKey:e.ctrlKey),this.dragMove=(n=t.state.facet(tv)).length?n[0](e):K.mac?!e.altKey:!e.ctrlKey,this.dragging=!!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let s=c(t.root);if(!s||0==s.rangeCount)return!0;let o=s.getRangeAt(0).getClientRects();for(let n=0;n=e.clientX&&r.top<=e.clientY&&r.bottom>=e.clientY)return!0}return!1}(t,e)&&1==eD(e)&&null,!1===this.dragging&&(e.preventDefault(),this.select(e))}move(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=t)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(t){let e=this.style.get(t,this.extend,this.multiple);(this.mustSelect||!e.eq(this.view.state.selection)||e.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:e,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function ep(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,s;i!=t.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(s=T.get(i))&&s.ignoreEvent(e))return!1;return!0}let em=Object.create(null),eg=Object.create(null),ev=K.ie&&K.ie_version<15||K.ios&&K.webkit_version<604;function ew(t,e){let{state:i}=t,s,o=1,n=i.toText(e),r=n.lines==i.selection.ranges.length;if(null!=eO&&i.selection.ranges.every(t=>t.empty)&&eO==n.toString()){let h=-1;s=i.changeByRange(t=>{let s=i.doc.lineAt(t.from);if(s.from==h)return{range:t};h=s.from;let a=i.toText((r?n.line(o++).text:e)+i.lineBreak);return{changes:{from:s.from,insert:a},range:l.jT.cursor(t.from+a.length)}})}else s=r?i.changeByRange(t=>{let e=n.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:l.jT.cursor(t.from+e.length)}}):i.replaceSelection(n);t.dispatch(s,{userEvent:"input.paste",scrollIntoView:!0})}function ey(t,e,i,s){if(1==s)return l.jT.cursor(e,i);if(2==s)return function(t,e,i=1){let s=t.charCategorizer(e),o=t.doc.lineAt(e),n=e-o.from;if(0==o.length)return l.jT.cursor(e);0==n?i=1:n==o.length&&(i=-1);let r=n,h=n;i<0?r=(0,l.cp)(o.text,n,!1):h=(0,l.cp)(o.text,n);let a=s(o.text.slice(r,h));for(;r>0;){let c=(0,l.cp)(o.text,r,!1);if(s(o.text.slice(c,r))!=a)break;r=c}for(;h{t.inputState.setSelectionOrigin("select"),27==e.keyCode?t.inputState.lastEscPress=Date.now():0>eu.indexOf(e.keyCode)&&(t.inputState.lastEscPress=0)},em.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},em.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},eg.touchstart=eg.touchmove={passive:!0},em.mousedown=(t,e)=>{let i,s,o,n,r;if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return;let h=null;for(let a of t.state.facet(tw))if(h=a(t,e))break;if(h||0!=e.button||(i=eS(t,e),s=eD(e),o=t.state.selection,n=i,r=e,h={update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),o=o.map(t.changes),r=null)},get(e,h,a){let c;r&&e.clientX==r.clientX&&e.clientY==r.clientY?c=n:(c=n=eS(t,e),r=e);let d=ey(t,c.pos,c.bias,s);if(i.pos!=c.pos&&!h){let u=ey(t,i.pos,i.bias,s),f=Math.min(u.from,d.from),p=Math.max(u.to,d.to);d=f1&&o.ranges.some(t=>t.eq(d))?function(t,e){for(let i=0;;i++)if(t.ranges[i].eq(e))return l.jT.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}(o,d):a?o.addRange(d):l.jT.create([d])}}),h){let c=t.root.activeElement!=t.contentDOM;c&&t.observer.ignore(()=>S(t.contentDOM)),t.inputState.startMouseSelection(new ef(t,e,h,c))}};let eb=(t,e)=>t>=e.top&&t<=e.bottom,ex=(t,e,i)=>eb(e,i)&&t>=i.left&&t<=i.right;function eS(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:function(t,e,i,s){let o=td.find(t.docView,e);if(!o)return 1;let n=e-o.posAtStart;if(0==n)return 1;if(n==o.length)return -1;let r=o.coordsAt(n,-1);if(r&&ex(i,s,r))return -1;let l=o.coordsAt(n,1);return l&&ex(i,s,l)?1:r&&eb(s,r)?-1:1}(t,i,e.clientX,e.clientY)}}let eM=K.ie&&K.ie_version<=11,ek=null,eC=0,eA=0;function eD(t){if(!eM)return t.detail;let e=ek,i=eA;return ek=t,eA=Date.now(),eC=!e||i>Date.now()-400&&2>Math.abs(e.clientX-t.clientX)&&2>Math.abs(e.clientY-t.clientY)?(eC+1)%3:1}function eT(t,e,i,s){if(!i)return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:n}=t.inputState,r=s&&n&&n.dragging&&n.dragMove?{from:n.dragging.from,to:n.dragging.to}:null,l={from:o,insert:i},h=t.state.changes(r?[r,l]:l);t.focus(),t.dispatch({changes:h,selection:{anchor:h.mapPos(o,-1),head:h.mapPos(o,1)},userEvent:r?"move.drop":"input.drop"})}em.dragstart=(t,e)=>{let{selection:{main:i}}=t.state,{mouseSelection:s}=t.inputState;s&&(s.dragging=i),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove")},em.drop=(t,e)=>{if(!e.dataTransfer)return;if(t.state.readOnly)return e.preventDefault();let i=e.dataTransfer.files;if(i&&i.length){e.preventDefault();let s=Array(i.length),o=0,n=()=>{++o==i.length&&eT(t,e,s.filter(t=>null!=t).join(t.state.lineBreak),!1)};for(let r=0;r{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(s[r]=l.result),n()},l.readAsText(i[r])}}else eT(t,e,e.dataTransfer.getData("Text"),!0)},em.paste=(t,e)=>{if(t.state.readOnly)return e.preventDefault();t.observer.flush();let i=ev?null:e.clipboardData;i?(ew(t,i.getData("text/plain")),e.preventDefault()):function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),ew(t,i.value)},50)}(t)};let eO=null;function eR(t){setTimeout(()=>{t.hasFocus!=t.inputState.notifiedFocused&&t.update([])},10)}em.copy=em.cut=(t,e)=>{let{text:i,ranges:s,linewise:o}=function(t){let e=[],i=[],s=!1;for(let o of t.selection.ranges)o.empty||(e.push(t.sliceDoc(o.from,o.to)),i.push(o));if(!e.length){let n=-1;for(let{from:r}of t.selection.ranges){let l=t.doc.lineAt(r);l.number>n&&(e.push(l.text),i.push({from:l.from,to:Math.min(t.doc.length,l.to+1)})),n=l.number}s=!0}return{text:e.join(t.lineBreak),ranges:i,linewise:s}}(t.state);if(!i&&!o)return;eO=o?i:null;let n=ev?null:e.clipboardData;n?(e.preventDefault(),n.clearData(),n.setData("text/plain",i)):function(t,e){let i=t.dom.parentNode;if(!i)return;let s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),t.focus()},50)}(t,i),"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"})},em.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),eR(t)},em.blur=t=>{t.observer.clearSelectionRange(),eR(t)},em.compositionstart=em.compositionupdate=t=>{null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)},em.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionFirstChange=null,K.chrome&&K.android&&t.observer.flushSoon(),setTimeout(()=>{t.inputState.composing<0&&t.docView.compositionDeco.size&&t.update([])},50)},em.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},em.beforeinput=(t,e)=>{var i;let s;if(K.chrome&&K.android&&(s=ec.find(t=>t.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),"Backspace"==s.key||"Delete"==s.key)){let o=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout(()=>{var e;((null===(e=window.visualViewport)||void 0===e?void 0:e.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}};let eE=["pre-wrap","normal","pre-line","break-spaces"];class eB{constructor(){this.doc=l.xv.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return eE.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,r=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=n;if(this.lineWrapping=n,this.lineHeight=e,this.charWidth=i,this.lineLength=s,r){this.heightSamples={};for(let l=0;l0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t,e){this.height!=e&&(Math.abs(this.height-e)>.001&&(t.heightChanged=!0),this.height=e)}replace(t,e,i){return eN.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let o=this;for(let n=s.length-1;n>=0;n--){let{fromA:r,toA:l,fromB:h,toB:a}=s[n],c=o.lineAt(r,eH.ByPosNoHeight,e,0,0),d=c.to>=l?c:o.lineAt(l,eH.ByPosNoHeight,e,0,0);for(a+=d.to-l,l=d.to;n>0&&c.from<=s[n-1].toA;)r=s[n-1].fromA,h=s[n-1].fromB,n--,r2*o){let n=t[e-1];n.break?t.splice(--e,1,n.left,null,n.right):t.splice(--e,1,n.left,n.right),i+=1+n.break,s-=n.size}else if(o>2*s){let r=t[i];r.break?t.splice(i,1,r.left,null,r.right):t.splice(i,1,r.left,r.right),i+=2+r.break,o-=r.size}else break}else if(s=o&&n(this.blockAt(0,i,s,o))}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setHeight(t,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class eW extends eP{constructor(t,e){super(t,e,to.Text),this.collapsed=0,this.widgetHeight=0}replace(t,e,i){let s=i[0];return 1==i.length&&(s instanceof eW||s instanceof ez&&4&s.flags)&&10>Math.abs(this.length-s.length)?(s instanceof ez?s=new eW(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):eN.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setHeight(t,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ez extends eN{constructor(t){super(t,0)}lines(t,e){let i=t.lineAt(e).number,s=t.lineAt(e+this.length).number;return{firstLine:i,lastLine:s,lineHeight:this.height/(s-i+1)}}blockAt(t,e,i,s){let{firstLine:o,lastLine:n,lineHeight:r}=this.lines(e,s),l=Math.max(0,Math.min(n-o,Math.floor((t-i)/r))),{from:h,length:a}=e.line(o+l);return new eV(h,a,i+r*l,r,to.Text)}lineAt(t,e,i,s,o){if(e==eH.ByHeight)return this.blockAt(t,i,s,o);if(e==eH.ByPosNoHeight){let{from:n,to:r}=i.lineAt(t);return new eV(n,r-n,0,0,to.Text)}let{firstLine:l,lineHeight:h}=this.lines(i,o),{from:a,length:c,number:d}=i.lineAt(t);return new eV(a,c,s+h*(d-l),h,to.Text)}forEachLine(t,e,i,s,o,n){let{firstLine:r,lineHeight:l}=this.lines(i,o);for(let h=Math.max(t,o),a=Math.min(o+this.length,e);h<=a;){let c=i.lineAt(h);h==t&&(s+=l*(c.number-r)),n(new eV(c.from,c.length,s,l,to.Text)),s+=l,h=c.to+1}}replace(t,e,i){let s=this.length-e;if(s>0){let o=i[i.length-1];o instanceof ez?i[i.length-1]=new ez(o.length+s):i.push(null,new ez(s-1))}if(t>0){let n=i[0];n instanceof ez?i[0]=new ez(t+n.length):i.unshift(new ez(t-1),null)}return eN.of(i)}decomposeLeft(t,e){e.push(new ez(t-1),null)}decomposeRight(t,e){e.push(null,new ez(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let o=e+this.length;if(s&&s.from<=e+this.length&&s.more){let n=[],r=Math.max(e,s.from),l=-1,h=t.heightChanged;for(s.from>e&&n.push(new ez(s.from-e-1).updateHeight(t,e));r<=o&&s.more;){let a=t.doc.lineAt(r).length;n.length&&n.push(null);let c=s.heights[s.index++];-1==l?l=c:Math.abs(c-l)>=.001&&(l=-2);let d=new eW(a,c);d.outdated=!1,n.push(d),r+=a+1}r<=o&&n.push(null,new ez(o-r).updateHeight(t,r));let u=eN.of(n);return t.heightChanged=h||l<0||Math.abs(u.height-this.height)>=.001||Math.abs(l-this.lines(t.doc,e).lineHeight)>=.001,u}return(i||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class eF extends eN{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,s){let o=i+this.left.height;return tr))return h;let a=e==eH.ByPosNoHeight?eH.ByPosNoHeight:eH.ByPos;return l?h.join(this.right.lineAt(r,a,i,n,r)):this.left.lineAt(r,a,i,s,o).join(h)}forEachLine(t,e,i,s,o,n){let r=s+this.left.height,l=o+this.left.length+this.break;if(this.break)t=l&&this.right.forEachLine(t,e,i,r,l,n);else{let h=this.lineAt(l,eH.ByPos,i,s,o);t=t&&h.from<=e&&n(h),e>h.to&&this.right.forEachLine(h.to+1,e,i,r,l,n)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let o=[];t>0&&this.decomposeLeft(t,o);let n=o.length;for(let r of i)o.push(r);if(t>0&&eI(o,n-1),e=++i&&e.push(null),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t2*e.size||e.size>2*t.size?eN.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)}updateHeight(t,e=0,i=!1,s){let{left:o,right:n}=this,r=e+o.length+this.break,l=null;return(s&&s.from<=e+o.length&&s.more?l=o=o.updateHeight(t,e,i,s):o.updateHeight(t,e,i),s&&s.from<=r+n.length&&s.more?l=n=n.updateHeight(t,r,i,s):n.updateHeight(t,r,i),l)?this.balanced(o,n):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function eI(t,e){let i,s;null==t[e]&&(i=t[e-1])instanceof ez&&(s=t[e+1])instanceof ez&&t.splice(e-1,3,new ez(i.length+1+s.length))}class eq{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof eW?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new eW(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(s,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new eW(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new ez(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof eW)return t;let e=new eW(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine(),t.type!=to.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=to.WidgetBefore&&(this.covering=t)}addLineDeco(t,e){let i=this.ensureLine();i.length+=e,i.collapsed+=e,i.widgetHeight=Math.max(i.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof eW||this.isCovered?(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&"visible"!=d.overflow){let u=c.getBoundingClientRect();n=Math.max(n,u.left),r=Math.min(r,u.right),l=Math.max(l,u.top),h=a==t.parentNode?u.bottom:Math.min(h,u.bottom)}a="absolute"==d.position||"fixed"==d.position?c.offsetParent:c.parentNode}else if(11==a.nodeType)a=a.host;else break;return{left:n-i.left,right:Math.max(n,r)-i.left,top:l-(i.top+e),bottom:Math.max(l,h)-(i.top+e)}}function e$(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class eG{constructor(t,e,i){this.from=t,this.to=e,this.size=i}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t),this.heightMap=eN.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle.setDoc(t.doc),[new tW(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=tn.set(this.lineGaps.map(t=>t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:t,to:e})=>s>=t&&s<=e)){let{from:o,to:n}=this.lineBlockAt(s);t.push(new eU(o,n))}}this.viewports=t.sort((t,e)=>t.from-e.from),this.scaler=this.heightMap.height<=7e6?eZ:new eJ(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,t=>{this.viewportLines.push(1==this.scaler.scale?t:e0(t,this.scaler))})}update(t,e=null){var i,s;let o;this.state=t.state;let n=this.stateDeco;this.stateDeco=this.state.facet(tV).filter(t=>"function"!=typeof t);let r=t.changedRanges,h=tW.extendWithRanges(r,(i=this.stateDeco,s=t?t.changes:l.as.empty(this.state.doc.length),o=new ej,l.Xs.compare(n,i,s,o,0),o.changes)),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),h),this.heightMap.height!=a&&(t.flags|=2);let c=h.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,e));let d=!t.changes.empty||2&t.flags||c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,this.updateForViewport(),d&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(tM)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?tF.RTL:tF.LTR;let n=this.heightOracle.mustRefreshForWrapping(o),r=n||this.mustMeasureContent||this.contentDOMHeight!=e.clientHeight;this.contentDOMHeight=e.clientHeight,this.mustMeasureContent=!1;let h=0,a=0,c=parseInt(i.paddingTop)||0,d=parseInt(i.paddingBottom)||0;(this.paddingTop!=c||this.paddingBottom!=d)&&(this.paddingTop=c,this.paddingBottom=d,h|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(r=!0),this.editorWidth=t.scrollDOM.clientWidth,h|=8);let u=(this.printing?e$:eK)(e,this.paddingTop),f=u.top-this.pixelViewport.top,p=u.bottom-this.pixelViewport.bottom;this.pixelViewport=u;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(r=!0)),!this.inView&&!this.scrollTarget)return 0;let g=e.clientWidth;if((this.contentDOMWidth!=g||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=g,this.editorHeight=t.scrollDOM.clientHeight,h|=8),r){let v=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(v)&&(n=!0),n||s.lineWrapping&&Math.abs(g-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:y}=t.docView.measureTextSize();(n=w>0&&s.refresh(o,w,y,g/y,v))&&(t.docView.minWidth=0,h|=8)}for(let b of(f>0&&p>0?a=Math.max(f,p):f<0&&p<0&&(a=Math.min(f,p)),s.heightChanged=!1,this.viewports)){let x=b.from==this.viewport.from?v:t.docView.measureVisibleLineHeights(b);this.heightMap=n?eN.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle,[new tW(0,0,0,t.state.doc.length)]):this.heightMap.updateHeight(s,0,n,new eL(b.from,x))}s.heightChanged&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,a)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(this.viewport=this.getViewport(a,this.scrollTarget)),this.updateForViewport(),(2&h||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(n?[]:this.lineGaps,t)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,o=this.state.doc,{visibleTop:n,visibleBottom:r}=this,l=new eU(s.lineAt(n-1e3*i,eH.ByHeight,o,0,0).from,s.lineAt(r+(1-i)*1e3,eH.ByHeight,o,0,0).to);if(e){let{head:h}=e.range;if(hl.to){let a=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=s.lineAt(h,eH.ByPos,o,0,0),d;d="center"==e.y?(c.top+c.bottom)/2-a/2:"start"==e.y||"nearest"==e.y&&h=r+Math.max(10,Math.min(i,250)))&&s>n-2e3&&o>1,n=s<<1;if(this.defaultTextDirection!=tF.LTR&&!i)return[];let r=[],h=(s,n,a,c)=>{if(n-ss&&ft.from>=a.from&&t.to<=a.to&&Math.abs(t.from-s)t.frome));if(!p){if(nt.from<=n&&t.to>=n)){let m=e.moveToLineBoundary(l.jT.cursor(n),!1,!0).head;m>s&&(n=m)}p=new eG(s,n,this.gapSize(a,s,n,c))}r.push(p)};for(let a of this.viewportLines){let c,d;if(a.lengtho&&(s.push({from:o,to:t}),n+=t-o),o=e}},20),oa.from&&h(a.from,c,a,u),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];l.Xs.spans(t,this.viewport.from,this.viewport.to,{span(t,i){e.push({from:t,to:i})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((t,i)=>t.from!=e[i].from||t.to!=e[i].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||e0(this.heightMap.lineAt(t,eH.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(t){return e0(this.heightMap.lineAt(this.scaler.fromDOM(t),eH.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(t){return e0(this.heightMap.blockAt(this.scaler.fromDOM(t),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class eU{constructor(t,e){this.from=t,this.to=e}}function eY({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let s=Math.floor(t*i);for(let o=0;;o++){let{from:n,to:r}=e[o],l=r-n;if(s<=l)return n+s;s-=l}}function eQ(t,e){let i=0;for(let{from:s,to:o}of t.ranges){if(e<=o){i+=e-s;break}i+=o-s}return i/t.total}let eZ={toDOM:t=>t,fromDOM:t=>t,scale:1};class eJ{constructor(t,e,i){let s=0,o=0,n=0;for(let r of(this.viewports=i.map(({from:i,to:o})=>{let n=e.lineAt(i,eH.ByPos,t,0,0).top,r=e.lineAt(o,eH.ByPos,t,0,0).bottom;return s+=r-n,{from:i,to:o,top:n,bottom:r,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s),this.viewports))r.domTop=n+(r.top-o)*this.scale,n=r.domBottom=r.domTop+(r.bottom-r.top),o=r.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let o=ee0(t,e)):t.type)}let e1=l.r$.define({combine:t=>t.join(" ")}),e2=l.r$.define({combine:t=>t.indexOf(!0)>-1}),e8=h.V.newName(),e3=h.V.newName(),e9=h.V.newName(),e5={"&light":"."+e3,"&dark":"."+e9};function e4(t,e,i){return new h.V(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,e=>{if("&"==e)return t;if(!i||!i[e])throw RangeError(`Unsupported selector: ${e}`);return i[e]}):t+" "+e})}let e6=e4("."+e8,{"&.cm-editor":{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,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&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%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&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"}},e5);class e7{constructor(t,e,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:o,impreciseAnchor:n}=t.docView;if(e>-1&&!t.state.readOnly&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let r=o||n?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:n}=t.observer.selectionRange;return i&&(e.push(new t3(i,s)),(o!=i||n!=s)&&e.push(new t3(o,n))),e}(t),h=new t2(r,t.state);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?l.jT.single(i+e,s+e):null}(r,this.bounds.from)}else{let a=t.observer.selectionRange,c=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!d(t.contentDOM,a.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(a.focusNode,a.focusOffset),u=n&&n.node==a.anchorNode&&n.offset==a.anchorOffset||!d(t.contentDOM,a.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(a.anchorNode,a.anchorOffset);this.newSel=l.jT.single(u,c)}}}function it(t,e){let i;let{newSel:s}=e,o=t.state.selection.main;if(e.bounds){let{from:n,to:r}=e.bounds,h=o.from,a=null;(8===t.inputState.lastKeyCode&&t.inputState.lastKeyTime>Date.now()-100||K.android&&e.text.length0&&l>0&&t.charCodeAt(r-1)==e.charCodeAt(l-1);)r--,l--;if("end"==s){let h=Math.max(0,n-Math.min(r,l));i-=r+h-n}if(r=r?n-i:0;n-=a,l=n+(l-r),r=n}else if(l=l?n-i:0;n-=c,r=n+(r-l),l=n}return{from:n,toA:r,toB:l}}(t.state.doc.sliceString(n,r,"￿"),e.text,h-n,a);c&&(K.chrome&&13==t.inputState.lastKeyCode&&c.toB==c.from+2&&"￿￿"==e.text.slice(c.from,c.toB)&&c.toB--,i={from:n+c.from,to:n+c.toA,insert:l.xv.of(e.text.slice(c.from,c.toB).split("￿"))})}else s&&(!t.hasFocus||!t.state.facet(tD)||s.main.eq(o))&&(s=null);if(!i&&!s)return!1;if(!i&&e.typeOver&&!o.empty&&s&&s.main.empty?i={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,o.to)}:i&&i.from>=o.from&&i.to<=o.to&&(i.from!=o.from||i.to!=o.to)&&o.to-o.from-(i.to-i.from)<=4?i={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,o.to))}:(K.mac||K.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())?(s&&2==i.insert.length&&(s=l.jT.single(s.main.anchor-1,s.main.head-1)),i={from:o.from,to:o.to,insert:l.xv.of([" "])}):K.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=l.jT.single(s.main.anchor-1,s.main.head-1)),i={from:o.from,to:o.to,insert:l.xv.of([" "])}),i){let d,u=t.state;if(K.ios&&t.inputState.flushIOSKey(t)||K.android&&(i.from==o.from&&i.to==o.to&&1==i.insert.length&&2==i.insert.lines&&k(t.contentDOM,"Enter",13)||i.from==o.from-1&&i.to==o.to&&0==i.insert.length&&k(t.contentDOM,"Backspace",8)||i.from==o.from&&i.to==o.to+1&&0==i.insert.length&&k(t.contentDOM,"Delete",46)))return!0;let f=i.insert.toString();if(t.state.facet(tx).some(e=>e(t,i.from,i.to,f)))return!0;if(t.inputState.composing>=0&&t.inputState.composing++,i.from>=o.from&&i.to<=o.to&&i.to-i.from>=(o.to-o.from)/3&&(!s||s.main.empty&&s.main.from==i.from+i.insert.length)&&t.inputState.composing<0){let p=o.fromi.to?u.sliceDoc(i.to,o.to):"";d=u.replaceSelection(t.state.toText(p+i.insert.sliceString(0,void 0,t.state.lineBreak)+m))}else{let g=u.changes(i),v=s&&!u.selection.main.eq(s.main)&&s.main.to<=g.newLength?s.main:void 0;if(u.selection.ranges.length>1&&t.inputState.composing>=0&&i.to<=o.to&&i.to>=o.to-10){let w=t.state.sliceDoc(i.from,i.to),y=t4(t)||t.state.doc.lineAt(o.head),b=o.to-i.to,x=o.to-o.from;d=u.changeByRange(e=>{if(e.from==o.from&&e.to==o.to)return{changes:g,range:v||e.map(g)};let s=e.to-b,n=s-w.length;if(e.to-e.from!=x||t.state.sliceDoc(n,s)!=w||y&&e.to>=y.from&&e.from<=y.to)return{range:e};let r=u.changes({from:n,to:s,insert:i.insert}),h=e.to-o.to;return{changes:r,range:v?l.jT.range(Math.max(0,v.anchor+h),Math.max(0,v.head+h)):e.map(r)}})}else d={changes:g,selection:v&&u.selection.replaceRange(v)}}let S="input.type";return t.composing&&(S+=".compose",t.inputState.compositionFirstChange&&(S+=".start",t.inputState.compositionFirstChange=!1)),t.dispatch(d,{scrollIntoView:!0,userEvent:S}),!0}if(!s||s.main.eq(o))return!1;{let M=!1,C="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(M=!0),C=t.inputState.lastSelectionOrigin),t.dispatch({selection:s,scrollIntoView:M,userEvent:C}),!0}}let ie={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ii=K.ie&&K.ie_version<=11;class is{constructor(t){this.view=t,this.active=!1,this.selectionRange=new b,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(K.ie&&K.ie_version<=11||K.ios&&t.composing)&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),ii&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver(()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runScrollHandlers(this.view,t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){for(let e of(this.gapIntersection.disconnect(),t))this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(tD)?i.root.activeElement!=this.dom:!u(i.dom,s))return;let o=s.anchorNode&&i.docView.nearest(s.anchorNode);if(o&&o.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(K.ie&&K.ie_version<=11||K.android&&K.chrome)&&!i.state.selection.main.empty&&s.focusNode&&p(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=K.safari&&11==t.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t){let e=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}if(t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),!e)return null;let s=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor);return p(l.node,l.offset,n,r)&&([s,o,n,r]=[n,r,s,o]),{anchorNode:s,anchorOffset:o,focusNode:n,focusOffset:r}}(this.view)||c(t.root);if(!e||this.selectionRange.eq(e))return!1;let i=u(this.dom,e);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;t&&(this.clearDelayedAndroidKey(),!this.flush()&&t.force&&k(this.dom,t.key,t.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let t=this.queue;for(let e of this.observer.takeRecords())t.push(e);t.length&&(this.queue=[]);let i=-1,s=-1,o=!1;for(let n of t){let r=this.readMutation(n);r&&(r.typeOver&&(o=!0),-1==i?{from:i,to:s}=r:(i=Math.min(r.from,i),s=Math.max(r.to,s)))}return{from:i,to:s,typeOver:o}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&u(this.dom,this.selectionRange);return t<0&&!s?null:(t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new e7(this.view,t,e,i))}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return!1;let i=this.view.state,s=it(this.view,e);return this.view.state==i&&this.view.update([]),s}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.dirty|=4),"childList"==t.type){let i=io(e,t.previousSibling||t.target.previousSibling,-1),s=io(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var t,e,i;for(let s of(this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resize)||void 0===i||i.disconnect(),this.scrollTargets))s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function io(t,e,i){for(;e;){let s=T.get(e);if(s&&s.parent==t)return s;let o=e.parentNode;e=o!=t.dom?o:i>0?e.nextSibling:e.previousSibling}return null}class ir{constructor(t={}){for(let e of(this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,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=t.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new e_(t.state||l.yy.create(t)),this.plugins=this.state.facet(tO).map(t=>new tE(t)),this.plugins))e.update(this);this.observer=new is(this),this.inputState=new ea(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new t9(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),t.parent&&t.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...t){this._dispatch(1==t.length&&t[0]instanceof l.YW?t[0]:this.state.update(...t))}update(t){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,s,o=this.state;for(let n of t){if(n.startState!=o)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=n.state}if(this.destroyed){this.viewState.state=o;return}let r=this.observer.delayedAndroidKey,h=null;if(r?(this.observer.clearDelayedAndroidKey(),((h=this.observer.readChange())&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(h=null)):this.observer.clear(),o.facet(l.yy.phrases)!=this.state.facet(l.yy.phrases))return this.setState(o);s=tz.create(this,o,t);let a=this.viewState.scrollTarget;try{for(let c of(this.updateState=2,t)){if(a&&(a=a.map(c.changes)),c.scrollIntoView){let{main:d}=c.state.selection;a=new tk(d.empty?d:l.jT.cursor(d.head,d.head>d.anchor?-1:1))}for(let u of c.effects)u.is(tC)&&(a=u.value)}this.viewState.update(s,a),this.bidiCache=ia.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),e=this.docView.update(s),this.state.facet(tP)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(t=>t.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(e1)!=s.state.facet(e1)&&(this.viewState.mustMeasureContent=!0),(e||i||a||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let f of this.state.facet(tb))f(s);h&&!it(this,h)&&r.force&&k(this.contentDOM,r.key,r.keyCode)}setState(t){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);for(let s of(this.viewState=new e_(t),this.plugins=t.facet(tO).map(t=>new tE(t)),this.pluginMap.clear(),this.plugins))s.update(this);this.docView=new t9(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(tO),i=t.state.facet(tO);if(e!=i){let s=[];for(let o of i){let n=e.indexOf(o);if(n<0)s.push(new tE(o));else{let r=this.plugins[n];r.mustUpdate=t,s.push(r)}}for(let l of this.plugins)l.mustUpdate!=t&&l.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let h of this.plugins)h.mustUpdate=t;for(let a=0;a-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,{scrollHeight:i,scrollTop:s,clientHeight:o}=this.scrollDOM,n=s>i-o-4?i:s;try{for(let r=0;;r++){this.updateState=1;let l=this.viewport,h=this.viewState.lineBlockAtHeight(n),a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(r>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];4&a||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(t=>{try{return t.read(this)}catch(e){return tA(this.state,e),ih}}),u=tz.create(this,this.state,[]),f=!1,p=!1;u.flags|=a,e?e.flags|=a:e=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),f=this.docView.update(u));for(let m=0;m1||w<-1)&&(this.scrollDOM.scrollTop+=w,p=!0)}}if(f&&this.docView.updateSelection(!0),this.viewport.from==l.from&&this.viewport.to==l.to&&!p&&0==this.measureRequests.length)break}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let y of this.state.facet(tb))y(e)}get themeClasses(){return e8+" "+(this.state.facet(e2)?e9:e3)+" "+this.state.facet(e1)}updateAttrs(){let t=ic(this,tB,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(tD)?"true":"false",class:"cm-content",style:`${K.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),ic(this,tL,e);let i=this.observer.ignore(()=>{let i=ti(this.contentDOM,this.contentAttrs,e),s=ti(this.dom,this.editorAttrs,t);return i||s});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let s of i.effects)s.is(ir.announce)&&(e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=s.value)}mountStyles(){this.styleModules=this.state.facet(tP),h.V.mount(this.root,this.styleModules.concat(e6).reverse())}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(null!=t.key){for(let e=0;ee.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return eh(this,t,el(this,t,e,i))}moveByGroup(t,e){return eh(this,t,el(this,t,e,e=>{var i;let s,o;return i=t.head,o=(s=this.state.charCategorizer(i))(e),t=>{let e=s(t);return o==l.D0.Space&&(o=e),o==e}}))}moveToLineBoundary(t,e,i=!0){return function(t,e,i,s){let o=t.state.doc.lineAt(e.head),n=s&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(n){let r=t.dom.getBoundingClientRect(),h=t.textDirectionAt(o.from),a=t.posAtCoords({x:i==(h==tF.LTR)?r.right-1:r.left+1,y:(n.top+n.bottom)/2});if(null!=a)return l.jT.cursor(a,i?-1:1)}let c=td.find(t.docView,e.head),d=c?i?c.posAtEnd:c.posAtStart:i?o.to:o.from;return l.jT.cursor(d,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return eh(this,t,function(t,e,i,s){let o=e.head,n=i?1:-1;if(o==(i?t.state.doc.length:0))return l.jT.cursor(o,e.assoc);let r=e.goalColumn,h,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(o),d=t.documentTop;if(c)null==r&&(r=c.left-a.left),h=n<0?c.top:c.bottom;else{let u=t.viewState.lineBlockAt(o);null==r&&(r=Math.min(a.right-a.left,t.defaultCharacterWidth*(o-u.from))),h=(n<0?u.top:u.bottom)+d}let f=a.left+r,p=null!=s?s:t.defaultLineHeight>>1;for(let m=0;;m+=10){let g=h+(p+m)*n,v=en(t,{x:f,y:g},!1,n);if(ga.bottom||(n<0?vo))return l.jT.cursor(v,e.assoc,void 0,r)}}(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),en(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(t),o=this.bidiSpans(s);return y(i,o[tZ.find(o,t-s.from,-1,e)].dir==tF.LTR==e>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(tS)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>il)return t0(t.length);let e=this.textDirectionAt(t.from);for(let i of this.bidiCache)if(i.from==t.from&&i.dir==e)return i.order;let s=function(t,e){let i=t.length,s=e==tI?1:2,o=e==tI?2:1;if(!t||1==s&&!tQ.test(t))return t0(i);for(let n=0,r=s,l=s;n=0;M-=3)if(tX[M+1]==-x){let k=tX[M+2],C=2&k?s:4&k?1&k?o:s:0;C&&(tJ[v]=tJ[tX[M]]=C),w=M;break}}else if(189==tX.length)break;else tX[w++]=v,tX[w++]=b,tX[w++]=y}else if(2==(S=tJ[v])||1==S){let A=S==s;y=A?0:1;for(let D=w-3;D>=0;D-=3){let T=tX[D+2];if(2&T)break;if(A)tX[D+2]|=2;else{if(4&T)break;tX[D+2]|=4}}}for(let O=0;ON;){let z=W,F=2!=tJ[--W];for(;W>N&&F==(2!=tJ[W-1]);)W--;V.push(new tZ(W,z,F?2:1))}else V.push(new tZ(N,H,0))}else for(let I=0;IDate.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{S(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return tC.of(new tk("number"==typeof t?l.jT.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}static domEventHandlers(t){return tR.define(()=>({}),{eventHandlers:t})}static theme(t,e){let i=h.V.newName(),s=[e1.of(i),tP.of(e4(`.${i}`,t))];return e&&e.dark&&s.push(e2.of(!0)),s}static baseTheme(t){return l.Wl.lowest(tP.of(e4("."+e8,t,e5)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&T.get(i)||T.get(t);return(null===(e=null==s?void 0:s.rootView)||void 0===e?void 0:e.view)||null}}ir.styleModule=tP,ir.inputHandler=tx,ir.perLineTextDirection=tS,ir.exceptionSink=ty,ir.updateListener=tb,ir.editable=tD,ir.mouseSelectionStyle=tw,ir.dragMovesSelection=tv,ir.clickAddsSelectionRange=tg,ir.decorations=tV,ir.atomicRanges=tH,ir.scrollMargins=tN,ir.darkTheme=e2,ir.contentAttributes=tL,ir.editorAttributes=tB,ir.lineWrapping=ir.contentAttributes.of({class:"cm-lineWrapping"}),ir.announce=l.Py.define();let il=4096,ih={};class ia{constructor(t,e,i,s){this.from=t,this.to=e,this.dir=i,this.order=s}static update(t,e){if(e.empty)return t;let i=[],s=t.length?t[t.length-1].dir:tF.LTR;for(let o=Math.max(0,t.length-10);o=0;o--){let n=s[o],r="function"==typeof n?n(t):n;r&&tt(r,i)}return i}let id=K.mac?"mac":K.windows?"win":K.linux?"linux":"key";function iu(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}let ip=l.Wl.default(ir.domEventHandlers({keydown:(t,e)=>ib(iv(e.state),t,e,"editor")})),im=l.r$.define({enables:ip}),ig=new WeakMap;function iv(t){let e=t.facet(im),i=ig.get(e);return i||ig.set(e,i=function(t,e=id){let i=Object.create(null),s=Object.create(null),o=(t,e)=>{let i=s[t];if(null==i)s[t]=e;else if(i!=e)throw Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},n=(t,s,n,r)=>{var l,h;let a=i[t]||(i[t]=Object.create(null)),c=s.split(/ (?!$)/).map(t=>(function(t,e){let i,s,o,n;let r=t.split(/-(?!$)/),l=r[r.length-1];"Space"==l&&(l=" ");for(let h=0;h{let i=iy={view:e,prefix:u,scope:t};return setTimeout(()=>{iy==i&&(iy=null)},4e3),!0}]})}let f=c.join(" ");o(f,!1);let p=a[f]||(a[f]={preventDefault:!1,run:(null===(h=null===(l=a._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});n&&p.run.push(n),r&&(p.preventDefault=!0)};for(let r of t){let l=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let h of l){let a=i[h]||(i[h]=Object.create(null));for(let c in a._any||(a._any={preventDefault:!1,run:[]}),a)a[c].run.push(r.any)}let d=r[e]||r.key;if(d)for(let u of l)n(u,d,r.run,r.preventDefault),r.shift&&n(u,"Shift-"+d,r.shift,r.preventDefault)}return i}(e.reduce((t,e)=>t.concat(e),[]))),i}function iw(t,e,i){return ib(iv(t.state),e,t,i)}let iy=null;function ib(t,e,i,s){let o=(0,a.YG)(e),n=(0,l.gm)(o,0),r=(0,l.nZ)(n)==o.length&&" "!=o,h="",c=!1;iy&&iy.view==i&&iy.scope==s&&(h=iy.prefix+" ",(c=0>eu.indexOf(e.keyCode))&&(iy=null));let d=new Set,u=t=>{if(t){for(let s of t.run)if(!d.has(s)&&(d.add(s),s(i,e)))return!0;t.preventDefault&&(c=!0)}return!1},f=t[s],p,m;if(f){if(u(f[h+iu(o,e,!r)]))return!0;if(r&&(e.shiftKey||e.altKey||e.metaKey||n>127)&&(p=a.ue[e.keyCode])&&p!=o){if(u(f[h+iu(p,e,!0)])||e.shiftKey&&(m=a.uY[e.keyCode])!=o&&m!=p&&u(f[h+iu(m,e,!1)]))return!0}else if(r&&e.shiftKey&&u(f[h+iu(o,e,!0)]))return!0;if(u(f._any))return!0}return c}let ix=!K.ios,iS=l.r$.define({combine:t=>(0,l.BO)(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function iM(t={}){return[iS.of(t),iC,iD,tM.of(!0)]}class ik{constructor(t,e,i,s,o){this.left=t,this.top=e,this.width=i,this.height=s,this.className=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}adjust(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"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}}let iC=tR.fromClass(class{constructor(t){this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(iS).cursorBlinkRate+"ms"}update(t){let e=t.startState.facet(iS)!=t.state.facet(iS);(e||t.selectionSet||t.geometryChanged||t.viewportChanged)&&this.view.requestMeasure(this.measureReq),t.transactions.some(t=>t.scrollIntoView)&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}readPos(){let{state:t}=this.view,e=t.facet(iS),i=t.selection.ranges.map(t=>t.empty?[]:function(t,e){if(e.to<=t.viewport.from||e.from>=t.viewport.to)return[];let i=Math.max(e.from,t.viewport.from),s=Math.min(e.to,t.viewport.to),o=t.textDirection==tF.LTR,n=t.contentDOM,r=n.getBoundingClientRect(),l=iT(t),h=window.getComputedStyle(n.firstChild),a=r.left+parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)),c=r.right-parseInt(h.paddingRight),d=iR(t,i),u=iR(t,s),f=d.type==to.Text?d:null,p=u.type==to.Text?u:null;if(t.lineWrapping&&(f&&(f=iO(t,i,f)),p&&(p=iO(t,s,p))),f&&p&&f.from==p.from)return y(b(e.from,e.to,f));{let m=f?b(e.from,null,f):x(d,!1),g=p?b(null,e.to,p):x(u,!0),v=[];return(f||d).to<(p||u).from-1?v.push(w(a,m.bottom,c,g.top)):m.bottomd&&f.from=m)break;y>p&&h(Math.max(w,p),null==e&&w<=d,Math.min(y,m),null==i&&y>=u,v.dir)}if((p=g.to+1)>=m)break}return 0==l.length&&h(d,null==e,u,null==i,t.textDirection),{top:n,bottom:r,horizontal:l}}function x(t,e){let i=r.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(this.view,t)).reduce((t,e)=>t.concat(e)),s=[];for(let o of t.selection.ranges){let n=o==t.selection.main;if(o.empty?!n||ix:e.drawRangeCursor){let r=function(t,e,i){let s=t.coordsAtPos(e.head,e.assoc||1);if(!s)return null;let o=iT(t);return new ik(s.left-o.left,s.top-o.top,-1,s.bottom-s.top,i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}(this.view,o,n);r&&s.push(r)}}return{rangePieces:i,cursors:s}}drawSel({rangePieces:t,cursors:e}){if(t.length!=this.rangePieces.length||t.some((t,e)=>!t.eq(this.rangePieces[e]))){for(let i of(this.selectionLayer.textContent="",t))this.selectionLayer.appendChild(i.draw());this.rangePieces=t}if(e.length!=this.cursors.length||e.some((t,e)=>!t.eq(this.cursors[e]))){let s=this.cursorLayer.children;if(s.length!==e.length)for(let o of(this.cursorLayer.textContent="",e))this.cursorLayer.appendChild(o.draw());else e.forEach((t,e)=>t.adjust(s[e]));this.cursors=e}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),iA={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ix&&(iA[".cm-line"].caretColor="transparent !important");let iD=l.Wl.highest(ir.theme(iA));function iT(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==tF.LTR?e.left:e.right-t.scrollDOM.clientWidth)-t.scrollDOM.scrollLeft,top:e.top-t.scrollDOM.scrollTop}}function iO(t,e,i){let s=l.jT.cursor(e);return{from:Math.max(i.from,t.moveToLineBoundary(s,!1,!0).from),to:Math.min(i.to,t.moveToLineBoundary(s,!0,!0).from),type:to.Text}}function iR(t,e){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){for(let s of i.type)if(s.to>e||s.to==e&&(s.to==i.to||s.type==to.Text))return s}return i}let iE=l.Py.define({map:(t,e)=>null==t?null:e.mapPos(t)}),iB=l.QQ.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce((t,e)=>e.is(iE)?e.value:t,t))}),iL=tR.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(iB);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(iB)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let t=this.view.state.field(iB),e=null!=t&&this.view.coordsAtPos(t);if(!e)return null;let i=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+this.view.scrollDOM.scrollLeft,top:e.top-i.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(t){this.cursor&&(t?(this.cursor.style.left=t.left+"px",this.cursor.style.top=t.top+"px",this.cursor.style.height=t.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(iB)!=t&&this.view.dispatch({effects:iE.of(t)})}},{eventHandlers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function iV(){return[iB,iL]}function iH(t,e,i,s,o){e.lastIndex=0;for(let n=t.iterRange(i,s),r=i,l;!n.next().done;r+=n.value.length)if(!n.lineBreak)for(;l=e.exec(n.value);)o(r+l.index,l)}class iN{constructor(t){let{regexp:e,decoration:i,decorate:s,boundary:o,maxLength:n=1e3}=t;if(!e.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(t,e,i,o)=>s(o,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,s,o)=>{let n=i(t,e,s);n&&o(s,s+t[0].length,n)};else if(i)this.addMatch=(t,e,s,o)=>o(s,s+t[0].length,i);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=n}createDeco(t){let e=new l.f_,i=e.add.bind(e);for(let{from:s,to:o}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let s=[];for(let{from:o,to:n}of i)o=Math.max(t.state.doc.lineAt(o).from,o-e),n=Math.min(t.state.doc.lineAt(n).to,n+e),s.length&&s[s.length-1].to>=o?s[s.length-1].to=n:s.push({from:o,to:n});return s}(t,this.maxLength))iH(t.state.doc,this.regexp,s,o,(e,s)=>this.addMatch(s,t,e,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return(t.docChanged&&t.changes.iterChanges((e,o,n,r)=>{r>t.view.viewport.from&&n1e3)?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let o of t.visibleRanges){let n=Math.max(o.from,i),r=Math.min(o.to,s);if(r>n){let l=t.state.doc.lineAt(n),h=l.tol.from;n--)if(this.boundary.test(l.text[n-1-l.from])){a=n;break}for(;rd.push(i.range(t,e));if(l==h)for(this.regexp.lastIndex=a-l.from;(u=this.regexp.exec(l.text))&&u.indexthis.addMatch(i,t,e,f));e=e.update({filterFrom:a,filterTo:c,filter:(t,e)=>tc,add:d})}}return e}}let iP=null!=/x/.unicode?"gu":"g",iW=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",iP),iz={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},iF=null,iI=l.r$.define({combine(t){let e=(0,l.BO)(t,{render:null,specialChars:iW,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==iF&&"undefined"!=typeof document&&document.body){let e=document.body.style;iF=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)!=null}return iF||!1}())&&(e.specialChars=RegExp(" |"+e.specialChars.source,iP)),e.addSpecialChars&&(e.specialChars=RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,iP)),e}});function iq(t={}){return[iI.of(t),ij||(ij=tR.fromClass(class{constructor(t){this.view=t,this.decorations=tn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(iI)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new iN({regexp:t.specialChars,decoration:(e,i,s)=>{let{doc:o}=i.state,n=(0,l.gm)(e[0],0);if(9==n){let r=o.lineAt(s),h=i.state.tabSize,a=(0,l.IS)(r.text,h,s-r.from);return tn.replace({widget:new i$((h-a%h)*this.view.defaultCharacterWidth)})}return this.decorationCache[n]||(this.decorationCache[n]=tn.replace({widget:new iK(t,n)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(iI);t.startState.facet(iI)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let ij=null;class iK extends ts{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){var e;let i=(e=this.code)>=32?"•":10==e?"␤":String.fromCharCode(9216+e),s=t.state.phrase("Control character")+" "+(iz[this.code]||"0x"+this.code.toString(16)),o=this.options.render&&this.options.render(this.code,s,i);if(o)return o;let n=document.createElement("span");return n.textContent=i,n.title=s,n.setAttribute("aria-label",s),n.className="cm-specialChar",n}ignoreEvent(){return!1}}class i$ extends ts{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function iG(){return i_}let iX=tn.line({class:"cm-activeLine"}),i_=tR.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let s of t.state.selection.ranges){let o=t.lineBlockAt(s.head);o.from>e&&(i.push(iX.range(o.from)),e=o.from)}return tn.set(i)}},{decorations:t=>t.decorations});class iU extends ts{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}ignoreEvent(){return!1}}function iY(t){return tR.fromClass(class{constructor(e){this.view=e,this.placeholder=tn.set([tn.widget({widget:new iU(t),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?tn.none:this.placeholder}},{decorations:t=>t.decorations})}function iQ(t,e){var i;let s,o=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(o),r=o-n.from,h=r>2e3?-1:r==n.length?(i=e.clientX,(s=t.coordsAtPos(t.viewport.from))?Math.round(Math.abs((s.left-i)/t.defaultCharacterWidth)):-1):(0,l.IS)(n.text,t.state.tabSize,o-n.from);return{line:n.number,col:h,off:r}}function iZ(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return ir.mouseSelectionStyle.of((t,i)=>{let s,o;return e(i)?(s=iQ(t,i),o=t.state.selection,s?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(s.line).from),i=t.state.doc.lineAt(e);s={line:i.number,col:s.col,off:Math.min(s.off,i.length)},o=o.map(t.changes)}},get(e,i,n){let r=iQ(t,e);if(!r)return o;let h=function(t,e,i){let s=Math.min(e.line,i.line),o=Math.max(e.line,i.line),n=[];if(e.off>2e3||i.off>2e3||e.col<0||i.col<0){let r=Math.min(e.off,i.off),h=Math.max(e.off,i.off);for(let a=s;a<=o;a++){let c=t.doc.line(a);c.length<=h&&n.push(l.jT.range(c.from+r,c.to+h))}}else{let d=Math.min(e.col,i.col),u=Math.max(e.col,i.col);for(let f=s;f<=o;f++){let p=t.doc.line(f),m=(0,l.Gz)(p.text,d,t.tabSize,!0);if(m<0)n.push(l.jT.cursor(p.to));else{let g=(0,l.Gz)(p.text,u,t.tabSize);n.push(l.jT.range(p.from+m,p.from+g))}}}return n}(t.state,s,r);return h.length?n?l.jT.create(h.concat(o.ranges)):l.jT.create(h):o}}:null):null})}let iJ={Alt:[18,t=>t.altKey],Control:[17,t=>t.ctrlKey],Shift:[16,t=>t.shiftKey],Meta:[91,t=>t.metaKey]},i0={style:"cursor: crosshair"};function i1(t={}){let[e,i]=iJ[t.key||"Alt"],s=tR.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventHandlers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){t.keyCode!=e&&i(t)||this.set(!1)},mousemove(t){this.set(i(t))}}});return[s,ir.contentAttributes.of(t=>{var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?i0:null})]}let i2="-10000px";class i8{constructor(t,e,i){this.facet=e,this.createTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter(t=>t),this.tooltipViews=this.tooltips.map(i)}update(t){var e;let i=t.state.facet(this.facet),s=i.filter(t=>t);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(t);return!1}let n=[];for(let r=0;rn.indexOf(u)&&(u.dom.remove(),null===(e=u.destroy)||void 0===e||e.call(u));return this.input=i,this.tooltips=s,this.tooltipViews=n,!0}}function i3(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}let i9=l.r$.define({combine(t){var e,i,s;return{position:K.ios?"absolute":(null===(e=t.find(t=>t.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(t=>t.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(t=>t.tooltipSpace))||void 0===s?void 0:s.tooltipSpace)||i3}}}),i5=tR.fromClass(class{constructor(t){this.view=t,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(i9);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new i8(t,i7,t=>this.createTooltip(t)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let t of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(t.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t);e&&this.observeIntersection();let i=e||t.geometryChanged,s=t.state.facet(i9);if(s.position!=this.position){for(let o of(this.position=s.position,this.manager.tooltipViews))o.dom.style.position=this.position;i=!0}if(s.parent!=this.parent){for(let n of(this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(n.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t){let e=t.create(this.view);if(e.dom.classList.add("cm-tooltip"),t.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",e.dom.appendChild(i)}return e.dom.style.position=this.position,e.dom.style.top=i2,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var t,e;for(let i of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))i.dom.remove(),null===(t=i.destroy)||void 0===t||t.call(i);null===(e=this.intersectionObserver)||void 0===e||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect();return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)}),size:this.manager.tooltipViews.map(({dom:t})=>t.getBoundingClientRect()),space:this.view.state.facet(i9).tooltipSpace(this.view)}}writeMeasure(t){let{editor:e,space:i}=t,s=[];for(let o=0;o=Math.min(e.bottom,i.bottom)||h.rightMath.min(e.right,i.right)+.1){l.style.top=i2;continue}let c=n.arrow?r.dom.querySelector(".cm-tooltip-arrow"):null,d=c?7:0,u=a.right-a.left,f=a.bottom-a.top,p=r.offset||i6,m=this.view.textDirection==tF.LTR,g=a.width>i.right-i.left?m?i.left:i.right-a.width:m?Math.min(h.left-(c?14:0)+p.x,i.right-u):Math.max(i.left,h.left-u+(c?14:0)-p.x),v=!!n.above;!n.strictSide&&(v?h.top-(a.bottom-a.top)-p.yi.bottom)&&v==i.bottom-h.bottom>h.top-i.top&&(v=!v);let w=v?h.top-f-d-p.y:h.bottom+d+p.y,y=g+u;if(!0!==r.overlap)for(let b of s)b.leftg&&b.topw&&(w=v?b.top-f-2-d:b.bottom+d+2);"absolute"==this.position?(l.style.top=w-t.parent.top+"px",l.style.left=g-t.parent.left+"px"):(l.style.top=w+"px",l.style.left=g+"px"),c&&(c.style.left=`${h.left+(m?p.x:-p.x)-(g+14-7)}px`),!0!==r.overlap&&s.push({left:g,top:w,right:y,bottom:w+f}),l.classList.toggle("cm-tooltip-above",v),l.classList.toggle("cm-tooltip-below",!v),r.positioned&&r.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=i2}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),i4=ir.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),i6={x:0,y:0},i7=l.r$.define({enables:[i5,i4]}),st=l.r$.define();class se{constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new i8(t,st,t=>this.createHostedView(t))}static create(t){return new se(t)}createHostedView(t){let e=t.create(this.view);return e.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(e.dom),this.mounted&&e.mount&&e.mount(this.view),e}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned()}update(t){this.manager.update(t)}}let si=i7.compute([st],t=>{let e=t.facet(st).filter(t=>t);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>null!=t.end).map(t=>t.end)),create:se.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class ss{constructor(t,e,i,s,o){this.view=t,this.source=e,this.field=i,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let t=Date.now()-this.lastMove.time;ti.bottom||t.xi.right+this.view.defaultCharacterWidth)return;let s=this.view.bidiSpans(this.view.state.doc.lineAt(e)).find(t=>t.from<=e&&t.to>=e),o=s&&s.dir==tF.RTL?-1:1,n=this.source(this.view,e,t.x{this.pending==r&&(this.pending=null,t&&this.view.dispatch({effects:this.setHover.of(t)}))},t=>tA(this.view.state,t,"hover tooltip"))}else n&&this.view.dispatch({effects:this.setHover.of(n)})}mousemove(t){var e;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!function(t){for(let e=t;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip"))return!0;return!1}(this.lastMove.target)||this.pending){let{pos:s}=i||this.pending,o=null!==(e=null==i?void 0:i.end)&&void 0!==e?e:s;(s==o?this.view.posAtCoords(this.lastMove)!=s:!function(t,e,i,s,o,n){let r=document.createRange(),l=t.domAtPos(e),h=t.domAtPos(i);r.setEnd(h.node,h.offset),r.setStart(l.node,l.offset);let a=r.getClientRects();r.detach();for(let c=0;c=Math.max(d.top-o,o-d.bottom,d.left-s,s-d.right))return!0}return!1}(this.view,s,o,t.clientX,t.clientY,0))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function so(t,e={}){let i=l.Py.define(),s=l.QQ.define({create:()=>null,update(t,s){if(t&&(e.hideOnChange&&(s.docChanged||s.selection)||e.hideOn&&e.hideOn(s,t)))return null;if(t&&s.docChanged){let o=s.changes.mapPos(t.pos,-1,l.gc.TrackDel);if(null==o)return null;let n=Object.assign(Object.create(null),t);n.pos=o,null!=t.end&&(n.end=s.changes.mapPos(t.end)),t=n}for(let r of s.effects)r.is(i)&&(t=r.value),r.is(sr)&&(t=null);return t},provide:t=>st.from(t)});return[s,tR.define(o=>new ss(o,t,s,i,e.hoverTime||300)),si]}function sn(t,e){let i=t.plugin(i5);if(!i)return null;let s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s]}let sr=l.Py.define(),sl=l.r$.define({combine(t){let e,i;for(let s of t)e=e||s.topContainer,i=i||s.bottomContainer;return{topContainer:e,bottomContainer:i}}});function sh(t,e){let i=t.plugin(sa),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null}let sa=tR.fromClass(class{constructor(t){this.input=t.state.facet(su),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(e=>e(t));let e=t.state.facet(sl);for(let i of(this.top=new sc(t,!0,e.topContainer),this.bottom=new sc(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top)),this.panels))i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(sl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new sc(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new sc(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(su);if(i!=this.input){let s=i.filter(t=>t),o=[],n=[],r=[],l=[];for(let h of s){let a=this.specs.indexOf(h),c;a<0?(c=h(t.view),l.push(c)):(c=this.panels[a]).update&&c.update(t),o.push(c),(c.top?n:r).push(c)}for(let d of(this.specs=s,this.panels=o,this.top.sync(n),this.bottom.sync(r),l))d.dom.classList.add("cm-panel"),d.mount&&d.mount()}else for(let u of this.panels)u.update&&u.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ir.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class sc{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&0>t.indexOf(e)&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=sd(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=sd(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function sd(t){let e=t.nextSibling;return t.remove(),e}let su=l.r$.define({enables:sa});class sf extends l.uU{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}sf.prototype.elementClass="",sf.prototype.toDOM=void 0,sf.prototype.mapMode=l.gc.TrackBefore,sf.prototype.startSide=sf.prototype.endSide=-1,sf.prototype.point=!0;let sp=l.r$.define(),sm={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>l.Xs.empty,lineMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},sg=l.r$.define();function sv(t){return[sy(),sg.of(Object.assign(Object.assign({},sm),t))]}let sw=l.r$.define({combine:t=>t.some(t=>t)});function sy(t){let e=[sb];return t&&!1===t.fixed&&e.push(sw.of(!0)),e}let sb=tR.fromClass(class{constructor(t){for(let e of(this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=t.state.facet(sg).map(e=>new sk(t,e)),this.gutters))this.dom.appendChild(e.dom);this.fixed=!t.state.facet(sw),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,s=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(s<(i.to-i.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(sw)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let i=l.Xs.iter(this.view.state.facet(sp),this.view.viewport.from),s=[],o=this.gutters.map(t=>new sM(t,this.view.viewport,-this.view.documentPadding.top));for(let n of this.view.viewportLineBlocks){let r;if(Array.isArray(n.type)){for(let h of n.type)if(h.type==to.Text){r=h;break}}else r=n.type==to.Text?n:void 0;if(r)for(let a of(s.length&&(s=[]),sS(i,s,n.from),o))a.line(this.view,r,s)}for(let c of o)c.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(sg),i=t.state.facet(sg),s=t.docChanged||t.heightChanged||t.viewportChanged||!l.Xs.eq(t.startState.facet(sp),t.state.facet(sp),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let o of this.gutters)o.update(t)&&(s=!0);else{s=!0;let n=[];for(let r of i){let h=e.indexOf(r);h<0?n.push(new sk(this.view,r)):(this.gutters[h].update(t),n.push(this.gutters[h]))}for(let a of this.gutters)a.dom.remove(),0>n.indexOf(a)&&a.destroy();for(let c of n)this.dom.appendChild(c.dom);this.gutters=n}return s}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>ir.scrollMargins.of(e=>{let i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==tF.LTR?{left:i.dom.offsetWidth}:{right:i.dom.offsetWidth}:null})});function sx(t){return Array.isArray(t)?t:[t]}function sS(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class sM{constructor(t,e,i){this.gutter=t,this.height=i,this.localMarkers=[],this.i=0,this.cursor=l.Xs.iter(t.markers,e.from)}line(t,e,i){this.localMarkers.length&&(this.localMarkers=[]),sS(this.cursor,this.localMarkers,e.from);let s=i.length?this.localMarkers.concat(i):this.localMarkers,o=this.gutter.config.lineMarker(t,e,s);o&&s.unshift(o);let n=this.gutter;if(0==s.length&&!n.config.renderEmptyElements)return;let r=e.top-this.height;if(this.i==n.elements.length){let l=new sC(t,e.height,r,s);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(t,e.height,r,s);this.height=e.bottom,this.i++}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class sk{constructor(t,e){for(let i in this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),e.domEventHandlers)this.dom.addEventListener(i,s=>{let o=t.lineBlockAtHeight(s.clientY-t.documentTop);e.domEventHandlers[i](t,o,s)&&s.preventDefault()});this.markers=sx(e.markers(t)),e.initialSpacer&&(this.spacer=new sC(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=sx(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let s=t.view.viewport;return!l.Xs.eq(this.markers,e,s.from,s.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class sC{constructor(t,e,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s)}update(t,e,i,s){this.height!=e&&(this.dom.style.height=(this.height=e)+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),!function(t,e){if(t.length!=e.length)return!1;for(let i=0;i(0,l.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let s in e){let o=i[s],n=e[s];i[s]=o?(t,e,i)=>o(t,e,i)||n(t,e,i):n}return i}})});class sT extends sf{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function sO(t,e){return t.state.facet(sD).formatNumber(e,t.state)}let sR=sg.compute([sD],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(sA),lineMarker:(t,e,i)=>i.some(t=>t.toDOM)?null:new sT(sO(t,t.state.doc.lineAt(e.from).number)),lineMarkerChange:t=>t.startState.facet(sD)!=t.state.facet(sD),initialSpacer:t=>new sT(sO(t,sB(t.state.doc.lines))),updateSpacer(t,e){let i=sO(e.view,sB(e.view.state.doc.lines));return i==t.number?t:new sT(i)},domEventHandlers:t.facet(sD).domEventHandlers}));function sE(t={}){return[sD.of(t),sy(),sR]}function sB(t){let e=9;for(;e{let e=[],i=-1;for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head).from;o>i&&(i=o,e.push(sL.range(o)))}return l.Xs.of(e)});function sH(){return sV}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5762],{47421:function(t,e,i){let s;i.d(e,{$1:function(){return iw},$f:function(){return im},AE:function(){return iq},Eu:function(){return sB},HQ:function(){return sN},Nm:function(){return tF},OO:function(){return tA},S2:function(){return i1},SJ:function(){return sp},Sd:function(){return sa},Uw:function(){return iM},W$:function(){return iY},ZO:function(){return iG},Zs:function(){return iZ},bF:function(){return sn},gB:function(){return sr},hJ:function(){return i7},l9:function(){return ts},lg:function(){return tR},mH:function(){return sf},p:function(){return tn},qr:function(){return iV},tk:function(){return ir},v5:function(){return sw}});var o,n,r,l=i(78120),h=i(28699),a=i(33952);function c(t){return(11==t.nodeType?t.getSelection?t:t.ownerDocument:t).getSelection()}function d(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function u(t,e){if(!e.anchorNode)return!1;try{return d(t,e.anchorNode)}catch(i){return!1}}function f(t){return 3==t.nodeType?M(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function p(t,e,i,s){return!!i&&(g(t,e,i,s,-1)||g(t,e,i,s,1))}function m(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function g(t,e,i,s,o){for(;;){if(t==i&&e==s)return!0;if(e==(o<0?0:v(t))){if("DIV"==t.nodeName)return!1;let n=t.parentNode;if(!n||1!=n.nodeType)return!1;e=m(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType||1==(t=t.childNodes[e+(o<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=o<0?v(t):0}}}function v(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}let w={left:0,right:0,top:0,bottom:0};function y(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}class b{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){this.set(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let x=null;function S(t){if(t.setActive)return t.setActive();if(x)return t.focus(x);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==x?{get preventScroll(){return x={preventScroll:!0},!0}}:void 0),!x){x=!1;for(let s=0;se)return c.domBoundsAround(t,e,h);if(d>=t&&-1==s&&(s=l,o=h),h>e&&c.dom.parentNode==this.dom){n=l,r=a;break}a=d,h=d+c.breakAfter}return{from:o,to:r<0?i+this.length:r,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:n=0?this.children[n].dom:null}}markDirty(t=!1){this.dirty|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.dirty|=2),1&e.dirty)return;e.dirty|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}setDOM(t){this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=D){this.markDirty();for(let s=t;sthis.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function E(t,e,i,s,o,n,r,l,h){let{children:a}=t,c=a.length?a[e]:null,d=n.length?n[n.length-1]:null,u=d?d.breakAfter:r;if(!(e==s&&c&&!r&&!u&&n.length<2&&c.merge(i,o,n.length?d:null,0==i,l,h))){if(s0&&(!r&&n.length&&c.merge(i,c.length,n[0],!1,l,0)?c.breakAfter=n.shift().breakAfter:(i2);var K={mac:j||/Mac/.test(L.platform),windows:/Win/.test(L.platform),linux:/Linux|X11/.test(L.platform),ie:W,ie_version:N?V.documentMode||6:P?+P[1]:H?+H[1]:0,gecko:z,gecko_version:z?+(/Firefox\/(\d+)/.exec(L.userAgent)||[0,0])[1]:0,chrome:!!F,chrome_version:F?+F[1]:0,ios:j,android:/Android\b/.test(L.userAgent),webkit:I,safari:q,webkit_version:I?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=V.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class $ extends T{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return(!i||i instanceof $&&!(this.length-(e-t)+i.length>256))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new $(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new A(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return X(this.dom,t,e)}}class G extends T{constructor(t,e=[],i=0){for(let s of(super(),this.mark=t,this.children=e,this.length=i,e))s.setParent(this)}setAttrs(t){if(C(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.dirty|=6)}sync(t){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t)}merge(t,e,i,s,o,n){return(!i||!!(i instanceof G&&i.mark.eq(this.mark))&&(!t||!(o<=0))&&(!(et&&e.push(i=t&&(s=o),i=r,o++}let l=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new G(this.mark,e,l)}domAtPos(t){return Z(this,t)}coordsAt(t,e){return J(this,t,e)}}function X(t,e,i){let s=t.nodeValue.length;e>s&&(e=s);let o=e,n=e,r=0;0==e&&i<0||e==s&&i>=0?!(K.chrome||K.gecko)&&(e?(o--,r=1):n=0)?0:l.length-1];return K.safari&&!r&&0==h.width&&(h=Array.prototype.find.call(l,t=>t.width)||h),r?y(h,r<0):h||null}class _ extends T{constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}static create(t,e,i){return new(t.customView||_)(t,e,i)}split(t){let e=_.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(t,e,i,s,o,n){return(!i||i instanceof _&&!!this.widget.compare(i.widget)&&(!(t>0)||!(o<=0))&&(!(e0?i.length-1:0;s=i[o],t>0?0!=o:o!=i.length-1&&!(s.top0?-1:1);return this.length?s:y(s,this.side>0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class U extends _{domAtPos(t){let{topView:e,text:i}=this.widget;return e?Y(t,0,e,i,(t,e)=>t.domAtPos(e),t=>new A(i,Math.min(t,i.nodeValue.length))):new A(i,Math.min(t,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(t,e){let{topView:i,text:s}=this.widget;return i?function t(e,i,s,o){if(s instanceof G)for(let n of s.children){let r=0,l=d(n.dom,o);if(d(n.dom,e))return r+(l?t(e,i,n,o):n.localPosFromDOM(e,i));r+=l?o.nodeValue.length:n.length}else if(s.dom==o)return Math.min(i,o.nodeValue.length);return s.localPosFromDOM(e,i)}(t,e,i,s):Math.min(e,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(t,e){let{topView:i,text:s}=this.widget;return i?Y(t,e,i,s,(t,e,i)=>t.coordsAt(e,i),(t,e)=>X(s,t,e)):X(s,t,e)}destroy(){var t;super.destroy(),null===(t=this.widget.topView)||void 0===t||t.destroy()}get isEditable(){return!0}canReuseDOM(){return!0}}function Y(t,e,i,s,o,n){if(i instanceof G){for(let r=i.dom.firstChild;r;r=r.nextSibling){let l=T.get(r);if(!l)return n(t,e);let h=d(r,s),a=l.length+(h?s.nodeValue.length:0);if(t=l.getSide())return h?Y(t,e,l,s,o,n):o(l,t,e);t-=a}return o(i,i.length,-1)}return i.dom==s?n(t,e):o(i,t,e)}class Q extends T{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof Q&&t.side==this.side}split(){return new Q(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return A.before(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){let e=this.dom.getBoundingClientRect(),i=function(t,e){let i=t.parent,s=i?i.children.indexOf(t):-1;for(;i&&s>=0;)if(e<0?s>0:s0?-1:1);return i&&i.tope.top?{left:e.left,right:e.right,top:i.top,bottom:i.bottom}:e}get overrideDOMText(){return l.xv.empty}}function Z(t,e){let i=t.dom,{children:s}=t,o=0;for(let n=0;o=r.getSide())){if(e>n&&e0;h--){let a=s[h-1];if(a.dom.parentNode==i)return a.domAtPos(a.length)}for(let c=o;c=i&&(a.children.length?t(a,i-h):!n&&(c>i||h==c&&a.getSide()>0)?(n=a,r=i-h):(ha.getSide())&&(s=a,o=i-h)),h=c}}(t,e);let l=(i<0?s:n)||s||n;return l?l.coordsAt(Math.max(0,l==s?o:r),i):function(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=f(e);return i[i.length-1]||null}(t)}function tt(t,e){for(let i in t)"class"==i&&e.class?e.class+=" "+t.class:"style"==i&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}function te(t,e){if(t==e)return!0;if(!t||!e)return!1;let i=Object.keys(t),s=Object.keys(e);if(i.length!=s.length)return!1;for(let o of i)if(-1==s.indexOf(o)||t[o]!==e[o])return!1;return!0}function ti(t,e,i){let s=null;if(e)for(let o in e)i&&o in i||t.removeAttribute(s=o);if(i)for(let n in i)e&&e[n]==i[n]||t.setAttribute(s=n,i[n]);return!!s}$.prototype.children=_.prototype.children=Q.prototype.children=D;class ts{eq(t){return!1}updateDOM(t){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return -1}ignoreEvent(t){return!0}get customView(){return null}destroy(t){}}var to=((o=to||(to={}))[o.Text=0]="Text",o[o.WidgetBefore=1]="WidgetBefore",o[o.WidgetAfter=2]="WidgetAfter",o[o.WidgetRange=3]="WidgetRange",o);class tn extends l.uU{constructor(t,e,i,s){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(t){return new tr(t)}static widget(t){let e=t.side||0,i=!!t.block;return e+=i?e>0?3e8:-4e8:e>0?1e8:-1e8,new th(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap)i=-5e8,s=4e8;else{let{start:o,end:n}=ta(t,e);i=(o?e?-3e8:-1:5e8)-1,s=(n?e?2e8:1:-6e8)+1}return new th(t,i,s,e,t.widget||null,!0)}static line(t){return new tl(t)}static set(t,e=!1){return l.Xs.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}tn.none=l.Xs.empty;class tr extends tn{constructor(t){let{start:e,end:i}=ta(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){return this==t||t instanceof tr&&this.tagName==t.tagName&&this.class==t.class&&te(this.attrs,t.attrs)}range(t,e=t){if(t>=e)throw RangeError("Mark decorations may not be empty");return super.range(t,e)}}tr.prototype.point=!1;class tl extends tn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof tl&&te(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}tl.prototype.mapMode=l.gc.TrackBefore,tl.prototype.point=!0;class th extends tn{constructor(t,e,i,s,o,n){super(e,i,o,t),this.block=s,this.isReplace=n,this.mapMode=s?e<=0?l.gc.TrackBefore:l.gc.TrackAfter:l.gc.TrackDel}get type(){return this.startSide=5}eq(t){var e,i;return t instanceof th&&((e=this.widget)==(i=t.widget)||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function ta(t,e=!1){let{inclusiveStart:i,inclusiveEnd:s}=t;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e}}function tc(t,e,i,s=0){let o=i.length-1;o>=0&&i[o]+s>=t?i[o]=Math.max(i[o],e):i.push(t,e)}th.prototype.point=!0;class td extends T{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,s,o,n){if(i){if(!(i instanceof td))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),B(this,t,e,i?i.children:[],o,n),!0}split(t){let e=new td;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:s}=this.childPos(t);s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let o=i;o0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){te(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){!function t(e,i,s){let o,{children:n}=e;s>0&&i instanceof G&&n.length&&(o=n[n.length-1])instanceof G&&o.mark.eq(i.mark)?t(o,i.children[0],s-1):(n.push(i),i.setParent(e)),e.length+=i.length}(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=tt(e,this.attrs||{})),i&&(this.attrs=tt({class:i},this.attrs||{}))}domAtPos(t){return Z(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.dirty|=6)}sync(t){var e;this.dom?4&this.dirty&&(C(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ti(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t);let i=this.dom.lastChild;for(;i&&T.get(i) instanceof G;)i=i.lastChild;if(!i||!this.length||"BR"!=i.nodeName&&(null===(e=T.get(i))||void 0===e?void 0:e.isEditable)==!1&&(!K.ios||!this.children.some(t=>t instanceof $))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t=0;for(let e of this.children){if(!(e instanceof $)||/[^ -~]/.test(e.text))return null;let i=f(e.dom);if(1!=i.length)return null;t+=i[0].width}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}:null}coordsAt(t,e){return J(this,t,e)}become(t){return!1}get type(){return to.Text}static find(t,e){for(let i=0,s=0;i=e){if(o instanceof td)return o;if(n>e)break}s=n+o.breakAfter}return null}}class tu extends T{constructor(t,e,i){super(),this.widget=t,this.length=e,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,s,o,n){return(!i||i instanceof tu&&!!this.widget.compare(i.widget)&&(!(t>0)||!(o<=0))&&(!(e0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw 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.flushBuffer([]),this.curLine=null,t--;continue}this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(0,i)),this.getLine().append(tp(new $(this.text.slice(this.textOff,this.textOff+r)),e),i),this.atCursorPos=!0,this.textOff+=r,t-=r,i=0}}span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s)}point(t,e,i,s,o,n){if(this.disallowBlockEffectsFor[n]&&i instanceof th){if(i.block)throw RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}let r=e-t;if(i instanceof th){if(i.block){let{type:l}=i;l!=to.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new tu(i.widget||new tm("div"),r,l))}else{let h=_.create(i.widget||new tm("span"),r,r?0:i.startSide),a=this.atCursorPos&&!h.isEditable&&o<=s.length&&(t0),c=!h.isEditable&&(tt.some(t=>t)}),tM=l.r$.define({combine:t=>t.some(t=>t)});class tk{constructor(t,e="nearest",i="nearest",s=5,o=5){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=o}map(t){return t.empty?this:new tk(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin)}}let tC=l.Py.define({map:(t,e)=>t.map(e)});function tA(t,e,i){let s=t.facet(ty);s.length?s[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e)}let tD=l.r$.define({combine:t=>!t.length||t[0]}),tT=0,tO=l.r$.define();class tR{constructor(t,e,i,s){this.id=t,this.create=e,this.domEventHandlers=i,this.extension=s(this)}static define(t,e){let{eventHandlers:i,provide:s,decorations:o}=e||{};return new tR(tT++,t,i,t=>{let e=[tO.of(t)];return o&&e.push(tV.of(e=>{let i=e.plugin(t);return i?o(i):tn.none})),s&&e.push(s(t)),e})}static fromClass(t,e){return tR.define(e=>new t(e),e)}}class tE{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(s){if(tA(e.state,s,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(o){tA(t.state,o,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(i){tA(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let tB=l.r$.define(),tL=l.r$.define(),tV=l.r$.define(),tH=l.r$.define(),tN=l.r$.define(),tP=l.r$.define();class tW{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new tW(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toAa)break;o+=2}if(!l)return i;new tW(l.fromA,l.toA,l.fromB,l.toB).addToSet(i),n=l.toA,r=l.toB}}}class tz{constructor(t,e,i){for(let s of(this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=l.as.empty(this.startState.doc.length),i))this.changes=this.changes.compose(s.changes);let o=[];this.changes.iterChangedRanges((t,e,i,s)=>o.push(new tW(t,e,i,s))),this.changedRanges=o;let n=t.hasFocus;n!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=n,this.flags|=1)}static create(t,e,i){return new tz(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}var tF=((n=tF||(tF={}))[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n);let tI=tF.LTR,tq=tF.RTL;function tj(t){let e=[];for(let i=0;i=e){if(r.level==i)return n;(o<0||(0!=s?s<0?r.frome:t[o].level>r.level))&&(o=n)}}if(o<0)throw RangeError("Index out of range");return o}}let tJ=[];function t0(t){return[new tZ(0,t,0)]}let t1="";class t2{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(l.yy.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+="￿"}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s),this.readNode(s);let o=s.nextSibling;if(o==e)break;let n=T.get(s),r=T.get(o);(n&&r?n.breakAfter:(n?n.breakAfter:t8(s))||t8(o)&&("BR"!=s.nodeName||s.cmIgnore))&&this.lineBreak(),s=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let s=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let n=-1,r=1,l;if(this.lineSeparator?(n=e.indexOf(this.lineSeparator,s),r=this.lineSeparator.length):(l=o.exec(e))&&(n=l.index,r=l[0].length),this.append(e.slice(s,n<0?e.length:n)),n<0)break;if(this.lineBreak(),r>1)for(let h of this.points)h.node==t&&h.pos>this.text.length&&(h.pos-=r-1);s=n+r}}readNode(t){if(t.cmIgnore)return;let e=T.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+Math.min(e,i.offset))}}function t8(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class t3{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class t9 extends T{constructor(t){super(),this.view=t,this.compositionDeco=tn.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new td],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new tW(0,0,0,t.state.doc.length)],0)}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(t){var e,i,s;let o,n=t.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:t,toA:e})=>ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=tn.none:(t.transactions.length||this.dirty)&&(this.compositionDeco=function(t,e){let i=t4(t);if(!i)return tn.none;let{from:s,to:o,node:n,text:r}=i,l=e.mapPos(s,1),h=Math.max(l,e.mapPos(o,-1)),{state:a}=t,c=3==n.nodeType?n.nodeValue:new t2([],a).readRange(n.firstChild,null).text;if(h-l{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=K.chrome||K.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(t),this.dirty=0,t&&(t.written||i.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?t[s]:null;if(!o)break;let{fromA:n,toA:r,fromB:l,toB:h}=o,{content:a,breakAtStart:c,openStart:d,openEnd:u}=tf.build(this.view.state.doc,l,h,this.decorations,this.dynamicDecorationMap),{i:f,off:p}=i.findPos(r,1),{i:m,off:g}=i.findPos(n,-1);E(this,m,g,f,p,a,c,d,u)}}updateSelection(t=!1,e=!1){var i;if((t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(e||this.mayControlSelection()))return;let s=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,n=this.domAtPos(o.anchor),r=o.empty?n:this.domAtPos(o.head);if(K.gecko&&o.empty&&1==(i=n).node.nodeType&&i.node.firstChild&&(0==i.offset||"false"==i.node.childNodes[i.offset-1].contentEditable)&&(i.offset==i.node.childNodes.length||"false"==i.node.childNodes[i.offset].contentEditable)){let l=document.createTextNode("");this.view.observer.ignore(()=>n.node.insertBefore(l,n.node.childNodes[n.offset]||null)),n=r=new A(l,0),s=!0}let h=this.view.observer.selectionRange;!s&&h.focusNode&&p(n.node,n.offset,h.anchorNode,h.anchorOffset)&&p(r.node,r.offset,h.focusNode,h.focusOffset)||(this.view.observer.ignore(()=>{K.android&&K.chrome&&this.dom.contains(h.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=c(this.view.root);if(t){if(o.empty){if(K.gecko){var e,i;let s=(e=n.node,i=n.offset,1!=e.nodeType?0:(i&&"false"==e.childNodes[i-1].contentEditable?1:0)|(io.head&&([n,r]=[r,n]),d.setEnd(r.node,r.offset),d.setStart(n.node,n.offset),t.removeAllRanges(),t.addRange(d)}}}),this.view.observer.setSelectionRange(n,r)),this.impreciseAnchor=n.precise?null:new A(h.anchorNode,h.anchorOffset),this.impreciseHead=r.precise?null:new A(h.focusNode,h.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:t}=this,e=t.state.selection.main,i=c(t.root),{anchorNode:s,anchorOffset:o}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let n=td.find(this,e.head);if(!n)return;let r=n.posAtStart;if(e.head==r||e.head==r+n.length)return;let l=this.coordsAt(e.head,-1),h=this.coordsAt(e.head,1);if(!l||!h||l.bottom>h.top)return;let a=this.domAtPos(e.head+e.assoc);i.collapse(a.node,a.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let d=t.observer.selectionRange;t.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=e.from&&i.collapse(s,o)}mayControlSelection(){let t=this.view.root.activeElement;return t==this.dom||u(this.dom,this.view.observer.selectionRange)&&!(t&&this.dom.contains(t))}nearest(t){for(let e=t;e;){let i=T.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;en||t==n&&o.type!=to.WidgetBefore&&o.type!=to.WidgetAfter&&(!s||2==e||this.children[s-1].breakAfter||this.children[s-1].type==to.WidgetBefore&&e>-2))return o.coordsAt(t-n,e);i=n}}measureVisibleLineHeights(t){let e=[],{from:i,to:s}=t,o=this.view.contentDOM.clientWidth,n=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,r=-1,l=this.view.textDirection==tF.LTR;for(let h=0,a=0;as)break;if(h>=i){let u=c.dom.getBoundingClientRect();if(e.push(u.height),n){let p=c.dom.lastChild,m=p?f(p):[];if(m.length){let g=m[m.length-1],v=l?g.right-u.left:u.right-g.left;v>r&&(r=v,this.minWidth=o,this.minWidthFrom=h,this.minWidthTo=d)}}}h=d+c.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?tF.RTL:tF.LTR}measureTextSize(){for(let t of this.children)if(t instanceof td){let e=t.measureTextSize();if(e)return e}let i=document.createElement("div"),s,o;return i.className="cm-line",i.style.width="99999px",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(i);let t=f(i.firstChild)[0];s=i.getBoundingClientRect().height,o=t?t.width/27:7,i.remove()}),{lineHeight:s,charWidth:o}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new R(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let o=s==e.viewports.length?null:e.viewports[s],n=o?o.from-1:this.length;if(n>i){let r=e.lineBlockAt(n).bottom-e.lineBlockAt(i).top;t.push(tn.replace({widget:new t5(r),block:!0,inclusive:!0,isBlockGap:!0}).range(i,n))}if(!o)break;i=o.to+1}return tn.set(t)}updateDeco(){let t=this.view.state.facet(tV).map((t,e)=>(this.dynamicDecorationMap[e]="function"==typeof t)?t(this.view):t);for(let e=t.length;ee.anchor?-1:1),s;if(!i)return;!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=0,n=0,r=0,l=0;for(let h of this.view.state.facet(tN).map(t=>t(this.view)))if(h){let{left:a,right:c,top:d,bottom:u}=h;null!=a&&(o=Math.max(o,a)),null!=c&&(n=Math.max(n,c)),null!=d&&(r=Math.max(r,d)),null!=u&&(l=Math.max(l,u))}let f={left:i.left-o,top:i.top-r,right:i.right+n,bottom:i.bottom+l};!function(t,e,i,s,o,n,r,l){let h=t.ownerDocument,a=h.defaultView||window;for(let c=t;c;)if(1==c.nodeType){let d,u=c==h.body;if(u)d={left:0,right:a.innerWidth,top:0,bottom:a.innerHeight};else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let f=c.getBoundingClientRect();d={left:f.left,right:f.left+c.clientWidth,top:f.top,bottom:f.top+c.clientHeight}}let p=0,m=0;if("nearest"==o)e.top0&&e.bottom>d.bottom+m&&(m=e.bottom-d.bottom+m+r)):e.bottom>d.bottom&&(m=e.bottom-d.bottom+r,i<0&&e.top-m0&&e.right>d.right+p&&(p=e.right-d.right+p+n)):e.right>d.right&&(p=e.right-d.right+n,i<0&&e.leftMath.abs(w-p)&&(s="nearest"),y&&1>Math.abs(y-m)&&(o="nearest")}}if(u)break;c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,f,e.head0&&i<=0)e=v(t=t.childNodes[e-1]);else{if(1!=t.nodeType||!(e=0))return null;t=t.childNodes[e],e=0}}}class et{constructor(){this.changes=[]}compareRange(t,e){tc(t,e,this.changes)}comparePoint(t,e){tc(t,e,this.changes)}}function ee(t,e){return t.tope.top+1}function ei(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function eo(t,e,i){let s=t.nodeValue.length,o=-1,n=1e9,r=0;for(let l=0;li?c.top-i:i-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&d=(c.left+c.right)/2,f=u;if((K.chrome||K.gecko)&&M(t,l).getBoundingClientRect().left==c.right&&(f=!u),d<=0)return{node:t,offset:l+(f?1:0)};o=l+(f?1:0),n=d}}}return{node:t,offset:o>-1?o:r>0?t.nodeValue.length:0}}function en(t,{x:e,y:i},s,o=-1){var n;let r=t.contentDOM.getBoundingClientRect(),l=r.top+t.viewState.paddingTop,h,{docHeight:a}=t.viewState,c=i-l;if(c<0)return 0;if(c>a)return t.state.doc.length;for(let d=t.defaultLineHeight/2,u=!1;(h=t.elementAtHeight(c)).type!=to.Text;)for(;!((c=o>0?h.bottom+d:h.top-d)>=0)||!(c<=a);){if(u)return s?null:0;u=!0,o=-o}i=l+c;let p=h.from;if(pt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:s?null:er(t,r,h,e,i);let m=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:m,v=g.elementFromPoint(e,i);v&&!t.contentDOM.contains(v)&&(v=null),!v&&(e=Math.max(r.left+1,Math.min(r.right-1,e)),(v=g.elementFromPoint(e,i))&&!t.contentDOM.contains(v)&&(v=null));let w,y=-1;if(v&&(null===(n=t.docView.nearest(v))||void 0===n?void 0:n.isEditable)!=!1){if(m.caretPositionFromPoint){let b=m.caretPositionFromPoint(e,i);b&&({offsetNode:w,offset:y}=b)}else if(m.caretRangeFromPoint){let x=m.caretRangeFromPoint(e,i);x&&({startContainer:w,startOffset:y}=x,(!t.contentDOM.contains(w)||K.safari&&function(t,e,i){let s;if(3!=t.nodeType||e!=(s=t.nodeValue.length))return!1;for(let o=t.nextSibling;o;o=o.nextSibling)if(1!=o.nodeType||"BR"!=o.nodeName)return!1;return M(t,s-1,s).getBoundingClientRect().left>i}(w,y,e)||K.chrome&&function(t,e,i){if(0!=e)return!1;for(let s=t;;){let o=s.parentNode;if(!o||1!=o.nodeType||o.firstChild!=s)return!1;if(o.classList.contains("cm-line"))break;s=o}return i-(1==t.nodeType?t.getBoundingClientRect():M(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect()).left>5}(w,y,e))&&(w=void 0))}}if(!w||!t.docView.dom.contains(w)){let S=td.find(t.docView,p);if(!S)return c>h.top+h.height/2?h.to:h.from;({node:w,offset:y}=function t(e,i,s){let o,n,r,l,h,a,c,d,u=!1;for(let p=e.firstChild;p;p=p.nextSibling){let m=f(p);for(let g=0;gi?v.left-i:Math.max(0,i-v.right),x=(w=y).top>s?w.top-s:Math.max(0,s-w.bottom);if(0==b&&0==x)return 3==p.nodeType?eo(p,i,s):t(p,i,s);(!h||d>x||d==x&&c>b)&&(h=p,a=y,c=b,d=x,u=!b||(b>0?g0)),0==b?s>y.bottom&&(!r||r.bottomy.top)&&(n=p,l=y):r&&ee(r,y)?r=es(r,y.bottom):l&&ee(l,y)&&(l=ei(l,y.top))}}if(r&&r.bottom>=s?(h=o,a=r):l&&l.top<=s&&(h=n,a=l),!h)return{node:e,offset:0};let S=Math.max(a.left,Math.min(a.right,i));if(3==h.nodeType)return eo(h,S,s);if(u&&"false"!=h.contentEditable)return t(h,S,s);let M=Array.prototype.indexOf.call(e.childNodes,h)+(i>=(a.left+a.right)/2?1:0);return{node:e,offset:M}}(S.dom,e,i))}return t.docView.posFromDOM(w,y)}function er(t,e,i,s,o){let n=Math.round((s-e.left)*t.defaultCharacterWidth);t.lineWrapping&&i.height>1.5*t.defaultLineHeight&&(n+=Math.floor((o-i.top)/t.defaultLineHeight)*t.viewState.heightOracle.lineLength);let r=t.state.sliceDoc(i.from,i.to);return i.from+(0,l.Gz)(r,n,t.state.tabSize)}function el(t,e,i,s){let o=t.state.doc.lineAt(e.head),n=t.bidiSpans(o),r=t.textDirectionAt(o.from);for(let h=e,a=null;;){let c=function(t,e,i,s,o){var n;let r=s.head-t.from,h=-1;if(0==r){if(!o||!t.length)return null;e[0].level!=i&&(r=e[0].side(!1,i),h=0)}else if(r==t.length){if(o)return null;let a=e[e.length-1];a.level!=i&&(r=a.side(!0,i),h=e.length-1)}h<0&&(h=tZ.find(e,r,null!==(n=s.bidiLevel)&&void 0!==n?n:-1,s.assoc));let c=e[h];r==c.side(o,i)&&(r=(c=e[h+=o?1:-1]).side(!o,i));let d=o==(c.dir==i),u=(0,l.cp)(t.text,r,d);if(t1=t.text.slice(Math.min(r,u),Math.max(r,u)),u!=c.side(o,i))return l.jT.cursor(u+t.from,d?-1:1,c.level);let f=h==(o?e.length-1:0)?null:e[h+(o?1:-1)];return f||c.level==i?f&&f.levele(t));for(;;){let o=!1;for(let n of s)n.between(i.from-1,i.from+1,(t,s,n)=>{i.from>t&&i.fromi.from?l.jT.cursor(t,1):l.jT.cursor(s,-1),o=!0)});if(!o)return i}}class ea{constructor(t){for(let e in this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null,em){let i=em[e];t.contentDOM.addEventListener(e,s=>{!(!ep(t,s)||this.ignoreDuringComposition(s))&&("keydown"==e&&this.keydown(t,s)||(this.mustFlushObserver(s)&&t.observer.forceFlush(),this.runCustomHandlers(e,t,s)?s.preventDefault():i(t,s)))},eg[e]),this.registeredEvents.push(e)}K.chrome&&102==K.chrome_version&&t.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?t.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,t.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=t.hasFocus,K.safari&&t.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}ensureHandlers(t,e){var i;let s;for(let o of(this.customHandlers=[],e))if(s=null===(i=o.update(t).spec)||void 0===i?void 0:i.domEventHandlers)for(let n in this.customHandlers.push({plugin:o.value,handlers:s}),s)0>this.registeredEvents.indexOf(n)&&"scroll"!=n&&(this.registeredEvents.push(n),t.contentDOM.addEventListener(n,e=>{ep(t,e)&&this.runCustomHandlers(n,t,e)&&e.preventDefault()}))}runCustomHandlers(t,e,i){for(let s of this.customHandlers){let o=s.handlers[t];if(o)try{if(o.call(s.plugin,i,e)||i.defaultPrevented)return!0}catch(n){tA(e.state,n)}}return!1}runScrollHandlers(t,e){for(let i of(this.lastScrollTop=t.scrollDOM.scrollTop,this.lastScrollLeft=t.scrollDOM.scrollLeft,this.customHandlers)){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,e,t)}catch(o){tA(t.state,o)}}}keydown(t,e){let i;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&Date.now()t.keyCode==e.keyCode))&&!e.ctrlKey||ed.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey))&&(this.pendingIOSKey=i||e,setTimeout(()=>this.flushIOSKey(t),250),!0))}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,k(t.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(K.safari&&!K.ios&&Date.now()-this.compositionEndedAt<100)&&(this.compositionEndedAt=0,!0))}mustFlushObserver(t){return"keydown"==t.type&&229!=t.keyCode}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.mouseSelection&&this.mouseSelection.update(t),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}let ec=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ed="dthko",eu=[16,17,18,20,91,92,224,225];class ef{constructor(t,e,i,s){let o,n;this.view=t,this.style=i,this.mustSelect=s,this.lastEvent=e;let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(l.yy.allowMultipleSelections)&&((o=t.state.facet(tg)).length?o[0](e):K.mac?e.metaKey:e.ctrlKey),this.dragMove=(n=t.state.facet(tv)).length?n[0](e):K.mac?!e.altKey:!e.ctrlKey,this.dragging=!!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let s=c(t.root);if(!s||0==s.rangeCount)return!0;let o=s.getRangeAt(0).getClientRects();for(let n=0;n=e.clientX&&r.top<=e.clientY&&r.bottom>=e.clientY)return!0}return!1}(t,e)&&1==eD(e)&&null,!1===this.dragging&&(e.preventDefault(),this.select(e))}move(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=t)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(t){let e=this.style.get(t,this.extend,this.multiple);(this.mustSelect||!e.eq(this.view.state.selection)||e.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:e,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function ep(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,s;i!=t.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(s=T.get(i))&&s.ignoreEvent(e))return!1;return!0}let em=Object.create(null),eg=Object.create(null),ev=K.ie&&K.ie_version<15||K.ios&&K.webkit_version<604;function ew(t,e){let{state:i}=t,s,o=1,n=i.toText(e),r=n.lines==i.selection.ranges.length;if(null!=eO&&i.selection.ranges.every(t=>t.empty)&&eO==n.toString()){let h=-1;s=i.changeByRange(t=>{let s=i.doc.lineAt(t.from);if(s.from==h)return{range:t};h=s.from;let a=i.toText((r?n.line(o++).text:e)+i.lineBreak);return{changes:{from:s.from,insert:a},range:l.jT.cursor(t.from+a.length)}})}else s=r?i.changeByRange(t=>{let e=n.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:l.jT.cursor(t.from+e.length)}}):i.replaceSelection(n);t.dispatch(s,{userEvent:"input.paste",scrollIntoView:!0})}function ey(t,e,i,s){if(1==s)return l.jT.cursor(e,i);if(2==s)return function(t,e,i=1){let s=t.charCategorizer(e),o=t.doc.lineAt(e),n=e-o.from;if(0==o.length)return l.jT.cursor(e);0==n?i=1:n==o.length&&(i=-1);let r=n,h=n;i<0?r=(0,l.cp)(o.text,n,!1):h=(0,l.cp)(o.text,n);let a=s(o.text.slice(r,h));for(;r>0;){let c=(0,l.cp)(o.text,r,!1);if(s(o.text.slice(c,r))!=a)break;r=c}for(;h{t.inputState.setSelectionOrigin("select"),27==e.keyCode?t.inputState.lastEscPress=Date.now():0>eu.indexOf(e.keyCode)&&(t.inputState.lastEscPress=0)},em.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},em.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},eg.touchstart=eg.touchmove={passive:!0},em.mousedown=(t,e)=>{let i,s,o,n,r;if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return;let h=null;for(let a of t.state.facet(tw))if(h=a(t,e))break;if(h||0!=e.button||(i=eS(t,e),s=eD(e),o=t.state.selection,n=i,r=e,h={update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),o=o.map(t.changes),r=null)},get(e,h,a){let c;r&&e.clientX==r.clientX&&e.clientY==r.clientY?c=n:(c=n=eS(t,e),r=e);let d=ey(t,c.pos,c.bias,s);if(i.pos!=c.pos&&!h){let u=ey(t,i.pos,i.bias,s),f=Math.min(u.from,d.from),p=Math.max(u.to,d.to);d=f1&&o.ranges.some(t=>t.eq(d))?function(t,e){for(let i=0;;i++)if(t.ranges[i].eq(e))return l.jT.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}(o,d):a?o.addRange(d):l.jT.create([d])}}),h){let c=t.root.activeElement!=t.contentDOM;c&&t.observer.ignore(()=>S(t.contentDOM)),t.inputState.startMouseSelection(new ef(t,e,h,c))}};let eb=(t,e)=>t>=e.top&&t<=e.bottom,ex=(t,e,i)=>eb(e,i)&&t>=i.left&&t<=i.right;function eS(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:function(t,e,i,s){let o=td.find(t.docView,e);if(!o)return 1;let n=e-o.posAtStart;if(0==n)return 1;if(n==o.length)return -1;let r=o.coordsAt(n,-1);if(r&&ex(i,s,r))return -1;let l=o.coordsAt(n,1);return l&&ex(i,s,l)?1:r&&eb(s,r)?-1:1}(t,i,e.clientX,e.clientY)}}let eM=K.ie&&K.ie_version<=11,ek=null,eC=0,eA=0;function eD(t){if(!eM)return t.detail;let e=ek,i=eA;return ek=t,eA=Date.now(),eC=!e||i>Date.now()-400&&2>Math.abs(e.clientX-t.clientX)&&2>Math.abs(e.clientY-t.clientY)?(eC+1)%3:1}function eT(t,e,i,s){if(!i)return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:n}=t.inputState,r=s&&n&&n.dragging&&n.dragMove?{from:n.dragging.from,to:n.dragging.to}:null,l={from:o,insert:i},h=t.state.changes(r?[r,l]:l);t.focus(),t.dispatch({changes:h,selection:{anchor:h.mapPos(o,-1),head:h.mapPos(o,1)},userEvent:r?"move.drop":"input.drop"})}em.dragstart=(t,e)=>{let{selection:{main:i}}=t.state,{mouseSelection:s}=t.inputState;s&&(s.dragging=i),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove")},em.drop=(t,e)=>{if(!e.dataTransfer)return;if(t.state.readOnly)return e.preventDefault();let i=e.dataTransfer.files;if(i&&i.length){e.preventDefault();let s=Array(i.length),o=0,n=()=>{++o==i.length&&eT(t,e,s.filter(t=>null!=t).join(t.state.lineBreak),!1)};for(let r=0;r{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(s[r]=l.result),n()},l.readAsText(i[r])}}else eT(t,e,e.dataTransfer.getData("Text"),!0)},em.paste=(t,e)=>{if(t.state.readOnly)return e.preventDefault();t.observer.flush();let i=ev?null:e.clipboardData;i?(ew(t,i.getData("text/plain")),e.preventDefault()):function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),ew(t,i.value)},50)}(t)};let eO=null;function eR(t){setTimeout(()=>{t.hasFocus!=t.inputState.notifiedFocused&&t.update([])},10)}em.copy=em.cut=(t,e)=>{let{text:i,ranges:s,linewise:o}=function(t){let e=[],i=[],s=!1;for(let o of t.selection.ranges)o.empty||(e.push(t.sliceDoc(o.from,o.to)),i.push(o));if(!e.length){let n=-1;for(let{from:r}of t.selection.ranges){let l=t.doc.lineAt(r);l.number>n&&(e.push(l.text),i.push({from:l.from,to:Math.min(t.doc.length,l.to+1)})),n=l.number}s=!0}return{text:e.join(t.lineBreak),ranges:i,linewise:s}}(t.state);if(!i&&!o)return;eO=o?i:null;let n=ev?null:e.clipboardData;n?(e.preventDefault(),n.clearData(),n.setData("text/plain",i)):function(t,e){let i=t.dom.parentNode;if(!i)return;let s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(()=>{s.remove(),t.focus()},50)}(t,i),"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"})},em.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),eR(t)},em.blur=t=>{t.observer.clearSelectionRange(),eR(t)},em.compositionstart=em.compositionupdate=t=>{null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)},em.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionFirstChange=null,K.chrome&&K.android&&t.observer.flushSoon(),setTimeout(()=>{t.inputState.composing<0&&t.docView.compositionDeco.size&&t.update([])},50)},em.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},em.beforeinput=(t,e)=>{var i;let s;if(K.chrome&&K.android&&(s=ec.find(t=>t.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),"Backspace"==s.key||"Delete"==s.key)){let o=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout(()=>{var e;((null===(e=window.visualViewport)||void 0===e?void 0:e.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}};let eE=["pre-wrap","normal","pre-line","break-spaces"];class eB{constructor(){this.doc=l.xv.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return eE.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,r=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=n;if(this.lineWrapping=n,this.lineHeight=e,this.charWidth=i,this.lineLength=s,r){this.heightSamples={};for(let l=0;l0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t,e){this.height!=e&&(Math.abs(this.height-e)>.001&&(t.heightChanged=!0),this.height=e)}replace(t,e,i){return eN.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let o=this;for(let n=s.length-1;n>=0;n--){let{fromA:r,toA:l,fromB:h,toB:a}=s[n],c=o.lineAt(r,eH.ByPosNoHeight,e,0,0),d=c.to>=l?c:o.lineAt(l,eH.ByPosNoHeight,e,0,0);for(a+=d.to-l,l=d.to;n>0&&c.from<=s[n-1].toA;)r=s[n-1].fromA,h=s[n-1].fromB,n--,r2*o){let n=t[e-1];n.break?t.splice(--e,1,n.left,null,n.right):t.splice(--e,1,n.left,n.right),i+=1+n.break,s-=n.size}else if(o>2*s){let r=t[i];r.break?t.splice(i,1,r.left,null,r.right):t.splice(i,1,r.left,r.right),i+=2+r.break,o-=r.size}else break}else if(s=o&&n(this.blockAt(0,i,s,o))}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setHeight(t,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class eW extends eP{constructor(t,e){super(t,e,to.Text),this.collapsed=0,this.widgetHeight=0}replace(t,e,i){let s=i[0];return 1==i.length&&(s instanceof eW||s instanceof ez&&4&s.flags)&&10>Math.abs(this.length-s.length)?(s instanceof ez?s=new eW(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):eN.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setHeight(t,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ez extends eN{constructor(t){super(t,0)}lines(t,e){let i=t.lineAt(e).number,s=t.lineAt(e+this.length).number;return{firstLine:i,lastLine:s,lineHeight:this.height/(s-i+1)}}blockAt(t,e,i,s){let{firstLine:o,lastLine:n,lineHeight:r}=this.lines(e,s),l=Math.max(0,Math.min(n-o,Math.floor((t-i)/r))),{from:h,length:a}=e.line(o+l);return new eV(h,a,i+r*l,r,to.Text)}lineAt(t,e,i,s,o){if(e==eH.ByHeight)return this.blockAt(t,i,s,o);if(e==eH.ByPosNoHeight){let{from:n,to:r}=i.lineAt(t);return new eV(n,r-n,0,0,to.Text)}let{firstLine:l,lineHeight:h}=this.lines(i,o),{from:a,length:c,number:d}=i.lineAt(t);return new eV(a,c,s+h*(d-l),h,to.Text)}forEachLine(t,e,i,s,o,n){let{firstLine:r,lineHeight:l}=this.lines(i,o);for(let h=Math.max(t,o),a=Math.min(o+this.length,e);h<=a;){let c=i.lineAt(h);h==t&&(s+=l*(c.number-r)),n(new eV(c.from,c.length,s,l,to.Text)),s+=l,h=c.to+1}}replace(t,e,i){let s=this.length-e;if(s>0){let o=i[i.length-1];o instanceof ez?i[i.length-1]=new ez(o.length+s):i.push(null,new ez(s-1))}if(t>0){let n=i[0];n instanceof ez?i[0]=new ez(t+n.length):i.unshift(new ez(t-1),null)}return eN.of(i)}decomposeLeft(t,e){e.push(new ez(t-1),null)}decomposeRight(t,e){e.push(null,new ez(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let o=e+this.length;if(s&&s.from<=e+this.length&&s.more){let n=[],r=Math.max(e,s.from),l=-1,h=t.heightChanged;for(s.from>e&&n.push(new ez(s.from-e-1).updateHeight(t,e));r<=o&&s.more;){let a=t.doc.lineAt(r).length;n.length&&n.push(null);let c=s.heights[s.index++];-1==l?l=c:Math.abs(c-l)>=.001&&(l=-2);let d=new eW(a,c);d.outdated=!1,n.push(d),r+=a+1}r<=o&&n.push(null,new ez(o-r).updateHeight(t,r));let u=eN.of(n);return t.heightChanged=h||l<0||Math.abs(u.height-this.height)>=.001||Math.abs(l-this.lines(t.doc,e).lineHeight)>=.001,u}return(i||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class eF extends eN{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,s){let o=i+this.left.height;return tr))return h;let a=e==eH.ByPosNoHeight?eH.ByPosNoHeight:eH.ByPos;return l?h.join(this.right.lineAt(r,a,i,n,r)):this.left.lineAt(r,a,i,s,o).join(h)}forEachLine(t,e,i,s,o,n){let r=s+this.left.height,l=o+this.left.length+this.break;if(this.break)t=l&&this.right.forEachLine(t,e,i,r,l,n);else{let h=this.lineAt(l,eH.ByPos,i,s,o);t=t&&h.from<=e&&n(h),e>h.to&&this.right.forEachLine(h.to+1,e,i,r,l,n)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let o=[];t>0&&this.decomposeLeft(t,o);let n=o.length;for(let r of i)o.push(r);if(t>0&&eI(o,n-1),e=++i&&e.push(null),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t2*e.size||e.size>2*t.size?eN.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)}updateHeight(t,e=0,i=!1,s){let{left:o,right:n}=this,r=e+o.length+this.break,l=null;return(s&&s.from<=e+o.length&&s.more?l=o=o.updateHeight(t,e,i,s):o.updateHeight(t,e,i),s&&s.from<=r+n.length&&s.more?l=n=n.updateHeight(t,r,i,s):n.updateHeight(t,r,i),l)?this.balanced(o,n):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function eI(t,e){let i,s;null==t[e]&&(i=t[e-1])instanceof ez&&(s=t[e+1])instanceof ez&&t.splice(e-1,3,new ez(i.length+1+s.length))}class eq{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof eW?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new eW(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(s,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new eW(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new ez(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof eW)return t;let e=new eW(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine(),t.type!=to.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=to.WidgetBefore&&(this.covering=t)}addLineDeco(t,e){let i=this.ensureLine();i.length+=e,i.collapsed+=e,i.widgetHeight=Math.max(i.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof eW||this.isCovered?(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&"visible"!=d.overflow){let u=c.getBoundingClientRect();n=Math.max(n,u.left),r=Math.min(r,u.right),l=Math.max(l,u.top),h=a==t.parentNode?u.bottom:Math.min(h,u.bottom)}a="absolute"==d.position||"fixed"==d.position?c.offsetParent:c.parentNode}else if(11==a.nodeType)a=a.host;else break;return{left:n-i.left,right:Math.max(n,r)-i.left,top:l-(i.top+e),bottom:Math.max(l,h)-(i.top+e)}}function e$(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class eG{constructor(t,e,i){this.from=t,this.to=e,this.size=i}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t),this.heightMap=eN.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle.setDoc(t.doc),[new tW(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=tn.set(this.lineGaps.map(t=>t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:t,to:e})=>s>=t&&s<=e)){let{from:o,to:n}=this.lineBlockAt(s);t.push(new eU(o,n))}}this.viewports=t.sort((t,e)=>t.from-e.from),this.scaler=this.heightMap.height<=7e6?eZ:new eJ(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,t=>{this.viewportLines.push(1==this.scaler.scale?t:e0(t,this.scaler))})}update(t,e=null){var i,s;let o;this.state=t.state;let n=this.stateDeco;this.stateDeco=this.state.facet(tV).filter(t=>"function"!=typeof t);let r=t.changedRanges,h=tW.extendWithRanges(r,(i=this.stateDeco,s=t?t.changes:l.as.empty(this.state.doc.length),o=new ej,l.Xs.compare(n,i,s,o,0),o.changes)),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),h),this.heightMap.height!=a&&(t.flags|=2);let c=h.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,e));let d=!t.changes.empty||2&t.flags||c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,this.updateForViewport(),d&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(tM)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?tF.RTL:tF.LTR;let n=this.heightOracle.mustRefreshForWrapping(o),r=n||this.mustMeasureContent||this.contentDOMHeight!=e.clientHeight;this.contentDOMHeight=e.clientHeight,this.mustMeasureContent=!1;let h=0,a=0,c=parseInt(i.paddingTop)||0,d=parseInt(i.paddingBottom)||0;(this.paddingTop!=c||this.paddingBottom!=d)&&(this.paddingTop=c,this.paddingBottom=d,h|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(r=!0),this.editorWidth=t.scrollDOM.clientWidth,h|=8);let u=(this.printing?e$:eK)(e,this.paddingTop),f=u.top-this.pixelViewport.top,p=u.bottom-this.pixelViewport.bottom;this.pixelViewport=u;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(r=!0)),!this.inView&&!this.scrollTarget)return 0;let g=e.clientWidth;if((this.contentDOMWidth!=g||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=g,this.editorHeight=t.scrollDOM.clientHeight,h|=8),r){let v=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(v)&&(n=!0),n||s.lineWrapping&&Math.abs(g-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:y}=t.docView.measureTextSize();(n=w>0&&s.refresh(o,w,y,g/y,v))&&(t.docView.minWidth=0,h|=8)}for(let b of(f>0&&p>0?a=Math.max(f,p):f<0&&p<0&&(a=Math.min(f,p)),s.heightChanged=!1,this.viewports)){let x=b.from==this.viewport.from?v:t.docView.measureVisibleLineHeights(b);this.heightMap=(n?eN.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle,[new tW(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,n,new eL(b.from,x))}s.heightChanged&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,a)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(this.viewport=this.getViewport(a,this.scrollTarget)),this.updateForViewport(),(2&h||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(n?[]:this.lineGaps,t)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,o=this.state.doc,{visibleTop:n,visibleBottom:r}=this,l=new eU(s.lineAt(n-1e3*i,eH.ByHeight,o,0,0).from,s.lineAt(r+(1-i)*1e3,eH.ByHeight,o,0,0).to);if(e){let{head:h}=e.range;if(hl.to){let a=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=s.lineAt(h,eH.ByPos,o,0,0),d;d="center"==e.y?(c.top+c.bottom)/2-a/2:"start"==e.y||"nearest"==e.y&&h=r+Math.max(10,Math.min(i,250)))&&s>n-2e3&&o>1,n=s<<1;if(this.defaultTextDirection!=tF.LTR&&!i)return[];let r=[],h=(s,n,a,c)=>{if(n-ss&&ft.from>=a.from&&t.to<=a.to&&Math.abs(t.from-s)t.frome));if(!p){if(nt.from<=n&&t.to>=n)){let m=e.moveToLineBoundary(l.jT.cursor(n),!1,!0).head;m>s&&(n=m)}p=new eG(s,n,this.gapSize(a,s,n,c))}r.push(p)};for(let a of this.viewportLines){let c,d;if(a.lengtho&&(s.push({from:o,to:t}),n+=t-o),o=e}},20),oa.from&&h(a.from,c,a,u),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];l.Xs.spans(t,this.viewport.from,this.viewport.to,{span(t,i){e.push({from:t,to:i})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((t,i)=>t.from!=e[i].from||t.to!=e[i].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||e0(this.heightMap.lineAt(t,eH.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(t){return e0(this.heightMap.lineAt(this.scaler.fromDOM(t),eH.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(t){return e0(this.heightMap.blockAt(this.scaler.fromDOM(t),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class eU{constructor(t,e){this.from=t,this.to=e}}function eY({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let s=Math.floor(t*i);for(let o=0;;o++){let{from:n,to:r}=e[o],l=r-n;if(s<=l)return n+s;s-=l}}function eQ(t,e){let i=0;for(let{from:s,to:o}of t.ranges){if(e<=o){i+=e-s;break}i+=o-s}return i/t.total}let eZ={toDOM:t=>t,fromDOM:t=>t,scale:1};class eJ{constructor(t,e,i){let s=0,o=0,n=0;for(let r of(this.viewports=i.map(({from:i,to:o})=>{let n=e.lineAt(i,eH.ByPos,t,0,0).top,r=e.lineAt(o,eH.ByPos,t,0,0).bottom;return s+=r-n,{from:i,to:o,top:n,bottom:r,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s),this.viewports))r.domTop=n+(r.top-o)*this.scale,n=r.domBottom=r.domTop+(r.bottom-r.top),o=r.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let o=ee0(t,e)):t.type)}let e1=l.r$.define({combine:t=>t.join(" ")}),e2=l.r$.define({combine:t=>t.indexOf(!0)>-1}),e8=h.V.newName(),e3=h.V.newName(),e9=h.V.newName(),e5={"&light":"."+e3,"&dark":"."+e9};function e4(t,e,i){return new h.V(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,e=>{if("&"==e)return t;if(!i||!i[e])throw RangeError(`Unsupported selector: ${e}`);return i[e]}):t+" "+e})}let e6=e4("."+e8,{"&.cm-editor":{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,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&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%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&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"}},e5);class e7{constructor(t,e,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:o,impreciseAnchor:n}=t.docView;if(t.state.readOnly&&e>-1);else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let r=o||n?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:n}=t.observer.selectionRange;return i&&(e.push(new t3(i,s)),(o!=i||n!=s)&&e.push(new t3(o,n))),e}(t),h=new t2(r,t.state);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?l.jT.single(i+e,s+e):null}(r,this.bounds.from)}else{let a=t.observer.selectionRange,c=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!d(t.contentDOM,a.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(a.focusNode,a.focusOffset),u=n&&n.node==a.anchorNode&&n.offset==a.anchorOffset||!d(t.contentDOM,a.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(a.anchorNode,a.anchorOffset);this.newSel=l.jT.single(u,c)}}}function it(t,e){let i;let{newSel:s}=e,o=t.state.selection.main;if(e.bounds){let{from:n,to:r}=e.bounds,h=o.from,a=null;(8===t.inputState.lastKeyCode&&t.inputState.lastKeyTime>Date.now()-100||K.android&&e.text.length0&&l>0&&t.charCodeAt(r-1)==e.charCodeAt(l-1);)r--,l--;if("end"==s){let h=Math.max(0,n-Math.min(r,l));i-=r+h-n}if(r=r?n-i:0;n-=a,l=n+(l-r),r=n}else if(l=l?n-i:0;n-=c,r=n+(r-l),l=n}return{from:n,toA:r,toB:l}}(t.state.doc.sliceString(n,r,"￿"),e.text,h-n,a);c&&(K.chrome&&13==t.inputState.lastKeyCode&&c.toB==c.from+2&&"￿￿"==e.text.slice(c.from,c.toB)&&c.toB--,i={from:n+c.from,to:n+c.toA,insert:l.xv.of(e.text.slice(c.from,c.toB).split("￿"))})}else s&&(!t.hasFocus||!t.state.facet(tD)||s.main.eq(o))&&(s=null);if(!i&&!s)return!1;if(!i&&e.typeOver&&!o.empty&&s&&s.main.empty?i={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,o.to)}:i&&i.from>=o.from&&i.to<=o.to&&(i.from!=o.from||i.to!=o.to)&&o.to-o.from-(i.to-i.from)<=4?i={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,o.to))}:(K.mac||K.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())?(s&&2==i.insert.length&&(s=l.jT.single(s.main.anchor-1,s.main.head-1)),i={from:o.from,to:o.to,insert:l.xv.of([" "])}):K.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=l.jT.single(s.main.anchor-1,s.main.head-1)),i={from:o.from,to:o.to,insert:l.xv.of([" "])}),i){let d,u=t.state;if(K.ios&&t.inputState.flushIOSKey(t)||K.android&&(i.from==o.from&&i.to==o.to&&1==i.insert.length&&2==i.insert.lines&&k(t.contentDOM,"Enter",13)||i.from==o.from-1&&i.to==o.to&&0==i.insert.length&&k(t.contentDOM,"Backspace",8)||i.from==o.from&&i.to==o.to+1&&0==i.insert.length&&k(t.contentDOM,"Delete",46)))return!0;let f=i.insert.toString();if(t.state.facet(tx).some(e=>e(t,i.from,i.to,f)))return!0;if(t.inputState.composing>=0&&t.inputState.composing++,i.from>=o.from&&i.to<=o.to&&i.to-i.from>=(o.to-o.from)/3&&(!s||s.main.empty&&s.main.from==i.from+i.insert.length)&&t.inputState.composing<0){let p=o.fromi.to?u.sliceDoc(i.to,o.to):"";d=u.replaceSelection(t.state.toText(p+i.insert.sliceString(0,void 0,t.state.lineBreak)+m))}else{let g=u.changes(i),v=s&&!u.selection.main.eq(s.main)&&s.main.to<=g.newLength?s.main:void 0;if(u.selection.ranges.length>1&&t.inputState.composing>=0&&i.to<=o.to&&i.to>=o.to-10){let w=t.state.sliceDoc(i.from,i.to),y=t4(t)||t.state.doc.lineAt(o.head),b=o.to-i.to,x=o.to-o.from;d=u.changeByRange(e=>{if(e.from==o.from&&e.to==o.to)return{changes:g,range:v||e.map(g)};let s=e.to-b,n=s-w.length;if(e.to-e.from!=x||t.state.sliceDoc(n,s)!=w||y&&e.to>=y.from&&e.from<=y.to)return{range:e};let r=u.changes({from:n,to:s,insert:i.insert}),h=e.to-o.to;return{changes:r,range:v?l.jT.range(Math.max(0,v.anchor+h),Math.max(0,v.head+h)):e.map(r)}})}else d={changes:g,selection:v&&u.selection.replaceRange(v)}}let S="input.type";return t.composing&&(S+=".compose",t.inputState.compositionFirstChange&&(S+=".start",t.inputState.compositionFirstChange=!1)),t.dispatch(d,{scrollIntoView:!0,userEvent:S}),!0}if(!s||s.main.eq(o))return!1;{let M=!1,C="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(M=!0),C=t.inputState.lastSelectionOrigin),t.dispatch({selection:s,scrollIntoView:M,userEvent:C}),!0}}let ie={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ii=K.ie&&K.ie_version<=11;class is{constructor(t){this.view=t,this.active=!1,this.selectionRange=new b,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(K.ie&&K.ie_version<=11||K.ios&&t.composing)&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),ii&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver(()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runScrollHandlers(this.view,t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){for(let e of(this.gapIntersection.disconnect(),t))this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(tD)?i.root.activeElement!=this.dom:!u(i.dom,s))return;let o=s.anchorNode&&i.docView.nearest(s.anchorNode);if(o&&o.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(K.ie&&K.ie_version<=11||K.android&&K.chrome)&&!i.state.selection.main.empty&&s.focusNode&&p(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=K.safari&&11==t.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t){let e=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}if(t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),!e)return null;let s=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor);return p(l.node,l.offset,n,r)&&([s,o,n,r]=[n,r,s,o]),{anchorNode:s,anchorOffset:o,focusNode:n,focusOffset:r}}(this.view)||c(t.root);if(!e||this.selectionRange.eq(e))return!1;let i=u(this.dom,e);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;t&&(this.clearDelayedAndroidKey(),!this.flush()&&t.force&&k(this.dom,t.key,t.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let t=this.queue;for(let e of this.observer.takeRecords())t.push(e);t.length&&(this.queue=[]);let i=-1,s=-1,o=!1;for(let n of t){let r=this.readMutation(n);r&&(r.typeOver&&(o=!0),-1==i?{from:i,to:s}=r:(i=Math.min(r.from,i),s=Math.max(r.to,s)))}return{from:i,to:s,typeOver:o}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&u(this.dom,this.selectionRange);return t<0&&!s?null:(t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new e7(this.view,t,e,i))}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return!1;let i=this.view.state,s=it(this.view,e);return this.view.state==i&&this.view.update([]),s}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.dirty|=4),"childList"==t.type){let i=io(e,t.previousSibling||t.target.previousSibling,-1),s=io(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var t,e,i;for(let s of(this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resize)||void 0===i||i.disconnect(),this.scrollTargets))s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function io(t,e,i){for(;e;){let s=T.get(e);if(s&&s.parent==t)return s;let o=e.parentNode;e=o!=t.dom?o:i>0?e.nextSibling:e.previousSibling}return null}class ir{constructor(t={}){for(let e of(this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,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=t.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new e_(t.state||l.yy.create(t)),this.plugins=this.state.facet(tO).map(t=>new tE(t)),this.plugins))e.update(this);this.observer=new is(this),this.inputState=new ea(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new t9(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),t.parent&&t.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...t){this._dispatch(1==t.length&&t[0]instanceof l.YW?t[0]:this.state.update(...t))}update(t){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,s,o=this.state;for(let n of t){if(n.startState!=o)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=n.state}if(this.destroyed){this.viewState.state=o;return}let r=this.observer.delayedAndroidKey,h=null;if(r?(this.observer.clearDelayedAndroidKey(),((h=this.observer.readChange())&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(h=null)):this.observer.clear(),o.facet(l.yy.phrases)!=this.state.facet(l.yy.phrases))return this.setState(o);s=tz.create(this,o,t);let a=this.viewState.scrollTarget;try{for(let c of(this.updateState=2,t)){if(a&&(a=a.map(c.changes)),c.scrollIntoView){let{main:d}=c.state.selection;a=new tk(d.empty?d:l.jT.cursor(d.head,d.head>d.anchor?-1:1))}for(let u of c.effects)u.is(tC)&&(a=u.value)}this.viewState.update(s,a),this.bidiCache=ia.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),e=this.docView.update(s),this.state.facet(tP)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(t=>t.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(e1)!=s.state.facet(e1)&&(this.viewState.mustMeasureContent=!0),(e||i||a||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let f of this.state.facet(tb))f(s);h&&!it(this,h)&&r.force&&k(this.contentDOM,r.key,r.keyCode)}setState(t){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);for(let s of(this.viewState=new e_(t),this.plugins=t.facet(tO).map(t=>new tE(t)),this.pluginMap.clear(),this.plugins))s.update(this);this.docView=new t9(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(tO),i=t.state.facet(tO);if(e!=i){let s=[];for(let o of i){let n=e.indexOf(o);if(n<0)s.push(new tE(o));else{let r=this.plugins[n];r.mustUpdate=t,s.push(r)}}for(let l of this.plugins)l.mustUpdate!=t&&l.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let h of this.plugins)h.mustUpdate=t;for(let a=0;a-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,{scrollHeight:i,scrollTop:s,clientHeight:o}=this.scrollDOM,n=s>i-o-4?i:s;try{for(let r=0;;r++){this.updateState=1;let l=this.viewport,h=this.viewState.lineBlockAtHeight(n),a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(r>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];4&a||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(t=>{try{return t.read(this)}catch(e){return tA(this.state,e),ih}}),u=tz.create(this,this.state,[]),f=!1,p=!1;u.flags|=a,e?e.flags|=a:e=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),f=this.docView.update(u));for(let m=0;m1||w<-1)&&(this.scrollDOM.scrollTop+=w,p=!0)}}if(f&&this.docView.updateSelection(!0),this.viewport.from==l.from&&this.viewport.to==l.to&&!p&&0==this.measureRequests.length)break}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let y of this.state.facet(tb))y(e)}get themeClasses(){return e8+" "+(this.state.facet(e2)?e9:e3)+" "+this.state.facet(e1)}updateAttrs(){let t=ic(this,tB,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(tD)?"true":"false",class:"cm-content",style:`${K.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),ic(this,tL,e);let i=this.observer.ignore(()=>{let i=ti(this.contentDOM,this.contentAttrs,e),s=ti(this.dom,this.editorAttrs,t);return i||s});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let s of i.effects)s.is(ir.announce)&&(e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=s.value)}mountStyles(){this.styleModules=this.state.facet(tP),h.V.mount(this.root,this.styleModules.concat(e6).reverse())}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(null!=t.key){for(let e=0;ee.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return eh(this,t,el(this,t,e,i))}moveByGroup(t,e){return eh(this,t,el(this,t,e,e=>{var i;let s,o;return i=t.head,o=(s=this.state.charCategorizer(i))(e),t=>{let e=s(t);return o==l.D0.Space&&(o=e),o==e}}))}moveToLineBoundary(t,e,i=!0){return function(t,e,i,s){let o=t.state.doc.lineAt(e.head),n=s&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(n){let r=t.dom.getBoundingClientRect(),h=t.textDirectionAt(o.from),a=t.posAtCoords({x:i==(h==tF.LTR)?r.right-1:r.left+1,y:(n.top+n.bottom)/2});if(null!=a)return l.jT.cursor(a,i?-1:1)}let c=td.find(t.docView,e.head),d=c?i?c.posAtEnd:c.posAtStart:i?o.to:o.from;return l.jT.cursor(d,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return eh(this,t,function(t,e,i,s){let o=e.head,n=i?1:-1;if(o==(i?t.state.doc.length:0))return l.jT.cursor(o,e.assoc);let r=e.goalColumn,h,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(o),d=t.documentTop;if(c)null==r&&(r=c.left-a.left),h=n<0?c.top:c.bottom;else{let u=t.viewState.lineBlockAt(o);null==r&&(r=Math.min(a.right-a.left,t.defaultCharacterWidth*(o-u.from))),h=(n<0?u.top:u.bottom)+d}let f=a.left+r,p=null!=s?s:t.defaultLineHeight>>1;for(let m=0;;m+=10){let g=h+(p+m)*n,v=en(t,{x:f,y:g},!1,n);if(ga.bottom||(n<0?vo))return l.jT.cursor(v,e.assoc,void 0,r)}}(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),en(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(t),o=this.bidiSpans(s);return y(i,o[tZ.find(o,t-s.from,-1,e)].dir==tF.LTR==e>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(tS)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>il)return t0(t.length);let e=this.textDirectionAt(t.from);for(let i of this.bidiCache)if(i.from==t.from&&i.dir==e)return i.order;let s=function(t,e){let i=t.length,s=e==tI?1:2,o=e==tI?2:1;if(!t||1==s&&!tQ.test(t))return t0(i);for(let n=0,r=s,l=s;n=0;M-=3)if(tX[M+1]==-x){let k=tX[M+2],C=2&k?s:4&k?1&k?o:s:0;C&&(tJ[v]=tJ[tX[M]]=C),w=M;break}}else if(189==tX.length)break;else tX[w++]=v,tX[w++]=b,tX[w++]=y}else if(2==(S=tJ[v])||1==S){let A=S==s;y=A?0:1;for(let D=w-3;D>=0;D-=3){let T=tX[D+2];if(2&T)break;if(A)tX[D+2]|=2;else{if(4&T)break;tX[D+2]|=4}}}for(let O=0;ON;){let z=W,F=2!=tJ[--W];for(;W>N&&F==(2!=tJ[W-1]);)W--;V.push(new tZ(W,z,F?2:1))}else V.push(new tZ(N,H,0))}else for(let I=0;IDate.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{S(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return tC.of(new tk("number"==typeof t?l.jT.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}static domEventHandlers(t){return tR.define(()=>({}),{eventHandlers:t})}static theme(t,e){let i=h.V.newName(),s=[e1.of(i),tP.of(e4(`.${i}`,t))];return e&&e.dark&&s.push(e2.of(!0)),s}static baseTheme(t){return l.Wl.lowest(tP.of(e4("."+e8,t,e5)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&T.get(i)||T.get(t);return(null===(e=null==s?void 0:s.rootView)||void 0===e?void 0:e.view)||null}}ir.styleModule=tP,ir.inputHandler=tx,ir.perLineTextDirection=tS,ir.exceptionSink=ty,ir.updateListener=tb,ir.editable=tD,ir.mouseSelectionStyle=tw,ir.dragMovesSelection=tv,ir.clickAddsSelectionRange=tg,ir.decorations=tV,ir.atomicRanges=tH,ir.scrollMargins=tN,ir.darkTheme=e2,ir.contentAttributes=tL,ir.editorAttributes=tB,ir.lineWrapping=ir.contentAttributes.of({class:"cm-lineWrapping"}),ir.announce=l.Py.define();let il=4096,ih={};class ia{constructor(t,e,i,s){this.from=t,this.to=e,this.dir=i,this.order=s}static update(t,e){if(e.empty)return t;let i=[],s=t.length?t[t.length-1].dir:tF.LTR;for(let o=Math.max(0,t.length-10);o=0;o--){let n=s[o],r="function"==typeof n?n(t):n;r&&tt(r,i)}return i}let id=K.mac?"mac":K.windows?"win":K.linux?"linux":"key";function iu(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}let ip=l.Wl.default(ir.domEventHandlers({keydown:(t,e)=>ib(iv(e.state),t,e,"editor")})),im=l.r$.define({enables:ip}),ig=new WeakMap;function iv(t){let e=t.facet(im),i=ig.get(e);return i||ig.set(e,i=function(t,e=id){let i=Object.create(null),s=Object.create(null),o=(t,e)=>{let i=s[t];if(null==i)s[t]=e;else if(i!=e)throw Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},n=(t,s,n,r)=>{var l,h;let a=i[t]||(i[t]=Object.create(null)),c=s.split(/ (?!$)/).map(t=>(function(t,e){let i,s,o,n;let r=t.split(/-(?!$)/),l=r[r.length-1];"Space"==l&&(l=" ");for(let h=0;h{let i=iy={view:e,prefix:u,scope:t};return setTimeout(()=>{iy==i&&(iy=null)},4e3),!0}]})}let f=c.join(" ");o(f,!1);let p=a[f]||(a[f]={preventDefault:!1,run:(null===(h=null===(l=a._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});n&&p.run.push(n),r&&(p.preventDefault=!0)};for(let r of t){let l=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let h of l){let a=i[h]||(i[h]=Object.create(null));for(let c in a._any||(a._any={preventDefault:!1,run:[]}),a)a[c].run.push(r.any)}let d=r[e]||r.key;if(d)for(let u of l)n(u,d,r.run,r.preventDefault),r.shift&&n(u,"Shift-"+d,r.shift,r.preventDefault)}return i}(e.reduce((t,e)=>t.concat(e),[]))),i}function iw(t,e,i){return ib(iv(t.state),e,t,i)}let iy=null;function ib(t,e,i,s){let o=(0,a.YG)(e),n=(0,l.gm)(o,0),r=(0,l.nZ)(n)==o.length&&" "!=o,h="",c=!1;iy&&iy.view==i&&iy.scope==s&&(h=iy.prefix+" ",(c=0>eu.indexOf(e.keyCode))&&(iy=null));let d=new Set,u=t=>{if(t){for(let s of t.run)if(!d.has(s)&&(d.add(s),s(i,e)))return!0;t.preventDefault&&(c=!0)}return!1},f=t[s],p,m;if(f){if(u(f[h+iu(o,e,!r)]))return!0;if(r&&(e.shiftKey||e.altKey||e.metaKey||n>127)&&(p=a.ue[e.keyCode])&&p!=o){if(u(f[h+iu(p,e,!0)])||e.shiftKey&&(m=a.uY[e.keyCode])!=o&&m!=p&&u(f[h+iu(m,e,!1)]))return!0}else if(r&&e.shiftKey&&u(f[h+iu(o,e,!0)]))return!0;if(u(f._any))return!0}return c}let ix=!K.ios,iS=l.r$.define({combine:t=>(0,l.BO)(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function iM(t={}){return[iS.of(t),iC,iD,tM.of(!0)]}class ik{constructor(t,e,i,s,o){this.left=t,this.top=e,this.width=i,this.height=s,this.className=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}adjust(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"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}}let iC=tR.fromClass(class{constructor(t){this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(iS).cursorBlinkRate+"ms"}update(t){let e=t.startState.facet(iS)!=t.state.facet(iS);(e||t.selectionSet||t.geometryChanged||t.viewportChanged)&&this.view.requestMeasure(this.measureReq),t.transactions.some(t=>t.scrollIntoView)&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}readPos(){let{state:t}=this.view,e=t.facet(iS),i=t.selection.ranges.map(t=>t.empty?[]:function(t,e){if(e.to<=t.viewport.from||e.from>=t.viewport.to)return[];let i=Math.max(e.from,t.viewport.from),s=Math.min(e.to,t.viewport.to),o=t.textDirection==tF.LTR,n=t.contentDOM,r=n.getBoundingClientRect(),l=iT(t),h=window.getComputedStyle(n.firstChild),a=r.left+parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)),c=r.right-parseInt(h.paddingRight),d=iR(t,i),u=iR(t,s),f=d.type==to.Text?d:null,p=u.type==to.Text?u:null;if(t.lineWrapping&&(f&&(f=iO(t,i,f)),p&&(p=iO(t,s,p))),f&&p&&f.from==p.from)return y(b(e.from,e.to,f));{let m=f?b(e.from,null,f):x(d,!1),g=p?b(null,e.to,p):x(u,!0),v=[];return(f||d).to<(p||u).from-1?v.push(w(a,m.bottom,c,g.top)):m.bottomd&&f.from=m)break;y>p&&h(Math.max(w,p),null==e&&w<=d,Math.min(y,m),null==i&&y>=u,v.dir)}if((p=g.to+1)>=m)break}return 0==l.length&&h(d,null==e,u,null==i,t.textDirection),{top:n,bottom:r,horizontal:l}}function x(t,e){let i=r.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(this.view,t)).reduce((t,e)=>t.concat(e)),s=[];for(let o of t.selection.ranges){let n=o==t.selection.main;if(o.empty?!n||ix:e.drawRangeCursor){let r=function(t,e,i){let s=t.coordsAtPos(e.head,e.assoc||1);if(!s)return null;let o=iT(t);return new ik(s.left-o.left,s.top-o.top,-1,s.bottom-s.top,i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}(this.view,o,n);r&&s.push(r)}}return{rangePieces:i,cursors:s}}drawSel({rangePieces:t,cursors:e}){if(t.length!=this.rangePieces.length||t.some((t,e)=>!t.eq(this.rangePieces[e]))){for(let i of(this.selectionLayer.textContent="",t))this.selectionLayer.appendChild(i.draw());this.rangePieces=t}if(e.length!=this.cursors.length||e.some((t,e)=>!t.eq(this.cursors[e]))){let s=this.cursorLayer.children;if(s.length!==e.length)for(let o of(this.cursorLayer.textContent="",e))this.cursorLayer.appendChild(o.draw());else e.forEach((t,e)=>t.adjust(s[e]));this.cursors=e}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),iA={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ix&&(iA[".cm-line"].caretColor="transparent !important");let iD=l.Wl.highest(ir.theme(iA));function iT(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==tF.LTR?e.left:e.right-t.scrollDOM.clientWidth)-t.scrollDOM.scrollLeft,top:e.top-t.scrollDOM.scrollTop}}function iO(t,e,i){let s=l.jT.cursor(e);return{from:Math.max(i.from,t.moveToLineBoundary(s,!1,!0).from),to:Math.min(i.to,t.moveToLineBoundary(s,!0,!0).from),type:to.Text}}function iR(t,e){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){for(let s of i.type)if(s.to>e||s.to==e&&(s.to==i.to||s.type==to.Text))return s}return i}let iE=l.Py.define({map:(t,e)=>null==t?null:e.mapPos(t)}),iB=l.QQ.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce((t,e)=>e.is(iE)?e.value:t,t))}),iL=tR.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(iB);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(iB)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let t=this.view.state.field(iB),e=null!=t&&this.view.coordsAtPos(t);if(!e)return null;let i=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+this.view.scrollDOM.scrollLeft,top:e.top-i.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(t){this.cursor&&(t?(this.cursor.style.left=t.left+"px",this.cursor.style.top=t.top+"px",this.cursor.style.height=t.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(iB)!=t&&this.view.dispatch({effects:iE.of(t)})}},{eventHandlers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function iV(){return[iB,iL]}function iH(t,e,i,s,o){e.lastIndex=0;for(let n=t.iterRange(i,s),r=i,l;!n.next().done;r+=n.value.length)if(!n.lineBreak)for(;l=e.exec(n.value);)o(r+l.index,l)}class iN{constructor(t){let{regexp:e,decoration:i,decorate:s,boundary:o,maxLength:n=1e3}=t;if(!e.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(t,e,i,o)=>s(o,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,s,o)=>{let n=i(t,e,s);n&&o(s,s+t[0].length,n)};else if(i)this.addMatch=(t,e,s,o)=>o(s,s+t[0].length,i);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=n}createDeco(t){let e=new l.f_,i=e.add.bind(e);for(let{from:s,to:o}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let s=[];for(let{from:o,to:n}of i)o=Math.max(t.state.doc.lineAt(o).from,o-e),n=Math.min(t.state.doc.lineAt(n).to,n+e),s.length&&s[s.length-1].to>=o?s[s.length-1].to=n:s.push({from:o,to:n});return s}(t,this.maxLength))iH(t.state.doc,this.regexp,s,o,(e,s)=>this.addMatch(s,t,e,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return(t.docChanged&&t.changes.iterChanges((e,o,n,r)=>{r>t.view.viewport.from&&n1e3)?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let o of t.visibleRanges){let n=Math.max(o.from,i),r=Math.min(o.to,s);if(r>n){let l=t.state.doc.lineAt(n),h=l.tol.from;n--)if(this.boundary.test(l.text[n-1-l.from])){a=n;break}for(;rd.push(i.range(t,e));if(l==h)for(this.regexp.lastIndex=a-l.from;(u=this.regexp.exec(l.text))&&u.indexthis.addMatch(i,t,e,f));e=e.update({filterFrom:a,filterTo:c,filter:(t,e)=>tc,add:d})}}return e}}let iP=null!=/x/.unicode?"gu":"g",iW=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",iP),iz={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},iF=null,iI=l.r$.define({combine(t){let e=(0,l.BO)(t,{render:null,specialChars:iW,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==iF&&"undefined"!=typeof document&&document.body){let e=document.body.style;iF=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)!=null}return iF||!1}())&&(e.specialChars=RegExp(" |"+e.specialChars.source,iP)),e.addSpecialChars&&(e.specialChars=RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,iP)),e}});function iq(t={}){return[iI.of(t),ij||(ij=tR.fromClass(class{constructor(t){this.view=t,this.decorations=tn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(iI)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new iN({regexp:t.specialChars,decoration:(e,i,s)=>{let{doc:o}=i.state,n=(0,l.gm)(e[0],0);if(9==n){let r=o.lineAt(s),h=i.state.tabSize,a=(0,l.IS)(r.text,h,s-r.from);return tn.replace({widget:new i$((h-a%h)*this.view.defaultCharacterWidth)})}return this.decorationCache[n]||(this.decorationCache[n]=tn.replace({widget:new iK(t,n)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(iI);t.startState.facet(iI)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let ij=null;class iK extends ts{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){var e;let i=(e=this.code)>=32?"•":10==e?"␤":String.fromCharCode(9216+e),s=t.state.phrase("Control character")+" "+(iz[this.code]||"0x"+this.code.toString(16)),o=this.options.render&&this.options.render(this.code,s,i);if(o)return o;let n=document.createElement("span");return n.textContent=i,n.title=s,n.setAttribute("aria-label",s),n.className="cm-specialChar",n}ignoreEvent(){return!1}}class i$ extends ts{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function iG(){return i_}let iX=tn.line({class:"cm-activeLine"}),i_=tR.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let s of t.state.selection.ranges){let o=t.lineBlockAt(s.head);o.from>e&&(i.push(iX.range(o.from)),e=o.from)}return tn.set(i)}},{decorations:t=>t.decorations});class iU extends ts{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}ignoreEvent(){return!1}}function iY(t){return tR.fromClass(class{constructor(e){this.view=e,this.placeholder=tn.set([tn.widget({widget:new iU(t),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?tn.none:this.placeholder}},{decorations:t=>t.decorations})}function iQ(t,e){var i;let s,o=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(o),r=o-n.from,h=r>2e3?-1:r==n.length?(i=e.clientX,(s=t.coordsAtPos(t.viewport.from))?Math.round(Math.abs((s.left-i)/t.defaultCharacterWidth)):-1):(0,l.IS)(n.text,t.state.tabSize,o-n.from);return{line:n.number,col:h,off:r}}function iZ(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return ir.mouseSelectionStyle.of((t,i)=>{let s,o;return e(i)?(s=iQ(t,i),o=t.state.selection,s?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(s.line).from),i=t.state.doc.lineAt(e);s={line:i.number,col:s.col,off:Math.min(s.off,i.length)},o=o.map(t.changes)}},get(e,i,n){let r=iQ(t,e);if(!r)return o;let h=function(t,e,i){let s=Math.min(e.line,i.line),o=Math.max(e.line,i.line),n=[];if(e.off>2e3||i.off>2e3||e.col<0||i.col<0){let r=Math.min(e.off,i.off),h=Math.max(e.off,i.off);for(let a=s;a<=o;a++){let c=t.doc.line(a);c.length<=h&&n.push(l.jT.range(c.from+r,c.to+h))}}else{let d=Math.min(e.col,i.col),u=Math.max(e.col,i.col);for(let f=s;f<=o;f++){let p=t.doc.line(f),m=(0,l.Gz)(p.text,d,t.tabSize,!0);if(m<0)n.push(l.jT.cursor(p.to));else{let g=(0,l.Gz)(p.text,u,t.tabSize);n.push(l.jT.range(p.from+m,p.from+g))}}}return n}(t.state,s,r);return h.length?n?l.jT.create(h.concat(o.ranges)):l.jT.create(h):o}}:null):null})}let iJ={Alt:[18,t=>t.altKey],Control:[17,t=>t.ctrlKey],Shift:[16,t=>t.shiftKey],Meta:[91,t=>t.metaKey]},i0={style:"cursor: crosshair"};function i1(t={}){let[e,i]=iJ[t.key||"Alt"],s=tR.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventHandlers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){t.keyCode!=e&&i(t)||this.set(!1)},mousemove(t){this.set(i(t))}}});return[s,ir.contentAttributes.of(t=>{var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?i0:null})]}let i2="-10000px";class i8{constructor(t,e,i){this.facet=e,this.createTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter(t=>t),this.tooltipViews=this.tooltips.map(i)}update(t){var e;let i=t.state.facet(this.facet),s=i.filter(t=>t);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(t);return!1}let n=[];for(let r=0;rn.indexOf(u)&&(u.dom.remove(),null===(e=u.destroy)||void 0===e||e.call(u));return this.input=i,this.tooltips=s,this.tooltipViews=n,!0}}function i3(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}let i9=l.r$.define({combine(t){var e,i,s;return{position:K.ios?"absolute":(null===(e=t.find(t=>t.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(t=>t.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(t=>t.tooltipSpace))||void 0===s?void 0:s.tooltipSpace)||i3}}}),i5=tR.fromClass(class{constructor(t){this.view=t,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(i9);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new i8(t,i7,t=>this.createTooltip(t)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let t of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(t.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t);e&&this.observeIntersection();let i=e||t.geometryChanged,s=t.state.facet(i9);if(s.position!=this.position){for(let o of(this.position=s.position,this.manager.tooltipViews))o.dom.style.position=this.position;i=!0}if(s.parent!=this.parent){for(let n of(this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(n.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t){let e=t.create(this.view);if(e.dom.classList.add("cm-tooltip"),t.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",e.dom.appendChild(i)}return e.dom.style.position=this.position,e.dom.style.top=i2,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var t,e;for(let i of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))i.dom.remove(),null===(t=i.destroy)||void 0===t||t.call(i);null===(e=this.intersectionObserver)||void 0===e||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect();return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)}),size:this.manager.tooltipViews.map(({dom:t})=>t.getBoundingClientRect()),space:this.view.state.facet(i9).tooltipSpace(this.view)}}writeMeasure(t){let{editor:e,space:i}=t,s=[];for(let o=0;o=Math.min(e.bottom,i.bottom)||h.rightMath.min(e.right,i.right)+.1){l.style.top=i2;continue}let c=n.arrow?r.dom.querySelector(".cm-tooltip-arrow"):null,d=c?7:0,u=a.right-a.left,f=a.bottom-a.top,p=r.offset||i6,m=this.view.textDirection==tF.LTR,g=a.width>i.right-i.left?m?i.left:i.right-a.width:m?Math.min(h.left-(c?14:0)+p.x,i.right-u):Math.max(i.left,h.left-u+(c?14:0)-p.x),v=!!n.above;!n.strictSide&&(v?h.top-(a.bottom-a.top)-p.yi.bottom)&&v==i.bottom-h.bottom>h.top-i.top&&(v=!v);let w=v?h.top-f-d-p.y:h.bottom+d+p.y,y=g+u;if(!0!==r.overlap)for(let b of s)b.leftg&&b.topw&&(w=v?b.top-f-2-d:b.bottom+d+2);"absolute"==this.position?(l.style.top=w-t.parent.top+"px",l.style.left=g-t.parent.left+"px"):(l.style.top=w+"px",l.style.left=g+"px"),c&&(c.style.left=`${h.left+(m?p.x:-p.x)-(g+14-7)}px`),!0!==r.overlap&&s.push({left:g,top:w,right:y,bottom:w+f}),l.classList.toggle("cm-tooltip-above",v),l.classList.toggle("cm-tooltip-below",!v),r.positioned&&r.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=i2}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),i4=ir.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),i6={x:0,y:0},i7=l.r$.define({enables:[i5,i4]}),st=l.r$.define();class se{constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new i8(t,st,t=>this.createHostedView(t))}static create(t){return new se(t)}createHostedView(t){let e=t.create(this.view);return e.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(e.dom),this.mounted&&e.mount&&e.mount(this.view),e}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned()}update(t){this.manager.update(t)}}let si=i7.compute([st],t=>{let e=t.facet(st).filter(t=>t);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>null!=t.end).map(t=>t.end)),create:se.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class ss{constructor(t,e,i,s,o){this.view=t,this.source=e,this.field=i,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let t=Date.now()-this.lastMove.time;ti.bottom||t.xi.right+this.view.defaultCharacterWidth)return;let s=this.view.bidiSpans(this.view.state.doc.lineAt(e)).find(t=>t.from<=e&&t.to>=e),o=s&&s.dir==tF.RTL?-1:1,n=this.source(this.view,e,t.x{this.pending==r&&(this.pending=null,t&&this.view.dispatch({effects:this.setHover.of(t)}))},t=>tA(this.view.state,t,"hover tooltip"))}else n&&this.view.dispatch({effects:this.setHover.of(n)})}mousemove(t){var e;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!so(this.lastMove.target)||this.pending){let{pos:s}=i||this.pending,o=null!==(e=null==i?void 0:i.end)&&void 0!==e?e:s;(s==o?this.view.posAtCoords(this.lastMove)!=s:!function(t,e,i,s,o,n){let r=document.createRange(),l=t.domAtPos(e),h=t.domAtPos(i);r.setEnd(h.node,h.offset),r.setStart(l.node,l.offset);let a=r.getClientRects();r.detach();for(let c=0;c=Math.max(d.top-o,o-d.bottom,d.left-s,s-d.right))return!0}return!1}(this.view,s,o,t.clientX,t.clientY,0))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!so(t.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function so(t){for(let e=t;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip"))return!0;return!1}function sn(t,e={}){let i=l.Py.define(),s=l.QQ.define({create:()=>null,update(t,s){if(t&&(e.hideOnChange&&(s.docChanged||s.selection)||e.hideOn&&e.hideOn(s,t)))return null;if(t&&s.docChanged){let o=s.changes.mapPos(t.pos,-1,l.gc.TrackDel);if(null==o)return null;let n=Object.assign(Object.create(null),t);n.pos=o,null!=t.end&&(n.end=s.changes.mapPos(t.end)),t=n}for(let r of s.effects)r.is(i)&&(t=r.value),r.is(sl)&&(t=null);return t},provide:t=>st.from(t)});return[s,tR.define(o=>new ss(o,t,s,i,e.hoverTime||300)),si]}function sr(t,e){let i=t.plugin(i5);if(!i)return null;let s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s]}let sl=l.Py.define(),sh=l.r$.define({combine(t){let e,i;for(let s of t)e=e||s.topContainer,i=i||s.bottomContainer;return{topContainer:e,bottomContainer:i}}});function sa(t,e){let i=t.plugin(sc),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null}let sc=tR.fromClass(class{constructor(t){this.input=t.state.facet(sf),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(e=>e(t));let e=t.state.facet(sh);for(let i of(this.top=new sd(t,!0,e.topContainer),this.bottom=new sd(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top)),this.panels))i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(sh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new sd(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new sd(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(sf);if(i!=this.input){let s=i.filter(t=>t),o=[],n=[],r=[],l=[];for(let h of s){let a=this.specs.indexOf(h),c;a<0?(c=h(t.view),l.push(c)):(c=this.panels[a]).update&&c.update(t),o.push(c),(c.top?n:r).push(c)}for(let d of(this.specs=s,this.panels=o,this.top.sync(n),this.bottom.sync(r),l))d.dom.classList.add("cm-panel"),d.mount&&d.mount()}else for(let u of this.panels)u.update&&u.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ir.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class sd{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&0>t.indexOf(e)&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=su(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=su(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function su(t){let e=t.nextSibling;return t.remove(),e}let sf=l.r$.define({enables:sc});class sp extends l.uU{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}sp.prototype.elementClass="",sp.prototype.toDOM=void 0,sp.prototype.mapMode=l.gc.TrackBefore,sp.prototype.startSide=sp.prototype.endSide=-1,sp.prototype.point=!0;let sm=l.r$.define(),sg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>l.Xs.empty,lineMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},sv=l.r$.define();function sw(t){return[sb(),sv.of(Object.assign(Object.assign({},sg),t))]}let sy=l.r$.define({combine:t=>t.some(t=>t)});function sb(t){let e=[sx];return t&&!1===t.fixed&&e.push(sy.of(!0)),e}let sx=tR.fromClass(class{constructor(t){for(let e of(this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=t.state.facet(sv).map(e=>new sC(t,e)),this.gutters))this.dom.appendChild(e.dom);this.fixed=!t.state.facet(sy),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,s=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(s<(i.to-i.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(sy)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let i=l.Xs.iter(this.view.state.facet(sm),this.view.viewport.from),s=[],o=this.gutters.map(t=>new sk(t,this.view.viewport,-this.view.documentPadding.top));for(let n of this.view.viewportLineBlocks){let r;if(Array.isArray(n.type)){for(let h of n.type)if(h.type==to.Text){r=h;break}}else r=n.type==to.Text?n:void 0;if(r)for(let a of(s.length&&(s=[]),sM(i,s,n.from),o))a.line(this.view,r,s)}for(let c of o)c.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(sv),i=t.state.facet(sv),s=t.docChanged||t.heightChanged||t.viewportChanged||!l.Xs.eq(t.startState.facet(sm),t.state.facet(sm),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let o of this.gutters)o.update(t)&&(s=!0);else{s=!0;let n=[];for(let r of i){let h=e.indexOf(r);h<0?n.push(new sC(this.view,r)):(this.gutters[h].update(t),n.push(this.gutters[h]))}for(let a of this.gutters)a.dom.remove(),0>n.indexOf(a)&&a.destroy();for(let c of n)this.dom.appendChild(c.dom);this.gutters=n}return s}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>ir.scrollMargins.of(e=>{let i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==tF.LTR?{left:i.dom.offsetWidth}:{right:i.dom.offsetWidth}:null})});function sS(t){return Array.isArray(t)?t:[t]}function sM(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class sk{constructor(t,e,i){this.gutter=t,this.height=i,this.localMarkers=[],this.i=0,this.cursor=l.Xs.iter(t.markers,e.from)}line(t,e,i){this.localMarkers.length&&(this.localMarkers=[]),sM(this.cursor,this.localMarkers,e.from);let s=i.length?this.localMarkers.concat(i):this.localMarkers,o=this.gutter.config.lineMarker(t,e,s);o&&s.unshift(o);let n=this.gutter;if(0==s.length&&!n.config.renderEmptyElements)return;let r=e.top-this.height;if(this.i==n.elements.length){let l=new sA(t,e.height,r,s);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(t,e.height,r,s);this.height=e.bottom,this.i++}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class sC{constructor(t,e){for(let i in this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),e.domEventHandlers)this.dom.addEventListener(i,s=>{let o=t.lineBlockAtHeight(s.clientY-t.documentTop);e.domEventHandlers[i](t,o,s)&&s.preventDefault()});this.markers=sS(e.markers(t)),e.initialSpacer&&(this.spacer=new sA(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=sS(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let s=t.view.viewport;return!l.Xs.eq(this.markers,e,s.from,s.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class sA{constructor(t,e,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s)}update(t,e,i,s){this.height!=e&&(this.dom.style.height=(this.height=e)+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),!function(t,e){if(t.length!=e.length)return!1;for(let i=0;i(0,l.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let s in e){let o=i[s],n=e[s];i[s]=o?(t,e,i)=>o(t,e,i)||n(t,e,i):n}return i}})});class sO extends sp{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function sR(t,e){return t.state.facet(sT).formatNumber(e,t.state)}let sE=sv.compute([sT],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(sD),lineMarker:(t,e,i)=>i.some(t=>t.toDOM)?null:new sO(sR(t,t.state.doc.lineAt(e.from).number)),lineMarkerChange:t=>t.startState.facet(sT)!=t.state.facet(sT),initialSpacer:t=>new sO(sR(t,sL(t.state.doc.lines))),updateSpacer(t,e){let i=sR(e.view,sL(e.view.state.doc.lines));return i==t.number?t:new sO(i)},domEventHandlers:t.facet(sT).domEventHandlers}));function sB(t={}){return[sT.of(t),sb(),sE]}function sL(t){let e=9;for(;e{let e=[],i=-1;for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head).from;o>i&&(i=o,e.push(sV.range(o)))}return l.Xs.of(e)});function sN(){return sH}}}]); \ No newline at end of file diff --git a/static/web/_next/static/mkGTx9lVMlIhwJiHQzE-9/_buildManifest.js b/static/web/_next/static/f7TnkO0yIOPf5jnSXGKBM/_buildManifest.js similarity index 96% rename from static/web/_next/static/mkGTx9lVMlIhwJiHQzE-9/_buildManifest.js rename to static/web/_next/static/f7TnkO0yIOPf5jnSXGKBM/_buildManifest.js index aad958fab..69a3c47c5 100644 --- a/static/web/_next/static/mkGTx9lVMlIhwJiHQzE-9/_buildManifest.js +++ b/static/web/_next/static/f7TnkO0yIOPf5jnSXGKBM/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,a,c,e,i,t,d,n,f,b,h,o,m,u,k,r,g,j,p,l,_,w,v,y,I,B,F){return{__rewrites:{beforeFiles:[],afterFiles:[{source:"/api/:path*"},{source:"/hls/:path*"},{source:"/img/:path*"},{source:"/logo"},{source:"/thumbnail.jpg"}],fallback:[]},"/":[a,s,c,t,d,f,o,m,g,"static/chunks/8980-ed3298b2bcefdc65.js",b,"static/css/4480c029d7516206.css","static/chunks/pages/index-98ce467007d59c20.js"],"/_error":["static/chunks/pages/_error-02cc11fd74b4e5ff.js"],"/admin":[a,s,c,e,i,t,d,n,h,m,"static/chunks/8676-9693205d9b48d90d.js","static/chunks/pages/admin-9743bab3e8215a95.js"],"/admin/access-tokens":[a,s,c,e,i,"static/chunks/pages/admin/access-tokens-647bf15770f8de69.js"],"/admin/actions":[a,s,c,e,"static/chunks/pages/admin/actions-6130c774a7acaaaa.js"],"/admin/chat/messages":[j,a,s,c,e,i,d,p,"static/chunks/pages/admin/chat/messages-7a31c7f626fb8bec.js"],"/admin/chat/users":[j,a,s,c,e,i,t,d,p,"static/chunks/pages/admin/chat/users-39fb6345a4973ccf.js"],"/admin/config/appearance":[l,o,_,w,"static/css/6c8941159bdd16f6.css","static/chunks/pages/admin/config/appearance-32949ed54f5af9c5.js"],"/admin/config-chat":["static/chunks/pages/admin/config-chat-2d8f314ed2c642bf.js"],"/admin/config-federation":["static/chunks/1829-0eb93b8278101717.js","static/chunks/pages/admin/config-federation-b722e1bc8f0608b4.js"],"/admin/config-notify":["static/chunks/pages/admin/config-notify-2462c2f26ef3ddf1.js"],"/admin/config-public-details":[l,a,s,c,e,u,_,"static/chunks/1043-14d9ee8e305b7d46.js","static/chunks/pages/admin/config-public-details-a7869dcd92815edc.js"],"/admin/config-server-details":[v,"static/chunks/pages/admin/config-server-details-a148074a13faf6b7.js"],"/admin/config-social-items":[a,s,c,e,"static/chunks/pages/admin/config-social-items-ce13bfc436b5d6a9.js"],"/admin/config-storage":["static/chunks/pages/admin/config-storage-36a2bd13af05ae97.js"],"/admin/config-video":[a,s,c,e,v,"static/chunks/7326-d1457038bcb2631e.js","static/chunks/pages/admin/config-video-130a2f37c23239cf.js"],"/admin/federation/actions":[a,s,c,e,i,"static/chunks/pages/admin/federation/actions-78fd66c12ca134fb.js"],"/admin/federation/followers":[a,s,c,e,i,t,"static/chunks/pages/admin/federation/followers-3ec562a4246409e8.js"],"/admin/hardware-info":[k,i,t,n,h,r,u,"static/chunks/pages/admin/hardware-info-46d48f624d002e29.js"],"/admin/help":[t,n,o,w,"static/chunks/7830-b923a5bc4363fd63.js","static/chunks/pages/admin/help-cf300ec18943e98c.js"],"/admin/logs":[a,s,c,e,i,m,"static/chunks/pages/admin/logs-27fd8a9785eb4444.js"],"/admin/stream-health":[k,i,t,n,h,r,"static/chunks/2934-7e53ecb633cea33f.js","static/chunks/pages/admin/stream-health-b0b8adb3104c1426.js"],"/admin/upgrade":[a,s,c,e,"static/chunks/2069-45eeb5cd16bd7089.js","static/chunks/pages/admin/upgrade-f2dff185555ce8b4.js"],"/admin/viewer-info":[k,a,s,c,e,i,t,d,n,h,r,u,"static/chunks/pages/admin/viewer-info-91f77ca6adbf9cd7.js"],"/admin/webhooks":[a,s,c,e,"static/chunks/pages/admin/webhooks-f4de58dc6d71d032.js"],"/embed/chat/readonly":[y,I,f,B,b,F,"static/css/a97531dfaf987e89.css","static/chunks/pages/embed/chat/readonly-8691c428580148c9.js"],"/embed/chat/readwrite":[y,I,s,f,B,"static/chunks/911-ab40692bfb30c49e.js",b,F,"static/css/840d7a2c1c6fcb28.css","static/chunks/pages/embed/chat/readwrite-085229ff1a723635.js"],"/embed/video":["static/chunks/d6e1aeb5-10235c1a69554191.js",d,f,"static/css/7c735c05af084bb2.css","static/chunks/7902-20b0295e1ac2a055.js",g,b,"static/chunks/2239-356eb3e5578600fe.js","static/css/761481e63e7ebbee.css","static/chunks/pages/embed/video-bd051034577b5b63.js"],sortedPages:["/","/_app","/_error","/admin","/admin/access-tokens","/admin/actions","/admin/chat/messages","/admin/chat/users","/admin/config/appearance","/admin/config-chat","/admin/config-federation","/admin/config-notify","/admin/config-public-details","/admin/config-server-details","/admin/config-social-items","/admin/config-storage","/admin/config-video","/admin/federation/actions","/admin/federation/followers","/admin/hardware-info","/admin/help","/admin/logs","/admin/stream-health","/admin/upgrade","/admin/viewer-info","/admin/webhooks","/embed/chat/readonly","/embed/chat/readwrite","/embed/video"]}}("static/chunks/3903-9cbfaf7acb4d3371.js","static/chunks/8939-eda7d68f97fec02a.js","static/chunks/4267-1777f44d4766c201.js","static/chunks/3626-d5468240e26d70a2.js","static/chunks/8091-a6f276da992f1283.js","static/chunks/4381-8950542b0a2e52d1.js","static/chunks/5938-b5bac17e4fa31c49.js","static/chunks/5315-f2b245b2b53141f8.js","static/chunks/6395-982bd92523d8632a.js","static/chunks/7466-ff9ca0156f5ae223.js","static/chunks/4763-9e9e95131bc3a2f7.js","static/chunks/1082-6faa6106b5c12158.js","static/chunks/5360-e0e4b550194b07d1.js","static/chunks/7910-c08e4804be2001d2.js","static/chunks/3fff1979-8d1696e6e8bf7bc8.js","static/chunks/2139-45d397b25adef6af.js","static/chunks/8245-e46be43dd8c8766c.js","static/chunks/29107295-1453a3860b50f70e.js","static/chunks/7635-7a16767323b61021.js","static/chunks/4ad82c5e-f4c5e1bb80225462.js","static/chunks/1943-00ec23568327ea33.js","static/chunks/1938-b0f3946c8d62a1b3.js","static/chunks/3286-ce799b633708bdb2.js","static/chunks/d3048c20-a3e38fff4fb3204a.js","static/chunks/d2094a0f-43945b499b1f7318.js","static/chunks/2852-c69fa78b76fad306.js","static/chunks/4977-a3ad840d64183a0d.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,a,c,e,i,t,d,n,f,b,h,o,m,u,k,r,g,j,p,l,_,w,v,y,I,B,F){return{__rewrites:{beforeFiles:[],afterFiles:[{source:"/api/:path*"},{source:"/hls/:path*"},{source:"/img/:path*"},{source:"/logo"},{source:"/thumbnail.jpg"}],fallback:[]},"/":[a,s,c,t,d,f,o,m,g,"static/chunks/8980-ed3298b2bcefdc65.js",b,"static/css/4480c029d7516206.css","static/chunks/pages/index-98ce467007d59c20.js"],"/_error":["static/chunks/pages/_error-02cc11fd74b4e5ff.js"],"/admin":[a,s,c,e,i,t,d,n,h,m,"static/chunks/8676-9693205d9b48d90d.js","static/chunks/pages/admin-9743bab3e8215a95.js"],"/admin/access-tokens":[a,s,c,e,i,"static/chunks/pages/admin/access-tokens-647bf15770f8de69.js"],"/admin/actions":[a,s,c,e,"static/chunks/pages/admin/actions-6130c774a7acaaaa.js"],"/admin/chat/messages":[j,a,s,c,e,i,d,p,"static/chunks/pages/admin/chat/messages-7a31c7f626fb8bec.js"],"/admin/chat/users":[j,a,s,c,e,i,t,d,p,"static/chunks/pages/admin/chat/users-39fb6345a4973ccf.js"],"/admin/config/appearance":[l,o,_,w,"static/css/6c8941159bdd16f6.css","static/chunks/pages/admin/config/appearance-32949ed54f5af9c5.js"],"/admin/config-chat":["static/chunks/pages/admin/config-chat-2d8f314ed2c642bf.js"],"/admin/config-federation":["static/chunks/1829-0eb93b8278101717.js","static/chunks/pages/admin/config-federation-b722e1bc8f0608b4.js"],"/admin/config-notify":["static/chunks/pages/admin/config-notify-2462c2f26ef3ddf1.js"],"/admin/config-public-details":[l,a,s,c,e,u,_,"static/chunks/1043-14d9ee8e305b7d46.js","static/chunks/pages/admin/config-public-details-a7869dcd92815edc.js"],"/admin/config-server-details":[v,"static/chunks/pages/admin/config-server-details-a148074a13faf6b7.js"],"/admin/config-social-items":[a,s,c,e,"static/chunks/pages/admin/config-social-items-ce13bfc436b5d6a9.js"],"/admin/config-storage":["static/chunks/pages/admin/config-storage-36a2bd13af05ae97.js"],"/admin/config-video":[a,s,c,e,v,"static/chunks/7326-d1457038bcb2631e.js","static/chunks/pages/admin/config-video-130a2f37c23239cf.js"],"/admin/federation/actions":[a,s,c,e,i,"static/chunks/pages/admin/federation/actions-78fd66c12ca134fb.js"],"/admin/federation/followers":[a,s,c,e,i,t,"static/chunks/pages/admin/federation/followers-3ec562a4246409e8.js"],"/admin/hardware-info":[k,i,t,n,h,r,u,"static/chunks/pages/admin/hardware-info-46d48f624d002e29.js"],"/admin/help":[t,n,o,w,"static/chunks/7830-b923a5bc4363fd63.js","static/chunks/pages/admin/help-cf300ec18943e98c.js"],"/admin/logs":[a,s,c,e,i,m,"static/chunks/pages/admin/logs-27fd8a9785eb4444.js"],"/admin/stream-health":[k,i,t,n,h,r,"static/chunks/2934-7e53ecb633cea33f.js","static/chunks/pages/admin/stream-health-b0b8adb3104c1426.js"],"/admin/upgrade":[a,s,c,e,"static/chunks/2069-a148391615083e0c.js","static/chunks/pages/admin/upgrade-f2dff185555ce8b4.js"],"/admin/viewer-info":[k,a,s,c,e,i,t,d,n,h,r,u,"static/chunks/pages/admin/viewer-info-91f77ca6adbf9cd7.js"],"/admin/webhooks":[a,s,c,e,"static/chunks/pages/admin/webhooks-f4de58dc6d71d032.js"],"/embed/chat/readonly":[y,I,f,B,b,F,"static/css/a97531dfaf987e89.css","static/chunks/pages/embed/chat/readonly-8691c428580148c9.js"],"/embed/chat/readwrite":[y,I,s,f,B,"static/chunks/911-ab40692bfb30c49e.js",b,F,"static/css/840d7a2c1c6fcb28.css","static/chunks/pages/embed/chat/readwrite-085229ff1a723635.js"],"/embed/video":["static/chunks/d6e1aeb5-10235c1a69554191.js",d,f,"static/css/7c735c05af084bb2.css","static/chunks/7902-20b0295e1ac2a055.js",g,b,"static/chunks/2239-356eb3e5578600fe.js","static/css/761481e63e7ebbee.css","static/chunks/pages/embed/video-bd051034577b5b63.js"],sortedPages:["/","/_app","/_error","/admin","/admin/access-tokens","/admin/actions","/admin/chat/messages","/admin/chat/users","/admin/config/appearance","/admin/config-chat","/admin/config-federation","/admin/config-notify","/admin/config-public-details","/admin/config-server-details","/admin/config-social-items","/admin/config-storage","/admin/config-video","/admin/federation/actions","/admin/federation/followers","/admin/hardware-info","/admin/help","/admin/logs","/admin/stream-health","/admin/upgrade","/admin/viewer-info","/admin/webhooks","/embed/chat/readonly","/embed/chat/readwrite","/embed/video"]}}("static/chunks/3903-9cbfaf7acb4d3371.js","static/chunks/8939-eda7d68f97fec02a.js","static/chunks/4267-1777f44d4766c201.js","static/chunks/3626-d5468240e26d70a2.js","static/chunks/8091-a6f276da992f1283.js","static/chunks/4381-8950542b0a2e52d1.js","static/chunks/5938-b5bac17e4fa31c49.js","static/chunks/5315-f2b245b2b53141f8.js","static/chunks/6395-982bd92523d8632a.js","static/chunks/7466-ff9ca0156f5ae223.js","static/chunks/4763-9e9e95131bc3a2f7.js","static/chunks/1082-6faa6106b5c12158.js","static/chunks/5360-e0e4b550194b07d1.js","static/chunks/7910-c08e4804be2001d2.js","static/chunks/3fff1979-8d1696e6e8bf7bc8.js","static/chunks/2139-45d397b25adef6af.js","static/chunks/8245-e46be43dd8c8766c.js","static/chunks/29107295-1453a3860b50f70e.js","static/chunks/7635-7a16767323b61021.js","static/chunks/4ad82c5e-fc50c092be65fd31.js","static/chunks/1943-59cf60c8459758f9.js","static/chunks/1938-b0f3946c8d62a1b3.js","static/chunks/3286-ce799b633708bdb2.js","static/chunks/d3048c20-a3e38fff4fb3204a.js","static/chunks/d2094a0f-43945b499b1f7318.js","static/chunks/2852-c69fa78b76fad306.js","static/chunks/4977-a3ad840d64183a0d.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/static/web/_next/static/mkGTx9lVMlIhwJiHQzE-9/_ssgManifest.js b/static/web/_next/static/f7TnkO0yIOPf5jnSXGKBM/_ssgManifest.js similarity index 100% rename from static/web/_next/static/mkGTx9lVMlIhwJiHQzE-9/_ssgManifest.js rename to static/web/_next/static/f7TnkO0yIOPf5jnSXGKBM/_ssgManifest.js diff --git a/static/web/admin/access-tokens/index.html b/static/web/admin/access-tokens/index.html index 80cf12b8a..f01a788ed 100644 --- a/static/web/admin/access-tokens/index.html +++ b/static/web/admin/access-tokens/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No data

\ No newline at end of file diff --git a/static/web/admin/actions/index.html b/static/web/admin/actions/index.html index ed7feb522..90346ad5e 100644 --- a/static/web/admin/actions/index.html +++ b/static/web/admin/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No data

\ No newline at end of file diff --git a/static/web/admin/chat/messages/index.html b/static/web/admin/chat/messages/index.html index f54c3d241..7b96a893c 100644 --- a/static/web/admin/chat/messages/index.html +++ b/static/web/admin/chat/messages/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No data
\ No newline at end of file diff --git a/static/web/admin/chat/users/index.html b/static/web/admin/chat/users/index.html index 6aa789f40..b84e84595 100644 --- a/static/web/admin/chat/users/index.html +++ b/static/web/admin/chat/users/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file diff --git a/static/web/admin/config-chat/index.html b/static/web/admin/config-chat/index.html index c7b2e6d86..86866cd05 100644 --- a/static/web/admin/config-chat/index.html +++ b/static/web/admin/config-chat/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/config-federation/index.html b/static/web/admin/config-federation/index.html index b3f9da7ec..e1effb2bd 100644 --- a/static/web/admin/config-federation/index.html +++ b/static/web/admin/config-federation/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/config-notify/index.html b/static/web/admin/config-notify/index.html index fd21aab7c..9928f7450 100644 --- a/static/web/admin/config-notify/index.html +++ b/static/web/admin/config-notify/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Notifications

Let your viewers know when you go live by supporting any of the below notification channels. Learn more about live notifications.


The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

Browser Alerts

Viewers can opt into being notified when you go live with their browser.

Not all browsers support this.

Enable browser notifications

The text to send when you go live.

Twitter

Let your Twitter followers know each time you go live.

Enable Twitter

The text to send when you go live.

Discord

Let your Discord channel know each time you go live.

Create a webhook under Edit Channel / Integrations on your Discord channel and provide it below.

Enable Discord

The webhook assigned to your channel.

The text to send when you go live.

Fediverse Social

Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality.

Fediverse social features: Disabled

Custom

Build your own notifications by using custom webhooks.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Notifications

Let your viewers know when you go live by supporting any of the below notification channels. Learn more about live notifications.


The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

Browser Alerts

Viewers can opt into being notified when you go live with their browser.

Not all browsers support this.

Enable browser notifications

The text to send when you go live.

Twitter

Let your Twitter followers know each time you go live.

Enable Twitter

The text to send when you go live.

Discord

Let your Discord channel know each time you go live.

Create a webhook under Edit Channel / Integrations on your Discord channel and provide it below.

Enable Discord

The webhook assigned to your channel.

The text to send when you go live.

Fediverse Social

Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality.

Fediverse social features: Disabled

Custom

Build your own notifications by using custom webhooks.

\ No newline at end of file diff --git a/static/web/admin/config-public-details/index.html b/static/web/admin/config-public-details/index.html index 08e715fa9..fd3d62603 100644 --- a/static/web/admin/config-public-details/index.html +++ b/static/web/admin/config-public-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


\ No newline at end of file diff --git a/static/web/admin/config-server-details/index.html b/static/web/admin/config-server-details/index.html index 51a803637..2bda4979f 100644 --- a/static/web/admin/config-server-details/index.html +++ b/static/web/admin/config-server-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file diff --git a/static/web/admin/config-social-items/index.html b/static/web/admin/config-social-items/index.html index 0fe435491..99cd59e06 100644 --- a/static/web/admin/config-social-items/index.html +++ b/static/web/admin/config-social-items/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file diff --git a/static/web/admin/config-storage/index.html b/static/web/admin/config-storage/index.html index 95f48d5cd..a09aa692b 100644 --- a/static/web/admin/config-storage/index.html +++ b/static/web/admin/config-storage/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file diff --git a/static/web/admin/config-video/index.html b/static/web/admin/config-video/index.html index e79d07d71..52909fdee 100644 --- a/static/web/admin/config-video/index.html +++ b/static/web/admin/config-video/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file diff --git a/static/web/admin/config/appearance/index.html b/static/web/admin/config/appearance/index.html index 0fa0590f2..fa169a36e 100644 --- a/static/web/admin/config/appearance/index.html +++ b/static/web/admin/config/appearance/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
Loading...
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
Loading...
\ No newline at end of file diff --git a/static/web/admin/federation/actions/index.html b/static/web/admin/federation/actions/index.html index 21180562b..53a9003fa 100644 --- a/static/web/admin/federation/actions/index.html +++ b/static/web/admin/federation/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Fediverse Actions

Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you.
ActionFromWhen
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Fediverse Actions

Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you.
ActionFromWhen
No data
\ No newline at end of file diff --git a/static/web/admin/federation/followers/index.html b/static/web/admin/federation/followers/index.html index 8e97dca4c..d71a51b5f 100644 --- a/static/web/admin/federation/followers/index.html +++ b/static/web/admin/federation/followers/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

The following accounts get notified when you go live or send a post.

NameURL
Added
Remove
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

The following accounts get notified when you go live or send a post.

NameURL
Added
Remove
No data
\ No newline at end of file diff --git a/static/web/admin/hardware-info/index.html b/static/web/admin/hardware-info/index.html index f8eb3eec7..f706dde86 100644 --- a/static/web/admin/hardware-info/index.html +++ b/static/web/admin/hardware-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


CPU
0%
Memory
0%
Disk
0%
Loading...
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


CPU
0%
Memory
0%
Disk
0%
Loading...
\ No newline at end of file diff --git a/static/web/admin/help/index.html b/static/web/admin/help/index.html index 51e85f119..6978fd9cc 100644 --- a/static/web/admin/help/index.html +++ b/static/web/admin/help/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file diff --git a/static/web/admin/index.html b/static/web/admin/index.html index b83164cdc..d74fca0ec 100644 --- a/static/web/admin/index.html +++ b/static/web/admin/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
fediverse
Add your Owncast instance to the Fediverse
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.

News & Updates from Owncast

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
fediverse
Add your Owncast instance to the Fediverse
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.

News & Updates from Owncast

\ No newline at end of file diff --git a/static/web/admin/logs/index.html b/static/web/admin/logs/index.html index c52c41e6e..f1bb969b8 100644 --- a/static/web/admin/logs/index.html +++ b/static/web/admin/logs/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/stream-health/index.html b/static/web/admin/stream-health/index.html index 8d0b7888c..f769a3811 100644 --- a/static/web/admin/stream-health/index.html +++ b/static/web/admin/stream-health/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Stream Performance

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Stream Performance

\ No newline at end of file diff --git a/static/web/admin/upgrade/index.html b/static/web/admin/upgrade/index.html index 43ca2a571..7d886554e 100644 --- a/static/web/admin/upgrade/index.html +++ b/static/web/admin/upgrade/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No data
\ No newline at end of file diff --git a/static/web/admin/viewer-info/index.html b/static/web/admin/viewer-info/index.html index da0b62aff..bb3671110 100644 --- a/static/web/admin/viewer-info/index.html +++ b/static/web/admin/viewer-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Viewer Info


Max viewers last stream
0
All-time max viewers
0
User AgentLocation
Watch Time
No data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Viewer Info


Max viewers last stream
0
All-time max viewers
0
User AgentLocation
Watch Time
No data
\ No newline at end of file diff --git a/static/web/admin/webhooks/index.html b/static/web/admin/webhooks/index.html index 16ebb2cb3..353da019b 100644 --- a/static/web/admin/webhooks/index.html +++ b/static/web/admin/webhooks/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No data

\ No newline at end of file diff --git a/static/web/embed/chat/readonly/index.html b/static/web/embed/chat/readonly/index.html index e78c0aed4..6e45470af 100644 --- a/static/web/embed/chat/readonly/index.html +++ b/static/web/embed/chat/readonly/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/static/web/embed/chat/readwrite/index.html b/static/web/embed/chat/readwrite/index.html index 0c6e19c94..1e84070cc 100644 --- a/static/web/embed/chat/readwrite/index.html +++ b/static/web/embed/chat/readwrite/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/static/web/embed/video/index.html b/static/web/embed/video/index.html index 46343f7e8..44676630a 100644 --- a/static/web/embed/video/index.html +++ b/static/web/embed/video/index.html @@ -1 +1 @@ -
This stream is offline. Check back soon!
\ No newline at end of file +
This stream is offline. Check back soon!
\ No newline at end of file diff --git a/static/web/index.html b/static/web/index.html index 07d989b90..5c3371c6e 100644 --- a/static/web/index.html +++ b/static/web/index.html @@ -1,9 +1,9 @@ {{.Name}}
{{.Name}}
Logo
Preview
\ No newline at end of file +
Logo
Preview
\ No newline at end of file