Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla5/media/vendor/codemirror/js/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla5/media/vendor/codemirror/js/codemirror-language.min.js

import{NodeType as U,NodeProp as x,IterMode as pt,Tree as y,TreeFragment as
H,Parser as ve,NodeSet as gt}from"@lezer/common";import{Facet as
v,EditorState as L,StateEffect as V,StateField as Q,countColumn as
mt,RangeSet as Te,combineConfig as Ae,RangeSetBuilder as X,Prec as
Ce}from"@codemirror/state";import{Decoration as m,Direction as
$,ViewPlugin as _,logException as kt,EditorView as w,WidgetType as
Pe,gutter as bt,GutterMarker as
yt}from"@codemirror/view";import{tags as c,styleTags as
wt,tagHighlighter as St,highlightTree as
xt}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
Oe{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=[],u=/^@(\w+)\b/.exec(o[0]),p=u&&u[1]=="keyframes";if(u&&a==null)return
l.push(o[0]+";");for(let d in a){let
g=a[d];if(/&/.test(d))s(d.split(/,\s*/).map(S=>o.map(N=>S.replace(/&/,N))).reduce((S,N)=>S.concat(N)),g,l);else
if(g&&typeof g=="object"){if(!u)throw new
RangeError("The value of a property ("+d+") should be a
primitive value.");s(i(d),g,f,p)}else
g!=null&&f.push(d.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+":
"+g+";")}(f.length||p)&&l.push((r&&!u&&!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
vt(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let Me=new Map;class
vt{constructor(e,t){let
r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let
s=Me.get(r);if(s)return e[ee]=s;this.sheet=new
i.CSSStyleSheet,Me.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 C=new x;function ne(n){return
v.define({combine:n?e=>e.concat(n):void 0})}const Ne=new x;class
k{constructor(e,t,r=[],i=""){this.data=e,this.name=i,L.prototype.hasOwnProperty("tree")||Object.defineProperty(L.prototype,"tree",{get(){return
b(this)}}),this.parser=t,this.extension=[T.of(this),L.languageData.of((s,o,a)=>{let
l=Le(s,o,a),h=l.type.prop(C);if(!h)return[];let
f=s.facet(h),u=l.type.prop(Ne);if(u){let p=l.resolve(o-l.from,a);for(let d
of u)if(d.test(p,s)){let g=s.facet(d.facet);return
d.type=="replace"?g:g.concat(f)}}return
f})].concat(r)}isActiveAt(e,t,r=-1){return
Le(e,t,r).type.prop(C)==this.data}findRegions(e){let
t=e.facet(T);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(C)==this.data){r.push({from:o,to:o+s.length});return}let
a=s.prop(x.mounted);if(a){if(a.tree.prop(C)==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
y&&i(h,s.positions[l]+o)}};return i(b(e),0),r}get
allowsNesting(){return!0}}k.setState=V.define();function Le(n,e,t){let
r=n.facet(T),i=b(n).topNode;if(!r||r.allowsNesting)for(let
s=i;s;s=s.enter(e,t,pt.ExcludeBuffers))s.type.isTop&&(i=s);return
i}class J extends k{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:[C.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 b(n){let
e=n.field(k.state,!1);return e?e.tree:y.empty}function Be(n,e,t=50){var
r;let i=(r=n.field(k.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 Tt(n,e=n.doc.length){var
t;return((t=n.field(k.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!=b(n.state)&&n.dispatch({}),!!r}function
Ct(n){var e;return((e=n.plugin(je))===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,[],y.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!=y.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(H.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(H.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,u,p)=>l.push({fromA:h,toA:f,fromB:u,toB:p})),r=H.applyChanges(r,l),i=y.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),u=e.mapPos(h.to,-1);f<u&&a.push({from:f,to:u})}}}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 ve{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
y(U.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
H.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class
M{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 M(t)}static init(e){let
t=Math.min(3e3,e.doc.length),r=I.create(e.facet(T).parser,e,{from:0,to:t});return
r.work(20,t)||r.takeTree(),new
M(r)}}k.state=Q.define({create:M.init,update(n,e){for(let t of
e.effects)if(t.is(k.setState))return t.value;return
e.startState.facet(T)!=e.state.facet(T)?M.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,je=_.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(k.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(k.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(k.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:k.setState.of(new
M(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=>kt(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()}}}),T=v.define({combine(n){return
n.length?n[0]:null},enables:n=>[k.state,je,w.contentAttributes.compute([n],e=>{let
t=e.facet(n);return
t&&t.name?{"data-language":t.name}:{}})]});class
Pt{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
ie=v.define(),se=v.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(se);return
e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function oe(n,e){let
t="",r=n.tabSize,i=n.facet(se)[0];if(i=="	"){for(;e>=r;)t+="	",e-=r;i="
"}for(let s=0;s<e;s++)t+=i;return t}function le(n,e){n instanceof
L&&(n=new q(n));for(let r of n.state.facet(ie)){let
i=r(n,e);if(i!==void 0)return i}let t=b(n.state);return
t.length>=e?Dt(n,t,e):null}function It(n,e,t){let
r=Object.create(null),i=new q(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=le(i,a.from);if(l==null)continue;/\S/.test(a.text)||(l=0);let
h=/^\s*/.exec(a.text)[0],f=oe(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
q{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
mt(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 We=new
x;function Dt(n,e,t){let
r=e.resolveStack(t),i=r.node.enterUnfinishedNodesBefore(t);if(i!=r.node){let
s=[];for(let o=i;o!=r.node;o=o.parent)s.push(o);for(let
o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return Ue(r,n,t)}function
Ue(n,e,t){for(let r=n;r;r=r.next){let i=Mt(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
Mt(n){let e=n.type.prop(We);if(e)return e;let
t=n.firstChild,r;if(t&&(r=t.type.prop(x.closedBy))){let
i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return
o=>He(o,!0,1,void 0,s&&!Ot(o)?i.from:void 0)}return
n.parent==null?Nt:null}function Nt(){return 0}class K extends
q{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(Lt(r,e))break;t=this.state.doc.lineAt(r.from)}return
this.lineIndent(t.from)}continue(){return
Ue(this.context.next,this.base,this.pos)}}function Lt(n,e){for(let
t=e;t;t=t.parent)if(n==t)return!0;return!1}function Bt(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)return l.from<o?t:null;a=l.to}}function
Rt({closing:n,align:e=!0,units:t=1}){return r=>He(r,e,t,n)}function
He(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?Bt(n):null;return
l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const
Et=n=>n.baseIndent;function Ft({except:n,units:e=1}={}){return
t=>{let r=n&&n.test(t.textAfter);return
t.baseIndent+(r?0:e*t.unit)}}const jt=200;function Wt(){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+jt)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
u=le(o,f.from);if(u==null)continue;let
p=/^\s*/.exec(f.text)[0],d=oe(o,u);p!=d&&l.push({from:f.from,to:f.from+p.length,insert:d})}return
l.length?[n,{changes:l,sequential:!0}]:n})}const Ve=v.define(),$e=new
x;function Ut(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
Ht(n,e,t){let r=b(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||!Vt(a))){let
h=l(a,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(s=h)}}return
s}function Vt(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 Ht(n,e,t)}function
_e(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 O=V.define({map:_e}),P=V.define({map:_e});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 A=Q.define({create(){return
m.none},update(n,e){n=n.map(e.changes);for(let t of
e.effects)if(t.is(O)&&!_t(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(fe),i=r?m.replace({widget:new
Kt(r(e.state,t.value))}):Ze;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}));if(e.selection){let
t=!1,{head:r}=e.selection.main;n.between(r,r,(i,s)=>{i<r&&s>r&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,s)=>s<=r||i>=r}))}return
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(Ze.range(r,i))}return m.set(e,!0)}});function
$t(n){return n.field(A,!1)||Te.empty}function E(n,e,t){var r;let
i=null;return(r=n.field(A,!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(A,!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,[O.of(t),z(n,t)])}),!0}return!1},ze=n=>{if(!n.state.field(A,!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),z(n,r,!1))}return
e.length&&n.dispatch({effects:e}),e.length>0};function
z(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
Ge=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(O.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return
t.length&&n.dispatch({effects:he(n.state,t)}),!!t.length},Je=n=>{let
e=n.state.field(A,!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 zt=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),z(n,r,!1));else{let
i=qt(n,t);i&&e.push(O.of(i),z(n,i))}}return
e.length>0&&n.dispatch({effects:he(n.state,e)}),!!e.length},Gt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:qe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ze},{key:"Ctrl-Alt-[",run:Ge},{key:"Ctrl-Alt-]",run:Je}],Jt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},fe=v.define({combine(n){return
Ae(n,Jt)}});function ue(n){let e=[A,Xt];return
n&&e.push(fe.of(n)),e}function
Ke(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
Ze=m.replace({widget:new class extends Pe{toDOM(n){return
Ke(n,null)}}});class Kt extends
Pe{constructor(e){super(),this.value=e}eq(e){return
this.value==e.value}toDOM(e){return Ke(e,this.value)}}const
Zt={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class
ce extends
yt{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 Qt(n={}){let
e=Object.assign(Object.assign({},Zt),n),t=new ce(e,!0),r=new
ce(e,!1),i=_.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(T)!=o.state.facet(T)||o.startState.field(A,!1)!=o.state.field(A,!1)||b(o.startState)!=b(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)||Te.empty},initialSpacer(){return new
ce(e,!1)},domEventHandlers:Object.assign(Object.assign({},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:O.of(f)}),!0):!1}})}),ue()]}const
Xt=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=Oe.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
k?a=>a.prop(C)==o.data:o?a=>a==o:void
0,this.style=St(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new
Oe(r):null,this.themeType=t.themeType}static define(e,t){return new
W(e,t||{})}}const de=v.define(),Qe=v.define({combine(n){return
n.length?[n[0]]:null}});function G(n){let e=n.facet(de);return
e.length?e:n.facet(Qe)}function Yt(n,e){let t=[nn],r;return n instanceof
W&&(n.module&&t.push(w.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(Qe.of(n)):r?t.push(de.computeN([w.darkTheme],i=>i.facet(w.darkTheme)==(r=="dark")?[n]:[])):t.push(de.of(n)),t}function
en(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
tn{constructor(e){this.markCache=Object.create(null),this.tree=b(e.state),this.decorations=this.buildDeco(e,G(e.state)),this.decoratedTo=e.viewport.to}update(e){let
t=b(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
m.none;let r=new X;for(let{from:i,to:s}of
e.visibleRanges)xt(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=m.mark({class:l})))},i,s);return
r.finish()}}const
nn=Ce.high(_.fromClass(tn,{decorations:n=>n.decorations})),rn=W.define([{tag:c.meta,color:"#404740"},{tag:c.link,textDecoration:"underline"},{tag:c.heading,textDecoration:"underline",fontWeight:"bold"},{tag:c.emphasis,fontStyle:"italic"},{tag:c.strong,fontWeight:"bold"},{tag:c.strikethrough,textDecoration:"line-through"},{tag:c.keyword,color:"#708"},{tag:[c.atom,c.bool,c.url,c.contentSeparator,c.labelName],color:"#219"},{tag:[c.literal,c.inserted],color:"#164"},{tag:[c.string,c.deleted],color:"#a11"},{tag:[c.regexp,c.escape,c.special(c.string)],color:"#e40"},{tag:c.definition(c.variableName),color:"#00f"},{tag:c.local(c.variableName),color:"#30a"},{tag:[c.typeName,c.namespace],color:"#085"},{tag:c.className,color:"#167"},{tag:[c.special(c.variableName),c.macroName],color:"#256"},{tag:c.definition(c.propertyName),color:"#00c"},{tag:c.comment,color:"#940"},{tag:c.invalid,color:"#f00"}]),sn=w.baseTheme({"&.cm-focused
.cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused
.cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Xe=1e4,Ye="()[]{}",et=v.define({combine(n){return
Ae(n,{afterCursor:!0,brackets:Ye,maxScanDistance:Xe,renderMatch:an})}}),on=m.mark({class:"cm-matchingBracket"}),ln=m.mark({class:"cm-nonmatchingBracket"});function
an(n){let e=[],t=n.matched?on:ln;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
hn=Q.define({create(){return
m.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let
t=[],r=e.state.facet(et);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
m.set(t,!0)},provide:n=>w.decorations.from(n)}),fn=[hn,sn];function
un(n={}){return[et.of(n),fn]}const tt=new x;function pe(n,e,t){let
r=n.prop(e<0?x.openedBy:x.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(tt);return e?e(n.node):n}function
F(n,e,t,r={}){let
i=r.maxScanDistance||Xe,s=r.brackets||Ye,o=b(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
cn(n,e,t,l,f,h,s)}}return dn(n,e,t,o,a.type,i,s)}function
cn(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
u=ge(f);return{start:l,end:u?{from:u.from,to:u.to}:void 0,matched:!0}}else
if(pe(f.type,t,o))h++;else if(pe(f.type,-t,o)){if(h==0){let
u=ge(f);return{start:l,end:u&&u.from<u.to?{from:u.from,to:u.to}:void
0,matched:!1}}h--}}while(t<0?f.prevSibling():f.nextSibling());return{start:l,matched:!1}}function
dn(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),u=0;for(let
p=0;!f.next().done&&p<=s;){let
d=f.value;t<0&&(p+=d.length);let g=e+p*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(g+S,1).type!=i))if(Z%2==0==t>0)u++;else{if(u==1)return{start:h,end:{from:g+S,to:g+S+1},matched:Z>>1==l>>1};u--}}t>0&&(p+=d.length)}return
f.done?{start:h,matched:!1}:null}function
nt(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=nt(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:nt(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
pn(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||gn,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||be}}function
gn(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 rt=new
WeakMap;class xe extends k{constructor(e){let
t=ne(e.languageData),r=pn(e),i,s=new class extends
ve{createParse(o,a,l){return new
kn(i,o,a,l)}};super(t,s,[ie.of((o,a)=>this.getIndent(o,a))],e.name),this.topNode=wn(t),i=this,this.streamParser=r,this.stateAfter=new
x({perNode:!0}),this.tokenTable=e.tokenTable?new ht(r.tokenTable):yn}static
define(e){return new xe(e)}getIndent(e,t){let
r=b(e.state),i=r.resolve(t);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return
null;let
s,{overrideIndentation:o}=e.options;o&&(s=rt.get(e.state),s!=null&&s<t-1e4&&(s=void
0));let
a=ke(this,r,0,i.from,s??t),l,h;if(a?(h=a.state,l=a.pos+1):(h=this.streamParser.startState(e.unit),l=0),t-l>1e4)return
null;for(;l<t;){let
u=e.state.doc.lineAt(l),p=Math.min(t,u.to);if(u.length){let
d=o?o(u.from):-1,g=new me(u.text,e.state.tabSize,e.unit,d<0?void
0:d);for(;g.pos<p-u.from;)st(this.streamParser.token,g,h)}else
this.streamParser.blankLine(h,e.unit);if(p==t)break;l=u.to+1}let
f=e.lineAt(t);return
o&&s==null&&rt.set(e.state,f.from),this.streamParser.indent(h,/^\s*(.*)/.exec(f.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
y&&l<i&&ke(n,a,l,r,i);if(h)return h}return null}function
it(n,e,t,r,i){if(i&&t<=0&&r>=e.length)return
e;!i&&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
y){if(!(l=it(n,a,t-o,r-o,i)))break;return i?new
y(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return
null}function mn(n,e,t,r){for(let i of e){let
s=i.from+(i.openStart?25:0),o=i.to-(i.openEnd?25:0),a=s<=t&&o>t&&ke(n,i.tree,0-i.offset,t,o),l;if(a&&(l=it(n,i.tree,t+i.offset,a.pos+i.offset,!1)))return{state:a.state,tree:l}}return{state:n.streamParser.startState(r?R(r):4),tree:y.empty}}class
kn{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}=mn(e,r,o,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&&(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+2048);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,s){if(this.ranges.length>1){s=this.skipGapsTo(t,s,1),t+=s;let
o=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-o}return
this.chunk.push(e,t,r,i),s}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=st(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,4,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let
e=y.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:bn,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new
y(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
y(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function
st(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
be=Object.create(null),j=[U.none],bn=new
gt(j),ot=[],lt=Object.create(null),at=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"]])at[n]=ft(be,e);class
ht{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),at)}resolve(e){return
e?this.table[e]||(this.table[e]=ft(this.extra,e)):0}}const yn=new
ht(be);function
ye(n,e){ot.indexOf(n)>-1||(ot.push(n),console.warn(e))}function
ft(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let h of
a.split(".")){let f=n[h]||c[h];f?typeof
f=="function"?l.length?l=l.map(f):ye(h,`Modifier ${h} used at
start of tag`):l.length?ye(h,`Tag ${h} used as
modifier`):l=Array.isArray(f)?f:[f]:ye(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=lt[i];if(s)return
s.id;let o=lt[i]=U.define({id:j.length,name:r,props:[wt({[r]:t})]});return
j.push(o),o.id}function wn(n){let
e=U.define({id:j.length,name:"Document",props:[C.add(()=>n)],top:!0});return
j.push(e),e}function ut(n){return
n.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(n)}function
ct(n){for(let
e=n.iter();!e.next().done;)if(ut(e.value))return!0;return!1}function
Sn(n){let e=!1;return
n.iterChanges((t,r,i,s,o)=>{!e&&ct(o)&&(e=!0)}),e}const
we=v.define({combine:n=>n.some(e=>e)});function xn(n={}){let
e=[vn];return n.alwaysIsolate&&e.push(we.of(!0)),e}const
vn=_.fromClass(class{constructor(n){this.always=n.state.facet(we)||n.textDirection!=$.LTR||n.state.facet(w.perLineTextDirection),this.hasRTL=!this.always&&ct(n.state.doc),this.tree=b(n.state),this.decorations=this.always||this.hasRTL?dt(n,this.tree,this.always):m.none}update(n){let
e=n.state.facet(we)||n.view.textDirection!=$.LTR||n.state.facet(w.perLineTextDirection);if(!e&&!this.hasRTL&&Sn(n.changes)&&(this.hasRTL=!0),!e&&!this.hasRTL)return;let
t=b(n.state);(e!=this.always||t!=this.tree||n.docChanged||n.viewportChanged)&&(this.tree=t,this.always=e,this.decorations=dt(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:m.none}return[w.outerDecorations.of(e),Ce.lowest(w.bidiIsolatedRanges.of(e))]}});function
dt(n,e,t){let r=new
X,i=n.visibleRanges;t||(i=Tn(i,n.state.doc));for(let{from:s,to:o}of
i)e.iterate({enter:a=>{let
l=a.type.prop(x.isolate);l&&r.add(a.from,a.to,An[l])},from:s,to:o});return
r.finish()}function Tn(n,e){let
t=e.iter(),r=0,i=[],s=null;for(let{from:o,to:a}of
n)for(o!=r&&(r<o&&t.next(o-r),r=o);;){let
l=r,h=r+t.value.length;if(!t.lineBreak&&ut(t.value)&&(s&&s.to>l-10?s.to=Math.min(a,h):i.push(s={from:l,to:Math.min(a,h)})),r>=a)break;r=h,t.next()}return
i}const
An={rtl:m.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:$.RTL}),ltr:m.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:$.LTR}),auto:m.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};export{Re
as DocInput,W as HighlightStyle,q as IndentContext,J as LRLanguage,k as
Language,Se as LanguageDescription,Pt as LanguageSupport,I as
ParseContext,xe as StreamLanguage,me as StringStream,K as
TreeIndentContext,xn as bidiIsolates,un as bracketMatching,tt as
bracketMatchingHandle,ue as codeFolding,Ft as continuedIndent,rn as
defaultHighlightStyle,ne as defineLanguageFacet,Rt as delimitedIndent,Be as
ensureSyntaxTree,Et as flatIndent,Ge as foldAll,qe as foldCode,O as
foldEffect,Qt as foldGutter,Ut as foldInside,Gt as foldKeymap,$e as
foldNodeProp,Ve as foldService,A as foldState,D as foldable,$t as
foldedRanges,At as forceParsing,R as getIndentUnit,le as getIndentation,en
as highlightingFor,We as indentNodeProp,Wt as indentOnInput,It as
indentRange,ie as indentService,oe as indentString,se as indentUnit,T as
language,C as languageDataProp,F as matchBrackets,Ne as sublanguageProp,Yt
as syntaxHighlighting,Ct as syntaxParserRunning,b as syntaxTree,Tt as
syntaxTreeAvailable,zt as toggleFold,Je as unfoldAll,ze as unfoldCode,P as
unfoldEffect};