PageSourceSearch

https://www.survival.it/assets/@codemirror--language-cffecb1c.js

js survival.it collected 2026-09-24 09:53:07 UTC 39,624 bytes, 6 lines download raw bytes

1// @codemirror/[email protected] downloaded from https://ga.jspm.io/npm:@codemirror/[email protected]/dist/index.js
2
3import{NodeProp as e,Tree as t,IterMode as n,TreeFragment as r,Parser as i,NodeType as a,NodeSet as o}from"@lezer/common";import{Facet as s,EditorState as c,StateEffect as l,StateField as u,countColumn as d,RangeSet as f,combineConfig as ee,RangeSetBuilder as p,Prec as m}from"@codemirror/state";import{ViewPlugin as h,logException as te,EditorView as g,Decoration as _,WidgetType as v,GutterMarker as ne,gutter as re,Direction as y}from"@codemirror/view";import{tagHighlighter as ie,highlightTree as ae,tags as b,styleTags as oe}from"@lezer/highlight";import{StyleModule as se}from"style-mod";var ce;const x=/* @__PURE__ */ new e;function S(e){return s.define({combine:e?t=>t.concat(e):void 0})}const le=/* @__PURE__ */ new e;class Language{constructor(e,t,n=[],r=``){this.data=e,this.name=r,c.prototype.hasOwnProperty(`tree`)||Object.defineProperty(c.prototype,"tree",{get(){return C(this)}}),this.parser=t,this.extension=[E.of(this),c.languageData.of((e,t,n)=>{let r=ue(e,t,n),i=r.type.prop(x);if(!i)return[];let a=e.facet(i),o=r.type.prop(le);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return ue(e,t,n).type.prop(x)==this.data}findRegions(n){let r=n.facet(E);if((r==null?void 0:r.data)==this.data)return[{from:0,to:n.doc.length}];if(!r||!r.allowsNesting)return[];let i=[],a=(n,r)=>{if(n.prop(x)==this.data){i.push({from:r,to:r+n.length});return}let o=n.prop(e.mounted);if(o){if(o.tree.prop(x)==this.data){if(o.overlay)for(let e of o.overlay)i.push({from:e.from+r,to:e.to+r});else i.push({from:r,to:r+n.length});return}else if(o.overlay){let e=i.length;if(a(o.tree,o.overlay[0].from+r),i.length>e)return}}for(let e=0;e<n.children.length;e++){let i=n.children[e];i instanceof t&&a(i,n.positions[e]+r)}};return a(C(n),0),i}get allowsNesting(){return!0}}Language.setState=/* @__PURE__ */ l.define();function ue(e,t,r){let i=e.facet(E),a=C(e).topNode;if(!i||i.allowsNesting)for(let e=a;e;e=e.enter(t,r,n.ExcludeBuffers|n.EnterBracketed))e.type.isTop&&(a=e);return a}class LRLanguage extends Language{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=S(e.languageData);return new LRLanguage(t,e.parser.configure({props:[x.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new LRLanguage(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function C(e){let n=e.field(Language.state,!1);return n?n.tree:t.empty}function de(e,t,n=50){var r;let i=(r=e.field(Language.state,!1))==null?void 0:r.context;if(!i)return null;let a=i.viewport;i.updateViewport({from:0,to:t});let o=i.isDone(t)||i.work(n,t)?i.tree:null;return i.updateViewport(a),o}function fe(e,t=e.doc.length){var n;return((n=e.field(Language.state,!1))==null?void 0:n.context.isDone(t))||!1}function pe(e,t=e.viewport.to,n=100){let r=de(e.state,t,n);return r!=C(e.state)&&e.dispatch({}),!!r}function me(e){var t;return((t=e.plugin(_e))==null?void 0:t.isWorking())||!1}class DocInput{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}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<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let w=null;class ParseContext{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new ParseContext(e,n,[],t.empty,0,r,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=t.empty&&this.isDone(n==null?this.state.doc.length:n)?(this.takeTree(),!0):this.withContext(()=>{var t;if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(r.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(t=this.parse.stoppedAt)==null?this.state.doc.length:t,this.tree=i,this.parse=null,this.treeLen<(n==null?this.state.doc.length:n))this.parse=this.startParse();else return!0;
vendor: 4,968 bytes, line 3
3if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||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.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=w;w=this;try{return e()}finally{w=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=he(e,t.from,t.to);return e}changes(e,n){let{fragments:i,tree:a,treeLen:o,viewport:s,skipped:c}=this;if(this.takeTree(),!e.empty){let n=[];if(e.iterChangedRanges((e,t,r,i)=>n.push({fromA:e,toA:t,fromB:r,toB:i})),i=r.applyChanges(i,n),a=t.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){c=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&c.push({from:n,to:r})}}}return new ParseContext(this.parser,n,i,a,o,s,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=he(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(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 i{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let n=w;if(n){for(let e of i)n.tempSkipped.push(e);e&&(n.scheduleOn=n.scheduleOn?Promise.all([n.scheduleOn,e]):e)}return this.parsedPos=s,new t(a.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return w}}function he(e,t,n){return r.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class LanguageState{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 LanguageState(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ParseContext.create(e.facet(E).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new LanguageState(n)}}Language.state=/* @__PURE__ */ u.define({create:LanguageState.init,update(e,t){for(let e of t.effects)if(e.is(Language.setState))return e.value;return t.startState.facet(E)==t.state.facet(E)?e.apply(t):LanguageState.init(t.state)}});let ge=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(ge=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const T=typeof navigator<`u`&&(ce=navigator.scheduling)!=null&&ce.isInputPending?()=>navigator.scheduling.isInputPending():null,_e=/* @__PURE__ */ h.fromClass(class ParseWorker{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(Language.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Language.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ge(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(Language.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!T?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>T&&T()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>te(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()}}}),E=/* @__PURE__ */ s.define({combine(e){return e.length?e[0]:null},enables:e=>[Language.state,_e,g.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});
3class LanguageSupport{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class LanguageDescription{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,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 LanguageDescription(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 n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}}const ve=/* @__PURE__ */ s.define(),D=/* @__PURE__ */ s.define({combine:e=>{if(!e.length)return`  `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function O(e){let t=e.facet(D);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function k(e,t){let n=``,r=e.tabSize,i=e.facet(D)[0];if(i==`	`){for(;t>=r;)n+=`	`,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function A(e,t){e instanceof c&&(e=new IndentContext(e));for(let n of e.state.facet(ve)){let r=n(e,t);if(r!==void 0)return r}let n=C(e.state);return n.length>=t?be(e,n,t):null}function ye(e,t,n){let r=Object.create(null),i=new IndentContext(e,{overrideIndentation:e=>{var t;return(t=r[e])==null?-1:t}}),a=[];for(let o=t;o<=n;){let t=e.doc.lineAt(o);o=t.to+1;let n=A(i,t.from);if(n==null)continue;/\S/.test(t.text)||(n=0);let s=/^\s*/.exec(t.text)[0],c=k(e,n);s!=c&&(r[t.from]=n,a.push({from:t.from,to:t.from+s.length,insert:c}))}return e.changes(a)}class IndentContext{constructor(e,t={}){this.state=e,this.options=t,this.unit=O(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return d(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const j=/* @__PURE__ */ new e;function be(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return xe(r,e,n)}function xe(e,t,n){for(let r=e;r;r=r.next){let e=Ce(r.node);if(e)return e(TreeIndentContext.create(t,n,r))}return 0}function Se(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Ce(t){let n=t.type.prop(j);if(n)return n;let r=t.firstChild,i;if(r&&(i=r.type.prop(e.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>Oe(t,!0,1,void 0,n&&!Se(t)?e.from:void 0)}return t.parent==null?we:null}function we(){return 0}class TreeIndentContext extends IndentContext{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new TreeIndentContext(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Te(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return xe(this.context.next,this.base,this.pos)}}function Te(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Ee(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function De({closing:e,align:t=!0,units:n=1}){return r=>Oe(r,t,n,e)}function Oe(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?Ee(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}const ke=e=>e.baseIndent;function Ae({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const je=200;function Me(){return c.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;
vendor: 11,586 bytes, line 3
3let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=A(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=k(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}const Ne=/* @__PURE__ */ s.define(),Pe=/* @__PURE__ */ new e;function Fe(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Ie(e,t,n){let r=C(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(Pe);if(s&&(i.to<r.length-50||r.length==e.doc.length||!Le(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function Le(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function M(e,t,n){for(let r of e.facet(Ne)){let i=r(e,t,n);if(i)return i}return Ie(e,t,n)}function Re(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const N=/* @__PURE__ */ l.define({map:Re}),P=/* @__PURE__ */ l.define({map:Re});function F(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}const I=/* @__PURE__ */ u.define({create(){return _.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=L(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(N)&&!Be(e,r.value.from,r.value.to)?n.push(r.value):r.is(P)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(V),i=n.map(e=>(r?_.replace({widget:new PreparedFoldWidget(r(t.state,e))}):Xe).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=L(e,t.selection.main.head)),e},provide:e=>g.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<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(Xe.range(r,i))}return _.set(t,!0)}});function L(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function ze(e){return e.field(I,!1)||f.empty}function R(e,t,n){var r;let i=null;return(r=e.field(I,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Be(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function z(e,t){return e.field(I,!1)?t:t.concat(l.appendConfig.of(H()))}const Ve=e=>{for(let t of F(e)){let n=M(e.state,t.from,t.to);if(n)return e.dispatch({effects:z(e.state,[N.of(n),B(e,n)])}),!0}return!1},He=e=>{if(!e.state.field(I,!1))return!1;let t=[];for(let n of F(e)){let r=R(e.state,n.from,n.to);r&&t.push(P.of(r),B(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function B(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return g.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}const Ue=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=M(t,i.from,i.to);a&&n.push(N.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:z(e.state,n)}),!!n.length},We=e=>{let t=e.state.field(I,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(P.of({from:e,to:t}))}),e.dispatch({effects:n}),!0};function Ge(e,t){for(let n=t;;){let r=M(e.state,n.from,n.to);if(r&&r.to>t.from)return r;if(!n.from)return null;n=e.lineBlockAt(n.from-1)}}const Ke=e=>{let t=[];for(let n of F(e)){let r=R(e.state,n.from,n.to);if(r)t.push(P.of(r),B(e,r,!1));else{let r=Ge(e,n);r&&t.push(N.of(r),B(e,r))}}return t.length>0&&e.dispatch({effects:z(e.state,t)}),!!t.length},qe=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Ve},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:He},{key:`Ctrl-Alt-[`,run:Ue},{key:`Ctrl-Alt-]`,run:We}],Je={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},V=/* @__PURE__ */ s.define({combine(e){return ee(e,Je)}});function H(e){let t=[I,$e];return e&&t.push(V.of(e)),t}function Ye(e,t){let{state:n}=e,r=n.facet(V),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=R(e.state,n.from,n.to);r&&e.dispatch({effects:P.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}const Xe=/* @__PURE__ */ _.replace({widget:/* @__PURE__ */ new class extends v{toDOM(e){return Ye(e,null)}}});class PreparedFoldWidget extends v{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ye(e,this.value)}}const Ze={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class FoldMarker extends ne{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 Qe(e={}){let t={...Ze,...e},n=new FoldMarker(t,!0),r=new FoldMarker(t,!1),i=h.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(E)!=e.state.facet(E)||e.startState.field(I,!1)!=e.state.field(I,!1)||C(e.startState)!=C(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new p;for(let i of e.viewportLineBlocks){let a=R(e.state,i.from,i.to)?r:M(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,re({class:`cm-foldGutter`,markers(e){var t;return((t=e.plugin(i))==null?void 0:t.markers)||f.empty},initialSpacer(){return new FoldMarker(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=R(e.state,t.from,t.to);if(r)return e.dispatch({effects:P.of(r)}),!0;let i=M(e.state,t.from,t.to);return i?(e.dispatch({effects:N.of(i)}),!0):!1}}}),H()]}const $e=/* @__PURE__ */ g.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 HighlightStyle{constructor(e,t){this.specs=e;let n;function r(e){let t=se.newName();return(n||(n=Object.create(null)))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof Language?e=>e.prop(x)==a.data:a?e=>e==a:void 0,this.style=ie(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new se(n):null,this.themeType=t.themeType}static define(e,t){return new HighlightStyle(e,t||{})}}const U=/* @__PURE__ */ s.define(),et=/* @__PURE__ */ s.define({combine(e){return e.length?[e[0]]:null}});function W(e){let t=e.facet(U);return t.length?t:e.facet(et)}function tt(e,t){let n=[rt],r;return e instanceof HighlightStyle&&(e.module&&n.push(g.styleModule.of(e.module)),r=e.themeType),t!=null&&t.fallback?n.push(et.of(e)):r?n.push(U.computeN([g.darkTheme],t=>t.facet(g.darkTheme)==(r==`dark`)?[e]:[])):n.push(U.of(e)),n}function nt(e,t,n){let r=W(e),i=null;if(r){for(let e of r)if(!e.scope||n&&e.scope(n)){let n=e.style(t);n&&(i=i?i+` `+n:n)}}return i}class TreeHighlighter{constructor(e){this.markCache=Object.create(null),this.tree=C(e.state),this.decorations=this.buildDeco(e,W(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=C(e.state),n=W(e.state),r=n!=W(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return _.none;let n=new p;for(let{from:r,to:i}of e.visibleRanges)ae(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=_.mark({class:r})))},r,i);return n.finish()}}const rt=/* @__PURE__ */ m.high(/* @__PURE__ */ h.fromClass(TreeHighlighter,{decorations:e=>e.decorations})),it=/* @__PURE__ */ HighlightStyle.define([{tag:b.meta,color:`#404740`},{tag:b.link,textDecoration:`underline`},{tag:b.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:b.emphasis,fontStyle:`italic`},{tag:b.strong,fontWeight:`bold`},{tag:b.strikethrough,textDecoration:`line-through`},{tag:b.keyword,color:`#708`},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:`#219`},{tag:[b.literal,b.inserted],color:`#164`},{tag:[b.string,b.deleted],color:`#a11`},{tag:[b.regexp,b.escape,/* @__PURE__ */ b.special(b.string)],color:`#e40`},{tag:/* @__PURE__ */ b.definition(b.variableName),color:`#00f`},{tag:/* @__PURE__ */ b.local(b.variableName),color:`#30a`},{tag:[b.typeName,b.namespace],color:`#085`},{tag:b.className,color:`#167`},{tag:[/* @__PURE__ */ b.special(b.variableName),b.macroName],color:`#256`},{tag:/* @__PURE__ */ b.definition(b.propertyName),color:`#00c`},{tag:b.comment,color:`#940`},{tag:b.invalid,color:`#f00`}]),at=/* @__PURE__ */ g.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),ot=1e4,st=`()[]{}`,ct=/* @__PURE__ */ s.define({combine(e){return ee(e,{afterCursor:!0,brackets:st,maxScanDistance:ot,renderMatch:dt})}}),lt=/* @__PURE__ */ _.mark({class:`cm-matchingBracket`}),ut=/* @__PURE__ */ _.mark({class:`cm-nonmatchingBracket`});function dt(e){let t=[],n=e.matched?lt:ut;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function ft(e){let t=[],n=e.facet(ct);for(let r of e.selection.ranges){if(!r.empty)continue;let i=q(e,r.head,-1,n)||r.head>0&&q(e,r.head-1,1,n)||n.afterCursor&&(q(e,r.head,1,n)||r.head<e.doc.length&&q(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return _.set(t,!0)}const pt=[/* @__PURE__ */ h.fromClass(class{constructor(e){this.paused=!1,this.decorations=ft(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=ft(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),at];function mt(e={}){return[ct.of(e),pt]}const ht=/* @__PURE__ */ new e;function G(t,n,r){let i=t.prop(n<0?e.openedBy:e.closedBy);if(i)return i;if(t.name.length==1){let e=r.indexOf(t.name);if(e>-1&&e%2==+(n<0))return[r[e+n]]}return null}function K(e){let t=e.type.prop(ht);return t?t(e.node):e}function q(e,t,n,r={}){let i=r.maxScanDistance||ot,a=r.brackets||st,o=C(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=G(r.type,n,a);if(i&&r.from<r.to){let o=K(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return gt(e,t,n,r,o,i,a)}}return _t(e,t,n,o,s.type,i,a)}function gt(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to}
3,l=0,u=s==null?void 0:s.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=K(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(G(u.type,n,o))l++;else if(G(u.type,-n,o)){if(l==0){let e=K(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function _t(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}function vt(e,t,n,r=0,i=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}class StringStream{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}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.lastColumnPos<this.start&&(this.lastColumnValue=vt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)==null?vt(this.string,null,this.tabSize):e}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function yt(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||bt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||Y,mergeTokens:e.mergeTokens!==!1}}function bt(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}const xt=/* @__PURE__ */ new WeakMap;class StreamLanguage extends Language{constructor(t){let n=S(t.languageData),r=yt(t),a,o=new class extends i{createParse(e,t,n){return new Parse(a,e,t,n)}};super(n,o,[],t.name),this.topNode=At(n,this),a=this,this.streamParser=r,this.stateAfter=new e({perNode:!0}),this.tokenTable=t.tokenTable?new TokenTable(r.tokenTable):Ot}static define(e){return new StreamLanguage(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=xt.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=J(this,e.node.tree,e.node.from,e.node.from,t==null?e.pos:t),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new StringStream(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)wt(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&xt.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}}function J(e,n,r,i,a){let o=r>=i&&r+n.length<=a&&n.prop(e.stateAfter);if(o)return{state:e.streamParser.copyState(o),pos:r+n.length};for(let o=n.children.length-1;o>=0;o--){let s=n.children[o],c=r+n.positions[o],l=s instanceof t&&c<a&&J(e,s,c,i,a);if(l)return l}return null}function St(e,n,r,i,a){if(a&&r<=0&&i>=n.length)return n;!a&&r==0&&n.type==e.topNode&&(a=!0);for(let o=n.children.length-1;o>=0;o--){let s=n.positions[o],c=n.children[o],l;if(s<i&&c instanceof t){if(!(l=St(e,c,r-s,i-s,a)))break;
vendor: 1,652 bytes, lines 3-5
3return a?new t(n.type,n.children.slice(0,o).concat(l),n.positions.slice(0,o+1),s+l.length):l}}return null}function Ct(e,n,r,i,a){for(let t of n){let n=t.from+(t.openStart?25:0),a=t.to-(t.openEnd?25:0),o=n<=r&&a>r&&J(e,t.tree,0-t.offset,r,a),s;if(o&&o.pos<=i&&(s=St(e,t.tree,r+t.offset,o.pos+t.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(a?O(a):4),tree:t.empty}}class Parse{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=ParseContext.get(),a=r[0].from,{state:o,tree:s}=Ct(e,n,a,this.to,i==null?void 0:i.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(O(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=ParseContext.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=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)t==`
4`&&(t=``);else{let e=t.indexOf(`
5`);e>
5-1&&(t=t.slice(0,e))}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 e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length))break;let i=this.ranges[e].from,a=this.lineAfter(i);t+=a,n=i+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;let a=this.ranges[++this.rangeIndex].from;t+=a-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let e=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-e}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==t?this.chunk[a+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,a=new StringStream(t,e?e.state.tabSize:4,e?O(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let e=wt(i.token,a,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=t.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Tt,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new t(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new t(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function wt(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error(`Stream parser failed to advance stream.`)}const Y=/* @__PURE__ */ Object.create(null),X=[a.none],Tt=/* @__PURE__ */ new o(X),Z=[],Et=/* @__PURE__ */ Object.create(null),Dt=/* @__PURE__ */ Object.create(null);for(let[e,t]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`]])Dt[e]=/* @__PURE__ */ kt(Y,t);class TokenTable{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Dt)}resolve(e){return e?this.table[e]||(this.table[e]=kt(this.extra,e)):0}}const Ot=/* @__PURE__ */ new TokenTable(Y);function Q(e,t){Z.indexOf(e)>-1||(Z.push(e),console.warn(t))}function kt(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||b[n];r?typeof r==`function`?t.length?t=t.map(r):Q(n,`Modifier ${n} used at start of tag`):t.length?Q(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:Q(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),o=Et[i];if(o)return o.id;let s=Et[i]=a.define({id:X.length,name:r,props:[oe({[r]:n})]});return X.push(s),s.id}function At(e,t){let n=a.define({id:X.length,name:`Document`,props:[x.add(()=>e),j.add(()=>e=>t.getIndent(e))],top:!0});return X.push(n),n}function jt(e){return e.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(e)}function Mt(e){for(let t=e.iter();!t.next().done;)if(jt(t.value))return!0;return!1}function Nt(e){let t=!1;return e.iterChanges((e,n,r,i,a)=>{!t&&Mt(a)&&(t=!0)}),t}const $=/* @__PURE__ */ s.define({combine:e=>e.some(e=>e)});function Pt(e={}){let t=[Ft];return e.alwaysIsolate&&t.push($.of(!0)),t}const Ft=/* @__PURE__ */ h.fromClass(class{constructor(e){this.always=e.state.facet($)||e.textDirection!=y.LTR||e.state.facet(g.perLineTextDirection),this.hasRTL=!this.always&&Mt(e.state.doc),this.tree=C(e.state),this.decorations=this.always||this.hasRTL?It(e,this.tree,this.always):_.none}update(e){let t=e.state.facet($)||e.view.textDirection!=y.LTR||e.state.facet(g.perLineTextDirection);if(!t&&!this.hasRTL&&Nt(e.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let n=C(e.state);(t!=this.always||n!=this.tree||e.docChanged||e.viewportChanged)&&(this.tree=n,this.always=t,this.decorations=It(e.view,n,t))}},{provide:e=>{function t(t){var n,r;return(r=(n=t.plugin(e))==null?void 0:n.decorations)==null?_.none:r}return[g.outerDecorations.of(t),m.lowest(g.bidiIsolatedRanges.of(t))]}});function It(t,n,r){let i=new p,a=t.visibleRanges;r||(a=Lt(a,t.state.doc));for(let{from:t,to:r}of a)n.iterate({enter:t=>{let n=t.type.prop(e.isolate);n&&i.add(t.from,t.to,Rt[n])},from:t,to:r});return i.finish()}function Lt(e,t){let n=t.iter(),r=0,i=[],a=null;for(let{from:t,to:o}of e)if(!(a&&a.to>t&&(t=a.to,t>=o)))for(r+n.value.length<t&&(n.next(t-(r+n.value.length)),r=t);;){let e=r,t=r+n.value.length;if(!n.lineBreak&&jt(n.value)&&(a&&a.to>e-10?a.to=Math.min(o,t):i.push(a={from:e,to:Math.min(o,t)})),t>=o)break;r=t,n.next()}return i}const Rt={rtl:/* @__PURE__ */ _.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`rtl`},bidiIsolate:y.RTL}),ltr:/* @__PURE__ */ _.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`ltr`},bidiIsolate:y.LTR}),auto:/* @__PURE__ */ _.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`auto`},bidiIsolate:null})};export{DocInput,HighlightStyle,IndentContext,LRLanguage,Language,LanguageDescription,LanguageSupport,ParseContext,StreamLanguage,StringStream,TreeIndentContext,Pt as bidiIsolates,mt as bracketMatching,ht as bracketMatchingHandle,H as codeFolding,Ae as continuedIndent,it as defaultHighlightStyle,S as defineLanguageFacet,De as delimitedIndent,de as ensureSyntaxTree,ke as flatIndent,Ue as foldAll,Ve as foldCode,N as foldEffect,Qe as foldGutter,Fe as foldInside,qe as foldKeymap,Pe as foldNodeProp,Ne as foldService,I as foldState,M as foldable,ze as foldedRanges,pe as forceParsing,O as getIndentUnit,A as getIndentation,nt as highlightingFor,j as indentNodeProp,Me as indentOnInput,ye as indentRange,ve as indentService,k as indentStr
5ing,D as indentUnit,E as language,x as languageDataProp,q as matchBrackets,le as sublanguageProp,tt as syntaxHighlighting,me as syntaxParserRunning,C as syntaxTree,fe as syntaxTreeAvailable,Ke as toggleFold,We as unfoldAll,He as unfoldCode,P as unfoldEffect};
6

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.