p3x-redis-ui-material
Version:
💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io
1 lines • 52.8 kB
JavaScript
"use strict";(self.webpackChunkp3x_redis_ui_material=self.webpackChunkp3x_redis_ui_material||[]).push([[9668],{22828(t,e,r){r.d(e,{EI:()=>B,KB:()=>P,Oh:()=>M,Xt:()=>N,Yy:()=>_,_v:()=>E,b_:()=>W,bj:()=>p,bracketMatching:()=>Bt,cr:()=>dt,defaultHighlightStyle:()=>kt,foldGutter:()=>ut,foldKeymap:()=>rt,indentOnInput:()=>U,jU:()=>It,mv:()=>g,mz:()=>L,syntaxHighlighting:()=>bt,tp:()=>O,yd:()=>H});var n,i=r(80919),s=r(41762),o=r(43599),l=r(7398),a=r(50079);const h=new i.uY;function f(t){return s.sj.define({combine:t?e=>e.concat(t):void 0})}const u=new i.uY;class c{constructor(t,e,r=[],n=""){this.data=t,this.name=n,s.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(s.EditorState.prototype,"tree",{get(){return g(this)}}),this.parser=e,this.extension=[S.of(this),s.EditorState.languageData.of(((t,e,r)=>{let n=d(t,e,r),i=n.type.prop(h);if(!i)return[];let s=t.facet(i),o=n.type.prop(u);if(o){let i=n.resolve(e-n.from,r);for(let e of o)if(e.test(i,t)){let r=t.facet(e.facet);return"replace"==e.type?r:r.concat(s)}}return s}))].concat(r)}isActiveAt(t,e,r=-1){return d(t,e,r).type.prop(h)==this.data}findRegions(t){let e=t.facet(S);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let r=[],n=(t,e)=>{if(t.prop(h)==this.data)return void r.push({from:e,to:e+t.length});let s=t.prop(i.uY.mounted);if(s){if(s.tree.prop(h)==this.data){if(s.overlay)for(let t of s.overlay)r.push({from:t.from+e,to:t.to+e});else r.push({from:e,to:e+t.length});return}if(s.overlay){let t=r.length;if(n(s.tree,s.overlay[0].from+e),r.length>t)return}}for(let r=0;r<t.children.length;r++){let s=t.children[r];s instanceof i.PH&&n(s,t.positions[r]+e)}};return n(g(t),0),r}get allowsNesting(){return!0}}function d(t,e,r){let n=t.facet(S),s=g(t).topNode;if(!n||n.allowsNesting)for(let t=s;t;t=t.enter(e,r,i.Qj.ExcludeBuffers|i.Qj.EnterBracketed))t.type.isTop&&(s=t);return s}c.setState=s.Pe.define();class p extends c{constructor(t,e,r){super(t,e,[],r),this.parser=e}static define(t){let e=f(t.languageData);return new p(e,t.parser.configure({props:[h.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new p(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function g(t){let e=t.field(c.state,!1);return e?e.tree:i.PH.empty}class m{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let r=this.cursorPos-this.string.length;return t<r||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-r,e-r)}}let b=null;class x{constructor(t,e,r=[],n,i,s,o,l){this.parser=t,this.state=e,this.fragments=r,this.tree=n,this.treeLen=i,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,e,r){return new x(t,e,[],i.PH.empty,0,r,[],null)}startParse(){return this.parser.startParse(new m(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=i.PH.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var r;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(i.rr.addTree(n,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(r=this.parse.stoppedAt)&&void 0!==r?r:this.state.doc.length,this.tree=n,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(i.rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=b;b=this;try{return t()}finally{b=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=y(t,e.from,e.to);return t}changes(t,e){let{fragments:r,tree:n,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,r,n,i)=>e.push({fromA:t,toA:r,fromB:n,toB:i}))),r=i.rr.applyChanges(r,e),n=i.PH.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let e of this.skipped){let r=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);r<n&&l.push({from:r,to:n})}}}return new x(this.parser,e,r,n,s,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:r,to:n}=this.skipped[e];r<t.to&&n>t.from&&(this.fragments=y(this.fragments,r,n),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends i.iX{createParse(e,r,n){let s=n[0].from,o=n[n.length-1].to;return{parsedPos:s,advance(){let e=b;if(e){for(let t of n)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new i.PH(i.Z6.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return b}}function y(t,e,r){return i.rr.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class k{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,r)||e.takeTree(),new k(e)}static init(t){let e=Math.min(3e3,t.doc.length),r=x.create(t.facet(S).parser,t,{from:0,to:e});return r.work(20,e)||r.takeTree(),new k(r)}}c.state=s.sU.define({create:k.init,update(t,e){for(let t of e.effects)if(t.is(c.setState))return t.value;return e.startState.facet(S)!=e.state.facet(S)?k.init(e.state):t.apply(e)}});let w=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(w=t=>{let e=-1,r=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const v="undefined"!=typeof navigator&&(null===(n=navigator.scheduling)||void 0===n?void 0:n.isInputPending)?()=>navigator.scheduling.isInputPending():null,A=o.Z9.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(c.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(c.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=w(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:n}}=this.view,i=r.field(c.state);if(i.tree==i.context.tree&&i.context.isDone(n+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!v?Math.max(25,t.timeRemaining()-5):1e9),o=i.context.treeLen<n&&r.doc.length>n+1e3,l=i.context.work((()=>v&&v()||Date.now()>s),n+(o?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:c.setState.of(new k(i.context))})),this.chunkBudget>0&&(!l||o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>(0,o.c_)(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),S=s.sj.define({combine:t=>t.length?t[0]:null,enables:t=>[c.state,A,o.EditorView.contentAttributes.compute([t],(e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}}))]});class _{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const C=s.sj.define(),N=s.sj.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function O(t){let e=t.facet(N);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function B(t,e){let r="",n=t.tabSize,i=t.facet(N)[0];if("\t"==i){for(;e>=n;)r+="\t",e-=n;i=" "}for(let t=0;t<e;t++)r+=i;return r}function E(t,e){t instanceof s.EditorState&&(t=new P(t));for(let r of t.state.facet(C)){let n=r(t,e);if(void 0!==n)return n}let r=g(t.state);return r.length>=e?function(t,e,r){let n=e.resolveStack(r),i=e.resolveInner(r,-1).resolve(r,0).enterUnfinishedNodesBefore(r);if(i!=n.node){let t=[];for(let e=i;e&&!(e.from<n.node.from||e.to>n.node.to||e.from==n.node.from&&e.type==n.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)n={node:t[e],next:n}}return I(n,t,r)}(t,r,e):null}class P{constructor(t,e={}){this.state=t,this.options=e,this.unit=O(t)}lineAt(t,e=1){let r=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:i}=this.options;return null!=n&&n>=r.from&&n<=r.to?i&&n==t?{text:"",from:t}:(e<0?n<t:n<=t)?{text:r.text.slice(n-r.from),from:n}:{text:r.text.slice(0,n-r.from),from:r.from}:r}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:n}=this.lineAt(t,e);return r.slice(t-n,Math.min(r.length,t+100-n))}column(t,e=1){let{text:r,from:n}=this.lineAt(t,e),i=this.countColumn(r,t-n),s=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return s>-1&&(i+=s-this.countColumn(r,r.search(/\S|$/))),i}countColumn(t,e=t.length){return(0,s.y$)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:r,from:n}=this.lineAt(t,e),i=this.options.overrideIndentation;if(i){let t=i(n);if(t>-1)return t}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const M=new i.uY;function I(t,e,r){for(let n=t;n;n=n.next){let t=T(n.node);if(t)return t(j.create(e,r,n))}return 0}function T(t){let e=t.type.prop(M);if(e)return e;let r,n=t.firstChild;if(n&&(r=n.type.prop(i.uY.closedBy))){let e=t.lastChild,n=e&&r.indexOf(e.name)>-1;return t=>R(t,!0,1,void 0,n&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?D:null}function D(){return 0}class j extends P{constructor(t,e,r){super(t.state,t.options),this.base=t,this.pos=e,this.context=r}get node(){return this.context.node}static create(t,e,r){return new j(t,e,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(e.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(z(r,t))break;e=this.state.doc.lineAt(r.from)}return this.lineIndent(e.from)}continue(){return I(this.context.next,this.base,this.pos)}}function z(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function R(t,e,r,n,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||i==t.pos+o,a=e?function(t){let e=t.node,r=e.childAfter(e.from),n=e.lastChild;if(!r)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(r.from),o=null==i||i<=s.from?s.to:Math.min(s.to,i);for(let t=r.to;;){let i=e.childAfter(t);if(!i||i==n)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let t=/^ */.exec(s.text.slice(r.to-s.from))[0].length;return{from:r.from,to:r.to+t}}t=i.to}}(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*r)}function L({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}function U(){return s.EditorState.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let r=t.newDoc,{head:n}=t.newSelection.main,i=r.lineAt(n);if(n>i.from+200)return t;let s=r.sliceString(i.from,n);if(!e.some((t=>t.test(s))))return t;let{state:o}=t,l=-1,a=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==l)continue;l=e.from;let r=E(o,e.from);if(null==r)continue;let n=/^\s*/.exec(e.text)[0],i=B(o,r);n!=i&&a.push({from:e.from,to:e.from+n.length,insert:i})}return a.length?[t,{changes:a,sequential:!0}]:t}))}const Z=s.sj.define(),W=new i.uY;function H(t){let e=t.firstChild,r=t.lastChild;return e&&e.to<r.from?{from:e.to,to:r.type.isError?t.to:r.from}:null}function V(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Y(t,e,r){for(let n of t.facet(Z)){let i=n(t,e,r);if(i)return i}return function(t,e,r){let n=g(t);if(n.length<r)return null;let i=null;for(let s=n.resolveStack(r,1);s;s=s.next){let o=s.node;if(o.to<=r||o.from>r)continue;if(i&&o.from<e)break;let l=o.type.prop(W);if(l&&(o.to<n.length-50||n.length==t.doc.length||!V(o))){let n=l(o,t);n&&n.from<=r&&n.from>=e&&n.to>r&&(i=n)}}return i}(t,e,r)}function $(t,e){let r=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return r>=n?void 0:{from:r,to:n}}const q=s.Pe.define({map:$}),F=s.Pe.define({map:$});function J(t){let e=[];for(let{head:r}of t.state.selection.ranges)e.some((t=>t.from<=r&&t.to>=r))||e.push(t.lineBlockAt(r));return e}const K=s.sU.define({create:()=>o.NZ.none,update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges(((e,r)=>t=G(t,e,r))),t=t.map(e.changes);for(let r of e.effects)if(r.is(q)&&!X(t,r.value.from,r.value.to)){let{preparePlaceholder:n}=e.state.facet(it),i=n?o.NZ.replace({widget:new at(n(e.state,r.value))}):lt;t=t.update({add:[i.range(r.value.from,r.value.to)]})}else r.is(F)&&(t=t.update({filter:(t,e)=>r.value.from!=t||r.value.to!=e,filterFrom:r.value.from,filterTo:r.value.to}));return e.selection&&(t=G(t,e.selection.main.head)),t},provide:t=>o.EditorView.decorations.from(t),toJSON(t,e){let r=[];return t.between(0,e.doc.length,((t,e)=>{r.push(t,e)})),r},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let r=0;r<t.length;){let n=t[r++],i=t[r++];if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid JSON for fold state");e.push(lt.range(n,i))}return o.NZ.set(e,!0)}});function G(t,e,r=e){let n=!1;return t.between(e,r,((t,i)=>{t<r&&i>e&&(n=!0)})),n?t.update({filterFrom:e,filterTo:r,filter:(t,n)=>t>=r||n<=e}):t}function Q(t,e,r){var n;let i=null;return null===(n=t.field(K,!1))||void 0===n||n.between(e,r,((t,e)=>{(!i||i.from>t)&&(i={from:t,to:e})})),i}function X(t,e,r){let n=!1;return t.between(e,e,((t,i)=>{t==e&&i==r&&(n=!0)})),n}function tt(t,e){return t.field(K,!1)?e:e.concat(s.Pe.appendConfig.of(st()))}function et(t,e,r=!0){let n=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return o.EditorView.announce.of(`${t.state.phrase(r?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`)}const rt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of J(t)){let r=Y(t.state,e.from,e.to);if(r)return t.dispatch({effects:tt(t.state,[q.of(r),et(t,r)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(K,!1))return!1;let e=[];for(let r of J(t)){let n=Q(t.state,r.from,r.to);n&&e.push(F.of(n),et(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,r=[];for(let n=0;n<e.doc.length;){let i=t.lineBlockAt(n),s=Y(e,i.from,i.to);s&&r.push(q.of(s)),n=(s?t.lineBlockAt(s.to):i).to+1}return r.length&&t.dispatch({effects:tt(t.state,r)}),!!r.length}},{key:"Ctrl-Alt-]",run:t=>{let e=t.state.field(K,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,((t,e)=>{r.push(F.of({from:t,to:e}))})),t.dispatch({effects:r}),!0}}],nt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},it=s.sj.define({combine:t=>(0,s.QR)(t,nt)});function st(t){let e=[K,ct];return t&&e.push(it.of(t)),e}function ot(t,e){let{state:r}=t,n=r.facet(it),i=e=>{let r=t.lineBlockAt(t.posAtDOM(e.target)),n=Q(t.state,r.from,r.to);n&&t.dispatch({effects:F.of(n)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",r.phrase("folded code")),s.title=r.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const lt=o.NZ.replace({widget:new class extends o.xO{toDOM(t){return ot(t,null)}}});class at extends o.xO{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return ot(t,this.value)}}const ht={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ft extends o.wJ{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function ut(t={}){let e={...ht,...t},r=new ft(e,!0),n=new ft(e,!1),i=o.Z9.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(S)!=t.state.facet(S)||t.startState.field(K,!1)!=t.state.field(K,!1)||g(t.startState)!=g(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new s.vB;for(let i of t.viewportLineBlocks){let s=Q(t.state,i.from,i.to)?n:Y(t.state,i.from,i.to)?r:null;s&&e.add(i.from,i.from,s)}return e.finish()}}),{domEventHandlers:l}=e;return[i,(0,o.cU)({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(i))||void 0===e?void 0:e.markers)||s.om.empty},initialSpacer:()=>new ft(e,!1),domEventHandlers:{...l,click:(t,e,r)=>{if(l.click&&l.click(t,e,r))return!0;let n=Q(t.state,e.from,e.to);if(n)return t.dispatch({effects:F.of(n)}),!0;let i=Y(t.state,e.from,e.to);return!!i&&(t.dispatch({effects:q.of(i)}),!0)}}}),st()]}const ct=o.EditorView.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 dt{constructor(t,e){let r;function n(t){let e=a.G.newName();return(r||(r=Object.create(null)))["."+e]=t,e}this.specs=t;const i="string"==typeof e.all?e.all:e.all?n(e.all):void 0,s=e.scope;this.scope=s instanceof c?t=>t.prop(h)==s.data:s?t=>t==s:void 0,this.style=(0,l.az)(t.map((t=>({tag:t.tag,class:t.class||n(Object.assign({},t,{tag:null}))}))),{all:i}).style,this.module=r?new a.G(r):null,this.themeType=e.themeType}static define(t,e){return new dt(t,e||{})}}const pt=s.sj.define(),gt=s.sj.define({combine:t=>t.length?[t[0]]:null});function mt(t){let e=t.facet(pt);return e.length?e:t.facet(gt)}function bt(t,e){let r,n=[yt];return t instanceof dt&&(t.module&&n.push(o.EditorView.styleModule.of(t.module)),r=t.themeType),(null==e?void 0:e.fallback)?n.push(gt.of(t)):r?n.push(pt.computeN([o.EditorView.darkTheme],(e=>e.facet(o.EditorView.darkTheme)==("dark"==r)?[t]:[]))):n.push(pt.of(t)),n}class xt{constructor(t){this.markCache=Object.create(null),this.tree=g(t.state),this.decorations=this.buildDeco(t,mt(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=g(t.state),r=mt(t.state),n=r!=mt(t.startState),{viewport:i}=t.view,s=t.changes.mapPos(this.decoratedTo,1);e.length<i.to&&!n&&e.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=i.to)}buildDeco(t,e){if(!e||!this.tree.length)return o.NZ.none;let r=new s.vB;for(let{from:n,to:i}of t.visibleRanges)(0,l.DM)(this.tree,e,((t,e,n)=>{r.add(t,e,this.markCache[n]||(this.markCache[n]=o.NZ.mark({class:n})))}),n,i);return r.finish()}}const yt=s.Nb.high(o.Z9.fromClass(xt,{decorations:t=>t.decorations})),kt=dt.define([{tag:l._A.meta,color:"#404740"},{tag:l._A.link,textDecoration:"underline"},{tag:l._A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:l._A.emphasis,fontStyle:"italic"},{tag:l._A.strong,fontWeight:"bold"},{tag:l._A.strikethrough,textDecoration:"line-through"},{tag:l._A.keyword,color:"#708"},{tag:[l._A.atom,l._A.bool,l._A.url,l._A.contentSeparator,l._A.labelName],color:"#219"},{tag:[l._A.literal,l._A.inserted],color:"#164"},{tag:[l._A.string,l._A.deleted],color:"#a11"},{tag:[l._A.regexp,l._A.escape,l._A.special(l._A.string)],color:"#e40"},{tag:l._A.definition(l._A.variableName),color:"#00f"},{tag:l._A.local(l._A.variableName),color:"#30a"},{tag:[l._A.typeName,l._A.namespace],color:"#085"},{tag:l._A.className,color:"#167"},{tag:[l._A.special(l._A.variableName),l._A.macroName],color:"#256"},{tag:l._A.definition(l._A.propertyName),color:"#00c"},{tag:l._A.comment,color:"#940"},{tag:l._A.invalid,color:"#f00"}]),wt=o.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),vt="()[]{}",At=s.sj.define({combine:t=>(0,s.QR)(t,{afterCursor:!0,brackets:vt,maxScanDistance:1e4,renderMatch:Ct})}),St=o.NZ.mark({class:"cm-matchingBracket"}),_t=o.NZ.mark({class:"cm-nonmatchingBracket"});function Ct(t){let e=[],r=t.matched?St:_t;return e.push(r.range(t.start.from,t.start.to)),t.end&&e.push(r.range(t.end.from,t.end.to)),e}function Nt(t){let e=[],r=t.facet(At);for(let n of t.selection.ranges){if(!n.empty)continue;let i=It(t,n.head,-1,r)||n.head>0&&It(t,n.head-1,1,r)||r.afterCursor&&(It(t,n.head,1,r)||n.head<t.doc.length&&It(t,n.head+1,-1,r));i&&(e=e.concat(r.renderMatch(i,t)))}return o.NZ.set(e,!0)}const Ot=[o.Z9.fromClass(class{constructor(t){this.paused=!1,this.decorations=Nt(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=Nt(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),wt];function Bt(t={}){return[At.of(t),Ot]}const Et=new i.uY;function Pt(t,e,r){let n=t.prop(e<0?i.uY.openedBy:i.uY.closedBy);if(n)return n;if(1==t.name.length){let n=r.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[r[n+e]]}return null}function Mt(t){let e=t.type.prop(Et);return e?e(t.node):t}function It(t,e,r,n={}){let i=n.maxScanDistance||1e4,s=n.brackets||vt,o=g(t),l=o.resolveInner(e,r);for(let n=l;n;n=n.parent){let i=Pt(n.type,r,s);if(i&&n.from<n.to){let o=Mt(n);if(o&&(r>0?e>=o.from&&e<o.to:e>o.from&&e<=o.to))return Tt(t,e,r,n,o,i,s)}}return function(t,e,r,n,i,s,o){if(r<0?!e:e==t.doc.length)return null;let l=r<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=r>0)return null;let h={from:r<0?e-1:e,to:r>0?e+1:e},f=t.doc.iterRange(e,r>0?t.doc.length:0),u=0;for(let t=0;!f.next().done&&t<=s;){let s=f.value;r<0&&(t+=s.length);let l=e+t*r;for(let t=r>0?0:s.length-1,e=r>0?s.length:-1;t!=e;t+=r){let e=o.indexOf(s[t]);if(!(e<0||n.resolveInner(l+t,1).type!=i))if(e%2==0==r>0)u++;else{if(1==u)return{start:h,end:{from:l+t,to:l+t+1},matched:e>>1==a>>1};u--}}r>0&&(t+=s.length)}return f.done?{start:h,matched:!1}:null}(t,e,r,o,l.type,i,s)}function Tt(t,e,r,n,i,s,o){let l=n.parent,a={from:i.from,to:i.to},h=0,f=null==l?void 0:l.cursor();if(f&&(r<0?f.childBefore(n.from):f.childAfter(n.to)))do{if(r<0?f.to<=n.from:f.from>=n.to){if(0==h&&s.indexOf(f.type.name)>-1&&f.from<f.to){let t=Mt(f);return{start:a,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Pt(f.type,r,o))h++;else if(Pt(f.type,-r,o)){if(0==h){let t=Mt(f);return{start:a,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}h--}}}while(r<0?f.prevSibling():f.nextSibling());return{start:a,matched:!1}}const Dt=Object.create(null),jt=[i.Z6.none],zt=[],Rt=Object.create(null),Lt=Object.create(null);for(let[t,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"]])Lt[t]=Zt(Dt,e);function Ut(t,e){zt.indexOf(t)>-1||(zt.push(t),console.warn(e))}function Zt(t,e){let r=[];for(let n of e.split(" ")){let e=[];for(let r of n.split(".")){let n=t[r]||l._A[r];n?"function"==typeof n?e.length?e=e.map(n):Ut(r,`Modifier ${r} used at start of tag`):e.length?Ut(r,`Tag ${r} used as modifier`):e=Array.isArray(n)?n:[n]:Ut(r,`Unknown highlighting tag ${r}`)}for(let t of e)r.push(t)}if(!r.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+r.map((t=>t.id)),o=Rt[s];if(o)return o.id;let a=Rt[s]=i.Z6.define({id:jt.length,name:n,props:[(0,l.pn)({[n]:r})]});return jt.push(a),a.id}o.OP.RTL,o.OP.LTR},80919(t,e,r){r.d(e,{PH:()=>p,Qj:()=>d,Z6:()=>h,cF:()=>n,fI:()=>f,iX:()=>I,rr:()=>M,uY:()=>o});const n=1024;let i=0;class s{constructor(t,e){this.from=t,this.to=e}}class o{constructor(t={}){this.id=i++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=h.match(t)),e=>{let r=t(e);return void 0===r?null:[this,r]}}}o.closedBy=new o({deserialize:t=>t.split(" ")}),o.openedBy=new o({deserialize:t=>t.split(" ")}),o.group=new o({deserialize:t=>t.split(" ")}),o.isolate=new o({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),o.contextHash=new o({perNode:!0}),o.lookAhead=new o({perNode:!0}),o.mounted=new o({perNode:!0});class l{constructor(t,e,r,n=!1){this.tree=t,this.overlay=e,this.parser=r,this.bracketed=n}static get(t){return t&&t.props&&t.props[o.mounted.id]}}const a=Object.create(null);class h{constructor(t,e,r,n=0){this.name=t,this.props=e,this.id=r,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):a,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new h(t.name||"",e,t.id,r);if(t.props)for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}return n}prop(t){return this.props[t.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(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(o.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let r in t)for(let n of r.split(" "))e[n]=t[r];return t=>{for(let r=t.prop(o.group),n=-1;n<(r?r.length:0);n++){let i=e[n<0?t.name:r[n]];if(i)return i}}}}h.none=new h("",Object.create(null),0,8);class f{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let r of this.types){let n=null;for(let e of t){let t=e(r);if(t){n||(n=Object.assign({},r.props));let e=t[1],i=t[0];i.combine&&i.id in n&&(e=i.combine(n[i.id],e)),n[i.id]=e}}e.push(n?new h(r.name,n,r.id,r.flags):r)}return new f(e)}}const u=new WeakMap,c=new WeakMap;var d;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"}(d||(d={}));class p{constructor(t,e,r,n,i){if(this.type=t,this.children=e,this.positions=r,this.length=n,this.props=null,i&&i.length){this.props=Object.create(null);for(let[t,e]of i)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=l.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let r=t.toString();r&&(e&&(e+=","),e+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new N(this.topNode,t)}cursorAt(t,e=0,r=0){let n=u.get(this)||this.topNode,i=new N(n);return i.moveTo(t,e),u.set(this,i._tree),i}get topNode(){return new k(this,0,0,null)}resolve(t,e=0){let r=x(u.get(this)||this.topNode,t,e,!1);return u.set(this,r),r}resolveInner(t,e=0){let r=x(c.get(this)||this.topNode,t,e,!0);return c.set(this,r),r}resolveStack(t,e=0){return function(t,e,r){let n=t.resolveInner(e,r),i=null;for(let t=n instanceof k?n:n.context.parent;t;t=t.parent)if(t.index<0){let s=t.parent;(i||(i=[n])).push(s.resolve(e,r)),t=s}else{let s=l.get(t.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let o=new k(s.tree,s.overlay[0].from+t.from,-1,t);(i||(i=[n])).push(x(o,e,r,!1))}}return i?_(i):n}(this,t,e)}iterate(t){let{enter:e,leave:r,from:n=0,to:i=this.length}=t,s=t.mode||0,o=(s&d.IncludeAnonymous)>0;for(let t=this.cursor(s|d.IncludeAnonymous);;){let s=!1;if(t.from<=i&&t.to>=n&&(!o&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;s=!0}for(;s&&r&&(o||!t.type.isAnonymous)&&r(t),!t.nextSibling();){if(!t.parent())return;s=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:P(h.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,r)=>new p(this.type,t,e,r,this.propValues)),t.makeTree||((t,e,r)=>new p(h.none,t,e,r)))}static build(t){return function(t){var e;let{buffer:r,nodeSet:i,maxBufferLength:s=n,reused:l=[],minRepeatType:a=i.types.length}=t,h=Array.isArray(r)?new g(r,r.length):r,f=i.types,u=0,c=0;function d(t,e,r,n,o,p){let{id:g,start:A,end:S,size:_}=h,C=c,N=u;if(_<0){if(h.next(),-1==_){let e=l[g];return r.push(e),void n.push(A-t)}if(-3==_)return void(u=g);if(-4==_)return void(c=g);throw new RangeError(`Unrecognized record size: ${_}`)}let O,B,E=f[g],M=A-t;if(S-A<=s&&(B=w(h.pos-e,o))){let e=new Uint16Array(B.size-B.skip),r=h.pos-B.size,n=e.length;for(;h.pos>r;)n=v(B.start,e,n);O=new m(e,S-B.start,i),M=B.start-t}else{let t=h.pos-_;h.next();let e=[],r=[],n=g>=a?g:-1,i=0,o=S;for(;h.pos>t;)n>=0&&h.id==n&&h.size>=0?(h.end<=o-s&&(y(e,r,A,i,h.end,o,n,C,N),i=e.length,o=h.end),h.next()):p>2500?b(A,t,e,r):d(A,t,e,r,n,p+1);if(n>=0&&i>0&&i<e.length&&y(e,r,A,i,A,o,n,C,N),e.reverse(),r.reverse(),n>-1&&i>0){let t=x(E,N);O=P(E,e,r,0,e.length,0,S-A,t,t)}else O=k(E,e,r,S-A,C-S,N)}r.push(O),n.push(M)}function b(t,e,r,n){let o=[],l=0,a=-1;for(;h.pos>e;){let{id:t,start:e,end:r,size:n}=h;if(n>4)h.next();else{if(a>-1&&e<a)break;a<0&&(a=r-s),o.push(t,e,r),l++,h.next()}}if(l){let e=new Uint16Array(4*l),s=o[o.length-2];for(let t=o.length-3,r=0;t>=0;t-=3)e[r++]=o[t],e[r++]=o[t+1]-s,e[r++]=o[t+2]-s,e[r++]=r;r.push(new m(e,o[2]-s,i)),n.push(s-t)}}function x(t,e){return(r,n,i)=>{let s,l,a=0,h=r.length-1;if(h>=0&&(s=r[h])instanceof p){if(!h&&s.type==t&&s.length==i)return s;(l=s.prop(o.lookAhead))&&(a=n[h]+s.length+l)}return k(t,r,n,i,a,e)}}function y(t,e,r,n,s,o,l,a,h){let f=[],u=[];for(;t.length>n;)f.push(t.pop()),u.push(e.pop()+r-s);t.push(k(i.types[l],f,u,o-s,a-o,h)),e.push(s-r)}function k(t,e,r,n,i,s,l){if(s){let t=[o.contextHash,s];l=l?[t].concat(l):[t]}if(i>25){let t=[o.lookAhead,i];l=l?[t].concat(l):[t]}return new p(t,e,r,n,l)}function w(t,e){let r=h.fork(),n=0,i=0,o=0,l=r.end-s,f={size:0,start:0,skip:0};t:for(let s=r.pos-t;r.pos>s;){let t=r.size;if(r.id==e&&t>=0){f.size=n,f.start=i,f.skip=o,o+=4,n+=4,r.next();continue}let h=r.pos-t;if(t<0||h<s||r.start<l)break;let u=r.id>=a?4:0,c=r.start;for(r.next();r.pos>h;){if(r.size<0){if(-3!=r.size&&-4!=r.size)break t;u+=4}else r.id>=a&&(u+=4);r.next()}i=c,n+=t,o+=u}return(e<0||n==t)&&(f.size=n,f.start=i,f.skip=o),f.size>4?f:void 0}function v(t,e,r){let{id:n,start:i,end:s,size:o}=h;if(h.next(),o>=0&&n<a){let l=r;if(o>4){let n=h.pos-(o-4);for(;h.pos>n;)r=v(t,e,r)}e[--r]=l,e[--r]=s-t,e[--r]=i-t,e[--r]=n}else-3==o?u=n:-4==o&&(c=n);return r}let A=[],S=[];for(;h.pos>0;)d(t.start||0,t.bufferStart||0,A,S,-1,0);let _=null!==(e=t.length)&&void 0!==e?e:A.length?S[0]+A[0].length:0;return new p(f[t.topID],A.reverse(),S.reverse(),_)}(t)}}p.empty=new p(h.none,[],[],0);class g{constructor(t,e){this.buffer=t,this.index=e}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 m{constructor(t,e,r){this.buffer=t,this.length=e,this.set=r}get type(){return h.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],r=this.buffer[t+3],n=this.set.types[e],i=n.name;if(/\W/.test(i)&&!n.isError&&(i=JSON.stringify(i)),r==(t+=4))return i;let s=[];for(;t<r;)s.push(this.childString(t)),t=this.buffer[t+3];return i+"("+s.join(",")+")"}findChild(t,e,r,n,i){let{buffer:s}=this,o=-1;for(let l=t;l!=e&&!(b(i,n,s[l+1],s[l+2])&&(o=l,r>0));l=s[l+3]);return o}slice(t,e,r){let n=this.buffer,i=new Uint16Array(e-t),s=0;for(let o=t,l=0;o<e;){i[l++]=n[o++],i[l++]=n[o++]-r;let e=i[l++]=n[o++]-r;i[l++]=n[o++]-t,s=Math.max(s,e)}return new m(i,s,this.set)}}function b(t,e,r,n){switch(t){case-2:return r<e;case-1:return n>=e&&r<e;case 0:return r<e&&n>e;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function x(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to<e);){let e=!n&&t instanceof k&&t.index<0?null:t.parent;if(!e)return t;t=e}let s=n?0:d.IgnoreOverlays;if(n)for(let n=t,o=n.parent;o;n=o,o=n.parent)n instanceof k&&n.index<0&&(null===(i=o.enter(e,r,s))||void 0===i?void 0:i.from)!=n.from&&(t=o);for(;;){let n=t.enter(e,r,s);if(!n)return t;t=n}}class y{cursor(t=0){return new N(this,t)}getChild(t,e=null,r=null){let n=w(this,t,e,r);return n.length?n[0]:null}getChildren(t,e=null,r=null){return w(this,t,e,r)}resolve(t,e=0){return x(this,t,e,!1)}resolveInner(t,e=0){return x(this,t,e,!0)}matchContext(t){return v(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),r=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(r=e,e=t.prevSibling):e=t}return r}get node(){return this}get next(){return this.parent}}class k extends y{constructor(t,e,r,n){super(),this._tree=t,this.from=e,this.index=r,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,r,n,i=0){for(let s=this;;){for(let{children:o,positions:a}=s._tree,h=e>0?o.length:-1;t!=h;t+=e){let h,f=o[t],u=a[t]+s.from;if(i&d.EnterBracketed&&f instanceof p&&(h=l.get(f))&&!h.overlay&&h.bracketed&&r>=u&&r<=u+f.length||b(n,r,u,u+f.length))if(f instanceof m){if(i&d.ExcludeBuffers)continue;let o=f.findChild(0,f.buffer.length,e,r-u,n);if(o>-1)return new S(new A(s,f,t,u),null,o)}else if(i&d.IncludeAnonymous||!f.type.isAnonymous||O(f)){let o;if(!(i&d.IgnoreMounts)&&(o=l.get(f))&&!o.overlay)return new k(o.tree,u,t,s);let a=new k(f,u,t,s);return i&d.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?f.children.length-1:0,e,r,n,i)}}if(i&d.IncludeAnonymous||!s.type.isAnonymous)return null;if(t=s.index>=0?s.index+e:e<0?-1:s._parent._tree.children.length,s=s._parent,!s)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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,r=0){let n;if(!(r&d.IgnoreOverlays)&&(n=l.get(this._tree))&&n.overlay){let i=t-this.from,s=r&d.EnterBracketed&&n.bracketed;for(let{from:t,to:r}of n.overlay)if((e>0||s?t<=i:t<i)&&(e<0||s?r>=i:r>i))return new k(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function w(t,e,r,n){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(null!=r)for(let t=!1;!t;)if(t=i.type.is(r),!i.nextSibling())return s;for(;;){if(null!=n&&i.type.is(n))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return null==n?s:[]}}function v(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class A{constructor(t,e,r,n){this.parent=t,this.buffer=e,this.index=r,this.start=n}}class S extends y{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]}constructor(t,e,r){super(),this.context=t,this._parent=e,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,e,r){let{buffer:n}=this.context,i=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,r);return i<0?null:new S(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,r=0){if(r&d.ExcludeBuffers)return null;let{buffer:n}=this.context,i=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return i<0?null:new S(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new S(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new S(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:r}=this.context,n=this.index+4,i=r.buffer[this.index+3];if(i>n){let s=r.buffer[this.index+1];t.push(r.slice(n,i,s)),e.push(0)}return new p(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function _(t){if(!t.length)return null;let e=0,r=t[0];for(let n=1;n<t.length;n++){let i=t[n];(i.from>r.from||i.to<r.to)&&(r=i,e=n)}let n=r instanceof k&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new C(i,r)}class C{constructor(t,e){this.heads=t,this.node=e}get next(){return _(this.heads)}}class N{get name(){return this.type.name}constructor(t,e=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=e&~d.EnterBracketed,t instanceof k)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:r,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=r+n.buffer[t+1],this.to=r+n.buffer[t+2],!0}yield(t){return!!t&&(t instanceof k?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,r,this.mode));let{buffer:n}=this.buffer,i=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,r);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,r=this.mode){return this.buffer?!(r&d.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&d.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&d.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,r=this.stack.length-1;if(t<0){let t=r<0?0:this.stack[r]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(r<0?e.buffer.length:e.buffer[this.stack[r]+3]))return this.yieldBuf(t)}return r<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,r,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(n.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:r}=n)}else({index:e,_parent:r}=this._tree);for(;r;({index:e,_parent:r}=r))if(e>-1)for(let n=e+t,i=t<0?-1:r._tree.children.length;n!=i;n+=t){let t=r._tree.children[n];if(this.mode&d.IncludeAnonymous||t instanceof m||!t.type.isAnonymous||O(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,r=0;if(t&&t.context==this.buffer)t:for(let n=this.index,i=this.stack.length;i>=0;){for(let s=t;s;s=s._parent)if(s.index==n){if(n==this.index)return s;e=s,r=i+1;break t}n=this.stack[--i]}for(let t=r;t<this.stack.length;t++)e=new S(this.buffer,e,this.stack[t]);return this.bufferNode=new S(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let r=0;;){let n=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){r++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&e&&e(this),n=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,n=!0}}}matchContext(t){if(!this.buffer)return v(this.node.parent,t);let{buffer:e}=this.buffer,{types:r}=e.set;for(let n=t.length-1,i=this.stack.length-1;n>=0;i--){if(i<0)return v(this._tree,t,n);let s=r[e.buffer[this.stack[i]]];if(!s.isAnonymous){if(t[n]&&t[n]!=s.name)return!1;n--}}return!0}}function O(t){return t.children.some((t=>t instanceof m||!t.type.isAnonymous||O(t)))}const B=new WeakMap;function E(t,e){if(!t.isAnonymous||e instanceof m||e.type!=t)return 1;let r=B.get(e);if(null==r){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof p)){r=1;break}r+=E(t,n)}B.set(e,r)}return r}function P(t,e,r,n,i,s,o,l,a){let h=0;for(let r=n;r<i;r++)h+=E(t,e[r]);let f=Math.ceil(1.5*h/8),u=[],c=[];return function e(r,n,i,o,l){for(let h=i;h<o;){let i=h,d=n[h],p=E(t,r[h]);for(h++;h<o;h++){let e=E(t,r[h]);if(p+e>=f)break;p+=e}if(h==i+1){if(p>f){let t=r[i];e(t.children,t.positions,0,t.children.length,n[i]+l);continue}u.push(r[i])}else{let e=n[h-1]+r[h-1].length-d;u.push(P(t,r,n,i,h,d,e,null,a))}c.push(d+l-s)}}(e,r,n,i,0),(l||a)(u,c,o)}class M{constructor(t,e,r,n,i=!1,s=!1){this.from=t,this.to=e,this.tree=r,this.offset=n,this.open=(i?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],r=!1){let n=[new M(0,t.length,t,0,!1,r)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,r=128){if(!e.length)return t;let n=[],i=1,s=t.length?t[0]:null;for(let o=0,l=0,a=0;;o++){let h=o<e.length?e[o]:null,f=h?h.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let e=s;if(l>=e.from||f<=e.to||a){let t=Math.max(e.from,l)-a,r=Math.min(e.to,f)-a;e=t>=r?null:new M(t,r,e.tree,e.offset+a,o>0,!!h)}if(e&&n.push(e),s.to>f)break;s=i<t.length?t[i++]:null}if(!h)break;l=h.toA,a=h.toA-h.toB}return n}}class I{startParse(t,e,r){return"string"==typeof t&&(t=new T(t)),r=r?r.length?r.map((t=>new s(t.from,t.to))):[new s(0,0)]:[new s(0,t.length)],this.createParse(t,e||[],r)}parse(t,e,r){let n=this.startParse(t,e,r);for(;;){let t=n.advance();if(t)return t}}}class T{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new o({perNode:!0})},7398(t,e,r){r.d(e,{DM:()=>c,_A:()=>B,az:()=>u,pn:()=>a});var n=r(80919);let i=0;class s{constructor(t,e,r,n){this.name=t,this.set=e,this.base=r,this.modified=n,this.id=i++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let r="string"==typeof t?t:"?";if(t instanceof s&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let n=new s(r,[],null,[]);if(n.set.push(n),e)for(let t of e.set)n.set.push(t);return n}static defineModifier(t){let e=new l(t);return t=>t.modified.indexOf(e)>-1?t:l.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}let o=0;class l{constructor(t){this.name=t,this.instances=[],this.id=o++}static get(t,e){if(!e.length)return t;let r=e[0].instances.find((r=>{return r.base==t&&(n=e,i=r.modified,n.length==i.length&&n.every(((t,e)=>t==i[e])));var n,i}));if(r)return r;let n=[],i=new s(t.name,n,t,e);for(let t of e)t.instances.push(i);let o=function(t){let e=[[]];for(let r=0;r<t.length;r++)for(let n=0,i=e.length;n<i;n++)e.push(e[n].concat(t[r]));return e.sort(((t,e)=>e.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)n.push(l.get(e,t));return i}}function a(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let t of r.split(" "))if(t){let r=[],i=2,s=t;for(let e=0;;){if("..."==s&&e>0&&e+3==t.length){i=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!n)throw new RangeError("Invalid path: "+t);if(r.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){i=0;break}if("/"!=o)throw new RangeError("Invalid path: "+t);s=t.slice(e)}let o=r.length-1,l=r[o];if(!l)throw new RangeError("Invalid path: "+t);let a=new f(n,i,o>0?r.slice(0,o):null);e[l]=a.sort(e[l])}}return h.add(e)}const h=new n.uY({combine(t,e){let r,n,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),r&&r.mode==i.mode&&!i.context&&!r.context)continue;let s=new f(i.tags,i.mode,i.context);r?r.next=s:n=s,r=s}return n}});class f{constructor(t,e,r,n){this.tags=t,this.mode=e,this.context=r,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function u(t,e){let r=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)r[t.id]=e.class;else r[e.tag.id]=e.class;let{scope:n,all:i=null}=e||{};return{style:t=>{let e=i;for(let n of t)for(let t of n.set){let n=r[t.id];if(n){e=e?e+" "+n:n;break}}return e},scope:n}}function c(t,e,r,n=0,i=t.length){let s=new d(n,Array.isArray(e)?e:[e],r);s.highlightRange(t.cursor(),n,i,"",s.highlighters),s.flush(i)}f.empty=new f([],2,null);class d{constructor(t,e,r){this.at=t,this.highlighters=e,this.span=r,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,r,i,s){let{type:o,from:l,to:a}=t;if(l>=r||a<=e)return;o.isTop&&(s=this.highlighters.filter((t=>!t.scope||t.scope(o))));let u=i,c=function(t){let e=t.type.prop(h);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||f.empty,d=function(t,e){let r=null;for(let n of t){let t=n.style(e);t&&(r=r?r+" "+t:t)}return r}(s,c.tags);if(d&&(u&&(u+=" "),u+=d,1==c.mode&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(e,l),u),c.opaque)return;let p=t.tree&&t.tree.prop(n.uY.mounted);if(p&&p.overlay){let n=t.node.enter(p.overlay[0].from+l,1),o=this.highlighters.filter((t=>!t.scope||t.scope(p.tree.type))),h=t.firstChild();for(let f=0,c=l;;f++){let d=f<p.overlay.length?p.overlay[f]:null,g=d?d.from+l:a,m=Math.max(e,c),b=Math.min(r,g);if(m<b&&h)for(;t.from<b&&(this.highlightRange(t,m,b,i,s),this.startSpan(Math.min(b,t.to),u),!(t.to>=g)&&t.nextSibling()););if(!d||g>r)break;c=d.to+l,c>e&&(this.highlightRange(n.cursor(),Math.max(e,d.from+l),Math.min(r,c),"",o),this.startSpan(Math.min(r,c),u))}h&&t.parent()}else if(t.firstChild()){p&&(i="");do{if(!(t.to<=e)){if(t.from>=r)break;this.highlightRange(t,e,r,i,s),this.startSpan(Math.min(r,t.to),u)}}while(t.nextSibling());t.parent()}}}const p=s.define,g=p(),m=p(),b=p(m),x=p(m),y=p(),k=p(y),w=p(y),v=p(),A=p(v),S=p(),_=p(),C=p(),N=p(C),O=p(),B={comment:g,lineComment:p(g),blockComment:p(g),docComment:p(g),name:m,variableName:p(m),typeName:b,tagName:p(b),propertyName:x,attributeName:p(x),className:p(m),labelName:p(m),namespace:p(m),macroName:p(m),literal:y,string:k,docString:p(k),character:p(k),attributeValue:p(k),number:w,integer:p(w),float:p(w),bool:p(y),regexp:p(y),escape:p(y),color:p(y),url:p(y),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:_,derefOperator:p(_),arithmeticOperator:p(_),logicOperator:p(_),bitwiseOperator:p(_),compareOperator:p(_),updateOperator:p(_),definitionOperator:p(_),typeOperator:p(_),controlOperator:p(_),punctuation:C,separator:p(C),bracket:N,angleBracket:p(N),squareBracket:p(N),paren:p(N),brace:p(N),content:v,heading:A,heading1:p(A),heading2:p(A),heading3:p(A),heading4:p(A),heading5:p(A),heading6:p(A),contentSeparator:p(v),list:p(v),quote:p(v),emphasis:p(v),strong:p(v),link:p(v),monospace:p(v),strikethrough:p(v),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:O,documentMeta:p(O),annotation:p(O),processingInstruction:p(O),definition:s.defineModifier("definition"),constant:s.defineModifier("constant"),function:s.defineModifier("function"),standard:s.defineModifier("standard"),local:s.defineModifier("local"),special:s.defineModifier("special")};for(let t in B){let e=B[t];e instanceof s&&(e.name=t)}u([{tag:B.link,class:"tok-link"},{tag:B.heading,class:"tok-heading"},{tag:B.emphasis,class:"tok-emphasis"},{tag:B.strong,class:"tok-strong"},{tag:B.keyword,class:"tok-keyword"},{tag:B.atom,class:"tok-atom"},{tag:B.bool,class:"tok-bool"},{tag:B.url,class:"tok-url"},{tag:B.labelName,class:"tok-labelName"},{tag:B.inserted,class:"tok-inserted"},{tag:B.deleted,class:"tok-deleted"},{tag:B.literal,class:"tok-literal"},{tag:B.string,class:"tok-string"},{tag:B.number,class:"tok-number"},{tag:[B.regexp,B.escape,B.special(B.string)],class:"tok-string2"},{tag:B.variableName,class:"tok-variableName"},{tag:B.local(B.variableName),class:"tok-variableName tok-local"},{tag:B.definition(B.variableName),class:"tok-variableName tok-definition"},{tag:B.special(B.variableName),class:"tok-variableName2"},{tag:B.definition(B.propertyName),class:"tok-propertyName tok-definition"},{tag:B.typeName,class:"tok-typeName"},{tag:B.namespace,class:"tok-namespace"},{tag:B.className,class:"tok-className"},{tag:B.macroName,class:"tok-macroName"},{tag:B.propertyName,class:"tok-propertyName"},{tag:B.operator,class:"tok-operator"},{tag:B.comment,class:"tok-comment"},{tag:B.meta,class:"tok-meta"},{tag:B.invalid,class:"tok-invalid"},{tag:B.punctuation,class:"tok-punctuation"}])}}]);