shell bypass 403

Cubjrnet7 Shell


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

© 2025 Cubjrnet7