likec4 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/__app__/src/chunks/{-index-overview-XuOb1YP0.js → -index-overview-Csw3b-Fk.js} +4 -4
- package/__app__/src/chunks/{likec4-D8rQPdul.js → likec4-fsbHEjF3.js} +479 -478
- package/__app__/src/chunks/{main-BTT9mi5e.js → main-DbAbBULM.js} +5487 -5443
- package/__app__/src/chunks/{mantine-D3AsIG-5.js → mantine-BdYO4lQg.js} +3837 -3743
- package/__app__/src/chunks/{tanstack-router-BE0xJAYp.js → tanstack-router-H-3IPlI6.js} +1 -1
- package/__app__/src/main.js +1 -1
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +1277 -1145
- package/dist/cli/index.cjs +67 -65
- package/dist/cli/index.mjs +109 -107
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +114 -659
- package/dist/index.d.mts +114 -659
- package/dist/index.d.ts +114 -659
- package/dist/index.mjs +1 -1
- package/dist/model/index.cjs +1 -1
- package/dist/model/index.d.cts +2 -2
- package/dist/model/index.d.mts +2 -2
- package/dist/model/index.d.ts +2 -2
- package/dist/model/index.mjs +1 -1
- package/dist/shared/likec4.BH2DNgw1.mjs +1855 -0
- package/dist/shared/likec4.DIyCHEbR.cjs +1855 -0
- package/package.json +24 -22
- package/react/index.js +947 -820
- package/react/style.css +1 -1
- package/dist/shared/likec4.DpEZnw1B.cjs +0 -1856
- package/dist/shared/likec4.EF3jY6Mw.mjs +0 -1856
|
@@ -1,1856 +0,0 @@
|
|
|
1
|
-
import*as Fb from"node:fs";import{writeFileSync as Lb,statSync as P1,readFileSync as mm,appendFileSync as I1,createReadStream as Mb,createWriteStream as Bb,existsSync as x1}from"node:fs";import Pr,{sep as zb,resolve as N1,basename as O1}from"node:path";import{fileURLToPath as gm,pathToFileURL as F1}from"node:url";import{isatty as L1}from"tty";import M1,{formatWithOptions as qb,debuglog as B1,stripVTControlCharacters as z1,inspect as Ed,promisify as q1,callbackify as Zs,aborted as j1}from"node:util";import U1 from"util";import fr from"path";import G1 from"os";import W1 from"crypto";import H1 from"net";import V1 from"url";import ea from"fs";import jb from"child_process";import{nonexhaustive as Ie,defaultTheme as Ir,DefaultRelationshipColor as no,ComputedView as ro,delay as K1,invariant as Se,ComputedNode as Rd,DefaultArrowType as Ji,isome as Ub,extractStep as Y1,nonNullable as sn,hierarchyDistance as X1,nameFromFqn as io,parentFqn as so,compareFqnHierarchically as J1,isThemeColor as Gb,DefaultThemeColor as Wb,LinkedList as ym,DefaultLineStyle as Q1,AsFqn as Z1,stringHash as ex,compareNatural as Hb,LikeC4Model as Vb,sortByFqnHierarchically as Kb,isScopedElementView as tx,computeColorValues as nx,compareRelations as rx,DeploymentElement as ix,FqnRef as ao,isSameHierarchy as Yb,isAncestor as wm,FqnExpr as oo,isNonEmptyArray as Kn,isAutoLayoutDirection as sx,isOrOperator as Xb,isAndOperator as Jb,hasAtLeast as ax}from"@likec4/core";import tt,{cwd as ox,platform as ux,hrtime as Td,execPath as cx,execArgv as lx}from"node:process";import*as vm from"node:tty";import Qb from"node:tty";import{Graphviz as bm}from"@hpcc-js/wasm-graphviz";import{Buffer as Dm}from"buffer";import{resolveRulesExtendedViews as dx}from"@likec4/core/compute-view";import{ChildProcess as Zb,spawnSync as fx,spawn as px}from"node:child_process";import{StringDecoder as eD}from"node:string_decoder";import{setTimeout as tD,scheduler as nD,setImmediate as hx}from"node:timers/promises";import{constants as Qi,cpus as mx}from"node:os";import{once as wn,addAbortListener as rD,EventEmitter as gx,on as Sd,setMaxListeners as yx}from"node:events";import{serialize as wx}from"node:v8";import{Transform as vx,getDefaultHighWaterMark as $d,PassThrough as iD,Readable as Zi,Writable as Em,Duplex as Rm}from"node:stream";import{Buffer as Tm}from"node:buffer";import{finished as ci}from"node:stream/promises";import{createLogger as bx}from"vite";import{LikeC4Model as sD}from"@likec4/core/model";function Sm(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function $m(t,e,n=".",r){if(!Sm(e))return $m(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(r&&r(i,s,a,n)||(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:Sm(a)&&Sm(i[s])?i[s]=$m(a,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=a))}return i}function Dx(t){return(...e)=>e.reduce((n,r)=>$m(n,r,"",t),{})}const km=Dx();function bt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Mn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function Ex(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function kd(t){return typeof t=="object"&&t!==null&&bt(t.container)&&Mn(t.reference)&&typeof t.message=="string"}class aD{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return bt(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function li(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function es(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function oD(t){return li(t)&&typeof t.fullText=="string"}class Pt{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Pt(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return Kt})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Rx(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Pt(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Kt:{done:!1,value:e(i)}})}filter(e){return new Pt(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Kt})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Pt(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Cd(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Kt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Pt(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Cd(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Kt})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Pt(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new Pt(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Kt:this.nextFn(n.state)))}distinct(e){return new Pt(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return Kt})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Rx(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Cd(t){return!!t&&typeof t[Symbol.iterator]=="function"}const ta=new Pt(()=>{},()=>Kt),Kt=Object.freeze({done:!0,value:void 0});function et(...t){if(t.length===1){const e=t[0];if(e instanceof Pt)return e;if(Cd(e))return new Pt(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Pt(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Kt)}return t.length>1?new Pt(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];Cd(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Kt}):ta}class na extends Pt{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return Kt})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Cm;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(Cm||(Cm={}));function uo(t){return new na(t,e=>li(e)?e.content:[],{includeRoot:!0})}function uD(t){return uo(t).filter(es)}function cD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Ad(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function co(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var pr;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(pr||(pr={}));function lD(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return pr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return pr.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?pr.Inside:n?pr.OverlapBack:r?pr.OverlapFront:pr.Outside}function Am(t,e){return lD(t,e)>pr.After}const _m=/^[\w\p{L}]$/u;function di(t,e,n=_m){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return Im(t,e)}}function _d(t,e){if(t){const n=fD(t,!0);if(n&&Pm(n,e))return n;if(oD(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(Pm(s,e))return s}}}}function Pm(t,e){return es(t)&&e.includes(t.tokenType.name)}function Im(t,e){if(es(t))return t;if(li(t)){const n=dD(t,e,!1);if(n)return Im(n,e)}}function Pd(t,e){if(es(t))return t;if(li(t)){const n=dD(t,e,!0);if(n)return Pd(n,e)}}function dD(t,e,n){let r=0,i=t.content.length-1,s;for(;r<=i;){const a=Math.floor((r+i)/2),o=t.content[a];if(o.offset<=e&&o.end>e)return o;o.end<=e?(s=n?o:void 0,r=a+1):i=a-1}return s}function fD(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}function pD(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const s=n.content[r];if(e||!s.hidden)return s}t=n}}function Tx(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let n=t,r;for(;t.container;){const i=t.container,s=r??i.content.indexOf(t);if(s===0?(t=i,r=void 0):(r=s-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function hD(t,e){const n=Sx(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function Sx(t,e){const n=mD(t),r=mD(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const a=n[s],o=r[s];if(a.parent===o.parent)i={parent:a.parent,a:a.index,b:o.index};else break}return i}function mD(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}const $x={__proto__:null,DefaultNameRegexp:_m,get RangeComparison(){return pr},compareRange:lD,findCommentNode:_d,findDeclarationNodeAtOffset:di,findLeafNodeAtOffset:Im,findLeafNodeBeforeOffset:Pd,flattenCst:uD,getInteriorNodes:hD,getNextNode:pD,getPreviousNode:fD,getStartlineNode:Tx,inRange:Am,isChildNode:cD,isCommentNode:Pm,streamCst:uo,toDocumentSegment:co,tokenToRange:Ad};class gD extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function lo(t){throw new Error("Error! The input value was not handled.")}const Id="AbstractRule",xd="AbstractType",xm="Condition",yD="TypeDefinition",Nm="ValueLiteral",fo="AbstractElement";function Om(t){return qe.isInstance(t,fo)}const Nd="ArrayLiteral",po="ArrayType";function kx(t){return qe.isInstance(t,po)}const ho="BooleanLiteral";function Cx(t){return qe.isInstance(t,ho)}const mo="Conjunction";function Ax(t){return qe.isInstance(t,mo)}const go="Disjunction";function _x(t){return qe.isInstance(t,go)}const Od="Grammar",Fm="GrammarImport",yo="InferredType";function wD(t){return qe.isInstance(t,yo)}const wo="Interface";function vD(t){return qe.isInstance(t,wo)}const Lm="NamedArgument",vo="Negation";function Px(t){return qe.isInstance(t,vo)}const Fd="NumberLiteral",Ld="Parameter",bo="ParameterReference";function Ix(t){return qe.isInstance(t,bo)}const Do="ParserRule";function Yt(t){return qe.isInstance(t,Do)}const Eo="ReferenceType";function xx(t){return qe.isInstance(t,Eo)}const Md="ReturnType";function Nx(t){return qe.isInstance(t,Md)}const Ro="SimpleType";function bD(t){return qe.isInstance(t,Ro)}const Bd="StringLiteral",ra="TerminalRule";function xr(t){return qe.isInstance(t,ra)}const To="Type";function Mm(t){return qe.isInstance(t,To)}const Bm="TypeAttribute",So="UnionType";function Ox(t){return qe.isInstance(t,So)}const $o="Action";function ts(t){return qe.isInstance(t,$o)}const ko="Alternatives";function zm(t){return qe.isInstance(t,ko)}const Co="Assignment";function hr(t){return qe.isInstance(t,Co)}const Ao="CharacterRange";function Fx(t){return qe.isInstance(t,Ao)}const _o="CrossReference";function Po(t){return qe.isInstance(t,_o)}const Io="EndOfFile";function Lx(t){return qe.isInstance(t,Io)}const xo="Group";function fi(t){return qe.isInstance(t,xo)}const No="Keyword";function mr(t){return qe.isInstance(t,No)}const Oo="NegatedToken";function Mx(t){return qe.isInstance(t,Oo)}const Fo="RegexToken";function Bx(t){return qe.isInstance(t,Fo)}const Lo="RuleCall";function Nr(t){return qe.isInstance(t,Lo)}const Mo="TerminalAlternatives";function zx(t){return qe.isInstance(t,Mo)}const Bo="TerminalGroup";function qx(t){return qe.isInstance(t,Bo)}const zo="TerminalRuleCall";function DD(t){return qe.isInstance(t,zo)}const qo="UnorderedGroup";function qm(t){return qe.isInstance(t,qo)}const jo="UntilToken";function jx(t){return qe.isInstance(t,jo)}const Uo="Wildcard";function Ux(t){return qe.isInstance(t,Uo)}class ED extends aD{getAllTypes(){return[fo,Id,xd,$o,ko,Nd,po,Co,ho,Ao,xm,mo,_o,go,Io,Od,Fm,xo,yo,wo,No,Lm,Oo,vo,Fd,Ld,bo,Do,Eo,Fo,Md,Lo,Ro,Bd,Mo,Bo,ra,zo,To,Bm,yD,So,qo,jo,Nm,Uo]}computeIsSubtype(e,n){switch(e){case $o:case ko:case Co:case Ao:case _o:case Io:case xo:case No:case Oo:case Fo:case Lo:case Mo:case Bo:case zo:case qo:case jo:case Uo:return this.isSubtype(fo,n);case Nd:case Fd:case Bd:return this.isSubtype(Nm,n);case po:case Eo:case Ro:case So:return this.isSubtype(yD,n);case ho:return this.isSubtype(xm,n)||this.isSubtype(Nm,n);case mo:case go:case vo:case bo:return this.isSubtype(xm,n);case yo:case wo:case To:return this.isSubtype(xd,n);case Do:return this.isSubtype(Id,n)||this.isSubtype(xd,n);case ra:return this.isSubtype(Id,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return xd;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Id;case"Grammar:usedGrammars":return Od;case"NamedArgument:parameter":case"ParameterReference:parameter":return Ld;case"TerminalRuleCall:rule":return ra;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case fo:return{name:fo,properties:[{name:"cardinality"},{name:"lookahead"}]};case Nd:return{name:Nd,properties:[{name:"elements",defaultValue:[]}]};case po:return{name:po,properties:[{name:"elementType"}]};case ho:return{name:ho,properties:[{name:"true",defaultValue:!1}]};case mo:return{name:mo,properties:[{name:"left"},{name:"right"}]};case go:return{name:go,properties:[{name:"left"},{name:"right"}]};case Od:return{name:Od,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case Fm:return{name:Fm,properties:[{name:"path"}]};case yo:return{name:yo,properties:[{name:"name"}]};case wo:return{name:wo,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Lm:return{name:Lm,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case vo:return{name:vo,properties:[{name:"value"}]};case Fd:return{name:Fd,properties:[{name:"value"}]};case Ld:return{name:Ld,properties:[{name:"name"}]};case bo:return{name:bo,properties:[{name:"parameter"}]};case Do:return{name:Do,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Eo:return{name:Eo,properties:[{name:"referenceType"}]};case Md:return{name:Md,properties:[{name:"name"}]};case Ro:return{name:Ro,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Bd:return{name:Bd,properties:[{name:"value"}]};case ra:return{name:ra,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case To:return{name:To,properties:[{name:"name"},{name:"type"}]};case Bm:return{name:Bm,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case So:return{name:So,properties:[{name:"types",defaultValue:[]}]};case $o:return{name:$o,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case ko:return{name:ko,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Co:return{name:Co,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Ao:return{name:Ao,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case _o:return{name:_o,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Io:return{name:Io,properties:[{name:"cardinality"},{name:"lookahead"}]};case xo:return{name:xo,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case No:return{name:No,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Oo:return{name:Oo,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Fo:return{name:Fo,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case Lo:return{name:Lo,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Mo:return{name:Mo,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Bo:return{name:Bo,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case zo:return{name:zo,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case qo:return{name:qo,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case jo:return{name:jo,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Uo:return{name:Uo,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const qe=new ED;function jm(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{bt(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):bt(n)&&(n.$container=t,n.$containerProperty=e))}function Xt(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function pi(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function ht(t){const n=zd(t).$document;if(!n)throw new Error("AST node has no document.");return n}function zd(t){for(;t.$container;)t=t.$container;return t}function Go(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Pt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(bt(s)){if(r.keyIndex++,Um(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(bt(o)&&Um(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return Kt})}function gr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new na(t,n=>Go(n,e))}function Or(t,e){if(t){if(e?.range&&!Um(t,e.range))return new na(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new na(t,n=>Go(n,e),{includeRoot:!0})}function Um(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?Am(r,e):!1}function qd(t){return new Pt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(Mn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Mn(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Kt})}function Gx(t,e=ht(t).parseResult.value){const n=[];return Or(e).forEach(r=>{qd(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),et(n)}function Gm(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=RD(i.defaultValue))}function RD(t){return Array.isArray(t)?[...t.map(RD)]:t}function Wm(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(bt(i))n[r]=Wm(i,e);else if(Mn(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const a of i)bt(a)?s.push(Wm(a,e)):Mn(a)?s.push(e(n,r,a.$refNode,a.$refText)):s.push(a);n[r]=s}else n[r]=i;return jm(n),n}const Wo={__proto__:null,assignMandatoryProperties:Gm,copyAstNode:Wm,findLocalReferences:Gx,findRootNode:zd,getContainerOfType:Xt,getDocument:ht,hasContainerOfType:pi,linkContentToContainer:jm,streamAllContents:gr,streamAst:Or,streamContents:Go,streamReferences:qd};function Re(t){return t.charCodeAt(0)}function Hm(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function Ho(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function ia(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Wx(){throw Error("Internal Error - Should never get here!")}function TD(t){return t.type==="Character"}const jd=[];for(let t=Re("0");t<=Re("9");t++)jd.push(t);const Ud=[Re("_")].concat(jd);for(let t=Re("a");t<=Re("z");t++)Ud.push(t);for(let t=Re("A");t<=Re("Z");t++)Ud.push(t);const SD=[Re(" "),Re("\f"),Re(`
|
|
2
|
-
`),Re("\r"),Re(" "),Re("\v"),Re(" "),Re("\xA0"),Re("\u1680"),Re("\u2000"),Re("\u2001"),Re("\u2002"),Re("\u2003"),Re("\u2004"),Re("\u2005"),Re("\u2006"),Re("\u2007"),Re("\u2008"),Re("\u2009"),Re("\u200A"),Re("\u2028"),Re("\u2029"),Re("\u202F"),Re("\u205F"),Re("\u3000"),Re("\uFEFF")],Hx=/[0-9a-fA-F]/,Gd=/[0-9]/,Vx=/[1-9]/;class $D{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ho(r,"global");break;case"i":Ho(r,"ignoreCase");break;case"m":Ho(r,"multiLine");break;case"u":Ho(r,"unicode");break;case"y":Ho(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}ia(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return Wx()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;ia(n);break}if(!(e===!0&&n===void 0)&&ia(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),ia(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Re(`
|
|
3
|
-
`),Re("\r"),Re("\u2028"),Re("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=jd;break;case"D":e=jd,n=!0;break;case"s":e=SD;break;case"S":e=SD,n=!0;break;case"w":e=Ud;break;case"W":e=Ud,n=!0;break}if(ia(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Re("\f");break;case"n":e=Re(`
|
|
4
|
-
`);break;case"r":e=Re("\r");break;case"t":e=Re(" ");break;case"v":e=Re("\v");break}if(ia(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Re("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Re(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Re(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,TD(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,TD(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else Hm(r.value,e),e.push(Re("-")),Hm(i.value,e)}else Hm(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
-
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Re("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(Vx.test(e)===!1)throw Error("Expecting a positive integer");for(;Gd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Gd.test(e)===!1)throw Error("Expecting an integer");for(;Gd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
-
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Re(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Gd.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(Hx.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Wd{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const kD=/\r?\n/gm,Kx=new $D;class Yx extends Wd{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
|
|
10
|
-
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Hd(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
|
|
11
|
-
`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const Vm=new Yx;function Xx(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Vm.reset(t),Vm.visit(Kx.pattern(t)),Vm.multiline}catch{return!1}}const Jx=`\f
|
|
12
|
-
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Km(t){const e=typeof t=="string"?new RegExp(t):t;return Jx.some(n=>e.test(n))}function Hd(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qx(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Hd(e)).join("")}function Zx(t,e){const n=eN(t),r=e.match(n);return!!r&&r[0].length>0}function eN(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(c){s+=n.substr(r,c),r+=c}function u(c){s+="(?:"+n.substr(r,c)+"|$)",r+=c}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?n[r+2]==="{"?u(n.indexOf("}",r)-r+1):u(6):u(2);break;case"p":case"P":e.unicode?u(n.indexOf("}",r)-r+1):u(2);break;case"k":u(n.indexOf(">",r)-r+1);break;default:u(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],u(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):u(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:u(1);break}return s}return new RegExp(i(),t.flags)}function Vd(t){return t.rules.find(e=>Yt(e)&&e.entry)}function CD(t){return t.rules.filter(e=>xr(e)&&e.hidden)}function Ym(t,e){const n=new Set,r=Vd(t);if(!r)return new Set(t.rules);const i=[r].concat(CD(t));for(const a of i)AD(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||xr(a)&&a.hidden)&&s.add(a);return s}function AD(t,e,n){e.add(t.name),gr(t).forEach(r=>{if(Nr(r)||n&&DD(r)){const i=r.rule.ref;i&&!e.has(i.name)&&AD(i,e,n)}})}function Xm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=eg(t.type.ref);return e?.terminal}}function _D(t){return t.hidden&&!Km(Yo(t))}function sa(t,e){return!t||!e?[]:Jm(t,e,t.astNode,!0)}function Jt(t,e,n){if(!t||!e)return;const r=Jm(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Jm(t,e,n,r){if(!r){const i=Xt(t.grammarSource,hr);if(i&&i.feature===e)return[t]}return li(t)&&t.astNode===n?t.content.flatMap(i=>Jm(i,e,n,!1)):[]}function Qm(t,e){return t?Zm(t,e,t?.astNode):[]}function Vo(t,e,n){if(!t)return;const r=Zm(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Zm(t,e,n){if(t.astNode!==n)return[];if(mr(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=uo(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?mr(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function PD(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=Xt(t.grammarSource,hr);if(r)return r;t=t.container}}function eg(t){let e=t;return wD(e)&&(ts(e.$container)?e=e.$container.$container:Yt(e.$container)?e=e.$container:lo(e.$container)),ID(t,e,new Map)}function ID(t,e,n){var r;function i(s,a){let o;return Xt(s,hr)||(o=ID(a,a,n)),n.set(t,o),o}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of gr(e)){if(hr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Nr(s)&&Yt(s.rule.ref))return i(s,s.rule.ref);if(bD(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function xD(t){const e=t.$container;if(fi(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(ts(s))return s;{const a=gr(n[i]).find(ts);if(a)return a}}}if(Om(e))return xD(e)}function aa(t,e){return t==="?"||t==="*"||fi(e)&&!!e.guardCondition}function ND(t){return t==="*"||t==="+"}function tN(t){return t==="+="}function Kd(t){return OD(t,new Set)}function OD(t,e){if(e.has(t))return!0;e.add(t);for(const n of gr(t))if(Nr(n)){if(!n.rule.ref||Yt(n.rule.ref)&&!OD(n.rule.ref,e))return!1}else{if(hr(n))return!1;if(ts(n))return!1}return!!t.definition}function nN(t){return tg(t.type,new Set)}function tg(t,e){if(e.has(t))return!0;if(e.add(t),kx(t))return!1;if(xx(t))return!1;if(Ox(t))return t.types.every(n=>tg(n,e));if(bD(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const n=t.typeRef.ref;return Mm(n)?tg(n.type,e):!1}else return!1}else return!1}function ns(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(Yt(e))return e.name;if(vD(e)||Mm(e))return e.name}}}function Ko(t){var e;if(Yt(t))return Kd(t)?t.name:(e=ns(t))!==null&&e!==void 0?e:t.name;if(vD(t)||Mm(t)||Nx(t))return t.name;if(ts(t)){const n=FD(t);if(n)return n}else if(wD(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function FD(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return Ko(t.type.ref)}function rN(t){var e,n,r;return xr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":Kd(t)?t.name:(r=ns(t))!==null&&r!==void 0?r:t.name}function LD(t){var e,n,r;return xr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=ns(t))!==null&&r!==void 0?r:t.name}function Yo(t){const e={s:!1,i:!1,u:!1},n=oa(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const ng=/[\s\S]/.source;function oa(t,e){if(zx(t))return iN(t);if(qx(t))return sN(t);if(Fx(t))return uN(t);if(DD(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Fr(oa(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(Mx(t))return oN(t);if(jx(t))return aN(t);if(Bx(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),Fr(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(Ux(t))return Fr(ng,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function iN(t){return Fr(t.elements.map(e=>oa(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function sN(t){return Fr(t.elements.map(e=>oa(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function aN(t){return Fr(`${ng}*?${oa(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function oN(t){return Fr(`(?!${oa(t.terminal)})${ng}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function uN(t){return t.right?Fr(`[${rg(t.left)}-${rg(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):Fr(rg(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function rg(t){return Hd(t.value)}function Fr(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const Yd={__proto__:null,findAssignment:PD,findNameAssignment:eg,findNodeForKeyword:Vo,findNodeForProperty:Jt,findNodesForKeyword:Qm,findNodesForKeywordInternal:Zm,findNodesForProperty:sa,getActionAtElement:xD,getActionType:FD,getAllReachableRules:Ym,getCrossReferenceTerminal:Xm,getEntryRule:Vd,getExplicitRuleType:ns,getHiddenRules:CD,getRuleType:LD,getRuleTypeName:rN,getTypeName:Ko,isArrayCardinality:ND,isArrayOperator:tN,isCommentTerminal:_D,isDataType:nN,isDataTypeRule:Kd,isOptionalCardinality:aa,terminalRegex:Yo};function cN(t){const e=[],n=t.Grammar;for(const r of n.rules)xr(r)&&_D(r)&&Xx(Yo(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:_m}}var MD=typeof global=="object"&&global&&global.Object===Object&&global,lN=typeof self=="object"&&self&&self.Object===Object&&self,yr=MD||lN||Function("return this")(),Bn=yr.Symbol,BD=Object.prototype,dN=BD.hasOwnProperty,fN=BD.toString,Xo=Bn?Bn.toStringTag:void 0;function pN(t){var e=dN.call(t,Xo),n=t[Xo];try{t[Xo]=void 0;var r=!0}catch{}var i=fN.call(t);return r&&(e?t[Xo]=n:delete t[Xo]),i}var hN=Object.prototype,mN=hN.toString;function gN(t){return mN.call(t)}var yN="[object Null]",wN="[object Undefined]",zD=Bn?Bn.toStringTag:void 0;function hi(t){return t==null?t===void 0?wN:yN:zD&&zD in Object(t)?pN(t):gN(t)}function Yn(t){return t!=null&&typeof t=="object"}var vN="[object Symbol]";function Jo(t){return typeof t=="symbol"||Yn(t)&&hi(t)==vN}function Xd(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var je=Array.isArray,qD=Bn?Bn.prototype:void 0,jD=qD?qD.toString:void 0;function UD(t){if(typeof t=="string")return t;if(je(t))return Xd(t,UD)+"";if(Jo(t))return jD?jD.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var bN=/\s/;function DN(t){for(var e=t.length;e--&&bN.test(t.charAt(e)););return e}var EN=/^\s+/;function RN(t){return t&&t.slice(0,DN(t)+1).replace(EN,"")}function zn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var GD=NaN,TN=/^[-+]0x[0-9a-f]+$/i,SN=/^0b[01]+$/i,$N=/^0o[0-7]+$/i,kN=parseInt;function CN(t){if(typeof t=="number")return t;if(Jo(t))return GD;if(zn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=zn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=RN(t);var n=SN.test(t);return n||$N.test(t)?kN(t.slice(2),n?2:8):TN.test(t)?GD:+t}var AN=1/0,_N=17976931348623157e292;function PN(t){if(!t)return t===0?t:0;if(t=CN(t),t===AN||t===-1/0){var e=t<0?-1:1;return e*_N}return t===t?t:0}function Jd(t){var e=PN(t),n=e%1;return e===e?n?e-n:e:0}function rs(t){return t}var IN="[object AsyncFunction]",xN="[object Function]",NN="[object GeneratorFunction]",ON="[object Proxy]";function Lr(t){if(!zn(t))return!1;var e=hi(t);return e==xN||e==NN||e==IN||e==ON}var ig=yr["__core-js_shared__"],WD=function(){var t=/[^.]+$/.exec(ig&&ig.keys&&ig.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function FN(t){return!!WD&&WD in t}var LN=Function.prototype,MN=LN.toString;function is(t){if(t!=null){try{return MN.call(t)}catch{}try{return t+""}catch{}}return""}var BN=/[\\^$.*+?()[\]{}|]/g,zN=/^\[object .+?Constructor\]$/,qN=Function.prototype,jN=Object.prototype,UN=qN.toString,GN=jN.hasOwnProperty,WN=RegExp("^"+UN.call(GN).replace(BN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HN(t){if(!zn(t)||FN(t))return!1;var e=Lr(t)?WN:zN;return e.test(is(t))}function VN(t,e){return t?.[e]}function ss(t,e){var n=VN(t,e);return HN(n)?n:void 0}var sg=ss(yr,"WeakMap"),HD=Object.create,KN=function(){function t(){}return function(e){if(!zn(e))return{};if(HD)return HD(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function YN(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xt(){}function XN(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var JN=800,QN=16,ZN=Date.now;function eO(t){var e=0,n=0;return function(){var r=ZN(),i=QN-(r-n);if(n=r,i>0){if(++e>=JN)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function tO(t){return function(){return t}}var Qd=function(){try{var t=ss(Object,"defineProperty");return t({},"",{}),t}catch{}}(),nO=Qd?function(t,e){return Qd(t,"toString",{configurable:!0,enumerable:!1,value:tO(e),writable:!0})}:rs,rO=eO(nO);function VD(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function KD(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function iO(t){return t!==t}function sO(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function ag(t,e,n){return e===e?sO(t,e,n):KD(t,iO,n)}function YD(t,e){var n=t==null?0:t.length;return!!n&&ag(t,e,0)>-1}var aO=9007199254740991,oO=/^(?:0|[1-9]\d*)$/;function Zd(t,e){var n=typeof t;return e=e??aO,!!e&&(n=="number"||n!="symbol"&&oO.test(t))&&t>-1&&t%1==0&&t<e}function og(t,e,n){e=="__proto__"&&Qd?Qd(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Qo(t,e){return t===e||t!==t&&e!==e}var uO=Object.prototype,cO=uO.hasOwnProperty;function ef(t,e,n){var r=t[e];(!(cO.call(t,e)&&Qo(r,n))||n===void 0&&!(e in t))&&og(t,e,n)}function ug(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var o=e[s],u=void 0;u===void 0&&(u=t[o]),i?og(n,o,u):ef(n,o,u)}return n}var XD=Math.max;function lO(t,e,n){return e=XD(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=XD(r.length-e,0),a=Array(s);++i<s;)a[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(a),YN(t,this,o)}}function cg(t,e){return rO(lO(t,e,rs),t+"")}var dO=9007199254740991;function lg(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=dO}function wr(t){return t!=null&&lg(t.length)&&!Lr(t)}function JD(t,e,n){if(!zn(n))return!1;var r=typeof e;return(r=="number"?wr(n)&&Zd(e,n.length):r=="string"&&e in n)?Qo(n[e],t):!1}function fO(t){return cg(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&JD(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,s)}return e})}var pO=Object.prototype;function Zo(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||pO;return t===n}function hO(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var mO="[object Arguments]";function QD(t){return Yn(t)&&hi(t)==mO}var ZD=Object.prototype,gO=ZD.hasOwnProperty,yO=ZD.propertyIsEnumerable,tf=QD(function(){return arguments}())?QD:function(t){return Yn(t)&&gO.call(t,"callee")&&!yO.call(t,"callee")};function wO(){return!1}var eE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,tE=eE&&typeof module=="object"&&module&&!module.nodeType&&module,vO=tE&&tE.exports===eE,nE=vO?yr.Buffer:void 0,bO=nE?nE.isBuffer:void 0,eu=bO||wO,DO="[object Arguments]",EO="[object Array]",RO="[object Boolean]",TO="[object Date]",SO="[object Error]",$O="[object Function]",kO="[object Map]",CO="[object Number]",AO="[object Object]",_O="[object RegExp]",PO="[object Set]",IO="[object String]",xO="[object WeakMap]",NO="[object ArrayBuffer]",OO="[object DataView]",FO="[object Float32Array]",LO="[object Float64Array]",MO="[object Int8Array]",BO="[object Int16Array]",zO="[object Int32Array]",qO="[object Uint8Array]",jO="[object Uint8ClampedArray]",UO="[object Uint16Array]",GO="[object Uint32Array]",dt={};dt[FO]=dt[LO]=dt[MO]=dt[BO]=dt[zO]=dt[qO]=dt[jO]=dt[UO]=dt[GO]=!0,dt[DO]=dt[EO]=dt[NO]=dt[RO]=dt[OO]=dt[TO]=dt[SO]=dt[$O]=dt[kO]=dt[CO]=dt[AO]=dt[_O]=dt[PO]=dt[IO]=dt[xO]=!1;function WO(t){return Yn(t)&&lg(t.length)&&!!dt[hi(t)]}function nf(t){return function(e){return t(e)}}var rE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,tu=rE&&typeof module=="object"&&module&&!module.nodeType&&module,HO=tu&&tu.exports===rE,dg=HO&&MD.process,mi=function(){try{var t=tu&&tu.require&&tu.require("util").types;return t||dg&&dg.binding&&dg.binding("util")}catch{}}(),iE=mi&&mi.isTypedArray,fg=iE?nf(iE):WO,VO=Object.prototype,KO=VO.hasOwnProperty;function sE(t,e){var n=je(t),r=!n&&tf(t),i=!n&&!r&&eu(t),s=!n&&!r&&!i&&fg(t),a=n||r||i||s,o=a?hO(t.length,String):[],u=o.length;for(var c in t)(e||KO.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Zd(c,u)))&&o.push(c);return o}function aE(t,e){return function(n){return t(e(n))}}var YO=aE(Object.keys,Object),XO=Object.prototype,JO=XO.hasOwnProperty;function oE(t){if(!Zo(t))return YO(t);var e=[];for(var n in Object(t))JO.call(t,n)&&n!="constructor"&&e.push(n);return e}function qn(t){return wr(t)?sE(t):oE(t)}var QO=Object.prototype,ZO=QO.hasOwnProperty,$n=fO(function(t,e){if(Zo(e)||wr(e)){ug(e,qn(e),t);return}for(var n in e)ZO.call(e,n)&&ef(t,n,e[n])});function eF(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var tF=Object.prototype,nF=tF.hasOwnProperty;function rF(t){if(!zn(t))return eF(t);var e=Zo(t),n=[];for(var r in t)r=="constructor"&&(e||!nF.call(t,r))||n.push(r);return n}function uE(t){return wr(t)?sE(t,!0):rF(t)}var iF=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sF=/^\w*$/;function pg(t,e){if(je(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Jo(t)?!0:sF.test(t)||!iF.test(t)||e!=null&&t in Object(e)}var nu=ss(Object,"create");function aF(){this.__data__=nu?nu(null):{},this.size=0}function oF(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var uF="__lodash_hash_undefined__",cF=Object.prototype,lF=cF.hasOwnProperty;function dF(t){var e=this.__data__;if(nu){var n=e[t];return n===uF?void 0:n}return lF.call(e,t)?e[t]:void 0}var fF=Object.prototype,pF=fF.hasOwnProperty;function hF(t){var e=this.__data__;return nu?e[t]!==void 0:pF.call(e,t)}var mF="__lodash_hash_undefined__";function gF(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nu&&e===void 0?mF:e,this}function as(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}as.prototype.clear=aF,as.prototype.delete=oF,as.prototype.get=dF,as.prototype.has=hF,as.prototype.set=gF;function yF(){this.__data__=[],this.size=0}function rf(t,e){for(var n=t.length;n--;)if(Qo(t[n][0],e))return n;return-1}var wF=Array.prototype,vF=wF.splice;function bF(t){var e=this.__data__,n=rf(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():vF.call(e,n,1),--this.size,!0}function DF(t){var e=this.__data__,n=rf(e,t);return n<0?void 0:e[n][1]}function EF(t){return rf(this.__data__,t)>-1}function RF(t,e){var n=this.__data__,r=rf(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Mr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Mr.prototype.clear=yF,Mr.prototype.delete=bF,Mr.prototype.get=DF,Mr.prototype.has=EF,Mr.prototype.set=RF;var ru=ss(yr,"Map");function TF(){this.size=0,this.__data__={hash:new as,map:new(ru||Mr),string:new as}}function SF(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sf(t,e){var n=t.__data__;return SF(e)?n[typeof e=="string"?"string":"hash"]:n.map}function $F(t){var e=sf(this,t).delete(t);return this.size-=e?1:0,e}function kF(t){return sf(this,t).get(t)}function CF(t){return sf(this,t).has(t)}function AF(t,e){var n=sf(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Br(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Br.prototype.clear=TF,Br.prototype.delete=$F,Br.prototype.get=kF,Br.prototype.has=CF,Br.prototype.set=AF;var _F="Expected a function";function hg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(_F);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(hg.Cache||Br),n}hg.Cache=Br;var PF=500;function IF(t){var e=hg(t,function(r){return n.size===PF&&n.clear(),r}),n=e.cache;return e}var xF=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,NF=/\\(\\)?/g,OF=IF(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(xF,function(n,r,i,s){e.push(i?s.replace(NF,"$1"):r||n)}),e});function FF(t){return t==null?"":UD(t)}function af(t,e){return je(t)?t:pg(t,e)?[t]:OF(FF(t))}function iu(t){if(typeof t=="string"||Jo(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mg(t,e){e=af(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[iu(e[n++])];return n&&n==r?t:void 0}function LF(t,e,n){var r=t==null?void 0:mg(t,e);return r===void 0?n:r}function gg(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var cE=Bn?Bn.isConcatSpreadable:void 0;function MF(t){return je(t)||tf(t)||!!(cE&&t&&t[cE])}function yg(t,e,n,r,i){var s=-1,a=t.length;for(n||(n=MF),i||(i=[]);++s<a;){var o=t[s];n(o)?gg(i,o):r||(i[i.length]=o)}return i}function jn(t){var e=t==null?0:t.length;return e?yg(t):[]}var lE=aE(Object.getPrototypeOf,Object);function dE(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function BF(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function zF(){this.__data__=new Mr,this.size=0}function qF(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function jF(t){return this.__data__.get(t)}function UF(t){return this.__data__.has(t)}var GF=200;function WF(t,e){var n=this.__data__;if(n instanceof Mr){var r=n.__data__;if(!ru||r.length<GF-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Br(r)}return n.set(t,e),this.size=n.size,this}function vr(t){var e=this.__data__=new Mr(t);this.size=e.size}vr.prototype.clear=zF,vr.prototype.delete=qF,vr.prototype.get=jF,vr.prototype.has=UF,vr.prototype.set=WF;function HF(t,e){return t&&ug(e,qn(e),t)}var fE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pE=fE&&typeof module=="object"&&module&&!module.nodeType&&module,VF=pE&&pE.exports===fE,hE=VF?yr.Buffer:void 0,mE=hE?hE.allocUnsafe:void 0;function KF(t,e){var n=t.length,r=mE?mE(n):new t.constructor(n);return t.copy(r),r}function wg(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}function gE(){return[]}var YF=Object.prototype,XF=YF.propertyIsEnumerable,yE=Object.getOwnPropertySymbols,vg=yE?function(t){return t==null?[]:(t=Object(t),wg(yE(t),function(e){return XF.call(t,e)}))}:gE;function JF(t,e){return ug(t,vg(t),e)}var QF=Object.getOwnPropertySymbols,ZF=QF?function(t){for(var e=[];t;)gg(e,vg(t)),t=lE(t);return e}:gE;function wE(t,e,n){var r=e(t);return je(t)?r:gg(r,n(t))}function bg(t){return wE(t,qn,vg)}function eL(t){return wE(t,uE,ZF)}var Dg=ss(yr,"DataView"),Eg=ss(yr,"Promise"),ua=ss(yr,"Set"),vE="[object Map]",tL="[object Object]",bE="[object Promise]",DE="[object Set]",EE="[object WeakMap]",RE="[object DataView]",nL=is(Dg),rL=is(ru),iL=is(Eg),sL=is(ua),aL=is(sg),Un=hi;(Dg&&Un(new Dg(new ArrayBuffer(1)))!=RE||ru&&Un(new ru)!=vE||Eg&&Un(Eg.resolve())!=bE||ua&&Un(new ua)!=DE||sg&&Un(new sg)!=EE)&&(Un=function(t){var e=hi(t),n=e==tL?t.constructor:void 0,r=n?is(n):"";if(r)switch(r){case nL:return RE;case rL:return vE;case iL:return bE;case sL:return DE;case aL:return EE}return e});var oL=Object.prototype,uL=oL.hasOwnProperty;function cL(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&uL.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var of=yr.Uint8Array;function lL(t){var e=new t.constructor(t.byteLength);return new of(e).set(new of(t)),e}function dL(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var fL=/\w*$/;function pL(t){var e=new t.constructor(t.source,fL.exec(t));return e.lastIndex=t.lastIndex,e}var TE=Bn?Bn.prototype:void 0,SE=TE?TE.valueOf:void 0;function hL(t){return SE?Object(SE.call(t)):{}}function mL(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var gL="[object Boolean]",yL="[object Date]",wL="[object Map]",vL="[object Number]",bL="[object RegExp]",DL="[object Set]",EL="[object String]",RL="[object Symbol]",TL="[object ArrayBuffer]",SL="[object DataView]",$L="[object Float32Array]",kL="[object Float64Array]",CL="[object Int8Array]",AL="[object Int16Array]",_L="[object Int32Array]",PL="[object Uint8Array]",IL="[object Uint8ClampedArray]",xL="[object Uint16Array]",NL="[object Uint32Array]";function OL(t,e,n){var r=t.constructor;switch(e){case TL:return lL(t);case gL:case yL:return new r(+t);case SL:return dL(t);case $L:case kL:case CL:case AL:case _L:case PL:case IL:case xL:case NL:return mL(t);case wL:return new r;case vL:case EL:return new r(t);case bL:return pL(t);case DL:return new r;case RL:return hL(t)}}function FL(t){return typeof t.constructor=="function"&&!Zo(t)?KN(lE(t)):{}}var LL="[object Map]";function ML(t){return Yn(t)&&Un(t)==LL}var $E=mi&&mi.isMap,BL=$E?nf($E):ML,zL="[object Set]";function qL(t){return Yn(t)&&Un(t)==zL}var kE=mi&&mi.isSet,jL=kE?nf(kE):qL,CE="[object Arguments]",UL="[object Array]",GL="[object Boolean]",WL="[object Date]",HL="[object Error]",AE="[object Function]",VL="[object GeneratorFunction]",KL="[object Map]",YL="[object Number]",_E="[object Object]",XL="[object RegExp]",JL="[object Set]",QL="[object String]",ZL="[object Symbol]",eM="[object WeakMap]",tM="[object ArrayBuffer]",nM="[object DataView]",rM="[object Float32Array]",iM="[object Float64Array]",sM="[object Int8Array]",aM="[object Int16Array]",oM="[object Int32Array]",uM="[object Uint8Array]",cM="[object Uint8ClampedArray]",lM="[object Uint16Array]",dM="[object Uint32Array]",at={};at[CE]=at[UL]=at[tM]=at[nM]=at[GL]=at[WL]=at[rM]=at[iM]=at[sM]=at[aM]=at[oM]=at[KL]=at[YL]=at[_E]=at[XL]=at[JL]=at[QL]=at[ZL]=at[uM]=at[cM]=at[lM]=at[dM]=!0,at[HL]=at[AE]=at[eM]=!1;function uf(t,e,n,r,i,s){var a;if(a!==void 0)return a;if(!zn(t))return t;var o=je(t);if(o)return a=cL(t),XN(t,a);var u=Un(t),c=u==AE||u==VL;if(eu(t))return KF(t);if(u==_E||u==CE||c&&!i)return a=c?{}:FL(t),JF(t,HF(a,t));if(!at[u])return i?t:{};a=OL(t,u),s||(s=new vr);var l=s.get(t);if(l)return l;s.set(t,a),jL(t)?t.forEach(function(p){a.add(uf(p,e,n,p,t,s))}):BL(t)&&t.forEach(function(p,h){a.set(h,uf(p,e,n,h,t,s))});var d=bg,f=o?void 0:d(t);return VD(f||t,function(p,h){f&&(h=p,p=t[h]),ef(a,h,uf(p,e,n,h,t,s))}),a}var fM=4;function qt(t){return uf(t,fM)}function su(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var pM="__lodash_hash_undefined__";function hM(t){return this.__data__.set(t,pM),this}function mM(t){return this.__data__.has(t)}function ca(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Br;++e<n;)this.add(t[e])}ca.prototype.add=ca.prototype.push=hM,ca.prototype.has=mM;function PE(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Rg(t,e){return t.has(e)}var gM=1,yM=2;function IE(t,e,n,r,i,s){var a=n&gM,o=t.length,u=e.length;if(o!=u&&!(a&&u>o))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,p=n&yM?new ca:void 0;for(s.set(t,e),s.set(e,t);++d<o;){var h=t[d],w=e[d];if(r)var D=a?r(w,h,d,e,t,s):r(h,w,d,t,e,s);if(D!==void 0){if(D)continue;f=!1;break}if(p){if(!PE(e,function(g,v){if(!Rg(p,v)&&(h===g||i(h,g,n,r,s)))return p.push(v)})){f=!1;break}}else if(!(h===w||i(h,w,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function wM(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Tg(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var vM=1,bM=2,DM="[object Boolean]",EM="[object Date]",RM="[object Error]",TM="[object Map]",SM="[object Number]",$M="[object RegExp]",kM="[object Set]",CM="[object String]",AM="[object Symbol]",_M="[object ArrayBuffer]",PM="[object DataView]",xE=Bn?Bn.prototype:void 0,Sg=xE?xE.valueOf:void 0;function IM(t,e,n,r,i,s,a){switch(n){case PM:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _M:return!(t.byteLength!=e.byteLength||!s(new of(t),new of(e)));case DM:case EM:case SM:return Qo(+t,+e);case RM:return t.name==e.name&&t.message==e.message;case $M:case CM:return t==e+"";case TM:var o=wM;case kM:var u=r&vM;if(o||(o=Tg),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;r|=bM,a.set(t,e);var l=IE(o(t),o(e),r,i,s,a);return a.delete(t),l;case AM:if(Sg)return Sg.call(t)==Sg.call(e)}return!1}var xM=1,NM=Object.prototype,OM=NM.hasOwnProperty;function FM(t,e,n,r,i,s){var a=n&xM,o=bg(t),u=o.length,c=bg(e),l=c.length;if(u!=l&&!a)return!1;for(var d=u;d--;){var f=o[d];if(!(a?f in e:OM.call(e,f)))return!1}var p=s.get(t),h=s.get(e);if(p&&h)return p==e&&h==t;var w=!0;s.set(t,e),s.set(e,t);for(var D=a;++d<u;){f=o[d];var g=t[f],v=e[f];if(r)var R=a?r(v,g,f,e,t,s):r(g,v,f,t,e,s);if(!(R===void 0?g===v||i(g,v,n,r,s):R)){w=!1;break}D||(D=f=="constructor")}if(w&&!D){var k=t.constructor,A=e.constructor;k!=A&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof A=="function"&&A instanceof A)&&(w=!1)}return s.delete(t),s.delete(e),w}var LM=1,NE="[object Arguments]",OE="[object Array]",cf="[object Object]",MM=Object.prototype,FE=MM.hasOwnProperty;function BM(t,e,n,r,i,s){var a=je(t),o=je(e),u=a?OE:Un(t),c=o?OE:Un(e);u=u==NE?cf:u,c=c==NE?cf:c;var l=u==cf,d=c==cf,f=u==c;if(f&&eu(t)){if(!eu(e))return!1;a=!0,l=!1}if(f&&!l)return s||(s=new vr),a||fg(t)?IE(t,e,n,r,i,s):IM(t,e,u,n,r,i,s);if(!(n&LM)){var p=l&&FE.call(t,"__wrapped__"),h=d&&FE.call(e,"__wrapped__");if(p||h){var w=p?t.value():t,D=h?e.value():e;return s||(s=new vr),i(w,D,n,r,s)}}return f?(s||(s=new vr),FM(t,e,n,r,i,s)):!1}function $g(t,e,n,r,i){return t===e?!0:t==null||e==null||!Yn(t)&&!Yn(e)?t!==t&&e!==e:BM(t,e,n,r,$g,i)}var zM=1,qM=2;function jM(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var o=a[0],u=t[o],c=a[1];if(a[2]){if(u===void 0&&!(o in t))return!1}else{var l=new vr,d;if(!(d===void 0?$g(c,u,zM|qM,r,l):d))return!1}}return!0}function LE(t){return t===t&&!zn(t)}function UM(t){for(var e=qn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,LE(i)]}return e}function ME(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function GM(t){var e=UM(t);return e.length==1&&e[0][2]?ME(e[0][0],e[0][1]):function(n){return n===t||jM(n,t,e)}}function WM(t,e){return t!=null&&e in Object(t)}function BE(t,e,n){e=af(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var a=iu(e[r]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&lg(i)&&Zd(a,i)&&(je(t)||tf(t)))}function HM(t,e){return t!=null&&BE(t,e,WM)}var VM=1,KM=2;function YM(t,e){return pg(t)&&LE(e)?ME(iu(t),e):function(n){var r=LF(n,t);return r===void 0&&r===e?HM(n,t):$g(e,r,VM|KM)}}function XM(t){return function(e){return e?.[t]}}function JM(t){return function(e){return mg(e,t)}}function QM(t){return pg(t)?XM(iu(t)):JM(t)}function Xn(t){return typeof t=="function"?t:t==null?rs:typeof t=="object"?je(t)?YM(t[0],t[1]):GM(t):QM(t)}function ZM(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(r,a,n(a),t)}return r}function e2(t){return function(e,n,r){for(var i=-1,s=Object(e),a=r(e),o=a.length;o--;){var u=a[++i];if(n(s[u],u,s)===!1)break}return e}}var t2=e2();function n2(t,e){return t&&t2(t,e,qn)}function r2(t,e){return function(n,r){if(n==null)return n;if(!wr(n))return t(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var os=r2(n2);function i2(t,e,n,r){return os(t,function(i,s,a){e(r,i,n(i),a)}),r}function s2(t,e){return function(n,r){var i=je(n)?ZM:i2,s=e?e():{};return i(n,t,Xn(r),s)}}var zE=Object.prototype,a2=zE.hasOwnProperty,kg=cg(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&JD(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],a=uE(s),o=-1,u=a.length;++o<u;){var c=a[o],l=t[c];(l===void 0||Qo(l,zE[c])&&!a2.call(t,c))&&(t[c]=s[c])}return t});function qE(t){return Yn(t)&&wr(t)}var o2=200;function u2(t,e,n,r){var i=-1,s=YD,a=!0,o=t.length,u=[],c=e.length;if(!o)return u;e.length>=o2&&(s=Rg,a=!1,e=new ca(e));e:for(;++i<o;){var l=t[i],d=l;if(l=l!==0?l:0,a&&d===d){for(var f=c;f--;)if(e[f]===d)continue e;u.push(l)}else s(e,d,r)||u.push(l)}return u}var lf=cg(function(t,e){return qE(t)?u2(t,yg(e,1,qE,!0)):[]});function la(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function jt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Jd(e),dE(t,e<0?0:e,r)):[]}function au(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Jd(e),e=r-e,dE(t,0,e<0?0:e)):[]}function c2(t){return typeof t=="function"?t:rs}function De(t,e){var n=je(t)?VD:os;return n(t,c2(e))}function l2(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function d2(t,e){var n=!0;return os(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function Jn(t,e,n){var r=je(t)?l2:d2;return r(t,Xn(e))}function jE(t,e){var n=[];return os(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function kn(t,e){var n=je(t)?wg:jE;return n(t,Xn(e))}function f2(t){return function(e,n,r){var i=Object(e);if(!wr(e)){var s=Xn(n);e=qn(e),n=function(o){return s(i[o],o,i)}}var a=t(e,n,r);return a>-1?i[s?e[a]:a]:void 0}}var p2=Math.max;function h2(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Jd(n);return i<0&&(i=p2(r+i,0)),KD(t,Xn(e),i)}var da=f2(h2);function Qn(t){return t&&t.length?t[0]:void 0}function m2(t,e){var n=-1,r=wr(t)?Array(t.length):[];return os(t,function(i,s,a){r[++n]=e(i,s,a)}),r}function fe(t,e){var n=je(t)?Xd:m2;return n(t,Xn(e))}function Cn(t,e){return yg(fe(t,e))}var g2=Object.prototype,y2=g2.hasOwnProperty,w2=s2(function(t,e,n){y2.call(t,n)?t[n].push(e):og(t,n,[e])}),v2=Object.prototype,b2=v2.hasOwnProperty;function D2(t,e){return t!=null&&b2.call(t,e)}function Ee(t,e){return t!=null&&BE(t,e,D2)}var E2="[object String]";function vn(t){return typeof t=="string"||!je(t)&&Yn(t)&&hi(t)==E2}function R2(t,e){return Xd(e,function(n){return t[n]})}function Nt(t){return t==null?[]:R2(t,qn(t))}var T2=Math.max;function an(t,e,n,r){t=wr(t)?t:Nt(t),n=n?Jd(n):0;var i=t.length;return n<0&&(n=T2(i+n,0)),vn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ag(t,e,n)>-1}function UE(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return ag(t,e,i)}var S2="[object Map]",$2="[object Set]",k2=Object.prototype,C2=k2.hasOwnProperty;function nt(t){if(t==null)return!0;if(wr(t)&&(je(t)||typeof t=="string"||typeof t.splice=="function"||eu(t)||fg(t)||tf(t)))return!t.length;var e=Un(t);if(e==S2||e==$2)return!t.size;if(Zo(t))return!oE(t).length;for(var n in t)if(C2.call(t,n))return!1;return!0}var A2="[object RegExp]";function _2(t){return Yn(t)&&hi(t)==A2}var GE=mi&&mi.isRegExp,zr=GE?nf(GE):_2;function qr(t){return t===void 0}function P2(t,e){return t<e}function I2(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],a=e(s);if(a!=null&&(o===void 0?a===a&&!Jo(a):n(a,o)))var o=a,u=s}return u}function x2(t){return t&&t.length?I2(t,rs,P2):void 0}var N2="Expected a function";function O2(t){if(typeof t!="function")throw new TypeError(N2);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function F2(t,e,n,r){if(!zn(t))return t;e=af(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var u=iu(e[i]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=a){var l=o[u];c=void 0,c===void 0&&(c=zn(l)?l:Zd(e[i+1])?[]:{})}ef(o,u,c),o=o[u]}return t}function L2(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var a=e[r],o=mg(t,a);n(o,a)&&F2(s,af(a,t),o)}return s}function Zn(t,e){if(t==null)return{};var n=Xd(eL(t),function(r){return[r]});return e=Xn(e),L2(t,n,function(r,i){return e(r,i[0])})}function M2(t,e,n,r,i){return i(t,function(s,a,o){n=r?(r=!1,s):e(n,s,a,o)}),n}function on(t,e,n){var r=je(t)?BF:M2,i=arguments.length<3;return r(t,Xn(e),n,i,os)}function df(t,e){var n=je(t)?wg:jE;return n(t,O2(Xn(e)))}function B2(t,e){var n;return os(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function WE(t,e,n){var r=je(t)?PE:B2;return r(t,Xn(e))}var z2=1/0,q2=ua&&1/Tg(new ua([,-0]))[1]==z2?function(t){return new ua(t)}:xt,j2=200;function HE(t,e,n){var r=-1,i=YD,s=t.length,a=!0,o=[],u=o;if(s>=j2){var c=e?null:q2(t);if(c)return Tg(c);a=!1,i=Rg,u=new ca}else u=e?[]:o;e:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=l!==0?l:0,a&&d===d){for(var f=u.length;f--;)if(u[f]===d)continue e;e&&u.push(d),o.push(l)}else i(u,d,n)||(u!==o&&u.push(d),o.push(l))}return o}function Cg(t){return t&&t.length?HE(t):[]}function U2(t,e){return t&&t.length?HE(t,Xn(e)):[]}function Ag(t){console&&console.error&&console.error(`Error: ${t}`)}function VE(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function KE(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function YE(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function G2(t){return W2(t)?t.LABEL:t.name}function W2(t){return vn(t.LABEL)&&t.LABEL!==""}class br{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),De(this.definition,n=>{n.accept(e)})}}class un extends br{constructor(e){super([]),this.idx=1,$n(this,Zn(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class fa extends br{constructor(e){super(e.definition),this.orgText="",$n(this,Zn(e,n=>n!==void 0))}}class bn extends br{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,$n(this,Zn(e,n=>n!==void 0))}}class Ut extends br{constructor(e){super(e.definition),this.idx=1,$n(this,Zn(e,n=>n!==void 0))}}class An extends br{constructor(e){super(e.definition),this.idx=1,$n(this,Zn(e,n=>n!==void 0))}}class _n extends br{constructor(e){super(e.definition),this.idx=1,$n(this,Zn(e,n=>n!==void 0))}}class Dt extends br{constructor(e){super(e.definition),this.idx=1,$n(this,Zn(e,n=>n!==void 0))}}class Dn extends br{constructor(e){super(e.definition),this.idx=1,$n(this,Zn(e,n=>n!==void 0))}}class En extends br{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,$n(this,Zn(e,n=>n!==void 0))}}class ft{constructor(e){this.idx=1,$n(this,Zn(e,n=>n!==void 0))}accept(e){e.visit(this)}}function H2(t){return fe(t,ff)}function ff(t){function e(n){return fe(n,ff)}if(t instanceof un){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return vn(t.label)&&(n.label=t.label),n}else{if(t instanceof bn)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ut)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof An)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof _n)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:ff(new ft({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Dn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:ff(new ft({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Dt)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof En)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ft){const n={type:"Terminal",name:t.terminalType.name,label:G2(t.terminalType),idx:t.idx};vn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=zr(r)?r.source:r),n}else{if(t instanceof fa)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class pa{visit(e){const n=e;switch(n.constructor){case un:return this.visitNonTerminal(n);case bn:return this.visitAlternative(n);case Ut:return this.visitOption(n);case An:return this.visitRepetitionMandatory(n);case _n:return this.visitRepetitionMandatoryWithSeparator(n);case Dn:return this.visitRepetitionWithSeparator(n);case Dt:return this.visitRepetition(n);case En:return this.visitAlternation(n);case ft:return this.visitTerminal(n);case fa:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function V2(t){return t instanceof bn||t instanceof Ut||t instanceof Dt||t instanceof An||t instanceof _n||t instanceof Dn||t instanceof ft||t instanceof fa}function pf(t,e=[]){return t instanceof Ut||t instanceof Dt||t instanceof Dn?!0:t instanceof En?WE(t.definition,r=>pf(r,e)):t instanceof un&&an(e,t)?!1:t instanceof br?(t instanceof un&&e.push(t),Jn(t.definition,r=>pf(r,e))):!1}function K2(t){return t instanceof En}function Dr(t){if(t instanceof un)return"SUBRULE";if(t instanceof Ut)return"OPTION";if(t instanceof En)return"OR";if(t instanceof An)return"AT_LEAST_ONE";if(t instanceof _n)return"AT_LEAST_ONE_SEP";if(t instanceof Dn)return"MANY_SEP";if(t instanceof Dt)return"MANY";if(t instanceof ft)return"CONSUME";throw Error("non exhaustive match")}class hf{walk(e,n=[]){De(e.definition,(r,i)=>{const s=jt(e.definition,i+1);if(r instanceof un)this.walkProdRef(r,s,n);else if(r instanceof ft)this.walkTerminal(r,s,n);else if(r instanceof bn)this.walkFlat(r,s,n);else if(r instanceof Ut)this.walkOption(r,s,n);else if(r instanceof An)this.walkAtLeastOne(r,s,n);else if(r instanceof _n)this.walkAtLeastOneSep(r,s,n);else if(r instanceof Dn)this.walkManySep(r,s,n);else if(r instanceof Dt)this.walkMany(r,s,n);else if(r instanceof En)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Ut({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=XE(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Ut({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=XE(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);De(e.definition,s=>{const a=new bn({definition:[s]});this.walk(a,i)})}}function XE(t,e,n){return[new Ut({definition:[new ft({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function ou(t){if(t instanceof un)return ou(t.referencedRule);if(t instanceof ft)return J2(t);if(V2(t))return Y2(t);if(K2(t))return X2(t);throw Error("non exhaustive match")}function Y2(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=pf(s),e=e.concat(ou(s)),r=r+1,i=n.length>r;return Cg(e)}function X2(t){const e=fe(t.definition,n=>ou(n));return Cg(jn(e))}function J2(t){return[t.terminalType]}const JE="_~IN~_";class Q2 extends hf{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=eB(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new bn({definition:s}),o=ou(a);this.follows[i]=o}}function Z2(t){const e={};return De(t,n=>{const r=new Q2(n).startWalking();$n(e,r)}),e}function eB(t,e){return t.name+e+JE}let mf={};const tB=new $D;function gf(t){const e=t.toString();if(mf.hasOwnProperty(e))return mf[e];{const n=tB.pattern(e);return mf[e]=n,n}}function nB(){mf={}}const QE="Complement Sets are not supported for first char optimization",yf=`Unable to use "first char" lexer optimizations:
|
|
13
|
-
`;function rB(t,e=!1){try{const n=gf(t);return _g(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===QE)e&&VE(`${yf} Unable to optimize: < ${t.toString()} >
|
|
14
|
-
Complement Sets cannot be automatically optimized.
|
|
15
|
-
This will disable the lexer's first char optimizations.
|
|
16
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
|
|
17
|
-
This will disable the lexer's first char optimizations.
|
|
18
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Ag(`${yf}
|
|
19
|
-
Failed parsing: < ${t.toString()} >
|
|
20
|
-
Using the @chevrotain/regexp-to-ast library
|
|
21
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function _g(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)_g(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":wf(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(QE);De(a.value,u=>{if(typeof u=="number")wf(u,e,n);else{const c=u;if(n===!0)for(let l=c.from;l<=c.to;l++)wf(l,e,n);else{for(let l=c.from;l<=c.to&&l<cu;l++)wf(l,e,n);if(c.to>=cu){const l=c.from>=cu?c.from:cu,d=c.to,f=gi(l),p=gi(d);for(let h=f;h<=p;h++)e[h]=h}}}});break;case"Group":_g(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Pg(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Nt(e)}function wf(t,e,n){const r=gi(t);e[r]=r,n===!0&&iB(t,e)}function iB(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=gi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=gi(i.charCodeAt(0));e[s]=s}}}function ZE(t,e){return da(t.value,n=>{if(typeof n=="number")return an(e,n);{const r=n;return da(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Pg(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?je(t.value)?Jn(t.value,Pg):Pg(t.value):!1}class sB extends Wd{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){an(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?ZE(e,this.targetCharCodes)===void 0&&(this.found=!0):ZE(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Ig(t,e){if(e instanceof RegExp){const n=gf(e),r=new sB(t);return r.visit(n),r.found}else return da(e,n=>an(t,n.charCodeAt(0)))!==void 0}const us="PATTERN",uu="defaultMode",vf="modes";let eR=typeof new RegExp("(?:)").sticky=="boolean";function aB(t,e){e=kg(e,{useSticky:eR,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
-
`],tracer:(v,R)=>R()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{AB()});let r;n("Reject Lexer.NA",()=>{r=df(t,v=>v[us]===Rn.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=fe(r,v=>{const R=v[us];if(zr(R)){const k=R.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!R.ignoreCase?k:k.length===2&&k[0]==="\\"&&!an(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?nR(R):tR(R)}else{if(Lr(R))return i=!0,{exec:R};if(typeof R=="object")return i=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const k=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(k);return e.useSticky?nR(A):tR(A)}}else throw Error("non exhaustive match")}})});let a,o,u,c,l;n("misc mapping",()=>{a=fe(r,v=>v.tokenTypeIdx),o=fe(r,v=>{const R=v.GROUP;if(R!==Rn.SKIPPED){if(vn(R))return R;if(qr(R))return!1;throw Error("non exhaustive match")}}),u=fe(r,v=>{const R=v.LONGER_ALT;if(R)return je(R)?fe(R,A=>UE(r,A)):[UE(r,R)]}),c=fe(r,v=>v.PUSH_MODE),l=fe(r,v=>Ee(v,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const v=sR(e.lineTerminatorCharacters);d=fe(r,R=>!1),e.positionTracking!=="onlyOffset"&&(d=fe(r,R=>Ee(R,"LINE_BREAKS")?!!R.LINE_BREAKS:iR(R,v)===!1&&Ig(v,R.PATTERN)))});let f,p,h,w;n("Misc Mapping #2",()=>{f=fe(r,rR),p=fe(s,$B),h=on(r,(v,R)=>{const k=R.GROUP;return vn(k)&&k!==Rn.SKIPPED&&(v[k]=[]),v},{}),w=fe(s,(v,R)=>({pattern:s[R],longerAlt:u[R],canLineTerminator:d[R],isCustom:f[R],short:p[R],group:o[R],push:c[R],pop:l[R],tokenTypeIdx:a[R],tokenType:r[R]}))});let D=!0,g=[];return e.safeMode||n("First Char Optimization",()=>{g=on(r,(v,R,k)=>{if(typeof R.PATTERN=="string"){const A=R.PATTERN.charCodeAt(0),j=gi(A);xg(v,j,w[k])}else if(je(R.START_CHARS_HINT)){let A;De(R.START_CHARS_HINT,j=>{const W=typeof j=="string"?j.charCodeAt(0):j,Z=gi(W);A!==Z&&(A=Z,xg(v,Z,w[k]))})}else if(zr(R.PATTERN))if(R.PATTERN.unicode)D=!1,e.ensureOptimizations&&Ag(`${yf} Unable to analyze < ${R.PATTERN.toString()} > pattern.
|
|
23
|
-
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
|
-
This will disable the lexer's first char optimizations.
|
|
25
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=rB(R.PATTERN,e.ensureOptimizations);nt(A)&&(D=!1),De(A,j=>{xg(v,j,w[k])})}else e.ensureOptimizations&&Ag(`${yf} TokenType: <${R.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
|
-
This will disable the lexer's first char optimizations.
|
|
27
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),D=!1;return v},[])}),{emptyGroups:h,patternIdxToConfig:w,charCodeToPatternIdxToConfig:g,hasCustom:i,canBeOptimized:D}}function oB(t,e){let n=[];const r=cB(t);n=n.concat(r.errors);const i=lB(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(uB(s)),n=n.concat(wB(s)),n=n.concat(vB(s,e)),n=n.concat(bB(s)),n}function uB(t){let e=[];const n=kn(t,r=>zr(r[us]));return e=e.concat(fB(n)),e=e.concat(mB(n)),e=e.concat(gB(n)),e=e.concat(yB(n)),e=e.concat(pB(n)),e}function cB(t){const e=kn(t,i=>!Ee(i,us)),n=fe(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Et.MISSING_PATTERN,tokenTypes:[i]})),r=lf(t,e);return{errors:n,valid:r}}function lB(t){const e=kn(t,i=>{const s=i[us];return!zr(s)&&!Lr(s)&&!Ee(s,"exec")&&!vn(s)}),n=fe(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Et.INVALID_PATTERN,tokenTypes:[i]})),r=lf(t,e);return{errors:n,valid:r}}const dB=/[^\\][$]/;function fB(t){class e extends Wd{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=kn(t,i=>{const s=i.PATTERN;try{const a=gf(s),o=new e;return o.visit(a),o.found}catch{return dB.test(s.source)}});return fe(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
28
|
-
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Et.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function pB(t){const e=kn(t,r=>r.PATTERN.test(""));return fe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Et.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const hB=/[^\\[][\^]|^\^/;function mB(t){class e extends Wd{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=kn(t,i=>{const s=i.PATTERN;try{const a=gf(s),o=new e;return o.visit(a),o.found}catch{return hB.test(s.source)}});return fe(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
30
|
-
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
31
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Et.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function gB(t){const e=kn(t,r=>{const i=r[us];return i instanceof RegExp&&(i.multiline||i.global)});return fe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Et.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function yB(t){const e=[];let n=fe(t,s=>on(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!an(e,o)&&o.PATTERN!==Rn.NA&&(e.push(o),a.push(o)),a),[]));n=su(n);const r=kn(n,s=>s.length>1);return fe(r,s=>{const a=fe(s,u=>u.name);return{message:`The same RegExp pattern ->${Qn(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Et.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function wB(t){const e=kn(t,r=>{if(!Ee(r,"GROUP"))return!1;const i=r.GROUP;return i!==Rn.SKIPPED&&i!==Rn.NA&&!vn(i)});return fe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Et.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function vB(t,e){const n=kn(t,i=>i.PUSH_MODE!==void 0&&!an(e,i.PUSH_MODE));return fe(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Et.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function bB(t){const e=[],n=on(t,(r,i,s)=>{const a=i.PATTERN;return a===Rn.NA||(vn(a)?r.push({str:a,idx:s,tokenType:i}):zr(a)&&EB(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return De(t,(r,i)=>{De(n,({str:s,idx:a,tokenType:o})=>{if(i<a&&DB(s,r.PATTERN)){const u=`Token: ->${o.name}<- can never be matched.
|
|
32
|
-
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
33
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Et.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function DB(t,e){if(zr(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(Lr(e))return e(t,0,[],{});if(Ee(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function EB(t){return da([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function tR(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function nR(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function RB(t,e,n){const r=[];return Ee(t,uu)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+uu+`> property in its definition
|
|
34
|
-
`,type:Et.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Ee(t,vf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+vf+`> property in its definition
|
|
35
|
-
`,type:Et.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Ee(t,vf)&&Ee(t,uu)&&!Ee(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${uu}: <${t.defaultMode}>which does not exist
|
|
36
|
-
`,type:Et.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Ee(t,vf)&&De(t.modes,(i,s)=>{De(i,(a,o)=>{if(qr(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
|
|
37
|
-
`,type:Et.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Ee(a,"LONGER_ALT")){const u=je(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];De(u,c=>{!qr(c)&&!an(i,c)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${a.name}> outside of mode <${s}>
|
|
38
|
-
`,type:Et.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function TB(t,e,n){const r=[];let i=!1;const s=su(jn(Nt(t.modes))),a=df(s,u=>u[us]===Rn.NA),o=sR(n);return e&&De(a,u=>{const c=iR(u,o);if(c!==!1){const d={message:CB(u,c),type:c.issue,tokenType:u};r.push(d)}else Ee(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):Ig(o,u.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
|
-
This Lexer has been defined to track line and column information,
|
|
40
|
-
But none of the Token Types can be identified as matching a line terminator.
|
|
41
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
42
|
-
for details.`,type:Et.NO_LINE_BREAKS_FLAGS}),r}function SB(t){const e={},n=qn(t);return De(n,r=>{const i=t[r];if(je(i))e[r]=[];else throw Error("non exhaustive match")}),e}function rR(t){const e=t.PATTERN;if(zr(e))return!1;if(Lr(e))return!0;if(Ee(e,"exec"))return!0;if(vn(e))return!1;throw Error("non exhaustive match")}function $B(t){return vn(t)&&t.length===1?t.charCodeAt(0):!1}const kB={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function iR(t,e){if(Ee(t,"LINE_BREAKS"))return!1;if(zr(t.PATTERN)){try{Ig(e,t.PATTERN)}catch(n){return{issue:Et.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(vn(t.PATTERN))return!1;if(rR(t))return{issue:Et.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function CB(t,e){if(e.issue===Et.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
43
|
-
The problem is in the <${t.name}> Token Type
|
|
44
|
-
Root cause: ${e.errMsg}.
|
|
45
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Et.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
|
-
The problem is in the <${t.name}> Token Type
|
|
47
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function sR(t){return fe(t,n=>vn(n)?n.charCodeAt(0):n)}function xg(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const cu=256;let bf=[];function gi(t){return t<cu?t:bf[t]}function AB(){if(nt(bf)){bf=new Array(65536);for(let t=0;t<65536;t++)bf[t]=t>255?255+~~(t/255):t}}function lu(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function Df(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let aR=1;const oR={};function du(t){const e=_B(t);PB(e),xB(e),IB(e),De(e,n=>{n.isParent=n.categoryMatches.length>0})}function _B(t){let e=qt(t),n=t,r=!0;for(;r;){n=su(jn(fe(n,s=>s.CATEGORIES)));const i=lf(n,e);e=e.concat(i),nt(i)?r=!1:n=i}return e}function PB(t){De(t,e=>{cR(e)||(oR[aR]=e,e.tokenTypeIdx=aR++),lR(e)&&!je(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),lR(e)||(e.CATEGORIES=[]),NB(e)||(e.categoryMatches=[]),OB(e)||(e.categoryMatchesMap={})})}function IB(t){De(t,e=>{e.categoryMatches=[],De(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(oR[r].tokenTypeIdx)})})}function xB(t){De(t,e=>{uR([],e)})}function uR(t,e){De(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),De(e.CATEGORIES,n=>{const r=t.concat(e);an(r,n)||uR(r,n)})}function cR(t){return Ee(t,"tokenTypeIdx")}function lR(t){return Ee(t,"CATEGORIES")}function NB(t){return Ee(t,"categoryMatches")}function OB(t){return Ee(t,"categoryMatchesMap")}function FB(t){return Ee(t,"tokenTypeIdx")}const Ng={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var Et;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Et||(Et={}));const fu={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ng,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(fu);class Rn{constructor(e,n=fu){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);const{time:o,value:u}=KE(s),c=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,u}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
|
-
a boolean 2nd argument is no longer supported`);this.config=$n({},fu,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===fu.lineTerminatorsPattern)this.config.lineTerminatorsPattern=kB;else if(this.config.lineTerminatorCharacters===fu.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),je(e)?i={modes:{defaultMode:qt(e)},defaultMode:uu}:(s=!1,i=qt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(RB(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(TB(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},De(i.modes,(o,u)=>{i.modes[u]=df(o,c=>qr(c))});const a=qn(i.modes);if(De(i.modes,(o,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(oB(o,a))}),nt(this.lexerDefinitionErrors)){du(o);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=aB(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=c.charCodeToPatternIdxToConfig,this.emptyGroups=$n({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!nt(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const u=fe(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
|
|
51
|
-
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
-
`+u)}De(this.lexerDefinitionWarning,o=>{VE(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(eR?(this.chopInput=rs,this.match=this.matchWithTest):(this.updateLastIndex=xt,this.match=this.matchWithExec),s&&(this.handleModes=xt),this.trackStartLines===!1&&(this.computeNewColumn=rs),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=xt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=on(this.canModeBeOptimized,(u,c,l)=>(c===!1&&u.push(l),u),[]);if(n.ensureOptimizations&&!nt(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
53
|
-
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{nB()}),this.TRACE_INIT("toFastProperties",()=>{YE(this)})})}tokenize(e,n=this.defaultMode){if(!nt(this.lexerDefinitionErrors)){const i=fe(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
55
|
-
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
-
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,u,c,l,d,f,p,h,w,D,g;const v=e,R=v.length;let k=0,A=0;const j=this.hasCustom?0:Math.floor(e.length/10),W=new Array(j),Z=[];let J=this.trackStartLines?1:void 0,de=this.trackStartLines?1:void 0;const N=SB(this.emptyGroups),$=this.trackStartLines,T=this.config.lineTerminatorsPattern;let O=0,V=[],M=[];const H=[],be=[];Object.freeze(be);let te;function C(){return V}function pe(_e){const se=gi(_e),we=M[se];return we===void 0?be:we}const Qe=_e=>{if(H.length===1&&_e.tokenType.PUSH_MODE===void 0){const se=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(_e);Z.push({offset:_e.startOffset,line:_e.startLine,column:_e.startColumn,length:_e.image.length,message:se})}else{H.pop();const se=la(H);V=this.patternIdxToConfig[se],M=this.charCodeToPatternIdxToConfig[se],O=V.length;const we=this.canModeBeOptimized[se]&&this.config.safeMode===!1;M&&we?te=pe:te=C}};function ct(_e){H.push(_e),M=this.charCodeToPatternIdxToConfig[_e],V=this.patternIdxToConfig[_e],O=V.length,O=V.length;const se=this.canModeBeOptimized[_e]&&this.config.safeMode===!1;M&&se?te=pe:te=C}ct.call(this,n);let U;const K=this.config.recoveryEnabled;for(;k<R;){u=null;const _e=v.charCodeAt(k),se=te(_e),we=se.length;for(r=0;r<we;r++){U=se[r];const Te=U.pattern;c=null;const oe=U.short;if(oe!==!1?_e===oe&&(u=Te):U.isCustom===!0?(g=Te.exec(v,k,W,N),g!==null?(u=g[0],g.payload!==void 0&&(c=g.payload)):u=null):(this.updateLastIndex(Te,k),u=this.match(Te,e,k)),u!==null){if(o=U.longerAlt,o!==void 0){const I=o.length;for(s=0;s<I;s++){const B=V[o[s]],ce=B.pattern;if(l=null,B.isCustom===!0?(g=ce.exec(v,k,W,N),g!==null?(a=g[0],g.payload!==void 0&&(l=g.payload)):a=null):(this.updateLastIndex(ce,k),a=this.match(ce,e,k)),a&&a.length>u.length){u=a,c=l,U=B;break}}}break}}if(u!==null){if(d=u.length,f=U.group,f!==void 0&&(p=U.tokenTypeIdx,h=this.createTokenInstance(u,k,p,U.tokenType,J,de,d),this.handlePayload(h,c),f===!1?A=this.addToken(W,A,h):N[f].push(h)),e=this.chopInput(e,d),k=k+d,de=this.computeNewColumn(de,d),$===!0&&U.canLineTerminator===!0){let Te=0,oe,I;T.lastIndex=0;do oe=T.test(u),oe===!0&&(I=T.lastIndex-1,Te++);while(oe===!0);Te!==0&&(J=J+Te,de=d-I,this.updateTokenEndLineColumnLocation(h,f,I,Te,J,de,d))}this.handleModes(U,Qe,ct,h)}else{const Te=k,oe=J,I=de;let B=K===!1;for(;B===!1&&k<R;)for(e=this.chopInput(e,1),k++,i=0;i<O;i++){const ce=V[i],z=ce.pattern,ue=ce.short;if(ue!==!1?v.charCodeAt(k)===ue&&(B=!0):ce.isCustom===!0?B=z.exec(v,k,W,N)!==null:(this.updateLastIndex(z,k),B=z.exec(e)!==null),B===!0)break}if(w=k-Te,de=this.computeNewColumn(de,w),D=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,Te,w,oe,I),Z.push({offset:Te,line:oe,column:I,length:w,message:D}),K===!1)break}}return this.hasCustom||(W.length=A),{tokens:W,groups:N,errors:Z}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,a,o){let u,c;n!==void 0&&(u=r===o-1,c=u?-1:0,i===1&&u===!0||(e.endLine=s+c,e.endColumn=a-1+-c))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,a){return{image:e,startOffset:n,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:n+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}Rn.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",Rn.NA=/NOT_APPLICABLE/;function ha(t){return dR(t)?t.LABEL:t.name}function dR(t){return vn(t.LABEL)&&t.LABEL!==""}const LB="parent",fR="categories",pR="label",hR="group",mR="push_mode",gR="pop_mode",yR="longer_alt",wR="line_breaks",vR="start_chars_hint";function bR(t){return MB(t)}function MB(t){const e=t.pattern,n={};if(n.name=t.name,qr(e)||(n.PATTERN=e),Ee(t,LB))throw`The parent property is no longer supported.
|
|
57
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Ee(t,fR)&&(n.CATEGORIES=t[fR]),du([n]),Ee(t,pR)&&(n.LABEL=t[pR]),Ee(t,hR)&&(n.GROUP=t[hR]),Ee(t,gR)&&(n.POP_MODE=t[gR]),Ee(t,mR)&&(n.PUSH_MODE=t[mR]),Ee(t,yR)&&(n.LONGER_ALT=t[yR]),Ee(t,wR)&&(n.LINE_BREAKS=t[wR]),Ee(t,vR)&&(n.START_CHARS_HINT=t[vR]),n}const yi=bR({name:"EOF",pattern:Rn.NA});du([yi]);function Og(t,e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function DR(t,e){return lu(t,e)}const ma={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${dR(t)?`--> ${ha(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
|
|
58
|
-
but found: '`+Qn(e).image+"'";if(r)return s+r+o;{const u=on(t,(f,p)=>f.concat(p),[]),c=fe(u,f=>`[${fe(f,p=>ha(p)).join(", ")}]`),d=`one of these possible Token sequences:
|
|
59
|
-
${fe(c,(f,p)=>` ${p+1}. ${f}`).join(`
|
|
60
|
-
`)}`;return s+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=`
|
|
61
|
-
but found: '`+Qn(e).image+"'";if(n)return i+n+a;{const u=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
-
<${fe(t,c=>`[${fe(c,l=>ha(l)).join(",")}]`).join(" ,")}>`;return i+u+a}}};Object.freeze(ma);const BB={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
-
inside top level rule: ->`+t.name+"<-"}},cs={buildDuplicateFoundError(t,e){function n(l){return l instanceof ft?l.terminalType.name:l instanceof un?l.nonTerminalName:""}const r=t.name,i=Qn(e),s=i.idx,a=Dr(i),o=n(i),u=s>0;let c=`->${a}${u?s:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
64
|
-
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
65
|
-
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
-
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
|
|
67
|
-
`),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
68
|
-
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
69
|
-
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
70
|
-
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
71
|
-
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=fe(t.prefixPath,i=>ha(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
-
in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
-
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
-
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
75
|
-
For Further details.`},buildAlternationAmbiguityError(t){const e=fe(t.prefixPath,i=>ha(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
76
|
-
<${e}> may appears as a prefix path in all these alternatives.
|
|
77
|
-
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
78
|
-
For Further details.`,r},buildEmptyRepetitionError(t){let e=Dr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
79
|
-
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
80
|
-
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
81
|
-
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
82
|
-
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=fe(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
83
|
-
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
84
|
-
without consuming any Tokens. The grammar path that causes this is:
|
|
85
|
-
${r}
|
|
86
|
-
To fix this refactor your grammar to remove the left recursion.
|
|
87
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof fa?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function zB(t,e){const n=new qB(t,e);return n.resolveRefs(),n.errors}class qB extends pa{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){De(Nt(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:cn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class jB extends hf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=qt(this.path.ruleStack).reverse(),this.occurrenceStack=qt(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){nt(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class UB extends jB{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new bn({definition:i});this.possibleTokTypes=ou(s),this.found=!0}}}class Ef extends hf{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class GB extends Ef{walkMany(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ft&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class ER extends Ef{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ft&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class WB extends Ef{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ft&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class RR extends Ef{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ft&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Fg(t,e,n=[]){n=qt(n);let r=[],i=0;function s(o){return o.concat(jt(t,i+1))}function a(o){const u=Fg(s(o),e,n);return r.concat(u)}for(;n.length<e&&i<t.length;){const o=t[i];if(o instanceof bn)return a(o.definition);if(o instanceof un)return a(o.definition);if(o instanceof Ut)r=a(o.definition);else if(o instanceof An){const u=o.definition.concat([new Dt({definition:o.definition})]);return a(u)}else if(o instanceof _n){const u=[new bn({definition:o.definition}),new Dt({definition:[new ft({terminalType:o.separator})].concat(o.definition)})];return a(u)}else if(o instanceof Dn){const u=o.definition.concat([new Dt({definition:[new ft({terminalType:o.separator})].concat(o.definition)})]);r=a(u)}else if(o instanceof Dt){const u=o.definition.concat([new Dt({definition:o.definition})]);r=a(u)}else{if(o instanceof En)return De(o.definition,u=>{nt(u.definition)===!1&&(r=a(u.definition))}),r;if(o instanceof ft)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:jt(t,i)}),r}function TR(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const u=e.length,c=u-r-1,l=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!nt(d);){const f=d.pop();if(f===a){o&&la(d).idx<=c&&d.pop();continue}const p=f.def,h=f.idx,w=f.ruleStack,D=f.occurrenceStack;if(nt(p))continue;const g=p[0];if(g===i){const v={idx:h,def:jt(p),ruleStack:au(w),occurrenceStack:au(D)};d.push(v)}else if(g instanceof ft)if(h<u-1){const v=h+1,R=e[v];if(n(R,g.terminalType)){const k={idx:v,def:jt(p),ruleStack:w,occurrenceStack:D};d.push(k)}}else if(h===u-1)l.push({nextTokenType:g.terminalType,nextTokenOccurrence:g.idx,ruleStack:w,occurrenceStack:D}),o=!0;else throw Error("non exhaustive match");else if(g instanceof un){const v=qt(w);v.push(g.nonTerminalName);const R=qt(D);R.push(g.idx);const k={idx:h,def:g.definition.concat(s,jt(p)),ruleStack:v,occurrenceStack:R};d.push(k)}else if(g instanceof Ut){const v={idx:h,def:jt(p),ruleStack:w,occurrenceStack:D};d.push(v),d.push(a);const R={idx:h,def:g.definition.concat(jt(p)),ruleStack:w,occurrenceStack:D};d.push(R)}else if(g instanceof An){const v=new Dt({definition:g.definition,idx:g.idx}),R=g.definition.concat([v],jt(p)),k={idx:h,def:R,ruleStack:w,occurrenceStack:D};d.push(k)}else if(g instanceof _n){const v=new ft({terminalType:g.separator}),R=new Dt({definition:[v].concat(g.definition),idx:g.idx}),k=g.definition.concat([R],jt(p)),A={idx:h,def:k,ruleStack:w,occurrenceStack:D};d.push(A)}else if(g instanceof Dn){const v={idx:h,def:jt(p),ruleStack:w,occurrenceStack:D};d.push(v),d.push(a);const R=new ft({terminalType:g.separator}),k=new Dt({definition:[R].concat(g.definition),idx:g.idx}),A=g.definition.concat([k],jt(p)),j={idx:h,def:A,ruleStack:w,occurrenceStack:D};d.push(j)}else if(g instanceof Dt){const v={idx:h,def:jt(p),ruleStack:w,occurrenceStack:D};d.push(v),d.push(a);const R=new Dt({definition:g.definition,idx:g.idx}),k=g.definition.concat([R],jt(p)),A={idx:h,def:k,ruleStack:w,occurrenceStack:D};d.push(A)}else if(g instanceof En)for(let v=g.definition.length-1;v>=0;v--){const R=g.definition[v],k={idx:h,def:R.definition.concat(jt(p)),ruleStack:w,occurrenceStack:D};d.push(k),d.push(a)}else if(g instanceof bn)d.push({idx:h,def:g.definition.concat(jt(p)),ruleStack:w,occurrenceStack:D});else if(g instanceof fa)d.push(HB(g,h,w,D));else throw Error("non exhaustive match")}return l}function HB(t,e,n,r){const i=qt(n);i.push(t.name);const s=qt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var gt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(gt||(gt={}));function Lg(t){if(t instanceof Ut||t==="Option")return gt.OPTION;if(t instanceof Dt||t==="Repetition")return gt.REPETITION;if(t instanceof An||t==="RepetitionMandatory")return gt.REPETITION_MANDATORY;if(t instanceof _n||t==="RepetitionMandatoryWithSeparator")return gt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Dn||t==="RepetitionWithSeparator")return gt.REPETITION_WITH_SEPARATOR;if(t instanceof En||t==="Alternation")return gt.ALTERNATION;throw Error("non exhaustive match")}function SR(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Lg(r);return s===gt.ALTERNATION?Rf(e,n,i):Tf(e,n,s,i)}function VB(t,e,n,r,i,s){const a=Rf(t,e,n),o=AR(a)?Df:lu;return s(a,r,o,i)}function KB(t,e,n,r,i,s){const a=Tf(t,e,i,n),o=AR(a)?Df:lu;return s(a[0],o,r)}function YB(t,e,n,r){const i=t.length,s=Jn(t,a=>Jn(a,o=>o.length===1));if(e)return function(a){const o=fe(a,u=>u.GATE);for(let u=0;u<i;u++){const c=t[u],l=c.length,d=o[u];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<l;f++){const p=c[f],h=p.length;for(let w=0;w<h;w++){const D=this.LA(w+1);if(n(D,p[w])===!1)continue e}return u}}};if(s&&!r){const a=fe(t,u=>jn(u)),o=on(a,(u,c,l)=>(De(c,d=>{Ee(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=l),De(d.categoryMatches,f=>{Ee(u,f)||(u[f]=l)})}),u),{});return function(){const u=this.LA(1);return o[u.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],u=o.length;e:for(let c=0;c<u;c++){const l=o[c],d=l.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(n(p,l[f])===!1)continue e}return a}}}}function XB(t,e,n){const r=Jn(t,s=>s.length===1),i=t.length;if(r&&!n){const s=jn(t);if(s.length===1&&nt(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=on(s,(o,u,c)=>(o[u.tokenTypeIdx]=!0,De(u.categoryMatches,l=>{o[l]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let u=0;u<o;u++){const c=this.LA(u+1);if(e(c,a[u])===!1)continue e}return!0}return!1}}class JB extends hf{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,gt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,gt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,gt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,gt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,gt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class $R extends pa{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,gt.OPTION)}visitRepetition(e){this.checkIsTarget(e,gt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,gt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,gt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,gt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,gt.ALTERNATION)}}function kR(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Mg(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+r.tokenTypeIdx);for(let o=0;o<r.categoryMatches.length;o++){const u="_"+r.categoryMatches[o];i.push(a+u)}}e=i}return e}function QB(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function CR(t,e){const n=fe(t,a=>Fg([a],1)),r=kR(n.length),i=fe(n,a=>{const o={};return De(a,u=>{const c=Mg(u.partialPath);De(c,l=>{o[l]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=kR(o.length);for(let u=0;u<o.length;u++){const c=o[u];for(let l=0;l<c.length;l++){const d=c[l].partialPath,f=c[l].suffixDef,p=Mg(d);if(QB(i,p,u)||nt(f)||d.length===e){const w=r[u];if(Bg(w,d)===!1){w.push(d);for(let D=0;D<p.length;D++){const g=p[D];i[u][g]=!0}}}else{const w=Fg(f,a+1,d);s[u]=s[u].concat(w),De(w,D=>{const g=Mg(D.partialPath);De(g,v=>{i[u][v]=!0})})}}}}return r}function Rf(t,e,n,r){const i=new $R(t,gt.ALTERNATION,r);return e.accept(i),CR(i.result,n)}function Tf(t,e,n,r){const i=new $R(t,n);e.accept(i);const s=i.result,o=new JB(e,t,n).startWalking(),u=new bn({definition:s}),c=new bn({definition:o});return CR([u,c],r)}function Bg(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],a=r[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function ZB(t,e){return t.length<e.length&&Jn(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function AR(t){return Jn(t,e=>Jn(e,n=>Jn(n,r=>nt(r.categoryMatches))))}function ez(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return fe(e,n=>Object.assign({type:cn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function tz(t,e,n,r){const i=Cn(t,u=>nz(u,n)),s=hz(t,e,n),a=Cn(t,u=>lz(u,n)),o=Cn(t,u=>sz(u,t,r,n));return i.concat(s,a,o)}function nz(t,e){const n=new iz;t.accept(n);const r=n.allProductions,i=w2(r,rz),s=Zn(i,o=>o.length>1);return fe(Nt(s),o=>{const u=Qn(o),c=e.buildDuplicateFoundError(t,o),l=Dr(u),d={message:c,type:cn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:u.idx},f=_R(u);return f&&(d.parameter=f),d})}function rz(t){return`${Dr(t)}_#_${t.idx}_#_${_R(t)}`}function _R(t){return t instanceof ft?t.terminalType.name:t instanceof un?t.nonTerminalName:""}class iz extends pa{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function sz(t,e,n,r){const i=[];if(on(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:cn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function az(t,e,n){const r=[];let i;return an(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:cn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function PR(t,e,n,r=[]){const i=[],s=Sf(e.definition);if(nt(s))return[];{const a=t.name;an(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:cn.LEFT_RECURSION,ruleName:a});const u=lf(s,r.concat([t])),c=Cn(u,l=>{const d=qt(r);return d.push(l),PR(t,l,n,d)});return i.concat(c)}}function Sf(t){let e=[];if(nt(t))return e;const n=Qn(t);if(n instanceof un)e.push(n.referencedRule);else if(n instanceof bn||n instanceof Ut||n instanceof An||n instanceof _n||n instanceof Dn||n instanceof Dt)e=e.concat(Sf(n.definition));else if(n instanceof En)e=jn(fe(n.definition,s=>Sf(s.definition)));else if(!(n instanceof ft))throw Error("non exhaustive match");const r=pf(n),i=t.length>1;if(r&&i){const s=jt(t);return e.concat(Sf(s))}else return e}class zg extends pa{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function oz(t,e){const n=new zg;t.accept(n);const r=n.alternations;return Cn(r,s=>{const a=au(s.definition);return Cn(a,(o,u)=>{const c=TR([o],[],lu,1);return nt(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:u}),type:cn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:u+1}]:[]})})}function uz(t,e,n){const r=new zg;t.accept(r);let i=r.alternations;return i=df(i,a=>a.ignoreAmbiguities===!0),Cn(i,a=>{const o=a.idx,u=a.maxLookahead||e,c=Rf(o,t,u,a),l=fz(c,a,t,n),d=pz(c,a,t,n);return l.concat(d)})}class cz extends pa{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function lz(t,e){const n=new zg;t.accept(n);const r=n.alternations;return Cn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:cn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function dz(t,e,n){const r=[];return De(t,i=>{const s=new cz;i.accept(s);const a=s.allProductions;De(a,o=>{const u=Lg(o),c=o.maxLookahead||e,l=o.idx,f=Tf(l,i,u,c)[0];if(nt(jn(f))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:p,type:cn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function fz(t,e,n,r){const i=[],s=on(t,(o,u,c)=>(e.definition[c].ignoreAmbiguities===!0||De(u,l=>{const d=[c];De(t,(f,p)=>{c!==p&&Bg(f,l)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Bg(i,l)&&(i.push(l),o.push({alts:d,path:l}))}),o),[]);return fe(s,o=>{const u=fe(o.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:u,prefixPath:o.path}),type:cn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function pz(t,e,n,r){const i=on(t,(a,o,u)=>{const c=fe(o,l=>({idx:u,path:l}));return a.concat(c)},[]);return su(Cn(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const u=a.idx,c=a.path,l=kn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<u&&ZB(f.path,c));return fe(l,f=>{const p=[f.idx+1,u+1],h=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:cn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:h,alternatives:p}})}))}function hz(t,e,n){const r=[],i=fe(e,s=>s.name);return De(t,s=>{const a=s.name;if(an(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:cn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function mz(t){const e=kg(t,{errMsgProvider:BB}),n={};return De(t.rules,r=>{n[r.name]=r}),zB(n,e.errMsgProvider)}function gz(t){return t=kg(t,{errMsgProvider:cs}),tz(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const IR="MismatchedTokenException",xR="NoViableAltException",NR="EarlyExitException",OR="NotAllInputParsedException",FR=[IR,xR,NR,OR];Object.freeze(FR);function $f(t){return an(FR,t.name)}class kf extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class LR extends kf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=IR}}class yz extends kf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=xR}}class wz extends kf{constructor(e,n){super(e,n),this.name=OR}}class vz extends kf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=NR}}const qg={},MR="InRuleRecoveryException";class bz extends Error{constructor(e){super(e),this.name=MR}}class Dz{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Ee(e,"recoveryEnabled")?e.recoveryEnabled:jr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Ez)}getTokenToInsert(e){const n=Og(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let u=!1;const c=this.LA(1);let l=this.LA(1);const d=()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:f,ruleName:this.getCurrRuleFullName()}),h=new LR(p,c,this.LA(0));h.resyncedTokens=au(o),this.SAVE_ERROR(h)};for(;!u;)if(this.tokenMatcher(l,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(l,s)?u=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new bz("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||nt(n))return!1;const r=this.LA(1);return da(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return an(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=da(e,s=>DR(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return qg;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return fe(e,(r,i)=>i===0?qg:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=fe(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return jn(e)}getFollowSetFromFollowKey(e){if(e===qg)return[yi];const n=e.ruleName+e.idxInCallingRule+JE+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,yi)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return au(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=qt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return fe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Ez(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let u=this.firstAfterRepMap[o];if(u===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];u=new s(p,i).startWalking(),this.firstAfterRepMap[o]=u}let c=u.token,l=u.occurrence;const d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=yi,l=1),!(c===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,l,a)&&this.tryInRepetitionRecovery(t,e,n,c)}const Rz=4,wi=8,BR=1<<wi,zR=2<<wi,jg=3<<wi,Ug=4<<wi,Gg=5<<wi,Cf=6<<wi;function Wg(t,e,n){return n|e|t}class Hg{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:jr.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(nt(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return Cn(e,n=>PR(n,n,cs))}validateEmptyOrAlternatives(e){return Cn(e,n=>oz(n,cs))}validateAmbiguousAlternationAlternatives(e,n){return Cn(e,r=>uz(r,n,cs))}validateSomeNonEmptyLookaheadPath(e,n){return dz(e,n,cs)}buildLookaheadForAlternation(e){return VB(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,YB)}buildLookaheadForOptional(e){return KB(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Lg(e.prodType),XB)}}class Tz{initLooksAhead(e){this.dynamicTokensEnabled=Ee(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:jr.dynamicTokensEnabled,this.maxLookahead=Ee(e,"maxLookahead")?e.maxLookahead:jr.maxLookahead,this.lookaheadStrategy=Ee(e,"lookaheadStrategy")?e.lookaheadStrategy:new Hg({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){De(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:u}=$z(n);De(r,c=>{const l=c.idx===0?"":c.idx;this.TRACE_INIT(`${Dr(c)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:n,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=Wg(this.fullRuleNameToShort[n.name],BR,c.idx);this.setLaFuncCache(f,d)})}),De(i,c=>{this.computeLookaheadFunc(n,c.idx,jg,"Repetition",c.maxLookahead,Dr(c))}),De(s,c=>{this.computeLookaheadFunc(n,c.idx,zR,"Option",c.maxLookahead,Dr(c))}),De(a,c=>{this.computeLookaheadFunc(n,c.idx,Ug,"RepetitionMandatory",c.maxLookahead,Dr(c))}),De(o,c=>{this.computeLookaheadFunc(n,c.idx,Cf,"RepetitionMandatoryWithSeparator",c.maxLookahead,Dr(c))}),De(u,c=>{this.computeLookaheadFunc(n,c.idx,Gg,"RepetitionWithSeparator",c.maxLookahead,Dr(c))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=Wg(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(u,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return Wg(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Sz extends pa{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const Af=new Sz;function $z(t){Af.reset(),t.accept(Af);const e=Af.dslMethods;return Af.reset(),e}function qR(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function jR(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function kz(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function Cz(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const Az="name";function UR(t,e){Object.defineProperty(t,Az,{enumerable:!1,configurable:!0,writable:!1,value:e})}function _z(t,e){const n=qn(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],a=t[s],o=a.length;for(let u=0;u<o;u++){const c=a[u];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function Pz(t,e){const n=function(){};UR(n,t+"BaseSemantics");const r={visit:function(i,s){if(je(i)&&(i=i[0]),!qr(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=xz(this,e);if(!nt(i)){const s=fe(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
88
|
-
${s.join(`
|
|
89
|
-
|
|
90
|
-
`).replace(/\n/g,`
|
|
91
|
-
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function Iz(t,e,n){const r=function(){};UR(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return De(e,s=>{i[s]=_z}),r.prototype=i,r.prototype.constructor=r,r}var Vg;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Vg||(Vg={}));function xz(t,e){return Nz(t,e)}function Nz(t,e){const n=kn(e,i=>Lr(t[i])===!1),r=fe(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Vg.MISSING_METHOD,methodName:i}));return su(r)}class Oz{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Ee(e,"nodeLocationTracking")?e.nodeLocationTracking:jr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=xt,this.cstFinallyStateUpdate=xt,this.cstPostTerminal=xt,this.cstPostNonTerminal=xt,this.cstPostRule=xt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=jR,this.setNodeLocationFromNode=jR,this.cstPostRule=xt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=qR,this.setNodeLocationFromNode=qR,this.cstPostRule=xt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=xt,this.setInitialNodeLocation=xt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];kz(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Cz(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(qr(this.baseCstVisitorConstructor)){const e=Pz(this.className,qn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(qr(this.baseCstVisitorWithDefaultsConstructor)){const e=Iz(this.className,qn(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class Fz{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):If}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?If:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class Lz{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=xf){if(an(this.definedRulesNames,e)){const a={message:cs.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:cn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=xf){const i=az(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if($f(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return H2(Nt(this.gastProductionsCache))}}class Mz{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Df,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Ee(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
92
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
93
|
-
For Further details.`);if(je(e)){if(nt(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
94
|
-
Note that the first argument for the parser constructor
|
|
95
|
-
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
96
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
97
|
-
For Further details.`)}if(je(e))this.tokensMap=on(e,(s,a)=>(s[a.name]=a,s),{});else if(Ee(e,"modes")&&Jn(jn(Nt(e.modes)),FB)){const s=jn(Nt(e.modes)),a=Cg(s);this.tokensMap=on(a,(o,u)=>(o[u.name]=u,o),{})}else if(zn(e))this.tokensMap=qt(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=yi;const r=Ee(e,"modes")?jn(Nt(e.modes)):Nt(e),i=Jn(r,s=>nt(s.categoryMatches));this.tokenMatcher=i?Df:lu,du(Nt(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
98
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Ee(r,"resyncEnabled")?r.resyncEnabled:xf.resyncEnabled,s=Ee(r,"recoveryValueFunc")?r.recoveryValueFunc:xf.recoveryValueFunc,a=this.ruleShortNameIdx<<Rz+wi;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...l){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,l);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...l){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,l)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if($f(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return r(e);else{if(this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,a.partialCstResult=u}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(zR,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const a=e.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Ug,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,gt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Ug,e,WB)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Cf,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,RR],o,Cf,e,RR)}else throw this.raiseEarlyExitException(e,gt.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(jg,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const u=i;i=()=>o.call(this)&&u.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,jg,e,GB,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Gg,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,ER],o,Gg,e,ER)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Cf,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(BR,n),i=je(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new wz(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw $f(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new LR(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===MR?r:s}}else throw r}saveRecogState(){const e=this.errors,n=qt(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),yi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class Bz{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Ee(e,"errorMessageProvider")?e.errorMessageProvider:jr.errorMessageProvider}SAVE_ERROR(e){if($f(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:qt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return qt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Tf(e,s,n,this.maxLookahead)[0],u=[];for(let l=1;l<=this.maxLookahead;l++)u.push(this.LA(l));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:u,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new vz(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Rf(e,i,this.maxLookahead),a=[];for(let c=1;c<=this.maxLookahead;c++)a.push(this.LA(c));const o=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new yz(u,this.LA(1),o))}}class zz{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(qr(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return TR([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=Qn(e.ruleStack),i=this.getGAstProductions()[n];return new UB(i,e).startWalking()}}const _f={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(_f);const GR=!0,WR=Math.pow(2,wi)-1,HR=bR({name:"RECORDING_PHASE_TOKEN",pattern:Rn.NA});du([HR]);const VR=Og(HR,`This IToken indicates the Parser is in Recording Phase
|
|
99
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(VR);const qz={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
100
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class jz{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return If}topLevelRuleRecord(e,n){try{const r=new fa({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
101
|
-
This error was thrown during the "grammar recording phase" For more info see:
|
|
102
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return pu.call(this,Ut,e,n)}atLeastOneInternalRecord(e,n){pu.call(this,An,n,e)}atLeastOneSepFirstInternalRecord(e,n){pu.call(this,_n,n,e,GR)}manyInternalRecord(e,n){pu.call(this,Dt,n,e)}manySepFirstInternalRecord(e,n){pu.call(this,Dn,n,e,GR)}orInternalRecord(e,n){return Uz.call(this,e,n)}subruleInternalRecord(e,n,r){if(Pf(n),!e||Ee(e,"ruleName")===!1){const o=new Error(`<SUBRULE${KR(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
103
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=la(this.recordingProdStack),s=e.ruleName,a=new un({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?qz:_f}consumeInternalRecord(e,n,r){if(Pf(n),!cR(e)){const a=new Error(`<CONSUME${KR(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
104
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=la(this.recordingProdStack),s=new ft({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),VR}}function pu(t,e,n,r=!1){Pf(n);const i=la(this.recordingProdStack),s=Lr(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),Ee(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),_f}function Uz(t,e){Pf(e);const n=la(this.recordingProdStack),r=je(t)===!1,i=r===!1?t:t.DEF,s=new En({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});Ee(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=WE(i,o=>Lr(o.GATE));return s.hasPredicates=a,n.definition.push(s),De(i,o=>{const u=new bn({definition:[]});s.definition.push(u),Ee(o,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Ee(o,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),o.ALT.call(this),this.recordingProdStack.pop()}),_f}function KR(t){return t===0?"":`${t}`}function Pf(t){if(t<0||t>WR){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
105
|
-
Idx value must be a none negative value smaller than ${WR+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class Gz{initPerformanceTracer(e){if(Ee(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=jr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=KE(n),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function Wz(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const If=Og(yi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(If);const jr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:ma,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),xf=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var cn;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(cn||(cn={}));function YR(t=void 0){return function(){return t}}class bd{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{YE(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),De(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=mz({rules:Nt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(nt(r)&&this.skipValidations===!1){const i=gz({rules:Nt(this.gastProductionsCache),tokenTypes:Nt(this.tokensMap),errMsgProvider:cs,grammarName:n}),s=ez({lookaheadStrategy:this.lookaheadStrategy,rules:Nt(this.gastProductionsCache),tokenTypes:Nt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),nt(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Z2(Nt(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Nt(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Nt(this.gastProductionsCache))})),!bd.DEFER_DEFINITION_ERRORS_HANDLING&&!nt(this.definitionErrors))throw e=fe(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
106
|
-
${e.join(`
|
|
107
|
-
-------------------------------
|
|
108
|
-
`)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),Ee(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
109
|
-
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
110
|
-
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
111
|
-
For further details.`);this.skipValidations=Ee(n,"skipValidations")?n.skipValidations:jr.skipValidations}}bd.DEFER_DEFINITION_ERRORS_HANDLING=!1,Wz(bd,[Dz,Tz,Oz,Fz,Mz,Lz,Bz,zz,jz,Gz]);class Hz extends bd{constructor(e,n=jr){const r=qt(n);r.outputCst=!1,super(e,r)}}function ga(t,e,n){return`${t.name}_${e}_${n}`}const vi=1,Vz=2,XR=4,JR=5,hu=7,Kz=8,Yz=9,Xz=10,Jz=11,QR=12;class Kg{constructor(e){this.target=e}isEpsilon(){return!1}}class Yg extends Kg{constructor(e,n){super(e),this.tokenType=n}}class ZR extends Kg{constructor(e){super(e)}isEpsilon(){return!0}}class Xg extends Kg{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function Qz(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Zz(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=ls(e,i,i);s!==void 0&&lq(e,i,s)}return e}function Zz(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Lt(t,i,void 0,{type:Vz}),a=Lt(t,i,void 0,{type:hu});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function eT(t,e,n){return n instanceof ft?Jg(t,e,n.terminalType,n):n instanceof un?cq(t,e,n):n instanceof En?iq(t,e,n):n instanceof Ut?sq(t,e,n):n instanceof Dt?eq(t,e,n):n instanceof Dn?tq(t,e,n):n instanceof An?nq(t,e,n):n instanceof _n?rq(t,e,n):ls(t,e,n)}function eq(t,e,n){const r=Lt(t,e,n,{type:JR});bi(t,r);const i=ya(t,e,r,n,ls(t,e,n));return nT(t,e,n,i)}function tq(t,e,n){const r=Lt(t,e,n,{type:JR});bi(t,r);const i=ya(t,e,r,n,ls(t,e,n)),s=Jg(t,e,n.separator,n);return nT(t,e,n,i,s)}function nq(t,e,n){const r=Lt(t,e,n,{type:XR});bi(t,r);const i=ya(t,e,r,n,ls(t,e,n));return tT(t,e,n,i)}function rq(t,e,n){const r=Lt(t,e,n,{type:XR});bi(t,r);const i=ya(t,e,r,n,ls(t,e,n)),s=Jg(t,e,n.separator,n);return tT(t,e,n,i,s)}function iq(t,e,n){const r=Lt(t,e,n,{type:vi});bi(t,r);const i=fe(n.definition,a=>eT(t,e,a));return ya(t,e,r,n,...i)}function sq(t,e,n){const r=Lt(t,e,n,{type:vi});bi(t,r);const i=ya(t,e,r,n,ls(t,e,n));return aq(t,e,n,i)}function ls(t,e,n){const r=kn(fe(n.definition,i=>eT(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:uq(t,r)}function tT(t,e,n,r,i){const s=r.left,a=r.right,o=Lt(t,e,n,{type:Jz});bi(t,o);const u=Lt(t,e,n,{type:QR});return s.loopback=o,u.loopback=o,t.decisionMap[ga(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,kt(a,o),i===void 0?(kt(o,s),kt(o,u)):(kt(o,u),kt(o,i.left),kt(i.right,s)),{left:s,right:u}}function nT(t,e,n,r,i){const s=r.left,a=r.right,o=Lt(t,e,n,{type:Xz});bi(t,o);const u=Lt(t,e,n,{type:QR}),c=Lt(t,e,n,{type:Yz});return o.loopback=c,u.loopback=c,kt(o,s),kt(o,u),kt(a,c),i!==void 0?(kt(c,u),kt(c,i.left),kt(i.right,s)):kt(c,o),t.decisionMap[ga(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:u}}function aq(t,e,n,r){const i=r.left,s=r.right;return kt(i,s),t.decisionMap[ga(e,"Option",n.idx)]=i,r}function bi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function ya(t,e,n,r,...i){const s=Lt(t,e,r,{type:Kz,start:n});n.end=s;for(const o of i)o!==void 0?(kt(n,o.left),kt(o.right,s)):kt(n,s);const a={left:n,right:s};return t.decisionMap[ga(e,oq(r),r.idx)]=n,a}function oq(t){if(t instanceof En)return"Alternation";if(t instanceof Ut)return"Option";if(t instanceof Dt)return"Repetition";if(t instanceof Dn)return"RepetitionWithSeparator";if(t instanceof An)return"RepetitionMandatory";if(t instanceof _n)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function uq(t,e){const n=e.length;for(let s=0;s<n-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const u=o instanceof Xg,c=o,l=e[s+1].left;a.left.type===vi&&a.right.type===vi&&o!==void 0&&(u&&c.followState===a.right||o.target===a.right)?(u?c.followState=l:o.target=l,dq(t,a.right)):kt(a.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Jg(t,e,n,r){const i=Lt(t,e,r,{type:vi}),s=Lt(t,e,r,{type:vi});return Qg(i,new Yg(s,n)),{left:i,right:s}}function cq(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Lt(t,e,n,{type:vi}),a=Lt(t,e,n,{type:vi}),o=new Xg(i,r,a);return Qg(s,o),{left:s,right:a}}function lq(t,e,n){const r=t.ruleToStartState.get(e);kt(r,n.left);const i=t.ruleToStopState.get(e);return kt(n.right,i),{left:r,right:i}}function kt(t,e){const n=new ZR(e);Qg(t,n)}function Lt(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function Qg(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function dq(t,e){t.states.splice(t.states.indexOf(e),1)}const Nf={};class Zg{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=rT(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return fe(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function rT(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function fq(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class iT{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const sT=new iT;class pq extends Hg{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=Qz(e.rules),this.dfas=hq(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,u=ga(r,"Alternation",n),l=this.atn.decisionMap[u].decision,d=fe(SR({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>fe(f,p=>p[0]));if(aT(d,!1)&&!s){const f=on(d,(p,h,w)=>(De(h,D=>{D&&(p[D.tokenTypeIdx]=w,De(D.categoryMatches,g=>{p[g]=w}))}),p),{});return i?function(p){var h;const w=this.LA(1),D=f[w.tokenTypeIdx];if(p!==void 0&&D!==void 0){const g=(h=p[D])===null||h===void 0?void 0:h.GATE;if(g!==void 0&&g.call(this)===!1)return}return D}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new iT,h=f===void 0?0:f.length;for(let D=0;D<h;D++){const g=f?.[D].GATE;p.set(D,g===void 0||g.call(this))}const w=ey.call(this,a,l,p,o);return typeof w=="number"?w:void 0}:function(){const f=ey.call(this,a,l,sT,o);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,u=ga(r,i,n),l=this.atn.decisionMap[u].decision,d=fe(SR({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>fe(f,p=>p[0]));if(aT(d)&&d[0][0]&&!s){const f=d[0],p=jn(f);if(p.length===1&&nt(p[0].categoryMatches)){const w=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===w}}else{const h=on(p,(w,D)=>(D!==void 0&&(w[D.tokenTypeIdx]=!0,De(D.categoryMatches,g=>{w[g]=!0})),w),{});return function(){const w=this.LA(1);return h[w.tokenTypeIdx]===!0}}}return function(){const f=ey.call(this,a,l,sT,o);return typeof f=="object"?!1:f===0}}}function aT(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function hq(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=fq(t.decisionStates[r],r);return n}function ey(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const o=Sq(i.atnStartState);s=cT(i,oT(o)),i.start=s}return mq.apply(this,[i,s,n,r])}function mq(t,e,n,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let u=Dq(i,o);if(u===void 0&&(u=gq.apply(this,[t,i,o,s,n,r])),u===Nf)return bq(a,i,o);if(u.isAcceptState===!0)return u.prediction;i=u,a.push(o),o=this.LA(s++)}}function gq(t,e,n,r,i,s){const a=Eq(e.configs,n,i);if(a.size===0)return uT(t,e,n,Nf),Nf;let o=oT(a);const u=Tq(a,i);if(u!==void 0)o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u;else if(Aq(a)){const c=x2(a.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,yq.apply(this,[t,r,a.alts,s])}return o=uT(t,e,n,o),o}function yq(t,e,n,r){const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const s=t.atnStartState,a=s.rule,o=s.production,u=wq({topLevelRule:a,ambiguityIndices:n,production:o,prefixPath:i});r(u)}function wq(t){const e=fe(t.prefixPath,i=>ha(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${vq(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
112
|
-
<${e}> may appears as a prefix path in all these alternatives.
|
|
113
|
-
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
114
|
-
For Further details.`,r}function vq(t){if(t instanceof un)return"SUBRULE";if(t instanceof Ut)return"OPTION";if(t instanceof En)return"OR";if(t instanceof An)return"AT_LEAST_ONE";if(t instanceof _n)return"AT_LEAST_ONE_SEP";if(t instanceof Dn)return"MANY_SEP";if(t instanceof Dt)return"MANY";if(t instanceof ft)return"CONSUME";throw Error("non exhaustive match")}function bq(t,e,n){const r=Cn(e.configs.elements,s=>s.state.transitions),i=U2(r.filter(s=>s instanceof Yg).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function Dq(t,e){return t.edges[e.tokenTypeIdx]}function Eq(t,e,n){const r=new Zg,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===hu){i.push(a);continue}const o=a.state.transitions.length;for(let u=0;u<o;u++){const c=a.state.transitions[u],l=Rq(c,e);l!==void 0&&r.add({state:l,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Zg;for(const a of r.elements)Of(a,s)}if(i.length>0&&!kq(s))for(const a of i)s.add(a);return s}function Rq(t,e){if(t instanceof Yg&&DR(e,t.tokenType))return t.target}function Tq(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function oT(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function uT(t,e,n,r){return r=cT(t,r),e.edges[n.tokenTypeIdx]=r,r}function cT(t,e){if(e===Nf)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function Sq(t){const e=new Zg,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};Of(s,e)}return e}function Of(t,e){const n=t.state;if(n.type===hu){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};Of(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],a=$q(t,s);a!==void 0&&Of(a,e)}}function $q(t,e){if(e instanceof ZR)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Xg){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function kq(t){for(const e of t.elements)if(e.state.type===hu)return!0;return!1}function Cq(t){for(const e of t.elements)if(e.state.type!==hu)return!1;return!0}function Aq(t){if(Cq(t))return!0;const e=_q(t.elements);return Pq(e)&&!Iq(e)}function _q(t){const e=new Map;for(const n of t){const r=rT(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Pq(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function Iq(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var lT;(function(t){function e(n){return typeof n=="string"}t.is=e})(lT||(lT={}));var ty;(function(t){function e(n){return typeof n=="string"}t.is=e})(ty||(ty={}));var dT;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(dT||(dT={}));var Ff;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Ff||(Ff={}));var Xe;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Ff.MAX_VALUE),i===Number.MAX_VALUE&&(i=Ff.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&L.uinteger(i.line)&&L.uinteger(i.character)}t.is=n})(Xe||(Xe={}));var Me;(function(t){function e(r,i,s,a){if(L.uinteger(r)&&L.uinteger(i)&&L.uinteger(s)&&L.uinteger(a))return{start:Xe.create(r,i),end:Xe.create(s,a)};if(Xe.is(r)&&Xe.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&Xe.is(i.start)&&Xe.is(i.end)}t.is=n})(Me||(Me={}));var Lf;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&Me.is(i.range)&&(L.string(i.uri)||L.undefined(i.uri))}t.is=n})(Lf||(Lf={}));var fT;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&Me.is(i.targetRange)&&L.string(i.targetUri)&&Me.is(i.targetSelectionRange)&&(Me.is(i.originSelectionRange)||L.undefined(i.originSelectionRange))}t.is=n})(fT||(fT={}));var ny;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&L.numberRange(i.red,0,1)&&L.numberRange(i.green,0,1)&&L.numberRange(i.blue,0,1)&&L.numberRange(i.alpha,0,1)}t.is=n})(ny||(ny={}));var pT;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&Me.is(i.range)&&ny.is(i.color)}t.is=n})(pT||(pT={}));var hT;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&L.string(i.label)&&(L.undefined(i.textEdit)||Tn.is(i))&&(L.undefined(i.additionalTextEdits)||L.typedArray(i.additionalTextEdits,Tn.is))}t.is=n})(hT||(hT={}));var mT;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(mT||(mT={}));var gT;(function(t){function e(r,i,s,a,o,u){const c={startLine:r,endLine:i};return L.defined(s)&&(c.startCharacter=s),L.defined(a)&&(c.endCharacter=a),L.defined(o)&&(c.kind=o),L.defined(u)&&(c.collapsedText=u),c}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&L.uinteger(i.startLine)&&L.uinteger(i.startLine)&&(L.undefined(i.startCharacter)||L.uinteger(i.startCharacter))&&(L.undefined(i.endCharacter)||L.uinteger(i.endCharacter))&&(L.undefined(i.kind)||L.string(i.kind))}t.is=n})(gT||(gT={}));var ry;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&Lf.is(i.location)&&L.string(i.message)}t.is=n})(ry||(ry={}));var mu;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(mu||(mu={}));var yT;(function(t){t.Unnecessary=1,t.Deprecated=2})(yT||(yT={}));var wT;(function(t){function e(n){const r=n;return L.objectLiteral(r)&&L.string(r.href)}t.is=e})(wT||(wT={}));var Mf;(function(t){function e(r,i,s,a,o,u){let c={range:r,message:i};return L.defined(s)&&(c.severity=s),L.defined(a)&&(c.code=a),L.defined(o)&&(c.source=o),L.defined(u)&&(c.relatedInformation=u),c}t.create=e;function n(r){var i;let s=r;return L.defined(s)&&Me.is(s.range)&&L.string(s.message)&&(L.number(s.severity)||L.undefined(s.severity))&&(L.integer(s.code)||L.string(s.code)||L.undefined(s.code))&&(L.undefined(s.codeDescription)||L.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(L.string(s.source)||L.undefined(s.source))&&(L.undefined(s.relatedInformation)||L.typedArray(s.relatedInformation,ry.is))}t.is=n})(Mf||(Mf={}));var wa;(function(t){function e(r,i,...s){let a={title:r,command:i};return L.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.title)&&L.string(i.command)}t.is=n})(wa||(wa={}));var Tn;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return L.objectLiteral(a)&&L.string(a.newText)&&Me.is(a.range)}t.is=i})(Tn||(Tn={}));var iy;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&L.string(i.label)&&(L.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(L.string(i.description)||i.description===void 0)}t.is=n})(iy||(iy={}));var va;(function(t){function e(n){const r=n;return L.string(r)}t.is=e})(va||(va={}));var vT;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return Tn.is(a)&&(iy.is(a.annotationId)||va.is(a.annotationId))}t.is=i})(vT||(vT={}));var sy;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&ly.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(sy||(sy={}));var ay;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&L.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||L.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||L.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||va.is(i.annotationId))}t.is=n})(ay||(ay={}));var oy;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&L.string(i.oldUri)&&L.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||L.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||L.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||va.is(i.annotationId))}t.is=n})(oy||(oy={}));var uy;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&L.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||L.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||L.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||va.is(i.annotationId))}t.is=n})(uy||(uy={}));var cy;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>L.string(i.kind)?ay.is(i)||oy.is(i)||uy.is(i):sy.is(i)))}t.is=e})(cy||(cy={}));var bT;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)}t.is=n})(bT||(bT={}));var DT;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)&&L.integer(i.version)}t.is=n})(DT||(DT={}));var ly;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)&&(i.version===null||L.integer(i.version))}t.is=n})(ly||(ly={}));var ET;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)&&L.string(i.languageId)&&L.integer(i.version)&&L.string(i.text)}t.is=n})(ET||(ET={}));var dy;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(dy||(dy={}));var gu;(function(t){function e(n){const r=n;return L.objectLiteral(n)&&dy.is(r.kind)&&L.string(r.value)}t.is=e})(gu||(gu={}));var Ct;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Ct||(Ct={}));var Gn;(function(t){t.PlainText=1,t.Snippet=2})(Gn||(Gn={}));var RT;(function(t){t.Deprecated=1})(RT||(RT={}));var TT;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&L.string(i.newText)&&Me.is(i.insert)&&Me.is(i.replace)}t.is=n})(TT||(TT={}));var ST;(function(t){t.asIs=1,t.adjustIndentation=2})(ST||(ST={}));var $T;(function(t){function e(n){const r=n;return r&&(L.string(r.detail)||r.detail===void 0)&&(L.string(r.description)||r.description===void 0)}t.is=e})($T||($T={}));var kT;(function(t){function e(n){return{label:n}}t.create=e})(kT||(kT={}));var CT;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(CT||(CT={}));var Bf;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return L.string(i)||L.objectLiteral(i)&&L.string(i.language)&&L.string(i.value)}t.is=n})(Bf||(Bf={}));var AT;(function(t){function e(n){let r=n;return!!r&&L.objectLiteral(r)&&(gu.is(r.contents)||Bf.is(r.contents)||L.typedArray(r.contents,Bf.is))&&(n.range===void 0||Me.is(n.range))}t.is=e})(AT||(AT={}));var _T;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(_T||(_T={}));var PT;(function(t){function e(n,r,...i){let s={label:n};return L.defined(r)&&(s.documentation=r),L.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(PT||(PT={}));var IT;(function(t){t.Text=1,t.Read=2,t.Write=3})(IT||(IT={}));var xT;(function(t){function e(n,r){let i={range:n};return L.number(r)&&(i.kind=r),i}t.create=e})(xT||(xT={}));var er;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(er||(er={}));var NT;(function(t){t.Deprecated=1})(NT||(NT={}));var OT;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(OT||(OT={}));var FT;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(FT||(FT={}));var LT;(function(t){function e(r,i,s,a,o,u){let c={name:r,detail:i,kind:s,range:a,selectionRange:o};return u!==void 0&&(c.children=u),c}t.create=e;function n(r){let i=r;return i&&L.string(i.name)&&L.number(i.kind)&&Me.is(i.range)&&Me.is(i.selectionRange)&&(i.detail===void 0||L.string(i.detail))&&(i.deprecated===void 0||L.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(LT||(LT={}));var MT;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(MT||(MT={}));var zf;(function(t){t.Invoked=1,t.Automatic=2})(zf||(zf={}));var BT;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return L.defined(i)&&L.typedArray(i.diagnostics,Mf.is)&&(i.only===void 0||L.typedArray(i.only,L.string))&&(i.triggerKind===void 0||i.triggerKind===zf.Invoked||i.triggerKind===zf.Automatic)}t.is=n})(BT||(BT={}));var zT;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):wa.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&L.string(i.title)&&(i.diagnostics===void 0||L.typedArray(i.diagnostics,Mf.is))&&(i.kind===void 0||L.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||wa.is(i.command))&&(i.isPreferred===void 0||L.boolean(i.isPreferred))&&(i.edit===void 0||cy.is(i.edit))}t.is=n})(zT||(zT={}));var qT;(function(t){function e(r,i){let s={range:r};return L.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return L.defined(i)&&Me.is(i.range)&&(L.undefined(i.command)||wa.is(i.command))}t.is=n})(qT||(qT={}));var jT;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.uinteger(i.tabSize)&&L.boolean(i.insertSpaces)}t.is=n})(jT||(jT={}));var UT;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return L.defined(i)&&Me.is(i.range)&&(L.undefined(i.target)||L.string(i.target))}t.is=n})(UT||(UT={}));var GT;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&Me.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(GT||(GT={}));var Fe;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Fe||(Fe={}));var Je;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Je||(Je={}));var WT;(function(t){function e(n){const r=n;return L.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(WT||(WT={}));var HT;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&L.string(i.text)}t.is=n})(HT||(HT={}));var VT;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&L.boolean(i.caseSensitiveLookup)&&(L.string(i.variableName)||i.variableName===void 0)}t.is=n})(VT||(VT={}));var KT;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&(L.string(i.expression)||i.expression===void 0)}t.is=n})(KT||(KT={}));var YT;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return L.defined(i)&&Me.is(r.stoppedLocation)}t.is=n})(YT||(YT={}));var fy;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(fy||(fy={}));var py;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&(i.tooltip===void 0||L.string(i.tooltip)||gu.is(i.tooltip))&&(i.location===void 0||Lf.is(i.location))&&(i.command===void 0||wa.is(i.command))}t.is=n})(py||(py={}));var XT;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&Xe.is(i.position)&&(L.string(i.label)||L.typedArray(i.label,py.is))&&(i.kind===void 0||fy.is(i.kind))&&i.textEdits===void 0||L.typedArray(i.textEdits,Tn.is)&&(i.tooltip===void 0||L.string(i.tooltip)||gu.is(i.tooltip))&&(i.paddingLeft===void 0||L.boolean(i.paddingLeft))&&(i.paddingRight===void 0||L.boolean(i.paddingRight))}t.is=n})(XT||(XT={}));var JT;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(JT||(JT={}));var QT;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(QT||(QT={}));var ZT;(function(t){function e(n){return{items:n}}t.create=e})(ZT||(ZT={}));var eS;(function(t){t.Invoked=0,t.Automatic=1})(eS||(eS={}));var tS;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(tS||(tS={}));var nS;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(nS||(nS={}));var rS;(function(t){function e(n){const r=n;return L.objectLiteral(r)&&ty.is(r.uri)&&L.string(r.name)}t.is=e})(rS||(rS={}));var iS;(function(t){function e(s,a,o,u){return new xq(s,a,o,u)}t.create=e;function n(s){let a=s;return!!(L.defined(a)&&L.string(a.uri)&&(L.undefined(a.languageId)||L.string(a.languageId))&&L.uinteger(a.lineCount)&&L.func(a.getText)&&L.func(a.positionAt)&&L.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),u=i(a,(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),c=o.length;for(let l=u.length-1;l>=0;l--){let d=u[l],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=c)o=o.substring(0,f)+d.newText+o.substring(p,o.length);else throw new Error("Overlapping edit");c=f}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,u=s.slice(0,o),c=s.slice(o);i(u,a),i(c,a);let l=0,d=0,f=0;for(;l<u.length&&d<c.length;)a(u[l],c[d])<=0?s[f++]=u[l++]:s[f++]=c[d++];for(;l<u.length;)s[f++]=u[l++];for(;d<c.length;)s[f++]=c[d++];return s}})(iS||(iS={}));let xq=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
115
|
-
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
116
|
-
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return Xe.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return Xe.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var L;(function(t){const e=Object.prototype.toString;function n(p){return typeof p<"u"}t.defined=n;function r(p){return typeof p>"u"}t.undefined=r;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function a(p){return e.call(p)==="[object Number]"}t.number=a;function o(p,h,w){return e.call(p)==="[object Number]"&&h<=p&&p<=w}t.numberRange=o;function u(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=u;function c(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=c;function l(p){return e.call(p)==="[object Function]"}t.func=l;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,h){return Array.isArray(p)&&p.every(h)}t.typedArray=f})(L||(L={}));class Nq{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new aS(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new my;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new hy(e.startOffset,e.image.length,Ad(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new hy(s.startOffset,s.image.length,Ad(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class sS{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class hy extends sS{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class my extends sS{constructor(){super(...arguments),this.content=new xb(this)}get children(){return this.content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:Xe.create(0,0),end:Xe.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class xb extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,xb.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class aS extends my{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const gy=Symbol("Datatype");function yy(t){return t.$type===gy}const oS="\u200B",uS=t=>t.endsWith(oS)?t:t+oS;class cS{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new Bq(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Oq extends cS{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Nq,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(uS(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(Kd(e))return gy;{const n=ns(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const a={$type:e};this.stack.push(a),e===gy&&(a.value="")}let s;try{s=n(r)}catch{s=void 0}return s===void 0&&i&&(s=this.construct()),s}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:u}=this.getAssignment(r),c=this.current;if(o){const l=mr(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,l,a,u)}else if(yy(c)){let l=i.image;mr(r)||(l=this.converter.convert(l,a).toString()),c.value+=l}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,n,s);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,i,a)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(yy(a))a.value+=e.toString();else if(typeof e=="object"&&e){const u=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(u)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return jm(e),this.nodeBuilder.construct(e),this.stack.pop(),yy(e)?this.converter.convert(e.value,e.$cstNode):(Gm(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=Xt(e,hr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?Po(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Fq{buildMismatchTokenMessage(e){return ma.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return ma.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return ma.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return ma.buildEarlyExitMessage(e)}}class lS extends Fq{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class Lq extends cS{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(uS(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const Mq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new lS};class Bq extends Hz{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},Mq),{lookaheadStrategy:r?new Hg({maxLookahead:n.maxLookahead}):new pq({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function dS(t,e,n){return zq({parser:e,tokens:n,ruleNames:new Map},t),e}function zq(t,e){const n=Ym(e,!1),r=et(e.rules).filter(Yt).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,ds(s,i.definition))}}function ds(t,e,n=!1){let r;if(mr(e))r=Vq(t,e);else if(ts(e))r=qq(t,e);else if(hr(e))r=ds(t,e.terminal);else if(Po(e))r=fS(t,e);else if(Nr(e))r=jq(t,e);else if(zm(e))r=Gq(t,e);else if(qm(e))r=Wq(t,e);else if(fi(e))r=Hq(t,e);else if(Lx(e)){const i=t.consume++;r=()=>t.parser.consume(i,yi,e)}else throw new gD(e.$cstNode,`Unexpected element type: ${e.$type}`);return pS(t,n?void 0:qf(e),r,e.cardinality)}function qq(t,e){const n=Ko(e);return()=>t.parser.action(n,e)}function jq(t,e){const n=e.rule.ref;if(Yt(n)){const r=t.subrule++,i=n.fragment,s=e.arguments.length>0?Uq(n,e.arguments):()=>({});return a=>t.parser.subrule(r,hS(t,n),i,e,s(a))}else if(xr(n)){const r=t.consume++,i=wy(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)lo();else throw new gD(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function Uq(t,e){const n=e.map(r=>Ur(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const a=t.parameters[s],o=n[s];i[a.name]=o(r)}return i}}function Ur(t){if(_x(t)){const e=Ur(t.left),n=Ur(t.right);return r=>e(r)||n(r)}else if(Ax(t)){const e=Ur(t.left),n=Ur(t.right);return r=>e(r)&&n(r)}else if(Px(t)){const e=Ur(t.value);return n=>!e(n)}else if(Ix(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(Cx(t)){const e=!!t.true;return()=>e}lo()}function Gq(t,e){if(e.elements.length===1)return ds(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:ds(t,i,!0)},a=qf(i);a&&(s.GATE=Ur(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function Wq(t,e){if(e.elements.length===1)return ds(t,e.elements[0]);const n=[];for(const o of e.elements){const u={ALT:ds(t,o,!0)},c=qf(o);c&&(u.GATE=Ur(c)),n.push(u)}const r=t.or++,i=(o,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${o}_${c}`},s=o=>t.parser.alternatives(r,n.map((u,c)=>{const l={ALT:()=>!0},d=t.parser;l.ALT=()=>{if(u.ALT(o),!d.isRecording()){const p=i(r,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const h=d.unorderedGroups.get(p);typeof h?.[c]>"u"&&(h[c]=!0)}};const f=u.GATE;return f?l.GATE=()=>f(o):l.GATE=()=>{const p=d.unorderedGroups.get(i(r,d));return!p?.[c]},l})),a=pS(t,qf(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function Hq(t,e){const n=e.elements.map(r=>ds(t,r));return r=>n.forEach(i=>i(r))}function qf(t){if(fi(t))return t.guardCondition}function fS(t,e,n=e.terminal){if(n)if(Nr(n)&&Yt(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;return s=>t.parser.subrule(i,hS(t,r),!1,e,s)}else if(Nr(n)&&xr(n.rule.ref)){const r=t.consume++,i=wy(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(mr(n)){const r=t.consume++,i=wy(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=eg(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Ko(e.type.ref));return fS(t,e,i)}}function Vq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function pS(t,e,n,r){const i=e&&Ur(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:YR(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:YR(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else lo()}function hS(t,e){const n=Kq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Kq(t,e){if(Yt(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Yt(r);)(fi(r)||zm(r)||qm(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function wy(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Yq(t){const e=t.Grammar,n=t.parser.Lexer,r=new Lq(t);return dS(e,r,n.definition),r.finalize(),r}function Xq(t){const e=Jq(t);return e.finalize(),e}function Jq(t){const e=t.Grammar,n=t.parser.Lexer,r=new Oq(t);return dS(e,r,n.definition)}class Qq{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=et(Ym(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(a=>{const o=a.PATTERN;typeof o=="object"&&o&&"test"in o&&Km(o)?s.unshift(a):s.push(a)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(xr).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Yo(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Km(n)?Rn.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(Yt).flatMap(i=>gr(i).filter(mr)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(Qx(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&Zx("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Zq{convert(e,n){let r=n.grammarSource;if(Po(r)&&(r=Xm(r)),Nr(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return Gr.convertInt(n);case"STRING":return Gr.convertString(n);case"ID":return Gr.convertID(n)}switch((i=LD(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Gr.convertNumber(n);case"boolean":return Gr.convertBoolean(n);case"bigint":return Gr.convertBigint(n);case"date":return Gr.convertDate(n);default:return n}}}var Gr;(function(t){function e(c){let l="";for(let d=1;d<c.length-1;d++){const f=c.charAt(d);if(f==="\\"){const p=c.charAt(++d);l+=n(p)}else l+=f}return l}t.convertString=e;function n(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
117
|
-
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}t.convertID=r;function i(c){return parseInt(c)}t.convertInt=i;function s(c){return BigInt(c)}t.convertBigint=s;function a(c){return new Date(c)}t.convertDate=a;function o(c){return Number(c)}t.convertNumber=o;function u(c){return c.toLowerCase()==="true"}t.convertBoolean=u})(Gr||(Gr={}));var e3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fs={},jf={},mS;function ps(){if(mS)return jf;mS=1,Object.defineProperty(jf,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r}(e),jf.default=e,jf}var Gt={},gS;function yu(){if(gS)return Gt;gS=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.stringArray=Gt.array=Gt.func=Gt.error=Gt.number=Gt.string=Gt.boolean=void 0;function t(o){return o===!0||o===!1}Gt.boolean=t;function e(o){return typeof o=="string"||o instanceof String}Gt.string=e;function n(o){return typeof o=="number"||o instanceof Number}Gt.number=n;function r(o){return o instanceof Error}Gt.error=r;function i(o){return typeof o=="function"}Gt.func=i;function s(o){return Array.isArray(o)}Gt.array=s;function a(o){return s(o)&&o.every(u=>e(u))}return Gt.stringArray=a,Gt}var hs={},yS;function ba(){if(yS)return hs;yS=1,Object.defineProperty(hs,"__esModule",{value:!0}),hs.Emitter=hs.Event=void 0;const t=ps();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(hs.Event=e={}));class n{add(s,a=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(a),Array.isArray(o)&&o.push({dispose:()=>this.remove(s,a)})}remove(s,a=null){if(!this._callbacks)return;let o=!1;for(let u=0,c=this._callbacks.length;u<c;u++)if(this._callbacks[u]===s)if(this._contexts[u]===a){this._callbacks.splice(u,1),this._contexts.splice(u,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const a=[],o=this._callbacks.slice(0),u=this._contexts.slice(0);for(let c=0,l=o.length;c<l;c++)try{a.push(o[c].apply(u[c],s))}catch(d){(0,t.default)().console.error(d)}return a}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,a,o)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,a);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,a),u.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(u),u}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return hs.Emitter=r,r._noop=function(){},hs}var wS;function Uf(){if(wS)return fs;wS=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.CancellationTokenSource=fs.CancellationToken=void 0;const t=ps(),e=yu(),n=ba();var r;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function u(c){const l=c;return l&&(l===o.None||l===o.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}o.is=u})(r||(fs.CancellationToken=r={}));const i=Object.freeze(function(o,u){const c=(0,t.default)().timer.setTimeout(o.bind(u),0);return{dispose(){c.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class a{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return fs.CancellationTokenSource=a,fs}var rt=Uf();function t3(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Gf=0,n3=10;function r3(){return Gf=performance.now(),new rt.CancellationTokenSource}const Wf=Symbol("OperationCancelled");function Hf(t){return t===Wf}async function At(t){if(t===rt.CancellationToken.None)return;const e=performance.now();if(e-Gf>=n3&&(Gf=e,await t3(),Gf=performance.now()),t.isCancellationRequested)throw Wf}class by{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Dd{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(Dd.isIncremental(r)){const i=bS(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let c=this._lineOffsets;const l=vS(r.text,!1,s);if(u-o===l.length)for(let f=0,p=l.length;f<p;f++)c[f+o+1]=l[f];else l.length<1e4?c.splice(o+1,u-o,...l):this._lineOffsets=c=c.slice(0,o+1).concat(l,c.slice(u+1));const d=r.text.length-(a-s);if(d!==0)for(let f=o+1+l.length,p=c.length;f<p;f++)c[f]=c[f]+d}else if(Dd.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=vS(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Vf;(function(t){function e(i,s,a,o){return new Dd(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof Dd)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let a=i.getText(),o=Dy(s.map(i3),(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),u=0;const c=[];for(const l of o){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(a.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(a.substr(u)),c.join("")}t.applyEdits=r})(Vf||(Vf={}));function Dy(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Dy(r,e),Dy(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function vS(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function bS(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function i3(t){const e=bS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var DS;(()=>{var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function a(u,c){for(var l,d="",f=0,p=-1,h=0,w=0;w<=u.length;++w){if(w<u.length)l=u.charCodeAt(w);else{if(l===47)break;l=47}if(l===47){if(!(p===w-1||h===1))if(p!==w-1&&h===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var D=d.lastIndexOf("/");if(D!==d.length-1){D===-1?(d="",f=0):f=(d=d.slice(0,D)).length-1-d.lastIndexOf("/"),p=w,h=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=w,h=0;continue}}c&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+u.slice(p+1,w):d=u.slice(p+1,w),f=w-p-1;p=w,h=0}else l===46&&h!==-1?++h:h=-1}return d}var o={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f;d>=0?f=arguments[d]:(u===void 0&&(u=process.cwd()),f=u),s(f),f.length!==0&&(c=f+"/"+c,l=f.charCodeAt(0)===47)}return c=a(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=a(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":o.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=o.resolve(u))===(c=o.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var d=u.length,f=d-l,p=1;p<c.length&&c.charCodeAt(p)===47;++p);for(var h=c.length-p,w=f<h?f:h,D=-1,g=0;g<=w;++g){if(g===w){if(h>w){if(c.charCodeAt(p+g)===47)return c.slice(p+g+1);if(g===0)return c.slice(p+g)}else f>w&&(u.charCodeAt(l+g)===47?D=g:g===0&&(D=0));break}var v=u.charCodeAt(l+g);if(v!==c.charCodeAt(p+g))break;v===47&&(D=g)}var R="";for(g=l+D+1;g<=d;++g)g!==d&&u.charCodeAt(g)!==47||(R.length===0?R+="..":R+="/..");return R.length>0?R+c.slice(p+D):(p+=D,c.charCodeAt(p)===47&&++p,c.slice(p))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,f=!0,p=u.length-1;p>=1;--p)if((c=u.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,f=-1,p=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var h=c.length-1,w=-1;for(l=u.length-1;l>=0;--l){var D=u.charCodeAt(l);if(D===47){if(!p){d=l+1;break}}else w===-1&&(p=!1,w=l+1),h>=0&&(D===c.charCodeAt(h)?--h==-1&&(f=l):(h=-1,f=w))}return d===f?f=w:f===-1&&(f=u.length),u.slice(d,f)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!p){d=l+1;break}}else f===-1&&(p=!1,f=l+1);return f===-1?"":u.slice(d,f)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,f=!0,p=0,h=u.length-1;h>=0;--h){var w=u.charCodeAt(h);if(w!==47)d===-1&&(f=!1,d=h+1),w===46?c===-1?c=h:p!==1&&(p=1):c!==-1&&(p=-1);else if(!f){l=h+1;break}}return c===-1||d===-1||p===0||p===1&&c===d-1&&c===l+1?"":u.slice(c,d)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var d=l.dir||l.root,f=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+f:d+"/"+f:f}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),f=d===47;f?(c.root="/",l=1):l=0;for(var p=-1,h=0,w=-1,D=!0,g=u.length-1,v=0;g>=l;--g)if((d=u.charCodeAt(g))!==47)w===-1&&(D=!1,w=g+1),d===46?p===-1?p=g:v!==1&&(v=1):p!==-1&&(v=-1);else if(!D){h=g+1;break}return p===-1||w===-1||v===0||v===1&&p===w-1&&p===h+1?w!==-1&&(c.base=c.name=h===0&&f?u.slice(1,w):u.slice(h,w)):(h===0&&f?(c.name=u.slice(1,p),c.base=u.slice(1,w)):(c.name=u.slice(h,p),c.base=u.slice(h,w)),c.ext=u.slice(p,w)),h>0?c.dir=u.slice(0,h-1):f&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}n.d=(i,s)=>{for(var a in s)n.o(s,a)&&!n.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>de}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function u(N,$){if(!N.scheme&&$)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!s.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!a.test(N.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri($){return $ instanceof f||!!$&&typeof $.authority=="string"&&typeof $.fragment=="string"&&typeof $.path=="string"&&typeof $.query=="string"&&typeof $.scheme=="string"&&typeof $.fsPath=="string"&&typeof $.with=="function"&&typeof $.toString=="function"}scheme;authority;path;query;fragment;constructor($,T,O,V,M,H=!1){typeof $=="object"?(this.scheme=$.scheme||c,this.authority=$.authority||c,this.path=$.path||c,this.query=$.query||c,this.fragment=$.fragment||c):(this.scheme=function(be,te){return be||te?be:"file"}($,H),this.authority=T||c,this.path=function(be,te){switch(be){case"https":case"http":case"file":te?te[0]!==l&&(te=l+te):te=l}return te}(this.scheme,O||c),this.query=V||c,this.fragment=M||c,u(this,H))}get fsPath(){return v(this)}with($){if(!$)return this;let{scheme:T,authority:O,path:V,query:M,fragment:H}=$;return T===void 0?T=this.scheme:T===null&&(T=c),O===void 0?O=this.authority:O===null&&(O=c),V===void 0?V=this.path:V===null&&(V=c),M===void 0?M=this.query:M===null&&(M=c),H===void 0?H=this.fragment:H===null&&(H=c),T===this.scheme&&O===this.authority&&V===this.path&&M===this.query&&H===this.fragment?this:new h(T,O,V,M,H)}static parse($,T=!1){const O=d.exec($);return O?new h(O[2]||c,j(O[4]||c),j(O[5]||c),j(O[7]||c),j(O[9]||c),T):new h(c,c,c,c,c)}static file($){let T=c;if(i&&($=$.replace(/\\/g,l)),$[0]===l&&$[1]===l){const O=$.indexOf(l,2);O===-1?(T=$.substring(2),$=l):(T=$.substring(2,O),$=$.substring(O)||l)}return new h("file",T,$,c,c)}static from($){const T=new h($.scheme,$.authority,$.path,$.query,$.fragment);return u(T,!0),T}toString($=!1){return R(this,$)}toJSON(){return this}static revive($){if($){if($ instanceof f)return $;{const T=new h($);return T._formatted=$.external,T._fsPath=$._sep===p?$.fsPath:null,T}}return $}}const p=i?1:void 0;class h extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this)),this._fsPath}toString($=!1){return $?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const $={$mid:1};return this._fsPath&&($.fsPath=this._fsPath,$._sep=p),this._formatted&&($.external=this._formatted),this.path&&($.path=this.path),this.scheme&&($.scheme=this.scheme),this.authority&&($.authority=this.authority),this.query&&($.query=this.query),this.fragment&&($.fragment=this.fragment),$}}const w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function D(N,$,T){let O,V=-1;for(let M=0;M<N.length;M++){const H=N.charCodeAt(M);if(H>=97&&H<=122||H>=65&&H<=90||H>=48&&H<=57||H===45||H===46||H===95||H===126||$&&H===47||T&&H===91||T&&H===93||T&&H===58)V!==-1&&(O+=encodeURIComponent(N.substring(V,M)),V=-1),O!==void 0&&(O+=N.charAt(M));else{O===void 0&&(O=N.substr(0,M));const be=w[H];be!==void 0?(V!==-1&&(O+=encodeURIComponent(N.substring(V,M)),V=-1),O+=be):V===-1&&(V=M)}}return V!==-1&&(O+=encodeURIComponent(N.substring(V))),O!==void 0?O:N}function g(N){let $;for(let T=0;T<N.length;T++){const O=N.charCodeAt(T);O===35||O===63?($===void 0&&($=N.substr(0,T)),$+=w[O]):$!==void 0&&($+=N[T])}return $!==void 0?$:N}function v(N,$){let T;return T=N.authority&&N.path.length>1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(T=T.replace(/\//g,"\\")),T}function R(N,$){const T=$?g:D;let O="",{scheme:V,authority:M,path:H,query:be,fragment:te}=N;if(V&&(O+=V,O+=":"),(M||V==="file")&&(O+=l,O+=l),M){let C=M.indexOf("@");if(C!==-1){const pe=M.substr(0,C);M=M.substr(C+1),C=pe.lastIndexOf(":"),C===-1?O+=T(pe,!1,!1):(O+=T(pe.substr(0,C),!1,!1),O+=":",O+=T(pe.substr(C+1),!1,!0)),O+="@"}M=M.toLowerCase(),C=M.lastIndexOf(":"),C===-1?O+=T(M,!1,!0):(O+=T(M.substr(0,C),!1,!0),O+=M.substr(C))}if(H){if(H.length>=3&&H.charCodeAt(0)===47&&H.charCodeAt(2)===58){const C=H.charCodeAt(1);C>=65&&C<=90&&(H=`/${String.fromCharCode(C+32)}:${H.substr(3)}`)}else if(H.length>=2&&H.charCodeAt(1)===58){const C=H.charCodeAt(0);C>=65&&C<=90&&(H=`${String.fromCharCode(C+32)}:${H.substr(2)}`)}O+=T(H,!0,!1)}return be&&(O+="?",O+=T(be,!1,!1)),te&&(O+="#",O+=$?te:D(te,!1,!1)),O}function k(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+k(N.substr(3)):N}}const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function j(N){return N.match(A)?N.replace(A,$=>k($)):N}var W=n(470);const Z=W.posix||W,J="/";var de;(function(N){N.joinPath=function($,...T){return $.with({path:Z.join($.path,...T)})},N.resolvePath=function($,...T){let O=$.path,V=!1;O[0]!==J&&(O=J+O,V=!0);let M=Z.resolve(O,...T);return V&&M[0]===J&&!$.authority&&(M=M.substring(1)),$.with({path:M})},N.dirname=function($){if($.path.length===0||$.path===J)return $;let T=Z.dirname($.path);return T.length===1&&T.charCodeAt(0)===46&&(T=""),$.with({path:T})},N.basename=function($){return Z.basename($.path)},N.extname=function($){return Z.extname($.path)}})(de||(de={}))})(),DS=r})();const{URI:Wt,Utils:wu}=DS;var Rt;(function(t){t.basename=wu.basename,t.dirname=wu.dirname,t.extname=wu.extname,t.joinPath=wu.joinPath,t.resolvePath=wu.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const a=typeof i=="string"?i:i.path,o=typeof s=="string"?s:s.path,u=a.split("/").filter(p=>p.length>0),c=o.split("/").filter(p=>p.length>0);let l=0;for(;l<u.length&&u[l]===c[l];l++);const d="../".repeat(u.length-l),f=c.slice(l).join("/");return d+f}t.relative=n;function r(i){return Wt.parse(i.toString()).toString()}t.normalize=r})(Rt||(Rt={}));var Be;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Be||(Be={}));class s3{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=rt.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Wt.parse(e.uri),rt.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return rt.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:Be.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:Be.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,n){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,a=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=a?a.getText():await this.fileSystemProvider.readFile(e.uri);if(a)Object.defineProperty(e,"textDocument",{value:a});else{const u=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:u})}return s!==o&&(e.parseResult=await this.parseAsync(e.uri,o,n),e.parseResult.value.$document=e),e.state=Be.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=Vf.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class a3{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return et(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=Be.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=Be.Changed,this.documentMap.delete(n)),r}}const Ey=Symbol("ref_resolving");class o3{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,n=rt.CancellationToken.None){for(const r of Or(e.parseResult.value))await At(n),qd(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=Ey;try{const s=this.getCandidate(e);if(kd(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const a=this.loadAstNode(s);i._ref=a??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const a=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${a}`})}n.references.push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,get ref(){var o;if(bt(this._ref))return this._ref;if(Ex(this._nodeDescription)){const u=s.loadAstNode(this._nodeDescription);this._ref=u??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=Ey;const u=zd(e).$document,c=s.getLinkedNode({reference:a,container:e,property:n});if(c.error&&u&&u.state<Be.ComputedScopes)return this._ref=void 0;this._ref=(o=c.node)!==null&&o!==void 0?o:c.error,this._nodeDescription=c.descr,u?.references.push(this)}else if(this._ref===Ey)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return bt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return kd(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(kd(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(n=r.message)!==null&&n!==void 0?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=zd(e.container).$document;r&&r.state<Be.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function Kf(t){return typeof t.name=="string"}class ES{getName(e){if(Kf(e))return e.name}getNameNode(e){return Jt(e.$cstNode,"name")}}class u3{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=PD(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Mn(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Mn(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||cD(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>Rt.equals(s.sourceUri,n.documentUri))),r.push(...i),et(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=ht(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:co(n),local:!0}}}}class Pn{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Cm.sum(et(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return et(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return et(this.map.keys())}values(){return et(this.map.values()).flat()}entriesGroupedByKey(){return et(this.map.entries())}}class RS{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class TS{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=rt.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=Go,i=rt.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const a of r(e))await At(i),this.exportNode(a,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=rt.CancellationToken.None){const r=e.parseResult.value,i=new Pn;for(const s of gr(r))await At(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class ms{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class SS{constructor(e,n,r){var i;this.elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const a=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(a,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=et(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const Yf={getElement(){},getAllElements(){return ta}};class $S{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class c3 extends $S{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class kS extends $S{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class CS extends kS{constructor(e,n){super(r=>r.toString()),n?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(n,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{const s=r.concat(i);for(const a of s)this.clear(a)}))}}class AS extends c3{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class _S{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new AS(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=ht(e.container).precomputedScopes;if(i){let a=e.container;do{const o=i.get(a);o.length>0&&n.push(et(o).filter(u=>this.reflection.isSubtype(u.type,r))),a=a.$container}while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new ms(et(e),n,r)}createScopeForNodes(e,n,r){const i=et(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new ms(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new SS(this.indexManager.allElements(e)))}}function l3(t){return typeof t.$comment=="string"}function PS(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class d3{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(o,u)=>this.replacer(o,u,r),a=i?(o,u)=>i(o,u,s):s;try{return this.currentDocument=ht(e),JSON.stringify(e,a,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var u,c,l,d;if(!this.ignoreProperties.has(e))if(Mn(n)){const f=n.ref,p=r?n.$refText:void 0;if(f){const h=ht(f);let w="";this.currentDocument&&this.currentDocument!==h&&(o?w=o(h.uri,n):w=h.uri.toString());const D=this.astNodeLocator.getAstNodePath(f);return{$ref:`${w}#${D}`,$refText:p}}else return{$error:(c=(u=n.error)===null||u===void 0?void 0:u.message)!==null&&c!==void 0?c:"Could not resolve reference",$refText:p}}else if(bt(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(l=this.currentDocument)===null||l===void 0?void 0:l.uri.toString())),i&&!e&&(f??(f=Object.assign({},n)),f.$sourceText=(d=n.$cstNode)===null||d===void 0?void 0:d.text),a){f??(f=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(f.$comment=p.replace(/\r/g,""))}return f??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=sa(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[u,c]of Object.entries(e))if(Array.isArray(c))for(let l=0;l<c.length;l++){const d=c[l];PS(d)?c[l]=this.reviveReference(e,u,n,d,r):bt(d)&&this.linkNode(d,n,r,e,u,l)}else PS(c)?e[u]=this.reviveReference(e,u,n,c,r):bt(c)&&this.linkNode(c,n,r,e,u);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,n,r,i,s){let a=i.$refText,o=i.$error;if(i.$ref){const u=this.getRefNode(r,i.$ref,s.uriConverter);if(bt(u))return a||(a=this.nameProvider.getName(u)),{$refText:a??"",ref:u};o=u}if(o){const u={$refText:a??""};return u.error={container:e,property:n,message:o,reference:u},u}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const u=this.astNodeLocator.getAstNode(e,n.substring(1));return u||"Could not resolve path: "+n}if(i<0){const u=r?r(n):Wt.parse(n),c=this.langiumDocuments.getDocument(u);return c?c.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Wt.parse(n.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+n;if(i===n.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,n.substring(i+1));return o||"Could not resolve URI: "+n}catch(i){return String(i)}}}class f3{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(n=this.textDocuments)===null||n===void 0?void 0:n.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const s=Rt.extname(e),a=this.fileExtensionMap.get(s);if(!a)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function vu(t){return{code:t}}var Xf;(function(t){t.all=["fast","slow","built-in"]})(Xf||(Xf={}));class p3{constructor(e){this.entries=new Pn,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const u={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,u)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,o)}else lo()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(Hf(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=et(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class h3{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=rt.CancellationToken.None){const i=e.parseResult,s=[];if(await At(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===tr.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===tr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===tr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if(Hf(a))throw a;console.error("An error occurred during validation:",a)}return await At(r),s}processLexingErrors(e,n,r){var i,s,a;const o=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const u of o){const c=(a=u.severity)!==null&&a!==void 0?a:"error",l={severity:Ry(c),range:{start:{line:u.line-1,character:u.column-1},end:{line:u.line-1,character:u.column+u.length-1}},message:u.message,data:g3(c),source:this.getSource()};n.push(l)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=Ad(i.token);if(s){const a={severity:Ry("error"),range:s,message:i.message,data:vu(tr.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.container,property:s.property,index:s.index,data:{code:tr.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,n,r=rt.CancellationToken.None){const i=[],s=(a,o,u)=>{i.push(this.toDiagnostic(a,o,u))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=rt.CancellationToken.None){var s;const a=this.validationRegistry.checksBefore;for(const o of a)await At(i),await o(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=rt.CancellationToken.None){await Promise.all(Or(e).map(async s=>{await At(i);const a=this.validationRegistry.getChecks(s.$type,n.categories);for(const o of a)await o(s,r,i)}))}async validateAstAfter(e,n,r,i=rt.CancellationToken.None){var s;const a=this.validationRegistry.checksAfter;for(const o of a)await At(i),await o(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:m3(r),severity:Ry(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function m3(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Jt(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Vo(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Ry(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function g3(t){switch(t){case"error":return vu(tr.LexingError);case"warning":return vu(tr.LexingWarning);case"info":return vu(tr.LexingInfo);case"hint":return vu(tr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var tr;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(tr||(tr={}));class y3{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??ht(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>{var u;return a??(a=co((u=this.nameProvider.getNameNode(e))!==null&&u!==void 0?u:e.$cstNode))};return{node:e,name:n,get nameSegment(){return o()},selectionSegment:co(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class w3{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=rt.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Or(i))await At(n),qd(s).filter(a=>!kd(a)).forEach(a=>{const o=this.createDescription(a);o&&r.push(o)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=ht(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:co(r),local:Rt.equals(n.documentUri,i)}}}class v3{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),u=parseInt(s.substring(a+1)),c=i[o];return c?.[u]}return i[s]},e)}}var b3=ba();class D3{constructor(e){this._ready=new by,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new b3.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var gs;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(gs||(gs={}));class E3{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Pn,this.documentPhaseListeners=new Pn,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Be.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=rt.CancellationToken.None){var i,s;for(const a of e){const o=a.uri.toString();if(a.state===Be.Validated){if(typeof n.validation=="boolean"&&n.validation)a.state=Be.IndexedReferences,a.diagnostics=void 0,this.buildState.delete(o);else if(typeof n.validation=="object"){const u=this.buildState.get(o),c=(i=u?.result)===null||i===void 0?void 0:i.validationChecks;if(c){const d=((s=n.validation.categories)!==null&&s!==void 0?s:Xf.all).filter(f=>!c.includes(f));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:d})},result:u.result}),a.state=Be.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=Be.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=rt.CancellationToken.None){this.currentState=Be.Changed;for(const a of n)this.langiumDocuments.deleteDocument(a),this.buildState.delete(a.toString()),this.indexManager.remove(a);for(const a of e){if(!this.langiumDocuments.invalidateDocument(a)){const u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},a);u.state=Be.Changed,this.langiumDocuments.addDocument(u)}this.buildState.delete(a.toString())}const i=et(e).concat(n).map(a=>a.toString()).toSet();this.langiumDocuments.all.filter(a=>!i.has(a.uri.toString())&&this.shouldRelink(a,i)).forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,Be.ComputedScopes),a.diagnostics=void 0}),await this.emitUpdate(e,n),await At(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(a=>{var o;return a.state<Be.Linked||!(!((o=this.buildState.get(a.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),gs.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,Be.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,Be.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,Be.ComputedScopes,r,async s=>{const a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await a.computeLocalScopes(s,r)}),await this.runCancelable(e,Be.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,Be.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,Be.Validated,r,s=>this.validate(s,r));for(const s of e){const a=this.buildState.get(s.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(o=>o.state<n);for(const o of s)await At(r),await i(o),o.state=n,await this.notifyDocumentPhase(o,n,r);const a=e.filter(o=>o.state===n);await this.notifyBuildPhase(a,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),gs.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),gs.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=rt.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(Wf):new Promise((s,a)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),u.dispose(),i){const c=this.langiumDocuments.getDocument(i);s(c?.uri)}else s(void 0)}),u=r.onCancellationRequested(()=>{o.dispose(),u.dispose(),a(Wf)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await a(e,r)}catch(o){if(!Hf(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await At(r),await a(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o=typeof a=="object"?a:void 0,u=await s.validateDocument(e,o,n);e.diagnostics?e.diagnostics.push(...u):e.diagnostics=u;const c=this.buildState.get(e.uri.toString());if(c){(r=c.result)!==null&&r!==void 0||(c.result={});const l=(i=o?.categories)!==null&&i!==void 0?i:Xf.all;c.result.validationChecks?c.result.validationChecks.push(...l):c.result.validationChecks=[...l]}}getBuildOptions(e){var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class R3{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new kS,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=ht(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{Rt.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),et(i)}allElements(e,n){let r=et(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(o=>this.astReflection.isSubtype(o.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}async updateContent(e,n=rt.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=rt.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class IS{constructor(e){this.initialBuildOptions={},this._ready=new by,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var n;this.folders=(n=e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=rt.CancellationToken.None){const r=await this.performStartup(e);await At(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Wt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async a=>{if(this.includeEntry(e,a,r)){if(a.isDirectory)await this.traverseFolder(e,a.uri,r,i);else if(a.isFile){const o=await this.langiumDocuments.getOrCreateDocument(a.uri);i(o)}}}))}includeEntry(e,n,r){const i=Rt.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=Rt.extname(n.uri);return r.includes(s)}return!1}}class T3{buildUnexpectedCharactersMessage(e,n,r,i,s){return Ng.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return Ng.buildUnableToPopLexerModeMessage(e)}}const S3={mode:"full"};class $3{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=NS(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Rn(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=S3){var r,i,s;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:(r=a.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(NS(e))return e;const n=xS(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function k3(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function xS(t){return t&&"modes"in t&&"defaultMode"in t}function NS(t){return!k3(t)&&!xS(t)}function C3(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=Xe.create(0,0));const s=OS(t),a=Sy(r),o=P3({lines:s,position:i,options:a});return F3({index:0,tokens:o,position:i})}function A3(t,e){const n=Sy(e),r=OS(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!a?.exec(i)&&!!o?.exec(s)}function OS(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(kD)}const FS=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,_3=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function P3(t){var e,n,r;const i=[];let s=t.position.line,a=t.position.character;for(let o=0;o<t.lines.length;o++){const u=o===0,c=o===t.lines.length-1;let l=t.lines[o],d=0;if(u&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(d=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(d=p.index+p[0].length)}if(c){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);p&&(l=l.substring(0,p.index))}if(l=l.substring(0,O3(l)),Ty(l,d)>=l.length){if(i.length>0){const p=Xe.create(s,a);i.push({type:"break",content:"",range:Me.create(p,p)})}}else{FS.lastIndex=d;const p=FS.exec(l);if(p){const h=p[0],w=p[1],D=Xe.create(s,a+d),g=Xe.create(s,a+d+h.length);i.push({type:"tag",content:w,range:Me.create(D,g)}),d+=h.length,d=Ty(l,d)}if(d<l.length){const h=l.substring(d),w=Array.from(h.matchAll(_3));i.push(...I3(w,h,s,a+d))}}s++,a=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function I3(t,e,n,r){const i=[];if(t.length===0){const s=Xe.create(n,r),a=Xe.create(n,r+e.length);i.push({type:"text",content:e,range:Me.create(s,a)})}else{let s=0;for(const o of t){const u=o.index,c=e.substring(s,u);c.length>0&&i.push({type:"text",content:e.substring(s,u),range:Me.create(Xe.create(n,s+r),Xe.create(n,u+r))});let l=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Me.create(Xe.create(n,s+l+r),Xe.create(n,s+l+d.length+r))}),l+=d.length,o.length===4){l+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Me.create(Xe.create(n,s+l+r),Xe.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Me.create(Xe.create(n,s+l+r),Xe.create(n,s+l+r))});s=u+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:Me.create(Xe.create(n,s+r),Xe.create(n,s+r+a.length))})}return i}const x3=/\S/,N3=/\s*$/;function Ty(t,e){const n=t.substring(e).match(x3);return n?e+n.index:t.length}function O3(t){const e=t.match(N3);if(e&&typeof e.index=="number")return e.index}function F3(t){var e,n,r,i;const s=Xe.create(t.position.line,t.position.character);if(t.tokens.length===0)return new zS([],Me.create(s,s));const a=[];for(;t.index<t.tokens.length;){const c=L3(t,a[a.length-1]);c&&a.push(c)}const o=(n=(e=a[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,u=(i=(r=a[a.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new zS(a,Me.create(o,u))}function L3(t,e){const n=t.tokens[t.index];if(n.type==="tag")return MS(t,!1);if(n.type==="text"||n.type==="inline-tag")return LS(t);M3(n,e),t.index++}function M3(t,e){if(e){const n=new qS("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function LS(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(B3(t)),r=e,e=t.tokens[t.index];return new Cy(i,Me.create(n.range.start,r.range.end))}function B3(t){return t.tokens[t.index].type==="inline-tag"?MS(t,!0):BS(t)}function MS(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const s=BS(t);return new ky(r,new Cy([s],s.range),e,Me.create(n.range.start,s.range.end))}else{const s=LS(t);return new ky(r,s,e,Me.create(n.range.start,s.range.end))}else{const s=n.range;return new ky(r,new Cy([],s),e,s)}}function BS(t){const e=t.tokens[t.index++];return new qS(e.content,e.range)}function Sy(t){if(!t)return Sy({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:$y(e,!0),end:$y(n,!1),line:$y(r,!0)}}function $y(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Hd(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class zS{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=jS(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=jS(n)+i}return n.trim()}}class ky{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
|
|
118
|
-
${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=z3(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.content.inlines.length>1&&(i=`${i}
|
|
119
|
-
${n}`),this.inline?`{${i}}`:i}}function z3(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let a=e;if(s>0){const u=Ty(e,s);a=e.substring(u),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(a=`\`${a}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,a))!==null&&i!==void 0?i:q3(e,a)}}function q3(t,e){try{return Wt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Cy{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
|
|
120
|
-
`)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
|
|
121
|
-
`)}return n}}class qS{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function jS(t){return t.endsWith(`
|
|
122
|
-
`)?`
|
|
123
|
-
`:`
|
|
124
|
-
|
|
125
|
-
`}class j3{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&A3(n))return C3(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const a=s.nameSegment.range.start.line+1,o=s.nameSegment.range.start.character+1,u=s.documentUri.with({fragment:`L${a},${o}`});return`[${r}](${u.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=ht(e).precomputedScopes;if(!i)return;let s=e;do{const o=i.get(s).find(u=>u.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class U3{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return l3(e)?e.$comment:(n=_d(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class G3{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class W3{constructor(){this.previousTokenSource=new rt.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=r3();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=rt.CancellationToken.None){const i=new by,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Hf(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class H3{constructor(e){this.grammarElementIdMap=new RS,this.tokenTypeIdMap=new RS,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Or(e))n.set(i,{});if(e.$cstNode)for(const i of uo(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)bt(o)?a.push(this.dehydrateAstNode(o,n)):Mn(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else bt(s)?r[i]=this.dehydrateAstNode(s,n):Mn(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return oD(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),li(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):es(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Or(e))n.set(s,{});let i;if(e.$cstNode)for(const s of uo(e.$cstNode)){let a;"fullText"in s?(a=new aS(s.fullText),i=a):"content"in s?a=new my:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)bt(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):Mn(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else bt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Mn(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),li(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,u=e.endColumn,c=e.hidden;return new hy(r,i,{start:{line:s,character:a},end:{line:o,character:u}},n,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Or(this.grammar))Om(n)&&this.grammarElementIdMap.set(n,e++)}}function US(t){return{documentation:{CommentProvider:e=>new U3(e),DocumentationProvider:e=>new j3(e)},parser:{AsyncParser:e=>new G3(e),GrammarConfig:e=>cN(e),LangiumParser:e=>Xq(e),CompletionParser:e=>Yq(e),ValueConverter:()=>new Zq,TokenBuilder:()=>new Qq,Lexer:e=>new $3(e),ParserErrorMessageProvider:()=>new lS,LexerErrorMessageProvider:()=>new T3},workspace:{AstNodeLocator:()=>new v3,AstNodeDescriptionProvider:e=>new y3(e),ReferenceDescriptionProvider:e=>new w3(e)},references:{Linker:e=>new o3(e),NameProvider:()=>new ES,ScopeProvider:e=>new _S(e),ScopeComputation:e=>new TS(e),References:e=>new u3(e)},serializer:{Hydrator:e=>new H3(e),JsonSerializer:e=>new d3(e)},validation:{DocumentValidator:e=>new h3(e),ValidationRegistry:e=>new p3(e)},shared:()=>t.shared}}function GS(t){return{ServiceRegistry:e=>new f3(e),workspace:{LangiumDocuments:e=>new a3(e),LangiumDocumentFactory:e=>new s3(e),DocumentBuilder:e=>new E3(e),IndexManager:e=>new R3(e),WorkspaceManager:e=>new IS(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new W3,ConfigurationProvider:e=>new D3(e)}}}var Jf;(function(t){t.merge=(e,n)=>Zf(Zf({},e),n)})(Jf||(Jf={}));function Qf(t,e,n,r,i,s,a,o,u){const c=[t,e,n,r,i,s,a,o,u].reduce(Zf,{});return HS(c)}const WS=Symbol("isProxy");function Ay(t){if(t&&t[WS])for(const e of Object.values(t))Ay(e);return t}function HS(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===WS?!0:KS(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(KS(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const VS=Symbol();function KS(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===VS)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=VS;try{t[e]=typeof i=="function"?i(r):HS(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Zf(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=Zf(i,r):t[n]=r}}return t}class V3{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const YS={fileSystemProvider:()=>new V3},K3={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Y3={AstReflection:()=>new ED};function X3(){const t=Qf(GS(YS),Y3),e=Qf(US({shared:t}),K3);return t.ServiceRegistry.register(e),e}function J3(t){var e;const n=X3(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Wt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var Q3={done:!0,hasNext:!1},bu={done:!1,hasNext:!1},Z3=()=>Q3,ej=t=>({hasNext:!0,next:t,done:!1});function Ye(t,...e){let n=t,r=e.map(s=>"lazy"in s?tj(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!nj(n)){let u=e[i];n=u(n),i+=1;continue}let s=[];for(let u=i;u<e.length;u++){let c=r[u];if(c===void 0||(s.push(c),c.isSingle))break}let a=[];for(let u of n)if(XS(u,a,s))break;let{isSingle:o}=s.at(-1);n=o?a[0]:a,i+=s.length}return n}function XS(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=bu,s=!1;for(let[a,o]of n.entries()){let{index:u,items:c}=o;if(c.push(r),i=o(r,u,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(XS(l,e,n.slice(a+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function tj(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function nj(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function JS(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return Ye(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>Ye(i,r),r)}throw new Error("Wrong number of arguments")}function rj(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function it(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return rj(t,e,n);throw new Error("Wrong number of arguments")}function Du(...t){return it(Object.values,t)}function _y(...t){return JS(ij,t)}function ij(){let t=new Set;return e=>t.has(e)?bu:(t.add(e),{done:!1,hasNext:!0,next:e})}function sj(...t){return it(aj,t,oj)}var aj=(t,e)=>e<0?[]:t.slice(0,e);function oj(t){if(t<=0)return Z3;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function ys(...t){return it(uj,t)}var uj=(t,e)=>t.length>=e;function cj(...t){return it(lj,t)}function lj(t,e){return e(t),t}function QS(...t){return it(dj,t)}function dj(t,e){let n=[...t];return n.sort(e),n}function Py(...t){return it(fj,t)}var fj=(t,e,n)=>t.reduce(e,n);function ZS(...t){return it(pj,t)}function pj(t){return[...t].reverse()}function Eu(...t){return it(hj,t)}var hj=(t,e)=>t[e];function mj(...t){return it(gj,t)}function gj(t,e){if(!ys(e,1))return{...t};if(!ys(e,2)){let{[e[0]]:r,...i}=t;return i}let n={...t};for(let r of e)delete n[r];return n}function Ru(...t){return it(yj,t)}function yj(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function ae(t){return!!t}function Tu(...t){return it(wj,t)}var wj=t=>t.at(-1);function ln(...t){return it(vj,t,bj)}var vj=(t,e)=>t.map(e),bj=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function nr(...t){return it(Dj,t)}function Dj(t,e){let n={};for(let[r,i]of t.entries()){let[s,a]=e(i,r,t);n[s]=a}return n}function ep(t){return typeof t=="number"&&!Number.isNaN(t)}function Ej(t){return t instanceof Promise}function e$(t){return typeof t=="string"}function ws(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function Rj(t){return t instanceof Error}function Qt(t){return t!=null}function yt(t){return t==null}function Tj(t){return Array.isArray(t)}function Iy(t){return typeof t=="boolean"}function Ht(t){return t!==void 0}function Sj(t,{triggerAt:e="end",minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:s=$j}){let a,o,u,c,l=()=>{let p=u;p!==void 0&&(u=void 0,t(p),i!==void 0&&(o=setTimeout(d,i)))},d=()=>{clearTimeout(o),o=void 0,a===void 0&&l()},f=()=>{clearTimeout(a),a=void 0,c=void 0,o===void 0&&l()};return{call:(...p)=>{let h=a===void 0&&o===void 0;if((e!=="start"||h)&&(u=s(u,...p)),!(a===void 0&&!h)){if(n!==void 0||r!==void 0||i===void 0){clearTimeout(a);let w=Date.now();c??=w;let D=r===void 0?n??0:Math.min(n??r,r-(w-c));a=setTimeout(f,D)}e!=="end"&&h&&l()}},cancel:()=>{clearTimeout(a),a=void 0,c=void 0,clearTimeout(o),o=void 0,u=void 0},flush:()=>{f(),d()},get isIdle(){return a===void 0&&o===void 0}}}var $j=()=>"";function vs(...t){return it(kj,t)}var kj=(t,e)=>{let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let{[s]:a}=n;a===void 0&&(a=[],n[s]=a),a.push(i)}}return n};function xy(...t){return it(Cj,t)}function Cj(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function Di(...t){return it(Aj,t,_j)}var Aj=(t,e)=>t.flatMap(e),_j=t=>(e,n,r)=>{let i=t(e,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function Pj(...t){return it(Ij,t,xj)}function Ij(t,e){return t.forEach(e),t}var xj=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function tp(...t){return it(Nj,t)}function Nj(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function np(...t){return it(Object.entries,t)}function ze(...t){return it(Oj,t,Fj)}var Oj=(t,e)=>t.filter(e),Fj=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:bu,t$=t=>Object.assign(t,{single:!0});function n$(...t){return it(Lj,t,t$(Mj))}var Lj=(t,e)=>t.find(e),Mj=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:bu;function r$(...t){return it(Bj,t)}var Bj=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Da(...t){return it(zj,t,t$(qj))}var zj=([t])=>t,qj=()=>jj,jj=t=>({hasNext:!0,next:t,done:!0});function i$(...t){return it(Uj,t)}var Uj=(t,e)=>[...t,...e];function Gj(...t){return JS(Wj,t)}function Wj(t){if(t.length===0)return ej;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?{done:!1,hasNext:!0,next:n}:(e.set(n,r-1),bu)}}function Hj(...t){return it(Vj,t)}var Vj=(t,e)=>e.some(n=>n(t));function Kj(...t){return it(Yj,t)}function Yj(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e.toString()}' would result in an infinite array`);if(t.length===0)return[];if(e>=t.length)return[[...t]];let n=Math.ceil(t.length/e),r=new Array(n);if(e===1)for(let[i,s]of t.entries())r[i]=[s];else for(let i=0;i<n;i+=1){let s=i*e;r[i]=t.slice(s,s+e)}return r}function s$(...t){return it(Xj,t)}var Xj=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,Jj={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},Qj=Object.entries(Jj);function Ny(t){return String(t)}Ny.open="",Ny.close="";function Zj(t=!1){let e=typeof process<"u"?process:void 0,n=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function e8(t=!1){let e=Zj(t),n=(a,o,u,c)=>{let l="",d=0;do l+=a.substring(d,c)+u,d=c+o.length,c=a.indexOf(o,d);while(~c);return l+a.substring(d)},r=(a,o,u=a)=>{let c=l=>{let d=String(l),f=d.indexOf(o,a.length);return~f?a+n(d,o,u,f)+o:a+d+o};return c.open=a,c.close=o,c},i={isColorSupported:e},s=a=>`\x1B[${a}m`;for(let[a,o]of Qj)i[a]=e?r(s(o[0]),s(o[1]),o[2]):Ny;return i}var pt=e8(L1(1)),Su={},Tt={},a$;function Oy(){if(a$)return Tt;a$=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.thenable=Tt.typedArray=Tt.stringArray=Tt.array=Tt.func=Tt.error=Tt.number=Tt.string=Tt.boolean=void 0;function t(c){return c===!0||c===!1}Tt.boolean=t;function e(c){return typeof c=="string"||c instanceof String}Tt.string=e;function n(c){return typeof c=="number"||c instanceof Number}Tt.number=n;function r(c){return c instanceof Error}Tt.error=r;function i(c){return typeof c=="function"}Tt.func=i;function s(c){return Array.isArray(c)}Tt.array=s;function a(c){return s(c)&&c.every(l=>e(l))}Tt.stringArray=a;function o(c,l){return Array.isArray(c)&&c.every(l)}Tt.typedArray=o;function u(c){return c&&i(c.then)}return Tt.thenable=u,Tt}var Ue={},$u={},ku={},rp={},Fy={},me={},o$;function u$(){if(o$)return me;o$=1,Object.defineProperty(me,"__esModule",{value:!0}),me.Message=me.NotificationType9=me.NotificationType8=me.NotificationType7=me.NotificationType6=me.NotificationType5=me.NotificationType4=me.NotificationType3=me.NotificationType2=me.NotificationType1=me.NotificationType0=me.NotificationType=me.RequestType9=me.RequestType8=me.RequestType7=me.RequestType6=me.RequestType5=me.RequestType4=me.RequestType3=me.RequestType2=me.RequestType1=me.RequestType=me.RequestType0=me.AbstractMessageSignature=me.ParameterStructures=me.ResponseError=me.ErrorCodes=void 0;const t=yu();var e;(function($){$.ParseError=-32700,$.InvalidRequest=-32600,$.MethodNotFound=-32601,$.InvalidParams=-32602,$.InternalError=-32603,$.jsonrpcReservedErrorRangeStart=-32099,$.serverErrorStart=-32099,$.MessageWriteError=-32099,$.MessageReadError=-32098,$.PendingResponseRejected=-32097,$.ConnectionInactive=-32096,$.ServerNotInitialized=-32002,$.UnknownErrorCode=-32001,$.jsonrpcReservedErrorRangeEnd=-32e3,$.serverErrorEnd=-32e3})(e||(me.ErrorCodes=e={}));class n extends Error{constructor(T,O,V){super(O),this.code=t.number(T)?T:e.UnknownErrorCode,this.data=V,Object.setPrototypeOf(this,n.prototype)}toJson(){const T={code:this.code,message:this.message};return this.data!==void 0&&(T.data=this.data),T}}me.ResponseError=n;class r{constructor(T){this.kind=T}static is(T){return T===r.auto||T===r.byName||T===r.byPosition}toString(){return this.kind}}me.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(T,O){this.method=T,this.numberOfParams=O}get parameterStructures(){return r.auto}}me.AbstractMessageSignature=i;class s extends i{constructor(T){super(T,0)}}me.RequestType0=s;class a extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.RequestType=a;class o extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.RequestType1=o;class u extends i{constructor(T){super(T,2)}}me.RequestType2=u;class c extends i{constructor(T){super(T,3)}}me.RequestType3=c;class l extends i{constructor(T){super(T,4)}}me.RequestType4=l;class d extends i{constructor(T){super(T,5)}}me.RequestType5=d;class f extends i{constructor(T){super(T,6)}}me.RequestType6=f;class p extends i{constructor(T){super(T,7)}}me.RequestType7=p;class h extends i{constructor(T){super(T,8)}}me.RequestType8=h;class w extends i{constructor(T){super(T,9)}}me.RequestType9=w;class D extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.NotificationType=D;class g extends i{constructor(T){super(T,0)}}me.NotificationType0=g;class v extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.NotificationType1=v;class R extends i{constructor(T){super(T,2)}}me.NotificationType2=R;class k extends i{constructor(T){super(T,3)}}me.NotificationType3=k;class A extends i{constructor(T){super(T,4)}}me.NotificationType4=A;class j extends i{constructor(T){super(T,5)}}me.NotificationType5=j;class W extends i{constructor(T){super(T,6)}}me.NotificationType6=W;class Z extends i{constructor(T){super(T,7)}}me.NotificationType7=Z;class J extends i{constructor(T){super(T,8)}}me.NotificationType8=J;class de extends i{constructor(T){super(T,9)}}me.NotificationType9=de;var N;return function($){function T(M){const H=M;return H&&t.string(H.method)&&(t.string(H.id)||t.number(H.id))}$.isRequest=T;function O(M){const H=M;return H&&t.string(H.method)&&M.id===void 0}$.isNotification=O;function V(M){const H=M;return H&&(H.result!==void 0||!!H.error)&&(t.string(H.id)||t.number(H.id)||H.id===null)}$.isResponse=V}(N||(me.Message=N={})),me}var Wr={},c$;function l$(){if(c$)return Wr;c$=1;var t;Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.LRUCache=Wr.LinkedMap=Wr.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(Wr.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,a=e.None){const o=this._map.get(s);if(o)return a!==e.None&&this.touch(o,a),o.value}set(s,a,o=e.None){let u=this._map.get(s);if(u)u.value=a,o!==e.None&&this.touch(u,o);else{switch(u={key:s,value:a,next:void 0,previous:void 0},o){case e.None:this.addItemLast(u);break;case e.First:this.addItemFirst(u);break;case e.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const a=this._map.get(s);if(a)return this._map.delete(s),this.removeItem(a),this._size--,a.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,a){const o=this._state;let u=this._head;for(;u;){if(a?s.bind(a)(u.value,u.key,this):s(u.value,u.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const u={value:a.key,done:!1};return a=a.next,u}else return{value:void 0,done:!0}}};return o}values(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const u={value:a.value,done:!1};return a=a.next,u}else return{value:void 0,done:!0}}};return o}entries(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const u={value:[a.key,a.value],done:!1};return a=a.next,u}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let a=this._head,o=this.size;for(;a&&o>s;)this._map.delete(a.key),a=a.next,o--;this._head=a,this._size=o,a&&(a.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const a=s.next,o=s.previous;if(!a||!o)throw new Error("Invalid list");a.previous=o,o.next=a}s.next=void 0,s.previous=void 0,this._state++}touch(s,a){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(a!==e.First&&a!==e.Last)){if(a===e.First){if(s===this._head)return;const o=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(o.previous=u,u.next=o),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(a===e.Last){if(s===this._tail)return;const o=s.next,u=s.previous;s===this._head?(o.previous=void 0,this._head=o):(o.previous=u,u.next=o),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((a,o)=>{s.push([o,a])}),s}fromJSON(s){this.clear();for(const[a,o]of s)this.set(a,o)}}Wr.LinkedMap=n;class r extends n{constructor(s,a=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,a),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,a=e.AsNew){return super.get(s,a)}peek(s){return super.get(s,e.None)}set(s,a){return super.set(s,a,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return Wr.LRUCache=r,Wr}var Cu={},d$;function t8(){if(d$)return Cu;d$=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(Cu.Disposable=t={})),Cu}var bs={},f$;function n8(){if(f$)return bs;f$=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.SharedArrayReceiverStrategy=bs.SharedArraySenderStrategy=void 0;const t=Uf();var e;(function(a){a.Continue=0,a.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=e.Continue,this.buffers.set(o.id,u),o.$cancellationData=u}async sendCancellation(o,u){const c=this.buffers.get(u);if(c===void 0)return;const l=new Int32Array(c,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}bs.SharedArraySenderStrategy=n;class r{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new r(o)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(o){const u=o.$cancellationData;return u===void 0?new t.CancellationTokenSource:new i(u)}}return bs.SharedArrayReceiverStrategy=s,bs}var Hr={},Au={},p$;function h$(){if(p$)return Au;p$=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.Semaphore=void 0;const t=ps();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return Au.Semaphore=e,Au}var m$;function r8(){if(m$)return Hr;m$=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.ReadableStreamMessageReader=Hr.AbstractMessageReader=Hr.MessageReader=void 0;const t=ps(),e=yu(),n=ba(),r=h$();var i;(function(u){function c(l){let d=l;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}u.is=c})(i||(Hr.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${e.string(c.message)?c.message:"unknown"}`)}}Hr.AbstractMessageReader=s;var a;(function(u){function c(l){let d,f;const p=new Map;let h;const w=new Map;if(l===void 0||typeof l=="string")d=l??"utf-8";else{if(d=l.charset??"utf-8",l.contentDecoder!==void 0&&(f=l.contentDecoder,p.set(f.name,f)),l.contentDecoders!==void 0)for(const D of l.contentDecoders)p.set(D.name,D);if(l.contentTypeDecoder!==void 0&&(h=l.contentTypeDecoder,w.set(h.name,h)),l.contentTypeDecoders!==void 0)for(const D of l.contentTypeDecoders)w.set(D.name,D)}return h===void 0&&(h=(0,t.default)().applicationJson.decoder,w.set(h.name,h)),{charset:d,contentDecoder:f,contentDecoders:p,contentTypeDecoder:h,contentTypeDecoders:w}}u.fromOptions=c})(a||(a={}));class o extends s{constructor(c,l){super(),this.readable=c,this.options=a.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const l=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),l}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const f=d.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
126
|
-
${JSON.stringify(Object.fromEntries(d))}`));return}const p=parseInt(f);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=p}const l=this.buffer.tryReadBody(this.nextMessageLength);if(l===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}catch(l){this.fireError(l)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,l)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:l}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return Hr.ReadableStreamMessageReader=o,Hr}var Vr={},g$;function i8(){if(g$)return Vr;g$=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.WriteableStreamMessageWriter=Vr.AbstractMessageWriter=Vr.MessageWriter=void 0;const t=ps(),e=yu(),n=h$(),r=ba(),i="Content-Length: ",s=`\r
|
|
127
|
-
`;var a;(function(l){function d(f){let p=f;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=d})(a||(Vr.MessageWriter=a={}));class o{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,f,p){this.errorEmitter.fire([this.asError(d),f,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}Vr.AbstractMessageWriter=o;var u;(function(l){function d(f){return f===void 0||typeof f=="string"?{charset:f??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:f.charset??"utf-8",contentEncoder:f.contentEncoder,contentTypeEncoder:f.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=d})(u||(u={}));class c extends o{constructor(d,f){super(),this.writable=d,this.options=u.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{const h=[];return h.push(i,p.byteLength.toString(),s),h.push(s),this.doWrite(d,h,p)},p=>{throw this.fireError(p),p}))}async doWrite(d,f,p){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(p)}catch(h){return this.handleError(h,d),Promise.reject(h)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return Vr.WriteableStreamMessageWriter=c,Vr}var _u={},y$;function s8(){if(y$)return _u;y$=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
|
|
128
|
-
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const a=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(a),this._totalLength+=a.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let a=0,o=0,u=0,c=0;e:for(;o<this._chunks.length;){const p=this._chunks[o];for(u=0;u<p.length;){switch(p[u]){case t:switch(a){case 0:a=1;break;case 2:a=3;break;default:a=0}break;case e:switch(a){case 1:a=2;break;case 3:a=4,u++;break e;default:a=0}break;default:a=0}u++}c+=p.byteLength,o++}if(a!==4)return;const l=this._read(c+u),d=new Map,f=this.toString(l,"ascii").split(n);if(f.length<2)return d;for(let p=0;p<f.length-2;p++){const h=f[p],w=h.indexOf(":");if(w===-1)throw new Error(`Message header must separate key and value using ':'
|
|
129
|
-
${h}`);const D=h.substr(0,w),g=h.substr(w+1).trim();d.set(s?D.toLowerCase():D,g)}return d}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(c)}if(this._chunks[0].byteLength>s){const c=this._chunks[0],l=this.asNative(c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,l}const a=this.allocNative(s);let o=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const l=c.slice(0,s);a.set(l,o),o+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else a.set(c,o),o+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return a}}return _u.AbstractMessageBuffer=r,_u}var Ly={},w$;function a8(){return w$||(w$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=ps(),n=yu(),r=u$(),i=l$(),s=ba(),a=Uf();var o;(function(T){T.type=new r.NotificationType("$/cancelRequest")})(o||(o={}));var u;(function(T){function O(V){return typeof V=="string"||typeof V=="number"}T.is=O})(u||(t.ProgressToken=u={}));var c;(function(T){T.type=new r.NotificationType("$/progress")})(c||(c={}));class l{constructor(){}}t.ProgressType=l;var d;(function(T){function O(V){return n.func(V)}T.is=O})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function(T){T[T.Off=0]="Off",T[T.Messages=1]="Messages",T[T.Compact=2]="Compact",T[T.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(T){T.Off="off",T.Messages="messages",T.Compact="compact",T.Verbose="verbose"})(p||(t.TraceValues=p={})),function(T){function O(M){if(!n.string(M))return T.Off;switch(M=M.toLowerCase(),M){case"off":return T.Off;case"messages":return T.Messages;case"compact":return T.Compact;case"verbose":return T.Verbose;default:return T.Off}}T.fromString=O;function V(M){switch(M){case T.Off:return"off";case T.Messages:return"messages";case T.Compact:return"compact";case T.Verbose:return"verbose";default:return"off"}}T.toString=V}(f||(t.Trace=f={}));var h;(function(T){T.Text="text",T.JSON="json"})(h||(t.TraceFormat=h={})),function(T){function O(V){return n.string(V)?(V=V.toLowerCase(),V==="json"?T.JSON:T.Text):T.Text}T.fromString=O}(h||(t.TraceFormat=h={}));var w;(function(T){T.type=new r.NotificationType("$/setTrace")})(w||(t.SetTraceNotification=w={}));var D;(function(T){T.type=new r.NotificationType("$/logTrace")})(D||(t.LogTraceNotification=D={}));var g;(function(T){T[T.Closed=1]="Closed",T[T.Disposed=2]="Disposed",T[T.AlreadyListening=3]="AlreadyListening"})(g||(t.ConnectionErrors=g={}));class v extends Error{constructor(O,V){super(V),this.code=O,Object.setPrototypeOf(this,v.prototype)}}t.ConnectionError=v;var R;(function(T){function O(V){const M=V;return M&&n.func(M.cancelUndispatched)}T.is=O})(R||(t.ConnectionStrategy=R={}));var k;(function(T){function O(V){const M=V;return M&&(M.kind===void 0||M.kind==="id")&&n.func(M.createCancellationTokenSource)&&(M.dispose===void 0||n.func(M.dispose))}T.is=O})(k||(t.IdCancellationReceiverStrategy=k={}));var A;(function(T){function O(V){const M=V;return M&&M.kind==="request"&&n.func(M.createCancellationTokenSource)&&(M.dispose===void 0||n.func(M.dispose))}T.is=O})(A||(t.RequestCancellationReceiverStrategy=A={}));var j;(function(T){T.Message=Object.freeze({createCancellationTokenSource(V){return new a.CancellationTokenSource}});function O(V){return k.is(V)||A.is(V)}T.is=O})(j||(t.CancellationReceiverStrategy=j={}));var W;(function(T){T.Message=Object.freeze({sendCancellation(V,M){return V.sendNotification(o.type,{id:M})},cleanup(V){}});function O(V){const M=V;return M&&n.func(M.sendCancellation)&&n.func(M.cleanup)}T.is=O})(W||(t.CancellationSenderStrategy=W={}));var Z;(function(T){T.Message=Object.freeze({receiver:j.Message,sender:W.Message});function O(V){const M=V;return M&&j.is(M.receiver)&&W.is(M.sender)}T.is=O})(Z||(t.CancellationStrategy=Z={}));var J;(function(T){function O(V){const M=V;return M&&n.func(M.handleMessage)}T.is=O})(J||(t.MessageStrategy=J={}));var de;(function(T){function O(V){const M=V;return M&&(Z.is(M.cancellationStrategy)||R.is(M.connectionStrategy)||J.is(M.messageStrategy))}T.is=O})(de||(t.ConnectionOptions=de={}));var N;(function(T){T[T.New=1]="New",T[T.Listening=2]="Listening",T[T.Closed=3]="Closed",T[T.Disposed=4]="Disposed"})(N||(N={}));function $(T,O,V,M){const H=V!==void 0?V:t.NullLogger;let be=0,te=0,C=0;const pe="2.0";let Qe;const ct=new Map;let U;const K=new Map,_e=new Map;let se,we=new i.LinkedMap,Te=new Map,oe=new Set,I=new Map,B=f.Off,ce=h.Text,z,ue=N.New;const Le=new s.Emitter,Ke=new s.Emitter,ie=new s.Emitter,ke=new s.Emitter,ne=new s.Emitter,ve=M&&M.cancellationStrategy?M.cancellationStrategy:Z.Message;function Ne(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function lt(E){return E===null?"res-unknown-"+(++C).toString():"res-"+E.toString()}function Ge(){return"not-"+(++te).toString()}function Ot(E,q){r.Message.isRequest(q)?E.set(Ne(q.id),q):r.Message.isResponse(q)?E.set(lt(q.id),q):E.set(Ge(),q)}function Bt(E){}function nn(){return ue===N.Listening}function Y(){return ue===N.Closed}function X(){return ue===N.Disposed}function le(){(ue===N.New||ue===N.Listening)&&(ue=N.Closed,Ke.fire(void 0))}function zt(E){Le.fire([E,void 0,void 0])}function Ft(E){Le.fire(E)}T.onClose(le),T.onError(zt),O.onClose(le),O.onError(Ft);function cr(){se||we.size===0||(se=(0,e.default)().timer.setImmediate(()=>{se=void 0,Ui()}))}function ai(E){r.Message.isRequest(E)?Wi(E):r.Message.isNotification(E)?oi(E):r.Message.isResponse(E)?Hi(E):ui(E)}function Ui(){if(we.size===0)return;const E=we.shift();try{const q=M?.messageStrategy;J.is(q)?q.handleMessage(E,ai):ai(E)}finally{cr()}}const Gi=E=>{try{if(r.Message.isNotification(E)&&E.method===o.type.method){const q=E.params.id,ee=Ne(q),re=we.get(ee);if(r.Message.isRequest(re)){const Pe=M?.connectionStrategy,We=Pe&&Pe.cancelUndispatched?Pe.cancelUndispatched(re,Bt):void 0;if(We&&(We.error!==void 0||We.result!==void 0)){we.delete(ee),I.delete(q),We.id=re.id,lr(We,E.method,Date.now()),O.write(We).catch(()=>H.error("Sending response for canceled message failed."));return}}const Oe=I.get(q);if(Oe!==void 0){Oe.cancel(),_r(E);return}else oe.add(q)}Ot(we,E)}finally{cr()}};function Wi(E){if(X())return;function q(Ce,Ze,He){const It={jsonrpc:pe,id:E.id};Ce instanceof r.ResponseError?It.error=Ce.toJson():It.result=Ce===void 0?null:Ce,lr(It,Ze,He),O.write(It).catch(()=>H.error("Sending response failed."))}function ee(Ce,Ze,He){const It={jsonrpc:pe,id:E.id,error:Ce.toJson()};lr(It,Ze,He),O.write(It).catch(()=>H.error("Sending response failed."))}function re(Ce,Ze,He){Ce===void 0&&(Ce=null);const It={jsonrpc:pe,id:E.id,result:Ce};lr(It,Ze,He),O.write(It).catch(()=>H.error("Sending response failed."))}Yi(E);const Oe=ct.get(E.method);let Pe,We;Oe&&(Pe=Oe.type,We=Oe.handler);const he=Date.now();if(We||Qe){const Ce=E.id??String(Date.now()),Ze=k.is(ve.receiver)?ve.receiver.createCancellationTokenSource(Ce):ve.receiver.createCancellationTokenSource(E);E.id!==null&&oe.has(E.id)&&Ze.cancel(),E.id!==null&&I.set(Ce,Ze);try{let He;if(We)if(E.params===void 0){if(Pe!==void 0&&Pe.numberOfParams!==0){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines ${Pe.numberOfParams} params but received none.`),E.method,he);return}He=We(Ze.token)}else if(Array.isArray(E.params)){if(Pe!==void 0&&Pe.parameterStructures===r.ParameterStructures.byName){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,he);return}He=We(...E.params,Ze.token)}else{if(Pe!==void 0&&Pe.parameterStructures===r.ParameterStructures.byPosition){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,he);return}He=We(E.params,Ze.token)}else Qe&&(He=Qe(E.method,E.params,Ze.token));const It=He;He?It.then?It.then(rn=>{I.delete(Ce),q(rn,E.method,he)},rn=>{I.delete(Ce),rn instanceof r.ResponseError?ee(rn,E.method,he):rn&&n.string(rn.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${rn.message}`),E.method,he):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,he)}):(I.delete(Ce),q(He,E.method,he)):(I.delete(Ce),re(He,E.method,he))}catch(He){I.delete(Ce),He instanceof r.ResponseError?q(He,E.method,he):He&&n.string(He.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${He.message}`),E.method,he):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,he)}}else ee(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,he)}function Hi(E){if(!X())if(E.id===null)E.error?H.error(`Received response message without id: Error is:
|
|
130
|
-
${JSON.stringify(E.error,void 0,4)}`):H.error("Received response message without id. No further error information provided.");else{const q=E.id,ee=Te.get(q);if(Xi(E,ee),ee!==void 0){Te.delete(q);try{if(E.error){const re=E.error;ee.reject(new r.ResponseError(re.code,re.message,re.data))}else if(E.result!==void 0)ee.resolve(E.result);else throw new Error("Should never happen.")}catch(re){re.message?H.error(`Response handler '${ee.method}' failed with message: ${re.message}`):H.error(`Response handler '${ee.method}' failed unexpectedly.`)}}}}function oi(E){if(X())return;let q,ee;if(E.method===o.type.method){const re=E.params.id;oe.delete(re),_r(E);return}else{const re=K.get(E.method);re&&(ee=re.handler,q=re.type)}if(ee||U)try{if(_r(E),ee)if(E.params===void 0)q!==void 0&&q.numberOfParams!==0&&q.parameterStructures!==r.ParameterStructures.byName&&H.error(`Notification ${E.method} defines ${q.numberOfParams} params but received none.`),ee();else if(Array.isArray(E.params)){const re=E.params;E.method===c.type.method&&re.length===2&&u.is(re[0])?ee({token:re[0],value:re[1]}):(q!==void 0&&(q.parameterStructures===r.ParameterStructures.byName&&H.error(`Notification ${E.method} defines parameters by name but received parameters by position`),q.numberOfParams!==E.params.length&&H.error(`Notification ${E.method} defines ${q.numberOfParams} params but received ${re.length} arguments`)),ee(...re))}else q!==void 0&&q.parameterStructures===r.ParameterStructures.byPosition&&H.error(`Notification ${E.method} defines parameters by position but received parameters by name`),ee(E.params);else U&&U(E.method,E.params)}catch(re){re.message?H.error(`Notification handler '${E.method}' failed with message: ${re.message}`):H.error(`Notification handler '${E.method}' failed unexpectedly.`)}else ie.fire(E)}function ui(E){if(!E){H.error("Received empty message.");return}H.error(`Received message which is neither a response nor a notification message:
|
|
131
|
-
${JSON.stringify(E,null,4)}`);const q=E;if(n.string(q.id)||n.number(q.id)){const ee=q.id,re=Te.get(ee);re&&re.reject(new Error("The received response has neither a result nor an error property."))}}function yn(E){if(E!=null)switch(B){case f.Verbose:return JSON.stringify(E,null,4);case f.Compact:return JSON.stringify(E);default:return}}function Vi(E){if(!(B===f.Off||!z))if(ce===h.Text){let q;(B===f.Verbose||B===f.Compact)&&E.params&&(q=`Params: ${yn(E.params)}
|
|
132
|
-
|
|
133
|
-
`),z.log(`Sending request '${E.method} - (${E.id})'.`,q)}else Ln("send-request",E)}function Ki(E){if(!(B===f.Off||!z))if(ce===h.Text){let q;(B===f.Verbose||B===f.Compact)&&(E.params?q=`Params: ${yn(E.params)}
|
|
134
|
-
|
|
135
|
-
`:q=`No parameters provided.
|
|
136
|
-
|
|
137
|
-
`),z.log(`Sending notification '${E.method}'.`,q)}else Ln("send-notification",E)}function lr(E,q,ee){if(!(B===f.Off||!z))if(ce===h.Text){let re;(B===f.Verbose||B===f.Compact)&&(E.error&&E.error.data?re=`Error data: ${yn(E.error.data)}
|
|
138
|
-
|
|
139
|
-
`:E.result?re=`Result: ${yn(E.result)}
|
|
140
|
-
|
|
141
|
-
`:E.error===void 0&&(re=`No result returned.
|
|
142
|
-
|
|
143
|
-
`)),z.log(`Sending response '${q} - (${E.id})'. Processing request took ${Date.now()-ee}ms`,re)}else Ln("send-response",E)}function Yi(E){if(!(B===f.Off||!z))if(ce===h.Text){let q;(B===f.Verbose||B===f.Compact)&&E.params&&(q=`Params: ${yn(E.params)}
|
|
144
|
-
|
|
145
|
-
`),z.log(`Received request '${E.method} - (${E.id})'.`,q)}else Ln("receive-request",E)}function _r(E){if(!(B===f.Off||!z||E.method===D.type.method))if(ce===h.Text){let q;(B===f.Verbose||B===f.Compact)&&(E.params?q=`Params: ${yn(E.params)}
|
|
146
|
-
|
|
147
|
-
`:q=`No parameters provided.
|
|
148
|
-
|
|
149
|
-
`),z.log(`Received notification '${E.method}'.`,q)}else Ln("receive-notification",E)}function Xi(E,q){if(!(B===f.Off||!z))if(ce===h.Text){let ee;if((B===f.Verbose||B===f.Compact)&&(E.error&&E.error.data?ee=`Error data: ${yn(E.error.data)}
|
|
150
|
-
|
|
151
|
-
`:E.result?ee=`Result: ${yn(E.result)}
|
|
152
|
-
|
|
153
|
-
`:E.error===void 0&&(ee=`No result returned.
|
|
154
|
-
|
|
155
|
-
`)),q){const re=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";z.log(`Received response '${q.method} - (${E.id})' in ${Date.now()-q.timerStart}ms.${re}`,ee)}else z.log(`Received response ${E.id} without active response promise.`,ee)}else Ln("receive-response",E)}function Ln(E,q){if(!z||B===f.Off)return;const ee={isLSPMessage:!0,type:E,message:q,timestamp:Date.now()};z.log(ee)}function Vn(){if(Y())throw new v(g.Closed,"Connection is closed.");if(X())throw new v(g.Disposed,"Connection is disposed.")}function Qs(){if(nn())throw new v(g.AlreadyListening,"Connection is already listening")}function F(){if(!nn())throw new Error("Call listen() first.")}function b(E){return E===void 0?null:E}function _(E){if(E!==null)return E}function m(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function S(E,q){switch(E){case r.ParameterStructures.auto:return m(q)?_(q):[b(q)];case r.ParameterStructures.byName:if(!m(q))throw new Error("Received parameters by name but param is not an object literal.");return _(q);case r.ParameterStructures.byPosition:return[b(q)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function y(E,q){let ee;const re=E.numberOfParams;switch(re){case 0:ee=void 0;break;case 1:ee=S(E.parameterStructures,q[0]);break;default:ee=[];for(let Oe=0;Oe<q.length&&Oe<re;Oe++)ee.push(b(q[Oe]));if(q.length<re)for(let Oe=q.length;Oe<re;Oe++)ee.push(null);break}return ee}const P={sendNotification:(E,...q)=>{Vn();let ee,re;if(n.string(E)){ee=E;const Pe=q[0];let We=0,he=r.ParameterStructures.auto;r.ParameterStructures.is(Pe)&&(We=1,he=Pe);let Ce=q.length;const Ze=Ce-We;switch(Ze){case 0:re=void 0;break;case 1:re=S(he,q[We]);break;default:if(he===r.ParameterStructures.byName)throw new Error(`Received ${Ze} parameters for 'by Name' notification parameter structure.`);re=q.slice(We,Ce).map(He=>b(He));break}}else{const Pe=q;ee=E.method,re=y(E,Pe)}const Oe={jsonrpc:pe,method:ee,params:re};return Ki(Oe),O.write(Oe).catch(Pe=>{throw H.error("Sending notification failed."),Pe})},onNotification:(E,q)=>{Vn();let ee;return n.func(E)?U=E:q&&(n.string(E)?(ee=E,K.set(E,{type:void 0,handler:q})):(ee=E.method,K.set(E.method,{type:E,handler:q}))),{dispose:()=>{ee!==void 0?K.delete(ee):U=void 0}}},onProgress:(E,q,ee)=>{if(_e.has(q))throw new Error(`Progress handler for token ${q} already registered`);return _e.set(q,ee),{dispose:()=>{_e.delete(q)}}},sendProgress:(E,q,ee)=>P.sendNotification(c.type,{token:q,value:ee}),onUnhandledProgress:ke.event,sendRequest:(E,...q)=>{Vn(),F();let ee,re,Oe;if(n.string(E)){ee=E;const Ce=q[0],Ze=q[q.length-1];let He=0,It=r.ParameterStructures.auto;r.ParameterStructures.is(Ce)&&(He=1,It=Ce);let rn=q.length;a.CancellationToken.is(Ze)&&(rn=rn-1,Oe=Ze);const dr=rn-He;switch(dr){case 0:re=void 0;break;case 1:re=S(It,q[He]);break;default:if(It===r.ParameterStructures.byName)throw new Error(`Received ${dr} parameters for 'by Name' request parameter structure.`);re=q.slice(He,rn).map(_1=>b(_1));break}}else{const Ce=q;ee=E.method,re=y(E,Ce);const Ze=E.numberOfParams;Oe=a.CancellationToken.is(Ce[Ze])?Ce[Ze]:void 0}const Pe=be++;let We;Oe&&(We=Oe.onCancellationRequested(()=>{const Ce=ve.sender.sendCancellation(P,Pe);return Ce===void 0?(H.log(`Received no promise from cancellation strategy when cancelling id ${Pe}`),Promise.resolve()):Ce.catch(()=>{H.log(`Sending cancellation messages for id ${Pe} failed`)})}));const he={jsonrpc:pe,id:Pe,method:ee,params:re};return Vi(he),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(he),new Promise(async(Ce,Ze)=>{const He=dr=>{Ce(dr),ve.sender.cleanup(Pe),We?.dispose()},It=dr=>{Ze(dr),ve.sender.cleanup(Pe),We?.dispose()},rn={method:ee,timerStart:Date.now(),resolve:He,reject:It};try{await O.write(he),Te.set(Pe,rn)}catch(dr){throw H.error("Sending request failed."),rn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,dr.message?dr.message:"Unknown reason")),dr}})},onRequest:(E,q)=>{Vn();let ee=null;return d.is(E)?(ee=void 0,Qe=E):n.string(E)?(ee=null,q!==void 0&&(ee=E,ct.set(E,{handler:q,type:void 0}))):q!==void 0&&(ee=E.method,ct.set(E.method,{type:E,handler:q})),{dispose:()=>{ee!==null&&(ee!==void 0?ct.delete(ee):Qe=void 0)}}},hasPendingResponse:()=>Te.size>0,trace:async(E,q,ee)=>{let re=!1,Oe=h.Text;ee!==void 0&&(n.boolean(ee)?re=ee:(re=ee.sendNotification||!1,Oe=ee.traceFormat||h.Text)),B=E,ce=Oe,B===f.Off?z=void 0:z=q,re&&!Y()&&!X()&&await P.sendNotification(w.type,{value:f.toString(E)})},onError:Le.event,onClose:Ke.event,onUnhandledNotification:ie.event,onDispose:ne.event,end:()=>{O.end()},dispose:()=>{if(X())return;ue=N.Disposed,ne.fire(void 0);const E=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const q of Te.values())q.reject(E);Te=new Map,I=new Map,oe=new Set,we=new i.LinkedMap,n.func(O.dispose)&&O.dispose(),n.func(T.dispose)&&T.dispose()},listen:()=>{Vn(),Qs(),ue=N.Listening,T.listen(Gi)},inspect:()=>{(0,e.default)().console.log("inspect")}};return P.onNotification(D.type,E=>{if(B===f.Off||!z)return;const q=B===f.Verbose||B===f.Compact;z.log(E.message,q?E.verbose:void 0)}),P.onNotification(c.type,E=>{const q=_e.get(E.token);q?q(E.value):ke.fire(E)}),P}t.createMessageConnection=$}(Ly)),Ly}var v$;function My(){return v$||(v$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=u$();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=l$();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=t8();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=ba();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Uf();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=n8();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const o=r8();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const u=i8();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const c=s8();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const l=a8();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return l.MessageStrategy}});const d=ps();t.RAL=d.default}(Fy)),Fy}var b$;function o8(){if(b$)return rp;b$=1,Object.defineProperty(rp,"__esModule",{value:!0});const t=U1,e=My();class n extends e.AbstractMessageBuffer{constructor(u="utf-8"){super(u)}emptyBuffer(){return n.emptyBuffer}fromString(u,c){return Buffer.from(u,c)}toString(u,c){return u instanceof Buffer?u.toString(c):new t.TextDecoder(c).decode(u)}asNative(u,c){return c===void 0?u instanceof Buffer?u:Buffer.from(u):u instanceof Buffer?u.slice(0,c):Buffer.from(u,0,c)}allocNative(u){return Buffer.allocUnsafe(u)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(u){this.stream=u}onClose(u){return this.stream.on("close",u),e.Disposable.create(()=>this.stream.off("close",u))}onError(u){return this.stream.on("error",u),e.Disposable.create(()=>this.stream.off("error",u))}onEnd(u){return this.stream.on("end",u),e.Disposable.create(()=>this.stream.off("end",u))}onData(u){return this.stream.on("data",u),e.Disposable.create(()=>this.stream.off("data",u))}}class i{constructor(u){this.stream=u}onClose(u){return this.stream.on("close",u),e.Disposable.create(()=>this.stream.off("close",u))}onError(u){return this.stream.on("error",u),e.Disposable.create(()=>this.stream.off("error",u))}onEnd(u){return this.stream.on("end",u),e.Disposable.create(()=>this.stream.off("end",u))}write(u,c){return new Promise((l,d)=>{const f=p=>{p==null?l():d(p)};typeof u=="string"?this.stream.write(u,c,f):this.stream.write(u,f)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:o=>new n(o)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(o,u)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(o,void 0,0),u.charset))}catch(c){return Promise.reject(c)}}}),decoder:Object.freeze({name:"application/json",decode:(o,u)=>{try{return o instanceof Buffer?Promise.resolve(JSON.parse(o.toString(u.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(u.charset).decode(o)))}catch(c){return Promise.reject(c)}}})}),stream:Object.freeze({asReadableStream:o=>new r(o),asWritableStream:o=>new i(o)}),console,timer:Object.freeze({setTimeout(o,u,...c){const l=setTimeout(o,u,...c);return{dispose:()=>clearTimeout(l)}},setImmediate(o,...u){const c=setImmediate(o,...u);return{dispose:()=>clearImmediate(c)}},setInterval(o,u,...c){const l=setInterval(o,u,...c);return{dispose:()=>clearInterval(l)}}})});function a(){return s}return function(o){function u(){e.RAL.install(s)}o.install=u}(a),rp.default=a,rp}var D$;function Ds(){return D$||(D$=1,function(t){var e=ku.__createBinding||(Object.create?function(N,$,T,O){O===void 0&&(O=T);var V=Object.getOwnPropertyDescriptor($,T);(!V||("get"in V?!$.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return $[T]}}),Object.defineProperty(N,O,V)}:function(N,$,T,O){O===void 0&&(O=T),N[O]=$[T]}),n=ku.__exportStar||function(N,$){for(var T in N)T!=="default"&&!Object.prototype.hasOwnProperty.call($,T)&&e($,N,T)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const r=o8();r.default.install();const i=fr,s=G1,a=W1,o=H1,u=My();n(My(),t);class c extends u.AbstractMessageReader{constructor($){super(),this.process=$;let T=this.process;T.on("error",O=>this.fireError(O)),T.on("close",()=>this.fireClose())}listen($){return this.process.on("message",$),u.Disposable.create(()=>this.process.off("message",$))}}t.IPCMessageReader=c;class l extends u.AbstractMessageWriter{constructor($){super(),this.process=$,this.errorCount=0;const T=this.process;T.on("error",O=>this.fireError(O)),T.on("close",()=>this.fireClose)}write($){try{return typeof this.process.send=="function"&&this.process.send($,void 0,void 0,T=>{T?(this.errorCount++,this.handleError(T,$)):this.errorCount=0}),Promise.resolve()}catch(T){return this.handleError(T,$),Promise.reject(T)}}handleError($,T){this.errorCount++,this.fireError($,T,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends u.AbstractMessageReader{constructor($){super(),this.onData=new u.Emitter,$.on("close",()=>this.fireClose),$.on("error",T=>this.fireError(T)),$.on("message",T=>{this.onData.fire(T)})}listen($){return this.onData.event($)}}t.PortMessageReader=d;class f extends u.AbstractMessageWriter{constructor($){super(),this.port=$,this.errorCount=0,$.on("close",()=>this.fireClose()),$.on("error",T=>this.fireError(T))}write($){try{return this.port.postMessage($),Promise.resolve()}catch(T){return this.handleError(T,$),Promise.reject(T)}}handleError($,T){this.errorCount++,this.fireError($,T,this.errorCount)}end(){}}t.PortMessageWriter=f;class p extends u.ReadableStreamMessageReader{constructor($,T="utf-8"){super((0,r.default)().stream.asReadableStream($),T)}}t.SocketMessageReader=p;class h extends u.WriteableStreamMessageWriter{constructor($,T){super((0,r.default)().stream.asWritableStream($),T),this.socket=$}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=h;class w extends u.ReadableStreamMessageReader{constructor($,T){super((0,r.default)().stream.asReadableStream($),T)}}t.StreamMessageReader=w;class D extends u.WriteableStreamMessageWriter{constructor($,T){super((0,r.default)().stream.asWritableStream($),T)}}t.StreamMessageWriter=D;const g=process.env.XDG_RUNTIME_DIR,v=new Map([["linux",107],["darwin",103]]);function R(){const N=(0,a.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${N}-sock`;let $;g?$=i.join(g,`vscode-ipc-${N}.sock`):$=i.join(s.tmpdir(),`vscode-${N}.sock`);const T=v.get(process.platform);return T!==void 0&&$.length>T&&(0,r.default)().console.warn(`WARNING: IPC handle "${$}" is longer than ${T} characters.`),$}t.generateRandomPipeName=R;function k(N,$="utf-8"){let T;const O=new Promise((V,M)=>{T=V});return new Promise((V,M)=>{let H=(0,o.createServer)(be=>{H.close(),T([new p(be,$),new h(be,$)])});H.on("error",M),H.listen(N,()=>{H.removeListener("error",M),V({onConnected:()=>O})})})}t.createClientPipeTransport=k;function A(N,$="utf-8"){const T=(0,o.createConnection)(N);return[new p(T,$),new h(T,$)]}t.createServerPipeTransport=A;function j(N,$="utf-8"){let T;const O=new Promise((V,M)=>{T=V});return new Promise((V,M)=>{const H=(0,o.createServer)(be=>{H.close(),T([new p(be,$),new h(be,$)])});H.on("error",M),H.listen(N,"127.0.0.1",()=>{H.removeListener("error",M),V({onConnected:()=>O})})})}t.createClientSocketTransport=j;function W(N,$="utf-8"){const T=(0,o.createConnection)(N,"127.0.0.1");return[new p(T,$),new h(T,$)]}t.createServerSocketTransport=W;function Z(N){const $=N;return $.read!==void 0&&$.addListener!==void 0}function J(N){const $=N;return $.write!==void 0&&$.addListener!==void 0}function de(N,$,T,O){T||(T=u.NullLogger);const V=Z(N)?new w(N):N,M=J($)?new D($):$;return u.ConnectionStrategy.is(O)&&(O={connectionStrategy:O}),(0,u.createMessageConnection)(V,M,T,O)}t.createMessageConnection=de}(ku)),ku}var By,E$;function R$(){return E$||(E$=1,By=Ds()),By}var Pu={};function u8(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ip={exports:{}},T$;function zy(){return T$||(T$=1,function(t,e){(function(n){{var r=n(u8,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=r.InlineCompletionContext=r.SelectedCompletionInfo=r.InlineCompletionTriggerKind=r.InlineCompletionList=r.InlineCompletionItem=r.StringValue=r.InlayHint=r.InlayHintLabelPart=r.InlayHintKind=r.InlineValueContext=r.InlineValueEvaluatableExpression=r.InlineValueVariableLookup=r.InlineValueText=r.SemanticTokens=r.SemanticTokenModifiers=r.SemanticTokenTypes=r.SelectionRange=r.DocumentLink=r.FormattingOptions=r.CodeLens=r.CodeAction=r.CodeActionContext=r.CodeActionTriggerKind=r.CodeActionKind=r.DocumentSymbol=r.WorkspaceSymbol=r.SymbolInformation=r.SymbolTag=r.SymbolKind=r.DocumentHighlight=r.DocumentHighlightKind=r.SignatureInformation=r.ParameterInformation=r.Hover=r.MarkedString=r.CompletionList=r.CompletionItem=r.CompletionItemLabelDetails=r.InsertTextMode=r.InsertReplaceEdit=r.CompletionItemTag=r.InsertTextFormat=r.CompletionItemKind=r.MarkupContent=r.MarkupKind=r.TextDocumentItem=r.OptionalVersionedTextDocumentIdentifier=r.VersionedTextDocumentIdentifier=r.TextDocumentIdentifier=r.WorkspaceChange=r.WorkspaceEdit=r.DeleteFile=r.RenameFile=r.CreateFile=r.TextDocumentEdit=r.AnnotatedTextEdit=r.ChangeAnnotationIdentifier=r.ChangeAnnotation=r.TextEdit=r.Command=r.Diagnostic=r.CodeDescription=r.DiagnosticTag=r.DiagnosticSeverity=r.DiagnosticRelatedInformation=r.FoldingRange=r.FoldingRangeKind=r.ColorPresentation=r.ColorInformation=r.Color=r.LocationLink=r.Location=r.Range=r.Position=r.uinteger=r.integer=r.URI=r.DocumentUri=void 0;var i;(function(b){function _(m){return typeof m=="string"}b.is=_})(i||(r.DocumentUri=i={}));var s;(function(b){function _(m){return typeof m=="string"}b.is=_})(s||(r.URI=s={}));var a;(function(b){b.MIN_VALUE=-2147483648,b.MAX_VALUE=2147483647;function _(m){return typeof m=="number"&&b.MIN_VALUE<=m&&m<=b.MAX_VALUE}b.is=_})(a||(r.integer=a={}));var o;(function(b){b.MIN_VALUE=0,b.MAX_VALUE=2147483647;function _(m){return typeof m=="number"&&b.MIN_VALUE<=m&&m<=b.MAX_VALUE}b.is=_})(o||(r.uinteger=o={}));var u;(function(b){function _(S,y){return S===Number.MAX_VALUE&&(S=o.MAX_VALUE),y===Number.MAX_VALUE&&(y=o.MAX_VALUE),{line:S,character:y}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&F.uinteger(y.line)&&F.uinteger(y.character)}b.is=m})(u||(r.Position=u={}));var c;(function(b){function _(S,y,P,E){if(F.uinteger(S)&&F.uinteger(y)&&F.uinteger(P)&&F.uinteger(E))return{start:u.create(S,y),end:u.create(P,E)};if(u.is(S)&&u.is(y))return{start:S,end:y};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(y,", ").concat(P,", ").concat(E,"]"))}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&u.is(y.start)&&u.is(y.end)}b.is=m})(c||(r.Range=c={}));var l;(function(b){function _(S,y){return{uri:S,range:y}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&c.is(y.range)&&(F.string(y.uri)||F.undefined(y.uri))}b.is=m})(l||(r.Location=l={}));var d;(function(b){function _(S,y,P,E){return{targetUri:S,targetRange:y,targetSelectionRange:P,originSelectionRange:E}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&c.is(y.targetRange)&&F.string(y.targetUri)&&c.is(y.targetSelectionRange)&&(c.is(y.originSelectionRange)||F.undefined(y.originSelectionRange))}b.is=m})(d||(r.LocationLink=d={}));var f;(function(b){function _(S,y,P,E){return{red:S,green:y,blue:P,alpha:E}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&F.numberRange(y.red,0,1)&&F.numberRange(y.green,0,1)&&F.numberRange(y.blue,0,1)&&F.numberRange(y.alpha,0,1)}b.is=m})(f||(r.Color=f={}));var p;(function(b){function _(S,y){return{range:S,color:y}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&c.is(y.range)&&f.is(y.color)}b.is=m})(p||(r.ColorInformation=p={}));var h;(function(b){function _(S,y,P){return{label:S,textEdit:y,additionalTextEdits:P}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&F.string(y.label)&&(F.undefined(y.textEdit)||W.is(y))&&(F.undefined(y.additionalTextEdits)||F.typedArray(y.additionalTextEdits,W.is))}b.is=m})(h||(r.ColorPresentation=h={}));var w;(function(b){b.Comment="comment",b.Imports="imports",b.Region="region"})(w||(r.FoldingRangeKind=w={}));var D;(function(b){function _(S,y,P,E,q,ee){var re={startLine:S,endLine:y};return F.defined(P)&&(re.startCharacter=P),F.defined(E)&&(re.endCharacter=E),F.defined(q)&&(re.kind=q),F.defined(ee)&&(re.collapsedText=ee),re}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&F.uinteger(y.startLine)&&F.uinteger(y.startLine)&&(F.undefined(y.startCharacter)||F.uinteger(y.startCharacter))&&(F.undefined(y.endCharacter)||F.uinteger(y.endCharacter))&&(F.undefined(y.kind)||F.string(y.kind))}b.is=m})(D||(r.FoldingRange=D={}));var g;(function(b){function _(S,y){return{location:S,message:y}}b.create=_;function m(S){var y=S;return F.defined(y)&&l.is(y.location)&&F.string(y.message)}b.is=m})(g||(r.DiagnosticRelatedInformation=g={}));var v;(function(b){b.Error=1,b.Warning=2,b.Information=3,b.Hint=4})(v||(r.DiagnosticSeverity=v={}));var R;(function(b){b.Unnecessary=1,b.Deprecated=2})(R||(r.DiagnosticTag=R={}));var k;(function(b){function _(m){var S=m;return F.objectLiteral(S)&&F.string(S.href)}b.is=_})(k||(r.CodeDescription=k={}));var A;(function(b){function _(S,y,P,E,q,ee){var re={range:S,message:y};return F.defined(P)&&(re.severity=P),F.defined(E)&&(re.code=E),F.defined(q)&&(re.source=q),F.defined(ee)&&(re.relatedInformation=ee),re}b.create=_;function m(S){var y,P=S;return F.defined(P)&&c.is(P.range)&&F.string(P.message)&&(F.number(P.severity)||F.undefined(P.severity))&&(F.integer(P.code)||F.string(P.code)||F.undefined(P.code))&&(F.undefined(P.codeDescription)||F.string((y=P.codeDescription)===null||y===void 0?void 0:y.href))&&(F.string(P.source)||F.undefined(P.source))&&(F.undefined(P.relatedInformation)||F.typedArray(P.relatedInformation,g.is))}b.is=m})(A||(r.Diagnostic=A={}));var j;(function(b){function _(S,y){for(var P=[],E=2;E<arguments.length;E++)P[E-2]=arguments[E];var q={title:S,command:y};return F.defined(P)&&P.length>0&&(q.arguments=P),q}b.create=_;function m(S){var y=S;return F.defined(y)&&F.string(y.title)&&F.string(y.command)}b.is=m})(j||(r.Command=j={}));var W;(function(b){function _(P,E){return{range:P,newText:E}}b.replace=_;function m(P,E){return{range:{start:P,end:P},newText:E}}b.insert=m;function S(P){return{range:P,newText:""}}b.del=S;function y(P){var E=P;return F.objectLiteral(E)&&F.string(E.newText)&&c.is(E.range)}b.is=y})(W||(r.TextEdit=W={}));var Z;(function(b){function _(S,y,P){var E={label:S};return y!==void 0&&(E.needsConfirmation=y),P!==void 0&&(E.description=P),E}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&F.string(y.label)&&(F.boolean(y.needsConfirmation)||y.needsConfirmation===void 0)&&(F.string(y.description)||y.description===void 0)}b.is=m})(Z||(r.ChangeAnnotation=Z={}));var J;(function(b){function _(m){var S=m;return F.string(S)}b.is=_})(J||(r.ChangeAnnotationIdentifier=J={}));var de;(function(b){function _(P,E,q){return{range:P,newText:E,annotationId:q}}b.replace=_;function m(P,E,q){return{range:{start:P,end:P},newText:E,annotationId:q}}b.insert=m;function S(P,E){return{range:P,newText:"",annotationId:E}}b.del=S;function y(P){var E=P;return W.is(E)&&(Z.is(E.annotationId)||J.is(E.annotationId))}b.is=y})(de||(r.AnnotatedTextEdit=de={}));var N;(function(b){function _(S,y){return{textDocument:S,edits:y}}b.create=_;function m(S){var y=S;return F.defined(y)&&pe.is(y.textDocument)&&Array.isArray(y.edits)}b.is=m})(N||(r.TextDocumentEdit=N={}));var $;(function(b){function _(S,y,P){var E={kind:"create",uri:S};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(E.options=y),P!==void 0&&(E.annotationId=P),E}b.create=_;function m(S){var y=S;return y&&y.kind==="create"&&F.string(y.uri)&&(y.options===void 0||(y.options.overwrite===void 0||F.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||F.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||J.is(y.annotationId))}b.is=m})($||(r.CreateFile=$={}));var T;(function(b){function _(S,y,P,E){var q={kind:"rename",oldUri:S,newUri:y};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(q.options=P),E!==void 0&&(q.annotationId=E),q}b.create=_;function m(S){var y=S;return y&&y.kind==="rename"&&F.string(y.oldUri)&&F.string(y.newUri)&&(y.options===void 0||(y.options.overwrite===void 0||F.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||F.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||J.is(y.annotationId))}b.is=m})(T||(r.RenameFile=T={}));var O;(function(b){function _(S,y,P){var E={kind:"delete",uri:S};return y!==void 0&&(y.recursive!==void 0||y.ignoreIfNotExists!==void 0)&&(E.options=y),P!==void 0&&(E.annotationId=P),E}b.create=_;function m(S){var y=S;return y&&y.kind==="delete"&&F.string(y.uri)&&(y.options===void 0||(y.options.recursive===void 0||F.boolean(y.options.recursive))&&(y.options.ignoreIfNotExists===void 0||F.boolean(y.options.ignoreIfNotExists)))&&(y.annotationId===void 0||J.is(y.annotationId))}b.is=m})(O||(r.DeleteFile=O={}));var V;(function(b){function _(m){var S=m;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(y){return F.string(y.kind)?$.is(y)||T.is(y)||O.is(y):N.is(y)}))}b.is=_})(V||(r.WorkspaceEdit=V={}));var M=function(){function b(_,m){this.edits=_,this.changeAnnotations=m}return b.prototype.insert=function(_,m,S){var y,P;if(S===void 0?y=W.insert(_,m):J.is(S)?(P=S,y=de.insert(_,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(S),y=de.insert(_,m,P)),this.edits.push(y),P!==void 0)return P},b.prototype.replace=function(_,m,S){var y,P;if(S===void 0?y=W.replace(_,m):J.is(S)?(P=S,y=de.replace(_,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(S),y=de.replace(_,m,P)),this.edits.push(y),P!==void 0)return P},b.prototype.delete=function(_,m){var S,y;if(m===void 0?S=W.del(_):J.is(m)?(y=m,S=de.del(_,m)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(m),S=de.del(_,y)),this.edits.push(S),y!==void 0)return y},b.prototype.add=function(_){this.edits.push(_)},b.prototype.all=function(){return this.edits},b.prototype.clear=function(){this.edits.splice(0,this.edits.length)},b.prototype.assertChangeAnnotations=function(_){if(_===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},b}(),H=function(){function b(_){this._annotations=_===void 0?Object.create(null):_,this._counter=0,this._size=0}return b.prototype.all=function(){return this._annotations},Object.defineProperty(b.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),b.prototype.manage=function(_,m){var S;if(J.is(_)?S=_:(S=this.nextId(),m=_),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=m,this._size++,S},b.prototype.nextId=function(){return this._counter++,this._counter.toString()},b}(),be=function(){function b(_){var m=this;this._textEditChanges=Object.create(null),_!==void 0?(this._workspaceEdit=_,_.documentChanges?(this._changeAnnotations=new H(_.changeAnnotations),_.changeAnnotations=this._changeAnnotations.all(),_.documentChanges.forEach(function(S){if(N.is(S)){var y=new M(S.edits,m._changeAnnotations);m._textEditChanges[S.textDocument.uri]=y}})):_.changes&&Object.keys(_.changes).forEach(function(S){var y=new M(_.changes[S]);m._textEditChanges[S]=y})):this._workspaceEdit={}}return Object.defineProperty(b.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),b.prototype.getTextEditChange=function(_){if(pe.is(_)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:_.uri,version:_.version},S=this._textEditChanges[m.uri];if(!S){var y=[],P={textDocument:m,edits:y};this._workspaceEdit.documentChanges.push(P),S=new M(y,this._changeAnnotations),this._textEditChanges[m.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[_];if(!S){var y=[];this._workspaceEdit.changes[_]=y,S=new M(y),this._textEditChanges[_]=S}return S}},b.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new H,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},b.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},b.prototype.createFile=function(_,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;Z.is(m)||J.is(m)?y=m:S=m;var P,E;if(y===void 0?P=$.create(_,S):(E=J.is(y)?y:this._changeAnnotations.manage(y),P=$.create(_,S,E)),this._workspaceEdit.documentChanges.push(P),E!==void 0)return E},b.prototype.renameFile=function(_,m,S,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;Z.is(S)||J.is(S)?P=S:y=S;var E,q;if(P===void 0?E=T.create(_,m,y):(q=J.is(P)?P:this._changeAnnotations.manage(P),E=T.create(_,m,y,q)),this._workspaceEdit.documentChanges.push(E),q!==void 0)return q},b.prototype.deleteFile=function(_,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;Z.is(m)||J.is(m)?y=m:S=m;var P,E;if(y===void 0?P=O.create(_,S):(E=J.is(y)?y:this._changeAnnotations.manage(y),P=O.create(_,S,E)),this._workspaceEdit.documentChanges.push(P),E!==void 0)return E},b}();r.WorkspaceChange=be;var te;(function(b){function _(S){return{uri:S}}b.create=_;function m(S){var y=S;return F.defined(y)&&F.string(y.uri)}b.is=m})(te||(r.TextDocumentIdentifier=te={}));var C;(function(b){function _(S,y){return{uri:S,version:y}}b.create=_;function m(S){var y=S;return F.defined(y)&&F.string(y.uri)&&F.integer(y.version)}b.is=m})(C||(r.VersionedTextDocumentIdentifier=C={}));var pe;(function(b){function _(S,y){return{uri:S,version:y}}b.create=_;function m(S){var y=S;return F.defined(y)&&F.string(y.uri)&&(y.version===null||F.integer(y.version))}b.is=m})(pe||(r.OptionalVersionedTextDocumentIdentifier=pe={}));var Qe;(function(b){function _(S,y,P,E){return{uri:S,languageId:y,version:P,text:E}}b.create=_;function m(S){var y=S;return F.defined(y)&&F.string(y.uri)&&F.string(y.languageId)&&F.integer(y.version)&&F.string(y.text)}b.is=m})(Qe||(r.TextDocumentItem=Qe={}));var ct;(function(b){b.PlainText="plaintext",b.Markdown="markdown";function _(m){var S=m;return S===b.PlainText||S===b.Markdown}b.is=_})(ct||(r.MarkupKind=ct={}));var U;(function(b){function _(m){var S=m;return F.objectLiteral(m)&&ct.is(S.kind)&&F.string(S.value)}b.is=_})(U||(r.MarkupContent=U={}));var K;(function(b){b.Text=1,b.Method=2,b.Function=3,b.Constructor=4,b.Field=5,b.Variable=6,b.Class=7,b.Interface=8,b.Module=9,b.Property=10,b.Unit=11,b.Value=12,b.Enum=13,b.Keyword=14,b.Snippet=15,b.Color=16,b.File=17,b.Reference=18,b.Folder=19,b.EnumMember=20,b.Constant=21,b.Struct=22,b.Event=23,b.Operator=24,b.TypeParameter=25})(K||(r.CompletionItemKind=K={}));var _e;(function(b){b.PlainText=1,b.Snippet=2})(_e||(r.InsertTextFormat=_e={}));var se;(function(b){b.Deprecated=1})(se||(r.CompletionItemTag=se={}));var we;(function(b){function _(S,y,P){return{newText:S,insert:y,replace:P}}b.create=_;function m(S){var y=S;return y&&F.string(y.newText)&&c.is(y.insert)&&c.is(y.replace)}b.is=m})(we||(r.InsertReplaceEdit=we={}));var Te;(function(b){b.asIs=1,b.adjustIndentation=2})(Te||(r.InsertTextMode=Te={}));var oe;(function(b){function _(m){var S=m;return S&&(F.string(S.detail)||S.detail===void 0)&&(F.string(S.description)||S.description===void 0)}b.is=_})(oe||(r.CompletionItemLabelDetails=oe={}));var I;(function(b){function _(m){return{label:m}}b.create=_})(I||(r.CompletionItem=I={}));var B;(function(b){function _(m,S){return{items:m||[],isIncomplete:!!S}}b.create=_})(B||(r.CompletionList=B={}));var ce;(function(b){function _(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}b.fromPlainText=_;function m(S){var y=S;return F.string(y)||F.objectLiteral(y)&&F.string(y.language)&&F.string(y.value)}b.is=m})(ce||(r.MarkedString=ce={}));var z;(function(b){function _(m){var S=m;return!!S&&F.objectLiteral(S)&&(U.is(S.contents)||ce.is(S.contents)||F.typedArray(S.contents,ce.is))&&(m.range===void 0||c.is(m.range))}b.is=_})(z||(r.Hover=z={}));var ue;(function(b){function _(m,S){return S?{label:m,documentation:S}:{label:m}}b.create=_})(ue||(r.ParameterInformation=ue={}));var Le;(function(b){function _(m,S){for(var y=[],P=2;P<arguments.length;P++)y[P-2]=arguments[P];var E={label:m};return F.defined(S)&&(E.documentation=S),F.defined(y)?E.parameters=y:E.parameters=[],E}b.create=_})(Le||(r.SignatureInformation=Le={}));var Ke;(function(b){b.Text=1,b.Read=2,b.Write=3})(Ke||(r.DocumentHighlightKind=Ke={}));var ie;(function(b){function _(m,S){var y={range:m};return F.number(S)&&(y.kind=S),y}b.create=_})(ie||(r.DocumentHighlight=ie={}));var ke;(function(b){b.File=1,b.Module=2,b.Namespace=3,b.Package=4,b.Class=5,b.Method=6,b.Property=7,b.Field=8,b.Constructor=9,b.Enum=10,b.Interface=11,b.Function=12,b.Variable=13,b.Constant=14,b.String=15,b.Number=16,b.Boolean=17,b.Array=18,b.Object=19,b.Key=20,b.Null=21,b.EnumMember=22,b.Struct=23,b.Event=24,b.Operator=25,b.TypeParameter=26})(ke||(r.SymbolKind=ke={}));var ne;(function(b){b.Deprecated=1})(ne||(r.SymbolTag=ne={}));var ve;(function(b){function _(m,S,y,P,E){var q={name:m,kind:S,location:{uri:P,range:y}};return E&&(q.containerName=E),q}b.create=_})(ve||(r.SymbolInformation=ve={}));var Ne;(function(b){function _(m,S,y,P){return P!==void 0?{name:m,kind:S,location:{uri:y,range:P}}:{name:m,kind:S,location:{uri:y}}}b.create=_})(Ne||(r.WorkspaceSymbol=Ne={}));var lt;(function(b){function _(S,y,P,E,q,ee){var re={name:S,detail:y,kind:P,range:E,selectionRange:q};return ee!==void 0&&(re.children=ee),re}b.create=_;function m(S){var y=S;return y&&F.string(y.name)&&F.number(y.kind)&&c.is(y.range)&&c.is(y.selectionRange)&&(y.detail===void 0||F.string(y.detail))&&(y.deprecated===void 0||F.boolean(y.deprecated))&&(y.children===void 0||Array.isArray(y.children))&&(y.tags===void 0||Array.isArray(y.tags))}b.is=m})(lt||(r.DocumentSymbol=lt={}));var Ge;(function(b){b.Empty="",b.QuickFix="quickfix",b.Refactor="refactor",b.RefactorExtract="refactor.extract",b.RefactorInline="refactor.inline",b.RefactorRewrite="refactor.rewrite",b.Source="source",b.SourceOrganizeImports="source.organizeImports",b.SourceFixAll="source.fixAll"})(Ge||(r.CodeActionKind=Ge={}));var Ot;(function(b){b.Invoked=1,b.Automatic=2})(Ot||(r.CodeActionTriggerKind=Ot={}));var Bt;(function(b){function _(S,y,P){var E={diagnostics:S};return y!=null&&(E.only=y),P!=null&&(E.triggerKind=P),E}b.create=_;function m(S){var y=S;return F.defined(y)&&F.typedArray(y.diagnostics,A.is)&&(y.only===void 0||F.typedArray(y.only,F.string))&&(y.triggerKind===void 0||y.triggerKind===Ot.Invoked||y.triggerKind===Ot.Automatic)}b.is=m})(Bt||(r.CodeActionContext=Bt={}));var nn;(function(b){function _(S,y,P){var E={title:S},q=!0;return typeof y=="string"?(q=!1,E.kind=y):j.is(y)?E.command=y:E.edit=y,q&&P!==void 0&&(E.kind=P),E}b.create=_;function m(S){var y=S;return y&&F.string(y.title)&&(y.diagnostics===void 0||F.typedArray(y.diagnostics,A.is))&&(y.kind===void 0||F.string(y.kind))&&(y.edit!==void 0||y.command!==void 0)&&(y.command===void 0||j.is(y.command))&&(y.isPreferred===void 0||F.boolean(y.isPreferred))&&(y.edit===void 0||V.is(y.edit))}b.is=m})(nn||(r.CodeAction=nn={}));var Y;(function(b){function _(S,y){var P={range:S};return F.defined(y)&&(P.data=y),P}b.create=_;function m(S){var y=S;return F.defined(y)&&c.is(y.range)&&(F.undefined(y.command)||j.is(y.command))}b.is=m})(Y||(r.CodeLens=Y={}));var X;(function(b){function _(S,y){return{tabSize:S,insertSpaces:y}}b.create=_;function m(S){var y=S;return F.defined(y)&&F.uinteger(y.tabSize)&&F.boolean(y.insertSpaces)}b.is=m})(X||(r.FormattingOptions=X={}));var le;(function(b){function _(S,y,P){return{range:S,target:y,data:P}}b.create=_;function m(S){var y=S;return F.defined(y)&&c.is(y.range)&&(F.undefined(y.target)||F.string(y.target))}b.is=m})(le||(r.DocumentLink=le={}));var zt;(function(b){function _(S,y){return{range:S,parent:y}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&c.is(y.range)&&(y.parent===void 0||b.is(y.parent))}b.is=m})(zt||(r.SelectionRange=zt={}));var Ft;(function(b){b.namespace="namespace",b.type="type",b.class="class",b.enum="enum",b.interface="interface",b.struct="struct",b.typeParameter="typeParameter",b.parameter="parameter",b.variable="variable",b.property="property",b.enumMember="enumMember",b.event="event",b.function="function",b.method="method",b.macro="macro",b.keyword="keyword",b.modifier="modifier",b.comment="comment",b.string="string",b.number="number",b.regexp="regexp",b.operator="operator",b.decorator="decorator"})(Ft||(r.SemanticTokenTypes=Ft={}));var cr;(function(b){b.declaration="declaration",b.definition="definition",b.readonly="readonly",b.static="static",b.deprecated="deprecated",b.abstract="abstract",b.async="async",b.modification="modification",b.documentation="documentation",b.defaultLibrary="defaultLibrary"})(cr||(r.SemanticTokenModifiers=cr={}));var ai;(function(b){function _(m){var S=m;return F.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}b.is=_})(ai||(r.SemanticTokens=ai={}));var Ui;(function(b){function _(S,y){return{range:S,text:y}}b.create=_;function m(S){var y=S;return y!=null&&c.is(y.range)&&F.string(y.text)}b.is=m})(Ui||(r.InlineValueText=Ui={}));var Gi;(function(b){function _(S,y,P){return{range:S,variableName:y,caseSensitiveLookup:P}}b.create=_;function m(S){var y=S;return y!=null&&c.is(y.range)&&F.boolean(y.caseSensitiveLookup)&&(F.string(y.variableName)||y.variableName===void 0)}b.is=m})(Gi||(r.InlineValueVariableLookup=Gi={}));var Wi;(function(b){function _(S,y){return{range:S,expression:y}}b.create=_;function m(S){var y=S;return y!=null&&c.is(y.range)&&(F.string(y.expression)||y.expression===void 0)}b.is=m})(Wi||(r.InlineValueEvaluatableExpression=Wi={}));var Hi;(function(b){function _(S,y){return{frameId:S,stoppedLocation:y}}b.create=_;function m(S){var y=S;return F.defined(y)&&c.is(S.stoppedLocation)}b.is=m})(Hi||(r.InlineValueContext=Hi={}));var oi;(function(b){b.Type=1,b.Parameter=2;function _(m){return m===1||m===2}b.is=_})(oi||(r.InlayHintKind=oi={}));var ui;(function(b){function _(S){return{value:S}}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&(y.tooltip===void 0||F.string(y.tooltip)||U.is(y.tooltip))&&(y.location===void 0||l.is(y.location))&&(y.command===void 0||j.is(y.command))}b.is=m})(ui||(r.InlayHintLabelPart=ui={}));var yn;(function(b){function _(S,y,P){var E={position:S,label:y};return P!==void 0&&(E.kind=P),E}b.create=_;function m(S){var y=S;return F.objectLiteral(y)&&u.is(y.position)&&(F.string(y.label)||F.typedArray(y.label,ui.is))&&(y.kind===void 0||oi.is(y.kind))&&y.textEdits===void 0||F.typedArray(y.textEdits,W.is)&&(y.tooltip===void 0||F.string(y.tooltip)||U.is(y.tooltip))&&(y.paddingLeft===void 0||F.boolean(y.paddingLeft))&&(y.paddingRight===void 0||F.boolean(y.paddingRight))}b.is=m})(yn||(r.InlayHint=yn={}));var Vi;(function(b){function _(m){return{kind:"snippet",value:m}}b.createSnippet=_})(Vi||(r.StringValue=Vi={}));var Ki;(function(b){function _(m,S,y,P){return{insertText:m,filterText:S,range:y,command:P}}b.create=_})(Ki||(r.InlineCompletionItem=Ki={}));var lr;(function(b){function _(m){return{items:m}}b.create=_})(lr||(r.InlineCompletionList=lr={}));var Yi;(function(b){b.Invoked=0,b.Automatic=1})(Yi||(r.InlineCompletionTriggerKind=Yi={}));var _r;(function(b){function _(m,S){return{range:m,text:S}}b.create=_})(_r||(r.SelectedCompletionInfo=_r={}));var Xi;(function(b){function _(m,S){return{triggerKind:m,selectedCompletionInfo:S}}b.create=_})(Xi||(r.InlineCompletionContext=Xi={}));var Ln;(function(b){function _(m){var S=m;return F.objectLiteral(S)&&s.is(S.uri)&&F.string(S.name)}b.is=_})(Ln||(r.WorkspaceFolder=Ln={})),r.EOL=[`
|
|
156
|
-
`,`\r
|
|
157
|
-
`,"\r"];var Vn;(function(b){function _(P,E,q,ee){return new Qs(P,E,q,ee)}b.create=_;function m(P){var E=P;return!!(F.defined(E)&&F.string(E.uri)&&(F.undefined(E.languageId)||F.string(E.languageId))&&F.uinteger(E.lineCount)&&F.func(E.getText)&&F.func(E.positionAt)&&F.func(E.offsetAt))}b.is=m;function S(P,E){for(var q=P.getText(),ee=y(E,function(Ce,Ze){var He=Ce.range.start.line-Ze.range.start.line;return He===0?Ce.range.start.character-Ze.range.start.character:He}),re=q.length,Oe=ee.length-1;Oe>=0;Oe--){var Pe=ee[Oe],We=P.offsetAt(Pe.range.start),he=P.offsetAt(Pe.range.end);if(he<=re)q=q.substring(0,We)+Pe.newText+q.substring(he,q.length);else throw new Error("Overlapping edit");re=We}return q}b.applyEdits=S;function y(P,E){if(P.length<=1)return P;var q=P.length/2|0,ee=P.slice(0,q),re=P.slice(q);y(ee,E),y(re,E);for(var Oe=0,Pe=0,We=0;Oe<ee.length&&Pe<re.length;){var he=E(ee[Oe],re[Pe]);he<=0?P[We++]=ee[Oe++]:P[We++]=re[Pe++]}for(;Oe<ee.length;)P[We++]=ee[Oe++];for(;Pe<re.length;)P[We++]=re[Pe++];return P}})(Vn||(r.TextDocument=Vn={}));var Qs=function(){function b(_,m,S,y){this._uri=_,this._languageId=m,this._version=S,this._content=y,this._lineOffsets=void 0}return Object.defineProperty(b.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),b.prototype.getText=function(_){if(_){var m=this.offsetAt(_.start),S=this.offsetAt(_.end);return this._content.substring(m,S)}return this._content},b.prototype.update=function(_,m){this._content=_.text,this._version=m,this._lineOffsets=void 0},b.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var _=[],m=this._content,S=!0,y=0;y<m.length;y++){S&&(_.push(y),S=!1);var P=m.charAt(y);S=P==="\r"||P===`
|
|
158
|
-
`,P==="\r"&&y+1<m.length&&m.charAt(y+1)===`
|
|
159
|
-
`&&y++}S&&m.length>0&&_.push(m.length),this._lineOffsets=_}return this._lineOffsets},b.prototype.positionAt=function(_){_=Math.max(Math.min(_,this._content.length),0);var m=this.getLineOffsets(),S=0,y=m.length;if(y===0)return u.create(0,_);for(;S<y;){var P=Math.floor((S+y)/2);m[P]>_?y=P:S=P+1}var E=S-1;return u.create(E,_-m[E])},b.prototype.offsetAt=function(_){var m=this.getLineOffsets();if(_.line>=m.length)return this._content.length;if(_.line<0)return 0;var S=m[_.line],y=_.line+1<m.length?m[_.line+1]:this._content.length;return Math.max(Math.min(S+_.character,y),S)},Object.defineProperty(b.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),b}(),F;(function(b){var _=Object.prototype.toString;function m(he){return typeof he<"u"}b.defined=m;function S(he){return typeof he>"u"}b.undefined=S;function y(he){return he===!0||he===!1}b.boolean=y;function P(he){return _.call(he)==="[object String]"}b.string=P;function E(he){return _.call(he)==="[object Number]"}b.number=E;function q(he,Ce,Ze){return _.call(he)==="[object Number]"&&Ce<=he&&he<=Ze}b.numberRange=q;function ee(he){return _.call(he)==="[object Number]"&&-2147483648<=he&&he<=2147483647}b.integer=ee;function re(he){return _.call(he)==="[object Number]"&&0<=he&&he<=2147483647}b.uinteger=re;function Oe(he){return _.call(he)==="[object Function]"}b.func=Oe;function Pe(he){return he!==null&&typeof he=="object"}b.objectLiteral=Pe;function We(he,Ce){return Array.isArray(he)&&he.every(Ce)}b.typedArray=We})(F||(F={}))})}(ip,ip.exports)),ip.exports}var dn={},S$;function wt(){if(S$)return dn;S$=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.ProtocolNotificationType=dn.ProtocolNotificationType0=dn.ProtocolRequestType=dn.ProtocolRequestType0=dn.RegistrationType=dn.MessageDirection=void 0;const t=Ds();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(dn.MessageDirection=e={}));class n{constructor(u){this.method=u}}dn.RegistrationType=n;class r extends t.RequestType0{constructor(u){super(u)}}dn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(u){super(u,t.ParameterStructures.byName)}}dn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(u){super(u)}}dn.ProtocolNotificationType0=s;class a extends t.NotificationType{constructor(u){super(u,t.ParameterStructures.byName)}}return dn.ProtocolNotificationType=a,dn}var qy={},St={},$$;function jy(){if($$)return St;$$=1,Object.defineProperty(St,"__esModule",{value:!0}),St.objectLiteral=St.typedArray=St.stringArray=St.array=St.func=St.error=St.number=St.string=St.boolean=void 0;function t(c){return c===!0||c===!1}St.boolean=t;function e(c){return typeof c=="string"||c instanceof String}St.string=e;function n(c){return typeof c=="number"||c instanceof Number}St.number=n;function r(c){return c instanceof Error}St.error=r;function i(c){return typeof c=="function"}St.func=i;function s(c){return Array.isArray(c)}St.array=s;function a(c){return s(c)&&c.every(l=>e(l))}St.stringArray=a;function o(c,l){return Array.isArray(c)&&c.every(l)}St.typedArray=o;function u(c){return c!==null&&typeof c=="object"}return St.objectLiteral=u,St}var Iu={},k$;function c8(){if(k$)return Iu;k$=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.ImplementationRequest=void 0;const t=wt();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Iu.ImplementationRequest=e={})),Iu}var xu={},C$;function l8(){if(C$)return xu;C$=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.TypeDefinitionRequest=void 0;const t=wt();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(xu.TypeDefinitionRequest=e={})),xu}var Es={},A$;function d8(){if(A$)return Es;A$=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.DidChangeWorkspaceFoldersNotification=Es.WorkspaceFoldersRequest=void 0;const t=wt();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(Es.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(Es.DidChangeWorkspaceFoldersNotification=n={})),Es}var Nu={},_$;function f8(){if(_$)return Nu;_$=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.ConfigurationRequest=void 0;const t=wt();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(Nu.ConfigurationRequest=e={})),Nu}var Rs={},P$;function p8(){if(P$)return Rs;P$=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.ColorPresentationRequest=Rs.DocumentColorRequest=void 0;const t=wt();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Rs.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(Rs.ColorPresentationRequest=n={})),Rs}var Ts={},I$;function h8(){if(I$)return Ts;I$=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.FoldingRangeRefreshRequest=Ts.FoldingRangeRequest=void 0;const t=wt();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ts.FoldingRangeRequest=e={}));var n;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Ts.FoldingRangeRefreshRequest=n={})),Ts}var Ou={},x$;function m8(){if(x$)return Ou;x$=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.DeclarationRequest=void 0;const t=wt();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Ou.DeclarationRequest=e={})),Ou}var Fu={},N$;function g8(){if(N$)return Fu;N$=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.SelectionRangeRequest=void 0;const t=wt();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Fu.SelectionRangeRequest=e={})),Fu}var Kr={},O$;function y8(){if(O$)return Kr;O$=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.WorkDoneProgressCancelNotification=Kr.WorkDoneProgressCreateRequest=Kr.WorkDoneProgress=void 0;const t=Ds(),e=wt();var n;(function(s){s.type=new t.ProgressType;function a(o){return o===s.type}s.is=a})(n||(Kr.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(Kr.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(Kr.WorkDoneProgressCancelNotification=i={})),Kr}var Yr={},F$;function w8(){if(F$)return Yr;F$=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.CallHierarchyOutgoingCallsRequest=Yr.CallHierarchyIncomingCallsRequest=Yr.CallHierarchyPrepareRequest=void 0;const t=wt();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Yr.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Yr.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Yr.CallHierarchyOutgoingCallsRequest=r={})),Yr}var fn={},L$;function v8(){if(L$)return fn;L$=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.SemanticTokensRefreshRequest=fn.SemanticTokensRangeRequest=fn.SemanticTokensDeltaRequest=fn.SemanticTokensRequest=fn.SemanticTokensRegistrationType=fn.TokenFormat=void 0;const t=wt();var e;(function(o){o.Relative="relative"})(e||(fn.TokenFormat=e={}));var n;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(n||(fn.SemanticTokensRegistrationType=n={}));var r;(function(o){o.method="textDocument/semanticTokens/full",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(r||(fn.SemanticTokensRequest=r={}));var i;(function(o){o.method="textDocument/semanticTokens/full/delta",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(i||(fn.SemanticTokensDeltaRequest=i={}));var s;(function(o){o.method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(s||(fn.SemanticTokensRangeRequest=s={}));var a;return function(o){o.method="workspace/semanticTokens/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)}(a||(fn.SemanticTokensRefreshRequest=a={})),fn}var Lu={},M$;function b8(){if(M$)return Lu;M$=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.ShowDocumentRequest=void 0;const t=wt();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(Lu.ShowDocumentRequest=e={})),Lu}var Mu={},B$;function D8(){if(B$)return Mu;B$=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.LinkedEditingRangeRequest=void 0;const t=wt();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Mu.LinkedEditingRangeRequest=e={})),Mu}var Vt={},z$;function E8(){if(z$)return Vt;z$=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.WillDeleteFilesRequest=Vt.DidDeleteFilesNotification=Vt.DidRenameFilesNotification=Vt.WillRenameFilesRequest=Vt.DidCreateFilesNotification=Vt.WillCreateFilesRequest=Vt.FileOperationPatternKind=void 0;const t=wt();var e;(function(u){u.file="file",u.folder="folder"})(e||(Vt.FileOperationPatternKind=e={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(Vt.WillCreateFilesRequest=n={}));var r;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(r||(Vt.DidCreateFilesNotification=r={}));var i;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(i||(Vt.WillRenameFilesRequest=i={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(s||(Vt.DidRenameFilesNotification=s={}));var a;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(a||(Vt.DidDeleteFilesNotification=a={}));var o;return function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)}(o||(Vt.WillDeleteFilesRequest=o={})),Vt}var Xr={},q$;function R8(){if(q$)return Xr;q$=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.MonikerRequest=Xr.MonikerKind=Xr.UniquenessLevel=void 0;const t=wt();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(Xr.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(Xr.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Xr.MonikerRequest=r={})),Xr}var Jr={},j$;function T8(){if(j$)return Jr;j$=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.TypeHierarchySubtypesRequest=Jr.TypeHierarchySupertypesRequest=Jr.TypeHierarchyPrepareRequest=void 0;const t=wt();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Jr.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Jr.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Jr.TypeHierarchySubtypesRequest=r={})),Jr}var Ss={},U$;function S8(){if(U$)return Ss;U$=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.InlineValueRefreshRequest=Ss.InlineValueRequest=void 0;const t=wt();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ss.InlineValueRequest=e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Ss.InlineValueRefreshRequest=n={})),Ss}var Qr={},G$;function $8(){if(G$)return Qr;G$=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.InlayHintRefreshRequest=Qr.InlayHintResolveRequest=Qr.InlayHintRequest=void 0;const t=wt();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Qr.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Qr.InlayHintResolveRequest=n={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(r||(Qr.InlayHintRefreshRequest=r={})),Qr}var In={},W$;function k8(){if(W$)return In;W$=1,Object.defineProperty(In,"__esModule",{value:!0}),In.DiagnosticRefreshRequest=In.WorkspaceDiagnosticRequest=In.DocumentDiagnosticRequest=In.DocumentDiagnosticReportKind=In.DiagnosticServerCancellationData=void 0;const t=Ds(),e=jy(),n=wt();var r;(function(u){function c(l){const d=l;return d&&e.boolean(d.retriggerRequest)}u.is=c})(r||(In.DiagnosticServerCancellationData=r={}));var i;(function(u){u.Full="full",u.Unchanged="unchanged"})(i||(In.DocumentDiagnosticReportKind=i={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(s||(In.DocumentDiagnosticRequest=s={}));var a;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(a||(In.WorkspaceDiagnosticRequest=a={}));var o;return function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)}(o||(In.DiagnosticRefreshRequest=o={})),In}var vt={},H$;function C8(){if(H$)return vt;H$=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.DidCloseNotebookDocumentNotification=vt.DidSaveNotebookDocumentNotification=vt.DidChangeNotebookDocumentNotification=vt.NotebookCellArrayChange=vt.DidOpenNotebookDocumentNotification=vt.NotebookDocumentSyncRegistrationType=vt.NotebookDocument=vt.NotebookCell=vt.ExecutionSummary=vt.NotebookCellKind=void 0;const t=zy(),e=jy(),n=wt();var r;(function(p){p.Markup=1,p.Code=2;function h(w){return w===1||w===2}p.is=h})(r||(vt.NotebookCellKind=r={}));var i;(function(p){function h(g,v){const R={executionOrder:g};return(v===!0||v===!1)&&(R.success=v),R}p.create=h;function w(g){const v=g;return e.objectLiteral(v)&&t.uinteger.is(v.executionOrder)&&(v.success===void 0||e.boolean(v.success))}p.is=w;function D(g,v){return g===v?!0:g==null||v===null||v===void 0?!1:g.executionOrder===v.executionOrder&&g.success===v.success}p.equals=D})(i||(vt.ExecutionSummary=i={}));var s;(function(p){function h(v,R){return{kind:v,document:R}}p.create=h;function w(v){const R=v;return e.objectLiteral(R)&&r.is(R.kind)&&t.DocumentUri.is(R.document)&&(R.metadata===void 0||e.objectLiteral(R.metadata))}p.is=w;function D(v,R){const k=new Set;return v.document!==R.document&&k.add("document"),v.kind!==R.kind&&k.add("kind"),v.executionSummary!==R.executionSummary&&k.add("executionSummary"),(v.metadata!==void 0||R.metadata!==void 0)&&!g(v.metadata,R.metadata)&&k.add("metadata"),(v.executionSummary!==void 0||R.executionSummary!==void 0)&&!i.equals(v.executionSummary,R.executionSummary)&&k.add("executionSummary"),k}p.diff=D;function g(v,R){if(v===R)return!0;if(v==null||R===null||R===void 0||typeof v!=typeof R||typeof v!="object")return!1;const k=Array.isArray(v),A=Array.isArray(R);if(k!==A)return!1;if(k&&A){if(v.length!==R.length)return!1;for(let j=0;j<v.length;j++)if(!g(v[j],R[j]))return!1}if(e.objectLiteral(v)&&e.objectLiteral(R)){const j=Object.keys(v),W=Object.keys(R);if(j.length!==W.length||(j.sort(),W.sort(),!g(j,W)))return!1;for(let Z=0;Z<j.length;Z++){const J=j[Z];if(!g(v[J],R[J]))return!1}}return!0}})(s||(vt.NotebookCell=s={}));var a;(function(p){function h(D,g,v,R){return{uri:D,notebookType:g,version:v,cells:R}}p.create=h;function w(D){const g=D;return e.objectLiteral(g)&&e.string(g.uri)&&t.integer.is(g.version)&&e.typedArray(g.cells,s.is)}p.is=w})(a||(vt.NotebookDocument=a={}));var o;(function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(o||(vt.NotebookDocumentSyncRegistrationType=o={}));var u;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(u||(vt.DidOpenNotebookDocumentNotification=u={}));var c;(function(p){function h(D){const g=D;return e.objectLiteral(g)&&t.uinteger.is(g.start)&&t.uinteger.is(g.deleteCount)&&(g.cells===void 0||e.typedArray(g.cells,s.is))}p.is=h;function w(D,g,v){const R={start:D,deleteCount:g};return v!==void 0&&(R.cells=v),R}p.create=w})(c||(vt.NotebookCellArrayChange=c={}));var l;(function(p){p.method="notebookDocument/didChange",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(l||(vt.DidChangeNotebookDocumentNotification=l={}));var d;(function(p){p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(d||(vt.DidSaveNotebookDocumentNotification=d={}));var f;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method}(f||(vt.DidCloseNotebookDocumentNotification=f={})),vt}var Bu={},V$;function A8(){if(V$)return Bu;V$=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.InlineCompletionRequest=void 0;const t=wt();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Bu.InlineCompletionRequest=e={})),Bu}var K$;function _8(){return K$||(K$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=wt(),n=zy(),r=jy(),i=c8();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=l8();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=d8();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const o=f8();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const u=p8();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});const c=h8();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const l=m8();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=g8();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=y8();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const p=w8();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const h=v8();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return h.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return h.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return h.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return h.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return h.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return h.SemanticTokensRegistrationType}});const w=b8();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return w.ShowDocumentRequest}});const D=D8();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return D.LinkedEditingRangeRequest}});const g=E8();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return g.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return g.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return g.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return g.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return g.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return g.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return g.WillDeleteFilesRequest}});const v=R8();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});const R=T8();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySupertypesRequest}});const k=S8();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return k.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return k.InlineValueRefreshRequest}});const A=$8();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return A.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return A.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return A.InlayHintRefreshRequest}});const j=k8();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return j.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return j.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return j.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return j.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return j.DiagnosticRefreshRequest}});const W=C8();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return W.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return W.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return W.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return W.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return W.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return W.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return W.DidCloseNotebookDocumentNotification}});const Z=A8();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return Z.InlineCompletionRequest}});var J;(function(m){function S(y){const P=y;return r.string(P)||r.string(P.language)||r.string(P.scheme)||r.string(P.pattern)}m.is=S})(J||(t.TextDocumentFilter=J={}));var de;(function(m){function S(y){const P=y;return r.objectLiteral(P)&&(r.string(P.notebookType)||r.string(P.scheme)||r.string(P.pattern))}m.is=S})(de||(t.NotebookDocumentFilter=de={}));var N;(function(m){function S(y){const P=y;return r.objectLiteral(P)&&(r.string(P.notebook)||de.is(P.notebook))&&(P.language===void 0||r.string(P.language))}m.is=S})(N||(t.NotebookCellTextDocumentFilter=N={}));var $;(function(m){function S(y){if(!Array.isArray(y))return!1;for(let P of y)if(!r.string(P)&&!J.is(P)&&!N.is(P))return!1;return!0}m.is=S})($||(t.DocumentSelector=$={}));var T;(function(m){m.method="client/registerCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(T||(t.RegistrationRequest=T={}));var O;(function(m){m.method="client/unregisterCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(O||(t.UnregistrationRequest=O={}));var V;(function(m){m.Create="create",m.Rename="rename",m.Delete="delete"})(V||(t.ResourceOperationKind=V={}));var M;(function(m){m.Abort="abort",m.Transactional="transactional",m.TextOnlyTransactional="textOnlyTransactional",m.Undo="undo"})(M||(t.FailureHandlingKind=M={}));var H;(function(m){m.UTF8="utf-8",m.UTF16="utf-16",m.UTF32="utf-32"})(H||(t.PositionEncodingKind=H={}));var be;(function(m){function S(y){const P=y;return P&&r.string(P.id)&&P.id.length>0}m.hasId=S})(be||(t.StaticRegistrationOptions=be={}));var te;(function(m){function S(y){const P=y;return P&&(P.documentSelector===null||$.is(P.documentSelector))}m.is=S})(te||(t.TextDocumentRegistrationOptions=te={}));var C;(function(m){function S(P){const E=P;return r.objectLiteral(E)&&(E.workDoneProgress===void 0||r.boolean(E.workDoneProgress))}m.is=S;function y(P){const E=P;return E&&r.boolean(E.workDoneProgress)}m.hasWorkDoneProgress=y})(C||(t.WorkDoneProgressOptions=C={}));var pe;(function(m){m.method="initialize",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(pe||(t.InitializeRequest=pe={}));var Qe;(function(m){m.unknownProtocolVersion=1})(Qe||(t.InitializeErrorCodes=Qe={}));var ct;(function(m){m.method="initialized",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ct||(t.InitializedNotification=ct={}));var U;(function(m){m.method="shutdown",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType0(m.method)})(U||(t.ShutdownRequest=U={}));var K;(function(m){m.method="exit",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType0(m.method)})(K||(t.ExitNotification=K={}));var _e;(function(m){m.method="workspace/didChangeConfiguration",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(_e||(t.DidChangeConfigurationNotification=_e={}));var se;(function(m){m.Error=1,m.Warning=2,m.Info=3,m.Log=4,m.Debug=5})(se||(t.MessageType=se={}));var we;(function(m){m.method="window/showMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(we||(t.ShowMessageNotification=we={}));var Te;(function(m){m.method="window/showMessageRequest",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(Te||(t.ShowMessageRequest=Te={}));var oe;(function(m){m.method="window/logMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(oe||(t.LogMessageNotification=oe={}));var I;(function(m){m.method="telemetry/event",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(I||(t.TelemetryEventNotification=I={}));var B;(function(m){m.None=0,m.Full=1,m.Incremental=2})(B||(t.TextDocumentSyncKind=B={}));var ce;(function(m){m.method="textDocument/didOpen",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ce||(t.DidOpenTextDocumentNotification=ce={}));var z;(function(m){function S(P){let E=P;return E!=null&&typeof E.text=="string"&&E.range!==void 0&&(E.rangeLength===void 0||typeof E.rangeLength=="number")}m.isIncremental=S;function y(P){let E=P;return E!=null&&typeof E.text=="string"&&E.range===void 0&&E.rangeLength===void 0}m.isFull=y})(z||(t.TextDocumentContentChangeEvent=z={}));var ue;(function(m){m.method="textDocument/didChange",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ue||(t.DidChangeTextDocumentNotification=ue={}));var Le;(function(m){m.method="textDocument/didClose",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Le||(t.DidCloseTextDocumentNotification=Le={}));var Ke;(function(m){m.method="textDocument/didSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Ke||(t.DidSaveTextDocumentNotification=Ke={}));var ie;(function(m){m.Manual=1,m.AfterDelay=2,m.FocusOut=3})(ie||(t.TextDocumentSaveReason=ie={}));var ke;(function(m){m.method="textDocument/willSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ke||(t.WillSaveTextDocumentNotification=ke={}));var ne;(function(m){m.method="textDocument/willSaveWaitUntil",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ne||(t.WillSaveTextDocumentWaitUntilRequest=ne={}));var ve;(function(m){m.method="workspace/didChangeWatchedFiles",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(ve||(t.DidChangeWatchedFilesNotification=ve={}));var Ne;(function(m){m.Created=1,m.Changed=2,m.Deleted=3})(Ne||(t.FileChangeType=Ne={}));var lt;(function(m){function S(y){const P=y;return r.objectLiteral(P)&&(n.URI.is(P.baseUri)||n.WorkspaceFolder.is(P.baseUri))&&r.string(P.pattern)}m.is=S})(lt||(t.RelativePattern=lt={}));var Ge;(function(m){m.Create=1,m.Change=2,m.Delete=4})(Ge||(t.WatchKind=Ge={}));var Ot;(function(m){m.method="textDocument/publishDiagnostics",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(Ot||(t.PublishDiagnosticsNotification=Ot={}));var Bt;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.TriggerForIncompleteCompletions=3})(Bt||(t.CompletionTriggerKind=Bt={}));var nn;(function(m){m.method="textDocument/completion",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(nn||(t.CompletionRequest=nn={}));var Y;(function(m){m.method="completionItem/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Y||(t.CompletionResolveRequest=Y={}));var X;(function(m){m.method="textDocument/hover",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(X||(t.HoverRequest=X={}));var le;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.ContentChange=3})(le||(t.SignatureHelpTriggerKind=le={}));var zt;(function(m){m.method="textDocument/signatureHelp",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(zt||(t.SignatureHelpRequest=zt={}));var Ft;(function(m){m.method="textDocument/definition",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ft||(t.DefinitionRequest=Ft={}));var cr;(function(m){m.method="textDocument/references",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(cr||(t.ReferencesRequest=cr={}));var ai;(function(m){m.method="textDocument/documentHighlight",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ai||(t.DocumentHighlightRequest=ai={}));var Ui;(function(m){m.method="textDocument/documentSymbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ui||(t.DocumentSymbolRequest=Ui={}));var Gi;(function(m){m.method="textDocument/codeAction",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Gi||(t.CodeActionRequest=Gi={}));var Wi;(function(m){m.method="codeAction/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Wi||(t.CodeActionResolveRequest=Wi={}));var Hi;(function(m){m.method="workspace/symbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Hi||(t.WorkspaceSymbolRequest=Hi={}));var oi;(function(m){m.method="workspaceSymbol/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(oi||(t.WorkspaceSymbolResolveRequest=oi={}));var ui;(function(m){m.method="textDocument/codeLens",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ui||(t.CodeLensRequest=ui={}));var yn;(function(m){m.method="codeLens/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(yn||(t.CodeLensResolveRequest=yn={}));var Vi;(function(m){m.method="workspace/codeLens/refresh",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType0(m.method)})(Vi||(t.CodeLensRefreshRequest=Vi={}));var Ki;(function(m){m.method="textDocument/documentLink",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ki||(t.DocumentLinkRequest=Ki={}));var lr;(function(m){m.method="documentLink/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(lr||(t.DocumentLinkResolveRequest=lr={}));var Yi;(function(m){m.method="textDocument/formatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Yi||(t.DocumentFormattingRequest=Yi={}));var _r;(function(m){m.method="textDocument/rangeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(_r||(t.DocumentRangeFormattingRequest=_r={}));var Xi;(function(m){m.method="textDocument/rangesFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Xi||(t.DocumentRangesFormattingRequest=Xi={}));var Ln;(function(m){m.method="textDocument/onTypeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ln||(t.DocumentOnTypeFormattingRequest=Ln={}));var Vn;(function(m){m.Identifier=1})(Vn||(t.PrepareSupportDefaultBehavior=Vn={}));var Qs;(function(m){m.method="textDocument/rename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Qs||(t.RenameRequest=Qs={}));var F;(function(m){m.method="textDocument/prepareRename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(F||(t.PrepareRenameRequest=F={}));var b;(function(m){m.method="workspace/executeCommand",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(b||(t.ExecuteCommandRequest=b={}));var _;(function(m){m.method="workspace/applyEdit",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType("workspace/applyEdit")})(_||(t.ApplyWorkspaceEditRequest=_={}))}(qy)),qy}var zu={},Y$;function P8(){if(Y$)return zu;Y$=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.createProtocolConnection=void 0;const t=Ds();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return zu.createProtocolConnection=e,zu}var X$;function I8(){return X$||(X$=1,function(t){var e=Pu.__createBinding||(Object.create?function(s,a,o,u){u===void 0&&(u=o);var c=Object.getOwnPropertyDescriptor(a,o);(!c||("get"in c?!a.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,u,c)}:function(s,a,o,u){u===void 0&&(u=o),s[u]=a[o]}),n=Pu.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Ds(),t),n(zy(),t),n(wt(),t),n(_8(),t);var r=P8();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Pu)),Pu}var J$;function $t(){return J$||(J$=1,function(t){var e=$u.__createBinding||(Object.create?function(s,a,o,u){u===void 0&&(u=o);var c=Object.getOwnPropertyDescriptor(a,o);(!c||("get"in c?!a.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,u,c)}:function(s,a,o,u){u===void 0&&(u=o),s[u]=a[o]}),n=$u.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=R$();n(R$(),t),n(I8(),t);function i(s,a,o,u){return(0,r.createMessageConnection)(s,a,o,u)}t.createProtocolConnection=i}($u)),$u}var xn={},Q$;function Z$(){if(Q$)return xn;Q$=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.generateUuid=xn.parse=xn.isUUID=xn.v4=xn.empty=void 0;class t{constructor(u){this._value=u}asHex(){return this._value}equals(u){return this.asHex()===u.asHex()}}class e extends t{static _oneOf(u){return u[Math.floor(u.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}}e._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],e._timeHighBits=["8","9","a","b"],xn.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}xn.v4=n;const r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function i(o){return r.test(o)}xn.isUUID=i;function s(o){if(!i(o))throw new Error("invalid uuid");return new t(o)}xn.parse=s;function a(){return n().asHex()}return xn.generateUuid=a,xn}var Zr={},ek;function x8(){if(ek)return Zr;ek=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.attachPartialResult=Zr.ProgressFeature=Zr.attachWorkDone=void 0;const t=$t(),e=Z$();class n{constructor(f,p){this._connection=f,this._token=p,n.Instances.set(this._token,this)}begin(f,p,h,w){let D={kind:"begin",title:f,percentage:p,message:h,cancellable:w};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,D)}report(f,p){let h={kind:"report"};typeof f=="number"?(h.percentage=f,p!==void 0&&(h.message=p)):h.message=f,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,h)}done(){n.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:"end"})}}n.Instances=new Map;class r extends n{constructor(f,p){super(f,p),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class i{constructor(){}begin(){}report(){}done(){}}class s extends i{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function a(d,f){if(f===void 0||f.workDoneToken===void 0)return new i;const p=f.workDoneToken;return delete f.workDoneToken,new n(d,p)}Zr.attachWorkDone=a;const o=d=>class extends d{constructor(){super(),this._progressSupported=!1}initialize(f){super.initialize(f),f?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let h=n.Instances.get(p.token);(h instanceof r||h instanceof s)&&h.cancel()}))}attachWorkDoneProgress(f){return f===void 0?new i:new n(this.connection,f)}createWorkDoneProgress(){if(this._progressSupported){const f=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:f}).then(()=>new r(this.connection,f))}else return Promise.resolve(new s)}};Zr.ProgressFeature=o;var u;(function(d){d.type=new t.ProgressType})(u||(u={}));class c{constructor(f,p){this._connection=f,this._token=p}report(f){this._connection.sendProgress(u.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const p=f.partialResultToken;return delete f.partialResultToken,new c(d,p)}return Zr.attachPartialResult=l,Zr}var qu={},tk;function N8(){if(tk)return qu;tk=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.ConfigurationFeature=void 0;const t=$t(),e=Oy(),n=r=>class extends r{getConfiguration(i){return i?e.string(i)?this._getConfiguration({section:i}):this._getConfiguration(i):this._getConfiguration({})}_getConfiguration(i){let s={items:Array.isArray(i)?i:[i]};return this.connection.sendRequest(t.ConfigurationRequest.type,s).then(a=>Array.isArray(a)?Array.isArray(i)?a:a[0]:Array.isArray(i)?[]:null)}};return qu.ConfigurationFeature=n,qu}var ju={},nk;function O8(){if(nk)return ju;nk=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.WorkspaceFoldersFeature=void 0;const t=$t(),e=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(r){super.initialize(r);let i=r.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,s=>{this._onDidChangeWorkspaceFolders.fire(s.event)}))}fillServerCapabilities(r){super.fillServerCapabilities(r);const i=r.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=i===!0||typeof i=="string"}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};return ju.WorkspaceFoldersFeature=e,ju}var Uu={},rk;function F8(){if(rk)return Uu;rk=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.CallHierarchyFeature=void 0;const t=$t(),e=n=>class extends n{get callHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onIncomingCalls:r=>{const i=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Uu.CallHierarchyFeature=e,Uu}var ei={},ik;function sk(){if(ik)return ei;ik=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.SemanticTokensBuilder=ei.SemanticTokensDiff=ei.SemanticTokensFeature=void 0;const t=$t(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:s=>{const a=t.SemanticTokensRequest.type;return this.connection.onRequest(a,(o,u)=>s(o,u,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(a,o)))},onDelta:s=>{const a=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(a,(o,u)=>s(o,u,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(a,o)))},onRange:s=>{const a=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(a,(o,u)=>s(o,u,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(a,o)))}}}};ei.SemanticTokensFeature=e;class n{constructor(s,a){this.originalSequence=s,this.modifiedSequence=a}computeDiff(){const s=this.originalSequence.length,a=this.modifiedSequence.length;let o=0;for(;o<a&&o<s&&this.originalSequence[o]===this.modifiedSequence[o];)o++;if(o<a&&o<s){let u=s-1,c=a-1;for(;u>=o&&c>=o&&this.originalSequence[u]===this.modifiedSequence[c];)u--,c--;(u<o||c<o)&&(u++,c++);const l=u-o+1,d=this.modifiedSequence.slice(o,c+1);return d.length===1&&d[0]===this.originalSequence[u]?[{start:o,deleteCount:l-1}]:[{start:o,deleteCount:l,data:d}]}else return o<a?[{start:o,deleteCount:0,data:this.modifiedSequence.slice(o)}]:o<s?[{start:o,deleteCount:s-o}]:[]}}ei.SemanticTokensDiff=n;class r{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(s,a,o,u,c){let l=s,d=a;this._dataLen>0&&(l-=this._prevLine,l===0&&(d-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=d,this._data[this._dataLen++]=o,this._data[this._dataLen++]=u,this._data[this._dataLen++]=c,this._prevLine=s,this._prevChar=a}get id(){return this._id.toString()}previousResult(s){this.id===s&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}:this.build()}}return ei.SemanticTokensBuilder=r,ei}var Gu={},ak;function L8(){if(ak)return Gu;ak=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.ShowDocumentFeature=void 0;const t=$t(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return Gu.ShowDocumentFeature=e,Gu}var Wu={},ok;function M8(){if(ok)return Wu;ok=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.FileOperationsFeature=void 0;const t=$t(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(t.DidCreateFilesNotification.type,i=>{r(i)})}onDidRenameFiles(r){return this.connection.onNotification(t.DidRenameFilesNotification.type,i=>{r(i)})}onDidDeleteFiles(r){return this.connection.onNotification(t.DidDeleteFilesNotification.type,i=>{r(i)})}onWillCreateFiles(r){return this.connection.onRequest(t.WillCreateFilesRequest.type,(i,s)=>r(i,s))}onWillRenameFiles(r){return this.connection.onRequest(t.WillRenameFilesRequest.type,(i,s)=>r(i,s))}onWillDeleteFiles(r){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return Wu.FileOperationsFeature=e,Wu}var Hu={},uk;function B8(){if(uk)return Hu;uk=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.LinkedEditingRangeFeature=void 0;const t=$t(),e=n=>class extends n{onLinkedEditingRange(r){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0))}};return Hu.LinkedEditingRangeFeature=e,Hu}var Vu={},ck;function z8(){if(ck)return Vu;ck=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.TypeHierarchyFeature=void 0;const t=$t(),e=n=>class extends n{get typeHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onSupertypes:r=>{const i=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Vu.TypeHierarchyFeature=e,Vu}var Ku={},lk;function q8(){if(lk)return Ku;lk=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.InlineValueFeature=void 0;const t=$t(),e=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:r=>this.connection.onRequest(t.InlineValueRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return Ku.InlineValueFeature=e,Ku}var Yu={},dk;function j8(){if(dk)return Yu;dk=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.FoldingRangeFeature=void 0;const t=$t(),e=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:r=>{const i=t.FoldingRangeRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Yu.FoldingRangeFeature=e,Yu}var Xu={},fk;function U8(){if(fk)return Xu;fk=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.InlayHintFeature=void 0;const t=$t(),e=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:r=>this.connection.onRequest(t.InlayHintRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i))),resolve:r=>this.connection.onRequest(t.InlayHintResolveRequest.type,(i,s)=>r(i,s))}}};return Xu.InlayHintFeature=e,Xu}var Ju={},pk;function G8(){if(pk)return Ju;pk=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.DiagnosticFeature=void 0;const t=$t(),e=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:r=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:r=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Ju.DiagnosticFeature=e,Ju}var $s={},Qu={},hk;function mk(){if(hk)return Qu;hk=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.TextDocuments=void 0;const t=$t();class e{constructor(r){this._configuration=r,this._syncedDocuments=new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(r){this._willSaveWaitUntil=r}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(r){return this._syncedDocuments.get(r)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(r){r.__textDocumentSync=t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const a=s.textDocument,o=this._configuration.create(a.uri,a.languageId,a.version,a.text);this._syncedDocuments.set(a.uri,o);const u=Object.freeze({document:o});this._onDidOpen.fire(u),this._onDidChangeContent.fire(u)})),i.push(r.onDidChangeTextDocument(s=>{const a=s.textDocument,o=s.contentChanges;if(o.length===0)return;const{version:u}=a;if(u==null)throw new Error(`Received document change event for ${a.uri} without valid version identifier`);let c=this._syncedDocuments.get(a.uri);c!==void 0&&(c=this._configuration.update(c,o,u),this._syncedDocuments.set(a.uri,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),i.push(r.onDidCloseTextDocument(s=>{let a=this._syncedDocuments.get(s.textDocument.uri);a!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:a})))})),i.push(r.onWillSaveTextDocument(s=>{let a=this._syncedDocuments.get(s.textDocument.uri);a!==void 0&&this._onWillSave.fire(Object.freeze({document:a,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,a)=>{let o=this._syncedDocuments.get(s.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:s.reason}),a):[]})),i.push(r.onDidSaveTextDocument(s=>{let a=this._syncedDocuments.get(s.textDocument.uri);a!==void 0&&this._onDidSave.fire(Object.freeze({document:a}))})),t.Disposable.create(()=>{i.forEach(s=>s.dispose())})}}return Qu.TextDocuments=e,Qu}var gk;function yk(){if(gk)return $s;gk=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.NotebookDocuments=$s.NotebookSyncFeature=void 0;const t=$t(),e=mk(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:a=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,o=>{a(o)}),onDidChangeNotebookDocument:a=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,o=>{a(o)}),onDidSaveNotebookDocument:a=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,o=>{a(o)}),onDidCloseNotebookDocument:a=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,o=>{a(o)})}}};$s.NotebookSyncFeature=n;class r{onDidOpenTextDocument(a){return this.openHandler=a,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(a){this.openHandler&&this.openHandler(a)}onDidChangeTextDocument(a){return this.changeHandler=a,t.Disposable.create(()=>{this.changeHandler=a})}changeTextDocument(a){this.changeHandler&&this.changeHandler(a)}onDidCloseTextDocument(a){return this.closeHandler=a,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(a){this.closeHandler&&this.closeHandler(a)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(a){a instanceof e.TextDocuments?this._cellTextDocuments=a:this._cellTextDocuments=new e.TextDocuments(a),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(a){return this._cellTextDocuments.get(a.document)}getNotebookDocument(a){return this.notebookDocuments.get(a)}getNotebookCell(a){const o=this.notebookCellMap.get(a);return o&&o[0]}findNotebookDocumentForCell(a){const o=typeof a=="string"?a:a.document,u=this.notebookCellMap.get(o);return u&&u[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(a){const o=new r,u=[];return u.push(this.cellTextDocuments.listen(o)),u.push(a.notebooks.synchronization.onDidOpenNotebookDocument(c=>{this.notebookDocuments.set(c.notebookDocument.uri,c.notebookDocument);for(const l of c.cellTextDocuments)o.openTextDocument({textDocument:l});this.updateCellMap(c.notebookDocument),this._onDidOpen.fire(c.notebookDocument)})),u.push(a.notebooks.synchronization.onDidChangeNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l===void 0)return;l.version=c.notebookDocument.version;const d=l.metadata;let f=!1;const p=c.change;p.metadata!==void 0&&(f=!0,l.metadata=p.metadata);const h=[],w=[],D=[],g=[];if(p.cells!==void 0){const j=p.cells;if(j.structure!==void 0){const W=j.structure.array;if(l.cells.splice(W.start,W.deleteCount,...W.cells!==void 0?W.cells:[]),j.structure.didOpen!==void 0)for(const Z of j.structure.didOpen)o.openTextDocument({textDocument:Z}),h.push(Z.uri);if(j.structure.didClose)for(const Z of j.structure.didClose)o.closeTextDocument({textDocument:Z}),w.push(Z.uri)}if(j.data!==void 0){const W=new Map(j.data.map(Z=>[Z.document,Z]));for(let Z=0;Z<=l.cells.length;Z++){const J=W.get(l.cells[Z].document);if(J!==void 0){const de=l.cells.splice(Z,1,J);if(D.push({old:de[0],new:J}),W.delete(J.document),W.size===0)break}}}if(j.textContent!==void 0)for(const W of j.textContent)o.changeTextDocument({textDocument:W.document,contentChanges:W.changes}),g.push(W.document.uri)}this.updateCellMap(l);const v={notebookDocument:l};f&&(v.metadata={old:d,new:l.metadata});const R=[];for(const j of h)R.push(this.getNotebookCell(j));const k=[];for(const j of w)k.push(this.getNotebookCell(j));const A=[];for(const j of g)A.push(this.getNotebookCell(j));(R.length>0||k.length>0||D.length>0||A.length>0)&&(v.cells={added:R,removed:k,changed:{data:D,textContent:A}}),(v.metadata!==void 0||v.cells!==void 0)&&this._onDidChange.fire(v)})),u.push(a.notebooks.synchronization.onDidSaveNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),u.push(a.notebooks.synchronization.onDidCloseNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const d of c.cellTextDocuments)o.closeTextDocument({textDocument:d});this.notebookDocuments.delete(c.notebookDocument.uri);for(const d of l.cells)this.notebookCellMap.delete(d.document)}})),t.Disposable.create(()=>{u.forEach(c=>c.dispose())})}updateCellMap(a){for(const o of a.cells)this.notebookCellMap.set(o.document,[o,a])}}return $s.NotebookDocuments=i,$s}var Zu={},wk;function W8(){if(wk)return Zu;wk=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.MonikerFeature=void 0;const t=$t(),e=n=>class extends n{get moniker(){return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Zu.MonikerFeature=e,Zu}var vk;function bk(){if(vk)return Ue;vk=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.createConnection=Ue.combineFeatures=Ue.combineNotebooksFeatures=Ue.combineLanguagesFeatures=Ue.combineWorkspaceFeatures=Ue.combineWindowFeatures=Ue.combineClientFeatures=Ue.combineTracerFeatures=Ue.combineTelemetryFeatures=Ue.combineConsoleFeatures=Ue._NotebooksImpl=Ue._LanguagesImpl=Ue.BulkUnregistration=Ue.BulkRegistration=Ue.ErrorMessageTracker=void 0;const t=$t(),e=Oy(),n=Z$(),r=x8(),i=N8(),s=O8(),a=F8(),o=sk(),u=L8(),c=M8(),l=B8(),d=z8(),f=q8(),p=j8(),h=U8(),w=G8(),D=yk(),g=W8();function v(oe){if(oe!==null)return oe}class R{constructor(){this._messages=Object.create(null)}add(I){let B=this._messages[I];B||(B=0),B++,this._messages[I]=B}sendErrors(I){Object.keys(this._messages).forEach(B=>{I.window.showErrorMessage(B)})}}Ue.ErrorMessageTracker=R;class k{constructor(){}rawAttach(I){this._rawConnection=I}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(I){}initialize(I){}error(I){this.send(t.MessageType.Error,I)}warn(I){this.send(t.MessageType.Warning,I)}info(I){this.send(t.MessageType.Info,I)}log(I){this.send(t.MessageType.Log,I)}debug(I){this.send(t.MessageType.Debug,I)}send(I,B){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:I,message:B}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class A{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}showErrorMessage(I,...B){let ce={type:t.MessageType.Error,message:I,actions:B};return this.connection.sendRequest(t.ShowMessageRequest.type,ce).then(v)}showWarningMessage(I,...B){let ce={type:t.MessageType.Warning,message:I,actions:B};return this.connection.sendRequest(t.ShowMessageRequest.type,ce).then(v)}showInformationMessage(I,...B){let ce={type:t.MessageType.Info,message:I,actions:B};return this.connection.sendRequest(t.ShowMessageRequest.type,ce).then(v)}}const j=(0,u.ShowDocumentFeature)((0,r.ProgressFeature)(A));var W;(function(oe){function I(){return new Z}oe.create=I})(W||(Ue.BulkRegistration=W={}));class Z{constructor(){this._registrations=[],this._registered=new Set}add(I,B){const ce=e.string(I)?I:I.method;if(this._registered.has(ce))throw new Error(`${ce} is already added to this registration`);const z=n.generateUuid();this._registrations.push({id:z,method:ce,registerOptions:B||{}}),this._registered.add(ce)}asRegistrationParams(){return{registrations:this._registrations}}}var J;(function(oe){function I(){return new de(void 0,[])}oe.create=I})(J||(Ue.BulkUnregistration=J={}));class de{constructor(I,B){this._connection=I,this._unregistrations=new Map,B.forEach(ce=>{this._unregistrations.set(ce.method,ce)})}get isAttached(){return!!this._connection}attach(I){this._connection=I}add(I){this._unregistrations.set(I.method,I)}dispose(){let I=[];for(let ce of this._unregistrations.values())I.push(ce);let B={unregisterations:I};this._connection.sendRequest(t.UnregistrationRequest.type,B).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(I){const B=e.string(I)?I:I.method,ce=this._unregistrations.get(B);if(!ce)return!1;let z={unregisterations:[ce]};return this._connection.sendRequest(t.UnregistrationRequest.type,z).then(()=>{this._unregistrations.delete(B)},ue=>{this._connection.console.info(`Un-registering request handler for ${ce.id} failed.`)}),!0}}class N{attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}register(I,B,ce){return I instanceof Z?this.registerMany(I):I instanceof de?this.registerSingle1(I,B,ce):this.registerSingle2(I,B)}registerSingle1(I,B,ce){const z=e.string(B)?B:B.method,ue=n.generateUuid();let Le={registrations:[{id:ue,method:z,registerOptions:ce||{}}]};return I.isAttached||I.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,Le).then(Ke=>(I.add({id:ue,method:z}),I),Ke=>(this.connection.console.info(`Registering request handler for ${z} failed.`),Promise.reject(Ke)))}registerSingle2(I,B){const ce=e.string(I)?I:I.method,z=n.generateUuid();let ue={registrations:[{id:z,method:ce,registerOptions:B||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,ue).then(Le=>t.Disposable.create(()=>{this.unregisterSingle(z,ce).catch(()=>{this.connection.console.info(`Un-registering capability with id ${z} failed.`)})}),Le=>(this.connection.console.info(`Registering request handler for ${ce} failed.`),Promise.reject(Le)))}unregisterSingle(I,B){let ce={unregisterations:[{id:I,method:B}]};return this.connection.sendRequest(t.UnregistrationRequest.type,ce).catch(()=>{this.connection.console.info(`Un-registering request handler for ${I} failed.`)})}registerMany(I){let B=I.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,B).then(()=>new de(this._connection,B.registrations.map(ce=>({id:ce.id,method:ce.method}))),ce=>(this.connection.console.info("Bulk registration failed."),Promise.reject(ce)))}}class ${constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}applyEdit(I){function B(z){return z&&!!z.edit}let ce=B(I)?I:{edit:I};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,ce)}}const T=(0,c.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)($)));class O{constructor(){this._trace=t.Trace.Off}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}set trace(I){this._trace=I}log(I,B){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:I,verbose:this._trace===t.Trace.Verbose?B:void 0}).catch(()=>{})}}class V{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}logEvent(I){this.connection.sendNotification(t.TelemetryEventNotification.type,I).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class M{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}attachWorkDoneProgress(I){return(0,r.attachWorkDone)(this.connection,I)}attachPartialResultProgress(I,B){return(0,r.attachPartialResult)(this.connection,B)}}Ue._LanguagesImpl=M;const H=(0,p.FoldingRangeFeature)((0,g.MonikerFeature)((0,w.DiagnosticFeature)((0,h.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,o.SemanticTokensFeature)((0,a.CallHierarchyFeature)(M)))))))));class be{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}attachWorkDoneProgress(I){return(0,r.attachWorkDone)(this.connection,I)}attachPartialResultProgress(I,B){return(0,r.attachPartialResult)(this.connection,B)}}Ue._NotebooksImpl=be;const te=(0,D.NotebookSyncFeature)(be);function C(oe,I){return function(B){return I(oe(B))}}Ue.combineConsoleFeatures=C;function pe(oe,I){return function(B){return I(oe(B))}}Ue.combineTelemetryFeatures=pe;function Qe(oe,I){return function(B){return I(oe(B))}}Ue.combineTracerFeatures=Qe;function ct(oe,I){return function(B){return I(oe(B))}}Ue.combineClientFeatures=ct;function U(oe,I){return function(B){return I(oe(B))}}Ue.combineWindowFeatures=U;function K(oe,I){return function(B){return I(oe(B))}}Ue.combineWorkspaceFeatures=K;function _e(oe,I){return function(B){return I(oe(B))}}Ue.combineLanguagesFeatures=_e;function se(oe,I){return function(B){return I(oe(B))}}Ue.combineNotebooksFeatures=se;function we(oe,I){function B(z,ue,Le){return z&&ue?Le(z,ue):z||ue}return{__brand:"features",console:B(oe.console,I.console,C),tracer:B(oe.tracer,I.tracer,Qe),telemetry:B(oe.telemetry,I.telemetry,pe),client:B(oe.client,I.client,ct),window:B(oe.window,I.window,U),workspace:B(oe.workspace,I.workspace,K),languages:B(oe.languages,I.languages,_e),notebooks:B(oe.notebooks,I.notebooks,se)}}Ue.combineFeatures=we;function Te(oe,I,B){const ce=B&&B.console?new(B.console(k)):new k,z=oe(ce);ce.rawAttach(z);const ue=B&&B.tracer?new(B.tracer(O)):new O,Le=B&&B.telemetry?new(B.telemetry(V)):new V,Ke=B&&B.client?new(B.client(N)):new N,ie=B&&B.window?new(B.window(j)):new j,ke=B&&B.workspace?new(B.workspace(T)):new T,ne=B&&B.languages?new(B.languages(H)):new H,ve=B&&B.notebooks?new(B.notebooks(te)):new te,Ne=[ce,ue,Le,Ke,ie,ke,ne,ve];function lt(Y){return Y instanceof Promise?Y:e.thenable(Y)?new Promise((X,le)=>{Y.then(zt=>X(zt),zt=>le(zt))}):Promise.resolve(Y)}let Ge,Ot,Bt,nn={listen:()=>z.listen(),sendRequest:(Y,...X)=>z.sendRequest(e.string(Y)?Y:Y.method,...X),onRequest:(Y,X)=>z.onRequest(Y,X),sendNotification:(Y,X)=>{const le=e.string(Y)?Y:Y.method;return z.sendNotification(le,X)},onNotification:(Y,X)=>z.onNotification(Y,X),onProgress:z.onProgress,sendProgress:z.sendProgress,onInitialize:Y=>(Ot=Y,{dispose:()=>{Ot=void 0}}),onInitialized:Y=>z.onNotification(t.InitializedNotification.type,Y),onShutdown:Y=>(Ge=Y,{dispose:()=>{Ge=void 0}}),onExit:Y=>(Bt=Y,{dispose:()=>{Bt=void 0}}),get console(){return ce},get telemetry(){return Le},get tracer(){return ue},get client(){return Ke},get window(){return ie},get workspace(){return ke},get languages(){return ne},get notebooks(){return ve},onDidChangeConfiguration:Y=>z.onNotification(t.DidChangeConfigurationNotification.type,Y),onDidChangeWatchedFiles:Y=>z.onNotification(t.DidChangeWatchedFilesNotification.type,Y),__textDocumentSync:void 0,onDidOpenTextDocument:Y=>z.onNotification(t.DidOpenTextDocumentNotification.type,Y),onDidChangeTextDocument:Y=>z.onNotification(t.DidChangeTextDocumentNotification.type,Y),onDidCloseTextDocument:Y=>z.onNotification(t.DidCloseTextDocumentNotification.type,Y),onWillSaveTextDocument:Y=>z.onNotification(t.WillSaveTextDocumentNotification.type,Y),onWillSaveTextDocumentWaitUntil:Y=>z.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,Y),onDidSaveTextDocument:Y=>z.onNotification(t.DidSaveTextDocumentNotification.type,Y),sendDiagnostics:Y=>z.sendNotification(t.PublishDiagnosticsNotification.type,Y),onHover:Y=>z.onRequest(t.HoverRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),void 0)),onCompletion:Y=>z.onRequest(t.CompletionRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onCompletionResolve:Y=>z.onRequest(t.CompletionResolveRequest.type,Y),onSignatureHelp:Y=>z.onRequest(t.SignatureHelpRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),void 0)),onDeclaration:Y=>z.onRequest(t.DeclarationRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onDefinition:Y=>z.onRequest(t.DefinitionRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onTypeDefinition:Y=>z.onRequest(t.TypeDefinitionRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onImplementation:Y=>z.onRequest(t.ImplementationRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onReferences:Y=>z.onRequest(t.ReferencesRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onDocumentHighlight:Y=>z.onRequest(t.DocumentHighlightRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onDocumentSymbol:Y=>z.onRequest(t.DocumentSymbolRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onWorkspaceSymbol:Y=>z.onRequest(t.WorkspaceSymbolRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onWorkspaceSymbolResolve:Y=>z.onRequest(t.WorkspaceSymbolResolveRequest.type,Y),onCodeAction:Y=>z.onRequest(t.CodeActionRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onCodeActionResolve:Y=>z.onRequest(t.CodeActionResolveRequest.type,(X,le)=>Y(X,le)),onCodeLens:Y=>z.onRequest(t.CodeLensRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onCodeLensResolve:Y=>z.onRequest(t.CodeLensResolveRequest.type,(X,le)=>Y(X,le)),onDocumentFormatting:Y=>z.onRequest(t.DocumentFormattingRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),void 0)),onDocumentRangeFormatting:Y=>z.onRequest(t.DocumentRangeFormattingRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),void 0)),onDocumentOnTypeFormatting:Y=>z.onRequest(t.DocumentOnTypeFormattingRequest.type,(X,le)=>Y(X,le)),onRenameRequest:Y=>z.onRequest(t.RenameRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),void 0)),onPrepareRename:Y=>z.onRequest(t.PrepareRenameRequest.type,(X,le)=>Y(X,le)),onDocumentLinks:Y=>z.onRequest(t.DocumentLinkRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onDocumentLinkResolve:Y=>z.onRequest(t.DocumentLinkResolveRequest.type,(X,le)=>Y(X,le)),onDocumentColor:Y=>z.onRequest(t.DocumentColorRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onColorPresentation:Y=>z.onRequest(t.ColorPresentationRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onFoldingRanges:Y=>z.onRequest(t.FoldingRangeRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onSelectionRanges:Y=>z.onRequest(t.SelectionRangeRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),(0,r.attachPartialResult)(z,X))),onExecuteCommand:Y=>z.onRequest(t.ExecuteCommandRequest.type,(X,le)=>Y(X,le,(0,r.attachWorkDone)(z,X),void 0)),dispose:()=>z.dispose()};for(let Y of Ne)Y.attach(nn);return z.onRequest(t.InitializeRequest.type,Y=>{I.initialize(Y),e.string(Y.trace)&&(ue.trace=t.Trace.fromString(Y.trace));for(let X of Ne)X.initialize(Y.capabilities);if(Ot){let X=Ot(Y,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(z,Y),void 0);return lt(X).then(le=>{if(le instanceof t.ResponseError)return le;let zt=le;zt||(zt={capabilities:{}});let Ft=zt.capabilities;Ft||(Ft={},zt.capabilities=Ft),Ft.textDocumentSync===void 0||Ft.textDocumentSync===null?Ft.textDocumentSync=e.number(nn.__textDocumentSync)?nn.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Ft.textDocumentSync)&&!e.number(Ft.textDocumentSync.change)&&(Ft.textDocumentSync.change=e.number(nn.__textDocumentSync)?nn.__textDocumentSync:t.TextDocumentSyncKind.None);for(let cr of Ne)cr.fillServerCapabilities(Ft);return zt})}else{let X={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let le of Ne)le.fillServerCapabilities(X.capabilities);return X}}),z.onRequest(t.ShutdownRequest.type,()=>{if(I.shutdownReceived=!0,Ge)return Ge(new t.CancellationTokenSource().token)}),z.onNotification(t.ExitNotification.type,()=>{try{Bt&&Bt()}finally{I.shutdownReceived?I.exit(0):I.exit(1)}}),z.onNotification(t.SetTraceNotification.type,Y=>{ue.trace=t.Trace.fromString(Y.value)}),nn}return Ue.createConnection=Te,Ue}var pn={},Dk;function H8(){if(Dk)return pn;Dk=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.resolveModulePath=pn.FileSystem=pn.resolveGlobalYarnPath=pn.resolveGlobalNodePath=pn.resolve=pn.uriToFilePath=void 0;const t=V1,e=fr,n=ea,r=jb;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let p=f.path.split("/");for(var h=0,w=p.length;h<w;h++)p[h]=decodeURIComponent(p[h]);if(process.platform==="win32"&&p.length>1){let D=p[0],g=p[1];D.length===0&&g.length>1&&g[1]===":"&&p.shift()}return e.normalize(p.join("/"))}pn.uriToFilePath=i;function s(){return process.platform==="win32"}function a(d,f,p,h){const w="NODE_PATH",D=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((g,v)=>{let R=process.env,k=Object.create(null);Object.keys(R).forEach(A=>k[A]=R[A]),f&&n.existsSync(f)&&(k[w]?k[w]=f+e.delimiter+k[w]:k[w]=f,h&&h(`NODE_PATH value is: ${k[w]}`)),k.ELECTRON_RUN_AS_NODE="1";try{let A=(0,r.fork)("",[],{cwd:p,env:k,execArgv:["-e",D]});if(A.pid===void 0){v(new Error(`Starting process to resolve node module ${d} failed`));return}A.on("error",W=>{v(W)}),A.on("message",W=>{W.c==="r"&&(A.send({c:"e"}),W.s?g(W.r):v(new Error(`Failed to resolve module: ${d}`)))});let j={c:"rs",a:d};A.send(j)}catch(A){v(A)}})}pn.resolve=a;function o(d){let f="npm";const p=Object.create(null);Object.keys(process.env).forEach(D=>p[D]=process.env[D]),p.NO_UPDATE_NOTIFIER="true";const h={encoding:"utf8",env:p};s()&&(f="npm.cmd",h.shell=!0);let w=()=>{};try{process.on("SIGPIPE",w);let D=(0,r.spawnSync)(f,["config","get","prefix"],h).stdout;if(!D){d&&d("'npm config get prefix' didn't return a value.");return}let g=D.trim();return d&&d(`'npm config get prefix' value is: ${g}`),g.length>0?s()?e.join(g,"node_modules"):e.join(g,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",w)}}pn.resolveGlobalNodePath=o;function u(d){let f="yarn",p={encoding:"utf8"};s()&&(f="yarn.cmd",p.shell=!0);let h=()=>{};try{process.on("SIGPIPE",h);let w=(0,r.spawnSync)(f,["global","dir","--json"],p),D=w.stdout;if(!D){d&&(d("'yarn global dir' didn't return a value."),w.stderr&&d(w.stderr));return}let g=D.trim().split(/\r?\n/);for(let v of g)try{let R=JSON.parse(v);if(R.type==="log")return e.join(R.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",h)}}pn.resolveGlobalYarnPath=u;var c;(function(d){let f;function p(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=p;function h(w,D){return p()?e.normalize(D).indexOf(e.normalize(w))===0:e.normalize(D).toLowerCase().indexOf(e.normalize(w).toLowerCase())===0}d.isParent=h})(c||(pn.FileSystem=c={}));function l(d,f,p,h){return p?(e.isAbsolute(p)||(p=e.join(d,p)),a(f,p,p,h).then(w=>c.isParent(p,w)?w:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,w=>a(f,o(h),d,h))):a(f,o(h),d,h)}return pn.resolveModulePath=l,pn}var Uy,Ek;function Rk(){return Ek||(Ek=1,Uy=$t()),Uy}var ec={},tc={},Tk;function V8(){if(Tk)return tc;Tk=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.InlineCompletionFeature=void 0;const t=$t(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return tc.InlineCompletionFeature=e,tc}var Sk;function K8(){return Sk||(Sk=1,function(t){var e=ec.__createBinding||(Object.create?function(u,c,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(c,l);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(u,d,f)}:function(u,c,l,d){d===void 0&&(d=l),u[d]=c[l]}),n=ec.__exportStar||function(u,c){for(var l in u)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,u,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=sk();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=V8();n($t(),t);const s=mk();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const a=yk();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return a.NotebookDocuments}}),n(bk(),t);var o;(function(u){u.all={__brand:"features",languages:i.InlineCompletionFeature}})(o||(t.ProposedFeatures=o={}))}(ec)),ec}var $k;function kk(){return $k||($k=1,function(t){var e=Su.__createBinding||(Object.create?function(g,v,R,k){k===void 0&&(k=R);var A=Object.getOwnPropertyDescriptor(v,R);(!A||("get"in A?!v.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return v[R]}}),Object.defineProperty(g,k,A)}:function(g,v,R,k){k===void 0&&(k=R),g[k]=v[R]}),n=Su.__exportStar||function(g,v){for(var R in g)R!=="default"&&!Object.prototype.hasOwnProperty.call(v,R)&&e(v,g,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=M1,i=Oy(),s=bk(),a=H8(),o=Rk();n(Rk(),t),n(K8(),t);var u;(function(g){g.uriToFilePath=a.uriToFilePath,g.resolveGlobalNodePath=a.resolveGlobalNodePath,g.resolveGlobalYarnPath=a.resolveGlobalYarnPath,g.resolve=a.resolve,g.resolveModulePath=a.resolveModulePath})(u||(t.Files=u={}));function c(){}let l=!1,d;function f(){const g="--clientProcessId";function v(R){try{let k=parseInt(R);isNaN(k)||(d=setInterval(()=>{try{process.kill(k,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let R=2;R<process.argv.length;R++){let k=process.argv[R];if(k===g&&R+1<process.argv.length){v(process.argv[R+1]);return}else{let A=k.split("=");A[0]===g&&v(A[1])}}}f();const p={initialize:g=>{const v=g.processId;i.number(v)&&d===void 0&&setInterval(()=>{try{process.kill(v,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(g){l=g},exit:g=>{process.exit(g)}};function h(g,v,R,k){let A,j,W,Z;return g!==void 0&&g.__brand==="features"&&(A=g,g=v,v=R,R=k),o.ConnectionStrategy.is(g)||o.ConnectionOptions.is(g)?Z=g:(j=g,W=v,Z=R),w(j,W,Z,A)}t.createConnection=h;function w(g,v,R,k){let A=!1;if(!g&&!v&&process.argv.length>2){let J,de,N=process.argv.slice(2);for(let $=0;$<N.length;$++){let T=N[$];if(T==="--node-ipc"){g=new o.IPCMessageReader(process),v=new o.IPCMessageWriter(process);break}else if(T==="--stdio"){A=!0,g=process.stdin,v=process.stdout;break}else if(T==="--socket"){J=parseInt(N[$+1]);break}else if(T==="--pipe"){de=N[$+1];break}else{var j=T.split("=");if(j[0]==="--socket"){J=parseInt(j[1]);break}else if(j[0]==="--pipe"){de=j[1];break}}}if(J){let $=(0,o.createServerSocketTransport)(J);g=$[0],v=$[1]}else if(de){let $=(0,o.createServerPipeTransport)(de);g=$[0],v=$[1]}}var W="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!g)throw new Error("Connection input stream is not set. "+W);if(!v)throw new Error("Connection output stream is not set. "+W);if(i.func(g.read)&&i.func(g.on)){let J=g;J.on("end",()=>{process.exit(l?0:1)}),J.on("close",()=>{process.exit(l?0:1)})}const Z=J=>{const de=(0,o.createProtocolConnection)(g,v,J,R);return A&&D(J),de};return(0,s.createConnection)(Z,p,k)}function D(g){function v(k){return k.map(A=>typeof A=="string"?A:(0,r.inspect)(A)).join(" ")}const R=new Map;console.assert=function(A,...j){if(!A)if(j.length===0)g.error("Assertion failed");else{const[W,...Z]=j;g.error(`Assertion failed: ${W} ${v(Z)}`)}},console.count=function(A="default"){const j=String(A);let W=R.get(j)??0;W+=1,R.set(j,W),g.log(`${j}: ${j}`)},console.countReset=function(A){A===void 0?R.clear():R.delete(String(A))},console.debug=function(...A){g.log(v(A))},console.dir=function(A,j){g.log((0,r.inspect)(A,j))},console.log=function(...A){g.log(v(A))},console.error=function(...A){g.error(v(A))},console.trace=function(...A){const j=new Error().stack.replace(/(.+\n){2}/,"");let W="Trace";A.length!==0&&(W+=`: ${v(A)}`),g.log(`${W}
|
|
160
|
-
${j}`)},console.warn=function(...A){g.warn(v(A))}}}(Su)),Su}var ge=kk();function Ck(t,e){const n={stacks:t,tokens:e};return Y8(n),n.stacks.flat().forEach(i=>{i.property=void 0}),_k(n.stacks).map(i=>i[i.length-1])}function Gy(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],a=e.feature;if(r.has(a))return[];fi(a)||r.add(a);let o,u=a;for(;u.$container;)if(fi(u.$container)){o=u.$container;break}else if(Om(u.$container))u=u.$container;else break;if(ND(u.cardinality)){const c=Ea({next:{feature:u,type:e.type},cardinalities:n,visited:r,plus:i});for(const l of c)i.add(l.feature);s.push(...c)}if(o){const c=o.elements.indexOf(u);c!==void 0&&c<o.elements.length-1&&s.push(...Ak({feature:o,type:e.type},c+1,n,r,i)),s.every(l=>aa(l.feature.cardinality,l.feature)||aa(n.get(l.feature))||i.has(l.feature))&&s.push(...Gy({next:{feature:o,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function Wy(t){return bt(t)&&(t={feature:t}),Ea({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Ea(t){var e,n,r;const{next:i,cardinalities:s,visited:a,plus:o}=t;if(i===void 0)return[];const{feature:u,type:c}=i;if(fi(u))return a.has(u)?[]:(a.add(u),Ak(i,0,s,a,o).map(l=>sp(l,u.cardinality,s)));if(zm(u)||qm(u))return u.elements.flatMap(l=>Ea({next:{feature:l,type:c,property:i.property},cardinalities:s,visited:a,plus:o})).map(l=>sp(l,u.cardinality,s));if(hr(u)){const l={feature:u.terminal,type:c,property:(e=i.property)!==null&&e!==void 0?e:u.feature};return Ea({next:l,cardinalities:s,visited:a,plus:o}).map(d=>sp(d,u.cardinality,s))}else{if(ts(u))return Gy({next:{feature:u,type:Ko(u),property:(n=i.property)!==null&&n!==void 0?n:u.feature},cardinalities:s,visited:a,plus:o});if(Nr(u)&&Yt(u.rule.ref)){const l=u.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=ns(l))!==null&&r!==void 0?r:l.name,property:i.property};return Ea({next:d,cardinalities:s,visited:a,plus:o}).map(f=>sp(f,u.cardinality,s))}else return[i]}}function sp(t,e,n){return n.set(t.feature,e),t}function Ak(t,e,n,r,i){var s;const a=[];let o;for(;e<t.feature.elements.length&&(o={feature:t.feature.elements[e++],type:t.type},a.push(...Ea({next:o,cardinalities:n,visited:r,plus:i})),!!aa((s=o.feature.cardinality)!==null&&s!==void 0?s:n.get(o.feature),o.feature)););return a}function Y8(t){for(const e of t.tokens){const n=_k(t.stacks,e);t.stacks=n}}function _k(t,e){const n=[];for(const r of t)n.push(...X8(r,e));return n}function X8(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(J8)),i=[];for(;t.length>0;){const s=t.pop(),a=Gy({next:s,cardinalities:n,plus:r,visited:new Set}).filter(o=>e?Hy(o.feature,e):!0);for(const o of a)i.push([...t,o]);if(!a.every(o=>aa(o.feature.cardinality,o.feature)||aa(n.get(o.feature))))break}return i}function J8(t){if(t.cardinality==="+")return!0;const e=Xt(t,hr);return!!(e&&e.cardinality==="+")}function Hy(t,e){if(mr(t))return t.value===e.image;if(Nr(t))return Q8(t.rule.ref,e);if(Po(t)){const n=Xm(t);if(n)return Hy(n,e)}return!1}function Q8(t,e){return Yt(t)?Wy(t.definition).some(r=>Hy(r.feature,e)):xr(t)?Yo(t).test(e.image):!1}function Z8(t){const e=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.triggerCharacters)!==null&&i!==void 0?i:[]}))),n=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:n.length>0?n:void 0}}class Pk{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,n,r){const i=[],s=this.buildContexts(e,n.position),a=(c,l)=>{const d=this.fillCompletionItem(c,l);d&&i.push(d)},o=c=>mr(c.feature)?c.feature.value:c.feature,u=[];for(const c of s)if(await Promise.all(et(c.features).distinct(o).exclude(u).map(l=>this.completionFor(c,l,a))),u.push(...c.features),!this.continueCompletion(i))break;return ge.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return et(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:ge.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const u=Vd(this.grammar),c=Wy({feature:u.definition,type:ns(u)});return s.length>0?(s.shift(),Ck(c.map(l=>[l]),s)):c}const a=[...s].splice(i.tokenIndex);return Ck([i.elementStack.map(u=>({feature:u}))],a)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const a=e.textDocument,o=a.getText(),u=a.offsetAt(n),c={document:e,textDocument:a,offset:u,position:n},l=this.findDataTypeRuleStart(s,u);if(l){const[v,R]=l,k=(r=Pd(s,v))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},c),{node:k,tokenOffset:v,tokenEndOffset:R,features:this.findFeaturesAt(a,v)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:p,previousTokenEnd:h}=this.backtrackToAnyToken(o,u);let w=d;u<=d&&p!==void 0&&(w=p);const D=(i=Pd(s,w))===null||i===void 0?void 0:i.astNode;let g=!0;if(p!==void 0&&h!==void 0&&h===u&&(yield Object.assign(Object.assign({},c),{node:D,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(a,p)}),g=this.performNextTokenCompletion(e,o.substring(p,h),p,h),g&&(yield Object.assign(Object.assign({},c),{node:D,tokenOffset:h,tokenEndOffset:h,features:this.findFeaturesAt(a,h)}))),D)g&&(yield Object.assign(Object.assign({},c),{node:D,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(a,d)}));else{const v=Vd(this.grammar);if(!v)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},c),{tokenOffset:d,tokenEndOffset:f,features:Wy(v.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=di(e,n,this.grammarConfig.nameRegexp),a=!!(!((r=Xt(s?.grammarSource,Yt))===null||r===void 0)&&r.dataType);if(a){for(;a;)s=s?.container,a=!!(!((i=Xt(s?.grammarSource,Yt))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,n){const r=this.lexer.tokenize(e).tokens;if(r.length===0)return{nextTokenStart:n,nextTokenEnd:n};let i;for(const s of r){if(s.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=n)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,n,r){if(mr(n.feature))return this.completionForKeyword(e,n.feature,r);if(Po(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=Xt(n.feature,hr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},Gm(this.astReflection,s));const a={reference:{$refText:""},container:s,property:i.feature};try{for(const o of this.getReferenceCandidates(a,e))r(e,this.createReferenceCompletionItem(o))}catch(o){console.error(o)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.nodeKindProvider.getCompletionItemKind(e),r=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:n,documentation:r,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;const n=this.documentationProvider.getDocumentation(e.node);if(n)return{kind:"markdown",value:n}}completionForKeyword(e,n,r){this.filterKeyword(e,n)&&r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return ge.CompletionItemKind.Keyword}filterKeyword(e,n){return new RegExp("\\p{L}","u").test(n.value)}fillCompletionItem(e,n){var r,i;let s;if(typeof n.label=="string")s=n.label;else if("node"in n){const c=this.nameProvider.getName(n.node);if(!c)return;s=c}else if("nodeDescription"in n)s=n.nodeDescription.name;else return;let a;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?a=n.textEdit.newText:typeof n.insertText=="string"?a=n.insertText:a=s;const o=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,s,a);return o?{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:o,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const a=e.textDocument.positionAt(e.tokenOffset),o=e.position;return{newText:r,range:{start:a,end:o}}}else return}}class e4{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n,r){const i=e.parseResult.value;if(i.$cstNode){const s=i.$cstNode,a=di(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(a)return this.collectLocationLinks(a,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[ge.LocationLink.create(i.targetDocument.textDocument.uri,((r=i.target.astNode.$cstNode)!==null&&r!==void 0?r:i.target).range,i.target.range,i.source.range)]}findLink(e){const n=this.references.findDeclarationNode(e);if(n?.astNode){const r=ht(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class Ik{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=di(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const a=this.references.findDeclaration(s);if(a){const o=Rt.equals(ht(a).uri,e.uri),u={documentUri:e.uri,includeDeclaration:o};return this.references.findReferences(a,u).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range)}}class t4{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,n,r){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,n){const r=n.$cstNode,i=this.nameProvider.getNameNode(n);if(i&&r){const s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||i.text,range:r.range,selectionRange:i.range,children:this.getChildSymbols(e,n)}]}else return this.getChildSymbols(e,n)||[]}getChildSymbols(e,n){const r=[];for(const i of Go(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class n4{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let n=!1;e.lsp.LanguageServer.onInitialize(r=>{var i,s;n=!!(!((s=(i=r.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=et(e.ServiceRegistry.all).flatMap(r=>r.LanguageMetaData.fileExtensions).map(r=>r.startsWith(".")?r.substring(1):r).distinct().toArray();if(n.length>0){const r=e.lsp.Connection,i={watchers:[{globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}]};r?.client.register(ge.DidChangeWatchedFilesNotification.type,i)}}fireDocumentUpdate(e,n){e=e.filter(r=>this.serviceRegistry.hasServices(r)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(r=>this.documentBuilder.update(e,n,r))}).catch(r=>{console.error("Workspace initialization failed. Could not perform document update.",r)})}didChangeContent(e){this.fireDocumentUpdate([Wt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=et(e.changes).filter(i=>i.type!==ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Wt.parse(i.uri)).toArray(),r=et(e.changes).filter(i=>i.type===ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Wt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class r4{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=a=>i.push(a);return this.collectFolding(e,s),i}collectFolding(e,n){var r;const i=(r=e.parseResult)===null||r===void 0?void 0:r.value;if(i){if(this.shouldProcessContent(i)){const s=gr(i).iterator();let a;do if(a=s.next(),!a.done){const o=a.value;this.shouldProcess(o)&&this.collectObjectFolding(e,o,n),this.shouldProcessContent(o)||s.prune()}while(!a.done)}this.collectCommentFolding(e,i,n)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,n,r){const i=n.$cstNode;if(i){const s=this.toFoldingRange(e,i);s&&r(s)}}collectCommentFolding(e,n,r){const i=n.$cstNode;if(i){for(const s of uD(i))if(this.commentNames.includes(s.tokenType.name)){const a=this.toFoldingRange(e,s,ge.FoldingRangeKind.Comment);a&&r(a)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let a=i.end;if(!(a.line-s.line<2))return this.includeLastFoldingLine(n,r)||(a=e.textDocument.positionAt(e.textDocument.offsetAt({line:a.line,character:0})-1)),ge.FoldingRange.create(s.line,a.line,s.character,a.character,r)}includeLastFoldingLine(e,n){if(n===ge.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class i4{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const a=n.length;for(let o=0;o<a;o++){const u=n.charCodeAt(o),c=e.charCodeAt(s);if((u===c||this.toUpperCharCode(u)===this.toUpperCharCode(c))&&(r||(r=i===void 0||this.isWordTransition(i,u)),r&&s++,s===e.length))return!0;i=u}return!1}isWordTransition(e,n){return xk<=e&&e<=Nk&&s4<=n&&n<=a4||e===Ok&&n!==Ok}toUpperCharCode(e){return xk<=e&&e<=Nk?e-32:e}}const xk=97,Nk=122,s4=65,a4=90,Ok=95;class Fk{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,n){var r,i;const s=(i=(r=e.parseResult)===null||r===void 0?void 0:r.value)===null||i===void 0?void 0:i.$cstNode;if(s){const a=e.textDocument.offsetAt(n.position),o=di(s,a,this.grammarConfig.nameRegexp);if(o&&o.offset+o.length>a){const u=this.references.findDeclaration(o);if(u)return this.getAstNodeHoverContent(u)}}}}class o4 extends Fk{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){const n=this.documentationProvider.getDocumentation(e);if(n)return{contents:{kind:"markdown",value:n}}}}var ap=$t();const u4={[ge.SemanticTokenTypes.class]:0,[ge.SemanticTokenTypes.comment]:1,[ge.SemanticTokenTypes.enum]:2,[ge.SemanticTokenTypes.enumMember]:3,[ge.SemanticTokenTypes.event]:4,[ge.SemanticTokenTypes.function]:5,[ge.SemanticTokenTypes.interface]:6,[ge.SemanticTokenTypes.keyword]:7,[ge.SemanticTokenTypes.macro]:8,[ge.SemanticTokenTypes.method]:9,[ge.SemanticTokenTypes.modifier]:10,[ge.SemanticTokenTypes.namespace]:11,[ge.SemanticTokenTypes.number]:12,[ge.SemanticTokenTypes.operator]:13,[ge.SemanticTokenTypes.parameter]:14,[ge.SemanticTokenTypes.property]:15,[ge.SemanticTokenTypes.regexp]:16,[ge.SemanticTokenTypes.string]:17,[ge.SemanticTokenTypes.struct]:18,[ge.SemanticTokenTypes.type]:19,[ge.SemanticTokenTypes.typeParameter]:20,[ge.SemanticTokenTypes.variable]:21,[ge.SemanticTokenTypes.decorator]:22},c4={[ge.SemanticTokenModifiers.abstract]:1,[ge.SemanticTokenModifiers.async]:2,[ge.SemanticTokenModifiers.declaration]:4,[ge.SemanticTokenModifiers.defaultLibrary]:8,[ge.SemanticTokenModifiers.definition]:16,[ge.SemanticTokenModifiers.deprecated]:32,[ge.SemanticTokenModifiers.documentation]:64,[ge.SemanticTokenModifiers.modification]:128,[ge.SemanticTokenModifiers.readonly]:256,[ge.SemanticTokenModifiers.static]:512};function l4(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const a of t)a&&(a.legend.tokenTypes.forEach((o,u)=>{const c=e[u];if(c&&c!==o)throw new Error(`Cannot merge '${c}' and '${o}' token types. They use the same index ${u}.`);e[u]=o}),a.legend.tokenModifiers.forEach((o,u)=>{const c=n[u];if(c&&c!==o)throw new Error(`Cannot merge '${c}' and '${o}' token modifier. They use the same index ${u}.`);n[u]=o}),a.full?typeof a.full=="object"&&!a.full.delta&&(i=!1):r=!1,a.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class d4 extends ge.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,n,r,i,s){this._tokens.push({line:e,char:n,length:r,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(const e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,n){return e.line===n.line?e.char-n.char:e.line-n.line}}class f4{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(n=>{this.tokensBuilders.delete(n.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(n=>{var r;this.initialize((r=n.capabilities.textDocument)===null||r===void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return u4}get tokenModifiers(){return c4}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=rt.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=rt.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,n,r=rt.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.buildEdits()}createAcceptor(){return n=>{"line"in n?this.highlightToken({range:{start:{line:n.line,character:n.char},end:{line:n.line,character:n.char+n.length}},type:n.type,modifier:n.modifier}):"range"in n?this.highlightToken(n):"keyword"in n?this.highlightKeyword(n):"property"in n?this.highlightProperty(n):this.highlightNode({node:n.cst,type:n.type,modifier:n.modifier})}}getDocumentTokensBuilder(e){const n=this.tokensBuilders.get(e.uri.toString());if(n)return n;const r=new d4;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=Or(i,{range:this.currentRange}).iterator();let a;do if(a=s.next(),!a.done){await At(r);const o=a.value;this.highlightElement(o,n)==="prune"&&s.prune()}while(!a.done)}highlightToken(e){var n;const{range:r,type:i}=e;let s=e.modifier;if(this.currentRange&&!Am(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const a=this.tokenTypes[i];let o=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const d=this.tokenModifiers[l];o|=d}}const u=r.start.line,c=r.end.line;if(u===c){const l=r.start.character,d=r.end.character-l;this.currentTokensBuilder.push(u,l,d,a,o)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(u,l,f-d,a,o)}else{const l=r.start;let d=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(l.line,l.character,d-l.character-1,a,o);for(let f=u+1;f<c;f++){const p=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-p-1,a,o)}this.currentTokensBuilder.push(c,0,r.end.character,a,o)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=Jt(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...sa(e.node.$cstNode,e.property));const{type:r,modifier:i}=e;for(const s of n)this.highlightNode({node:s,type:r,modifier:i})}highlightKeyword(e){const{node:n,keyword:r,type:i,index:s,modifier:a}=e,o=[];if(typeof s=="number"){const u=Vo(n.$cstNode,r,s);u&&o.push(u)}else o.push(...Qm(n.$cstNode,r));for(const u of o)this.highlightNode({node:u,type:i,modifier:a})}highlightNode(e){const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var Lk;(function(t){function e(r,i,s){const a=new Map;Object.entries(i).forEach(([c,l])=>a.set(l,c));let o=0,u=0;return n(r.data,5).map(c=>{o+=c[0],c[0]!==0&&(u=0),u+=c[1];const l=c[2];return{offset:s.textDocument.offsetAt({line:o,character:u}),tokenType:a.get(c[3]),tokenModifiers:c[4],text:s.textDocument.getText({start:{line:o,character:u},end:{line:o,character:u+l}})}})}t.decode=e;function n(r,i){const s=[];for(let a=0;a<r.length;a+=i){const o=r.slice(a,a+i);s.push(o)}return s}})(Lk||(Lk={}));function p4(t){const e=[],n=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&n.push(...i.retriggerCharacters)});const r={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0};return r.triggerCharacters?r:void 0}class h4{constructor(e){this.onInitializeEmitter=new ap.Emitter,this.onInitializedEmitter=new ap.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){Ay(this.services),this.services.ServiceRegistry.all.forEach(e=>Ay(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var n,r,i,s;const a=this.services.lsp.DocumentUpdateHandler,o=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,u=this.services.ServiceRegistry.all,c=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.Formatter}),l=u.map(te=>{var C,pe;return(pe=(C=te.lsp)===null||C===void 0?void 0:C.Formatter)===null||pe===void 0?void 0:pe.formatOnTypeOptions}).find(te=>!!te),d=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeActionProvider}),f=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider}),p=l4(u.map(te=>{var C,pe;return(pe=(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider)===null||pe===void 0?void 0:pe.semanticTokensOptions})),h=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,w=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentLinkProvider}),D=p4(u.map(te=>{var C,pe;return(pe=(C=te.lsp)===null||C===void 0?void 0:C.SignatureHelp)===null||pe===void 0?void 0:pe.signatureHelpOptions})),g=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeProvider}),v=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ImplementationProvider}),R=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider}),k=Z8(u.map(te=>{var C,pe;return(pe=(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider)===null||pe===void 0?void 0:pe.completionOptions})),A=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ReferencesProvider}),j=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentSymbolProvider}),W=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DefinitionProvider}),Z=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentHighlightProvider}),J=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.FoldingRangeProvider}),de=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.HoverProvider}),N=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.RenameProvider}),$=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CallHierarchyProvider}),T=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeHierarchyProvider}),O=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeLensProvider}),V=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DeclarationProvider}),M=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.InlayHintProvider}),H=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:o},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:ap.TextDocumentSyncKind.Incremental,openClose:!0,save:!!a.didSaveDocument,willSave:!!a.willSaveDocument,willSaveWaitUntil:!!a.willSaveDocumentWaitUntil},completionProvider:R?k:void 0,referencesProvider:A,documentSymbolProvider:j,definitionProvider:W,typeDefinitionProvider:g,documentHighlightProvider:Z,codeActionProvider:d,documentFormattingProvider:c,documentRangeFormattingProvider:c,documentOnTypeFormattingProvider:l,foldingRangeProvider:J,hoverProvider:de,renameProvider:N?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:D,implementationProvider:v,callHierarchyProvider:$?{}:void 0,typeHierarchyProvider:T?{}:void 0,documentLinkProvider:w?{resolveProvider:!1}:void 0,codeLensProvider:O?{resolveProvider:!1}:void 0,declarationProvider:V,inlayHintProvider:M?{resolveProvider:!1}:void 0,workspaceSymbolProvider:H?{resolveProvider:!!H.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(ap.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>n.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(r).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}}class m4{getSymbolKind(e){return ge.SymbolKind.Field}getCompletionItemKind(e){return ge.CompletionItemKind.Reference}}class g4{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return[];const s=di(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,e):[]}getReferences(e,n,r){const i=[],s=this.references.findDeclaration(e);if(s){const a={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,a).forEach(o=>{i.push(ge.Location.create(o.sourceUri.toString(),o.segment.range))})}return i}}class y4{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n,r){const i={},s=e.parseResult.value.$cstNode;if(!s)return;const a=e.textDocument.offsetAt(n.position),o=di(s,a,this.grammarConfig.nameRegexp);if(!o)return;const u=this.references.findDeclaration(o);if(!u)return;const c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(u,c).forEach(d=>{const f=Tn.replace(d.segment.range,n.newName),p=d.sourceUri.toString();i[p]?i[p].push(f):i[p]=[f]}),{changes:i}}prepareRename(e,n,r){return this.renameNodeRange(e,n.position)}renameNodeRange(e,n){const r=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(n);if(r&&i){const s=di(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&Kf(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class Mk{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=rt.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await At(n),this.fuzzyMatcher.match(i,s.name)){const a=this.getWorkspaceSymbol(s);a&&r.push(a)}return r}getWorkspaceSymbol(e){const n=e.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:n.range,uri:e.documentUri.toString()}}}}class w4{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ge.Emitter,this._onDidOpen=new ge.Emitter,this._onDidClose=new ge.Emitter,this._onDidSave=new ge.Emitter,this._onWillSave=new ge.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(Rt.normalize(e))}set(e){const n=Rt.normalize(e.uri);let r=!0;this._syncedDocuments.has(n)&&(r=!1),this._syncedDocuments.set(n,e);const i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),r}delete(e){const n=Rt.normalize(typeof e=="object"&&"uri"in e?e.uri:e),r=this._syncedDocuments.get(n);r!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:r})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ge.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=Rt.normalize(i.uri),a=this._configuration.create(s,i.languageId,i.version,i.text);this._syncedDocuments.set(s,a);const o=Object.freeze({document:a});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:a}=i;if(a==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const o=Rt.normalize(i.uri);let u=this._syncedDocuments.get(o);u!==void 0&&(u=this._configuration.update(u,s,a),this._syncedDocuments.set(o,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),n.push(e.onDidCloseTextDocument(r=>{const i=Rt.normalize(r.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{const i=this._syncedDocuments.get(Rt.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{const s=this._syncedDocuments.get(Rt.normalize(r.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{const i=this._syncedDocuments.get(Rt.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ge.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function v4(t){return Jf.merge(US(t),b4(t))}function b4(t){return{lsp:{CompletionProvider:e=>new Pk(e),DocumentSymbolProvider:e=>new t4(e),HoverProvider:e=>new o4(e),FoldingRangeProvider:e=>new r4(e),ReferencesProvider:e=>new g4(e),DefinitionProvider:e=>new e4(e),DocumentHighlightProvider:e=>new Ik(e),RenameProvider:e=>new y4(e)},shared:()=>t.shared}}function D4(t){return Jf.merge(GS(t),E4(t))}function E4(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new h4(e),DocumentUpdateHandler:e=>new n4(e),WorkspaceSymbolProvider:e=>new Mk(e),NodeKindProvider:()=>new m4,FuzzyMatcher:()=>new i4},workspace:{TextDocuments:()=>new w4(Vf)}}}class R4{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new T4(e,this.collector)}formatDocument(e,n){const r=e.parseResult;return r.lexerErrors.length===0&&r.parserErrors.length===0?this.doDocumentFormat(e,n.options):[]}isFormatRangeErrorFree(e,n){const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var a;return(a=s.line)!==null&&a!==void 0?a:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var a;return(a=s.token.startLine)!==null&&a!==void 0?a:Number.MAX_VALUE}))>n.end.line:!0}formatDocumentRange(e,n){return this.isFormatRangeErrorFree(e,n.range)?this.doDocumentFormat(e,n.options,n.range):[]}formatDocumentOnType(e,n){const r={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(o,u,c)=>{var l,d;const f=this.nodeModeToKey(o,u),p=i.get(f),h=(l=c.options.priority)!==null&&l!==void 0?l:0,w=(d=p?.options.priority)!==null&&d!==void 0?d:0;(!p||w<=h)&&i.set(f,c)};this.collector=s,this.iterateAstFormatting(e,r);const a=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,a)}avoidOverlappingEdits(e,n){const r=[];for(const i of n){let s=r[r.length-1];for(;s;){const a=e.offsetAt(i.range.start),o=e.offsetAt(s.range.end);if(a<o)r.pop(),s=r[r.length-1];else break}r.push(i)}return r.filter(i=>this.isNecessary(i,e))}iterateAstFormatting(e,n){const r=e.parseResult.value;this.format(r);const i=gr(r).iterator();let s;do if(s=i.next(),!s.done){const a=s.value;this.insideRange(a.$cstNode.range,n)?this.format(a):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||e.start.line<=n.start.line&&e.end.line>=n.end.line||e.start.line>=n.start.line&&e.end.line<=n.end.line||e.start.line<=n.end.line&&e.end.line>=n.end.line}isNecessary(e,n){return e.newText!==n.getText(e.range).replace(/\r/g,"")}iterateCstFormatting(e,n,r,i){const s={indentation:0,options:r,document:e.textDocument},a=[],u=this.iterateCstTree(e,s).iterator();let c,l;do if(l=u.next(),!l.done){const d=l.value,f=es(d),p=this.nodeModeToKey(d,"prepend"),h=n.get(p);if(n.delete(p),h){const g=this.createTextEdit(c,d,h,s);for(const v of g)v&&this.insideRange(v.range,i)&&a.push(v)}const w=this.nodeModeToKey(d,"append"),D=n.get(w);if(n.delete(w),D){const g=pD(d);if(g){const v=this.createTextEdit(d,g,D,s);for(const R of v)R&&this.insideRange(R.range,i)&&a.push(R)}}if(!h&&d.hidden){const g=this.createHiddenTextEdits(c,d,void 0,s);for(const v of g)v&&this.insideRange(v.range,i)&&a.push(v)}f&&(c=d)}while(!l.done);return a}createHiddenTextEdits(e,n,r,i){var s;const a=n.range.start.line;if(e&&e.range.end.line===a)return[];const o=[],u={start:{character:0,line:a},end:n.range.start},c=i.document.getText(u),l=this.findFittingMove(u,(s=r?.moves)!==null&&s!==void 0?s:[],i),d=this.getExistingIndentationCharacterCount(c,i),p=this.getIndentationCharacterCount(i,l)-d;if(p===0)return[];let h="";p>0&&(h=(i.options.insertSpaces?" ":" ").repeat(p));const w=n.text.split(`
|
|
161
|
-
`);w[0]=c+w[0];for(let D=0;D<w.length;D++){const g=a+D,v={character:0,line:g};if(p>0)o.push({newText:h,range:{start:v,end:v}});else{const R=w[D];let k=0;for(;k<R.length;k++){const A=R.charAt(k);if(A!==" "&&A!==" ")break}o.push({newText:"",range:{start:v,end:{line:g,character:Math.min(k,Math.abs(p))}}})}}return o}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){let r=e.indentation;return n&&n.tabs&&(r+=n.tabs),(e.options.insertSpaces?e.options.tabSize:1)*r}createTextEdit(e,n,r,i){var s;if(n.hidden)return this.createHiddenTextEdits(e,n,r,i);if(e&&(e.range.end.line>n.range.start.line||e.range.end.line===n.range.start.line&&e.range.end.character>n.range.start.character))return[];const a={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},o=this.findFittingMove(a,r.moves,i);if(!o)return[];const u=o.characters,c=o.lines,l=o.tabs,d=i.indentation;i.indentation+=l??0;const f=[];return u!==void 0?e?.hidden||f.push(this.createSpaceTextEdit(a,u,r.options)):c!==void 0?f.push(this.createLineTextEdit(a,c,i,r.options)):l!==void 0&&f.push(this.createTabTextEdit(a,!!e,i)),es(n)&&(i.indentation=d),f}createSpaceTextEdit(e,n,r){if(e.start.line===e.end.line){const s=e.end.character-e.start.character;n=this.fitIntoOptions(n,s,r)}return{newText:" ".repeat(n),range:e}}createLineTextEdit(e,n,r,i){const s=e.end.line-e.start.line;n=this.fitIntoOptions(n,s,i);const o=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
|
|
162
|
-
`.repeat(n)}${o}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),a=n?1:0,o=Math.max(e.end.line-e.start.line,a);return{newText:`${`
|
|
163
|
-
`.repeat(o)}${s}`,range:e}}fitIntoOptions(e,n,r){return r.allowMore?e=Math.max(n,e):r.allowLess&&(e=Math.min(n,e)),e}findFittingMove(e,n,r){if(n.length===0)return;if(n.length===1)return n[0];const i=e.end.line-e.start.line;for(const s of n){if(s.lines!==void 0&&i<=s.lines)return s;if(s.lines===void 0&&i===0)return s}return n[n.length-1]}iterateCstTree(e,n){const i=e.parseResult.value.$cstNode;return i?new na(i,s=>this.iterateCst(s,n)):ta}iterateCst(e,n){if(!li(e))return ta;const r=n.indentation;return new Pt(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,Kt))}}class T4{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new ur(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new ur(n,this.collector)}property(e,n){const r=Jt(this.astNode.$cstNode,e,n);return new ur(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=sa(this.astNode.$cstNode,r);n.push(...i)}return new ur(n,this.collector)}keyword(e,n){const r=Vo(this.astNode.$cstNode,e,n);return new ur(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Qm(this.astNode.$cstNode,r);n.push(...i)}return new ur(n,this.collector)}cst(e){return new ur([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new ur([],this.collector);let s=r[0],a=i[0];if(s.offset>a.offset){const o=s;s=a,a=o}return new ur(hD(s,a),this.collector)}}class ur{constructor(e,n){this.nodes=e,this.collector=n}prepend(e){for(const n of this.nodes)this.collector(n,"prepend",e);return this}append(e){for(const n of this.nodes)this.collector(n,"append",e);return this}surround(e){for(const n of this.nodes)this.collector(n,"prepend",e),this.collector(n,"append",e);return this}slice(e,n){return new ur(this.nodes.slice(e,n),this.collector)}}var Ei;(function(t){function e(...l){return{options:{},moves:l.flatMap(d=>d.moves).sort(c)}}t.fit=e;function n(l){return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,d){return{options:d??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return a(1,l)}t.newLine=s;function a(l,d){return{options:d??{},moves:[{lines:l}]}}t.newLines=a;function o(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=o;function u(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=u;function c(l,d){var f,p,h,w,D,g;const v=(f=l.lines)!==null&&f!==void 0?f:0,R=(p=d.lines)!==null&&p!==void 0?p:0,k=(h=l.tabs)!==null&&h!==void 0?h:0,A=(w=d.tabs)!==null&&w!==void 0?w:0,j=(D=l.characters)!==null&&D!==void 0?D:0,W=(g=d.characters)!==null&&g!==void 0?g:0;return v<R?-1:v>R?1:k<A?-1:k>A?1:j<W?-1:j>W?1:0}})(Ei||(Ei={}));var Vy,Bk;function S4(){return Bk||(Bk=1,Vy=kk()),Vy}S4();var nc={},rc={},ic={},ks={},Ri={},ti={},zk;function qk(){if(zk)return ti;zk=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.normalizePath=ti.convertSlashes=ti.cleanPath=void 0;const t=fr;function e(s){let a=(0,t.normalize)(s);return a.length>1&&a[a.length-1]===t.sep&&(a=a.substring(0,a.length-1)),a}ti.cleanPath=e;const n=/[\\/]/g;function r(s,a){return s.replace(n,a)}ti.convertSlashes=r;function i(s,a){const{resolvePaths:o,normalizePath:u,pathSeparator:c}=a,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(o&&(s=(0,t.resolve)(s)),(u||l)&&(s=e(s)),s===".")return"";const d=s[s.length-1]!==c;return r(d?s+c:s,c)}return ti.normalizePath=i,ti}var ni={},jk;function $4(){if(jk)return ni;jk=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.build=ni.joinDirectoryPath=ni.joinPathWithBasePath=void 0;const t=fr,e=qk();function n(o,u){return u+o}ni.joinPathWithBasePath=n;function r(o,u){return function(c,l){return l.startsWith(o)?l.replace(o,"")+c:(0,e.convertSlashes)((0,t.relative)(o,l),u.pathSeparator)+u.pathSeparator+c}}function i(o){return o}function s(o,u,c){return u+o+c}ni.joinDirectoryPath=s;function a(o,u){const{relativePaths:c,includeBasePath:l}=u;return c&&o?r(o,u):l?n:i}return ni.build=a,ni}var sc={},Uk;function k4(){if(Uk)return sc;Uk=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.build=void 0;function t(a){return function(o,u){u.push(o.substring(a.length)||".")}}function e(a){return function(o,u,c){const l=o.substring(a.length)||".";c.every(d=>d(l,!0))&&u.push(l)}}const n=(a,o)=>{o.push(a||".")},r=(a,o,u)=>{const c=a||".";u.every(l=>l(c,!0))&&o.push(c)},i=()=>{};function s(a,o){const{includeDirs:u,filters:c,relativePaths:l}=o;return u?l?c&&c.length?e(a):t(a):c&&c.length?r:n:i}return sc.build=s,sc}var ac={},Gk;function C4(){if(Gk)return ac;Gk=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.build=void 0;const t=(a,o,u,c)=>{c.every(l=>l(a,!1))&&u.files++},e=(a,o,u,c)=>{c.every(l=>l(a,!1))&&o.push(a)},n=(a,o,u,c)=>{u.files++},r=(a,o)=>{o.push(a)},i=()=>{};function s(a){const{excludeFiles:o,filters:u,onlyCounts:c}=a;return o?i:u&&u.length?c?t:e:c?n:r}return ac.build=s,ac}var oc={},Wk;function A4(){if(Wk)return oc;Wk=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.build=void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return oc.build=n,oc}var uc={},Hk;function _4(){if(Hk)return uc;Hk=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.build=void 0;const t=(r,i,s)=>{r.push({directory:i,files:s,dir:i})},e=()=>{};function n(r){return r.group?t:e}return uc.build=n,uc}var Ra={},Vk;function P4(){if(Vk)return Ra;Vk=1;var t=Ra.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.build=void 0;const e=t(ea),n=fr,r=function(u,c,l){const{queue:d,options:{suppressErrors:f}}=c;d.enqueue(),e.default.realpath(u,(p,h)=>{if(p)return d.dequeue(f?null:p,c);e.default.stat(h,(w,D)=>{if(w)return d.dequeue(f?null:w,c);if(D.isDirectory()&&a(u,h,c))return d.dequeue(null,c);l(D,h),d.dequeue(null,c)})})},i=function(u,c,l){const{queue:d,options:{suppressErrors:f}}=c;d.enqueue();try{const p=e.default.realpathSync(u),h=e.default.statSync(p);if(h.isDirectory()&&a(u,p,c))return;l(h,p)}catch(p){if(!f)throw p}};function s(u,c){return!u.resolveSymlinks||u.excludeSymlinks?null:c?i:r}Ra.build=s;function a(u,c,l){if(l.options.useRealPaths)return o(c,l);let d=(0,n.dirname)(u),f=1;for(;d!==l.root&&f<2;){const p=l.symlinks.get(d);!!p&&(p===c||p.startsWith(c)||c.startsWith(p))?f++:d=(0,n.dirname)(d)}return l.symlinks.set(u,c),f>1}function o(u,c){return c.visited.includes(u+c.options.pathSeparator)}return Ra}var cc={},Kk;function I4(){if(Kk)return cc;Kk=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.build=void 0;const t=l=>l.counts,e=l=>l.groups,n=l=>l.paths,r=l=>l.paths.slice(0,l.options.maxFiles),i=(l,d,f)=>(u(d,f,l.counts,l.options.suppressErrors),null),s=(l,d,f)=>(u(d,f,l.paths,l.options.suppressErrors),null),a=(l,d,f)=>(u(d,f,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),o=(l,d,f)=>(u(d,f,l.groups,l.options.suppressErrors),null);function u(l,d,f,p){d(l&&!p?l:null,f)}function c(l,d){const{onlyCounts:f,group:p,maxFiles:h}=l;return f?d?t:i:p?d?e:o:h?d?r:a:d?n:s}return cc.build=c,cc}var Ta={},Yk;function x4(){if(Yk)return Ta;Yk=1;var t=Ta.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.build=void 0;const e=t(ea),n={withFileTypes:!0},r=(a,o,u,c,l)=>{if(c<0)return a.queue.dequeue(null,a);a.visited.push(o),a.counts.directories++,a.queue.enqueue(),e.default.readdir(o||".",n,(d,f=[])=>{l(f,u,c),a.queue.dequeue(a.options.suppressErrors?null:d,a)})},i=(a,o,u,c,l)=>{if(c<0)return;a.visited.push(o),a.counts.directories++;let d=[];try{d=e.default.readdirSync(o||".",n)}catch(f){if(!a.options.suppressErrors)throw f}l(d,u,c)};function s(a){return a?i:r}return Ta.build=s,Ta}var lc={},Xk;function N4(){if(Xk)return lc;Xk=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.Queue=void 0;class t{onQueueEmpty;count=0;constructor(n){this.onQueueEmpty=n}enqueue(){this.count++}dequeue(n,r){(--this.count<=0||n)&&this.onQueueEmpty(n,r)}}return lc.Queue=t,lc}var dc={},Jk;function O4(){if(Jk)return dc;Jk=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.Counter=void 0;class t{_files=0;_directories=0;set files(n){this._files=n}get files(){return this._files}set directories(n){this._directories=n}get directories(){return this._directories}get dirs(){return this._directories}}return dc.Counter=t,dc}var Qk;function Zk(){if(Qk)return Ri;Qk=1;var t=Ri.__createBinding||(Object.create?function(D,g,v,R){R===void 0&&(R=v);var k=Object.getOwnPropertyDescriptor(g,v);(!k||("get"in k?!g.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return g[v]}}),Object.defineProperty(D,R,k)}:function(D,g,v,R){R===void 0&&(R=v),D[R]=g[v]}),e=Ri.__setModuleDefault||(Object.create?function(D,g){Object.defineProperty(D,"default",{enumerable:!0,value:g})}:function(D,g){D.default=g}),n=Ri.__importStar||function(D){if(D&&D.__esModule)return D;var g={};if(D!=null)for(var v in D)v!=="default"&&Object.prototype.hasOwnProperty.call(D,v)&&t(g,D,v);return e(g,D),g};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.Walker=void 0;const r=fr,i=qk(),s=n($4()),a=n(k4()),o=n(C4()),u=n(A4()),c=n(_4()),l=n(P4()),d=n(I4()),f=n(x4()),p=N4(),h=O4();class w{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(g,v,R){this.isSynchronous=!R,this.callbackInvoker=d.build(v,this.isSynchronous),this.root=(0,i.normalizePath)(g,v),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new h.Counter,options:v,queue:new p.Queue((k,A)=>this.callbackInvoker(A,k,R)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,v),this.pushDirectory=a.build(this.root,v),this.pushFile=o.build(v),this.getArray=u.build(v),this.groupFiles=c.build(v),this.resolveSymlink=l.build(v,this.isSynchronous),this.walkDirectory=f.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(g,v,R)=>{const{paths:k,options:{filters:A,resolveSymlinks:j,excludeSymlinks:W,exclude:Z,maxFiles:J,signal:de,useRealPaths:N,pathSeparator:$}}=this.state;if(de&&de.aborted||J&&k.length>J)return;this.pushDirectory(v,k,A);const T=this.getArray(this.state.paths);for(let O=0;O<g.length;++O){const V=g[O];if(V.isFile()||V.isSymbolicLink()&&!j&&!W){const M=this.joinPath(V.name,v);this.pushFile(M,T,this.state.counts,A)}else if(V.isDirectory()){let M=s.joinDirectoryPath(V.name,v,this.state.options.pathSeparator);if(Z&&Z(V.name,M))continue;this.walkDirectory(this.state,M,M,R-1,this.walk)}else if(V.isSymbolicLink()&&this.resolveSymlink){let M=s.joinPathWithBasePath(V.name,v);this.resolveSymlink(M,this.state,(H,be)=>{if(H.isDirectory()){if(be=(0,i.normalizePath)(be,this.state.options),Z&&Z(V.name,be))return;this.walkDirectory(this.state,be,N?be:M+$,R-1,this.walk)}else{be=N?be:M;const te=(0,r.basename)(be),C=(0,i.normalizePath)((0,r.dirname)(be),this.state.options);be=this.joinPath(te,C),this.pushFile(be,T,this.state.counts,A)}})}}this.groupFiles(this.state.groups,v,T)}}return Ri.Walker=w,Ri}var eC;function F4(){if(eC)return ks;eC=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.callback=ks.promise=void 0;const t=Zk();function e(r,i){return new Promise((s,a)=>{n(r,i,(o,u)=>{if(o)return a(o);s(u)})})}ks.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return ks.callback=n,ks}var fc={},tC;function L4(){if(tC)return fc;tC=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.sync=void 0;const t=Zk();function e(n,r){return new t.Walker(n,r).start()}return fc.sync=e,fc}var nC;function M4(){if(nC)return ic;nC=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.APIBuilder=void 0;const t=F4(),e=L4();class n{root;options;constructor(i,s){this.root=i,this.options=s}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(i){(0,t.callback)(this.root,this.options,i)}sync(){return(0,e.sync)(this.root,this.options)}}return ic.APIBuilder=n,ic}var Ky={},Yy,rC;function op(){if(rC)return Yy;rC=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",a="(?=.)",o="[^/]",u=`(?:${s}|$)`,c=`(?:^|${s})`,l=`${n}{1,2}${u}`,d=`(?!${n})`,f=`(?!${c}${l})`,p=`(?!${n}{0,1}${u})`,h=`(?!${l})`,w=`[^.${s}]`,D=`${o}*?`,v={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:a,QMARK:o,END_ANCHOR:u,DOTS_SLASH:l,NO_DOT:d,NO_DOTS:f,NO_DOT_SLASH:p,NO_DOTS_SLASH:h,QMARK_NO_DOT:w,STAR:D,START_ANCHOR:c,SEP:"/"},R={...v,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},k={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Yy={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:k,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?R:v}},Yy}var iC;function up(){return iC||(iC=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=op();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>r.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(i,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,a=>a==="\\"?"":a),t.escapeLast=(s,a,o)=>{const u=s.lastIndexOf(a,o);return u===-1?s:s[u-1]==="\\"?t.escapeLast(s,a,u-1):`${s.slice(0,u)}\\${s.slice(u)}`},t.removePrefix=(s,a={})=>{let o=s;return o.startsWith("./")&&(o=o.slice(2),a.prefix="./"),o},t.wrapOutput=(s,a={},o={})=>{const u=o.contains?"":"^",c=o.contains?"":"$";let l=`${u}(?:${s})${c}`;return a.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:a}={})=>{const o=s.split(a?/[\\/]/:"/"),u=o[o.length-1];return u===""?o[o.length-2]:u}}(Ky)),Ky}var Xy,sC;function B4(){if(sC)return Xy;sC=1;const t=up(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:o,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:w}=op(),D=R=>R===o||R===r,g=R=>{R.isPrefix!==!0&&(R.depth=R.isGlobstar?1/0:1)};return Xy=(R,k)=>{const A=k||{},j=R.length-1,W=A.parts===!0||A.scanToEnd===!0,Z=[],J=[],de=[];let N=R,$=-1,T=0,O=0,V=!1,M=!1,H=!1,be=!1,te=!1,C=!1,pe=!1,Qe=!1,ct=!1,U=!1,K=0,_e,se,we={value:"",depth:0,isGlob:!1};const Te=()=>$>=j,oe=()=>N.charCodeAt($+1),I=()=>(_e=se,N.charCodeAt(++$));for(;$<j;){se=I();let Le;if(se===r){pe=we.backslashes=!0,se=I(),se===u&&(C=!0);continue}if(C===!0||se===u){for(K++;Te()!==!0&&(se=I());){if(se===r){pe=we.backslashes=!0,I();continue}if(se===u){K++;continue}if(C!==!0&&se===s&&(se=I())===s){if(V=we.isBrace=!0,H=we.isGlob=!0,U=!0,W===!0)continue;break}if(C!==!0&&se===i){if(V=we.isBrace=!0,H=we.isGlob=!0,U=!0,W===!0)continue;break}if(se===p&&(K--,K===0)){C=!1,V=we.isBrace=!0,U=!0;break}}if(W===!0)continue;break}if(se===o){if(Z.push($),J.push(we),we={value:"",depth:0,isGlob:!1},U===!0)continue;if(_e===s&&$===T+1){T+=2;continue}O=$+1;continue}if(A.noext!==!0&&(se===d||se===n||se===e||se===f||se===a)===!0&&oe()===c){if(H=we.isGlob=!0,be=we.isExtglob=!0,U=!0,se===a&&$===T&&(ct=!0),W===!0){for(;Te()!==!0&&(se=I());){if(se===r){pe=we.backslashes=!0,se=I();continue}if(se===h){H=we.isGlob=!0,U=!0;break}}continue}break}if(se===e){if(_e===e&&(te=we.isGlobstar=!0),H=we.isGlob=!0,U=!0,W===!0)continue;break}if(se===f){if(H=we.isGlob=!0,U=!0,W===!0)continue;break}if(se===l){for(;Te()!==!0&&(Le=I());){if(Le===r){pe=we.backslashes=!0,I();continue}if(Le===w){M=we.isBracket=!0,H=we.isGlob=!0,U=!0;break}}if(W===!0)continue;break}if(A.nonegate!==!0&&se===a&&$===T){Qe=we.negated=!0,T++;continue}if(A.noparen!==!0&&se===c){if(H=we.isGlob=!0,W===!0){for(;Te()!==!0&&(se=I());){if(se===c){pe=we.backslashes=!0,se=I();continue}if(se===h){U=!0;break}}continue}break}if(H===!0){if(U=!0,W===!0)continue;break}}A.noext===!0&&(be=!1,H=!1);let B=N,ce="",z="";T>0&&(ce=N.slice(0,T),N=N.slice(T),O-=T),B&&H===!0&&O>0?(B=N.slice(0,O),z=N.slice(O)):H===!0?(B="",z=N):B=N,B&&B!==""&&B!=="/"&&B!==N&&D(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),A.unescape===!0&&(z&&(z=t.removeBackslashes(z)),B&&pe===!0&&(B=t.removeBackslashes(B)));const ue={prefix:ce,input:R,start:T,base:B,glob:z,isBrace:V,isBracket:M,isGlob:H,isExtglob:be,isGlobstar:te,negated:Qe,negatedExtglob:ct};if(A.tokens===!0&&(ue.maxDepth=0,D(se)||J.push(we),ue.tokens=J),A.parts===!0||A.tokens===!0){let Le;for(let Ke=0;Ke<Z.length;Ke++){const ie=Le?Le+1:T,ke=Z[Ke],ne=R.slice(ie,ke);A.tokens&&(Ke===0&&T!==0?(J[Ke].isPrefix=!0,J[Ke].value=ce):J[Ke].value=ne,g(J[Ke]),ue.maxDepth+=J[Ke].depth),(Ke!==0||ne!=="")&&de.push(ne),Le=ke}if(Le&&Le+1<R.length){const Ke=R.slice(Le+1);de.push(Ke),A.tokens&&(J[J.length-1].value=Ke,g(J[J.length-1]),ue.maxDepth+=J[J.length-1].depth)}ue.slashes=Z,ue.parts=de}return ue},Xy}var Jy,aC;function z4(){if(aC)return Jy;aC=1;const t=op(),e=up(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:a}=t,o=(l,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...l,d);l.sort();const f=`[${l.join("-")}]`;try{new RegExp(f)}catch{return l.map(h=>e.escapeRegex(h)).join("..")}return f},u=(l,d)=>`Missing ${l}: "${d}" - use "\\\\${d}" to match literal characters`,c=(l,d)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=a[l]||l;const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n;let h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);const w={type:"bos",value:"",output:f.prepend||""},D=[w],g=f.capture?"":"?:",v=t.globChars(f.windows),R=t.extglobChars(v),{DOT_LITERAL:k,PLUS_LITERAL:A,SLASH_LITERAL:j,ONE_CHAR:W,DOTS_SLASH:Z,NO_DOT:J,NO_DOT_SLASH:de,NO_DOTS_SLASH:N,QMARK:$,QMARK_NO_DOT:T,STAR:O,START_ANCHOR:V}=v,M=ie=>`(${g}(?:(?!${V}${ie.dot?Z:k}).)*?)`,H=f.dot?"":J,be=f.dot?$:T;let te=f.bash===!0?M(f):O;f.capture&&(te=`(${te})`),typeof f.noext=="boolean"&&(f.noextglob=f.noext);const C={input:l,index:-1,start:0,dot:f.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:D};l=e.removePrefix(l,C),h=l.length;const pe=[],Qe=[],ct=[];let U=w,K;const _e=()=>C.index===h-1,se=C.peek=(ie=1)=>l[C.index+ie],we=C.advance=()=>l[++C.index]||"",Te=()=>l.slice(C.index+1),oe=(ie="",ke=0)=>{C.consumed+=ie,C.index+=ke},I=ie=>{C.output+=ie.output!=null?ie.output:ie.value,oe(ie.value)},B=()=>{let ie=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)we(),C.start++,ie++;return ie%2===0?!1:(C.negated=!0,C.start++,!0)},ce=ie=>{C[ie]++,ct.push(ie)},z=ie=>{C[ie]--,ct.pop()},ue=ie=>{if(U.type==="globstar"){const ke=C.braces>0&&(ie.type==="comma"||ie.type==="brace"),ne=ie.extglob===!0||pe.length&&(ie.type==="pipe"||ie.type==="paren");ie.type!=="slash"&&ie.type!=="paren"&&!ke&&!ne&&(C.output=C.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=te,C.output+=U.output)}if(pe.length&&ie.type!=="paren"&&(pe[pe.length-1].inner+=ie.value),(ie.value||ie.output)&&I(ie),U&&U.type==="text"&&ie.type==="text"){U.output=(U.output||U.value)+ie.value,U.value+=ie.value;return}ie.prev=U,D.push(ie),U=ie},Le=(ie,ke)=>{const ne={...R[ke],conditions:1,inner:""};ne.prev=U,ne.parens=C.parens,ne.output=C.output;const ve=(f.capture?"(":"")+ne.open;ce("parens"),ue({type:ie,value:ke,output:C.output?"":W}),ue({type:"paren",extglob:!0,value:we(),output:ve}),pe.push(ne)},Ke=ie=>{let ke=ie.close+(f.capture?")":""),ne;if(ie.type==="negate"){let ve=te;if(ie.inner&&ie.inner.length>1&&ie.inner.includes("/")&&(ve=M(f)),(ve!==te||_e()||/^\)+$/.test(Te()))&&(ke=ie.close=`)$))${ve}`),ie.inner.includes("*")&&(ne=Te())&&/^\.[^\\/.]+$/.test(ne)){const Ne=c(ne,{...d,fastpaths:!1}).output;ke=ie.close=`)${Ne})${ve})`}ie.prev.type==="bos"&&(C.negatedExtglob=!0)}ue({type:"paren",extglob:!0,value:K,output:ke}),z("parens")};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let ie=!1,ke=l.replace(s,(ne,ve,Ne,lt,Ge,Ot)=>lt==="\\"?(ie=!0,ne):lt==="?"?ve?ve+lt+(Ge?$.repeat(Ge.length):""):Ot===0?be+(Ge?$.repeat(Ge.length):""):$.repeat(Ne.length):lt==="."?k.repeat(Ne.length):lt==="*"?ve?ve+lt+(Ge?te:""):te:ve?ne:`\\${ne}`);return ie===!0&&(f.unescape===!0?ke=ke.replace(/\\/g,""):ke=ke.replace(/\\+/g,ne=>ne.length%2===0?"\\\\":ne?"\\":"")),ke===l&&f.contains===!0?(C.output=l,C):(C.output=e.wrapOutput(ke,C,d),C)}for(;!_e();){if(K=we(),K==="\0")continue;if(K==="\\"){const ne=se();if(ne==="/"&&f.bash!==!0||ne==="."||ne===";")continue;if(!ne){K+="\\",ue({type:"text",value:K});continue}const ve=/^\\+/.exec(Te());let Ne=0;if(ve&&ve[0].length>2&&(Ne=ve[0].length,C.index+=Ne,Ne%2!==0&&(K+="\\")),f.unescape===!0?K=we():K+=we(),C.brackets===0){ue({type:"text",value:K});continue}}if(C.brackets>0&&(K!=="]"||U.value==="["||U.value==="[^")){if(f.posix!==!1&&K===":"){const ne=U.value.slice(1);if(ne.includes("[")&&(U.posix=!0,ne.includes(":"))){const ve=U.value.lastIndexOf("["),Ne=U.value.slice(0,ve),lt=U.value.slice(ve+2),Ge=r[lt];if(Ge){U.value=Ne+Ge,C.backtrack=!0,we(),!w.output&&D.indexOf(U)===1&&(w.output=W);continue}}}(K==="["&&se()!==":"||K==="-"&&se()==="]")&&(K=`\\${K}`),K==="]"&&(U.value==="["||U.value==="[^")&&(K=`\\${K}`),f.posix===!0&&K==="!"&&U.value==="["&&(K="^"),U.value+=K,I({value:K});continue}if(C.quotes===1&&K!=='"'){K=e.escapeRegex(K),U.value+=K,I({value:K});continue}if(K==='"'){C.quotes=C.quotes===1?0:1,f.keepQuotes===!0&&ue({type:"text",value:K});continue}if(K==="("){ce("parens"),ue({type:"paren",value:K});continue}if(K===")"){if(C.parens===0&&f.strictBrackets===!0)throw new SyntaxError(u("opening","("));const ne=pe[pe.length-1];if(ne&&C.parens===ne.parens+1){Ke(pe.pop());continue}ue({type:"paren",value:K,output:C.parens?")":"\\)"}),z("parens");continue}if(K==="["){if(f.nobracket===!0||!Te().includes("]")){if(f.nobracket!==!0&&f.strictBrackets===!0)throw new SyntaxError(u("closing","]"));K=`\\${K}`}else ce("brackets");ue({type:"bracket",value:K});continue}if(K==="]"){if(f.nobracket===!0||U&&U.type==="bracket"&&U.value.length===1){ue({type:"text",value:K,output:`\\${K}`});continue}if(C.brackets===0){if(f.strictBrackets===!0)throw new SyntaxError(u("opening","["));ue({type:"text",value:K,output:`\\${K}`});continue}z("brackets");const ne=U.value.slice(1);if(U.posix!==!0&&ne[0]==="^"&&!ne.includes("/")&&(K=`/${K}`),U.value+=K,I({value:K}),f.literalBrackets===!1||e.hasRegexChars(ne))continue;const ve=e.escapeRegex(U.value);if(C.output=C.output.slice(0,-U.value.length),f.literalBrackets===!0){C.output+=ve,U.value=ve;continue}U.value=`(${g}${ve}|${U.value})`,C.output+=U.value;continue}if(K==="{"&&f.nobrace!==!0){ce("braces");const ne={type:"brace",value:K,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};Qe.push(ne),ue(ne);continue}if(K==="}"){const ne=Qe[Qe.length-1];if(f.nobrace===!0||!ne){ue({type:"text",value:K,output:K});continue}let ve=")";if(ne.dots===!0){const Ne=D.slice(),lt=[];for(let Ge=Ne.length-1;Ge>=0&&(D.pop(),Ne[Ge].type!=="brace");Ge--)Ne[Ge].type!=="dots"&<.unshift(Ne[Ge].value);ve=o(lt,f),C.backtrack=!0}if(ne.comma!==!0&&ne.dots!==!0){const Ne=C.output.slice(0,ne.outputIndex),lt=C.tokens.slice(ne.tokensIndex);ne.value=ne.output="\\{",K=ve="\\}",C.output=Ne;for(const Ge of lt)C.output+=Ge.output||Ge.value}ue({type:"brace",value:K,output:ve}),z("braces"),Qe.pop();continue}if(K==="|"){pe.length>0&&pe[pe.length-1].conditions++,ue({type:"text",value:K});continue}if(K===","){let ne=K;const ve=Qe[Qe.length-1];ve&&ct[ct.length-1]==="braces"&&(ve.comma=!0,ne="|"),ue({type:"comma",value:K,output:ne});continue}if(K==="/"){if(U.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",D.pop(),U=w;continue}ue({type:"slash",value:K,output:j});continue}if(K==="."){if(C.braces>0&&U.type==="dot"){U.value==="."&&(U.output=k);const ne=Qe[Qe.length-1];U.type="dots",U.output+=K,U.value+=K,ne.dots=!0;continue}if(C.braces+C.parens===0&&U.type!=="bos"&&U.type!=="slash"){ue({type:"text",value:K,output:k});continue}ue({type:"dot",value:K,output:k});continue}if(K==="?"){if(!(U&&U.value==="(")&&f.noextglob!==!0&&se()==="("&&se(2)!=="?"){Le("qmark",K);continue}if(U&&U.type==="paren"){const ve=se();let Ne=K;(U.value==="("&&!/[!=<:]/.test(ve)||ve==="<"&&!/<([!=]|\w+>)/.test(Te()))&&(Ne=`\\${K}`),ue({type:"text",value:K,output:Ne});continue}if(f.dot!==!0&&(U.type==="slash"||U.type==="bos")){ue({type:"qmark",value:K,output:T});continue}ue({type:"qmark",value:K,output:$});continue}if(K==="!"){if(f.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){Le("negate",K);continue}if(f.nonegate!==!0&&C.index===0){B();continue}}if(K==="+"){if(f.noextglob!==!0&&se()==="("&&se(2)!=="?"){Le("plus",K);continue}if(U&&U.value==="("||f.regex===!1){ue({type:"plus",value:K,output:A});continue}if(U&&(U.type==="bracket"||U.type==="paren"||U.type==="brace")||C.parens>0){ue({type:"plus",value:K});continue}ue({type:"plus",value:A});continue}if(K==="@"){if(f.noextglob!==!0&&se()==="("&&se(2)!=="?"){ue({type:"at",extglob:!0,value:K,output:""});continue}ue({type:"text",value:K});continue}if(K!=="*"){(K==="$"||K==="^")&&(K=`\\${K}`);const ne=i.exec(Te());ne&&(K+=ne[0],C.index+=ne[0].length),ue({type:"text",value:K});continue}if(U&&(U.type==="globstar"||U.star===!0)){U.type="star",U.star=!0,U.value+=K,U.output=te,C.backtrack=!0,C.globstar=!0,oe(K);continue}let ie=Te();if(f.noextglob!==!0&&/^\([^?]/.test(ie)){Le("star",K);continue}if(U.type==="star"){if(f.noglobstar===!0){oe(K);continue}const ne=U.prev,ve=ne.prev,Ne=ne.type==="slash"||ne.type==="bos",lt=ve&&(ve.type==="star"||ve.type==="globstar");if(f.bash===!0&&(!Ne||ie[0]&&ie[0]!=="/")){ue({type:"star",value:K,output:""});continue}const Ge=C.braces>0&&(ne.type==="comma"||ne.type==="brace"),Ot=pe.length&&(ne.type==="pipe"||ne.type==="paren");if(!Ne&&ne.type!=="paren"&&!Ge&&!Ot){ue({type:"star",value:K,output:""});continue}for(;ie.slice(0,3)==="/**";){const Bt=l[C.index+4];if(Bt&&Bt!=="/")break;ie=ie.slice(3),oe("/**",3)}if(ne.type==="bos"&&_e()){U.type="globstar",U.value+=K,U.output=M(f),C.output=U.output,C.globstar=!0,oe(K);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&!lt&&_e()){C.output=C.output.slice(0,-(ne.output+U.output).length),ne.output=`(?:${ne.output}`,U.type="globstar",U.output=M(f)+(f.strictSlashes?")":"|$)"),U.value+=K,C.globstar=!0,C.output+=ne.output+U.output,oe(K);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&ie[0]==="/"){const Bt=ie[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(ne.output+U.output).length),ne.output=`(?:${ne.output}`,U.type="globstar",U.output=`${M(f)}${j}|${j}${Bt})`,U.value+=K,C.output+=ne.output+U.output,C.globstar=!0,oe(K+we()),ue({type:"slash",value:"/",output:""});continue}if(ne.type==="bos"&&ie[0]==="/"){U.type="globstar",U.value+=K,U.output=`(?:^|${j}|${M(f)}${j})`,C.output=U.output,C.globstar=!0,oe(K+we()),ue({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-U.output.length),U.type="globstar",U.output=M(f),U.value+=K,C.output+=U.output,C.globstar=!0,oe(K);continue}const ke={type:"star",value:K,output:te};if(f.bash===!0){ke.output=".*?",(U.type==="bos"||U.type==="slash")&&(ke.output=H+ke.output),ue(ke);continue}if(U&&(U.type==="bracket"||U.type==="paren")&&f.regex===!0){ke.output=K,ue(ke);continue}(C.index===C.start||U.type==="slash"||U.type==="dot")&&(U.type==="dot"?(C.output+=de,U.output+=de):f.dot===!0?(C.output+=N,U.output+=N):(C.output+=H,U.output+=H),se()!=="*"&&(C.output+=W,U.output+=W)),ue(ke)}for(;C.brackets>0;){if(f.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C.output=e.escapeLast(C.output,"["),z("brackets")}for(;C.parens>0;){if(f.strictBrackets===!0)throw new SyntaxError(u("closing",")"));C.output=e.escapeLast(C.output,"("),z("parens")}for(;C.braces>0;){if(f.strictBrackets===!0)throw new SyntaxError(u("closing","}"));C.output=e.escapeLast(C.output,"{"),z("braces")}if(f.strictSlashes!==!0&&(U.type==="star"||U.type==="bracket")&&ue({type:"maybe_slash",value:"",output:`${j}?`}),C.backtrack===!0){C.output="";for(const ie of C.tokens)C.output+=ie.output!=null?ie.output:ie.value,ie.suffix&&(C.output+=ie.suffix)}return C};return c.fastpaths=(l,d)=>{const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n,h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);l=a[l]||l;const{DOT_LITERAL:w,SLASH_LITERAL:D,ONE_CHAR:g,DOTS_SLASH:v,NO_DOT:R,NO_DOTS:k,NO_DOTS_SLASH:A,STAR:j,START_ANCHOR:W}=t.globChars(f.windows),Z=f.dot?k:R,J=f.dot?A:R,de=f.capture?"":"?:",N={negated:!1,prefix:""};let $=f.bash===!0?".*?":j;f.capture&&($=`(${$})`);const T=H=>H.noglobstar===!0?$:`(${de}(?:(?!${W}${H.dot?v:w}).)*?)`,O=H=>{switch(H){case"*":return`${Z}${g}${$}`;case".*":return`${w}${g}${$}`;case"*.*":return`${Z}${$}${w}${g}${$}`;case"*/*":return`${Z}${$}${D}${g}${J}${$}`;case"**":return Z+T(f);case"**/*":return`(?:${Z}${T(f)}${D})?${J}${g}${$}`;case"**/*.*":return`(?:${Z}${T(f)}${D})?${J}${$}${w}${g}${$}`;case"**/.*":return`(?:${Z}${T(f)}${D})?${w}${g}${$}`;default:{const be=/^(.*?)\.(\w+)$/.exec(H);if(!be)return;const te=O(be[1]);return te?te+w+be[2]:void 0}}},V=e.removePrefix(l,N);let M=O(V);return M&&f.strictSlashes!==!0&&(M+=`${D}?`),M},Jy=c,Jy}var Qy,oC;function q4(){if(oC)return Qy;oC=1;const t=B4(),e=z4(),n=up(),r=op(),i=a=>a&&typeof a=="object"&&!Array.isArray(a),s=(a,o,u=!1)=>{if(Array.isArray(a)){const D=a.map(v=>s(v,o,u));return v=>{for(const R of D){const k=R(v);if(k)return k}return!1}}const c=i(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const l=o||{},d=l.windows,f=c?s.compileRe(a,o):s.makeRe(a,o,!1,!0),p=f.state;delete f.state;let h=()=>!1;if(l.ignore){const D={...o,ignore:null,onMatch:null,onResult:null};h=s(l.ignore,D,u)}const w=(D,g=!1)=>{const{isMatch:v,match:R,output:k}=s.test(D,f,o,{glob:a,posix:d}),A={glob:a,state:p,regex:f,posix:d,input:D,output:k,match:R,isMatch:v};return typeof l.onResult=="function"&&l.onResult(A),v===!1?(A.isMatch=!1,g?A:!1):h(D)?(typeof l.onIgnore=="function"&&l.onIgnore(A),A.isMatch=!1,g?A:!1):(typeof l.onMatch=="function"&&l.onMatch(A),g?A:!0)};return u&&(w.state=p),w};return s.test=(a,o,u,{glob:c,posix:l}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const d=u||{},f=d.format||(l?n.toPosixSlashes:null);let p=a===c,h=p&&f?f(a):a;return p===!1&&(h=f?f(a):a,p=h===c),(p===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?p=s.matchBase(a,o,u,l):p=o.exec(h)),{isMatch:!!p,match:p,output:h}},s.matchBase=(a,o,u)=>(o instanceof RegExp?o:s.makeRe(o,u)).test(n.basename(a)),s.isMatch=(a,o,u)=>s(o,u)(a),s.parse=(a,o)=>Array.isArray(a)?a.map(u=>s.parse(u,o)):e(a,{...o,fastpaths:!1}),s.scan=(a,o)=>t(a,o),s.compileRe=(a,o,u=!1,c=!1)=>{if(u===!0)return a.output;const l=o||{},d=l.contains?"":"^",f=l.contains?"":"$";let p=`${d}(?:${a.output})${f}`;a&&a.negated===!0&&(p=`^(?!${p}).*$`);const h=s.toRegex(p,o);return c===!0&&(h.state=a),h},s.makeRe=(a,o={},u=!1,c=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(l.output=e.fastpaths(a,o)),l.output||(l=e(a,o)),s.compileRe(l,o,u,c)},s.toRegex=(a,o)=>{try{const u=o||{};return new RegExp(a,u.flags||(u.nocase?"i":""))}catch(u){if(o&&o.debug===!0)throw u;return/$^/}},s.constants=r,Qy=s,Qy}var Zy,uC;function j4(){if(uC)return Zy;uC=1;const t=q4(),e=up();function n(r,i,s=!1){return i&&(i.windows===null||i.windows===void 0)&&(i={...i,windows:e.isWindows()}),t(r,i,s)}return Object.assign(n,t),Zy=n,Zy}var cC;function U4(){if(cC)return rc;cC=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.Builder=void 0;const t=fr,e=M4();var n=null;try{require.resolve("picomatch"),n=j4()}catch{}class r{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:t.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new e.APIBuilder(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,a){return this.options={...this.options,...a},new e.APIBuilder(s||".",this.options)}glob(...s){return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...a){const o=this.globFunction||n;if(!o)throw new Error("Please specify a glob function to use glob matching.");var u=this.globCache[s.join("\0")];return u||(u=o(s,...a),this.globCache[s.join("\0")]=u),this.options.filters.push(c=>u(c)),this}}return rc.Builder=r,rc}var ew={},lC;function G4(){return lC||(lC=1,Object.defineProperty(ew,"__esModule",{value:!0})),ew}var dC;function W4(){return dC||(dC=1,function(t){var e=nc.__createBinding||(Object.create?function(i,s,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(s,a);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,o,u)}:function(i,s,a,o){o===void 0&&(o=a),i[o]=s[a]}),n=nc.__exportStar||function(i,s){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&e(s,i,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.fdir=void 0;const r=U4();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(G4(),t)}(nc)),nc}var H4=W4();class V4{constructor(){this.encoding="utf-8"}readFile(e){return Fb.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await Fb.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Rt.joinPath(e,r.name)}))}}const tw="DeploymentElement";function fC(t){return G.isInstance(t,tw)}const nw="DeploymentNodeOrElementKind",cp="DeploymentViewRule";function K4(t){return G.isInstance(t,cp)}const pc="DynamicViewRule";function lp(t){return G.isInstance(t,pc)}const hc="ElementExpression";function rw(t){return G.isInstance(t,hc)}const dp="ElementPredicate";function Y4(t){return G.isInstance(t,dp)}const fp="ElementPredicateOrWhere";function X4(t){return G.isInstance(t,fp)}const Cs="ElementProperty";function J4(t){return G.isInstance(t,Cs)}const iw="ExpressionV2";function Q4(t){return G.isInstance(t,iw)}const mc="FqnExpr";function Z4(t){return G.isInstance(t,mc)}const sw="FqnReferenceable",As="LikeC4View";function aw(t){return G.isInstance(t,As)}const pp="MetadataProperty";function Sa(t){return G.isInstance(t,pp)}const ow="Predicate";function eU(t){return G.isInstance(t,ow)}const gc="Referenceable",hp="RelationExpr";function pC(t){return G.isInstance(t,hp)}const mp="RelationExpression";function uw(t){return G.isInstance(t,mp)}const gp="RelationPredicate";function tU(t){return G.isInstance(t,gp)}const yp="RelationPredicateOrWhere";function nU(t){return G.isInstance(t,yp)}const wp="RelationPredicateOrWhereV2";function rU(t){return G.isInstance(t,wp)}const yc="RelationProperty",vp="RelationshipStyleProperty";function hC(t){return G.isInstance(t,vp)}const $a="StringProperty";function mC(t){return G.isInstance(t,$a)}const wc="StyleProperty";function cw(t){return G.isInstance(t,wc)}const bp="ViewProperty";function iU(t){return G.isInstance(t,bp)}const vc="ViewRule";function sU(t){return G.isInstance(t,vc)}const Dp="ViewRulePredicate";function Ep(t){return G.isInstance(t,Dp)}const Rp="ViewRuleStyleOrGlobalRef";function lw(t){return G.isInstance(t,Rp)}const bc="WhereElement";function gC(t){return G.isInstance(t,bc)}const Dc="WhereElementExpression";function aU(t){return G.isInstance(t,Dc)}const yC="WhereExpression",Tp="WhereKindEqual";function oU(t){return G.isInstance(t,Tp)}const Ec="WhereRelation";function wC(t){return G.isInstance(t,Ec)}const Rc="WhereRelationExpression";function uU(t){return G.isInstance(t,Rc)}const Sp="WhereTagEqual";function cU(t){return G.isInstance(t,Sp)}const Tc="ArrowProperty";function Sc(t){return G.isInstance(t,Tc)}const $c="BorderProperty";function $p(t){return G.isInstance(t,$c)}const kc="ColorProperty";function _s(t){return G.isInstance(t,kc)}const Ps="CustomColor",kp="CustomElementProperties";function lU(t){return G.isInstance(t,kp)}const Cp="CustomRelationProperties";function dU(t){return G.isInstance(t,Cp)}const Ti="DeployedInstance";function rr(t){return G.isInstance(t,Ti)}const Ap="DeployedInstanceBody";function fU(t){return G.isInstance(t,Ap)}const Si="DeploymentNode";function hn(t){return G.isInstance(t,Si)}const _p="DeploymentNodeBody";function pU(t){return G.isInstance(t,_p)}const $i="DeploymentNodeKind",Pp="DeploymentRelation";function ki(t){return G.isInstance(t,Pp)}const Ip="DeploymentRelationBody";function hU(t){return G.isInstance(t,Ip)}const Cc="DeploymentView";function dw(t){return G.isInstance(t,Cc)}const xp="DeploymentViewBody";function mU(t){return G.isInstance(t,xp)}const Ac="DeploymentViewRulePredicate";function ka(t){return G.isInstance(t,Ac)}const Np="DeploymentViewRulePredicateExpression";function gU(t){return G.isInstance(t,Np)}const _c="DeploymentViewRuleStyle";function vC(t){return G.isInstance(t,_c)}const Pc="DirectedRelationExpr";function fw(t){return G.isInstance(t,Pc)}const Ic="DirectedRelationExpression";function pw(t){return G.isInstance(t,Ic)}const Ca="DynamicView";function bC(t){return G.isInstance(t,Ca)}const Op="DynamicViewBody";function yU(t){return G.isInstance(t,Op)}const xc="DynamicViewGlobalPredicateRef";function DC(t){return G.isInstance(t,xc)}const Nc="DynamicViewIncludePredicate";function wU(t){return G.isInstance(t,Nc)}const Fp="DynamicViewParallelSteps";function hw(t){return G.isInstance(t,Fp)}const Lp="DynamicViewPredicateIterator";function EC(t){return G.isInstance(t,Lp)}const mw="DynamicViewRef",Mp="DynamicViewStep";function gw(t){return G.isInstance(t,Mp)}const Wn="Element";function Nn(t){return G.isInstance(t,Wn)}const Bp="ElementBody";function Oc(t){return G.isInstance(t,Bp)}const Fc="ElementDescedantsExpression";function yw(t){return G.isInstance(t,Fc)}const zp="ElementExpressionsIterator";function vU(t){return G.isInstance(t,zp)}const ri="ElementKind";function bU(t){return G.isInstance(t,ri)}const Lc="ElementKindExpression";function qp(t){return G.isInstance(t,Lc)}const Mc="ElementPredicateWhere";function ww(t){return G.isInstance(t,Mc)}const Bc="ElementPredicateWith";function jp(t){return G.isInstance(t,Bc)}const zc="ElementRef";function qc(t){return G.isInstance(t,zc)}const jc="ElementStringProperty";function Uc(t){return G.isInstance(t,jc)}const Gc="ElementStyleProperty";function Ci(t){return G.isInstance(t,Gc)}const Wc="ElementTagExpression";function Up(t){return G.isInstance(t,Wc)}const Aa="ElementView";function Gp(t){return G.isInstance(t,Aa)}const Wp="ElementViewBody";function RC(t){return G.isInstance(t,Wp)}const vw="ElementViewRef",Hc="ExcludePredicate";function Vc(t){return G.isInstance(t,Hc)}const Kc="ExpandElementExpression";function TC(t){return G.isInstance(t,Kc)}const Is="ExtendElement";function _a(t){return G.isInstance(t,Is)}const Hp="ExtendElementBody";function SC(t){return G.isInstance(t,Hp)}const Vp="FqnElementRef";function $C(t){return G.isInstance(t,Vp)}const Kp="FqnExpressions";function DU(t){return G.isInstance(t,Kp)}const Yp="FqnRef";function kC(t){return G.isInstance(t,Yp)}const Yc="FqnRefExpr";function bw(t){return G.isInstance(t,Yc)}const Pa="GlobalDynamicPredicateGroup";function Xp(t){return G.isInstance(t,Pa)}const Ia="GlobalPredicateGroup";function Jp(t){return G.isInstance(t,Ia)}const xa="Globals";function Dw(t){return G.isInstance(t,xa)}const Qp="GlobalStyle";function Xc(t){return G.isInstance(t,Qp)}const Zp="GlobalStyleGroup";function Na(t){return G.isInstance(t,Zp)}const Jc="GlobalStyleId",Qc="IconProperty";function Er(t){return G.isInstance(t,Qc)}const Zc="IncludePredicate";function eh(t){return G.isInstance(t,Zc)}const el="IncomingRelationExpr";function Ew(t){return G.isInstance(t,el)}const tl="IncomingRelationExpression";function CC(t){return G.isInstance(t,tl)}const nl="InOutRelationExpr";function AC(t){return G.isInstance(t,nl)}const rl="InOutRelationExpression";function Rw(t){return G.isInstance(t,rl)}const xs="LibIcon";function EU(t){return G.isInstance(t,xs)}const th="LikeC4Grammar";function RU(t){return G.isInstance(t,th)}const nh="LikeC4Lib";function _C(t){return G.isInstance(t,nh)}const il="LineProperty";function sl(t){return G.isInstance(t,il)}const al="LinkProperty";function rh(t){return G.isInstance(t,al)}const ol="MetadataAttribute";function TU(t){return G.isInstance(t,ol)}const ul="MetadataBody";function SU(t){return G.isInstance(t,ul)}const Oa="Model";function PC(t){return G.isInstance(t,Oa)}const Fa="ModelDeployments";function IC(t){return G.isInstance(t,Fa)}const La="ModelViews";function cl(t){return G.isInstance(t,La)}const ll="MultipleProperty";function Tw(t){return G.isInstance(t,ll)}const ih="NavigateToProperty";function sh(t){return G.isInstance(t,ih)}const dl="NotationProperty";function Ma(t){return G.isInstance(t,dl)}const fl="NotesProperty";function xC(t){return G.isInstance(t,fl)}const pl="OpacityProperty";function ah(t){return G.isInstance(t,pl)}const hl="OutgoingRelationExpr";function Sw(t){return G.isInstance(t,hl)}const ml="OutgoingRelationExpression";function $w(t){return G.isInstance(t,ml)}const oh="Predicates";function NC(t){return G.isInstance(t,oh)}const uh="Relation";function Rr(t){return G.isInstance(t,uh)}const ch="RelationBody";function $U(t){return G.isInstance(t,ch)}const gl="RelationNavigateToProperty";function yl(t){return G.isInstance(t,gl)}const wl="RelationPredicateWhere";function kw(t){return G.isInstance(t,wl)}const vl="RelationPredicateWhereV2";function kU(t){return G.isInstance(t,vl)}const bl="RelationPredicateWith";function Cw(t){return G.isInstance(t,bl)}const Ai="RelationshipKind";function CU(t){return G.isInstance(t,Ai)}const Dl="RelationStringProperty";function El(t){return G.isInstance(t,Dl)}const Rl="RelationStyleProperty";function lh(t){return G.isInstance(t,Rl)}const Tl="ShapeProperty";function dh(t){return G.isInstance(t,Tl)}const fh="SpecificationColor";function ph(t){return G.isInstance(t,fh)}const Ba="SpecificationDeploymentNodeKind";function za(t){return G.isInstance(t,Ba)}const qa="SpecificationElementKind";function ja(t){return G.isInstance(t,qa)}const Sl="SpecificationElementStringProperty";function Aw(t){return G.isInstance(t,Sl)}const Ua="SpecificationRelationshipKind";function Ga(t){return G.isInstance(t,Ua)}const $l="SpecificationRelationshipStringProperty";function OC(t){return G.isInstance(t,$l)}const Wa="SpecificationRule";function _w(t){return G.isInstance(t,Wa)}const Ha="SpecificationTag";function hh(t){return G.isInstance(t,Ha)}const _i="Tag";function FC(t){return G.isInstance(t,_i)}const mh="Tags";function Pw(t){return G.isInstance(t,mh)}const Iw="ViewRef",kl="ViewRuleAutoLayout";function Cl(t){return G.isInstance(t,kl)}const Al="ViewRuleGlobalPredicateRef";function LC(t){return G.isInstance(t,Al)}const _l="ViewRuleGlobalStyle";function MC(t){return G.isInstance(t,_l)}const Pl="ViewRuleGroup";function gh(t){return G.isInstance(t,Pl)}const Il="ViewRuleStyle";function xl(t){return G.isInstance(t,Il)}const Nl="ViewStringProperty";function AU(t){return G.isInstance(t,Nl)}const Ol="WhereBinaryExpression";function _U(t){return G.isInstance(t,Ol)}const Fl="WhereElementKind";function PU(t){return G.isInstance(t,Fl)}const Ll="WhereElementNegation";function BC(t){return G.isInstance(t,Ll)}const Ml="WhereElementTag";function IU(t){return G.isInstance(t,Ml)}const Bl="WhereRelationKind";function zC(t){return G.isInstance(t,Bl)}const zl="WhereRelationNegation";function qC(t){return G.isInstance(t,zl)}const ql="WhereRelationParticipantKind";function jC(t){return G.isInstance(t,ql)}const jl="WhereRelationParticipantTag";function UC(t){return G.isInstance(t,jl)}const Ul="WhereRelationTag";function xU(t){return G.isInstance(t,Ul)}const Gl="WildcardExpression";function Ns(t){return G.isInstance(t,Gl)}class GC extends aD{getAllTypes(){return[Tc,$c,kc,Ps,kp,Cp,Ti,Ap,tw,Si,_p,$i,nw,Pp,Ip,Cc,xp,cp,Ac,Np,_c,Pc,Ic,Ca,Op,xc,Nc,Fp,Lp,mw,pc,Mp,Wn,Bp,Fc,hc,zp,ri,Lc,dp,fp,Mc,Bc,Cs,zc,jc,Gc,Wc,Aa,Wp,vw,Hc,Kc,iw,Is,Hp,Vp,mc,Kp,Yp,Yc,sw,Pa,Ia,Qp,Zp,Jc,xa,Qc,nl,rl,Zc,el,tl,xs,th,nh,As,il,al,ol,ul,pp,Oa,Fa,La,ll,ih,dl,fl,pl,hl,ml,ow,oh,gc,uh,ch,hp,mp,gl,gp,yp,wp,wl,vl,bl,yc,Dl,Rl,Ai,vp,Tl,fh,Ba,qa,Sl,Ua,$l,Wa,Ha,$a,wc,_i,mh,bp,Iw,vc,kl,Al,_l,Pl,Dp,Il,Rp,Nl,Ol,bc,Dc,Fl,Ll,Ml,yC,Tp,Ec,Rc,Bl,zl,ql,jl,Ul,Sp,Gl]}computeIsSubtype(e,n){switch(e){case Tc:case il:return this.isSubtype(vp,n);case $c:case ll:case pl:case Tl:return this.isSubtype(wc,n);case kc:return this.isSubtype(vp,n)||this.isSubtype(wc,n);case Ti:case Si:return this.isSubtype(tw,n)||this.isSubtype(gc,n);case $i:case ri:return this.isSubtype(nw,n);case Cc:case Ca:case Aa:return this.isSubtype(As,n);case Ac:case _c:return this.isSubtype(cp,n);case Pc:case el:case nl:case hl:return this.isSubtype(hp,n);case Ic:case tl:case rl:case ml:return this.isSubtype(mp,n);case xc:case Nc:return this.isSubtype(pc,n);case Wn:return this.isSubtype(sw,n)||this.isSubtype(gc,n);case Fc:case Lc:case zc:case Wc:case Kc:return this.isSubtype(hc,n);case hc:case Mc:return this.isSubtype(fp,n);case dp:case gp:return this.isSubtype(ow,n);case fp:case Bc:return this.isSubtype(dp,n);case jc:return this.isSubtype(Cs,n)||this.isSubtype($a,n);case Gc:return this.isSubtype(Cs,n);case Hc:case Zc:return this.isSubtype(Dp,n);case Is:case gc:return this.isSubtype(sw,n);case mc:case wp:return this.isSubtype(iw,n);case Yc:return this.isSubtype(mc,n);case Qc:return this.isSubtype(Cs,n)||this.isSubtype(wc,n);case al:return this.isSubtype(Cs,n)||this.isSubtype(yc,n)||this.isSubtype(bp,n);case ol:case dl:case fl:case Sl:case $l:return this.isSubtype($a,n);case ul:return this.isSubtype(pp,n);case pp:return this.isSubtype(Cs,n)||this.isSubtype(yc,n);case hp:case vl:return this.isSubtype(wp,n);case mp:case wl:return this.isSubtype(yp,n);case gl:case Rl:return this.isSubtype(yc,n);case yp:case bl:return this.isSubtype(gp,n);case Dl:return this.isSubtype(yc,n)||this.isSubtype($a,n);case kl:return this.isSubtype(cp,n)||this.isSubtype(pc,n)||this.isSubtype(vc,n);case Al:case Pl:case Dp:return this.isSubtype(vc,n);case _l:case Il:return this.isSubtype(Rp,n);case Rp:return this.isSubtype(pc,n)||this.isSubtype(vc,n);case Nl:return this.isSubtype($a,n)||this.isSubtype(bp,n);case Ol:return this.isSubtype(Dc,n)||this.isSubtype(Rc,n);case bc:case Ll:return this.isSubtype(Dc,n);case Dc:case Rc:return this.isSubtype(yC,n);case Fl:return this.isSubtype(bc,n)||this.isSubtype(Tp,n);case Ml:return this.isSubtype(bc,n)||this.isSubtype(Sp,n);case Ec:case zl:return this.isSubtype(Rc,n);case Bl:case ql:return this.isSubtype(Tp,n)||this.isSubtype(Ec,n);case jl:case Ul:return this.isSubtype(Ec,n)||this.isSubtype(Sp,n);case Gl:return this.isSubtype(hc,n)||this.isSubtype(mc,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return Ps;case"DeploymentNode:kind":return $i;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return Ai;case"DynamicViewGlobalPredicateRef:predicate":return Pa;case"DynamicViewRef:view":return Ca;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return ri;case"ElementRef:el":case"FqnElementRef:el":return Wn;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationParticipantTag:value":case"WhereRelationTag:value":return _i;case"ElementViewRef:view":return Aa;case"FqnRef:value":return gc;case"IconProperty:libicon":return xs;case"ViewRef:view":return As;case"ViewRuleGlobalPredicateRef:predicate":return Ia;case"ViewRuleGlobalStyle:style":return Jc;case"WhereRelationParticipantKind:value":return nw;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Tc:return{name:Tc,properties:[{name:"key"},{name:"value"}]};case $c:return{name:$c,properties:[{name:"key"},{name:"value"}]};case kc:return{name:kc,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case Ps:return{name:Ps,properties:[{name:"name"}]};case kp:return{name:kp,properties:[{name:"props",defaultValue:[]}]};case Cp:return{name:Cp,properties:[{name:"props",defaultValue:[]}]};case Ti:return{name:Ti,properties:[{name:"body"},{name:"element"},{name:"name"},{name:"title"}]};case Ap:return{name:Ap,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Si:return{name:Si,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case _p:return{name:_p,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case $i:return{name:$i,properties:[{name:"name"}]};case Pp:return{name:Pp,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Ip:return{name:Ip,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Cc:return{name:Cc,properties:[{name:"body"},{name:"name"}]};case xp:return{name:xp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Ac:return{name:Ac,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case Np:return{name:Np,properties:[{name:"prev"},{name:"value"}]};case _c:return{name:_c,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case Pc:return{name:Pc,properties:[{name:"source"},{name:"target"}]};case Ic:return{name:Ic,properties:[{name:"source"},{name:"target"}]};case Ca:return{name:Ca,properties:[{name:"body"},{name:"name"}]};case Op:return{name:Op,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case xc:return{name:xc,properties:[{name:"predicate"}]};case Nc:return{name:Nc,properties:[{name:"predicates"}]};case Fp:return{name:Fp,properties:[{name:"steps",defaultValue:[]}]};case Lp:return{name:Lp,properties:[{name:"prev"},{name:"value"}]};case mw:return{name:mw,properties:[{name:"view"}]};case Mp:return{name:Mp,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case Wn:return{name:Wn,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case Bp:return{name:Bp,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Fc:return{name:Fc,properties:[{name:"parent"},{name:"suffix"}]};case zp:return{name:zp,properties:[{name:"prev"},{name:"value"}]};case ri:return{name:ri,properties:[{name:"name"}]};case Lc:return{name:Lc,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case Mc:return{name:Mc,properties:[{name:"subject"},{name:"where"}]};case Bc:return{name:Bc,properties:[{name:"custom"},{name:"subject"}]};case zc:return{name:zc,properties:[{name:"el"},{name:"parent"}]};case jc:return{name:jc,properties:[{name:"key"},{name:"value"}]};case Gc:return{name:Gc,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Wc:return{name:Wc,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case Aa:return{name:Aa,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case Wp:return{name:Wp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case vw:return{name:vw,properties:[{name:"view"}]};case Hc:return{name:Hc,properties:[{name:"predicates"}]};case Kc:return{name:Kc,properties:[{name:"expand"}]};case Is:return{name:Is,properties:[{name:"body"},{name:"element"}]};case Hp:return{name:Hp,properties:[{name:"elements",defaultValue:[]}]};case Vp:return{name:Vp,properties:[{name:"el"},{name:"parent"}]};case Kp:return{name:Kp,properties:[{name:"prev"},{name:"value"}]};case Yp:return{name:Yp,properties:[{name:"parent"},{name:"value"}]};case Yc:return{name:Yc,properties:[{name:"ref"},{name:"selector"}]};case Pa:return{name:Pa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case Ia:return{name:Ia,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case xa:return{name:xa,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{name:"styles",defaultValue:[]}]};case Qp:return{name:Qp,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case Zp:return{name:Zp,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case Jc:return{name:Jc,properties:[{name:"name"}]};case Qc:return{name:Qc,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case Zc:return{name:Zc,properties:[{name:"predicates"}]};case el:return{name:el,properties:[{name:"to"}]};case tl:return{name:tl,properties:[{name:"to"}]};case nl:return{name:nl,properties:[{name:"inout"}]};case rl:return{name:rl,properties:[{name:"inout"}]};case xs:return{name:xs,properties:[{name:"name"}]};case th:return{name:th,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case nh:return{name:nh,properties:[{name:"icons",defaultValue:[]}]};case il:return{name:il,properties:[{name:"key"},{name:"value"}]};case al:return{name:al,properties:[{name:"key"},{name:"title"},{name:"value"}]};case ol:return{name:ol,properties:[{name:"key"},{name:"value"}]};case ul:return{name:ul,properties:[{name:"props",defaultValue:[]}]};case Oa:return{name:Oa,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case Fa:return{name:Fa,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case La:return{name:La,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case ll:return{name:ll,properties:[{name:"key"},{name:"value"}]};case ih:return{name:ih,properties:[{name:"key"},{name:"value"}]};case dl:return{name:dl,properties:[{name:"key"},{name:"value"}]};case fl:return{name:fl,properties:[{name:"key"},{name:"value"}]};case pl:return{name:pl,properties:[{name:"key"},{name:"value"}]};case hl:return{name:hl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case ml:return{name:ml,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case oh:return{name:oh,properties:[{name:"prev"},{name:"value"}]};case uh:return{name:uh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case ch:return{name:ch,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case gl:return{name:gl,properties:[{name:"key"},{name:"value"}]};case wl:return{name:wl,properties:[{name:"subject"},{name:"where"}]};case vl:return{name:vl,properties:[{name:"subject"},{name:"where"}]};case bl:return{name:bl,properties:[{name:"custom"},{name:"subject"}]};case Ai:return{name:Ai,properties:[{name:"name"}]};case Dl:return{name:Dl,properties:[{name:"key"},{name:"value"}]};case Rl:return{name:Rl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Tl:return{name:Tl,properties:[{name:"key"},{name:"value"}]};case fh:return{name:fh,properties:[{name:"color"},{name:"name"}]};case Ba:return{name:Ba,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case qa:return{name:qa,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Sl:return{name:Sl,properties:[{name:"key"},{name:"value"}]};case Ua:return{name:Ua,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case $l:return{name:$l,properties:[{name:"key"},{name:"value"}]};case Wa:return{name:Wa,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case Ha:return{name:Ha,properties:[{name:"tag"}]};case _i:return{name:_i,properties:[{name:"name"}]};case mh:return{name:mh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Iw:return{name:Iw,properties:[{name:"view"}]};case kl:return{name:kl,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case Al:return{name:Al,properties:[{name:"predicate"}]};case _l:return{name:_l,properties:[{name:"style"}]};case Pl:return{name:Pl,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case Il:return{name:Il,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case Nl:return{name:Nl,properties:[{name:"key"},{name:"value"}]};case Ol:return{name:Ol,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Fl:return{name:Fl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Ll:return{name:Ll,properties:[{name:"value"}]};case Ml:return{name:Ml,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Bl:return{name:Bl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case zl:return{name:zl,properties:[{name:"value"}]};case ql:return{name:ql,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case jl:return{name:jl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case Ul:return{name:Ul,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Gl:return{name:Gl,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const G=new GC;let WC;const NU=()=>WC??(WC=J3(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","entry":true,"name":"LikeC4Grammar","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibIcon","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tag","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"specification"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"colors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"deploymentNodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"element"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationDeploymentNodeKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deploymentNode"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationTag","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"tag"},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationColor","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"color"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"color","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"relationship"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Model","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"model"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Element","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElement","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tags","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Tags"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelViews","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"views"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@36"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@37"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewLayoutDirection","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"TopBottom"},{"$type":"Keyword","value":"LeftRight"},{"$type":"Keyword","value":"BottomTop"},{"$type":"Keyword","value":"RightLeft"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncludePredicate"}},{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicates","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@120"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementAnd","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSelectorExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementDescedantsExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]}}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicates","inferredType":{"$type":"InferredType","name":"RelationPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantTag"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantKind"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpression"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpressionsIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementExpressionsIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewIncludePredicate","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@121"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DynamicViewPredicateIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@122"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyleOrGlobalRef","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleAutoLayout","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"autoLayout"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@170"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@170"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotationProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotesProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationNavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelDeployments","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"deployment"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNode","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstance","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstanceBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelation","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"targets","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicate","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isInclude","operator":"?=","terminal":{"$type":"Keyword","value":"include"}},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"expr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicateExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DeploymentViewRulePredicateExpression"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExpressionV2","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhereV2"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpr","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRefExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"ref","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpr"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpr"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExpressions"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Globals","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"global"}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}]},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"predicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalDynamicPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamicPredicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"styleGroup"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ColorProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OpacityProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MultipleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"multiple"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"icon"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderStyleValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"border"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"line"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"head"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Boolean","dataType":"boolean","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"false"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineOptions","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"solid"},{"$type":"Keyword","value":"dashed"},{"$type":"Keyword","value":"dotted"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"Keyword","value":"normal"},{"$type":"Keyword","value":"onormal"},{"$type":"Keyword","value":"dot"},{"$type":"Keyword","value":"odot"},{"$type":"Keyword","value":"diamond"},{"$type":"Keyword","value":"odiamond"},{"$type":"Keyword","value":"crow"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"vee"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ThemeColor","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"primary"},{"$type":"Keyword","value":"secondary"},{"$type":"Keyword","value":"muted"},{"$type":"Keyword","value":"slate"},{"$type":"Keyword","value":"blue"},{"$type":"Keyword","value":"indigo"},{"$type":"Keyword","value":"sky"},{"$type":"Keyword","value":"red"},{"$type":"Keyword","value":"gray"},{"$type":"Keyword","value":"green"},{"$type":"Keyword","value":"amber"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementShape","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rectangle"},{"$type":"Keyword","value":"person"},{"$type":"Keyword","value":"browser"},{"$type":"Keyword","value":"mobile"},{"$type":"Keyword","value":"cylinder"},{"$type":"Keyword","value":"storage"},{"$type":"Keyword","value":"queue"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Participant","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"source"},{"$type":"Keyword","value":"target"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorValue","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@171"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@170"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"},{"$type":"Keyword","value":"node"},{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"instance"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EqOperator","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$type":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"IsEqual","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|azure|gcp|tech):[-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_WITH_SCHEMA","definition":{"$type":"RegexToken","regex":"/\\\\w+:\\\\/\\\\/\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotUnderscore","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\._(?![_a-zA-Z])/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*{1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hash","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"#"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"StickyDot","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\./"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Dot","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NotEqual","definition":{"$type":"RegexToken","regex":"/\\\\!\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Eq","definition":{"$type":"RegexToken","regex":"/\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Percent","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+%/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"String","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"IdTerminal","definition":{"$type":"RegexToken","regex":"/[_]*[a-zA-Z][-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Number","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+\\\\b/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hex","definition":{"$type":"RegexToken","regex":"/\\\\b[a-zA-Z0-9]+\\\\b/"},"fragment":false,"hidden":false}],"types":[{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@36"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@37"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@103"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@44"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@29"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@33"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}}]}},{"$type":"Type","name":"DeploymentNodeOrElementKind","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@3"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@7"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@2/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@3/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@58"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@70"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@7"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),xw={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},OU={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},FU={AstReflection:()=>new GC},LU={Grammar:()=>NU(),LanguageMetaData:()=>xw,parser:{ParserConfig:()=>OU}},mt={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},HC={silent:{level:-1},fatal:{level:mt.fatal},error:{level:mt.error},warn:{level:mt.warn},log:{level:mt.log},info:{level:mt.info},success:{level:mt.success},fail:{level:mt.fail},ready:{level:mt.info},start:{level:mt.info},box:{level:mt.info},debug:{level:mt.debug},trace:{level:mt.trace},verbose:{level:mt.verbose}};function Nw(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Ow(t,e,n=".",r){if(!Nw(e))return Ow(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:Nw(a)&&Nw(i[s])?i[s]=Ow(a,i[s],(n?`${n}.`:"")+s.toString()):i[s]=a)}return i}function MU(t){return(...e)=>e.reduce((n,r)=>Ow(n,r,""),{})}const BU=MU();function zU(t){return Object.prototype.toString.call(t)==="[object Object]"}function qU(t){return!(!zU(t)||!t.message&&!t.args||t.stack)}let Fw=!1;const VC=[];let mn=class A1{options;_lastLog;_mockFn;constructor(e={}){const n=e.types||HC;this.options=BU({...e,defaults:{...e.defaults},level:Lw(e.level,n),reporters:[...e.reporters||[]]},{types:HC,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const r in n){const i={type:r,...this.options.defaults,...n[r]};this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=Lw(e,this.options.types,this.options.level)}prompt(e,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,n)}create(e){const n=new A1({...this.options,...e});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const n=this.options.reporters.indexOf(e);if(n!==-1)return this.options.reporters.splice(n,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,n){e&&(e.__write||(e.__write=e.write),e.write=r=>{this[n].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){Fw=!0}resumeLogs(){Fw=!1;const e=VC.splice(0);for(const n of e)n[0]._logFn(n[1],n[2])}mockTypes(e){const n=e||this.options.mockFn;if(this._mockFn=n,typeof n=="function")for(const r in this.options.types)this[r]=n(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(e,n){return(...r)=>{if(Fw){VC.push([this,e,r,n]);return}return this._logFn(e,r,n)}}_logFn(e,n,r){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:Lw(e.level,this.options.types)};!r&&n.length===1&&qU(n[0])?Object.assign(i,n[0]):i.args=[...n],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
|
|
164
|
-
`)),i.args.push(`
|
|
165
|
-
`+i.additional.join(`
|
|
166
|
-
`)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";const s=(o=!1)=>{const u=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&u>0){const c=[...this._lastLog.object.args];u>1&&c.push(`(repeated ${u} times)`),this._log({...this._lastLog.object,args:c}),this._lastLog.count=1}o&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const a=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,a<this.options.throttle)try{const o=JSON.stringify([i.type,i.tag,i.args]),u=this._lastLog.serialized===o;if(this._lastLog.serialized=o,u&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(s,this.options.throttle);return}}catch{}s(!0)}_log(e){for(const n of this.options.reporters)n.log(e,{options:this.options})}};function Lw(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}mn.prototype.add=mn.prototype.addReporter,mn.prototype.remove=mn.prototype.removeReporter,mn.prototype.clear=mn.prototype.removeReporter,mn.prototype.withScope=mn.prototype.withTag,mn.prototype.mock=mn.prototype.mockTypes,mn.prototype.pause=mn.prototype.pauseLogs,mn.prototype.resume=mn.prototype.resumeLogs;function jU(t={}){return new mn(t)}function KC(t){const e=process.cwd()+zb;return t.split(`
|
|
167
|
-
`).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function UU(t,e){return(e.__write||e.write).call(e,t)}const Mw=t=>t?`[${t}]`:"";class YC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return r+KC(e).join(`
|
|
168
|
-
${r}`)}formatError(e,n){const r=e.message??qb(n,e),i=e.stack?this.formatStack(e.stack,n):"",s=n?.errorLevel||0,a=s>0?`${" ".repeat(s)}[cause]: `:"",o=e.cause?`
|
|
169
|
-
|
|
170
|
-
`+this.formatError(e.cause,{...n,errorLevel:s+1}):"";return a+r+`
|
|
171
|
-
`+i+o}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,n):i);return qb(n,...r)}formatDate(e,n){return n.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,n){const r=this.formatArgs(e.args,n);return e.type==="box"?`
|
|
172
|
-
`+[Mw(e.tag),e.title&&e.title,...r.split(`
|
|
173
|
-
`)].filter(Boolean).map(i=>" > "+i).join(`
|
|
174
|
-
`)+`
|
|
175
|
-
`:this.filterAndJoin([Mw(e.type),Mw(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return UU(r+`
|
|
176
|
-
`,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}const{env:Pi={},argv:XC=[],platform:GU=""}=typeof process>"u"?{}:process,WU="NO_COLOR"in Pi||XC.includes("--no-color"),HU="FORCE_COLOR"in Pi||XC.includes("--color"),VU=GU==="win32",JC=Pi.TERM==="dumb",KU=vm&&vm.isatty&&vm.isatty(1)&&Pi.TERM&&!JC,YU="CI"in Pi&&("GITHUB_ACTIONS"in Pi||"GITLAB_CI"in Pi||"CIRCLECI"in Pi),XU=!WU&&(HU||VU&&!JC||KU||YU);function QC(t,e,n,r,i=e.slice(0,Math.max(0,t))+r,s=e.slice(Math.max(0,t+n.length)),a=s.indexOf(n)){return i+(a<0?s:QC(a,s,n,r))}function JU(t,e,n,r,i){return t<0?n+e+r:n+QC(t,e,r,i)+r}function QU(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?JU((""+i).indexOf(e,r),i,t,e,n):""}function $e(t,e,n){return QU(`\x1B[${t}m`,`\x1B[${e}m`,n)}const ZC={reset:$e(0,0),bold:$e(1,22,"\x1B[22m\x1B[1m"),dim:$e(2,22,"\x1B[22m\x1B[2m"),italic:$e(3,23),underline:$e(4,24),inverse:$e(7,27),hidden:$e(8,28),strikethrough:$e(9,29),black:$e(30,39),red:$e(31,39),green:$e(32,39),yellow:$e(33,39),blue:$e(34,39),magenta:$e(35,39),cyan:$e(36,39),white:$e(37,39),gray:$e(90,39),bgBlack:$e(40,49),bgRed:$e(41,49),bgGreen:$e(42,49),bgYellow:$e(43,49),bgBlue:$e(44,49),bgMagenta:$e(45,49),bgCyan:$e(46,49),bgWhite:$e(47,49),blackBright:$e(90,39),redBright:$e(91,39),greenBright:$e(92,39),yellowBright:$e(93,39),blueBright:$e(94,39),magentaBright:$e(95,39),cyanBright:$e(96,39),whiteBright:$e(97,39),bgBlackBright:$e(100,49),bgRedBright:$e(101,49),bgGreenBright:$e(102,49),bgYellowBright:$e(103,49),bgBlueBright:$e(104,49),bgMagentaBright:$e(105,49),bgCyanBright:$e(106,49),bgWhiteBright:$e(107,49)};function ZU(t=XU){return t?ZC:Object.fromEntries(Object.keys(ZC).map(e=>[e,String]))}const Sn=ZU();function e6(t,e="reset"){return Sn[t]||Sn[e]}const t6=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function Va(t){return t.replace(new RegExp(t6,"g"),"")}const eA={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},n6={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function r6(t,e={}){const n={...e,style:{...n6,...e.style}},r=t.split(`
|
|
177
|
-
`),i=[],s=e6(n.style.borderColor),a={...typeof n.style.borderStyle=="string"?eA[n.style.borderStyle]||eA.solid:n.style.borderStyle};if(s)for(const p in a)a[p]=s(a[p]);const o=n.style.padding%2===0?n.style.padding:n.style.padding+1,u=r.length+o,c=Math.max(...r.map(p=>Va(p).length))+o,l=c+o,d=n.style.marginLeft>0?" ".repeat(n.style.marginLeft):"";if(n.style.marginTop>0&&i.push("".repeat(n.style.marginTop)),n.title){const p=s?s(n.title):n.title,h=a.h.repeat(Math.floor((c-Va(n.title).length)/2)),w=a.h.repeat(c-Va(n.title).length-Va(h).length+o);i.push(`${d}${a.tl}${h}${p}${w}${a.tr}`)}else i.push(`${d}${a.tl}${a.h.repeat(l)}${a.tr}`);const f=n.style.valign==="center"?Math.floor((u-r.length)/2):n.style.valign==="top"?u-r.length-o:u-r.length;for(let p=0;p<u;p++)if(p<f||p>=f+r.length)i.push(`${d}${a.v}${" ".repeat(l)}${a.v}`);else{const h=r[p-f],w=" ".repeat(o),D=" ".repeat(c-Va(h).length);i.push(`${d}${a.v}${w}${h}${D}${a.v}`)}return i.push(`${d}${a.bl}${a.h.repeat(l)}${a.br}`),n.style.marginBottom>0&&i.push("".repeat(n.style.marginBottom)),i.join(`
|
|
178
|
-
`)}const yh=Object.create(null),Wl=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?yh:globalThis),Ii=new Proxy(yh,{get(t,e){return Wl()[e]??yh[e]},has(t,e){const n=Wl();return e in n||e in yh},set(t,e,n){const r=Wl(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=Wl(!0);return delete n[e],!0},ownKeys(){const t=Wl(!0);return Object.keys(t)}}),i6=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",s6=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function a6(){if(globalThis.process?.env)for(const t of s6){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const tA=a6();tA.name;function Os(t){return t?t!=="false":!1}const o6=globalThis.process?.platform||"",u6=Os(Ii.CI)||tA.ci!==!1,c6=Os(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),l6=Os(Ii.DEBUG),nA=i6==="test"||Os(Ii.TEST);Os(Ii.MINIMAL);const d6=/^win/i.test(o6);!Os(Ii.NO_COLOR)&&(Os(Ii.FORCE_COLOR)||(c6||d6)&&Ii.TERM);const f6=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(f6?.split(".")[0]);const p6=globalThis.process||Object.create(null),rA={versions:{}};new Proxy(p6,{get(t,e){if(e==="env")return Ii;if(e in t)return t[e];if(e in rA)return rA[e]}});const h6=globalThis.process?.release?.name==="node",m6=!!globalThis.Bun||!!globalThis.process?.versions?.bun,g6=!!globalThis.Deno,y6=!!globalThis.fastly,w6=!!globalThis.Netlify,v6=!!globalThis.EdgeRuntime,b6=globalThis.navigator?.userAgent==="Cloudflare-Workers",D6=[[w6,"netlify"],[v6,"edge-light"],[b6,"workerd"],[y6,"fastly"],[g6,"deno"],[m6,"bun"],[h6,"node"]];function E6(){const t=D6.find(e=>e[0]);if(t)return{name:t[1]}}const R6=E6();R6?.name;function T6({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const S6=T6();function $6(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(S6,"")}function k6(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function C6(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function A6(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function _6(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function P6(t,{ambiguousAsWide:e=!1}={}){return _6(t),C6(t)||A6(t)||e&&k6(t)?2:1}const I6=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,x6=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},N6=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function O6(t,e={}){if(typeof t!="string"||t.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(t=$6(t)),t.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of x6.segment(t)){const o=a.codePointAt(0);if(!(o<=31||o>=127&&o<=159)&&!(o>=8203&&o<=8207||o===65279)&&!(o>=768&&o<=879||o>=6832&&o<=6911||o>=7616&&o<=7679||o>=8400&&o<=8447||o>=65056&&o<=65071)&&!(o>=55296&&o<=57343)&&!(o>=65024&&o<=65039)&&!N6.test(a)){if(I6().test(a)){i+=2;continue}i+=P6(o,s)}}return i}function F6(){const{env:t}=tt,{TERM:e,TERM_PROGRAM:n}=t;return tt.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const L6={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},M6={0:"red",1:"yellow"},B6=F6(),Tr=(t,e)=>B6?t:e,iA={error:Tr("\u2716","\xD7"),fatal:Tr("\u2716","\xD7"),ready:Tr("\u2714","\u221A"),warn:Tr("\u26A0","\u203C"),info:Tr("\u2139","i"),success:Tr("\u2714","\u221A"),debug:Tr("\u2699","D"),trace:Tr("\u2192","\u2192"),fail:Tr("\u2716","\xD7"),start:Tr("\u25D0","o"),log:""};function sA(t){return typeof Intl!="object"||!Intl.Segmenter?Va(t).length:O6(t)}class z6 extends YC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return`
|
|
179
|
-
${r}`+KC(e).map(i=>" "+i.replace(/^at +/,s=>Sn.gray(s)).replace(/\((.+)\)/,(s,a)=>`(${Sn.cyan(a)})`)).join(`
|
|
180
|
-
${r}`)}formatType(e,n,r){const i=L6[e.type]||M6[e.level]||"gray";if(n)return j6(i)(Sn.black(` ${e.type.toUpperCase()} `));const s=typeof iA[e.type]=="string"?iA[e.type]:e.icon||e.type;return s?q6(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
|
|
181
|
-
`);if(e.type==="box")return r6(wh(r+(i.length>0?`
|
|
182
|
-
`+i.join(`
|
|
183
|
-
`):"")),{title:e.title?wh(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),a=s&&Sn.gray(s),o=e.badge??e.level<2,u=this.formatType(e,o,n),c=e.tag?Sn.gray(e.tag):"";let l;const d=this.filterAndJoin([u,wh(r)]),f=this.filterAndJoin(n.columns?[c,a]:[c]),p=(n.columns||0)-sA(d)-sA(f)-2;if(l=p>0&&(n.columns||0)>=80?d+" ".repeat(p)+f:(f?`${Sn.gray(`[${f}]`)} `:"")+d,l+=wh(i.length>0?`
|
|
184
|
-
`+i.join(`
|
|
185
|
-
`):""),e.type==="trace"){const h=new Error("Trace: "+e.message);l+=this.formatStack(h.stack||"")}return o?`
|
|
186
|
-
`+l+`
|
|
187
|
-
`:l}}function wh(t){return t.replace(/`([^`]+)`/gm,(e,n)=>Sn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${Sn.underline(n)} `)}function q6(t="white"){return Sn[t]||Sn.white}function j6(t="bgWhite"){return Sn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||Sn.bgWhite}function aA(t={}){let e=U6();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),jU({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>import("../chunks/prompt.mjs").then(r=>r.prompt(...n)),reporters:t.reporters||[t.fancy??!(u6||nA)?new z6:new YC],...t})}function U6(){return l6?mt.debug:nA?mt.warn:mt.info}aA();const G6=t=>{Bw.forEach(e=>{W6(t,e)})},Bw=["name","message","stack","cause","errors"],W6=(t,e)=>{const n=zw(t,e);if(n!==void 0){if(H6(n)){ii(t,e,t[e]);return}V6(n)&&oA(t,e,n)}},zw=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:zw(r,e)},H6=({get:t,set:e})=>t!==void 0&&e===void 0,V6=({enumerable:t,writable:e})=>t||!e,ii=(t,e,n)=>{oA(t,e,{value:n})},oA=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},K6=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(Y6).map(e).filter(Boolean);ii(t,"errors",n)}else X6(t)?ii(t,"errors",[]):t.errors!==void 0&&J6(t)},Y6=t=>t!==void 0,X6=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),J6=t=>{delete t.errors,t.errors!==void 0&&ii(t,"errors",[])},Q6=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:ii(t,"cause",n)},Z6=t=>eG(t)||tG(t),eG=t=>{try{return t instanceof Error}catch{return!1}},tG=t=>{try{return nG.has(Object.prototype.toString.call(t))}catch{return!1}},nG=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function vh(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const rG=t=>!Object.isExtensible(t)||Bw.some(e=>iG(t,e)||sG(t,e)),iG=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},sG=(t,e)=>{try{return t[e],!1}catch{return!0}},qw=t=>{const e=aG(t.message,t.name);ii(t,"stack",e)},aG=(t="",e="Error")=>{const n=oG(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},oG=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},uG=t=>{const e={};for(const n of cG(t))try{const r=t[n],{enumerable:i,configurable:s,writable:a=!0}=zw(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:a})}catch{}return e},cG=t=>{const e=lG(t);for(const n of Bw)dG(t,n)&&e.push(n);return e},lG=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},dG=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},uA=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...a}=uG(t),o=fG(n,a),u=gG(e,o);return n===o&&yG(u,a),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([c,l])=>{wG(u,c,l)}),r===void 0&&qw(u),u},fG=(t,e)=>typeof t=="string"&&t!==""?t:mG(pG(e)),pG=t=>{try{return JSON.stringify(t)}catch{return hG(t)}},hG=t=>{try{return String(t)}catch{return"Invalid error"}},mG=t=>t.length<cA?t:`${t.slice(0,cA)}...`,cA=1e3,gG=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in lA?new lA[t](e):new Error(e),lA={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},yG=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},wG=(t,e,n)=>{n!==void 0&&ii(t,e,n)},vG=t=>{try{const e=new Error(String(t));return qw(e),e}catch(e){return e}},{toString:bG}=Object.prototype,DG=t=>EG(t)?uA(t):Z6(t)?RG(t)?uA(t):t:vG(t),EG=t=>{try{return vh(t)}catch{return!1}},RG=t=>TG(t)||rG(t)||SG(t),TG=t=>{try{return bG.call(t)==="[object Object]"}catch{return!0}},SG=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),bh=(t,{shallow:e=!1}={})=>dA(t,[],e),dA=(t,e,n)=>{if(e.includes(t))return;const r=n?$G:s=>dA(s,[...e,t],n),i=DG(t);return kG(i,r),i},$G=t=>t,kG=(t,e)=>{CG(t),AG(t),_G(t),Q6(t,e),K6(t,e),G6(t)},CG=t=>{if(Dh(t.name))return;const e=Object.getPrototypeOf(t).name,n=Dh(e)?e:t.constructor.name;ii(t,"name",n)},AG=t=>{Dh(t.message)||ii(t,"message","")},_G=t=>{Dh(t.stack)||qw(t)},Dh=t=>typeof t=="string"&&t!=="",PG=(t,e,n=t.name)=>{if(IG(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},IG=t=>{if(!xG(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!fA(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!NG(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},xG=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,fA=t=>t!==null&&(t.name==="Error"||fA(Object.getPrototypeOf(t))),NG=t=>typeof t.prototype.constructor=="function",pA=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},OG=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(FG(t,e),gA(t,"constructor"),LG(t,e))},FG=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},LG=(t,e)=>{gA(t,"name");const n=hA(e.prototype);t.name!==n&&pA(t,"name",n)},hA=t=>MG(t)??BG(t)??hA(Object.getPrototypeOf(t)),MG=t=>Object.hasOwn(t,"name")&&mA(t.name)?t.name:void 0,BG=t=>typeof t.constructor=="function"&&mA(t.constructor.name)?t.constructor.name:void 0,mA=t=>typeof t=="string"&&t!=="",gA=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},zG=(t,e)=>{if(!qG(t,e))return;const n=UG(t,e);pA(t,"stack",n)},qG=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&jG(),jG=()=>{class t extends Error{}const e={value:yA,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(yA)},yA="SetErrorClassError",UG=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=GG(n,t),[i,s]=r.find(([a])=>e.includes(a));return e.replace(i,s)},GG=(t,e)=>[[`
|
|
188
|
-
${t}: `,`
|
|
189
|
-
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],WG=(t,e,n)=>{const r=bh(t),i=PG(r,e,n);return OG(r,e),zG(r,i),r},HG=(t,e)=>e.configurable===!1?VG(t,e):XG(t,e),VG=(t,e)=>({...e,...KG(t,e),...YG(t,e)}),KG=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},YG=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},XG=(t,e)=>{const n=Hl(t.enumerable,e.enumerable,!0),r=Hl(t.writable,e.writable,!0),i=Hl(t.configurable,e.configurable,!0);return{...JG(t,e,r),enumerable:n,configurable:i}},JG=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!wA(t)&&!wA(e)?{value:e.value,writable:n}:{get:Hl(t.get,e.get),set:Hl(t.set,e.set)},wA=({get:t,set:e})=>t!==void 0||e!==void 0,Hl=(t,e,n)=>t??e??n,QG=(t,e,n)=>{if(!ZG(t))throw new TypeError(`Argument must be an object: ${t}`);if(!eW(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return tW(n)},ZG=t=>typeof t=="object"&&t!==null,eW=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},tW=t=>{if(!vh(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,...o}=t,u="value"in t;return nW({enumerable:e,writable:n,configurable:r,get:s,set:a,unknownProps:o,hasValue:u}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,hasValue:u}},nW=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:a})=>{vA(a,r,"get"),vA(a,i,"set"),jw(t,"enumerable"),jw(e,"writable"),jw(n,"configurable"),iW(s)},vA=(t,e,n)=>{if(rW(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},rW=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},jw=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},iW=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},sW=(t,e,n)=>{const r=QG(t,e,n),i=bA(t,e),s=HG(r,i);return aW(t,e,s),t},bA=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:bA(r,e)},aW=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},oW=(t,e,n)=>{if(n!==void 0)return DA(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return DA(t,e)},DA=(t,e,n)=>{const r=uW(e);sW(t,e,{value:n,...r})},uW=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},cW=t=>lW(t)||dW(t),lW=t=>{try{return t instanceof Error}catch{return!1}},dW=t=>{try{return fW.has(Object.prototype.toString.call(t))}catch{return!1}},fW=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),pW=(t,e,n={})=>{if(EA(t,"First argument"),EA(e,"Second argument"),!vh(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},EA=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!hW(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},hW=t=>vh(t)||cW(t),mW=({error:t,props:e,propName:n,soft:r})=>gW(n)||!vW.call(e,n)||r&&t[n]!==void 0,gW=t=>t in yW||wW.has(t),yW=new Error("check"),wW=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:vW}=Object.prototype,bW=(t,e,n)=>{const{soft:r}=pW(t,e,n);for(const i of Reflect.ownKeys(e))DW({error:t,props:e,propName:i,soft:r});return t},DW=({error:t,props:e,propName:n,soft:r})=>{mW({error:t,props:e,propName:n,soft:r})||oW(t,n,e[n])},Eh=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},EW=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Eh(t,"errors",n)},RW=({target:t,source:e,parent:n,child:r})=>{if(!RA(t)){TW(t,e);return}RA(e)&&Eh(t,"errors",[...r.errors,...n.errors])},TW=(t,e)=>{e.errors!==void 0&&Eh(t,"errors",e.errors)},RA=t=>t.errors!==void 0&&t.errors.length!==0,SW=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},$W=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?kW({name:t,stack:e,newMessage:n,currentMessage:r}):AW(t,e,n),kW=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=CW(t,n,r),[s,a]=i.find(([o])=>e.includes(o));return e.replace(s,a)},CW=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
190
|
-
${n}`,`
|
|
191
|
-
${e}`],[` ${n}`,` ${e}`],[n,e]],AW=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
192
|
-
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
193
|
-
`):`${r}${i}
|
|
194
|
-
${e}`},_W=(t,e,n)=>{const r=bh(t),i=SW(r,e,n);return SA(r,"message",e),PW(r,e,i),r},PW=(t,e,n)=>{if(e===n||!IW())return;const r=$W(t,e,n);SA(t,"stack",r)},IW=()=>{const{stack:t}=new Error(TA);return typeof t=="string"&&t.includes(TA)},TA="set-error-message test message",SA=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},$A=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=bh(t),i=xW(e,r.message);return _W(r,i,n)},xW=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:NW(n,r,t)},NW=(t,e,n)=>t.endsWith(OW)?n.endsWith(FW)?`${t}
|
|
195
|
-
${e}`:`${t} ${e}`:`${e}
|
|
196
|
-
${t}`,OW=":",FW=`
|
|
197
|
-
`,LW=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,$A(n,i,r.message)},MW=(t,e)=>kA(t)===e,kA=t=>typeof t=="object"&&t!==null?t.stack:void 0,BW=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Eh(e,"stack",n.stack),n),zW=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},qW=t=>CA(t,[]).error,CA=(t,e)=>{if(e.includes(t))return{};const n=u=>CA(u,[...e,t]),r=kA(t),i=bh(t,{shallow:!0}),s=MW(i,r);EW(i,n);const{parent:a,childHasStack:o}=jW(i,n);return{error:a,errorHasStack:s||o}},jW=(t,e)=>{const n=zW(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:UW({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},UW=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],a=BW({wrap:r,target:i,source:s,childHasStack:n}),o=WG(i,i.constructor,a.name),u=LW({parent:t,child:e,target:o,stackError:a});return RW({target:u,source:s,parent:t,child:e}),bW(u,s,{soft:!r})};function AA(t){return function(e,n){if(typeof n?.toJSON=="function"&&(n=n.toJSON()),!(n!==null&&typeof n=="object"))return n;if(t.has(n))return"[Circular]";t.add(n);const r=Array.isArray(n)?[]:{};for(const[i,s]of Object.entries(n))r[i]=AA(t)(i,s);return t.delete(n),r}}function _A(t,{indentation:e}={}){return JSON.stringify(t,AA(new WeakSet),e)}const GW=t=>t.split(`
|
|
198
|
-
`).map(e=>e.trim().replace("file://",""));function WW(t,e=GW){const n={message:""},r=t.args.find(s=>s instanceof Error);if(!r)return n.message=t.args.map(s=>typeof s=="string"?s:_A(s)).join("; "),typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n;const i=t.args.reduce((s,a)=>{if(a===r)return s;const o=typeof a=="string"?a:_A(a);return $A(s,o)},qW(r));if(n.message=i.message,n.error={message:i.message,name:i.name},i.stack){const s=e(i.stack);n.error.stack=s.join(`
|
|
199
|
-
`),n.message+=`
|
|
200
|
-
`+s.slice(1).map(a=>" "+a).join(`
|
|
201
|
-
`)}return typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n}function HW(t){const e=ox()+zb;return t.split(`
|
|
202
|
-
`).map(n=>n.trim().replace("file://","").replace(e,""))}function VW(t){return WW(t,HW)}const PA=mt.debug,Mt=aA({level:PA,defaults:{level:PA},throttle:2,throttleMin:500,formatOptions:{colors:!0,compact:!1,date:!1}}),xe=Mt.withTag("lsp");function IA(t){xe.error(t)}function ye(t){if(t instanceof Error){xe.warn(t.stack??t.message);return}xe.warn(t)}function KW(t){xe.level=mt[t]}function YW(t){const e={log:(n,r)=>{const{message:i,error:s}=VW(n);switch(n.type){case"silent":break;case"verbose":case"trace":{t.tracer.log(i);break}case"debug":{t.console.debug(i);break}case"log":{t.console.log(i);break}case"info":case"box":case"ready":case"start":case"success":{t.console.info(i);break}case"warn":{t.console.warn(i);break}case"fail":case"error":case"fatal":{t.console.error(i),s?t.telemetry.logEvent({eventName:"error",...s}):t.telemetry.logEvent({eventName:"error",message:i});break}default:Ie(n.type)}}};Mt.setReporters([e]),xe.setReporters(Mt.options.reporters)}const XW={fileSystemProvider:()=>new QW},JW=t=>xw.fileExtensions.some(e=>t.endsWith(e));let QW=class extends V4{async readDirectory(e){const n=[];try{const r=await new H4.fdir().withSymlinks().withFullPaths().filter(JW).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:Wt.file(i)})}catch(r){xe.error(r)}return n}};function xA(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Uw(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function NA(t){return Uw(t)||xA(t)}function Vl(t){return typeof t=="string"||NA(t)}function ZW(t){return Array.isArray(t)&&t.every(Vl)}function e9(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function OA(t){if(NA(t))return t;const[e,n,r]=t.split(":");return e9(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function t9(t){if(t.length<2&&(Vl(t[0])&&Vl(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>OA(e))}const Rh=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function n9(t){return Object.assign(Object.seal(Object.assign({},Rh)),t)}function r9(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Hn(t,...e){return r9(t,...e)}const i9=t=>(...e)=>n=>t(n,...e),s9=t=>({[Symbol.iterator]:t}),ir=i9((t,e)=>Array.from(s9(function*(){for(const n of t)yield e(n)})));class FA{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Ve=FA.prototype.createElement.bind(new FA),a9=/\r?\n/;function sr(t){return e=>e.join(t)}function o9(t){return e=>t+e+t}function xi(t,e){return n=>t+n+e}function Th(t){return e=>t+e}const LA=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Sh=t=>t.split(a9),Kl=(t,e,n)=>Hn(Sh,ir(Th(t==="space"?" ".repeat(e):`
|
|
203
|
-
`)),sr(n)),Fs=t=>{switch(t){case"crlf":return`\r
|
|
204
|
-
`;case"lf":return`
|
|
205
|
-
`}},u9={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=Fs(t.endOfLine);return Hn(ir(t.print),sr(n),Kl(t.indentStyle,t.indentSize,n),xi(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},c9={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},l9={match(t){return t.type==="Comment"},print(t,e){const n=Fs(t.endOfLine);switch(e.kind){case"Block":return Hn(Sh,ir(Th(" * ")),sr(n),xi(`/**${n}`,`${n} */`))(e.value);case"Macro":return Hn(Sh,ir(Th("# ")),sr(n))(e.value);case"Slash":default:return Hn(Sh,ir(Th("// ")),sr(n))(e.value)}}},d9={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Fs(t.endOfLine))}},f9={match(t){return t.type==="Edge"},print(t,e){const n=Hn(ir(t.print),sr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=Fs(t.endOfLine),i=Hn(ir(t.print),sr(r),Kl(t.indentStyle,t.indentSize,r),xi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},p9={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;const n=[];if(e.strict&&n.push("strict"),n.push(e.directed?"digraph":"graph"),e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=Fs(t.endOfLine),i=Hn(ir(t.print),sr(r),Kl(t.indentStyle,t.indentSize,r),xi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},h9=Hn(LA,o9('"')),m9=xi("<",">"),g9={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return m9(e.value);case!0:return h9(e.value);case!1:default:return LA(e.value)}}},y9={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=Fs(t.endOfLine),i=Hn(ir(t.print),sr(r),Kl(t.indentStyle,t.indentSize,r),xi(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},w9={match(t){return t.type==="NodeRefGroup"},print(t,e){return Hn(ir(t.print),sr(" "),xi("{","}"))(e.children)}},v9={match(t){return t.type==="NodeRef"},print(t,e){const n=[t.print(e.id)];return e.port&&n.push(t.print(e.port)),e.compass&&n.push(t.print(e.compass)),n.join(":")}},b9={match(t){return t.type==="Subgraph"},print(t,e){const n=["subgraph"];if(e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=Fs(t.endOfLine),i=Hn(ir(t.print),sr(r),Kl(t.indentStyle,t.indentSize,r),xi(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},D9=[u9,c9,l9,d9,f9,p9,g9,y9,w9,v9,b9];class E9{options;#e=[...D9];constructor(e={}){this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,a={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(o){for(const u of n)if(u.match(o))return u.print(a,o);throw Error()}};return a.print(e)}}function R9(t,e){const n=new E9(e).print(t);if(!n)throw new Error;return n}function $h(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Ve("Attribute",{key:Ve("Literal",{value:t,quoted:!1},[]),value:Ve("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Ve("Attribute",{key:Ve("Literal",{value:t,quoted:!1},[]),value:Ve("Literal",{value:e,quoted:!0},[])},[])}return Ve("Attribute",{key:Ve("Literal",{value:t,quoted:!1},[]),value:Ve("Literal",{value:String(e),quoted:!1},[])},[])}function Ls(t,e){return Ve("Comment",{kind:e,value:t},[])}function MA(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield $h(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield Ls(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield Ls(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield Ls(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield Ls(n.comment,t.commentKind)),yield t.convert(n)}())}const T9={match(t){return t.$$type==="AttributeList"},convert(t,e){return Ve("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>$h(n,r)))}},S9={match(t){return t.$$type==="Edge"},convert(t,e){return Ve("Edge",{targets:e.targets.map(n=>Uw(n)?Ve("NodeRef",{id:Ve("Literal",{value:n.id,quoted:!0},[])},[]):xA(n)?Ve("NodeRef",{id:Ve("Literal",{value:n.id,quoted:!0},[]),port:n.port?Ve("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Ve("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Ve("NodeRefGroup",{},n.map(r=>Uw(r)?Ve("NodeRef",{id:Ve("Literal",{value:r.id,quoted:!0},[])},[]):Ve("NodeRef",{id:Ve("Literal",{value:r.id,quoted:!0},[]),port:r.port?Ve("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Ve("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Ls(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>$h(n,r))])}},$9={match(t){return t.$$type==="Graph"},convert(t,e){return Ve("Dot",{},[...e.comment?[Ls(e.comment,t.commentKind)]:[],Ve("Graph",{directed:e.directed,strict:e.strict,id:e.id?Ve("Literal",{value:e.id,quoted:!0},[]):void 0},MA(t,e))])}},k9={match(t){return t.$$type==="Node"},convert(t,e){return Ve("Node",{id:Ve("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Ls(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>$h(n,r))])}},C9={match(t){return t.$$type==="Subgraph"},convert(t,e){return Ve("Subgraph",{id:e.id?Ve("Literal",{value:e.id,quoted:!0},[]):void 0},MA(t,e))}},A9=[T9,S9,k9,$9,C9];class _9{options;#e=[...A9];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){for(const a of n)if(a.match(s))return a.convert(i,s);throw Error()}};return i.convert(e)}}function P9(t,e){return new _9(e).convert(t)}const x=new Proxy(Object.freeze({}),{get:(t,e)=>e});class Gw{}class Ww extends Gw{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,n){n!=null&&this.#e.set(e,n)}delete(e){this.#e.delete(e)}apply(e){const n=Array.isArray(e)?e:Object.entries(e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class Hw extends Ww{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class BA extends Ww{#e=Rh;id;comment;attributes=Object.freeze({graph:new Hw("Graph"),edge:new Hw("Edge"),node:new Hw("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=n9(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){const n=new this.#e.Subgraph(...e);return n.with(this.#e),this.addSubgraph(n),n}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,n){const r=new this.#e.Node(e,n);return this.addNode(r),r}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(n=>n.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,n){const r=e.map(s=>ZW(s)?t9(s):OA(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(a=>typeof a=="string"),r=e.find(a=>typeof a=="object"&&a!==null),i=e.find(a=>typeof a=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.createSubgraph();return r!==void 0&&s.apply(r),i!==void 0&&i(s),s}node(e,...n){if(typeof e=="string"){const r=e,i=n.find(o=>typeof o=="object"&&o!==null),s=n.find(o=>typeof o=="function"),a=this.getNode(r)??this.createNode(r);return i!==void 0&&a.attributes.apply(i),s!==void 0&&s(a),a}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(o=>typeof o=="object"),s=n.find(o=>typeof o=="function"),a=this.createEdge(r,i);return s!==void 0&&s(a),a}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class zA extends BA{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(r=>typeof r=="string"),this.strict=e.find(r=>typeof r=="boolean")??!1;const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}}class I9 extends zA{get directed(){return!0}}class x9 extends zA{get directed(){return!1}}class N9 extends BA{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(r=>typeof r=="string");const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}}class qA extends Ww{comment}let O9=class extends Gw{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new qA(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class F9 extends Gw{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(Vl(e[0])&&Vl(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new qA(n)}}Object.assign(Rh,{Graph:x9,Digraph:I9,Subgraph:N9,Node:O9,Edge:F9});function jA(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(u=>typeof u=="string"),s=n.find(u=>typeof u=="object"),a=n.find(u=>typeof u=="function"),o=new r(i,e,s);return o.with(this),typeof a=="function"&&a(o),o}}function UA(t,e=Rh){return Object.freeze({digraph:jA.call(e,!0,t),graph:jA.call(e,!1,t)})}const GA=UA(!1),L9=GA.digraph;GA.graph;const M9=UA(!0);function WA(t,e){const n=P9(t,e?.convert);return R9(n,e?.print)}var Vw,HA;function B9(){if(HA)return Vw;HA=1;function t(r){let i=r.length-1,s=r[i];for(;s===" "||s===" ";)s=r[--i];return r.substring(0,i+1)}function e(r){return r.split(`
|
|
206
|
-
`).map(a=>t(a)).join(`
|
|
207
|
-
`)}Vw=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,a=typeof i.indent=="string"?i.indent:" ",o=i.newline||`
|
|
208
|
-
`+a,u=typeof i.escape=="function"?i.escape:n,c=".{1,"+s+"}";i.cut!==!0&&(c+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(c,"g"),d=r.match(l)||[],f=a+d.map(function(p){return p.slice(-1)===`
|
|
209
|
-
`&&(p=p.slice(0,p.length-1)),u(p)}).join(o);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return Vw}var z9=B9();const q9=vy(z9),kh={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return n*2.55;t/=360,e/=100,n/=100;const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;switch(r){case"r":return kh.hue2rgb(s,i,t+1/3)*255;case"g":return kh.hue2rgb(s,i,t)*255;case"b":return kh.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),s=Math.min(t,e,n),a=(i+s)/2;if(r==="l")return a*100;if(i===s)return 0;const o=i-s,u=a>.5?o/(2-i-s):o/(i+s);if(r==="s")return u*100;switch(i){case t:return((e-n)/o+(e<n?6:0))*60;case e:return((n-t)/o+2)*60;case n:return((t-e)/o+4)*60;default:return-1}}},j9={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},U9={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Ae={channel:kh,lang:j9,unit:U9},Ni={};for(let t=0;t<=255;t++)Ni[t]=Ae.unit.dec2hex(t);const Zt={ALL:0,RGB:1,HSL:2};class G9{constructor(){this.type=Zt.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Zt.ALL}is(e){return this.type===e}}class W9{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new G9}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=Zt.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=Ae.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=Ae.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ae.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=Ae.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=Ae.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ae.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(Zt.HSL)&&n!==void 0?n:(this._ensureHSL(),Ae.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(Zt.HSL)&&n!==void 0?n:(this._ensureHSL(),Ae.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(Zt.HSL)&&n!==void 0?n:(this._ensureHSL(),Ae.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(Zt.RGB)&&n!==void 0?n:(this._ensureRGB(),Ae.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(Zt.RGB)&&n!==void 0?n:(this._ensureRGB(),Ae.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(Zt.RGB)&&n!==void 0?n:(this._ensureRGB(),Ae.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Zt.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Zt.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Zt.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Zt.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Zt.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Zt.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Kw=new W9({r:0,g:0,b:0,a:0},"transparent"),Ka={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Ka.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,s=i%4===0,a=i>4,o=a?1:17,u=a?8:4,c=s?0:-1,l=a?255:15;return Kw.set({r:(r>>u*(c+3)&l)*o,g:(r>>u*(c+2)&l)*o,b:(r>>u*(c+1)&l)*o,a:s?(r&l)*o/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${Ni[Math.round(e)]}${Ni[Math.round(n)]}${Ni[Math.round(r)]}${Ni[Math.round(i*255)]}`:`#${Ni[Math.round(e)]}${Ni[Math.round(n)]}${Ni[Math.round(r)]}`}},Ms={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Ms.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return Ae.channel.clamp.h(parseFloat(n)*.9);case"rad":return Ae.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Ae.channel.clamp.h(parseFloat(n)*360)}}return Ae.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(Ms.re);if(!n)return;const[,r,i,s,a,o]=n;return Kw.set({h:Ms._hue2deg(r),s:Ae.channel.clamp.s(parseFloat(i)),l:Ae.channel.clamp.l(parseFloat(s)),a:a?Ae.channel.clamp.a(o?parseFloat(a)/100:parseFloat(a)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${Ae.lang.round(e)}, ${Ae.lang.round(n)}%, ${Ae.lang.round(r)}%, ${i})`:`hsl(${Ae.lang.round(e)}, ${Ae.lang.round(n)}%, ${Ae.lang.round(r)}%)`}},Yl={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Yl.colors[t];if(e)return Ka.parse(e)},stringify:t=>{const e=Ka.stringify(t);for(const n in Yl.colors)if(Yl.colors[n]===e)return n}},Xl={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(Xl.re);if(!n)return;const[,r,i,s,a,o,u,c,l]=n;return Kw.set({r:Ae.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:Ae.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:Ae.channel.clamp.b(u?parseFloat(o)*2.55:parseFloat(o)),a:c?Ae.channel.clamp.a(l?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${Ae.lang.round(e)}, ${Ae.lang.round(n)}, ${Ae.lang.round(r)}, ${Ae.lang.round(i)})`:`rgb(${Ae.lang.round(e)}, ${Ae.lang.round(n)}, ${Ae.lang.round(r)})`}},Oi={format:{keyword:Yl,hex:Ka,rgb:Xl,rgba:Xl,hsl:Ms,hsla:Ms},parse:t=>{if(typeof t!="string")return t;const e=Ka.parse(t)||Xl.parse(t)||Ms.parse(t)||Yl.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Zt.HSL)||t.data.r===void 0?Ms.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Xl.stringify(t):Ka.stringify(t)},H9=(t,e)=>{const n=Oi.parse(t);for(const r in e)n[r]=Ae.channel.clamp[r](e[r]);return Oi.stringify(n)},VA=t=>Oi.format.hex.stringify(Oi.parse(t)),V9=(t,e,n)=>{const r=Oi.parse(t),i=r[e],s=Ae.channel.clamp[e](i+n);return i!==s&&(r[e]=s),Oi.stringify(r)},K9=(t,e)=>V9(t,"a",-.3),Y9=(t,e)=>{const n=Oi.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return H9(t,r)},X9=(t,e)=>{const n=Oi.parse(t),r={},i=(s,a,o)=>a>0?(o-s)*a/100:s*a/100;for(const s in e)r[s]=i(n[s],e[s],Ae.channel.max[s]);return Y9(t,r)};class J9{value;next;constructor(e){this.value=e}}class Q9{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new J9(e);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}}function Yw(t){KA(t);const e=new Q9;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(u,c,l)=>{const d=(async()=>u(...l))();c(d);try{await d}catch{}i()},a=(u,c,l)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,u,c,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},o=(u,...c)=>new Promise(l=>{a(u,l,c)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(u){KA(u),t=u,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),o}function KA(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var Z9=Object.getOwnPropertyNames,eH=Object.getOwnPropertySymbols,tH=Object.prototype.hasOwnProperty;function YA(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function Ch(t){return function(e,n,r){if(!e||!n||typeof e!="object"||typeof n!="object")return t(e,n,r);var i=r.cache,s=i.get(e),a=i.get(n);if(s&&a)return s===n&&a===e;i.set(e,n),i.set(n,e);var o=t(e,n,r);return i.delete(e),i.delete(n),o}}function XA(t){return Z9(t).concat(eH(t))}var nH=Object.hasOwn||function(t,e){return tH.call(t,e)};function Bs(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var rH="__v",iH="__o",sH="_owner",JA=Object.getOwnPropertyDescriptor,QA=Object.keys;function aH(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function oH(t,e){return Bs(t.getTime(),e.getTime())}function uH(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function cH(t,e){return t===e}function ZA(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.entries(),a,o,u=0;(a=s.next())&&!a.done;){for(var c=e.entries(),l=!1,d=0;(o=c.next())&&!o.done;){if(i[d]){d++;continue}var f=a.value,p=o.value;if(n.equals(f[0],p[0],u,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){l=i[d]=!0;break}d++}if(!l)return!1;u++}return!0}var lH=Bs;function dH(t,e,n){var r=QA(t),i=r.length;if(QA(e).length!==i)return!1;for(;i-- >0;)if(!t0(t,e,n,r[i]))return!1;return!0}function Jl(t,e,n){var r=XA(t),i=r.length;if(XA(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=r[i],!t0(t,e,n,s)||(a=JA(t,s),o=JA(e,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function fH(t,e){return Bs(t.valueOf(),e.valueOf())}function pH(t,e){return t.source===e.source&&t.flags===e.flags}function e0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var u=e.values(),c=!1,l=0;(o=u.next())&&!o.done;){if(!i[l]&&n.equals(a.value,o.value,a.value,o.value,t,e,n)){c=i[l]=!0;break}l++}if(!c)return!1}return!0}function hH(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function mH(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function t0(t,e,n,r){return(r===sH||r===iH||r===rH)&&(t.$$typeof||e.$$typeof)?!0:nH(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var gH="[object Arguments]",yH="[object Boolean]",wH="[object Date]",vH="[object Error]",bH="[object Map]",DH="[object Number]",EH="[object Object]",RH="[object RegExp]",TH="[object Set]",SH="[object String]",$H="[object URL]",kH=Array.isArray,n0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,r0=Object.assign,CH=Object.prototype.toString.call.bind(Object.prototype.toString);function AH(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,u=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,l=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(p,h,w){if(p===h)return!0;if(p==null||h==null)return!1;var D=typeof p;if(D!==typeof h)return!1;if(D!=="object")return D==="number"?a(p,h,w):D==="function"?i(p,h,w):!1;var g=p.constructor;if(g!==h.constructor)return!1;if(g===Object)return o(p,h,w);if(kH(p))return e(p,h,w);if(n0!=null&&n0(p))return d(p,h,w);if(g===Date)return n(p,h,w);if(g===RegExp)return c(p,h,w);if(g===Map)return s(p,h,w);if(g===Set)return l(p,h,w);var v=CH(p);return v===wH?n(p,h,w):v===RH?c(p,h,w):v===bH?s(p,h,w):v===TH?l(p,h,w):v===EH?typeof p.then!="function"&&typeof h.then!="function"&&o(p,h,w):v===$H?f(p,h,w):v===vH?r(p,h,w):v===gH?o(p,h,w):v===yH||v===DH||v===SH?u(p,h,w):!1}}function _H(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Jl:aH,areDatesEqual:oH,areErrorsEqual:uH,areFunctionsEqual:cH,areMapsEqual:r?YA(ZA,Jl):ZA,areNumbersEqual:lH,areObjectsEqual:r?Jl:dH,arePrimitiveWrappersEqual:fH,areRegExpsEqual:pH,areSetsEqual:r?YA(e0,Jl):e0,areTypedArraysEqual:r?Jl:hH,areUrlsEqual:mH};if(n&&(i=r0({},i,n(i))),e){var s=Ch(i.areArraysEqual),a=Ch(i.areMapsEqual),o=Ch(i.areObjectsEqual),u=Ch(i.areSetsEqual);i=r0({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:u})}return i}function PH(t){return function(e,n,r,i,s,a,o){return t(e,n,o)}}function IH(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(o,u){var c=r(),l=c.cache,d=l===void 0?e?new WeakMap:void 0:l,f=c.meta;return n(o,u,{cache:d,equals:i,meta:f,strict:s})};if(e)return function(o,u){return n(o,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(o,u){return n(o,u,a)}}var xH=Fi();Fi({strict:!0}),Fi({circular:!0}),Fi({circular:!0,strict:!0}),Fi({createInternalComparator:function(){return Bs}}),Fi({strict:!0,createInternalComparator:function(){return Bs}}),Fi({circular:!0,createInternalComparator:function(){return Bs}}),Fi({circular:!0,createInternalComparator:function(){return Bs},strict:!0});function Fi(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=_H(t),u=AH(o),c=r?r(u):PH(u);return IH({circular:n,comparator:u,createState:i,equals:c,strict:a})}function i0(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:a,y:o,width:u,height:c}=s;return{...i,width:u,height:c,position:[a,o]}}),r=t.edges.map(i=>{const s=e.edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const s0=(t,e)=>t.width>e.width+10||t.height>e.height+10;function NH(t,e){if(t.hash===e.hash)return{diagram:i0(t,e)};if(xH(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||s0(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:i0(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const a={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||s0(i,s)||(a.fixedsize={width:s.width,height:s.height}),r.push(a),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:np(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function On(t){return t.children.length>0}function en(t){switch(t){case"open":return"vee";default:return t}}function Sr(t){return Array.isArray(t)?[Sr(t[0]),Sr(t[1])]:(Se(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const a0=t=>(Se(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),ot=t=>Math.ceil(t/72*1e3)/1e3,Fn=t=>Math.ceil(t);Fn(40).toString();function o0(t,e){return VA(X9(t,{l:-35-5*e,s:-15-5*e}))}function OH(t){return VA(K9(t))}function FH(t){return t.trim().replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function Xw(t,e,n){let r=q9(t,{width:e,indent:"",escape:FH}).split(`
|
|
210
|
-
`);return Ht(n)&&n>0&&r.length>n&&(r=r.slice(0,n-1)),r}function zs({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let a=Xw(t,e,r).join("<BR/>");i&&(a=`<B>${a}</B>`);const o=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${Fn(n)}"${o}>${a}</FONT>`}function LH(t,e){const n=ae(t.icon),r=[zs({text:t.title,fontsize:19,maxchars:35,maxLines:3})];if(ae(t.technology?.trim())&&r.push(zs({text:t.technology,fontsize:12,maxchars:n?35:45,maxLines:1,color:e.loContrast})),ae(t.description?.trim())&&r.push(zs({text:t.description,fontsize:14,maxchars:n?35:45,maxLines:5,color:e.loContrast})),r.length===1&&!n)return`<${r[0]}>`;const i=n?(s,a,o)=>{let u=`<TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD>`;if(a===0){const c=o.length>1?` ROWSPAN="${o.length}"`:"";let l=76;(t.shape==="queue"||t.shape==="mobile")&&(l+=20),u=`<TD${c} WIDTH="${l}"> </TD>${u}`,u=`${u}<TD${c} WIDTH="16"> </TD>`}return`<TR>${u}</TR>`}:s=>`<TR><TD>${s}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6">${r.map(i).join("")}</TABLE>>`}function MH(t,e){const n=zs({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const Ql=40,Jw=`BGCOLOR="${Ir.relationships[no].labelBgColor}A0"`;function u0({label:t,technology:e}){const n=[];if(ae(t?.trim())&&n.push(zs({text:t,maxchars:Ql,fontsize:14,maxLines:5,bold:t==="[...]"})),ae(e?.trim())&&n.push(zs({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:Ql})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${Jw}>${r}</TABLE>>`}function BH(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${Jw}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${Fn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ae(e?.trim())?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${Jw} CELLPADDING="3">`,zs({text:e,maxchars:Ql,fontsize:14,maxLines:5}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const Qw="dashed",Zw=Ir.font;class ev{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(On).map(i=>i.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(i=>this.compoundIds.has(i.source)||this.compoundIds.has(i.target)).map(i=>i.id):[]);const n=new Map;for(const i of e.edges)n.set(i.id,X1(i.source,i.target));this.edgeDistances=n;const r=this.graphvizModel=this.createGraph();this.applyNodeAttributes(r.attributes.node),this.applyEdgeAttributes(r.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;edgeDistances;graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const a=this.nodeId(i),o=this.elementToSubgraph(i,s.subgraph(a));this.subgraphs.set(i.id,o);for(const u of i.children){const c=this.viewElement(u);if(On(c))n(c,o);else{const l=sn(this.getGraphNode(c.id),`Graphviz Node not found for ${c.id}`);o.node(l.id)}}},r=[];for(const i of this.view.nodes)if(On(i))yt(i.parent)&&r.push(i);else{const s=this.nodeId(i),a=this.elementToNode(i,e.node(s));this.nodes.set(i.id,a)}for(const i of r)n(i,e);for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){const e=this.graphvizModel;return this.build(e),this.postBuild(e),WA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=L9({[x.bgcolor]:"transparent",[x.layout]:"dot",[x.compound]:!0,[x.rankdir]:e.direction,[x.TBbalance]:"min",[x.splines]:"spline",[x.outputorder]:"nodesfirst",[x.nodesep]:ot(e.nodeSep??110),[x.ranksep]:ot(e.rankSep??120),[x.pack]:Fn(e.rankSep??120),[x.packmode]:"array_3",[x.pad]:ot(15),[x.fontname]:Zw});return n.attributes.graph.apply({[x.fontsize]:Fn(15),[x.labeljust]:e.direction==="RL"?"r":"l",[x.labelloc]:e.direction==="BT"?"b":"t",[x.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[x.fontname]:Zw,[x.shape]:"rect",[x.width]:ot(320),[x.height]:ot(180),[x.style]:"filled",[x.penwidth]:0})}applyEdgeAttributes(e){e.apply({[x.arrowsize]:.75,[x.fontname]:Zw,[x.fontsize]:Fn(14),[x.penwidth]:Fn(2),[x.color]:Ir.relationships[no].lineColor,[x.fontcolor]:Ir.relationships[no].labelColor})}checkNodeId(e,n=!1){return n?e="cluster_"+e:e.toLowerCase().startsWith("cluster")&&(e="nd_"+e),this.ids.has(e)?null:(this.ids.add(e),e)}nodeId(e){const n=On(e);let r=io(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,a;for(;a=so(s);){if(r=io(a).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=a}r=io(e.id).toLowerCase();let o=1;do i=this.checkNodeId(r+"_"+o++,n);while(i===null);return i}elementToSubgraph(e,n){Se(On(e),"node should be compound"),Se(ep(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=OH(r.loContrast);return n.apply({[x.likec4_id]:e.id,[x.likec4_level]:e.level,[x.likec4_depth]:e.depth,[x.fillcolor]:o0(r.fill,e.depth),[x.color]:o0(r.stroke,e.depth),[x.style]:"filled",[x.margin]:Fn(e.children.length>1?40:32)}),ws(e.title.trim())||n.set(x.label,MH(e,i)),n}elementToNode(e,n){Se(!On(e),"node should not be compound");const r=ae(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[x.likec4_id]:e.id,[x.likec4_level]:e.level,[x.fillcolor]:i.fill,[x.fontcolor]:i.hiContrast,[x.color]:i.stroke,[x.margin]:`${ot(r?10:26)},${ot(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[x.margin]:`${ot(r?10:26)},${ot(0)}`,[x.penwidth]:Fn(2),[x.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[x.margin]:`${ot(r?10:30)},${ot(32)}`});break}case"mobile":{n.attributes.apply({[x.margin]:`${ot(r?10:30)},${ot(26)}`});break}case"queue":{n.attributes.apply({[x.width]:ot(320),[x.height]:ot(165),[x.margin]:`${ot(r?10:30)},${ot(26)}`});break}}return n.attributes.set(x.label,LH(e,i)),n}leafElements(e){return e===null?this.view.nodes.filter(n=>!On(n)):this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return On(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return[r,...this.descendants(r.id)]})}viewElement(e){return sn(this.view.nodes.find(n=>n.id===e),`Node ${e} not found`)}getGraphNode(e){return this.nodes.get(e)??null}getSubgraph(e){return this.subgraphs.get(e)??null}edgeEndpoint(e,n){let r=this.viewElement(e),i=this.getGraphNode(e),s;return i||(Se(On(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,Se(s,`subgraph ${e} not found`),r=sn(n(this.leafElements(e)),`leaf element in ${e} not found`),i=sn(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}findInternalEdges(e){if(e===null)return this.view.edges.slice();const n=this.viewElement(e);return Ye(this.descendants(e),Di(r=>i$(r.inEdges,r.outEdges)),_y(),Gj(i$(n.inEdges,n.outEdges)),ln(r=>this.view.edges.find(i=>i.id===r)),ze(ae))}withoutCompoundEdges(e){return this.edgesWithCompounds.size===0?e:{...e,inEdges:e.inEdges.filter(n=>!this.edgesWithCompounds.has(n)),outEdges:e.outEdges.filter(n=>!this.edgesWithCompounds.has(n))}}assignGroups(){const e=Ye(this.view.nodes,ze(On),ln(r=>r.id),QS(J1),ZS(),ln(r=>{const i=this.findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),ze(({edges:r})=>r.length>1&&r.length<8),sj(4)),n=new Set;for(const r of e){const i=r.edges.filter(s=>!n.has(s.source)&&!n.has(s.target));for(const s of i)try{const a=sn(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),o=sn(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),a.attributes.set(x.group,r.id),o.attributes.set(x.group,r.id)}catch(a){Mt.error(a)}}}applyManualLayout({height:e,...n}){const r=n.x<0?-n.x:0,i=n.y<0?-n.y:0,s=r>0||i>0;for(const{id:a,...o}of n.nodes){const u=this.getGraphNode(a);if(!u)continue;const c=ot(o.center.x)+r,l=ot(e-o.center.y);o.fixedsize?u.attributes.apply({[x.pos]:`${c},${l}!`,[x.pin]:!0,[x.width]:ot(o.fixedsize.width),[x.height]:ot(o.fixedsize.height),[x.fixedsize]:!0}):u.attributes.set(x.pos,`${c},${l}`)}for(const[a,o]of this.edges.entries()){o.attributes.delete(x.weight),o.attributes.delete(x.minlen),o.attributes.delete(x.constraint);const u=n.edges.find(c=>c.id===a)?.dotpos;u&&!s&&o.attributes.set(x.pos,u)}return this.graphvizModel.apply({[x.layout]:"fdp",[x.overlap]:"vpsc",[x.sep]:"+50,50",[x.esep]:"+10,10",[x.start]:"random2",[x.splines]:"compound"}),this.graphvizModel.delete(x.compound),this.graphvizModel.delete(x.rankdir),this.graphvizModel.delete(x.nodesep),this.graphvizModel.delete(x.ranksep),this.graphvizModel.delete(x.pack),this.graphvizModel.delete(x.pad),this.graphvizModel.delete(x.packmode),this.graphvizModel.attributes.graph.delete(x.margin),this}getRelationshipColorValues(e){return Gb(e)?Ir.relationships[e]:this.view.customColorDefinitions[e]?.relationships??Ir.relationships[Wb]}getElementColorValues(e){return Gb(e)?Ir.elements[e]:this.view.customColorDefinitions[e]?.elements??Ir.elements[Wb]}}class zH extends ev{createGraph(){const e=super.createGraph(),n=this.view.autoLayout;return e.delete(x.TBbalance),e.apply({[x.nodesep]:ot(n.nodeSep??130),[x.ranksep]:ot(n.rankSep??130)}),e}postBuild(e){Ye(this.view.nodes,ln(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),vs(({node:n,graphvizNode:r})=>{if(r!=null)return Rd.modelRef(n)??void 0}),Du(),ze(ys(2)),Pj(n=>{e.subgraph({[x.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(sn(i).id)})}),cj(()=>{e.set(x.newrank,!0),e.set(x.clusterrank,"global"),e.delete(x.pack),e.delete(x.packmode)}))}elementToSubgraph(e,n){const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(x.margin,Fn(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,a,o]=this.edgeEndpoint(r,v=>Tu(v)),[u,c,l]=this.edgeEndpoint(i,Da),d=Qt(l)||Qt(o),f=n.edge([a,c],{[x.likec4_id]:e.id,[x.style]:e.line??Qw});l&&f.attributes.set(x.lhead,l),o&&f.attributes.set(x.ltail,o);const p=this.edgeDistances.get(e.id)??0,h=[...s.inEdges,...s.outEdges,...u.inEdges,...u.outEdges].reduce((v,R)=>Math.max(v,this.edgeDistances.get(R)??0),0);h-p>1&&f.attributes.set(x.weight,h-p);const w=u0(e);if(w&&f.attributes.set(d?x.xlabel:x.label,w),e.color){const v=this.getRelationshipColorValues(e.color);f.attributes.apply({[x.color]:v.lineColor,[x.fontcolor]:v.labelColor})}let[D,g]=[e.head??Ji,e.tail??"none"];return D==="none"&&g==="none"?(f.attributes.apply({[x.arrowtail]:"none",[x.arrowhead]:"none",[x.dir]:"none"}),f):e.dir==="both"?(f.attributes.apply({[x.arrowhead]:en(D),[x.arrowtail]:en(e.tail??D),[x.dir]:"both"}),!d&&Rd.modelRef(s)!==Rd.modelRef(u)&&f.attributes.set(x.constraint,!1),f):(D!==Ji&&f.attributes.set(x.arrowhead,en(D)),g!=="none"&&f.attributes.set(x.arrowtail,en(g)),f)}}class Nb extends ev{static toDot(e){return new Nb(e).print()}postBuild(e){e.set(x.TBbalance,"max"),Ub(this.edgesWithCompounds,n=>this.view.edges.some(r=>r.id===n&&r.label))&&(e.delete(x.pack),e.delete(x.packmode))}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[a,o,u]=this.edgeEndpoint(i,A=>Tu(A)),[c,l,d]=this.edgeEndpoint(s,Da),f=n.edge([o,l],{[x.likec4_id]:e.id,[x.style]:e.line??Qw});if(d&&f.attributes.set(x.lhead,d),u&&f.attributes.set(x.ltail,u),e.color&&e.color!==no){const A=this.getRelationshipColorValues(e.color);f.attributes.apply({[x.color]:A.lineColor,[x.fontcolor]:A.labelColor})}const p=[e.label?.trim(),e.technology?.trim()].filter(ae).join(`
|
|
211
|
-
`),h=Y1(e.id),w=BH(h,p);f.attributes.set(x.label,w);const D=this.edgeDistances.get(e.id)??0,g=[...a.inEdges,...a.outEdges,...c.inEdges,...c.outEdges].reduce((A,j)=>Math.max(A,this.edgeDistances.get(j)??0),0);g-D>1&&f.attributes.set(x.weight,g-D);const v=r.findIndex(A=>A.id===i);r.findIndex(A=>A.id===s)<v&&e.dir!=="back"&&f.attributes.apply({[x.constraint]:!1});let[R,k]=[e.head??Ji,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[x.arrowtail]:en(R),[x.minlen]:0,[x.dir]:"back"}),k!=="none"&&f.attributes.apply({[x.arrowhead]:en(k),[x.dir]:"both"}),f):R==="none"&&k==="none"||R!=="none"&&k!=="none"?(f.attributes.apply({[x.arrowhead]:en(R),[x.arrowtail]:en(k),[x.dir]:"both"}),f):R==="none"?(f.attributes.delete(x.arrowhead),f.attributes.apply({[x.arrowtail]:en(k),[x.minlen]:0,[x.dir]:"back"}),f):(R!==Ji&&f.attributes.set(x.arrowhead,en(R)),f)}}class qH extends ev{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(On(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=Ye(i.children,ze(c=>!this.compoundIds.has(c)),ln(c=>this.viewElement(c)),ze(c=>c.inEdges.length===0&&c.outEdges.length===0));if(s.length<=2)continue;let a=2;switch(!0){case s.length>11:a=4;break;case s.length>4:a=3;break}const o=sn(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let u=null;Kj(s,a).forEach(c=>{const l=c.length>1?o.createSubgraph({[x.rank]:"same"}):null;c.forEach((d,f)=>{const p=this.getGraphNode(d.id);p&&(l?.node(p.id),f===0&&(u&&o.edge([u,p],{[x.style]:"invis"}),u=p))})})}Ub(this.edgesWithCompounds,i=>this.view.edges.some(s=>s.id===i&&s.label))&&(e.delete(x.pack),e.delete(x.packmode))}addEdge(e,n){const r=this.view.edges,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[a,o,u]=this.edgeEndpoint(i,A=>Tu(A)),[c,l,d]=this.edgeEndpoint(s,Da),f=e.parent,p=n.edge([o,l],{[x.likec4_id]:e.id,[x.style]:e.line??Qw});d&&p.attributes.set(x.lhead,d),u&&p.attributes.set(x.ltail,u);const h=Qt(d)||Qt(u),w=this.edgeDistances.get(e.id)??0,D=[...a.inEdges,...a.outEdges,...c.inEdges,...c.outEdges].reduce((A,j)=>Math.max(A,this.edgeDistances.get(j)??0),0);D-w>1&&p.attributes.set(x.weight,D-w);const g=u0(e);if(g&&p.attributes.set(h?x.xlabel:x.label,g),e.color){const A=this.getRelationshipColorValues(e.color);p.attributes.apply({[x.color]:A.lineColor,[x.fontcolor]:A.labelColor})}let[v,R]=[e.head??Ji,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[x.arrowtail]:en(v),[x.dir]:"back"}),R!=="none"&&p.attributes.apply({[x.arrowhead]:en(R),[x.dir]:"both",[x.minlen]:0}),p;if(v==="none"&&R==="none")return p.attributes.apply({[x.arrowtail]:"none",[x.arrowhead]:"none",[x.dir]:"none",[x.minlen]:0,[x.constraint]:!1}),p;if(v!=="none"&&R!=="none")return p.attributes.apply({[x.arrowhead]:en(v),[x.arrowtail]:en(R),[x.dir]:"both",[x.minlen]:0}),p;if(v!==Ji&&p.attributes.set(x.arrowhead,en(v)),R!=="none"&&p.attributes.set(x.arrowtail,en(R)),r.length===1)return p;let k;return f===null&&a.parent==null&&c.parent==null?k=r.filter(A=>{if(A.id===e.id||A.parent!==null||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)return!1;const j=this.viewElement(A.source),W=this.viewElement(A.target);return On(j)||On(W)?!1:j.parent==null&&W.parent==null}):k=this.findInternalEdges(f).filter(A=>!(A.id===e.id||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)),k.length===0&&(f===null||this.leafElements(f).length<=3)&&p.attributes.set(x.minlen,0),p}}function Ah(t){const[e,n,r,i]=t?t.split(",").map(o=>Sr(+o)):[0,0,0,0],s=Math.round(r-e),a=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:a}}function jH(t){try{const[e,n]=t.split(",");return{x:Sr(parseFloat(e)),y:Sr(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function c0(t){const{x:e,y:n}=jH(t.pos),r=a0(parseFloat(t.width)),i=a0(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function l0(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,a=-1/0,o=13;try{for(const c of t){if(c.op==="F"){o=Sr(c.size);continue}if(c.op==="T"){let l=Sr(c.pt[0])-e,d=Sr(c.width);switch(c.align){case"r":l-=d;break;case"c":l-=Math.round(d/2);break}r=Math.min(r,l),s=Math.max(s,l+d);let f=Sr(c.pt[1])-n;i=Math.min(i,Math.round(f-o)),a=Math.max(a,f)}}}catch(c){return Mt.warn(`Failed on parsing label draw ops: ${c}
|
|
212
|
-
${JSON.stringify(t,null,2)}`),null}if(r===1/0)return null;const u=2;return{x:r-u,y:i-u,width:s-r+2*u,height:a-i+2*u}}function d0({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");Se(ys(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&Mt.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Sr(s));return Se(ys(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
|
|
213
|
-
${JSON.stringify(t,null,2)}`,{cause:r})}}function UH(t,{id:e,source:n,target:r,dir:i,label:s,description:a,...o},u){const c=l0(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s?Xw(s,Ql).join(`
|
|
214
|
-
`):null,a=a?Xw(a,Ql).join(`
|
|
215
|
-
`):void 0,{id:e,source:n,target:r,label:s,...ae(a)&&{description:a},...ae(t.pos)&&{dotpos:t.pos},points:d0(t,u),labelBBox:c,...l?{dir:"back"}:{},...o}}function f0(t,e){const n=JSON.parse(t),r=Ah(n.bb),{nodes:i,edges:s,manualLayout:a,...o}=e,u={...o,bounds:r,nodes:[],edges:[]},c=n.objects??[];for(const d of i){const f=c.find(p=>p.likec4_id===d.id);Se(f,`View ${o.id} node ${d.id} not found in graphviz output`);try{const{x:p,y:h,width:w,height:D}="bb"in f?Ah(f.bb):c0(f),g=[p,h];u.nodes.push({...d,position:g,width:w,height:D,labelBBox:l0(f._ldraw_,g)??{x:p,y:h,width:w,height:D}})}catch(p){throw new Error(`Failed on parsing node ${d.id}:
|
|
216
|
-
${JSON.stringify(f,null,2)}`,{cause:p})}}const l=n.edges??[];for(const d of s){const f=l.find(p=>p.likec4_id===d.id);if(!f){Mt.warn(`View ${o.id} edge ${d.id} not found in graphviz output, skipping`);continue}u.edges.push(UH(f,d,o.id))}return u}const _h=t=>String(t+1).padStart(2,"0");function GH(t){const e=JSON.parse(t),n=Ah(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const a of s){if(!a.likec4_type)continue;const o=_h(a._gvid),u=a.likec4_path??"",c=i.get(a._gvid),{x:l,y:d,width:f,height:p}="bb"in a?Ah(a.bb):c0(a),h={x:l,y:d};if(a.likec4_type==="view")Se(a.likec4_id,`View ${a} has no likec4_id`),r.nodes.push({id:o,type:"view",parentId:c?.id??null,height:p,width:f,position:h,label:a.label??"",viewId:a.likec4_id});else{const w={id:o,type:a.likec4_type,parentId:c?.id??null,height:p,width:f,position:h,path:u,label:a.label??""},D=[..."subgraphs"in a?a.subgraphs:[],..."nodes"in a?a.nodes:[]];for(const g of D)i.set(g,w);r.nodes.push(w)}}for(const a of e.edges??[])try{const o=_h(a.tail),u=_h(a.head);r.edges.push({id:`link${_h(a._gvid)}`,source:o,target:u,points:d0(a)})}catch(o){Mt.warn(o)}return r}const p0=Ir.font,Ph="/";class Ob{static toDot(e){return new Ob(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=M9.graph({[x.layout]:"osage",[x.pack]:Fn(100),[x.packmode]:"array_ltc",[x.pad]:ot(15),[x.fontname]:p0,[x.splines]:"polyline",[x.esep]:"+20"});n.attributes.graph.apply({[x.fontsize]:Fn(20),[x.labeljust]:"l",[x.labelloc]:"t"}),n.attributes.node.apply({[x.fontname]:p0,[x.shape]:"rect",[x.width]:ot(400),[x.height]:ot(300),[x.fixedsize]:!0,[x.fontsize]:10}),n.attributes.edge.apply({[x.penwidth]:Fn(2)});const r=new Set(e.map(u=>u.relativePath??""));let i=0,s=[...e];const a=r.size>1;a&&s.sort((u,c)=>{const l=u.relativePath?.split(Ph)??[""],d=c.relativePath?.split(Ph)??[""];l.push(u.title??"Untitled"),d.push(c.title??"Untitled");const f=l.length,p=d.length;switch(i=Math.max(i,f,p),!0){case f>p:return-1;case f<p:return 1;default:{for(let h=0;h<f;h++){const w=l[h].localeCompare(d[h]);if(w!==0)return w}return 0}}});const o=new Map;s.forEach((u,c)=>{this.addView(a?u:{...u,relativePath:""},c+i);const l=u.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);l.size>0&&o.set(u.id,l)});for(const[u,c]of o)for(const l of c)n.edge([u,l])}getParentForPath(e){if(e==="")return this.graphvizModel;const n=e.toLowerCase();let r=this.subgraphs.get(n);if(!r){const i=n.endsWith(".c4")||n.endsWith(".likec4"),s=e.includes(Ph)?e.slice(0,e.lastIndexOf(Ph)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[x.likec4_type]:i?"file":"folder",[x.likec4_path]:e,[x.sortv]:this.subgraphs.size,[x.label]:ae(s)?e.slice(s.length+1):e}),this.subgraphs.set(n,r)}return r}addView(e,n=0){return this.getParentForPath(e.relativePath??"").node(e.id,{[x.likec4_type]:"view",[x.likec4_id]:e.id,[x.sortv]:n,[x.label]:e.title||"Untitled"})}print(){return WA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const h0=t=>{switch(!0){case ro.isDynamic(t):return new Nb(t);case ro.isDeployment(t):return new zH(t);case ro.isElement(t):return new qH(t);default:Ie(t)}};class m0{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){try{let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=f0(r,e);if(e.manualLayout){const s=NH(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const a=h0(e);if(a.hasEdgesWithCompounds)Mt.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{a.applyManualLayout(s.relayout);const o=await this.graphviz.layoutJson(a.print());i=f0(o,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
|
|
217
|
-
`).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
|
|
218
|
-
`),{dot:n,diagram:i}}catch(n){throw new Error(`Error during layout: ${e.id}`,{cause:n})}}async svg(e){let n=await this.dot(e);return n=n.split(`
|
|
219
|
-
`).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
|
|
220
|
-
`),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=h0(e).print();if(!ro.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return Mt.warn(`Error during unflatten: ${e.id}`,r),n}}async layoutOverviewGraph(e){if(e.length===0)return Promise.resolve({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}});const n=Ob.toDot(e),r=await this.graphviz.layoutJson(n);return GH(r)}}const WH=Yw(1);let g0=class pm{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>pm._graphviz??=bm.load())}async attempt(e,n,r){return await WH(async()=>{const i=Mt.withTag("graphviz-wasm");try{return await r()}catch(s){i.error(`FAILED GraphvizWasm.${e}`,s),i.warn(`FAILED DOT:
|
|
221
|
-
${n}`),bm.unload(),pm._graphviz=null}i.warn("Retrying..."),await K1(50,300);try{return await r()}finally{bm.unload(),pm._graphviz=null}})}async unflatten(e){return await this.attempt("unflatten",e,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt("acyclic",e,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt("layout",e,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt("svg",e,async()=>(await this.graphviz()).layout(e,"svg"))}};function gn(t){return t.el.ref}function Ih(t){const e=[t.el.$refText];let n=t.parent;for(;n;)e.push(n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}const Zl=Symbol.for("idattr"),xh={writeId(t,e){return t[Zl]=e,t},readId(t){return t[Zl]}},ed={writeId(t,e){return yt(e)?t[Zl]=void 0:t[Zl]=e,t},readId(t){return t[Zl]}};function td(t){return t.textDocument.languageId===xw.languageId}function tv(t){return td(t)&&t.state>=Be.IndexedContent&&!!t.c4fqnIndex}function Ya(t){return td(t)&&t.state==Be.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex&&!!t.c4Deployments&&!!t.c4DeploymentRelations}function*HH(t){const e=ym.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(Rr(r)){n.push(r);continue}if(_a(r)){if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);continue}if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function*VH(t){const e=ym.from(t.parseResult.value.deployments.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(ki(r)){n.push(r);continue}if(hn(r)&&r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function KH(t){const e=gn(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Ht(t.source)){const n=gn(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!Oc(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function y0({value:t}){const e=parseFloat(t);return isNaN(e)?100:s$(e,{min:0,max:100})}function Li(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case $p(r):{ae(r.value)&&(n.border=r.value);break}case _s(r):{const i=nd(r);ae(i)&&(n.color=i);break}case dh(r):{ae(r.value)&&(n.shape=r.value);break}case Er(r):{const i=r.libicon?.ref?.name??r.value;ae(i)&&(n.icon=i);break}case ah(r):{n.opacity=y0(r);break}case Tw(r):{n.multiple=Iy(r.value)?r.value:!1;break}default:Ie(r)}return n}function YH(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case _s(r):{const i=nd(r);ae(i)&&(n.color=i);break}case sl(r):{n.line=r.value;break}case Sc(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:Ie(r)}break}default:Ie(r)}return n}function nv(t,e){const{color:n,line:r,head:i,tail:s}=YH(t?.filter(hC),e);return{...n&&n!==no?{color:n}:{},...r&&r!==Q1?{line:r}:{},...i&&i!==Ji?{head:i}:{},...s?{tail:s}:{}}}function nd(t){return t?.themeColor??t?.customColor?.$refText}function rv(t){const e=t.rankSep,n=t.nodeSep;let r;switch(t.direction){case"TopBottom":{r="TB";break}case"BottomTop":{r="BT";break}case"LeftRight":{r="LR";break}case"RightLeft":{r="RL";break}default:Ie(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function XH(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Ie(t)}}function w0(t){if(rw(t))return t;if(ww(t))return t.subject;if(jp(t))return w0(t.subject);Ie(t)}class JH{parser;locator;constructor(e){this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if(hn(e)){const n=ht(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
|
|
222
|
-
`)}if(rr(e)){const n=ht(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id,`_instance of_ ${r.element}`];return i&&s.push(" ",`**${i.title}**`),s.join(`
|
|
223
|
-
`)}if(Nn(e)){const n=ht(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
|
|
224
|
-
`):void 0}}catch(n){ye(n)}}}function QH(t,e){return[t,e]=iv(t,e)>0?[e,t]:[t,e],ZH(t.range,e.range.start)}function iv(t,e){const n=t.range.start.line-e.range.start.line;return n!==0?n:t.range.start.character-e.range.start.character}function ZH(t,e){return!(e.line<t.start.line||e.line>t.end.line||e.line==t.start.line&&e.character<t.start.character||e.line==t.end.line&&e.character>t.end.character)}function Nh(t){return t.range.start.line!=t.range.end.line}const Q={newLine:Ei.newLine({allowMore:!0}),oneSpace:Ei.oneSpace(),noSpace:Ei.noSpace(),indent:Ei.indent({allowMore:!0}),noIndent:Ei.noIndent()};class e7 extends R4{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatGlobals(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatMetadataProperty(e),this.formatDeploymentNodeDeclaration(e),this.formatDeployedInstance(e),this.formatDeploymentRelation(e),this.formatView(e),this.formatViewRuleGroup(e),this.formatViewRuleGlobalStyle(e),this.formatViewRuleGlobalPredicate(e),this.formatIncludeExcludeExpressions(e),this.formatDeploymentViewRulePredicateExpressions(e),this.formatWhereExpression(e),this.formatWhereExpressionV2(e),this.formatWhereRelationExpression(e),this.formatWhereElementExpression(e),this.formatRelationExpression(e),this.formatAutolayoutProperty(e),this.formatWithPredicate(e),this.formatViewRuleStyle(e),this.formatLeafProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,Pw,(n,r)=>{r.cst(sa(n.$cstNode,"values").slice(1)).prepend(Q.oneSpace),r.keywords(",").prepend(Q.noSpace).append(Q.oneSpace)})}formatDeploymentRelation(e){this.on(e,ki,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(Q.oneSpace),r.keywords("]->").prepend(Q.noSpace),r.keywords("-[").append(Q.noSpace),r.nodes(...ze([n.target,n.tags],ae)).prepend(Q.oneSpace),r.properties("title","technology").prepend(Q.oneSpace)})}formatRelation(e){this.on(e,Rr,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(Q.oneSpace),r.keywords("]->").prepend(Q.noSpace),r.keywords("-[").append(Q.noSpace),r.nodes(...ze([n.target,n.tags],ae)).prepend(Q.oneSpace),r.properties("title","technology").prepend(Q.oneSpace)}),this.on(e,gw,(n,r)=>{r.keywords("->","<-").surround(Q.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(Q.oneSpace),r.keywords("]->").prepend(Q.noSpace).append(Q.oneSpace),r.keywords("-[").prepend(Q.oneSpace).append(Q.noSpace),r.properties("title").prepend(Q.oneSpace)}),this.on(e,pw)?.property("target").prepend(Q.oneSpace),this.on(e,$w,(n,r)=>{r.property("from").append(Q.oneSpace),r.keywords("]->").prepend(Q.noSpace),r.keywords("-[").append(Q.noSpace)}),this.on(e,CC)?.keywords("->").append(Q.oneSpace),this.on(e,Rw)?.keyword("->").prepend(Q.oneSpace)}removeIndentFromTopLevelStatements(e){(PC(e)||_w(e)||cl(e)||_C(e)||Dw(e)||IC(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global","deployments").prepend(Q.noIndent)}indentContentInBraces(e){if(_C(e)||_w(e)||ja(e)||Ga(e)||za(e)||Dw(e)||Xc(e)||Na(e)||Jp(e)||Xp(e)||Na(e)||PC(e)||Oc(e)||SC(e)||$U(e)||lh(e)||SU(e)||cl(e)||RC(e)||yU(e)||mU(e)||xl(e)||gh(e)||lU(e)||dU(e)||Ci(e)||hw(e)||IC(e)||pU(e)||hU(e)||fU(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let a=null;for(const o of s.nodes)(!a||!QH(a,o))&&n.cst([o]).prepend(Q.indent),a=o;r.prepend(Q.noIndent).prepend(Q.oneSpace),i.prepend(Q.noIndent).prepend(Ei.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,bU)?.keywords("element").append(Q.oneSpace)}formatView(e){this.on(e,Gp,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(Q.oneSpace),r.keywords("of","extends").surround(Q.oneSpace)}),this.on(e,bC)?.keywords("dynamic","view").append(Q.oneSpace),this.on(e,dw)?.keywords("deployment","view").append(Q.oneSpace)}formatLeafProperty(e){if(Uc(e)||El(e)||AU(e)||Ma(e)||Aw(e)||OC(e)||_s(e)||sl(e)||Sc(e)||Er(e)||dh(e)||$p(e)||ah(e)||Tw(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity","multiple");r.nodes.length===0?i.append(Q.oneSpace):r.prepend(Q.noSpace).append(Q.oneSpace),n.keyword(";").prepend(Q.noSpace).append(Q.newLine)}}formatLinkProperty(e){this.on(e,rh,(n,r)=>{r.keyword("link").append(Q.oneSpace),r.property("value").append(Q.oneSpace),r.keyword(":").prepend(Q.noSpace).append(Q.oneSpace),r.keyword(";").prepend(Q.noSpace).append(Q.newLine)})}formatNavigateToProperty(e){this.on(e,sh)?.property("key").append(Q.oneSpace)}formatAutolayoutProperty(e){this.on(e,Cl,(n,r)=>{r.keyword("autoLayout").append(Q.oneSpace),r.property("rankSep").prepend(Q.oneSpace),r.property("nodeSep").prepend(Q.oneSpace)})}formatMetadataProperty(e){this.on(e,TU,(n,r)=>{r.property("key").append(Q.oneSpace),r.keyword(":").prepend(Q.noSpace).append(Q.oneSpace),r.keyword(";").prepend(Q.noSpace).append(Q.newLine)})}formatElementDeclaration(e){this.on(e,Nn,(n,r)=>{const i=Jt(n.$cstNode,"kind"),s=Jt(n.$cstNode,"name");s&&i&&(iv(s,i)>0?r.cst([i]).append(Q.oneSpace):(r.cst([s]).append(Q.oneSpace),r.cst([i]).prepend(Q.oneSpace))),r.properties("props").prepend(Q.oneSpace)})}formatGlobals(e){this.on(e,Xc,(n,r)=>{r.keyword("style").append(Q.oneSpace),r.property("id").append(Q.oneSpace)}),this.on(e,Na,(n,r)=>{r.keyword("styleGroup").append(Q.oneSpace)}),this.on(e,Jp,(n,r)=>{r.keyword("predicateGroup").append(Q.oneSpace)}),this.on(e,Xp,(n,r)=>{r.keyword("dynamicPredicateGroup").append(Q.oneSpace)})}formatSpecificationRule(e){if((ja(e)||Ga(e)||hh(e)||za(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag","deploymentNode").append(Q.oneSpace),ph(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(Q.oneSpace),n.property("name").append(Q.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(jp(e)||Cw(e))&&n.keyword("with").prepend(Q.oneSpace)}formatDeploymentNodeDeclaration(e){this.on(e,hn,(n,r)=>{const i=Jt(n.$cstNode,"kind"),s=Jt(n.$cstNode,"name");s&&i&&(iv(s,i)>0?r.cst([i]).append(Q.oneSpace):(r.cst([s]).append(Q.oneSpace),r.cst([i]).prepend(Q.oneSpace))),r.properties("title").prepend(Q.oneSpace)})}formatDeployedInstance(e){this.on(e,rr,(n,r)=>{const i=n.$cstNode?.content.find(s=>s.text==="=");i&&r.cst([i]).surround(Q.oneSpace),r.keyword("instanceOf").append(Q.oneSpace),r.property("title").prepend(Q.oneSpace)})}formatViewRuleGlobalStyle(e){this.on(e,MC,(n,r)=>{r.keywords("global","style").append(Q.oneSpace)})}formatViewRuleGlobalPredicate(e){const n=this.getNodeFormatter(e);(LC(e)||DC(e))&&n.keywords("global","predicate").append(Q.oneSpace)}formatViewRuleGroup(e){this.on(e,gh,(n,r)=>{r.keyword("group").append(Q.oneSpace)})}formatViewRuleStyle(e){this.on(e,xl)?.keyword("style").append(Q.oneSpace),this.on(e,vC)?.keyword("style").append(Q.oneSpace),this.on(e,vU)?.keyword(",").prepend(Q.noSpace).append(Q.oneSpace),this.on(e,DU)?.keyword(",").prepend(Q.noSpace).append(Q.oneSpace)}formatWhereExpression(e){(nU(e)||X4(e))&&this.getNodeFormatter(e).keyword("where").append(Q.oneSpace)}formatWhereExpressionV2(e){rU(e)&&this.getNodeFormatter(e).keyword("where").append(Q.oneSpace)}formatWhereRelationExpression(e){if(this.on(e,uU,(n,r)=>{r.property("operator").surround(Q.oneSpace)}),this.on(e,qC,(n,r)=>{r.keyword("not").append(Q.oneSpace)}),wC(e)||xU(e)||zC(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(Q.oneSpace),n.property("not").surround(Q.oneSpace)}}formatWhereElementExpression(e){if(this.on(e,aU,(n,r)=>{r.property("operator").surround(Q.oneSpace)}),this.on(e,BC,(n,r)=>{r.keyword("not").append(Q.oneSpace)}),gC(e)||IU(e)||PU(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(Q.oneSpace),n.property("not").surround(Q.oneSpace)}}formatIncludeExcludeExpressions(e){if(lp(e)||eh(e)||Vc(e)||ka(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!Nh(e.$cstNode))&&n.keywords("include","exclude").append(Q.oneSpace)}if(EC(e)||NC(e)||NC(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&Nh(r?.$cstNode);i&&n.property("value").prepend(Q.indent),n.keyword(",").prepend(Q.noSpace).append(i?Q.newLine:Q.oneSpace)}}formatRelationExpression(e){this.on(e,Ew,(n,r)=>{r.keyword("->").append(Q.oneSpace)}),this.on(e,AC,(n,r)=>{r.keyword("->").prepend(Q.oneSpace)}),this.on(e,Sw,(n,r)=>{r.keywords("->","<->").prepend(Q.oneSpace),r.keywords("-[").prepend(Q.oneSpace).append(Q.noSpace),r.keywords("]->").prepend(Q.noSpace).append(Q.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(Q.oneSpace)}),this.on(e,fw,(n,r)=>{r.property("target").prepend(Q.oneSpace)})}formatDeploymentViewRulePredicateExpressions(e){if(lp(e)||eh(e)||Vc(e)||ka(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!Nh(e.$cstNode))&&n.keywords("include","exclude").append(Q.oneSpace)}if(gU(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&Nh(r?.$cstNode);i&&n.property("value").prepend(Q.indent),n.keyword(",").prepend(Q.noSpace).append(i?Q.newLine:Q.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||lp(n)||eh(n)||Vc(n)||ka(n))return n;n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class t7{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==Be.Validated&&(xe.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(Be.Validated,e.uri,r),xe.debug(`Document ${e.uri.path} is validated`)),Ya(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=xh.readId(i),a=i.$cstNode?.range;return!a||!s?[]:{range:{start:a.start,end:{line:a.start.line,character:a.start.character+4}},command:{command:"likec4.open-preview",arguments:[s],title:"open preview"}}}):void 0}}const sv=["color","shape","icon","border","opacity","multiple"].join(",");class n7 extends Pk{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(n.value==="deployment"&&pi(e.node,cl))return r(e,{label:n.value,detail:"Insert deployment view",kind:Ct.Class,insertTextFormat:Gn.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
|
|
225
|
-
`)});if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:Ct.Property,insertTextFormat:Gn.Snippet,insertText:`${n.value} '\${0}'`});if(["views","specification","model","deployment","with"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} {
|
|
226
|
-
$0
|
|
227
|
-
}`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:Ct.Class,insertTextFormat:Gn.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
|
|
228
|
-
`)});if(n.value==="dynamic"&&pi(e.node,cl))return r(e,{label:n.value,detail:"Insert dynamic view",kind:Ct.Class,insertTextFormat:Gn.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
|
|
229
|
-
`)});if(n.value==="style"&&e.node)return pi(e.node,Xc)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
|
|
230
|
-
\${3|${sv}|} $0
|
|
231
|
-
}`}):pi(e.node,Hj([cl,Na]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} \${1:*} {
|
|
232
|
-
\${2|${sv}|} $0
|
|
233
|
-
}`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} {
|
|
234
|
-
\${1|${sv}|} $0
|
|
235
|
-
}`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:Ct.Class,insertTextFormat:Gn.Snippet,insertText:`extend \${1:element} {
|
|
236
|
-
$0
|
|
237
|
-
}`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:Ct.Class,insertTextFormat:Gn.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class r7 extends Ik{createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range,ge.DocumentHighlightKind.Read)}}const i7=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,s7=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,a7=/^([/\\]\s*){2,}[^/\\]/;function v0(t){return["./","../"].some(e=>t.startsWith(e))}function av(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?i7.test(t):s7.test(t)||(e.acceptRelative?a7.test(t):!1)}function o7(t="",e){return t.endsWith("/")}function u7(t="",e){return(o7(t)?t.slice(0,-1):t)||"/"}function c7(t="",e){return t.endsWith("/")?t:t+"/"}function Oh(t=""){return t.startsWith("/")}function b0(t=""){return(Oh(t)?t.slice(1):t)||"/"}function l7(t=""){return Oh(t)?t:"/"+t}function d7(t,e){if(f7(e))return t;const n=u7(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function f7(t){return!t||t==="/"}function Fh(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}class p7{constructor(e){this.services=e}getDocumentLinks(e,n){return Ya(e)?gr(e.parseResult.value).filter(rh).map(r=>{try{const i=Jt(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&av(s))return{range:i,target:s}}catch(i){ye(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(av(n)||Oh(n))return n;const r=v0(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(Oh(n))return b0(n);if(v0(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return b0(d7(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class h7{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator,this.nameProvider=e.references.NameProvider}nodeKindProvider;nameProvider;parser;locator;getSymbols({parseResult:{value:{specifications:e,models:n,deployments:r,views:i,likec4lib:s}}}){return[...s.map(a=>()=>this.getLikec4LibSymbol(a)),...e.map(a=>()=>this.getSpecSymbol(a)),...n.map(a=>()=>this.getModelSymbol(a)),...r.map(a=>()=>this.getDeploymentModelSymbol(a)),...i.map(a=>()=>this.getModelViewsSymbol(a))].flatMap(a=>{try{return a()??[]}catch(o){return ye(o),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ae);return r.length===0?[]:[{kind:er.Namespace,name:"icons",range:n.range,selectionRange:Vo(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=Jt(n,"name");if(!r)return[];const i=Ye([...e.elements,...e.tags,...e.relationships],ln(s=>{try{if(ja(s)||Ga(s)||za(s))return this.getKindSymbol(s);if(hh(s))return this.getTagSymbol(s)}catch(a){return ye(a),null}Ie(s)}),ze(ae));return i.length===0?[]:[{kind:er.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=Jt(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getElementsSymbol(i))}]:[]}getDeploymentModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=Jt(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(_a(e))return this.getExtendElementSymbol(e);if(Nn(e))return this.getElementSymbol(e)}catch(n){ye(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:Ih(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=Jt(n,"name");if(!r||!n)return[];const i=e.name,s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(a=>this.getElementsSymbol(a))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=Jt(n,"name");return!r||!n?[]:[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.views.flatMap(i=>this.getViewSymbol(i))}]}getKindSymbol(e){return!e.$cstNode||!e.kind.$cstNode||ws(e.kind.name)?null:{kind:this.symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||ws(e.tag.name)?null:{kind:this.symbolKind(e),name:"#"+e.tag.name,range:e.$cstNode.range,selectionRange:e.tag.$cstNode.range}}getLibIconSymbol(e){return!e.$cstNode||ws(e.name)?null:{kind:this.symbolKind(e),name:e.name,range:e.$cstNode.range,selectionRange:e.$cstNode.range}}getViewSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.name?Jt(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if(hn(e))return this.getDeploymentNodeSymbol(e);if(rr(e))return this.getDeployedInstanceSymbol(e)}catch(n){ye(n)}return[]}getDeploymentNodeSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=this.nameProvider.getNameStrict(e),s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(a=>this.getDeploymentElementSymbol(a))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=ht(e),s=this.parser.forDocument(i).parseDeployedInstance(e),a=this.nameProvider.getNameStrict(e),o="instance of "+s.element;return[{kind:this.symbolKind(e),name:a,range:n.range,selectionRange:r.range,detail:o,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}var ov,D0;function m7(){return D0||(D0=1,ov=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),ov}var g7=m7();const y7=vy(g7);function uv(t){const e=y7(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}class w7 extends Fk{parser;locator;constructor(e){super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(FC(e))return{contents:{kind:"markdown",value:uv(`
|
|
238
|
-
tag: \`${e.name}\`
|
|
239
|
-
`)}};if(hn(e)){const n=ht(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("Deployment: `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
|
|
240
|
-
`)}}}if(rr(e)){const n=ht(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id+" ",`instance of \`${r.element}\``];return i&&s.push(`### ${i.title}`,"Element: `"+i.kind+"` "),{contents:{kind:"markdown",value:s.join(`
|
|
241
|
-
`)}}}if(Nn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"Element: `"+n.kind+"` "].join(`
|
|
242
|
-
`)}}:void 0}}}class v7 extends f4{highlightElement(e,n){if(Nn(e)||hn(e))return this.highlightNameAndKind(e,n);if(rr(e)){"name"in e&&n({node:e,property:"name",type:Fe.variable,modifier:[Je.definition,Je.readonly]});return}if(aw(e))return this.highlightView(e,n);if(CU(e))return n({node:e,property:"name",type:Fe.function});if(EU(e))return n({node:e,property:"name",type:Fe.type,modifier:[Je.definition]}),"prune";if($w(e)&&"kind"in e){n({node:e,property:"kind",type:Fe.function});return}if(Rr(e)&&"kind"in e&&n({node:e,property:"kind",type:Fe.function}),sh(e)||yl(e))return n({node:e,property:"key",type:Fe.property}),n({node:e,property:"value",type:Fe.variable,modifier:[Je.definition,Je.readonly]}),"prune";if((yw(e)||Ns(e))&&e.$cstNode)return n({cst:e.$cstNode,type:Fe.variable,modifier:[Je.definition,Je.readonly]}),"prune";if(bw(e)){e.selector&&n({node:e,property:"selector",type:Fe.variable,modifier:[Je.definition,Je.readonly]});return}if(zC(e)&&ae(e.value)){n({node:e,property:"value",type:Fe.function});return}if((gC(e)||wC(e))&&ae(e.value)){n({node:e,property:"value",type:Fe.type,modifier:[Je.definition,Je.readonly]});return}if((jC(e)||UC(e))&&n({node:e,property:"participant",type:Fe.keyword}),qp(e)&&ae(e.kind))return n({node:e,property:"kind",type:Fe.type,modifier:[Je.definition]}),"prune";if(Up(e)&&ae(e.tag))return n({node:e,property:"tag",type:Fe.type,modifier:[Je.definition]}),"prune";if(kC(e))return n({node:e,property:"value",type:e.parent?Fe.property:Fe.variable,modifier:[Je.definition,Je.readonly]}),e.parent?void 0:"prune";if(qc(e)||$C(e))return n({node:e,property:"el",type:e.parent?Fe.property:Fe.variable,modifier:[Je.definition,Je.readonly]}),e.parent?void 0:"prune";if(ph(e)){n({node:e,keyword:"color",type:Fe.keyword}),n({node:e,property:"name",type:Fe.type,modifier:[Je.declaration,Je.readonly]});return}if((ja(e)||Ga(e)||za(e))&&n({node:e,property:"kind",type:Fe.type,modifier:[Je.declaration,Je.readonly]}),Pw(e))return n({node:e,property:"values",type:Fe.interface});if(FC(e))return n({node:e,property:"name",type:Fe.type,modifier:[Je.definition]});if((lh(e)||Ci(e)&&Oc(e.$container))&&n({node:e,property:"key",type:Fe.property}),ah(e))return n({node:e,property:"key",type:Fe.property}),n({node:e,property:"value",type:Fe.number}),"prune";if(rh(e)||Er(e)||mC(e))return n({node:e,property:"key",type:Fe.property}),Er(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:Fe.enum,modifier:[Je.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:Fe.string}),"prune");if(_s(e)||dh(e)||Sc(e)||sl(e)||$p(e))return n({node:e,property:"key",type:Fe.property}),"value"in e&&n({node:e,property:"value",type:Fe.enum}),"prune"}highlightNameAndKind(e,n){n({node:e,property:"name",type:Fe.variable,modifier:[Je.declaration,Je.readonly]}),n({node:e,property:"kind",type:Fe.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Fe.variable,modifier:[Je.declaration,Je.readonly,"local"]})}}class b7{constructor(e){this.services=e,this.Names=e.references.NameProvider,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.documentCache=e.DocumentCache}Names;langiumDocuments;documentCache;documents(){return this.langiumDocuments.all.filter(e=>td(e)&&e.state>=Be.IndexedContent)}get(e){return e.state<Be.IndexedContent&&ye(`Document ${e.uri.path} is not indexed`),this.documentCache.get(e.uri,"DeploymentsIndex",()=>this.createDocumentIndex(e))}nested(e){const n=this.getFqn(e);return this.documents().flatMap(r=>this.get(r).nested(n))}byFqn(e){return this.documents().flatMap(n=>this.get(n).byFqn(e))}getFqn(e){let n=ed.readId(e);if(ae(n))return n;const r=[this.Names.getNameStrict(e)];let i=e,s;for(;s=Xt(i.$container,hn);)r.push(this.Names.getNameStrict(s)),i=s;return n=r.reduceRight((a,o)=>`${a}.${o}`),ed.writeId(e,n),n}createDocumentIndex(e){const n=e.parseResult.value.deployments.flatMap(l=>l.elements);if(n.length===0)return hm.EMPTY;const r=new Array,i=new Pn,s=new Pn,a=this.Names,o=this.services.workspace.AstNodeDescriptionProvider,u=l=>{const d={...o.createDescription(l.node,l.name,e),fqn:l.fqn};return ed.writeId(l.node,l.fqn),s.add(l.fqn,d),d},c=(l,d)=>{const f=[],p=l.body?.elements;if(!p||p.length===0)return[];const h=new Set;for(const w of p)if(!ki(w))try{const D=a.getName(w);if(ae(D)){const g=`${d}.${D}`,v=u({node:w,name:D,fqn:g});i.add(d,v),h.add(v.name),hn(w)&&w.body&&f.push(...c(w,g))}}catch(D){ye(D)}return f.length>0&&Ye(f,vs(Eu("name")),tp((w,D)=>{w.length>1||h.has(D)||i.add(d,w[0])})),i.get(d)};for(const l of n)try{if(ki(l))continue;const d=a.getName(l);ae(d)&&(r.push(u({node:l,name:d,fqn:d})),c(l,d))}catch(d){ye(d)}return new hm(r,i,s)}}class hm{constructor(e,n,r){this._rootNodes=e,this._nested=n,this._byfqn=r}static EMPTY=new hm([],new Pn,new Pn);rootNodes(){return this._rootNodes}byFqn(e){return this._byfqn.get(e)}nested(e){return this._nested.get(e)}unique(){const e=[];return Ye([...this._byfqn.values()],vs(Eu("name")),tp(n=>{n.length===1&&e.push(n[0])})),e}}const{findNodeForProperty:D7}=Yd,{toDocumentSegment:E0}=$x;function E7(t,e,n){const r=D7(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:E0(e.$cstNode)},...r&&{nameSegment:E0(r)},path:t.getAstNodePath(e),type:Wn}}function R7(t,e){const n=t.c4fqnIndex=new Pn,r=t.parseResult.value.models.flatMap(o=>o.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=ym.from(r.map(o=>[o,null]));let a;for(;a=s.shift();)try{const[o,u]=a;if(Rr(o))continue;if(_a(o)){if(Ht(o.body)&&!ws(o.body.elements)){const c=Ih(o.element);for(const l of o.body.elements)Rr(l)||s.push([l,c])}continue}if(Nn(o)){const c=Z1(o.name,u);if(n.add(c,{...E7(i,o,t),fqn:c}),ed.writeId(o,c),Ht(o.body)&&!ws(o.body.elements))for(const l of o.body.elements)Rr(l)||s.push([l,c]);continue}Ie(o)}catch(o){IA(o)}}class cv{toDispose=[];isDisposed=!1;onDispose(...e){this.toDispose.push(...e)}dispose(){this.throwIfDisposed(),this.isDisposed=!0;let e;for(;e=this.toDispose.pop();)try{e.dispose()}catch(n){IA(n)}}throwIfDisposed(){if(this.isDisposed)throw new Error("This has already been disposed")}}function rd(...t){var e=t.length>1?t.join(":::"):t[0];return ex(e)}class T7 extends cv{constructor(e){super(),this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.onDispose(e.shared.workspace.DocumentBuilder.onBuildPhase(Be.IndexedContent,async(n,r)=>{for(const i of n)if(td(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Deployments,delete i.c4DeploymentRelations,delete i.c4Globals,delete i.c4Views;try{R7(i,e)}catch(s){ye(s)}}return await Promise.resolve()})),xe.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(tv)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return ed.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return et([e]).flatMap(n=>{const r=this.entries(i=>so(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new Pn(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Pt(()=>{const n=`${e}.`,r=new Set,i=[],s=new Pn;if(this.entries(a=>a.startsWith(n)).forEach(a=>{const o=io(a.fqn),u={...a,name:o};so(a.fqn)===e?(r.add(o),s.add(o,u)):i.push(u)}),s.size+i.length===0)return null;for(const a of i)r.has(a.name)||s.add(a.name,a);return s.entriesGroupedByKey().flatMap(([a,o])=>o.length===1?o:[]).iterator()},n=>n?n.next():Kt)}}var S7=Object.getOwnPropertyNames,$7=Object.getOwnPropertySymbols,k7=Object.prototype.hasOwnProperty;function R0(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Lh(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,a=s.get(n),o=s.get(r);if(a&&o)return a===r&&o===n;s.set(n,r),s.set(r,n);var u=t(n,r,i);return s.delete(n),s.delete(r),u}}function T0(t){return S7(t).concat($7(t))}var C7=Object.hasOwn||function(t,e){return k7.call(t,e)};function qs(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var A7="__v",_7="__o",P7="_owner",S0=Object.getOwnPropertyDescriptor,$0=Object.keys;function I7(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function x7(t,e){return qs(t.getTime(),e.getTime())}function N7(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function O7(t,e){return t===e}function k0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.entries(),a,o,u=0;(a=s.next())&&!a.done;){for(var c=e.entries(),l=!1,d=0;(o=c.next())&&!o.done;){if(i[d]){d++;continue}var f=a.value,p=o.value;if(n.equals(f[0],p[0],u,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){l=i[d]=!0;break}d++}if(!l)return!1;u++}return!0}var F7=qs;function L7(t,e,n){var r=$0(t),i=r.length;if($0(e).length!==i)return!1;for(;i-- >0;)if(!A0(t,e,n,r[i]))return!1;return!0}function id(t,e,n){var r=T0(t),i=r.length;if(T0(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=r[i],!A0(t,e,n,s)||(a=S0(t,s),o=S0(e,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function M7(t,e){return qs(t.valueOf(),e.valueOf())}function B7(t,e){return t.source===e.source&&t.flags===e.flags}function C0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var u=e.values(),c=!1,l=0;(o=u.next())&&!o.done;){if(!i[l]&&n.equals(a.value,o.value,a.value,o.value,t,e,n)){c=i[l]=!0;break}l++}if(!c)return!1}return!0}function z7(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function q7(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function A0(t,e,n,r){return(r===P7||r===_7||r===A7)&&(t.$$typeof||e.$$typeof)?!0:C7(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var j7="[object Arguments]",U7="[object Boolean]",G7="[object Date]",W7="[object Error]",H7="[object Map]",V7="[object Number]",K7="[object Object]",Y7="[object RegExp]",X7="[object Set]",J7="[object String]",Q7="[object URL]",Z7=Array.isArray,_0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,P0=Object.assign,eV=Object.prototype.toString.call.bind(Object.prototype.toString);function tV(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,u=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,l=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(h,w,D){if(h===w)return!0;if(h==null||w==null)return!1;var g=typeof h;if(g!==typeof w)return!1;if(g!=="object")return g==="number"?a(h,w,D):g==="function"?i(h,w,D):!1;var v=h.constructor;if(v!==w.constructor)return!1;if(v===Object)return o(h,w,D);if(Z7(h))return e(h,w,D);if(_0!=null&&_0(h))return d(h,w,D);if(v===Date)return n(h,w,D);if(v===RegExp)return c(h,w,D);if(v===Map)return s(h,w,D);if(v===Set)return l(h,w,D);var R=eV(h);return R===G7?n(h,w,D):R===Y7?c(h,w,D):R===H7?s(h,w,D):R===X7?l(h,w,D):R===K7?typeof h.then!="function"&&typeof w.then!="function"&&o(h,w,D):R===Q7?f(h,w,D):R===W7?r(h,w,D):R===j7?o(h,w,D):R===U7||R===V7||R===J7?u(h,w,D):!1}}function nV(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?id:I7,areDatesEqual:x7,areErrorsEqual:N7,areFunctionsEqual:O7,areMapsEqual:r?R0(k0,id):k0,areNumbersEqual:F7,areObjectsEqual:r?id:L7,arePrimitiveWrappersEqual:M7,areRegExpsEqual:B7,areSetsEqual:r?R0(C0,id):C0,areTypedArraysEqual:r?id:z7,areUrlsEqual:q7};if(n&&(i=P0({},i,n(i))),e){var s=Lh(i.areArraysEqual),a=Lh(i.areMapsEqual),o=Lh(i.areObjectsEqual),u=Lh(i.areSetsEqual);i=P0({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:u})}return i}function rV(t){return function(e,n,r,i,s,a,o){return t(e,n,o)}}function iV(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(u,c){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,p=l.meta;return n(u,c,{cache:f,equals:i,meta:p,strict:s})};if(e)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(u,c){return n(u,c,a)}}var I0=Mi();Mi({strict:!0}),Mi({circular:!0}),Mi({circular:!0,strict:!0}),Mi({createInternalComparator:function(){return qs}}),Mi({strict:!0,createInternalComparator:function(){return qs}}),Mi({circular:!0,createInternalComparator:function(){return qs}}),Mi({circular:!0,createInternalComparator:function(){return qs},strict:!0});function Mi(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=nV(t),u=tV(o),c=r?r(u):rV(u);return iV({circular:n,comparator:u,createState:i,equals:c,strict:a})}function sV(t){const e=new Map;for(const n of t)if(ro.isElement(n)&&n.viewOf&&yt(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){const s=Rd.modelRef(i);if(i.navigateTo||!s)continue;const a=n$(e.get(s)??[],o=>o!==n);a&&(i.navigateTo=a)}return t}function aV(t,e="/"){const n=Ye(t,ln(u=>u.docUri),ze(ae),_y());if(n.length===0)return"";if(n.length===1){const u=Fh(n[0]).pathname.split(e);return u.length<=1?e:(u.pop(),u.join(e)+e)}Se(ys(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=Fh(r).pathname.split(e);let a=s.length;for(const u of i){if(u===r)continue;const c=Fh(u).pathname.split(e);for(let l=0;l<a;l++)c[l]!==s[l]&&(a=l);if(a===0)return""}const o=s.slice(0,a).join(e);return o.endsWith(e)?o:o+e}function oV(t){const e="/",n=aV(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=Fh(r.docUri).pathname;return n.length>0?(Se(i.startsWith(n),`Expect path "${i}" to start with common prefix: "${n}"`),i=i.slice(n.length)):i=i.includes(e)?i.slice(i.lastIndexOf(e)+1):i,{view:r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length!==i.parts.length)return r.parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const a=Hb(r.parts[s],i.parts[s]);if(a!==0)return a}return Hb(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function uV(t,e){const n={tags:new Set,deployments:{},elements:{},relationships:{},colors:{}},r={predicates:{},dynamicPredicates:{},styles:{}};for(const g of e){const{c4Specification:v,c4Globals:R}=g;v.tags.forEach(k=>n.tags.add(k)),Object.assign(n.elements,v.elements),Object.assign(n.relationships,v.relationships),Object.assign(n.colors,v.colors),Object.assign(n.deployments,v.deployments),Object.assign(r.predicates,R.predicates),Object.assign(r.dynamicPredicates,R.dynamicPredicates),Object.assign(r.styles,R.styles)}function i(g,v){return ln(v,R=>{try{const k=t.lsp.DocumentLinkProvider.relativeLink(g,R.url);if(k&&k!==R.url)return{...R,relative:k}}catch(k){ye(k)}return R})}const s=Ru(n.colors,g=>nx(g.color));function a(g){return({tags:v,links:R,style:{color:k,shape:A,icon:j,opacity:W,border:Z,multiple:J},id:de,kind:N,title:$,description:T,technology:O,metadata:V})=>{try{const M=n.elements[N];if(!M)return xe.warn(`No kind '${N}' found for ${de}`),null;const H=R?i(g,R):null;return k??=M.style.color,A??=M.style.shape,j??=M.style.icon,W??=M.style.opacity,Z??=M.style.border,O??=M.technology,J??=M.style.multiple,{...k&&{color:k},...A&&{shape:A},...j&&{icon:j},...V&&!ws(V)&&{metadata:V},...M.notation&&{notation:M.notation},style:{...Z&&{border:Z},...Iy(J)&&{multiple:J},...ep(W)&&{opacity:W}},links:H,tags:v??null,technology:O??null,description:T??null,title:$,kind:N,id:de}}catch(M){ye(M)}return null}}const o=Ye(e,Di(g=>ln(g.c4Elements,a(g))),ze(ae),Kb,Py((g,v)=>{const R=so(v.id);return R&&yt(g[R])?(ye(`No parent found for ${v.id}`),g):(g[v.id]=v,g)},{}));function u(g){return({astPath:v,source:R,target:k,kind:A,links:j,id:W,...Z})=>{if(yt(o[R])||yt(o[k]))return xe.warn(`Invalid relation ${W} at ${g.uri.path} ${v}, source: ${R}(${!!o[R]}), target: ${k}(${!!o[k]})`),null;const J=j?i(g,j):null;return Qt(A)&&A in n.relationships?{...n.relationships[A],...Z,...J&&{links:J},source:R,target:k,kind:A,id:W}:{...J&&{links:J},...Z,source:R,target:k,id:W}}}const c=Ye(e,Di(g=>ln(g.c4Relations,u(g))),ze(ae),QS(rx),ZS(),xy(Eu("id")));function l(g){return v=>{if(!ix.isDeploymentNode(v)){if(!v.links||v.links.length===0)return v;const R=i(g,v.links);return{...v,links:R}}try{const R=n.deployments[v.kind];if(!R)return xe.warn(`No kind '${v.kind}' found for ${v.id}`),null;let{technology:k=R.technology,notation:A=R.notation,links:j,style:W}=v;return{...v,...A&&{notation:A},...k&&{technology:k},style:{border:"dashed",opacity:10,...R.style,...W},links:j?i(g,j):null}}catch(R){ye(R)}return null}}const d=Ye(e,Di(g=>ln(g.c4Deployments,l(g))),ze(ae),Kb,Py((g,v)=>{const R=so(v.id);return R&&yt(g[R])?(ye(`No parent found for deployment element ${v.id}`),g):(g[v.id]=v,g)},{}));function f(g){return({astPath:v,source:R,target:k,kind:A,links:j,id:W,...Z})=>{if(yt(d[R.id])||yt(d[k.id]))return xe.warn(`Invalid deployment relation ${W} at ${g.uri.path} ${v}, source: ${R.id}(${!!d[R.id]}), target: ${k.id}(${!!d[k.id]})`),null;const J=j?i(g,j):null;return Qt(A)&&A in n.relationships?{...n.relationships[A],...Z,...J&&{links:J},source:R,target:k,kind:A,id:W}:{...J&&{links:J},...Z,source:R,target:k,id:W}}}const p=Ye(e,Di(g=>ln(g.c4DeploymentRelations,f(g))),ze(ae),Py((g,v)=>Ht(g[v.id])?(ye(`Duplicate deployment relation ${v.id}`),g):(g[v.id]=v,g),{}));function h(g){const v=g.uri.toString();return R=>{let{id:k,title:A,description:j,tags:W,links:Z,astPath:J,...de}=R;R.__==="element"&&yt(A)&&"viewOf"in R&&(A=o[R.viewOf]?.title??null),yt(A)&&k==="index"&&(A="Landscape view");const N=Z?i(g,Z):null;return{...de,customColorDefinitions:s,tags:W,links:N,docUri:v,description:j,title:A,id:k}}}const w=Ye(e,Di(g=>ln(g.c4Views,h(g))),oV);w.some(g=>g.id==="index")||w.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:s,rules:[{include:[{wildcard:!0}]}]});const D=Ye(w,xy(Eu("id")),dx);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships,deployments:n.deployments},elements:o,relations:c,globals:r,views:D,deployments:{elements:d,relations:p}}}const x0="ParsedLikeC4Model",lv="ComputedLikeC4Model";class cV extends cv{constructor(e){super(),this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments;const n=e.likec4.ModelParser;this.onDispose(e.shared.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.notifyListeners(i)})),this.onDispose(e.shared.workspace.DocumentBuilder.onBuildPhase(Be.Validated,async(r,i)=>{let s=[];xe.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const a of r)try{s.push(n.parse(a).uri)}catch(o){ye(o)}await At(i),s.length>0&&this.notifyListeners(s)})),xe.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){const e=this.documents();return e.length===0?(xe.debug("[ModelBuilder] No documents to build model from"),null):this.services.WorkspaceCache.get(x0,()=>(xe.debug(`[ModelBuilder] buildModel (${e.length} docs)`),uV(this.services,e)))}async buildModel(e){return this.services.WorkspaceCache.get(x0)||await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await At(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(lv,()=>{const i=Vb.makeCompute(e),s=[];for(const o of Du(e.views)){const u=i(o);if(!u.isSuccess){ye(u.error);continue}s.push(u.view)}sV(s);const a=nr(s,o=>{const u=this.previousViews[o.id],c=u&&I0(o,u)?u:o;return r.set(N0(o.id),c),[o.id,c]});return this.previousViews={...a},{...mj(e,["views"]),views:a}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(lv)?n.get(lv):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await At(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=N0(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await At(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),a=s?.views[e];if(!a)return xe.warn(`[ModelBuilder] Cannot find view ${e}`),null;const o=Vb.makeCompute(s)(a);if(!o.isSuccess)return ye(o.error),null;let u=o.view;const c=Ye(s.views,Du(),ze(tx),ze(d=>d.id!==e),vs(d=>d.viewOf));for(const d of u.nodes)if(!d.navigateTo){const f=c[d.id];f&&(d.navigateTo=f[0].id)}const l=this.previousViews[e];return l&&I0(u,l)?u=l:this.previousViews[e]=u,u})))}onModelParsed(e){return this.listeners.push(e),gs.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(Ya).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){ye(r)}}}function N0(t){return`computed-view-${t}`}const{findNodeForKeyword:lV,findNodeForProperty:Mh}=Yd,{getDocument:dV}=Wo;class fV{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;deploymentsIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(Ya)}getParsedElement(e){if(e$(e)){const i=e,s=this.fqnIndex.byFqn(e).head();if(!s)return null;const a=this.langiumDocuments.getDocument(s.documentUri);return!a||!Ya(a)?null:a.c4Elements.find(o=>o.id===i)??null}const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=dV(e);return Ya(r)?r.c4Elements.find(i=>i.id===n)??null:null}locateElement(e,n){const r=this.fqnIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateDeploymentElement(e,n){const r=this.deploymentsIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(a=>a.id===e)??n.c4DeploymentRelations.find(a=>a.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!Rr(i)&&!ki(i))continue;let s=i.title?Mh(i.$cstNode,"title"):void 0;if(s??=i.kind?Mh(i.$cstNode,"kind"):void 0,s??=Mh(i.$cstNode,"target"),s??=i.$cstNode,!!s)return{uri:n.uri.toString(),range:s.range}}return null}locateViewAst(e){for(const n of this.documents()){const r=n.c4Views.find(s=>s.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(aw(i))return{doc:n,view:r,viewAst:i}}return null}locateView(e){const n=this.locateViewAst(e);if(!n)return null;const r=n.viewAst;let i=r.name?Mh(r.$cstNode,"name"):void 0;return i??=lV(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}const js=["this","it","self","super","likec4lib","global"];function ut(t){return async function(e,n,r){try{const i=t(e,n,r);Ej(i)&&await i;return}catch(i){const s=i instanceof Error?i.message:String(i);n("error",`Validation failed: ${s}`,{node:e}),ye(i)}}}const{getDocument:pV}=Wo,hV=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return ut((r,i)=>{const s=n.getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const a=sn(n.getNameNode(r),"name CstNode not found").range;js.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:a});const o=e.getFqn(r);e.byFqn(o).limit(2).toArray().length>1&&i("error",`Duplicate node name "${o}"`,{node:r,range:a})})},mV=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return ut((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique inside node",{node:r});return}const a=sn(n.getNameNode(r),"name CstNode not found").range;js.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:a});const o=e.getFqn(r);e.byFqn(o).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${o}"`,{node:r,range:a})})},gV=t=>{const e=t.likec4.ModelParser;return ut((n,r)=>{if(!n.source?.value?.ref){let u=n.source?.$cstNode?.text??"";r("error",`DeploymentRelation source '${u}' not resolved`,{node:n,property:"source"});return}if(!n.target?.value?.ref){let u=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${u}' not resolved`,{node:n,property:"target"});return}const i=pV(n),s=e.forDocument(i),a=s.parseFqnRef(n.source);if(ao.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const o=s.parseFqnRef(n.target);if(ao.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}Yb(a.deployment,o.deployment)&&r("error","Invalid parent-child relationship",{node:n})})},yV=t=>ut((e,n)=>{const r=w0(e.value);switch(!0){case qp(r):case Up(r):case Ns(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}}),wV=t=>{const e=t.likec4.FqnIndex;return ut((n,r)=>{const i=gn(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const a=gn(n.target),o=a&&e.getFqn(a);o||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&o&&(wm(s,o)||wm(o,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:vV}=Wo,bV=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return ut((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}js.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const a=vV(r).uri,o=n.getAstNodePath(r),u=e.byFqn(s).filter(c=>c.documentUri!==a||c.path!==o).head();if(u){const c=u.documentUri!==a;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...c&&{relatedInformation:[{location:{range:u.nameSegment?.range??u.selectionSegment?.range,uri:u.documentUri.toString()},message:"conflicting element"}]}})}})},DV=t=>ut((e,n)=>{const r=parseFloat(e.value);(isNaN(r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})}),EV=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Er(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Ci(r)&&Oc(r.$container)&&r.$container.props.some(i=>Er(i))&&n("warning","Redundant as icon defined on element",{node:e})},RV=t=>(e,n)=>{pi(e,gw)||n("error","Notes can be defined only inside dynamic view",{node:e})},TV=t=>{const e=t.likec4.FqnIndex;return ut((n,r)=>{const i=gn(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let a;if(Ht(n.source)){if(a=gn(n.source),!a)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!Oc(n.$container))return r("error","Sourceless relation must be nested",{node:n});a=n.$container.$container}const o=e.getFqn(a);o||r("error","Source not resolved",{node:n}),o&&s&&Yb(o,s)&&r("error","Invalid parent-child relationship",{node:n})})},SV=t=>ut((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),$V=t=>ut((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),kV=t=>ut((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),CV=t=>ut((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),AV=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{js.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(ri).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==ht(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},_V=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{js.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements($i).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==ht(n).uri;r("error",`Duplicate deploymentNode kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},PV=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{const i="#"+n.name,s=e.allElements(_i).filter(a=>a.name===i&&a.node!==n).head();if(s){const a=s.documentUri!==ht(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},IV=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{js.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Ai).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},O0=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{const i=e.allElements(Ia),s=e.allElements(Pa);i.concat(s).filter(a=>a.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},xV=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{e.allElements(Jc).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},NV=t=>{const e=t.shared.workspace.IndexManager;return ut((n,r)=>{n.name&&(js.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(As).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))})},OV=t=>ut((e,n)=>{const r=Xt(e,Ep);Vc(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=ww(e.subject)?e.subject.subject:e.subject;switch(!0){case qc(i):case yw(i):case TC(i):case Ns(i):return;case qp(i):case Up(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Ie(i)}}),FV=t=>ut((e,n)=>{pi(e,uw)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})}),LV=t=>{const e=t.likec4.ModelParser;return ut((n,r)=>{if(n.$container.$type!=="DeploymentViewRulePredicateExpression")return;const i=Xt(n,ka);if(!i||i.isInclude!==!0)return;const s=ht(n),a=e.forDocument(s),o="Model reference is allowed in exclude predicate only";if(fw(n)){oo.isModelRef(a.parseFqnExpr(n.source.from))&&r("error",o,{node:n.source,property:"from"}),oo.isModelRef(a.parseFqnExpr(n.target))&&r("error",o,{node:n,property:"target"});return}let u;if(Ew(n)?u=n.to:Sw(n)?u=n.from:u=n.inout.to,oo.isModelRef(a.parseFqnExpr(u))){r("error",o,{node:n});return}})},MV=t=>{const e=t.likec4.ModelParser;return ut((n,r)=>{const i=n.ref.value.ref;if(yt(i)){r("error","Invalid empty reference",{node:n});return}const s=ht(n),a=e.forDocument(s).parseFqnRefExpr(n);if(n.$container.$type==="DeploymentViewRulePredicateExpression"){if(oo.isModelRef(a)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(oo.isDeploymentRef(a)&&ao.isInsideInstanceRef(a.ref)){r("error","Must reference deployment nodes or instances, but not internals",{node:n});return}}!hn(i)&&Qt(n.selector)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"})})},BV=t=>ut((e,n)=>{if(Ns(e.to)&&!Rw(e.$container)){const r=Xt(e,Gp);yt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),zV=t=>ut((e,n)=>{if(Ns(e.from)&&!pw(e.$container)){const r=Xt(e,Gp);yt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),qV=t=>ut((e,n)=>{const r=Xt(e,Ep);Vc(r)&&n("error",'Invalid usage inside "exclude"',{node:e})});function jV(t){return e=>t.some(n=>n(e))}const UV=jV([Dw,Jp,Xp,Xc,Na,EC,jp,Cw,rw,uw,hw,gw,K4,ka,Q4,pC,bw,iU,cw,eU,Pw,sU,lp,aw,lw,rr,hn,ki,hC,Sa,Rr,J4,mC,sh,Nn,_a,ja,Ga,za,hh,ph,_w]),GV=t=>{let e=t;for(;e&&!RU(e);){if(UV(e))return e;e=e.$container}};function WV(t){const e=t.state>=Be.Validated?t.diagnostics?.filter(r=>r.severity===mu.Error)??[]:[],n=new WeakSet;for(const{node:r}of e){if(yt(r)||n.has(r))continue;n.add(r);const i=GV(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function HV(t){xe.debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:mV(t),DeploymentNodeKind:_V(t),DeploymentNode:hV(t),DeploymentRelation:gV(t),FqnRefExpr:MV(t),RelationExpr:LV(t),NotesProperty:RV(),OpacityProperty:DV(),IconProperty:EV(),SpecificationRule:$V(),Model:kV(),Globals:CV(),GlobalPredicateGroup:O0(t),GlobalDynamicPredicateGroup:O0(t),GlobalStyleId:xV(t),DynamicViewStep:wV(t),LikeC4View:NV(t),Element:bV(t),ElementKind:AV(t),Relation:TV(t),RelationBody:SV(),Tag:PV(t),DynamicViewPredicateIterator:yV(),ElementPredicateWith:OV(),RelationPredicateWith:qV(),ExpandElementExpression:FV(),RelationshipKind:IV(t),IncomingRelationExpression:BV(),OutgoingRelationExpression:zV()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)xe.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function $r(t){return Qt(t)?st(t).split(`
|
|
243
|
-
`).join(" "):void 0}function st(t){return Qt(t)?uv(t).trim():void 0}class VV{constructor(e,n){this.services=e,this.doc=n,this.isValid=WV(n).isValid}isValid;resolveFqn(e){if(fC(e))return this.services.likec4.DeploymentsIndex.getFqn(e);if(_a(e))return Ih(e.element);const n=this.services.likec4.FqnIndex.getFqn(e);return Se(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!(!e||!this.isValid(e)))return nr(e.props,n=>[n.key,st(n.value)])}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;const r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ae);i.length>0&&r.push(...i)}}catch{}n=n.prev}return r.reverse(),Kn(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return Ye(e.props,ze(rh),Di(n=>{if(!this.isValid(n))return[];const r=n.value;if(ae(r)){const i=ae(n.title)?$r(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}function KV(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of VH(e))try{switch(!0){case ki(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case rr(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case hn(n):{e.c4Deployments.push(this.parseDeploymentNode(n));break}default:Ie(n)}}catch(r){ye(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=sn(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(e.body),a=e.body?.props.find(Ci)?.props,o=Li(a,n),u=this.getMetadata(e.body?.props.find(Sa)),c=Ye(e.body?.props??[],ze(n),ze(Uc),nr(w=>[w.key,w.value||void 0])),l=st(e.title??c.title),d=st(c.description),f=$r(c.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Er);if(h&&n(h)){const w=h.libicon?.ref?.name??h.value;ae(w)&&(o.icon=w)}return{id:r,kind:i,title:l??io(r),...u&&{metadata:u},...s&&{tags:s},...p&&Kn(p)&&{links:p},...ae(f)&&{technology:f},...ae(d)&&{description:d},style:o}}parseDeployedInstance(e){const n=this.isValid,r=this.resolveFqn(e),i=this.resolveFqn(sn(gn(e.element),"DeployedInstance element not found")),s=this.convertTags(e.body),a=e.body?.props.find(Ci)?.props,o=Li(a,n),u=this.getMetadata(e.body?.props.find(Sa)),c=Ye(e.body?.props??[],ze(n),ze(Uc),nr(w=>[w.key,w.value||void 0])),l=st(e.title??c.title),d=st(c.description),f=$r(c.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Er);if(h&&n(h)){const w=h.libicon?.ref?.name??h.value;ae(w)&&(o.icon=w)}return{id:r,element:i,...u&&{metadata:u},...l&&{title:l},...s&&{tags:s},...p&&Kn(p)&&{links:p},...ae(f)&&{technology:f},...ae(d)&&{description:d},style:o}}parseDeploymentRelation(e){const n=this.isValid,r=this.getAstNodePath(e),i=ao.toDeploymentRef(this.parseFqnRef(e.source)),s=ao.toDeploymentRef(this.parseFqnRef(e.target)),a=this.convertTags(e)??this.convertTags(e.body),o=this.convertLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Sa)),l=nr(e.body?.props.filter(El)??[],D=>[D.key,D.value]),d=Ye(e.body?.props??[],ze(yl),ln(D=>D.value.view.ref?.name),ze(ae),Da()),f=st(e.title??l.title),p=st(l.description),h=$r(e.technology)??st(l.technology),w=e.body?.props.find(lh);return{id:rd("deployment",r,i.id,s.id),source:i,target:s,...f&&{title:f},...c&&{metadata:c},...ae(h)&&{technology:h},...ae(p)&&{description:p},...u&&{kind:u},...a&&{tags:a},...Kn(o)&&{links:o},...nv(w?.props,n),...d&&{navigateTo:d},astPath:r}}}}function YV(t){for(var e=t.length,n=0,r=0;r<e;){var i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){var s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function XV(t,e,n){for(var r=t.length,i=n,s=0;s<r;){var a=t.charCodeAt(s++);if(a&4294967168)if(!(a&4294965248))e[i++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&s<r){var o=t.charCodeAt(s);(o&64512)===56320&&(++s,a=((a&1023)<<10)+(o&1023)+65536)}a&4294901760?(e[i++]=a>>18&7|240,e[i++]=a>>12&63|128,e[i++]=a>>6&63|128):(e[i++]=a>>12&15|224,e[i++]=a>>6&63|128)}else{e[i++]=a;continue}e[i++]=a&63|128}}var JV=new TextEncoder,QV=50;function ZV(t,e,n){JV.encodeInto(t,e.subarray(n))}function e5(t,e,n){t.length>QV?ZV(t,e,n):XV(t,e,n)}var t5=4096;function F0(t,e,n){for(var r=e,i=r+n,s=[],a="";r<i;){var o=t[r++];if(!(o&128))s.push(o);else if((o&224)===192){var u=t[r++]&63;s.push((o&31)<<6|u)}else if((o&240)===224){var u=t[r++]&63,c=t[r++]&63;s.push((o&31)<<12|u<<6|c)}else if((o&248)===240){var u=t[r++]&63,c=t[r++]&63,l=t[r++]&63,d=(o&7)<<18|u<<12|c<<6|l;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(o);s.length>=t5&&(a+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(a+=String.fromCharCode.apply(String,s)),a}var n5=new TextDecoder,r5=200;function i5(t,e,n){var r=t.subarray(e,e+n);return n5.decode(r)}function s5(t,e,n){return n>r5?i5(t,e,n):F0(t,e,n)}var Bh=function(){function t(e,n){this.type=e,this.data=n}return t}(),a5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kr=function(t){a5(e,t);function e(n){var r=t.call(this,n)||this,i=Object.create(e.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:e.name}),r}return e}(Error),sd=4294967295;function o5(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function L0(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function M0(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function u5(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var c5=-1,l5=4294967296-1,d5=17179869184-1;function f5(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=d5)if(n===0&&e<=l5){var r=new Uint8Array(4),i=new DataView(r.buffer);return i.setUint32(0,e),r}else{var s=e/4294967296,a=e&4294967295,r=new Uint8Array(8),i=new DataView(r.buffer);return i.setUint32(0,n<<2|s&3),i.setUint32(4,a),r}else{var r=new Uint8Array(12),i=new DataView(r.buffer);return i.setUint32(0,n),L0(i,4,e),r}}function p5(t){var e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function h5(t){if(t instanceof Date){var e=p5(t);return f5(e)}else return null}function m5(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:{var n=e.getUint32(0),r=0;return{sec:n,nsec:r}}case 8:{var i=e.getUint32(0),s=e.getUint32(4),n=(i&3)*4294967296+s,r=i>>>2;return{sec:n,nsec:r}}case 12:{var n=M0(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new kr("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function g5(t){var e=m5(t);return new Date(e.sec*1e3+e.nsec/1e6)}var y5={type:c5,encode:h5,decode:g5},B0=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(y5)}return t.prototype.register=function(e){var n=e.type,r=e.encode,i=e.decode;if(n>=0)this.encoders[n]=r,this.decoders[n]=i;else{var s=1+n;this.builtInEncoders[s]=r,this.builtInDecoders[s]=i}},t.prototype.tryToEncode=function(e,n){for(var r=0;r<this.builtInEncoders.length;r++){var i=this.builtInEncoders[r];if(i!=null){var s=i(e,n);if(s!=null){var a=-1-r;return new Bh(a,s)}}}for(var r=0;r<this.encoders.length;r++){var i=this.encoders[r];if(i!=null){var s=i(e,n);if(s!=null){var a=r;return new Bh(a,s)}}}return e instanceof Bh?e:null},t.prototype.decode=function(e,n,r){var i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new Bh(n,e)},t.defaultCodec=new t,t}();function w5(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function zh(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):w5(t)?new Uint8Array(t):Uint8Array.from(t)}function v5(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=zh(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var b5=100,D5=2048,E5=function(){function t(e){var n,r,i,s,a,o,u,c;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:B0.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:b5,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:D5,this.sortKeys=(a=e?.sortKeys)!==null&&a!==void 0?a:!1,this.forceFloat32=(o=e?.forceFloat32)!==null&&o!==void 0?o:!1,this.ignoreUndefined=(u=e?.ignoreUndefined)!==null&&u!==void 0?u:!1,this.forceIntegerToFloat=(c=e?.forceIntegerToFloat)!==null&&c!==void 0?c:!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},t.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},t.prototype.doEncode=function(e,n){if(n>this.maxDepth)throw new Error("Too deep objects in depth ".concat(n));e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)},t.prototype.ensureBufferSizeToWrite=function(e){var n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)},t.prototype.resizeBuffer=function(e){var n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(e){e===!1?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},t.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},t.prototype.encodeBigInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},t.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error("Too long string: ".concat(e," bytes in UTF-8"))},t.prototype.encodeString=function(e){var n=5,r=YV(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),e5(e,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(e,n){var r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)))},t.prototype.encodeBinary=function(e){var n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error("Too large binary: ".concat(n));var r=zh(e);this.writeU8a(r)},t.prototype.encodeArray=function(e,n){var r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error("Too large array: ".concat(r));for(var i=0,s=e;i<s.length;i++){var a=s[i];this.doEncode(a,n+1)}},t.prototype.countWithoutUndefined=function(e,n){for(var r=0,i=0,s=n;i<s.length;i++){var a=s[i];e[a]!==void 0&&r++}return r},t.prototype.encodeMap=function(e,n){var r=Object.keys(e);this.sortKeys&&r.sort();var i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error("Too large map object: ".concat(i));for(var s=0,a=r;s<a.length;s++){var o=a[s],u=e[o];this.ignoreUndefined&&u===void 0||(this.encodeString(o),this.doEncode(u,n+1))}},t.prototype.encodeExtension=function(e){var n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error("Too large extension object: ".concat(n));this.writeI8(e.type),this.writeU8a(e.data)},t.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},t.prototype.writeU8a=function(e){var n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n},t.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},t.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},t.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},t.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},t.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},t.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},t.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},t.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),o5(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),L0(this.view,this.pos,e),this.pos+=8},t.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},t.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},t}();function R5(t,e){var n=new E5(e);return n.encodeSharedRef(t)}function dv(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var T5=16,S5=16,$5=function(){function t(e,n){e===void 0&&(e=T5),n===void 0&&(n=S5),this.maxKeyLength=e,this.maxLengthPerKey=n,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},t.prototype.find=function(e,n,r){var i=this.caches[r-1];e:for(var s=0,a=i;s<a.length;s++){for(var o=a[s],u=o.bytes,c=0;c<r;c++)if(u[c]!==e[n+c])continue e;return o.str}return null},t.prototype.store=function(e,n){var r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)},t.prototype.decode=function(e,n,r){var i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;var s=F0(e,n,r),a=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(a,s),s},t}(),k5=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?s(l.value):i(l.value).then(o,u)}c((r=r.apply(t,e||[])).next())})},fv=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},z0=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(a){return new Promise(function(o,u){a=t[s](a),i(o,u,a.done,a.value)})}}function i(s,a,o,u){Promise.resolve(u).then(function(c){s({value:c,done:o})},a)}},Xa=function(t){return this instanceof Xa?(this.v=t,this):new Xa(t)},C5=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(h){return Promise.resolve(h).then(p,d)}}function o(p,h){r[p]&&(i[p]=function(w){return new Promise(function(D,g){s.push([p,w,D,g])>1||u(p,w)})},h&&(i[p]=h(i[p])))}function u(p,h){try{c(r[p](h))}catch(w){f(s[0][3],w)}}function c(p){p.value instanceof Xa?Promise.resolve(p.value.v).then(l,d):f(s[0][2],p)}function l(p){u("next",p)}function d(p){u("throw",p)}function f(p,h){p(h),s.shift(),s.length&&u(s[0][0],s[0][1])}},pv="array",ad="map_key",q0="map_value",A5=function(t){return typeof t=="string"||typeof t=="number"},_5=function(){function t(){this.stack=[],this.stackHeadPosition=-1}return Object.defineProperty(t.prototype,"length",{get:function(){return this.stackHeadPosition+1},enumerable:!1,configurable:!0}),t.prototype.top=function(){return this.stack[this.stackHeadPosition]},t.prototype.pushArrayState=function(e){var n=this.getUninitializedStateFromPool();n.type=pv,n.position=0,n.size=e,n.array=new Array(e)},t.prototype.pushMapState=function(e){var n=this.getUninitializedStateFromPool();n.type=ad,n.readCount=0,n.size=e,n.map={}},t.prototype.getUninitializedStateFromPool=function(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){var e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]},t.prototype.release=function(e){var n=this.stack[this.stackHeadPosition];if(n!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===pv){var r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===ad||e.type===q0){var r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--},t.prototype.reset=function(){this.stack.length=0,this.stackHeadPosition=-1},t}(),od=-1,hv=new DataView(new ArrayBuffer(0)),P5=new Uint8Array(hv.buffer);try{hv.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var mv=RangeError,j0=new mv("Insufficient data"),I5=new $5,x5=function(){function t(e){var n,r,i,s,a,o,u,c;this.totalPos=0,this.pos=0,this.view=hv,this.bytes=P5,this.headByte=od,this.stack=new _5,this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:B0.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.rawStrings=(i=e?.rawStrings)!==null&&i!==void 0?i:!1,this.maxStrLength=(s=e?.maxStrLength)!==null&&s!==void 0?s:sd,this.maxBinLength=(a=e?.maxBinLength)!==null&&a!==void 0?a:sd,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:sd,this.maxMapLength=(u=e?.maxMapLength)!==null&&u!==void 0?u:sd,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:sd,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:I5}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=od,this.stack.reset()},t.prototype.setBuffer=function(e){this.bytes=zh(e),this.view=v5(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===od&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=zh(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}},t.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},t.prototype.createExtraByteError=function(e){var n=this,r=n.view,i=n.pos;return new RangeError("Extra ".concat(r.byteLength-i," of ").concat(r.byteLength," byte(s) found at buffer[").concat(e,"]"))},t.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n},t.prototype.decodeMulti=function(e){return fv(this,function(n){switch(n.label){case 0:this.reinitializeState(),this.setBuffer(e),n.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})},t.prototype.decodeAsync=function(e){return k5(this,void 0,void 0,function(){var n,r,i,s,a,o,u,c,l,d,f,p,h,w,D;return fv(this,function(g){switch(g.label){case 0:n=!1,g.label=1;case 1:g.trys.push([1,6,7,12]),l=!0,d=z0(e),g.label=2;case 2:return[4,d.next()];case 3:if(f=g.sent(),p=f.done,!!p)return[3,5];if(D=f.value,l=!1,i=D,n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i);try{r=this.doDecodeSync(),n=!0}catch(v){if(!(v instanceof mv))throw v}this.totalPos+=this.pos,g.label=4;case 4:return l=!0,[3,2];case 5:return[3,12];case 6:return s=g.sent(),h={error:s},[3,12];case 7:return g.trys.push([7,,10,11]),!l&&!p&&(w=d.return)?[4,w.call(d)]:[3,9];case 8:g.sent(),g.label=9;case 9:return[3,11];case 10:if(h)throw h.error;return[7];case 11:return[7];case 12:if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,r]}throw a=this,o=a.headByte,u=a.pos,c=a.totalPos,new RangeError("Insufficient data in parsing ".concat(dv(o)," at ").concat(c," (").concat(u," in the current buffer)"))}})})},t.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},t.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},t.prototype.decodeMultiAsync=function(e,n){return C5(this,arguments,function(){var i,s,a,o,u,c,l,d,f,p,h,w;return fv(this,function(D){switch(D.label){case 0:i=n,s=-1,D.label=1;case 1:D.trys.push([1,13,14,19]),a=!0,o=z0(e),D.label=2;case 2:return[4,Xa(o.next())];case 3:if(u=D.sent(),f=u.done,!!f)return[3,12];if(w=u.value,a=!1,c=w,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(c),i&&(s=this.readArraySize(),i=!1,this.complete()),D.label=4;case 4:D.trys.push([4,9,,10]),D.label=5;case 5:return[4,Xa(this.doDecodeSync())];case 6:return[4,D.sent()];case 7:return D.sent(),--s===0?[3,8]:[3,5];case 8:return[3,10];case 9:if(l=D.sent(),!(l instanceof mv))throw l;return[3,10];case 10:this.totalPos+=this.pos,D.label=11;case 11:return a=!0,[3,2];case 12:return[3,19];case 13:return d=D.sent(),p={error:d},[3,19];case 14:return D.trys.push([14,,17,18]),!a&&!f&&(h=o.return)?[4,Xa(h.call(o))]:[3,16];case 15:D.sent(),D.label=16;case 16:return[3,18];case 17:if(p)throw p.error;return[7];case 18:return[7];case 19:return[2]}})})},t.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),n=void 0;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){var r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){var r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{var i=e-160;n=this.decodeString(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){var i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){var i=this.lookU16();n=this.decodeString(i,2)}else if(e===219){var i=this.lookU32();n=this.decodeString(i,4)}else if(e===220){var r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){var r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){var r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){var r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){var r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){var r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){var r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){var r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){var r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){var r=this.lookU32();n=this.decodeExtension(r,4)}else throw new kr("Unrecognized type byte: ".concat(dv(e)));this.complete();for(var s=this.stack;s.length>0;){var a=s.top();if(a.type===pv)if(a.array[a.position]=n,a.position++,a.position===a.size)n=a.array,s.release(a);else continue e;else if(a.type===ad){if(!A5(n))throw new kr("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new kr("The key __proto__ is not allowed");a.key=n,a.type=q0;continue e}else if(a.map[a.key]=n,a.readCount++,a.readCount===a.size)n=a.map,s.release(a);else{a.key=null,a.type=ad;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===od&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=od},t.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new kr("Unrecognized array type byte: ".concat(dv(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new kr("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new kr("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)},t.prototype.decodeString=function(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new kr("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw j0;var i=this.pos+n,s;return this.stateIsMapKey()&&(!((r=this.keyDecoder)===null||r===void 0)&&r.canBeCached(e))?s=this.keyDecoder.decode(this.bytes,i,e):s=s5(this.bytes,i,e),this.pos+=n+e,s},t.prototype.stateIsMapKey=function(){if(this.stack.length>0){var e=this.stack.top();return e.type===ad}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new kr("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw j0;var r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i},t.prototype.decodeExtension=function(e,n){if(e>this.maxExtLength)throw new kr("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},t.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},t.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},t.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},t.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},t.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},t.prototype.readU64=function(){var e=u5(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=M0(this.view,this.pos);return this.pos+=8,e},t.prototype.readU64AsBigInt=function(){var e=this.view.getBigUint64(this.pos);return this.pos+=8,e},t.prototype.readI64AsBigInt=function(){var e=this.view.getBigInt64(this.pos);return this.pos+=8,e},t.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},t.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},t}();function N5(t,e){var n=new x5(e);return n.decode(t)}const O5=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",F5=(t,e=0,n=t.byteLength-e)=>{if(!O5(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Dm.from(t,e,n)},U0=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Dm.from(t,e):Dm.from(t)},L5=/^[A-Za-z0-9+/]*={0,2}$/,M5=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!L5.exec(t))throw new TypeError("Invalid base64 string.");const e=U0(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},B5=t=>{const e=U0(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},z5=t=>{let e;if(typeof t=="string"?e=B5(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return F5(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:q5}=Wo;function j5({nodes:t,edges:e,...n}){return{...n,nodes:Ru(t,({x:r,y:i,width:s,height:a,isCompound:o,...u})=>({...u,b:[r,i,s,a],c:o})),edges:Ru(e,({points:r,controlPoints:i,labelBBox:s,dotpos:a,...o})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!a&&{dp:a},...o,p:r}))}}function U5({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:sx(n)?{direction:n}:n,nodes:Ru(t,({b:i,c:s,...a})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...a})),edges:Ru(e,({p:i,cp:s,l:a,dp:o,...u})=>({...!!s&&{controlPoints:s},...!!a&&{labelBBox:a},...!!o&&{dotpos:o},...u,points:i}))}}const G0=500;function G5(t){const e=R5(j5(t)),n=z5(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+G0,n.length))),i+=G0;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
|
|
244
|
-
`)}function W0(t){return t.includes("@likec4-generated")}function W5(t){if(!W0(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
|
|
245
|
-
`).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=M5(e);return U5(N5(n))}function gv(t){const e=_d(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!W0(e.text)))try{return W5(e.text)}catch(n){const r=q5(t);xe.warn(n),xe.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function H5(t){return class extends t{parseDeploymentView(e){const n=e.body;Se(n,"DynamicElementView body is not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+rd(this.doc.uri.toString(),i));const a=$r(r.find(d=>d.key==="title")?.value)??null,o=st(r.find(d=>d.key==="description")?.value)??null,u=this.convertTags(n),c=this.convertLinks(n);xh.writeId(e,s);const l=gv(e);return{__:"deployment",id:s,astPath:i,title:a,description:o,tags:u,links:Kn(c)?c:null,rules:n.rules.flatMap(d=>{try{return this.isValid(d)?this.parseDeploymentViewRule(d):[]}catch(f){return ye(f),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(ka(e))return this.parseDeploymentViewRulePredicate(e);if(Cl(e))return rv(e);if(vC(e))return this.parseDeploymentViewRuleStyle(e);Ie(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;if(Qt(i)&&this.isValid(i))switch(!0){case Z4(i):n.unshift(this.parseFqnExpr(i));break;case pC(i):n.unshift(this.parseRelationExpr(i));break;case kU(i):n.unshift(this.parseRelationWhereExpr(i));break;default:Ie(i)}}catch(i){ye(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=e.props.filter(cw),r=e.props.find(Ma),i=st(r?.value);return{targets:this.parseFqnExpressions(e.targets),...i&&{notation:i},style:{...Li(n,this.isValid)}}}}}function V5(t){let e;for(;e=t.value?.ref;){if(hn(e))return null;if(rr(e))return e;if(yt(t.parent))return null;t=t.parent}return null}const H0=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function V0(t){return!jC(t)&&!UC(t)?null:t.participant}function Ja(t){switch(!0){case cU(t):{const e=t.value?.ref?.name,n=V0(t);Se(e,"Expected tag name");const r={tag:H0(t,e)};return n?{participant:n,operator:r}:r}case oU(t):{const e=t.value?.ref?.name,n=V0(t);Se(e,"Expected kind name");const r={kind:H0(t,e)};return n?{participant:n,operator:r}:r}case(BC(t)||qC(t)):return{not:Ja(t.value)};case _U(t):{const e=Ja(t.left),n=Ja(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[Jb(e)?e.and:e,Jb(n)?n.and:n].flat();return Se(Kn(i),"Expected non-empty array"),{and:i}}case"or":{const i=[Xb(e)?e.or:e,Xb(n)?n.or:n].flat();return Se(Kn(i),"Expected non-empty array"),{or:i}}default:Ie(r)}}default:Ie(t)}}function K5(t){return class extends t{parseFqnRef(e){const n=sn(e.value.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(Nn(n)){const r=V5(e);if(!r)return{model:this.resolveFqn(n)};const i=this.resolveFqn(r),s=this.resolveFqn(n);return{deployment:i,element:s}}if(fC(n))return{deployment:this.resolveFqn(n)};Ie(n)}parseFqnExpr(e){if(Ns(e))return{wildcard:!0};if(bw(e))return this.parseFqnRefExpr(e);Ie(e)}parseFqnRefExpr(e){const n=this.parseFqnRef(e.ref);switch(!0){case e.selector==="._":return{ref:n,selector:"expanded"};case e.selector===".**":return{ref:n,selector:"descendants"};case e.selector===".*":return{ref:n,selector:"children"};default:return{ref:n}}}parseFqnExpressions(e){const n=[];let r=e;for(;r;){try{Qt(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){ye(i)}r=r.prev}return n.reverse()}parseRelationWhereExpr(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Ja(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationExpr(e){if(kw(e),fw(e))return{source:this.parseFqnExpr(e.source.from),target:this.parseFqnExpr(e.target),isBidirectional:e.source.isBidirectional};if(AC(e))return{inout:this.parseFqnExpr(e.inout.to)};if(Sw(e))return{outgoing:this.parseFqnExpr(e.from)};if(Ew(e))return{incoming:this.parseFqnExpr(e.to)};Ie(e)}}}function Y5(t){return class extends t{parseGlobals(){const{parseResult:e,c4Globals:n}=this.doc,r=this.isValid,i=e.value.globals.filter(r),s=i.flatMap(o=>o.predicates.filter(r));for(const o of s)try{const u=o.name;if(!ae(u))continue;if(u in n.predicates){xe.warn(`Global predicate named "${u}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(o,u,n)}catch(u){ye(u)}const a=i.flatMap(o=>o.styles.filter(r));for(const o of a)try{const u=o.id.name;if(!ae(u))continue;if(u in n.styles){xe.warn(`Global style named "${u}" is already defined`);continue}const c=this.parseGlobalStyleOrGroup(o);c.length>0&&(n.styles[u]=c)}catch(u){ye(u)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(Jp(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(Xp(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=i);return}Ie(e)}parseGlobalPredicateGroup(e){return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(Xc(e))return[this.parseViewRuleStyle(e)];if(Na(e))return e.styles.map(n=>this.parseViewRuleStyle(n));Ie(e)}}}function X5(t){return class extends t{parseModel(){const e=this.doc;for(const n of HH(e))try{if(Nn(n)){e.c4Elements.push(this.parseElement(n));continue}if(Rr(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}Ie(n)}catch(r){ye(r)}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=sn(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),a=e.body?.props.find(Ci)?.props,o=Li(a,n),u=this.getMetadata(e.body?.props.find(Sa)),c=this.getAstNodePath(e);let[l,d,f]=e.props??[];const p=Ye(e.body?.props??[],ze(n),ze(Uc),nr(D=>[D.key,D.value||void 0]));l=st(l??p.title),d=st(p.description??d),f=$r(p.technology??f);const h=this.parseLinks(e.body),w=e.body?.props.find(Er);if(w&&n(w)){const D=w.libicon?.ref?.name??w.value;ae(D)&&(o.icon=D)}return{id:r,kind:i,astPath:c,title:l??e.name,...u&&{metadata:u},...s&&{tags:s},...h&&Kn(h)&&{links:h},...ae(f)&&{technology:f},...ae(d)&&{description:d},style:o}}parseRelation(e){const n=this.isValid,r=KH(e),i=this.resolveFqn(r.target),s=this.resolveFqn(r.source),a=this.parseTags(e)??this.parseTags(e.body),o=this.parseLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Sa)),l=this.getAstNodePath(e),d=nr(e.body?.props.filter(El).filter(g=>Qt(g.value))??[],g=>[g.key,g.value]),f=Ye(e.body?.props??[],ze(yl),ln(g=>g.value.view.ref?.name),ze(ae),Da()),p=st(e.title??d.title)??"",h=st(d.description),w=$r(e.technology)??st(d.technology),D=e.body?.props.find(lh);return{id:rd(l,s,i),astPath:l,source:s,target:i,title:p,...c&&{metadata:c},...ae(w)&&{technology:w},...ae(h)&&{description:h},...u&&{kind:u},...a&&{tags:a},...Kn(o)&&{links:o},...nv(D?.props,n),...f&&{navigateTo:f}}}}}function J5(t){return class extends t{parsePredicate(e){if(Y4(e))return this.parseElementPredicate(e);if(tU(e))return this.parseRelationPredicate(e);Ie(e)}parseElementPredicate(e){if(jp(e))return this.parseElementPredicateWith(e);if(ww(e))return this.parseElementPredicateWhere(e);if(rw(e))return this.parseElementExpression(e);Ie(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{r.value&&n.unshift(this.parseElementExpression(r.value))}catch(i){ye(i)}r=r.prev}return n}parseElementExpression(e){if(Ns(e))return{wildcard:!0};if(qp(e))return Se(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(Up(e)){Se(e.tag?.ref,"ElementTagExpr tag is not resolved: "+e.$cstNode?.text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if(TC(e)){const n=gn(e.expand);return Se(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(yw(e)){const n=gn(e.parent);return Se(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isChildren:e.suffix===".*",isDescendants:e.suffix===".**"}}if(qc(e)){const n=gn(e);return Se(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Ie(e)}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpression(e.subject),condition:e.where?Ja(e.where):{kind:{neq:"--always-true--"}}}}}parseElementPredicateWith(e){const n=this.parseElementPredicate(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(sh(i)){const s=i.value.view.$refText;return ae(s)&&(r.custom.navigateTo=s),r}if(Uc(i))return Ht(i.value)&&(r.custom[i.key]=st(i.value)||""),r;if(Er(i)){const s=i.libicon?.ref?.name??i.value;return Ht(s)&&(r.custom[i.key]=s),r}if(_s(i)){const s=nd(i);return Ht(s)&&(r.custom[i.key]=s),r}if(dh(i)||$p(i))return Ht(i.value)&&(r.custom[i.key]=i.value),r;if(ah(i))return Ht(i.value)&&(r.custom[i.key]=y0(i)),r;if(Ma(i))return ae(i.value)&&(r.custom[i.key]=st(i.value)),r;if(Tw(i))return Iy(i.value)&&(r.custom[i.key]=i.value),r;Ie(i)},{custom:{expr:n}})}parseRelationPredicate(e){if(Cw(e)){let n=kw(e.subject)?this.parseRelationPredicateWhere(e.subject):this.parseRelationExpression(e.subject);return this.parseRelationPredicateWith(e,n)}if(kw(e))return this.parseRelationPredicateWhere(e);if(uw(e))return this.parseRelationExpression(e);Ie(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpression(e.subject),condition:e.where?Ja(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(El(i)||Ma(i)||xC(i))return Ht(i.value)&&(r.customRelation[i.key]=st(i.value)??""),r;if(Sc(i))return ae(i.value)&&(r.customRelation[i.key]=i.value),r;if(_s(i)){const s=nd(i);return ae(s)&&(r.customRelation[i.key]=s),r}if(sl(i))return ae(i.value)&&(r.customRelation[i.key]=i.value),r;if(yl(i)){const s=i.value.view.ref?.name;return ae(s)&&(r.customRelation.navigateTo=s),r}Ie(i)},{customRelation:{relation:n}})}parseRelationExpression(e){if(pw(e))return{source:this.parseElementExpression(e.source.from),target:this.parseElementExpression(e.target),isBidirectional:e.source.isBidirectional};if(Rw(e))return{inout:this.parseElementExpression(e.inout.to)};if($w(e))return{outgoing:this.parseElementExpression(e.from)};if(CC(e))return{incoming:this.parseElementExpression(e.to)};Ie(e)}}}function Q5(t){return class extends t{parseSpecification(){const{parseResult:{value:{specifications:e}},c4Specification:n}=this.doc,r=this.isValid,i=e.flatMap(c=>c.elements.filter(this.isValid));for(const{kind:c,props:l}of i)try{const d=c.name;if(!ae(d))continue;if(d in n.elements){xe.warn(`Element kind "${d}" is already defined`);continue}const f=l.find(Ci),p=Ye(l.filter(Aw)??[],ze(h=>this.isValid(h)&&Qt(h.value)),nr(h=>[h.key,st(h.value)]));n.elements[d]={...p,style:{...Li(f?.props,this.isValid)}}}catch(d){ye(d)}const s=e.flatMap(c=>c.relationships.filter(this.isValid));for(const{kind:c,props:l}of s)try{const d=c.name;if(!ae(d))continue;if(d in n.relationships){xe.warn(`Relationship kind "${d}" is already defined`);continue}const f=Ye(l.filter(OC)??[],ze(p=>this.isValid(p)&&Qt(p.value)),nr(p=>[p.key,st(p.value)]));n.relationships[d]={...f,...nv(l,this.isValid)}}catch(d){ye(d)}const a=e.flatMap(c=>c.tags.filter(this.isValid));for(const c of a){const l=c.tag.name;ae(l)&&n.tags.add(l)}const o=e.flatMap(c=>c.deploymentNodes.filter(r));for(const c of o)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(c))}catch(l){ye(l)}const u=e.flatMap(c=>c.colors.filter(r));for(const{name:c,color:l}of u)try{const d=c.name;if(d in n.colors){xe.warn(`Custom color "${d}" is already defined`);continue}n.colors[d]={color:l}}catch(d){ye(d)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ae(r))throw new Error("DeploymentNodeKind name is not resolved");const i=n.find(Ci),s=Ye(n.filter(Aw)??[],ze(a=>this.isValid(a)&&Qt(a.value)),nr(a=>[a.key,st(a.value)]));return{[r]:{...s,style:{...Li(i?.props,this.isValid)}}}}}}function Z5(t){return class extends t{parseViews(){const e=this.isValid;for(const n of this.doc.parseResult.value.views){const r=n.styles.flatMap(i=>{try{return e(i)?this.parseViewRuleStyleOrGlobalRef(i):[]}catch(s){return ye(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case Gp(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case bC(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case dw(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:Ie(i)}}catch(s){ye(s)}}}parseElementView(e,n){const r=e.body;Se(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const p=gn(e.viewOf),h=p&&this.resolveFqn(p);h?s=h:xe.warn("viewOf is not resolved: "+e.$cstNode?.text)}let a=e.name;a||(a="view_"+rd(this.doc.uri.toString(),i,s??""));const o=$r(r.props.find(p=>p.key==="title")?.value)??null,u=st(r.props.find(p=>p.key==="description")?.value)??null,c=this.convertTags(r),l=this.convertLinks(r),d=gv(e),f={__:"element",id:a,astPath:i,title:o,description:u,tags:c,links:Kn(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(p)?this.parseViewRule(p):[]}catch(h){return ye(h),[]}})],...s&&{viewOf:s},...d&&{manualLayout:d}};if(xh.writeId(e,f.id),"extends"in e){const p=e.extends.view.ref;return Se(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(f,{extends:p.name})}return f}parseViewRule(e){if(Ep(e))return this.parseViewRulePredicate(e);if(LC(e))return this.parseViewRuleGlobalPredicateRef(e);if(lw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(Cl(e))return rv(e);if(gh(e))return this.parseViewRuleGroup(e);Ie(e)}parseViewRulePredicate(e){const n=[];let r=e.predicates;for(;r;){const{value:i,prev:s}=r;try{ae(i)&&this.isValid(i)&&n.unshift(this.parsePredicate(i))}catch(a){ye(a)}if(!s)break;r=s}return eh(e)?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(xl(e))return this.parseViewRuleStyle(e);if(MC(e))return this.parseViewRuleGlobalStyle(e);Ie(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{if(!this.isValid(r))continue;if(Ep(r)){n.push(this.parseViewRulePredicate(r));continue}if(gh(r)){n.push(this.parseViewRuleGroup(r));continue}Ie(r)}catch(i){ye(i)}return{title:$r(e.title)??null,groupRules:n,...Li(e.props,this.isValid)}}parseViewRuleStyle(e){const n=e.props.filter(cw),r=e.target,i=e.props.find(Ma);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=Li(e,this.isValid),s=st(r?.value);return{targets:this.parseElementExpressionsIterator(n),...s&&{notation:s},style:{...i}}}parseViewRuleGlobalStyle(e){return{styleId:e.style.$refText}}parseDynamicElementView(e,n){const r=e.body;Se(r,"DynamicElementView body is not defined");const i=this.isValid,s=r.props.filter(i),a=this.getAstNodePath(e);let o=e.name;o||(o="dynamic_"+rd(this.doc.uri.toString(),a));const u=$r(s.find(p=>p.key==="title")?.value)??null,c=st(s.find(p=>p.key==="description")?.value)??null,l=this.convertTags(r),d=this.convertLinks(r);xh.writeId(e,o);const f=gv(e);return{__:"dynamic",id:o,astPath:a,title:u,description:c,tags:l,links:Kn(d)?d:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(h){return ye(h),[]}},[])],steps:r.steps.reduce((p,h)=>{try{i(h)&&(hw(h)?p.push(this.parseDynamicParallelSteps(h)):p.push(this.parseDynamicStep(h)))}catch(w){ye(w)}return p},[]),...f&&{manualLayout:f}}}parseDynamicViewRule(e){if(wU(e))return this.parseDynamicViewIncludePredicate(e);if(DC(e))return this.parseViewRuleGlobalPredicateRef(e);if(lw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(Cl(e))return rv(e);Ie(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.predicates;for(;r;){try{if(Qt(r.value)&&this.isValid(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){ye(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=gn(e.source);if(!n)throw new Error("Invalid reference to source");const r=gn(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const a=st(e.title)??null;let o={source:i,target:s,title:a};if(e.isBackward&&(o={source:s,target:i,title:a,isBackward:!0}),!Tj(e.custom?.props))return o;for(const u of e.custom.props)try{switch(!0){case yl(u):{const c=u.value.view.ref?.name;ae(c)&&(o.navigateTo=c);break}case El(u):case Ma(u):case xC(u):{Ht(u.value)&&(o[u.key]=st(u.value)??"");break}case Sc(u):{Ht(u.value)&&(o[u.key]=u.value);break}case _s(u):{const c=nd(u);Ht(c)&&(o[u.key]=c);break}case sl(u):{Ht(u.value)&&(o[u.key]=u.value);break}default:Ie(u)}}catch(c){ye(c)}return o}}}const eK=Ye(VV,K5,X5,KV,H5,J5,Q5,Z5,Y5);class tK extends eK{}class nK{constructor(e){this.services=e,this.cachedParsers=new CS(e.shared,Be.Validated)}cachedParsers;parse(e){Se(tv(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`);try{e=Object.assign(e,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{},deployments:{}},c4Elements:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[]});const n=this.forDocument(e);return n.parseSpecification(),n.parseModel(),n.parseGlobals(),n.parseDeployment(),n.parseViews(),n.doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return Se(tv(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`),this.cachedParsers.get(e.uri,"DocumentParser",()=>new tK(this.services,e))}}const{findNodeForKeyword:rK,findNodeForProperty:Sae}=Yd,iK=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...np(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},sK=(t,e)=>n=>{if(!xl(n))return!1;const r=n.target.value;if(!r||ae(n.target.prev)||!qc(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function aK(t,{view:e,viewAst:n,targets:r,style:i}){Se(n.body,`View ${e.id} has no body`);const s=n.$cstNode;Se(s,"viewCstNode");const a=Tu(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;Se(a,"insertPos is not defined");const o=s.range.start.character+2,u=t.likec4.FqnIndex,c=ze(n.body.rules,xl),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(D=>{const g=r$(c,sK(D,u)),v=l&&wm(l,D)?D.substring(l.length+1):D;g?d.push({fqn:v,rule:g}):f.push({fqn:v})});const p={start:a,end:a},h=D=>{D.start.line<=p.start.line&&(D.start.line==p.start.line?p.start.character=Math.min(D.start.character,p.start.character):p.start=D.start),D.end.line>=p.end.line&&(D.end.line==p.end.line?p.end.character=Math.max(D.end.character,p.end.character):p.end=D.end)},w=[];if(f.length>0){const D=f.flatMap(({fqn:g})=>iK(g,i,o));w.push(Tn.insert(a,`
|
|
246
|
-
`+D.join(`
|
|
247
|
-
`))),p.start={line:a.line+1,character:o},p.end={line:a.line+D.length,character:Tu(D)?.length??0}}if(d.length>0)for(const{rule:D}of d){const g=D.$cstNode;Se(g,"RuleCstNode not found");for(const[v,R]of np(i)){const k=v==="opacity"?R.toString()+"%":R,A=D.props.find(J=>J.key===v);if(A&&A.$cstNode){const{range:{start:J,end:de}}=A.$cstNode;h({start:J,end:de}),w.push(Tn.replace({start:J,end:de},v+" "+k));continue}const j=rK(g,"{")?.range.end;Se(j,"Opening brace not found");const W=" ".repeat(2+g.range.start.character),Z=W+v+" "+k;w.push(Tn.insert(j,`
|
|
248
|
-
`+Z)),h({start:{line:j.line+1,character:W.length},end:{line:j.line+1,character:Z.length}})}}return{modifiedRange:p,edits:w}}const{findNodeForProperty:$ae,findNodeForKeyword:oK}=Yd;function uK(t,{view:e,viewAst:n,layout:r}){Se(n.body,`View ${e.id} has no body`);const i=n.$cstNode;Se(i,"viewCstNode");const s=XH(r.direction),a=r$(n.body.rules,Cl);let o=`autoLayout ${s}`;if(ep(r.rankSep)&&(o+=` ${r.rankSep}`,ep(r.nodeSep)&&(o+=` ${r.nodeSep}`)),a&&a.$cstNode)return Tn.replace(a.$cstNode.range,o);const u=oK(n.body.$cstNode,"}")?.range.start;Se(u,"Closing brace not found");const c=` ${o}
|
|
249
|
-
`;return Tn.insert(u,c)}function cK(t,e=1,n={}){const{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function lK(t,{viewAst:e,layout:n}){Se(e.$cstNode,"invalid view.$cstNode");const r=_d(e.$cstNode,["BLOCK_COMMENT"]);let i=G5(n);return e.$cstNode.range.start.character>0&&(i=cK(i,e.$cstNode.range.start.character)),r?Tn.replace(r.range,i.trimStart()):Tn.insert({line:e.$cstNode.range.start.line,character:0},i+`
|
|
250
|
-
`)}class dK{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;Se(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:a}=this.convertToTextEdit(e),o={uri:i.textDocument.uri,version:i.textDocument.version};if(!s.length)return;const u=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{[o.uri]:s}}});if(!u.applied){n.window.showErrorMessage(`Failed to apply changes ${u.failureReason}`);return}r={uri:o.uri,range:a}})}catch(i){Mt.error(`Failed to apply change ${e.change.op} ${e.viewId}`,i)}return r}convertToTextEdit({viewId:e,change:n}){const r=this.locator.locateViewAst(e);if(!r)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(n.op){case"change-element-style":return{doc:r.doc,...aK(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=uK(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=lK(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Ie(n)}}}class fK extends ES{constructor(e){super(),this.services=e}getNameStrict(e){return sn(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(Kf(e))return e.name;if(rr(e))return e.element.el.$refText}getNameNode(e){if(Kf(e))return super.getNameNode(e);if(rr(e))return e.element.el.$refNode}}function pK(t){return Ye(t,vs(e=>`${e.type}.${e.name}`),np(),Di(([e,n])=>n.length===1?n:[]))}class hK extends TS{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:a,globals:o,likec4lib:u,deployments:c}=e.parseResult.value;this.exportLibrary(u,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(a,r,e),this.exportGlobals(o,r,e),this.exportDeployments(c,r,e)}catch(i){ye(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(yt(i)||i.length===0))for(const s of i)try{ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(a){ye(a)}}exportGlobals(e,n,r){if(!(yt(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ye(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ye(s)}}}exportModel(e,n,r){if(!(yt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{Nn(i)&&ae(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){ye(s)}}exportLibrary(e,n,r){if(!yt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){ye(i)}}exportSpecification(e,n,r){if(!(yt(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.deploymentNodes,...s.tags,...s.colors]))try{switch(!0){case za(i):case ja(i):{ae(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case hh(i):{ae(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case Ga(i):{ae(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.kind,"."+i.kind.name,r));continue}case ph(i):{ae(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Ie(i)}}catch(s){ye(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(yt(i)||i.length===0))for(const s of i)try{hn(s)&&ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(a){ye(a)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],a=new Pn;for(const o of i.models)try{s.push(...this.processContainer(o,a,e))}catch(u){ye(u)}for(const o of i.deployments)try{s.push(...this.processDeployments(o,a,e))}catch(u){ye(u)}pK(s).forEach(o=>{a.add(i,o)}),r(a)})}processContainer(e,n,r){const i=new Pn,s=[];for(const o of e.elements){if(Rr(o))continue;let u;if(Nn(o)?(ae(o.name)&&i.add(o.name,this.descriptions.createDescription(o,o.name,r)),u=o.body):_a(o)&&(u=o.body),u&&u.elements.length>0)try{s.push(...this.processContainer(u,n,r))}catch(c){ye(c)}}s.length&&Ye(s,ze(o=>!i.has(o.name)),vs(o=>o.name),tp((o,u)=>{o.length===1&&i.add(u,o[0])}));const a=[...i.values()];return n.addAll(e,a),a}processDeployments(e,n,r){const i=new Set,s=[];for(const a of e.elements){if(ki(a))continue;let o=this.nameProvider.getName(a);if(ae(o)){const u=this.descriptions.createDescription(a,o,r);n.add(e,u),i.add(u.name)}if(hn(a)&&a.body)try{s.push(...this.processDeployments(a.body,n,r))}catch(u){ye(u)}}return s.length>0&&Ye(s,ze(a=>!i.has(a.name)),vs(a=>a.name),tp((a,o)=>{a.length===1&&n.add(e,a[0])})),[...n.get(e).values()]}}const{getDocument:mK}=Wo;class gK extends _S{deploymentsIndex;fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Pt(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():Kt)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return et([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>gn(e)))}scopeElementView({viewOf:e,extends:n}){return e?et([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>gn(e))):n?et([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):ta}):ta}getScope(e){try{const n=this.reflection.getReferenceType(e);try{const r=e.container;if(kC(r))return this.getScopeForFqnRef(r,e);if(n!==Wn)return this.getGlobalScope(n,e);if($C(r)&&e.property==="el"){const i=r.parent;return i?new ms(this.directChildrenOf(Ih(i))):this.getGlobalScope(n,e)}if(qc(r)&&e.property==="el"){const i=r.parent;if(i)return new ms(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=Xt(r,Nn);return s?new SS([this.descriptions.createDescription(s,e.reference.$refText)]):Yf}}return this.computeScope(e)}catch(r){return xe.warn(r),this.getGlobalScope(n,e)}}catch(n){return xe.warn(n),Yf}}getScopeForFqnRef(e,n){const r=e.parent;if(!r)return this.createScope(this.computeScope(n,Si).getAllElements(),this.createScope(this.computeScope(n,Ti).getAllElements(),pi(e,dw)?this.computeScope(n,Wn):Yf));const i=r.value.ref;return i?hn(i)?new ms(this.deploymentsIndex.nested(i)):rr(i)?new ms(this.scopeElementRef(i.element)):Nn(i)?new ms(this.uniqueDescedants(()=>i)):Ie(i):Yf}computeScope(e,n=this.reflection.getReferenceType(e)){const r=this.reflection.isSubtype(n,Wn),i=[],s=mK(e.container).precomputedScopes;if(!s)return this.getGlobalScope(n,e);const a=u=>this.reflection.isSubtype(u.type,n);let o=e.container;for(;o;){const u=s.get(o).filter(a);u.length>0&&i.push(et(u)),r&&SC(o)&&i.push(this.scopeExtendElement(o.$container)),r&&RC(o)&&i.push(this.scopeElementView(o.$container)),o=o.$container}return i.reduceRight((u,c)=>this.createScope(c,u),this.getGlobalScope(n,e))}}const yK=`likec4lib { icons {
|
|
251
|
-
aws:activate
|
|
252
|
-
aws:alexa-for-business
|
|
253
|
-
aws:amplify
|
|
254
|
-
aws:apache-mxnet-on-aws
|
|
255
|
-
aws:api-gateway
|
|
256
|
-
aws:app-config
|
|
257
|
-
aws:app-flow
|
|
258
|
-
aws:app-mesh
|
|
259
|
-
aws:app-runner
|
|
260
|
-
aws:app-stream
|
|
261
|
-
aws:app-sync
|
|
262
|
-
aws:application-auto-scaling
|
|
263
|
-
aws:application-composer
|
|
264
|
-
aws:application-cost-profiler
|
|
265
|
-
aws:application-discovery-service
|
|
266
|
-
aws:application-migration-service
|
|
267
|
-
aws:artifact
|
|
268
|
-
aws:athena
|
|
269
|
-
aws:audit-manager
|
|
270
|
-
aws:augmented-ai-a2i
|
|
271
|
-
aws:aurora
|
|
272
|
-
aws:auto-scaling
|
|
273
|
-
aws:backint-agent
|
|
274
|
-
aws:backup
|
|
275
|
-
aws:batch
|
|
276
|
-
aws:billing-conductor
|
|
277
|
-
aws:bottlerocket
|
|
278
|
-
aws:braket
|
|
279
|
-
aws:budgets
|
|
280
|
-
aws:certificate-manager
|
|
281
|
-
aws:chatbot
|
|
282
|
-
aws:chime
|
|
283
|
-
aws:chime-sdk
|
|
284
|
-
aws:chime-voice-connector
|
|
285
|
-
aws:clean-rooms
|
|
286
|
-
aws:client-vpn
|
|
287
|
-
aws:cloud-control-api
|
|
288
|
-
aws:cloud-development-kit
|
|
289
|
-
aws:cloud-directory
|
|
290
|
-
aws:cloud-formation
|
|
291
|
-
aws:cloud-front
|
|
292
|
-
aws:cloud-hsm
|
|
293
|
-
aws:cloud-map
|
|
294
|
-
aws:cloud-search
|
|
295
|
-
aws:cloud-shell
|
|
296
|
-
aws:cloud-trail
|
|
297
|
-
aws:cloud-wan
|
|
298
|
-
aws:cloud-watch
|
|
299
|
-
aws:cloud9
|
|
300
|
-
aws:code-artifact
|
|
301
|
-
aws:code-build
|
|
302
|
-
aws:code-catalyst
|
|
303
|
-
aws:code-commit
|
|
304
|
-
aws:code-deploy
|
|
305
|
-
aws:code-guru
|
|
306
|
-
aws:code-pipeline
|
|
307
|
-
aws:code-star
|
|
308
|
-
aws:code-whisperer
|
|
309
|
-
aws:cognito
|
|
310
|
-
aws:command-line-interface
|
|
311
|
-
aws:comprehend
|
|
312
|
-
aws:comprehend-medical
|
|
313
|
-
aws:compute-optimizer
|
|
314
|
-
aws:config
|
|
315
|
-
aws:connect
|
|
316
|
-
aws:console-mobile-application
|
|
317
|
-
aws:control-tower
|
|
318
|
-
aws:corretto
|
|
319
|
-
aws:cost-and-usage-report
|
|
320
|
-
aws:cost-explorer
|
|
321
|
-
aws:data-exchange
|
|
322
|
-
aws:data-pipeline
|
|
323
|
-
aws:data-sync
|
|
324
|
-
aws:data-zone
|
|
325
|
-
aws:database-migration-service
|
|
326
|
-
aws:deep-composer
|
|
327
|
-
aws:deep-learning-amis
|
|
328
|
-
aws:deep-learning-containers
|
|
329
|
-
aws:deep-lens
|
|
330
|
-
aws:deep-racer
|
|
331
|
-
aws:detective
|
|
332
|
-
aws:dev-ops-guru
|
|
333
|
-
aws:device-farm
|
|
334
|
-
aws:direct-connect
|
|
335
|
-
aws:directory-service
|
|
336
|
-
aws:distro-for-open-telemetry
|
|
337
|
-
aws:document-db
|
|
338
|
-
aws:dynamo-db
|
|
339
|
-
aws:ec2
|
|
340
|
-
aws:ec2-auto-scaling
|
|
341
|
-
aws:ec2-image-builder
|
|
342
|
-
aws:ecs-anywhere
|
|
343
|
-
aws:efs
|
|
344
|
-
aws:eks-anywhere
|
|
345
|
-
aws:eks-cloud
|
|
346
|
-
aws:eks-distro
|
|
347
|
-
aws:elasti-cache
|
|
348
|
-
aws:elastic-beanstalk
|
|
349
|
-
aws:elastic-block-store
|
|
350
|
-
aws:elastic-container-registry
|
|
351
|
-
aws:elastic-container-service
|
|
352
|
-
aws:elastic-disaster-recovery
|
|
353
|
-
aws:elastic-fabric-adapter
|
|
354
|
-
aws:elastic-inference
|
|
355
|
-
aws:elastic-kubernetes-service
|
|
356
|
-
aws:elastic-load-balancing
|
|
357
|
-
aws:elastic-transcoder
|
|
358
|
-
aws:elemental-appliances-software
|
|
359
|
-
aws:elemental-conductor
|
|
360
|
-
aws:elemental-delta
|
|
361
|
-
aws:elemental-link
|
|
362
|
-
aws:elemental-live
|
|
363
|
-
aws:elemental-media-connect
|
|
364
|
-
aws:elemental-media-convert
|
|
365
|
-
aws:elemental-media-live
|
|
366
|
-
aws:elemental-media-package
|
|
367
|
-
aws:elemental-media-store
|
|
368
|
-
aws:elemental-media-tailor
|
|
369
|
-
aws:elemental-server
|
|
370
|
-
aws:emr
|
|
371
|
-
aws:event-bridge
|
|
372
|
-
aws:express-workflows
|
|
373
|
-
aws:fargate
|
|
374
|
-
aws:fault-injection-simulator
|
|
375
|
-
aws:file-cache
|
|
376
|
-
aws:fin-space
|
|
377
|
-
aws:firewall-manager
|
|
378
|
-
aws:forecast
|
|
379
|
-
aws:fraud-detector
|
|
380
|
-
aws:free-rtos
|
|
381
|
-
aws:fsx
|
|
382
|
-
aws:fsx-for-lustre
|
|
383
|
-
aws:fsx-for-net-app-ontap
|
|
384
|
-
aws:fsx-for-open-zfs
|
|
385
|
-
aws:fsx-for-wfs
|
|
386
|
-
aws:game-kit
|
|
387
|
-
aws:game-lift
|
|
388
|
-
aws:game-sparks
|
|
389
|
-
aws:genomics-cli
|
|
390
|
-
aws:global-accelerator
|
|
391
|
-
aws:glue
|
|
392
|
-
aws:glue-data-brew
|
|
393
|
-
aws:glue-elastic-views
|
|
394
|
-
aws:ground-station
|
|
395
|
-
aws:guard-duty
|
|
396
|
-
aws:health-lake
|
|
397
|
-
aws:honeycode
|
|
398
|
-
aws:iam-identity-center
|
|
399
|
-
aws:identity-and-access-management
|
|
400
|
-
aws:inspector
|
|
401
|
-
aws:interactive-video-service
|
|
402
|
-
aws:io-t-1-click
|
|
403
|
-
aws:io-t-analytics
|
|
404
|
-
aws:io-t-button
|
|
405
|
-
aws:io-t-core
|
|
406
|
-
aws:io-t-device-defender
|
|
407
|
-
aws:io-t-device-management
|
|
408
|
-
aws:io-t-edu-kit
|
|
409
|
-
aws:io-t-events
|
|
410
|
-
aws:io-t-express-link
|
|
411
|
-
aws:io-t-fleet-wise
|
|
412
|
-
aws:io-t-greengrass
|
|
413
|
-
aws:io-t-robo-runner
|
|
414
|
-
aws:io-t-site-wise
|
|
415
|
-
aws:io-t-things-graph
|
|
416
|
-
aws:io-t-twin-maker
|
|
417
|
-
aws:iq
|
|
418
|
-
aws:kendra
|
|
419
|
-
aws:key-management-service
|
|
420
|
-
aws:keyspaces
|
|
421
|
-
aws:kinesis
|
|
422
|
-
aws:kinesis-data-analytics
|
|
423
|
-
aws:kinesis-data-streams
|
|
424
|
-
aws:kinesis-firehose
|
|
425
|
-
aws:kinesis-video-streams
|
|
426
|
-
aws:lake-formation
|
|
427
|
-
aws:lambda
|
|
428
|
-
aws:launch-wizard
|
|
429
|
-
aws:lex
|
|
430
|
-
aws:license-manager
|
|
431
|
-
aws:lightsail
|
|
432
|
-
aws:local-zones
|
|
433
|
-
aws:location-service
|
|
434
|
-
aws:lookout-for-equipment
|
|
435
|
-
aws:lookout-for-metrics
|
|
436
|
-
aws:lookout-for-vision
|
|
437
|
-
aws:lumberyard
|
|
438
|
-
aws:macie
|
|
439
|
-
aws:mainframe-modernization
|
|
440
|
-
aws:managed-blockchain
|
|
441
|
-
aws:managed-grafana
|
|
442
|
-
aws:managed-service-for-prometheus
|
|
443
|
-
aws:managed-services
|
|
444
|
-
aws:managed-streaming-for-apache-kafka
|
|
445
|
-
aws:managed-workflows-for-apache-airflow
|
|
446
|
-
aws:management-console
|
|
447
|
-
aws:marketplace-dark
|
|
448
|
-
aws:marketplace-light
|
|
449
|
-
aws:memory-db-for-redis
|
|
450
|
-
aws:migration-evaluator
|
|
451
|
-
aws:migration-hub
|
|
452
|
-
aws:monitron
|
|
453
|
-
aws:mq
|
|
454
|
-
aws:neptune
|
|
455
|
-
aws:network-firewall
|
|
456
|
-
aws:neuron
|
|
457
|
-
aws:nice-dcv
|
|
458
|
-
aws:nice-engin-frame
|
|
459
|
-
aws:nimble-studio
|
|
460
|
-
aws:nitro-enclaves
|
|
461
|
-
aws:omics
|
|
462
|
-
aws:open-3d-engine
|
|
463
|
-
aws:open-search-service
|
|
464
|
-
aws:ops-works
|
|
465
|
-
aws:organizations
|
|
466
|
-
aws:outposts-family
|
|
467
|
-
aws:outposts-rack
|
|
468
|
-
aws:outposts-servers
|
|
469
|
-
aws:panorama
|
|
470
|
-
aws:parallel-cluster
|
|
471
|
-
aws:personal-health-dashboard
|
|
472
|
-
aws:personalize
|
|
473
|
-
aws:pinpoint
|
|
474
|
-
aws:pinpoint-apis
|
|
475
|
-
aws:polly
|
|
476
|
-
aws:private-5g
|
|
477
|
-
aws:private-certificate-authority
|
|
478
|
-
aws:private-link
|
|
479
|
-
aws:professional-services
|
|
480
|
-
aws:proton
|
|
481
|
-
aws:quantum-ledger-database
|
|
482
|
-
aws:quick-sight
|
|
483
|
-
aws:rds
|
|
484
|
-
aws:rds-on-vmware
|
|
485
|
-
aws:re-post
|
|
486
|
-
aws:red-hat-open-shift-service-on-aws
|
|
487
|
-
aws:redshift
|
|
488
|
-
aws:rekognition
|
|
489
|
-
aws:reserved-instance-reporting
|
|
490
|
-
aws:resilience-hub
|
|
491
|
-
aws:resource-access-manager
|
|
492
|
-
aws:resource-explorer
|
|
493
|
-
aws:robo-maker
|
|
494
|
-
aws:route-53
|
|
495
|
-
aws:s3-on-outposts
|
|
496
|
-
aws:sage-maker
|
|
497
|
-
aws:sage-maker-ground-truth
|
|
498
|
-
aws:sage-maker-studio-lab
|
|
499
|
-
aws:savings-plans
|
|
500
|
-
aws:secrets-manager
|
|
501
|
-
aws:security-hub
|
|
502
|
-
aws:security-lake
|
|
503
|
-
aws:server-migration-service
|
|
504
|
-
aws:serverless-application-repository
|
|
505
|
-
aws:service-catalog
|
|
506
|
-
aws:service-management-connector
|
|
507
|
-
aws:shield
|
|
508
|
-
aws:signer
|
|
509
|
-
aws:sim-space-weaver
|
|
510
|
-
aws:simple-email-service
|
|
511
|
-
aws:simple-notification-service
|
|
512
|
-
aws:simple-queue-service
|
|
513
|
-
aws:simple-storage-service
|
|
514
|
-
aws:simple-storage-service-glacier
|
|
515
|
-
aws:site-to-site-vpn
|
|
516
|
-
aws:snowball
|
|
517
|
-
aws:snowball-edge
|
|
518
|
-
aws:snowcone
|
|
519
|
-
aws:snowmobile
|
|
520
|
-
aws:step-functions
|
|
521
|
-
aws:storage-gateway
|
|
522
|
-
aws:sumerian
|
|
523
|
-
aws:supply-chain
|
|
524
|
-
aws:support
|
|
525
|
-
aws:systems-manager
|
|
526
|
-
aws:tensor-flow-on-aws
|
|
527
|
-
aws:textract
|
|
528
|
-
aws:thinkbox-deadline
|
|
529
|
-
aws:thinkbox-frost
|
|
530
|
-
aws:thinkbox-krakatoa
|
|
531
|
-
aws:thinkbox-sequoia
|
|
532
|
-
aws:thinkbox-stoke
|
|
533
|
-
aws:thinkbox-xmesh
|
|
534
|
-
aws:timestream
|
|
535
|
-
aws:tools-and-sdks
|
|
536
|
-
aws:torch-serve
|
|
537
|
-
aws:training-certification
|
|
538
|
-
aws:transcribe
|
|
539
|
-
aws:transfer-family
|
|
540
|
-
aws:transit-gateway
|
|
541
|
-
aws:translate
|
|
542
|
-
aws:trusted-advisor
|
|
543
|
-
aws:verified-access
|
|
544
|
-
aws:verified-permissions
|
|
545
|
-
aws:virtual-private-cloud
|
|
546
|
-
aws:vmware-cloud-on-aws
|
|
547
|
-
aws:vpc-lattice
|
|
548
|
-
aws:waf
|
|
549
|
-
aws:wavelength
|
|
550
|
-
aws:well-architected-tool
|
|
551
|
-
aws:wickr
|
|
552
|
-
aws:work-docs
|
|
553
|
-
aws:work-docs-sdk
|
|
554
|
-
aws:work-link
|
|
555
|
-
aws:work-mail
|
|
556
|
-
aws:work-spaces-family
|
|
557
|
-
aws:x-ray
|
|
558
|
-
azure:abs-member
|
|
559
|
-
azure:active-directory-connect-health
|
|
560
|
-
azure:activity-log
|
|
561
|
-
azure:administrative-units
|
|
562
|
-
azure:advisor
|
|
563
|
-
azure:ai-studio
|
|
564
|
-
azure:aks-automatic
|
|
565
|
-
azure:aks-istio
|
|
566
|
-
azure:alerts
|
|
567
|
-
azure:all-resources
|
|
568
|
-
azure:analysis-services
|
|
569
|
-
azure:anomaly-detector
|
|
570
|
-
azure:api-center
|
|
571
|
-
azure:api-connections
|
|
572
|
-
azure:api-management-services
|
|
573
|
-
azure:api-proxy
|
|
574
|
-
azure:app-compliance-automation
|
|
575
|
-
azure:app-configuration
|
|
576
|
-
azure:app-registrations
|
|
577
|
-
azure:app-service-certificates
|
|
578
|
-
azure:app-service-domains
|
|
579
|
-
azure:app-service-environments
|
|
580
|
-
azure:app-service-plans
|
|
581
|
-
azure:app-services
|
|
582
|
-
azure:app-space
|
|
583
|
-
azure:app-space-component
|
|
584
|
-
azure:applens
|
|
585
|
-
azure:application-gateway-containers
|
|
586
|
-
azure:application-gateways
|
|
587
|
-
azure:application-group
|
|
588
|
-
azure:application-insights
|
|
589
|
-
azure:application-security-groups
|
|
590
|
-
azure:aquila
|
|
591
|
-
azure:arc-data-services
|
|
592
|
-
azure:arc-kubernetes
|
|
593
|
-
azure:arc-machines
|
|
594
|
-
azure:arc-sql-managed-instance
|
|
595
|
-
azure:arc-sql-server
|
|
596
|
-
azure:atm-multistack
|
|
597
|
-
azure:auto-scale
|
|
598
|
-
azure:automanaged-vm
|
|
599
|
-
azure:automation-accounts
|
|
600
|
-
azure:availability-sets
|
|
601
|
-
azure:avs-vm
|
|
602
|
-
azure:azure-a
|
|
603
|
-
azure:azure-ad-b2c
|
|
604
|
-
azure:azure-api-for-fhir
|
|
605
|
-
azure:azure-applied-ai-services
|
|
606
|
-
azure:azure-arc
|
|
607
|
-
azure:azure-attestation
|
|
608
|
-
azure:azure-backup-center
|
|
609
|
-
azure:azure-blockchain-service
|
|
610
|
-
azure:azure-center-for-sap
|
|
611
|
-
azure:azure-chaos-studio
|
|
612
|
-
azure:azure-cloud-shell
|
|
613
|
-
azure:azure-communication-services
|
|
614
|
-
azure:azure-communications-gateway
|
|
615
|
-
azure:azure-compute-galleries
|
|
616
|
-
azure:azure-cosmos-db
|
|
617
|
-
azure:azure-data-catalog
|
|
618
|
-
azure:azure-data-explorer-clusters
|
|
619
|
-
azure:azure-database-maria-db-server
|
|
620
|
-
azure:azure-database-migration-services
|
|
621
|
-
azure:azure-database-my-sql-server
|
|
622
|
-
azure:azure-database-postgre-sql-server
|
|
623
|
-
azure:azure-database-postgre-sql-server-group
|
|
624
|
-
azure:azure-databox-gateway
|
|
625
|
-
azure:azure-databricks
|
|
626
|
-
azure:azure-deployment-environments
|
|
627
|
-
azure:azure-dev-ops
|
|
628
|
-
azure:azure-dev-tunnels
|
|
629
|
-
azure:azure-edge-hardware-center
|
|
630
|
-
azure:azure-experimentation-studio
|
|
631
|
-
azure:azure-fileshares
|
|
632
|
-
azure:azure-firewall-manager
|
|
633
|
-
azure:azure-firewall-policy
|
|
634
|
-
azure:azure-hcp-cache
|
|
635
|
-
azure:azure-hpc-workbenches
|
|
636
|
-
azure:azure-hybrid-center
|
|
637
|
-
azure:azure-information-protection
|
|
638
|
-
azure:azure-io-t-operations
|
|
639
|
-
azure:azure-lighthouse
|
|
640
|
-
azure:azure-load-testing
|
|
641
|
-
azure:azure-managed-grafana
|
|
642
|
-
azure:azure-maps-accounts
|
|
643
|
-
azure:azure-media-service
|
|
644
|
-
azure:azure-migrate
|
|
645
|
-
azure:azure-monitor-dashboard
|
|
646
|
-
azure:azure-monitor-pipeline
|
|
647
|
-
azure:azure-monitors-for-sap-solutions
|
|
648
|
-
azure:azure-net-app-files
|
|
649
|
-
azure:azure-network-function-manager
|
|
650
|
-
azure:azure-network-function-manager-functions
|
|
651
|
-
azure:azure-object-understanding
|
|
652
|
-
azure:azure-open-ai
|
|
653
|
-
azure:azure-operator-5g-core
|
|
654
|
-
azure:azure-operator-insights
|
|
655
|
-
azure:azure-operator-nexus
|
|
656
|
-
azure:azure-operator-service-manager
|
|
657
|
-
azure:azure-orbital
|
|
658
|
-
azure:azure-programmable-connectivity
|
|
659
|
-
azure:azure-purview-accounts
|
|
660
|
-
azure:azure-quotas
|
|
661
|
-
azure:azure-red-hat-open-shift
|
|
662
|
-
azure:azure-sentinel
|
|
663
|
-
azure:azure-service-bus
|
|
664
|
-
azure:azure-sphere
|
|
665
|
-
azure:azure-spring-apps
|
|
666
|
-
azure:azure-sql
|
|
667
|
-
azure:azure-sql-edge
|
|
668
|
-
azure:azure-sql-server-stretch-databases
|
|
669
|
-
azure:azure-sql-vm
|
|
670
|
-
azure:azure-stack
|
|
671
|
-
azure:azure-stack-edge
|
|
672
|
-
azure:azure-stack-hci-sizer
|
|
673
|
-
azure:azure-storage-mover
|
|
674
|
-
azure:azure-support-center-blue
|
|
675
|
-
azure:azure-sustainability
|
|
676
|
-
azure:azure-synapse-analytics
|
|
677
|
-
azure:azure-token-service
|
|
678
|
-
azure:azure-video-indexer
|
|
679
|
-
azure:azure-virtual-desktop
|
|
680
|
-
azure:azure-vmware-solution
|
|
681
|
-
azure:azure-workbooks
|
|
682
|
-
azure:azurite
|
|
683
|
-
azure:backlog
|
|
684
|
-
azure:backup-vault
|
|
685
|
-
azure:bare-metal-infrastructure
|
|
686
|
-
azure:bastions
|
|
687
|
-
azure:batch-accounts
|
|
688
|
-
azure:batch-ai
|
|
689
|
-
azure:biz-talk
|
|
690
|
-
azure:blob-block
|
|
691
|
-
azure:blob-page
|
|
692
|
-
azure:blockchain-applications
|
|
693
|
-
azure:blueprints
|
|
694
|
-
azure:bonsai
|
|
695
|
-
azure:bot-services
|
|
696
|
-
azure:branch
|
|
697
|
-
azure:browser
|
|
698
|
-
azure:bug
|
|
699
|
-
azure:builds
|
|
700
|
-
azure:business-process-tracking
|
|
701
|
-
azure:cache
|
|
702
|
-
azure:cache-redis
|
|
703
|
-
azure:capacity
|
|
704
|
-
azure:capacity-reservation-groups
|
|
705
|
-
azure:cdn-profiles
|
|
706
|
-
azure:central-service-instance-for-sap
|
|
707
|
-
azure:ceres
|
|
708
|
-
azure:change-analysis
|
|
709
|
-
azure:client-apps
|
|
710
|
-
azure:cloud-services-classic
|
|
711
|
-
azure:cloud-services-extended-support
|
|
712
|
-
azure:cloud-test
|
|
713
|
-
azure:code
|
|
714
|
-
azure:code-optimization
|
|
715
|
-
azure:cognitive-search
|
|
716
|
-
azure:cognitive-services
|
|
717
|
-
azure:cognitive-services-decisions
|
|
718
|
-
azure:collaborative-service
|
|
719
|
-
azure:commit
|
|
720
|
-
azure:community-images
|
|
721
|
-
azure:compliance
|
|
722
|
-
azure:compliance-center
|
|
723
|
-
azure:compute-fleet
|
|
724
|
-
azure:computer-vision
|
|
725
|
-
azure:conditional-access
|
|
726
|
-
azure:confidential-ledgers
|
|
727
|
-
azure:connected-cache
|
|
728
|
-
azure:connected-vehicle-platform
|
|
729
|
-
azure:connections
|
|
730
|
-
azure:consortium
|
|
731
|
-
azure:container-apps-environments
|
|
732
|
-
azure:container-instances
|
|
733
|
-
azure:container-registries
|
|
734
|
-
azure:container-services-deprecated
|
|
735
|
-
azure:content-moderators
|
|
736
|
-
azure:content-safety
|
|
737
|
-
azure:controls
|
|
738
|
-
azure:controls-horizontal
|
|
739
|
-
azure:cost-alerts
|
|
740
|
-
azure:cost-analysis
|
|
741
|
-
azure:cost-budgets
|
|
742
|
-
azure:cost-export
|
|
743
|
-
azure:cost-management
|
|
744
|
-
azure:cost-management-and-billing
|
|
745
|
-
azure:counter
|
|
746
|
-
azure:cubes
|
|
747
|
-
azure:custom-ip-prefix
|
|
748
|
-
azure:custom-vision
|
|
749
|
-
azure:customer-lockbox-for-microsoft-azure
|
|
750
|
-
azure:dashboard
|
|
751
|
-
azure:dashboard-hub
|
|
752
|
-
azure:data-box
|
|
753
|
-
azure:data-collection-rules
|
|
754
|
-
azure:data-factories
|
|
755
|
-
azure:data-lake-analytics
|
|
756
|
-
azure:data-lake-storage-gen1
|
|
757
|
-
azure:data-lake-store-gen1
|
|
758
|
-
azure:data-share-invitations
|
|
759
|
-
azure:data-shares
|
|
760
|
-
azure:database-instance-for-sap
|
|
761
|
-
azure:ddo-s-protection-plans
|
|
762
|
-
azure:dedicated-hsm
|
|
763
|
-
azure:defender-cm-local-manager
|
|
764
|
-
azure:defender-dcs-controller
|
|
765
|
-
azure:defender-distributer-control-system
|
|
766
|
-
azure:defender-engineering-station
|
|
767
|
-
azure:defender-external-management
|
|
768
|
-
azure:defender-freezer-monitor
|
|
769
|
-
azure:defender-historian
|
|
770
|
-
azure:defender-hmi
|
|
771
|
-
azure:defender-industrial-packaging-system
|
|
772
|
-
azure:defender-industrial-printer
|
|
773
|
-
azure:defender-industrial-robot
|
|
774
|
-
azure:defender-industrial-scale-system
|
|
775
|
-
azure:defender-marquee
|
|
776
|
-
azure:defender-meter
|
|
777
|
-
azure:defender-plc
|
|
778
|
-
azure:defender-pneumatic-device
|
|
779
|
-
azure:defender-programable-board
|
|
780
|
-
azure:defender-relay
|
|
781
|
-
azure:defender-robot-controller
|
|
782
|
-
azure:defender-rtu
|
|
783
|
-
azure:defender-sensor
|
|
784
|
-
azure:defender-slot
|
|
785
|
-
azure:defender-web-guiding-system
|
|
786
|
-
azure:detonation
|
|
787
|
-
azure:dev-console
|
|
788
|
-
azure:dev-ops-starter
|
|
789
|
-
azure:dev-test-labs
|
|
790
|
-
azure:device-compliance
|
|
791
|
-
azure:device-configuration
|
|
792
|
-
azure:device-enrollment
|
|
793
|
-
azure:device-provisioning-services
|
|
794
|
-
azure:device-security-apple
|
|
795
|
-
azure:device-security-google
|
|
796
|
-
azure:device-security-windows
|
|
797
|
-
azure:device-update-io-t-hub
|
|
798
|
-
azure:devices
|
|
799
|
-
azure:diagnostics-settings
|
|
800
|
-
azure:digital-twins
|
|
801
|
-
azure:disk-encryption-sets
|
|
802
|
-
azure:disk-pool
|
|
803
|
-
azure:disks
|
|
804
|
-
azure:disks-classic
|
|
805
|
-
azure:disks-snapshots
|
|
806
|
-
azure:dns-multistack
|
|
807
|
-
azure:dns-private-resolver
|
|
808
|
-
azure:dns-security-policy
|
|
809
|
-
azure:dns-zones
|
|
810
|
-
azure:download
|
|
811
|
-
azure:e-books
|
|
812
|
-
azure:edge-management
|
|
813
|
-
azure:education
|
|
814
|
-
azure:elastic-job-agents
|
|
815
|
-
azure:elastic-san
|
|
816
|
-
azure:endpoint-analytics
|
|
817
|
-
azure:enterprise-applications
|
|
818
|
-
azure:entra-connect
|
|
819
|
-
azure:entra-connect-health
|
|
820
|
-
azure:entra-connect-sync
|
|
821
|
-
azure:entra-domain-services
|
|
822
|
-
azure:entra-global-secure-access
|
|
823
|
-
azure:entra-id-protection
|
|
824
|
-
azure:entra-identity-custom-roles
|
|
825
|
-
azure:entra-identity-licenses
|
|
826
|
-
azure:entra-identity-risky-signins
|
|
827
|
-
azure:entra-identity-risky-users
|
|
828
|
-
azure:entra-identity-roles-and-administrators
|
|
829
|
-
azure:entra-internet-access
|
|
830
|
-
azure:entra-managed-identities
|
|
831
|
-
azure:entra-private-access
|
|
832
|
-
azure:entra-privleged-identity-management
|
|
833
|
-
azure:entra-verified-id
|
|
834
|
-
azure:error
|
|
835
|
-
azure:event-grid-domains
|
|
836
|
-
azure:event-grid-subscriptions
|
|
837
|
-
azure:event-grid-topics
|
|
838
|
-
azure:event-hub-clusters
|
|
839
|
-
azure:event-hubs
|
|
840
|
-
azure:exchange-access
|
|
841
|
-
azure:exchange-on-premises-access
|
|
842
|
-
azure:express-route-circuits
|
|
843
|
-
azure:express-route-direct
|
|
844
|
-
azure:express-route-traffic-collector
|
|
845
|
-
azure:extended-security-updates
|
|
846
|
-
azure:extensions
|
|
847
|
-
azure:external-identities
|
|
848
|
-
azure:face-apis
|
|
849
|
-
azure:feature-previews
|
|
850
|
-
azure:fhir-service
|
|
851
|
-
azure:fiji
|
|
852
|
-
azure:file
|
|
853
|
-
azure:files
|
|
854
|
-
azure:firewalls
|
|
855
|
-
azure:folder-blank
|
|
856
|
-
azure:folder-website
|
|
857
|
-
azure:form-recognizers
|
|
858
|
-
azure:free-services
|
|
859
|
-
azure:front-door-and-cdn-profiles
|
|
860
|
-
azure:ftp
|
|
861
|
-
azure:function-apps
|
|
862
|
-
azure:gear
|
|
863
|
-
azure:genomics
|
|
864
|
-
azure:genomics-accounts
|
|
865
|
-
azure:globe-error
|
|
866
|
-
azure:globe-success
|
|
867
|
-
azure:globe-warning
|
|
868
|
-
azure:groups
|
|
869
|
-
azure:guide
|
|
870
|
-
azure:hd-insight-clusters
|
|
871
|
-
azure:hdi-aks-cluster
|
|
872
|
-
azure:heart
|
|
873
|
-
azure:help-and-support
|
|
874
|
-
azure:host-groups
|
|
875
|
-
azure:host-pools
|
|
876
|
-
azure:hosts
|
|
877
|
-
azure:ic-m-troubleshooting
|
|
878
|
-
azure:identity-governance
|
|
879
|
-
azure:identity-multi-factor-authentication
|
|
880
|
-
azure:identity-secure-score
|
|
881
|
-
azure:image
|
|
882
|
-
azure:image-definitions
|
|
883
|
-
azure:image-templates
|
|
884
|
-
azure:image-versions
|
|
885
|
-
azure:images
|
|
886
|
-
azure:immersive-readers
|
|
887
|
-
azure:import-export-jobs
|
|
888
|
-
azure:industrial-io-t
|
|
889
|
-
azure:information
|
|
890
|
-
azure:infrastructure-backup
|
|
891
|
-
azure:input-output
|
|
892
|
-
azure:instance-pools
|
|
893
|
-
azure:integration-accounts
|
|
894
|
-
azure:integration-environments
|
|
895
|
-
azure:integration-service-environments
|
|
896
|
-
azure:internet-analyzer-profiles
|
|
897
|
-
azure:intune
|
|
898
|
-
azure:intune-app-protection
|
|
899
|
-
azure:intune-for-education
|
|
900
|
-
azure:intune-trends
|
|
901
|
-
azure:io-t-central-applications
|
|
902
|
-
azure:io-t-edge
|
|
903
|
-
azure:io-t-hub
|
|
904
|
-
azure:ip-address-manager
|
|
905
|
-
azure:ip-groups
|
|
906
|
-
azure:journey-hub
|
|
907
|
-
azure:key-vaults
|
|
908
|
-
azure:keys
|
|
909
|
-
azure:kubernetes-fleet-manager
|
|
910
|
-
azure:kubernetes-services
|
|
911
|
-
azure:lab-accounts
|
|
912
|
-
azure:lab-services
|
|
913
|
-
azure:language
|
|
914
|
-
azure:language-understanding
|
|
915
|
-
azure:launch-portal
|
|
916
|
-
azure:learn
|
|
917
|
-
azure:load-balancer-hub
|
|
918
|
-
azure:load-balancers
|
|
919
|
-
azure:load-test
|
|
920
|
-
azure:load-testing
|
|
921
|
-
azure:local-network-gateways
|
|
922
|
-
azure:location
|
|
923
|
-
azure:log-analytics-query-pack
|
|
924
|
-
azure:log-analytics-workspaces
|
|
925
|
-
azure:log-streaming
|
|
926
|
-
azure:logic-apps
|
|
927
|
-
azure:logic-apps-custom-connector
|
|
928
|
-
azure:machine-learning
|
|
929
|
-
azure:machine-learning-studio-classic-web-services
|
|
930
|
-
azure:machine-learning-studio-web-service-plans
|
|
931
|
-
azure:machine-learning-studio-workspaces
|
|
932
|
-
azure:machines-azure-arc
|
|
933
|
-
azure:maintenance-configuration
|
|
934
|
-
azure:managed-applications-center
|
|
935
|
-
azure:managed-database
|
|
936
|
-
azure:managed-desktop
|
|
937
|
-
azure:managed-dev-ops-pools
|
|
938
|
-
azure:managed-file-shares
|
|
939
|
-
azure:managed-identities
|
|
940
|
-
azure:managed-instance-apache-cassandra
|
|
941
|
-
azure:managed-service-fabric
|
|
942
|
-
azure:management-groups
|
|
943
|
-
azure:management-portal
|
|
944
|
-
azure:marketplace
|
|
945
|
-
azure:marketplace-management
|
|
946
|
-
azure:med-tech-service
|
|
947
|
-
azure:media
|
|
948
|
-
azure:media-file
|
|
949
|
-
azure:mesh-applications
|
|
950
|
-
azure:metrics
|
|
951
|
-
azure:metrics-advisor
|
|
952
|
-
azure:microsoft-defender-easm
|
|
953
|
-
azure:microsoft-defender-for-cloud
|
|
954
|
-
azure:microsoft-defender-for-io-t
|
|
955
|
-
azure:microsoft-dev-box
|
|
956
|
-
azure:mindaro
|
|
957
|
-
azure:mission-landing-zone
|
|
958
|
-
azure:mobile
|
|
959
|
-
azure:mobile-engagement
|
|
960
|
-
azure:mobile-networks
|
|
961
|
-
azure:modular-data-center
|
|
962
|
-
azure:module
|
|
963
|
-
azure:monitor
|
|
964
|
-
azure:monitor-health-models
|
|
965
|
-
azure:multi-tenancy
|
|
966
|
-
azure:multifactor-authentication
|
|
967
|
-
azure:my-customers
|
|
968
|
-
azure:nat
|
|
969
|
-
azure:network-interfaces
|
|
970
|
-
azure:network-managers
|
|
971
|
-
azure:network-security-groups
|
|
972
|
-
azure:network-security-perimeters
|
|
973
|
-
azure:network-watcher
|
|
974
|
-
azure:notification-hub-namespaces
|
|
975
|
-
azure:notification-hubs
|
|
976
|
-
azure:offers
|
|
977
|
-
azure:on-premises-data-gateways
|
|
978
|
-
azure:open-supply-chain-platform
|
|
979
|
-
azure:operation-log-classic
|
|
980
|
-
azure:oracle-database
|
|
981
|
-
azure:os-images-classic
|
|
982
|
-
azure:osconfig
|
|
983
|
-
azure:outbound-connection
|
|
984
|
-
azure:partner-namespace
|
|
985
|
-
azure:partner-registration
|
|
986
|
-
azure:partner-topic
|
|
987
|
-
azure:peering-service
|
|
988
|
-
azure:peerings
|
|
989
|
-
azure:personalizers
|
|
990
|
-
azure:plans
|
|
991
|
-
azure:policy
|
|
992
|
-
azure:power
|
|
993
|
-
azure:power-bi-embedded
|
|
994
|
-
azure:power-platform
|
|
995
|
-
azure:power-up
|
|
996
|
-
azure:powershell
|
|
997
|
-
azure:preview-features
|
|
998
|
-
azure:private-endpoints
|
|
999
|
-
azure:private-link
|
|
1000
|
-
azure:private-link-service
|
|
1001
|
-
azure:private-link-services
|
|
1002
|
-
azure:process-explorer
|
|
1003
|
-
azure:production-ready-database
|
|
1004
|
-
azure:proximity-placement-groups
|
|
1005
|
-
azure:public-ip-addresses
|
|
1006
|
-
azure:public-ip-addresses-classic
|
|
1007
|
-
azure:public-ip-prefixes
|
|
1008
|
-
azure:qn-a-makers
|
|
1009
|
-
azure:quickstart-center
|
|
1010
|
-
azure:recent
|
|
1011
|
-
azure:recovery-services-vaults
|
|
1012
|
-
azure:region-management
|
|
1013
|
-
azure:relays
|
|
1014
|
-
azure:remote-rendering
|
|
1015
|
-
azure:reservations
|
|
1016
|
-
azure:reserved-capacity
|
|
1017
|
-
azure:reserved-ip-addresses-classic
|
|
1018
|
-
azure:resource-explorer
|
|
1019
|
-
azure:resource-graph-explorer
|
|
1020
|
-
azure:resource-group-list
|
|
1021
|
-
azure:resource-groups
|
|
1022
|
-
azure:resource-guard
|
|
1023
|
-
azure:resource-linked
|
|
1024
|
-
azure:resource-management-private-link
|
|
1025
|
-
azure:resource-mover
|
|
1026
|
-
azure:resources-provider
|
|
1027
|
-
azure:restore-points
|
|
1028
|
-
azure:restore-points-collections
|
|
1029
|
-
azure:route-filters
|
|
1030
|
-
azure:route-tables
|
|
1031
|
-
azure:rtos
|
|
1032
|
-
azure:savings-plans
|
|
1033
|
-
azure:scheduler
|
|
1034
|
-
azure:scheduler-job-collections
|
|
1035
|
-
azure:scvmm-management-servers
|
|
1036
|
-
azure:search
|
|
1037
|
-
azure:search-grid
|
|
1038
|
-
azure:security
|
|
1039
|
-
azure:security-baselines
|
|
1040
|
-
azure:send-grid-accounts
|
|
1041
|
-
azure:server-farm
|
|
1042
|
-
azure:serverless-search
|
|
1043
|
-
azure:service-catalog-mad
|
|
1044
|
-
azure:service-endpoint-policies
|
|
1045
|
-
azure:service-fabric-clusters
|
|
1046
|
-
azure:service-health
|
|
1047
|
-
azure:service-providers
|
|
1048
|
-
azure:shared-image-galleries
|
|
1049
|
-
azure:signal-r
|
|
1050
|
-
azure:software-as-a-service
|
|
1051
|
-
azure:software-updates
|
|
1052
|
-
azure:solutions
|
|
1053
|
-
azure:sonic-dash
|
|
1054
|
-
azure:spatial-anchor-accounts
|
|
1055
|
-
azure:speech-services
|
|
1056
|
-
azure:spot-vm
|
|
1057
|
-
azure:spot-vmss
|
|
1058
|
-
azure:sql-data-warehouses
|
|
1059
|
-
azure:sql-database
|
|
1060
|
-
azure:sql-elastic-pools
|
|
1061
|
-
azure:sql-managed-instance
|
|
1062
|
-
azure:sql-server
|
|
1063
|
-
azure:sql-server-registries
|
|
1064
|
-
azure:ssd
|
|
1065
|
-
azure:ssh-keys
|
|
1066
|
-
azure:ssis-lift-and-shift-ir
|
|
1067
|
-
azure:stack-hci-premium
|
|
1068
|
-
azure:static-apps
|
|
1069
|
-
azure:stor-simple-data-managers
|
|
1070
|
-
azure:stor-simple-device-managers
|
|
1071
|
-
azure:storage-accounts
|
|
1072
|
-
azure:storage-accounts-classic
|
|
1073
|
-
azure:storage-actions
|
|
1074
|
-
azure:storage-azure-files
|
|
1075
|
-
azure:storage-container
|
|
1076
|
-
azure:storage-explorer
|
|
1077
|
-
azure:storage-functions
|
|
1078
|
-
azure:storage-queue
|
|
1079
|
-
azure:storage-sync-services
|
|
1080
|
-
azure:stream-analytics-jobs
|
|
1081
|
-
azure:subnet
|
|
1082
|
-
azure:subscriptions
|
|
1083
|
-
azure:system-topic
|
|
1084
|
-
azure:table
|
|
1085
|
-
azure:tag
|
|
1086
|
-
azure:tags
|
|
1087
|
-
azure:targets-management
|
|
1088
|
-
azure:template-specs
|
|
1089
|
-
azure:templates
|
|
1090
|
-
azure:tenant-properties
|
|
1091
|
-
azure:tenant-status
|
|
1092
|
-
azure:test-base
|
|
1093
|
-
azure:tfs-vc-repository
|
|
1094
|
-
azure:time-series-data-sets
|
|
1095
|
-
azure:time-series-insights-access-policies
|
|
1096
|
-
azure:time-series-insights-environments
|
|
1097
|
-
azure:time-series-insights-event-sources
|
|
1098
|
-
azure:toolbox
|
|
1099
|
-
azure:traffic-manager-profiles
|
|
1100
|
-
azure:translator-text
|
|
1101
|
-
azure:troubleshoot
|
|
1102
|
-
azure:universal-print
|
|
1103
|
-
azure:update-management-center
|
|
1104
|
-
azure:updates
|
|
1105
|
-
azure:user-privacy
|
|
1106
|
-
azure:user-settings
|
|
1107
|
-
azure:user-subscriptions
|
|
1108
|
-
azure:users
|
|
1109
|
-
azure:verifiable-credentials
|
|
1110
|
-
azure:verification-as-a-service
|
|
1111
|
-
azure:versions
|
|
1112
|
-
azure:video-analyzers
|
|
1113
|
-
azure:virtual-clusters
|
|
1114
|
-
azure:virtual-enclaves
|
|
1115
|
-
azure:virtual-instance-for-sap
|
|
1116
|
-
azure:virtual-machine
|
|
1117
|
-
azure:virtual-machines-classic
|
|
1118
|
-
azure:virtual-network-gateways
|
|
1119
|
-
azure:virtual-networks
|
|
1120
|
-
azure:virtual-networks-classic
|
|
1121
|
-
azure:virtual-router
|
|
1122
|
-
azure:virtual-visits-builder
|
|
1123
|
-
azure:virtual-wan-hub
|
|
1124
|
-
azure:virtual-wans
|
|
1125
|
-
azure:vm-app-definitions
|
|
1126
|
-
azure:vm-app-versions
|
|
1127
|
-
azure:vm-image-version
|
|
1128
|
-
azure:vm-images-classic
|
|
1129
|
-
azure:vm-scale-sets
|
|
1130
|
-
azure:wac
|
|
1131
|
-
azure:wac-installer
|
|
1132
|
-
azure:web-app-database
|
|
1133
|
-
azure:web-application-firewall-policies-waf
|
|
1134
|
-
azure:web-jobs
|
|
1135
|
-
azure:web-slots
|
|
1136
|
-
azure:web-test
|
|
1137
|
-
azure:website-power
|
|
1138
|
-
azure:website-staging
|
|
1139
|
-
azure:windows-notification-services
|
|
1140
|
-
azure:windows10-core-services
|
|
1141
|
-
azure:workbooks
|
|
1142
|
-
azure:worker-container-app
|
|
1143
|
-
azure:workflow
|
|
1144
|
-
azure:workspace-gateway
|
|
1145
|
-
azure:workspaces
|
|
1146
|
-
gcp:access-context-manager
|
|
1147
|
-
gcp:administration
|
|
1148
|
-
gcp:advanced-agent-modeling
|
|
1149
|
-
gcp:advanced-solutions-lab
|
|
1150
|
-
gcp:agent-assist
|
|
1151
|
-
gcp:ai-hub
|
|
1152
|
-
gcp:ai-platform
|
|
1153
|
-
gcp:ai-platform-unified
|
|
1154
|
-
gcp:analytics-hub
|
|
1155
|
-
gcp:anthos
|
|
1156
|
-
gcp:anthos-config-management
|
|
1157
|
-
gcp:anthos-service-mesh
|
|
1158
|
-
gcp:api
|
|
1159
|
-
gcp:api-analytics
|
|
1160
|
-
gcp:api-monetization
|
|
1161
|
-
gcp:apigee-api-platform
|
|
1162
|
-
gcp:apigee-sense
|
|
1163
|
-
gcp:app-engine
|
|
1164
|
-
gcp:artifact-registry
|
|
1165
|
-
gcp:asset-inventory
|
|
1166
|
-
gcp:assured-workloads
|
|
1167
|
-
gcp:auto-ml
|
|
1168
|
-
gcp:auto-ml-natural-language
|
|
1169
|
-
gcp:auto-ml-tables
|
|
1170
|
-
gcp:auto-ml-translation
|
|
1171
|
-
gcp:auto-ml-video-intelligence
|
|
1172
|
-
gcp:auto-ml-vision
|
|
1173
|
-
gcp:bare-metal-solutions
|
|
1174
|
-
gcp:batch
|
|
1175
|
-
gcp:beyondcorp
|
|
1176
|
-
gcp:big-query
|
|
1177
|
-
gcp:bigtable
|
|
1178
|
-
gcp:billing
|
|
1179
|
-
gcp:binary-authorization
|
|
1180
|
-
gcp:catalog
|
|
1181
|
-
gcp:certificate-authority-service
|
|
1182
|
-
gcp:certificate-manager
|
|
1183
|
-
gcp:cloud-api-gateway
|
|
1184
|
-
gcp:cloud-apis
|
|
1185
|
-
gcp:cloud-armor
|
|
1186
|
-
gcp:cloud-asset-inventory
|
|
1187
|
-
gcp:cloud-audit-logs
|
|
1188
|
-
gcp:cloud-build
|
|
1189
|
-
gcp:cloud-cdn
|
|
1190
|
-
gcp:cloud-code
|
|
1191
|
-
gcp:cloud-composer
|
|
1192
|
-
gcp:cloud-data-fusion
|
|
1193
|
-
gcp:cloud-deploy
|
|
1194
|
-
gcp:cloud-deployment-manager
|
|
1195
|
-
gcp:cloud-dns
|
|
1196
|
-
gcp:cloud-domains
|
|
1197
|
-
gcp:cloud-ekm
|
|
1198
|
-
gcp:cloud-endpoints
|
|
1199
|
-
gcp:cloud-external-ip-addresses
|
|
1200
|
-
gcp:cloud-firewall-rules
|
|
1201
|
-
gcp:cloud-for-marketing
|
|
1202
|
-
gcp:cloud-functions
|
|
1203
|
-
gcp:cloud-generic
|
|
1204
|
-
gcp:cloud-gpu
|
|
1205
|
-
gcp:cloud-healthcare-api
|
|
1206
|
-
gcp:cloud-healthcare-marketplace
|
|
1207
|
-
gcp:cloud-hsm
|
|
1208
|
-
gcp:cloud-ids
|
|
1209
|
-
gcp:cloud-inference-api
|
|
1210
|
-
gcp:cloud-interconnect
|
|
1211
|
-
gcp:cloud-jobs-api
|
|
1212
|
-
gcp:cloud-load-balancing
|
|
1213
|
-
gcp:cloud-logging
|
|
1214
|
-
gcp:cloud-media-edge
|
|
1215
|
-
gcp:cloud-monitoring
|
|
1216
|
-
gcp:cloud-nat
|
|
1217
|
-
gcp:cloud-natural-language-api
|
|
1218
|
-
gcp:cloud-network
|
|
1219
|
-
gcp:cloud-ops
|
|
1220
|
-
gcp:cloud-optimization-ai
|
|
1221
|
-
gcp:cloud-optimization-ai-fleet-routing-api
|
|
1222
|
-
gcp:cloud-router
|
|
1223
|
-
gcp:cloud-routes
|
|
1224
|
-
gcp:cloud-run
|
|
1225
|
-
gcp:cloud-run-for-anthos
|
|
1226
|
-
gcp:cloud-scheduler
|
|
1227
|
-
gcp:cloud-security-scanner
|
|
1228
|
-
gcp:cloud-shell
|
|
1229
|
-
gcp:cloud-spanner
|
|
1230
|
-
gcp:cloud-sql
|
|
1231
|
-
gcp:cloud-storage
|
|
1232
|
-
gcp:cloud-tasks
|
|
1233
|
-
gcp:cloud-test-lab
|
|
1234
|
-
gcp:cloud-tpu
|
|
1235
|
-
gcp:cloud-translation-api
|
|
1236
|
-
gcp:cloud-vision-api
|
|
1237
|
-
gcp:cloud-vpn
|
|
1238
|
-
gcp:compute-engine
|
|
1239
|
-
gcp:configuration-management
|
|
1240
|
-
gcp:connectivity-test
|
|
1241
|
-
gcp:connectors
|
|
1242
|
-
gcp:contact-center-ai
|
|
1243
|
-
gcp:container-optimized-os
|
|
1244
|
-
gcp:container-registry
|
|
1245
|
-
gcp:data-catalog
|
|
1246
|
-
gcp:data-labeling
|
|
1247
|
-
gcp:data-layers
|
|
1248
|
-
gcp:data-loss-prevention-api
|
|
1249
|
-
gcp:data-qn-a
|
|
1250
|
-
gcp:data-studio
|
|
1251
|
-
gcp:data-transfer
|
|
1252
|
-
gcp:database-migration-service
|
|
1253
|
-
gcp:dataflow
|
|
1254
|
-
gcp:datalab
|
|
1255
|
-
gcp:dataplex
|
|
1256
|
-
gcp:datapol
|
|
1257
|
-
gcp:dataprep
|
|
1258
|
-
gcp:dataproc
|
|
1259
|
-
gcp:dataproc-metastore
|
|
1260
|
-
gcp:datashare
|
|
1261
|
-
gcp:datastore
|
|
1262
|
-
gcp:datastream
|
|
1263
|
-
gcp:debugger
|
|
1264
|
-
gcp:developer-portal
|
|
1265
|
-
gcp:dialogflow
|
|
1266
|
-
gcp:dialogflow-cx
|
|
1267
|
-
gcp:dialogflow-insights
|
|
1268
|
-
gcp:document-ai
|
|
1269
|
-
gcp:early-access-center
|
|
1270
|
-
gcp:error-reporting
|
|
1271
|
-
gcp:eventarc
|
|
1272
|
-
gcp:filestore
|
|
1273
|
-
gcp:financial-services-marketplace
|
|
1274
|
-
gcp:firestore
|
|
1275
|
-
gcp:fleet-engine
|
|
1276
|
-
gcp:free-trial
|
|
1277
|
-
gcp:game-servers
|
|
1278
|
-
gcp:gce-systems-management
|
|
1279
|
-
gcp:genomics
|
|
1280
|
-
gcp:gke-on-prem
|
|
1281
|
-
gcp:google-cloud-marketplace
|
|
1282
|
-
gcp:google-kubernetes-engine
|
|
1283
|
-
gcp:google-maps-platform
|
|
1284
|
-
gcp:healthcare-nlp-api
|
|
1285
|
-
gcp:home
|
|
1286
|
-
gcp:identity-and-access-management
|
|
1287
|
-
gcp:identity-aware-proxy
|
|
1288
|
-
gcp:identity-platform
|
|
1289
|
-
gcp:iot-core
|
|
1290
|
-
gcp:iot-edge
|
|
1291
|
-
gcp:key-access-justifications
|
|
1292
|
-
gcp:key-management-service
|
|
1293
|
-
gcp:kuberun
|
|
1294
|
-
gcp:launcher
|
|
1295
|
-
gcp:local-ssd
|
|
1296
|
-
gcp:looker
|
|
1297
|
-
gcp:managed-service-for-microsoft-active-directory
|
|
1298
|
-
gcp:media-translation-api
|
|
1299
|
-
gcp:memorystore
|
|
1300
|
-
gcp:migrate-for-anthos
|
|
1301
|
-
gcp:migrate-for-compute-engine
|
|
1302
|
-
gcp:my-cloud
|
|
1303
|
-
gcp:network-connectivity-center
|
|
1304
|
-
gcp:network-intelligence-center
|
|
1305
|
-
gcp:network-security
|
|
1306
|
-
gcp:network-tiers
|
|
1307
|
-
gcp:network-topology
|
|
1308
|
-
gcp:onboarding
|
|
1309
|
-
gcp:os-configuration-management
|
|
1310
|
-
gcp:os-inventory-management
|
|
1311
|
-
gcp:os-patch-management
|
|
1312
|
-
gcp:partner-interconnect
|
|
1313
|
-
gcp:partner-portal
|
|
1314
|
-
gcp:performance-dashboard
|
|
1315
|
-
gcp:permissions
|
|
1316
|
-
gcp:persistent-disk
|
|
1317
|
-
gcp:phishing-protection
|
|
1318
|
-
gcp:policy-analyzer
|
|
1319
|
-
gcp:premium-network-tier
|
|
1320
|
-
gcp:private-connectivity
|
|
1321
|
-
gcp:private-service-connect
|
|
1322
|
-
gcp:producer-portal
|
|
1323
|
-
gcp:profiler
|
|
1324
|
-
gcp:project
|
|
1325
|
-
gcp:pub-sub
|
|
1326
|
-
gcp:quantum-engine
|
|
1327
|
-
gcp:quotas
|
|
1328
|
-
gcp:real-world-insights
|
|
1329
|
-
gcp:recommendations-ai
|
|
1330
|
-
gcp:release-notes
|
|
1331
|
-
gcp:retail-api
|
|
1332
|
-
gcp:risk-manager
|
|
1333
|
-
gcp:runtime-config
|
|
1334
|
-
gcp:secret-manager
|
|
1335
|
-
gcp:security
|
|
1336
|
-
gcp:security-command-center
|
|
1337
|
-
gcp:security-health-advisor
|
|
1338
|
-
gcp:security-key-enforcement
|
|
1339
|
-
gcp:service-discovery
|
|
1340
|
-
gcp:speech-to-text
|
|
1341
|
-
gcp:stackdriver
|
|
1342
|
-
gcp:standard-network-tier
|
|
1343
|
-
gcp:stream-suite
|
|
1344
|
-
gcp:support
|
|
1345
|
-
gcp:tensorflow-enterprise
|
|
1346
|
-
gcp:text-to-speech
|
|
1347
|
-
gcp:tools-for-powershell
|
|
1348
|
-
gcp:trace
|
|
1349
|
-
gcp:traffic-director
|
|
1350
|
-
gcp:transfer
|
|
1351
|
-
gcp:transfer-appliance
|
|
1352
|
-
gcp:user-preferences
|
|
1353
|
-
gcp:vertex-ai
|
|
1354
|
-
gcp:video-intelligence-api
|
|
1355
|
-
gcp:virtual-private-cloud
|
|
1356
|
-
gcp:visual-inspection
|
|
1357
|
-
gcp:vmware-engine
|
|
1358
|
-
gcp:web-risk
|
|
1359
|
-
gcp:web-security-scanner
|
|
1360
|
-
gcp:workflows
|
|
1361
|
-
gcp:workload-identity-pool
|
|
1362
|
-
tech:aarch64
|
|
1363
|
-
tech:adobe-illustrator
|
|
1364
|
-
tech:adobe-photoshop
|
|
1365
|
-
tech:adobe-premiere-pro
|
|
1366
|
-
tech:adobe-xd
|
|
1367
|
-
tech:adonis-js
|
|
1368
|
-
tech:after-effects
|
|
1369
|
-
tech:airflow
|
|
1370
|
-
tech:akka
|
|
1371
|
-
tech:algolia
|
|
1372
|
-
tech:alpine-js
|
|
1373
|
-
tech:amazon-web-services
|
|
1374
|
-
tech:anaconda
|
|
1375
|
-
tech:android
|
|
1376
|
-
tech:android-studio
|
|
1377
|
-
tech:angular
|
|
1378
|
-
tech:angular-js
|
|
1379
|
-
tech:ansible
|
|
1380
|
-
tech:ant-design
|
|
1381
|
-
tech:apache
|
|
1382
|
-
tech:apl
|
|
1383
|
-
tech:appcelerator
|
|
1384
|
-
tech:apple
|
|
1385
|
-
tech:apple-safari
|
|
1386
|
-
tech:appwrite
|
|
1387
|
-
tech:arch-linux
|
|
1388
|
-
tech:arduino
|
|
1389
|
-
tech:argo-cd
|
|
1390
|
-
tech:astro
|
|
1391
|
-
tech:atom
|
|
1392
|
-
tech:autodesk-maya
|
|
1393
|
-
tech:autodesk-shot-grid
|
|
1394
|
-
tech:awk
|
|
1395
|
-
tech:azios
|
|
1396
|
-
tech:azure
|
|
1397
|
-
tech:azure-devops
|
|
1398
|
-
tech:azure-sql-database
|
|
1399
|
-
tech:babel
|
|
1400
|
-
tech:backbone-js
|
|
1401
|
-
tech:ballerina
|
|
1402
|
-
tech:bamboo
|
|
1403
|
-
tech:bash
|
|
1404
|
-
tech:behance
|
|
1405
|
-
tech:bitbucket
|
|
1406
|
-
tech:blender
|
|
1407
|
-
tech:bootstrap
|
|
1408
|
-
tech:bower
|
|
1409
|
-
tech:browserstack
|
|
1410
|
-
tech:bulma
|
|
1411
|
-
tech:bun
|
|
1412
|
-
tech:c
|
|
1413
|
-
tech:cairo-graphics
|
|
1414
|
-
tech:cake-php
|
|
1415
|
-
tech:canva
|
|
1416
|
-
tech:capacitor
|
|
1417
|
-
tech:cassandra
|
|
1418
|
-
tech:cent-os
|
|
1419
|
-
tech:chrome
|
|
1420
|
-
tech:circle-ci
|
|
1421
|
-
tech:clarity
|
|
1422
|
-
tech:clion
|
|
1423
|
-
tech:clojure
|
|
1424
|
-
tech:clojure-script
|
|
1425
|
-
tech:cloudflare
|
|
1426
|
-
tech:cloudflare-workers
|
|
1427
|
-
tech:cmake
|
|
1428
|
-
tech:code-igniter
|
|
1429
|
-
tech:code-pen
|
|
1430
|
-
tech:codeac
|
|
1431
|
-
tech:codecov
|
|
1432
|
-
tech:coffee-script
|
|
1433
|
-
tech:composer
|
|
1434
|
-
tech:confluence
|
|
1435
|
-
tech:consul
|
|
1436
|
-
tech:contao
|
|
1437
|
-
tech:corejs
|
|
1438
|
-
tech:cosmosdb
|
|
1439
|
-
tech:couchdb
|
|
1440
|
-
tech:cplusplus
|
|
1441
|
-
tech:crystal
|
|
1442
|
-
tech:csharp
|
|
1443
|
-
tech:css3
|
|
1444
|
-
tech:cucumber
|
|
1445
|
-
tech:cypress
|
|
1446
|
-
tech:d3js
|
|
1447
|
-
tech:dart
|
|
1448
|
-
tech:data-grip
|
|
1449
|
-
tech:data-spell
|
|
1450
|
-
tech:dbeaver
|
|
1451
|
-
tech:debian
|
|
1452
|
-
tech:deno
|
|
1453
|
-
tech:devicon
|
|
1454
|
-
tech:digital-ocean
|
|
1455
|
-
tech:discord-js
|
|
1456
|
-
tech:django
|
|
1457
|
-
tech:django-rest
|
|
1458
|
-
tech:docker
|
|
1459
|
-
tech:doctrine
|
|
1460
|
-
tech:dropwizard
|
|
1461
|
-
tech:drupal
|
|
1462
|
-
tech:eclipse-ceylon
|
|
1463
|
-
tech:eclipse-ide
|
|
1464
|
-
tech:eclipse-vert-x
|
|
1465
|
-
tech:elasticbeats
|
|
1466
|
-
tech:elasticsearch
|
|
1467
|
-
tech:electron
|
|
1468
|
-
tech:eleventy-11ty
|
|
1469
|
-
tech:elixir
|
|
1470
|
-
tech:elm
|
|
1471
|
-
tech:embedded-c
|
|
1472
|
-
tech:ember-js
|
|
1473
|
-
tech:envoy
|
|
1474
|
-
tech:erlang
|
|
1475
|
-
tech:eslint
|
|
1476
|
-
tech:express
|
|
1477
|
-
tech:facebook
|
|
1478
|
-
tech:fast-api
|
|
1479
|
-
tech:fastify
|
|
1480
|
-
tech:fauna
|
|
1481
|
-
tech:feathers
|
|
1482
|
-
tech:fedora
|
|
1483
|
-
tech:figma
|
|
1484
|
-
tech:file-zilla
|
|
1485
|
-
tech:firebase
|
|
1486
|
-
tech:firefox
|
|
1487
|
-
tech:flask
|
|
1488
|
-
tech:flutter
|
|
1489
|
-
tech:fortran
|
|
1490
|
-
tech:foundation
|
|
1491
|
-
tech:fsharp
|
|
1492
|
-
tech:gatling
|
|
1493
|
-
tech:gatsby
|
|
1494
|
-
tech:gazebo
|
|
1495
|
-
tech:gcc
|
|
1496
|
-
tech:gentoo
|
|
1497
|
-
tech:ghost
|
|
1498
|
-
tech:gimp
|
|
1499
|
-
tech:git
|
|
1500
|
-
tech:gitbook
|
|
1501
|
-
tech:github
|
|
1502
|
-
tech:github-actions
|
|
1503
|
-
tech:github-codespaces
|
|
1504
|
-
tech:gitlab
|
|
1505
|
-
tech:gitpod
|
|
1506
|
-
tech:gitter
|
|
1507
|
-
tech:gnu-emacs
|
|
1508
|
-
tech:go
|
|
1509
|
-
tech:go-land
|
|
1510
|
-
tech:godot-engine
|
|
1511
|
-
tech:google
|
|
1512
|
-
tech:google-cloud
|
|
1513
|
-
tech:gradle
|
|
1514
|
-
tech:grafana
|
|
1515
|
-
tech:grails
|
|
1516
|
-
tech:graphql
|
|
1517
|
-
tech:groovy
|
|
1518
|
-
tech:grunt-js
|
|
1519
|
-
tech:gulp-js
|
|
1520
|
-
tech:hadoop
|
|
1521
|
-
tech:handlebars
|
|
1522
|
-
tech:hardhat
|
|
1523
|
-
tech:harvester
|
|
1524
|
-
tech:hashicorp-vault
|
|
1525
|
-
tech:haskell
|
|
1526
|
-
tech:haxe
|
|
1527
|
-
tech:helm
|
|
1528
|
-
tech:heroku
|
|
1529
|
-
tech:hibernate
|
|
1530
|
-
tech:homebrew
|
|
1531
|
-
tech:html5
|
|
1532
|
-
tech:hugo
|
|
1533
|
-
tech:ibm-spss-statistics
|
|
1534
|
-
tech:ie10
|
|
1535
|
-
tech:ifttt
|
|
1536
|
-
tech:influxdb
|
|
1537
|
-
tech:inkscape
|
|
1538
|
-
tech:insomnia
|
|
1539
|
-
tech:intellij-idea
|
|
1540
|
-
tech:ionic
|
|
1541
|
-
tech:jaeger
|
|
1542
|
-
tech:jamstack
|
|
1543
|
-
tech:jasmine
|
|
1544
|
-
tech:java
|
|
1545
|
-
tech:javascript
|
|
1546
|
-
tech:jeet
|
|
1547
|
-
tech:jekyll
|
|
1548
|
-
tech:jenkins
|
|
1549
|
-
tech:jest
|
|
1550
|
-
tech:jetbrains
|
|
1551
|
-
tech:jira
|
|
1552
|
-
tech:jira-align
|
|
1553
|
-
tech:jquery
|
|
1554
|
-
tech:json
|
|
1555
|
-
tech:jule
|
|
1556
|
-
tech:julia
|
|
1557
|
-
tech:junit
|
|
1558
|
-
tech:jupyter
|
|
1559
|
-
tech:k3os
|
|
1560
|
-
tech:k3s
|
|
1561
|
-
tech:kafka
|
|
1562
|
-
tech:kaggle
|
|
1563
|
-
tech:karate
|
|
1564
|
-
tech:karma
|
|
1565
|
-
tech:keras
|
|
1566
|
-
tech:kibana
|
|
1567
|
-
tech:knex-js
|
|
1568
|
-
tech:knockout
|
|
1569
|
-
tech:kotlin
|
|
1570
|
-
tech:krakenjs
|
|
1571
|
-
tech:ktor
|
|
1572
|
-
tech:kubernetes
|
|
1573
|
-
tech:labview
|
|
1574
|
-
tech:laravel
|
|
1575
|
-
tech:latex
|
|
1576
|
-
tech:less-js
|
|
1577
|
-
tech:linkedin
|
|
1578
|
-
tech:linux
|
|
1579
|
-
tech:liquibase
|
|
1580
|
-
tech:livewire
|
|
1581
|
-
tech:llvm
|
|
1582
|
-
tech:logstash
|
|
1583
|
-
tech:lua
|
|
1584
|
-
tech:lumen
|
|
1585
|
-
tech:magento
|
|
1586
|
-
tech:markdown
|
|
1587
|
-
tech:material-ui
|
|
1588
|
-
tech:materialize
|
|
1589
|
-
tech:matlab
|
|
1590
|
-
tech:matplotlib
|
|
1591
|
-
tech:maven
|
|
1592
|
-
tech:meteor-js
|
|
1593
|
-
tech:microsoft-sql-server
|
|
1594
|
-
tech:minitab
|
|
1595
|
-
tech:mob-x
|
|
1596
|
-
tech:mocha
|
|
1597
|
-
tech:modx
|
|
1598
|
-
tech:moleculer
|
|
1599
|
-
tech:mongodb
|
|
1600
|
-
tech:mongoose-js
|
|
1601
|
-
tech:moodle
|
|
1602
|
-
tech:ms-dos
|
|
1603
|
-
tech:mysql
|
|
1604
|
-
tech:nano
|
|
1605
|
-
tech:nerog
|
|
1606
|
-
tech:nestjs
|
|
1607
|
-
tech:net
|
|
1608
|
-
tech:net-core
|
|
1609
|
-
tech:network-x
|
|
1610
|
-
tech:new4j
|
|
1611
|
-
tech:nextjs
|
|
1612
|
-
tech:nginx
|
|
1613
|
-
tech:nhibernate
|
|
1614
|
-
tech:nim
|
|
1615
|
-
tech:nimble
|
|
1616
|
-
tech:nix
|
|
1617
|
-
tech:nodejs
|
|
1618
|
-
tech:nodemon
|
|
1619
|
-
tech:nodewebkit
|
|
1620
|
-
tech:npm
|
|
1621
|
-
tech:nuget
|
|
1622
|
-
tech:num-py
|
|
1623
|
-
tech:nuxt-js
|
|
1624
|
-
tech:objective-c
|
|
1625
|
-
tech:ocaml
|
|
1626
|
-
tech:oh-my-zsh
|
|
1627
|
-
tech:okta
|
|
1628
|
-
tech:open-al
|
|
1629
|
-
tech:open-api
|
|
1630
|
-
tech:open-cl
|
|
1631
|
-
tech:open-cv
|
|
1632
|
-
tech:open-gl
|
|
1633
|
-
tech:open-stack
|
|
1634
|
-
tech:open-suse
|
|
1635
|
-
tech:open-telemetry
|
|
1636
|
-
tech:opera
|
|
1637
|
-
tech:oracle
|
|
1638
|
-
tech:p5js
|
|
1639
|
-
tech:packer
|
|
1640
|
-
tech:pandas
|
|
1641
|
-
tech:perl
|
|
1642
|
-
tech:pf-sense
|
|
1643
|
-
tech:phalcon
|
|
1644
|
-
tech:phoenix-framework
|
|
1645
|
-
tech:photon-engine
|
|
1646
|
-
tech:php
|
|
1647
|
-
tech:php-storm
|
|
1648
|
-
tech:playwrite
|
|
1649
|
-
tech:ploty
|
|
1650
|
-
tech:podman
|
|
1651
|
-
tech:polygon
|
|
1652
|
-
tech:portainer
|
|
1653
|
-
tech:postcss
|
|
1654
|
-
tech:postgresql
|
|
1655
|
-
tech:postman
|
|
1656
|
-
tech:powershell
|
|
1657
|
-
tech:processing
|
|
1658
|
-
tech:prometheus
|
|
1659
|
-
tech:protractor
|
|
1660
|
-
tech:purescript
|
|
1661
|
-
tech:putty
|
|
1662
|
-
tech:pycharm
|
|
1663
|
-
tech:pyscript
|
|
1664
|
-
tech:pytest
|
|
1665
|
-
tech:python
|
|
1666
|
-
tech:python-poetry
|
|
1667
|
-
tech:pytorch
|
|
1668
|
-
tech:qodana
|
|
1669
|
-
tech:qt
|
|
1670
|
-
tech:quarkus
|
|
1671
|
-
tech:quasar
|
|
1672
|
-
tech:qwik
|
|
1673
|
-
tech:r
|
|
1674
|
-
tech:rabbitmq
|
|
1675
|
-
tech:rancher
|
|
1676
|
-
tech:raspberrypi
|
|
1677
|
-
tech:reach
|
|
1678
|
-
tech:react
|
|
1679
|
-
tech:react-bootstrap
|
|
1680
|
-
tech:realm
|
|
1681
|
-
tech:red-cube-s-epic-compiler-thingy-programming-re-ct
|
|
1682
|
-
tech:redhat
|
|
1683
|
-
tech:redis
|
|
1684
|
-
tech:redux
|
|
1685
|
-
tech:ren-py
|
|
1686
|
-
tech:rider
|
|
1687
|
-
tech:robot-operating-system-ros
|
|
1688
|
-
tech:rocksdb
|
|
1689
|
-
tech:rollup-js
|
|
1690
|
-
tech:rspec
|
|
1691
|
-
tech:rstudio
|
|
1692
|
-
tech:ruby
|
|
1693
|
-
tech:ruby-mine
|
|
1694
|
-
tech:ruby-on-rails
|
|
1695
|
-
tech:rust
|
|
1696
|
-
tech:salesforce
|
|
1697
|
-
tech:sanity
|
|
1698
|
-
tech:sass
|
|
1699
|
-
tech:scala
|
|
1700
|
-
tech:scalingo
|
|
1701
|
-
tech:sdl
|
|
1702
|
-
tech:selenium
|
|
1703
|
-
tech:sema-software
|
|
1704
|
-
tech:sequelize
|
|
1705
|
-
tech:shopware
|
|
1706
|
-
tech:sketch
|
|
1707
|
-
tech:slack
|
|
1708
|
-
tech:socket-io
|
|
1709
|
-
tech:solid-js
|
|
1710
|
-
tech:solidity
|
|
1711
|
-
tech:sonarqube
|
|
1712
|
-
tech:sourcetree
|
|
1713
|
-
tech:spark
|
|
1714
|
-
tech:splunk
|
|
1715
|
-
tech:spring
|
|
1716
|
-
tech:sql-developer
|
|
1717
|
-
tech:sqlalchemy
|
|
1718
|
-
tech:sqlite
|
|
1719
|
-
tech:ssh
|
|
1720
|
-
tech:stackoverflow
|
|
1721
|
-
tech:stata
|
|
1722
|
-
tech:storybook
|
|
1723
|
-
tech:streamlit
|
|
1724
|
-
tech:stylus
|
|
1725
|
-
tech:subversion
|
|
1726
|
-
tech:svelte
|
|
1727
|
-
tech:swagger
|
|
1728
|
-
tech:swift
|
|
1729
|
-
tech:symfony
|
|
1730
|
-
tech:tailwind-css
|
|
1731
|
-
tech:tauri
|
|
1732
|
-
tech:tensorflow
|
|
1733
|
-
tech:terraform
|
|
1734
|
-
tech:tex
|
|
1735
|
-
tech:the-algorithms
|
|
1736
|
-
tech:three-js
|
|
1737
|
-
tech:titanium-sdk
|
|
1738
|
-
tech:tomcat
|
|
1739
|
-
tech:tortoise-git
|
|
1740
|
-
tech:tower
|
|
1741
|
-
tech:traefik-mesh
|
|
1742
|
-
tech:traefik-proxy
|
|
1743
|
-
tech:travis-ci
|
|
1744
|
-
tech:trello
|
|
1745
|
-
tech:twitter
|
|
1746
|
-
tech:typescript
|
|
1747
|
-
tech:typo3
|
|
1748
|
-
tech:ubuntu
|
|
1749
|
-
tech:uml
|
|
1750
|
-
tech:unity
|
|
1751
|
-
tech:unix
|
|
1752
|
-
tech:unreal-engine
|
|
1753
|
-
tech:uwsgi
|
|
1754
|
-
tech:v8
|
|
1755
|
-
tech:vagrant
|
|
1756
|
-
tech:vala
|
|
1757
|
-
tech:vercel
|
|
1758
|
-
tech:veutify
|
|
1759
|
-
tech:vim
|
|
1760
|
-
tech:visualstudio
|
|
1761
|
-
tech:vite
|
|
1762
|
-
tech:vitejs
|
|
1763
|
-
tech:vscode
|
|
1764
|
-
tech:vsphere
|
|
1765
|
-
tech:vue
|
|
1766
|
-
tech:vue-storefront
|
|
1767
|
-
tech:vyper
|
|
1768
|
-
tech:webassembly
|
|
1769
|
-
tech:webflow
|
|
1770
|
-
tech:weblate
|
|
1771
|
-
tech:webpack
|
|
1772
|
-
tech:webstorm
|
|
1773
|
-
tech:windows8
|
|
1774
|
-
tech:windows11
|
|
1775
|
-
tech:woo-commerce
|
|
1776
|
-
tech:wordpress
|
|
1777
|
-
tech:xamarin
|
|
1778
|
-
tech:xcode
|
|
1779
|
-
tech:xml
|
|
1780
|
-
tech:yaml
|
|
1781
|
-
tech:yarn
|
|
1782
|
-
tech:yii-framework
|
|
1783
|
-
tech:yuno-host
|
|
1784
|
-
tech:zend-framework
|
|
1785
|
-
tech:zig
|
|
1786
|
-
}}`,K0="likec4builtin",wK=`${K0}:///likec4/lib/icons.c4`;var Bi=Ds();const vK=new Bi.NotificationType("likec4/onDidChangeModel"),bK=new Bi.RequestType0("likec4/fetchModel"),DK=new Bi.RequestType("likec4/fetchComputedModel"),EK=new Bi.RequestType("likec4/computeView"),RK=new Bi.RequestType("likec4/layout-view"),TK=new Bi.RequestType("likec4/build"),SK=new Bi.RequestType("likec4/locate"),$K=new Bi.RequestType("likec4/change-view");class kK extends cv{constructor(e){super(),this.services=e}init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.likec4.Views,s=this.services.shared.lsp.Connection;if(!s){xe.info("[ServerRpc] no connection, not initializing");return}xe.info("[ServerRpc] init");const a=this.services.shared.workspace.LangiumDocuments,o=this.services.shared.workspace.DocumentBuilder,u=Sj(()=>{s.sendNotification(vK,"").catch(l=>(xe.warn(`[ServerRpc] error sending onDidChangeModel: ${l}`),Promise.resolve()))},{minQuietPeriodMs:250,maxBurstDurationMs:1e3,minGapMs:200});let c=!0;this.onDispose(e.onModelParsed(()=>u.call()),s.onRequest(DK,async({cleanCaches:l},d)=>(l&&(this.services.WorkspaceCache.clear(),this.services.DocumentCache.clear()),{model:await e.buildComputedModel(d)})),s.onRequest(bK,async l=>({model:await e.buildModel(l)})),s.onRequest(EK,async({viewId:l},d)=>({view:await e.computeView(l,d)})),s.onRequest(RK,async({viewId:l},d)=>({result:await i.layoutView(l,d)})),s.onRequest(TK,async({docs:l},d)=>{const f=l.map(w=>Wt.parse(w)),p=w=>f.every(D=>!Rt.equals(D,w)),h=a.all.filter(w=>td(w)&&p(w.uri)&&w.uri.scheme!==K0).map(w=>w.uri).toArray();xe.debug(`[ServerRpc] received request to build:
|
|
1787
|
-
changed (total ${f.length}):${l.map(w=>`
|
|
1788
|
-
- `+w).join("")}
|
|
1789
|
-
deleted (total ${h.length}):${h.map(w=>`
|
|
1790
|
-
- `+w.toString()).join(`
|
|
1791
|
-
`)}`),!c&&f.length+h.length>0&&await Promise.allSettled([...f,...h].map(async w=>{const D=w.toString();xe.debug(`clear diagnostics for ${D}`);try{await s.sendDiagnostics({uri:D,diagnostics:[]})}catch(g){xe.warn(`error clearing diagnostics for ${D}: ${g}`)}})),c=!1,await At(d),await o.update(f,h,d)}),s.onRequest(SK,l=>{switch(!0){case"element"in l:return n.locateElement(l.element,l.property??"name");case"relation"in l:return n.locateRelation(l.relation);case"view"in l:return n.locateView(l.view);case"deployment"in l:return n.locateDeploymentElement(l.deployment,l.property??"name");default:Ie(l)}}),s.onRequest($K,async(l,d)=>await r.applyChange(l)),gs.create(()=>{u.cancel()}))}}class CK{constructor(e){this.services=e}getSymbolKind(e){const n=bt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Wn,Is,Si,Ti):return er.Constructor;case r(Oa,La,Fa,xa,Wa):return er.Namespace;case r(As):return er.Class;case r(_i,xs,Ps,Ha):return er.EnumMember;case r(Ai,Ua):return er.Event;case r(ri,$i,qa,Ba):return er.TypeParameter}return er.Field}getCompletionItemKind(e){const n=bt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Ps):return Ct.Color;case r(Wn,Si,Ti,Is):return Ct.Constructor;case r(Oa,La,Fa,xa,Wa):return Ct.Module;case r(As):return Ct.Class;case r(_i,xs,Ps,Ha):return Ct.EnumMember;case r(Ai,Ua):return Ct.Event;case r(ri,qa,$i,Ba):return Ct.TypeParameter;default:return Ct.Reference}}}class AK extends IS{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(yK,Wt.parse(wK))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&ax(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return Se(e,"Workspace not initialized"),Wt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return Se(e,"Workspace not initialized"),new URL(e.uri)}}class _K extends Mk{}class PK{constructor(e){this.services=e}cache=new WeakMap;viewsWithReportedErrors=new Set;get layouter(){return this.services.likec4.Layouter}async computedViews(e){const n=await this.services.likec4.ModelBuilder.buildComputedModel(e);return n?Du(n.views):[]}async layoutAllViews(e){const n=await this.computedViews(e);if(n.length===0)return[];const r=[],i=[];for(const s of n)this.viewsWithReportedErrors.delete(s.id),i.push(this.layouter.layout(s).then(a=>(this.cache.set(s,a),a)).catch(a=>(this.cache.delete(s),ye(a),Promise.reject(a))));for(const s of await Promise.allSettled(i))s.status==="fulfilled"&&r.push(s.value);return r}async layoutView(e,n){const r=await this.services.likec4.ModelBuilder.buildComputedModel(n);if(!r)return null;const i=r.views[e];if(!i)return null;let s=this.cache.get(i);if(s)return s;try{const a=await this.layouter.layout(i);return this.viewsWithReportedErrors.delete(e),this.cache.set(i,a),a}catch(a){if(!this.viewsWithReportedErrors.has(e)){const o=a instanceof Error?a.message:""+a;this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${o}`),this.viewsWithReportedErrors.add(e)}return xe.error(a),Promise.reject(a)}}async diagrams(){return(await this.layoutAllViews()).map(e=>e.diagram)}async viewsAsGraphvizOut(){const e="All-LayoutedViews-DotWithSvg",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=(await this.computedViews()).map(async a=>{const{dot:o,svg:u}=await this.layouter.svg(a);return{id:a.id,dot:o,svg:u}}),i=[],s=await Promise.allSettled(r);for(const a of s)a.status==="fulfilled"?i.push(a.value):ye(a.reason);return n.set(e,i),i}async overviewGraph(){const e="OverviewGraph",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const IK={lsp:{NodeKindProvider:t=>new CK(t),WorkspaceSymbolProvider:t=>new _K(t)},workspace:{WorkspaceManager:t=>new AK(t)}};function _t(t){return e=>new t(e)}const xK={documentation:{DocumentationProvider:_t(JH)},WorkspaceCache:t=>new AS(t.shared),DocumentCache:t=>new CS(t.shared),Rpc:_t(kK),likec4:{Layouter:t=>(xe.debug("Creating GraphvizLayouter with GraphvizWasmAdapter"),new m0(new g0)),Views:_t(PK),DeploymentsIndex:_t(b7),ModelChanges:_t(dK),FqnIndex:_t(T7),ModelParser:_t(nK),ModelBuilder:_t(cV),ModelLocator:_t(fV)},lsp:{CompletionProvider:_t(n7),DocumentHighlightProvider:_t(r7),DocumentSymbolProvider:_t(h7),SemanticTokenProvider:_t(v7),HoverProvider:_t(w7),CodeLensProvider:_t(t7),DocumentLinkProvider:_t(p7),Formatter:_t(e7)},references:{NameProvider:_t(fK),ScopeComputation:_t(hK),ScopeProvider:_t(gK)}};function NK(t,e,n,r){const i=OK(t),s=[v4({shared:i}),LU,xK,e,n,r].reduce(Y0,{}),a=Qf(s);return i.ServiceRegistry.register(a),HV(a),t.connection?a.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:a}}function OK(t={}){const e={...YS,...t};return t.connection&&YW(t.connection),Qf(D4(e),FU,IK)}function Y0(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=Y0(i,r):t[n]=r}}return t}function tn(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const yv=(t,e)=>{const n=X0(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},X0=t=>t instanceof URL?gm(t):t,J0=(t,e=[],n={})=>{const r=yv(t,"First argument"),[i,s]=tn(e)?[[],e]:[e,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const a=i.map(String),o=a.find(u=>u.includes("\0"));if(o!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${o}`);if(!tn(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,a,s]},{toString:Q0}=Object.prototype,FK=t=>Q0.call(t)==="[object ArrayBuffer]",ar=t=>Q0.call(t)==="[object Uint8Array]",ud=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),LK=new TextEncoder,Z0=t=>LK.encode(t),MK=new TextDecoder,e_=t=>MK.decode(t),BK=(t,e)=>zK(t,e).join(""),zK=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new eD(e),r=t.map(s=>typeof s=="string"?Z0(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},wv=t=>t.length===1&&ar(t[0])?t[0]:t_(qK(t)),qK=t=>t.map(e=>typeof e=="string"?Z0(e):e),t_=t=>{const e=new Uint8Array(jK(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},jK=t=>{let e=0;for(const n of t)e+=n.length;return e},UK=t=>Array.isArray(t)&&Array.isArray(t.raw),GK=(t,e)=>{let n=[];for(const[s,a]of t.entries())n=WK({templates:t,expressions:e,tokens:n,index:s,template:a});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},WK=({templates:t,expressions:e,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[r]}`);const{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:o}=HK(i,t.raw[r]),u=r_(n,s,a);if(r===e.length)return u;const c=e[r],l=Array.isArray(c)?c.map(d=>i_(d)):[i_(c)];return r_(u,l,o)},HK=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=n_.has(e[0]);for(let a=0,o=0;a<t.length;a+=1,o+=1){const u=e[o];if(n_.has(u))r!==a&&n.push(t.slice(r,a)),r=a+1;else if(u==="\\"){const c=e[o+1];c==="u"&&e[o+2]==="{"?o=e.indexOf("}",o+3):o+=VK[c]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},n_=new Set([" "," ","\r",`
|
|
1792
|
-
`]),VK={x:3,u:5},r_=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],i_=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(tn(t)&&("stdout"in t||"isMaxBuffer"in t))return KK(t);throw t instanceof Zb||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},KK=({stdout:t})=>{if(typeof t=="string")return t;if(ar(t))return e_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)},Us=t=>vv.includes(t),vv=[tt.stdin,tt.stdout,tt.stderr],Cr=["stdin","stdout","stderr"],s_=t=>Cr[t]??`stdio[${t}]`,YK=t=>{const e={...t};for(const n of c_)e[n]=a_(t,n);return e},a_=(t,e)=>{const n=Array.from({length:XK(t)+1}),r=JK(t[e],n,e);return nY(r,e)},XK=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Cr.length):Cr.length,JK=(t,e,n)=>tn(t)?QK(t,e,n):e.fill(t),QK=(t,e,n)=>{for(const r of Object.keys(t).sort(ZK))for(const i of eY(r,n,e))e[i]=t[r];return e},ZK=(t,e)=>o_(t)<o_(e)?1:-1,o_=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,eY=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=u_(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
1793
|
-
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
1794
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},u_=t=>{if(t==="all")return t;if(Cr.includes(t))return Cr.indexOf(t);const e=tY.exec(t);if(e!==null)return Number(e[1])},tY=/^fd(\d+)$/,nY=(t,e)=>t.map(n=>n===void 0?iY[e]:n),rY=B1("execa").enabled?"full":"none",iY={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:rY,stripFinalNewline:!0},c_=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],cd=(t,e)=>e==="ipc"?t.at(-1):t[e],bv=({verbose:t},e)=>Ev(t,e)!=="none",Dv=({verbose:t},e)=>!["none","short"].includes(Ev(t,e)),sY=({verbose:t},e)=>{const n=Ev(t,e);return Rv(n)?n:void 0},Ev=(t,e)=>e===void 0?aY(t):cd(t,e),aY=t=>t.find(e=>Rv(e))??Tv.findLast(e=>t.includes(e)),Rv=t=>typeof t=="function",Tv=["none","short","full"],oY=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>pY(l_(s))).join(" ");return{command:r,escapedCommand:i}},Sv=t=>z1(t).split(`
|
|
1795
|
-
`).map(e=>l_(e)).join(`
|
|
1796
|
-
`),l_=t=>t.replaceAll(lY,e=>uY(e)),uY=t=>{const e=dY[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=fY?`\\u${r.padStart(4,"0")}`:`\\U${r}`},cY=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},lY=cY(),dY={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},fY=65535,pY=t=>hY.test(t)?t:ux==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,hY=/^[\w./-]+$/;function mY(){return tt.platform!=="win32"?tt.env.TERM!=="linux":!!tt.env.WT_SESSION||!!tt.env.TERMINUS_SUBLIME||tt.env.ConEmuTask==="{cmd::Cmder}"||tt.env.TERM_PROGRAM==="Terminus-Sublime"||tt.env.TERM_PROGRAM==="vscode"||tt.env.TERM==="xterm-256color"||tt.env.TERM==="alacritty"||tt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const d_={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},gY={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},yY={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},wY={...d_,...gY},vY={...d_,...yY},bY=mY(),$v=bY?wY:vY,DY=Qb.WriteStream.prototype.hasColors(),qh=(t,e)=>{if(!DY)return i=>i;const n=`\x1B[${t}m`,r=`\x1B[${e}m`;return i=>{const s=i+"";let a=s.indexOf(r);if(a===-1)return n+s+r;let o=n,u=0;for(;a!==-1;)o+=s.slice(u,a)+n,u=a+r.length,a=s.indexOf(r,u);return o+=s.slice(u)+r,o}},EY=qh(1,22),kv=qh(90,39),RY=qh(91,39),TY=qh(93,39),SY=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:a=!0}})=>{const o=$Y(n),u=kY[t]({failed:s,reject:a,piped:r}),c=CY[t]({reject:a});return`${kv(`[${o}]`)} ${kv(`[${i}]`)} ${c(u)} ${c(e)}`},$Y=t=>`${jh(t.getHours(),2)}:${jh(t.getMinutes(),2)}:${jh(t.getSeconds(),2)}.${jh(t.getMilliseconds(),3)}`,jh=(t,e)=>String(t).padStart(e,"0"),f_=({failed:t,reject:e})=>t?e?$v.cross:$v.warning:$v.tick,kY={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:f_,duration:f_},p_=t=>t,CY={command:()=>EY,output:()=>p_,ipc:()=>p_,error:({reject:t})=>t?RY:TY,duration:()=>kv},AY=(t,e,n)=>{const r=sY(e,n);return t.map(({verboseLine:i,verboseObject:s})=>_Y(i,s,r)).filter(i=>i!==void 0).map(i=>PY(i)).join("")},_Y=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},PY=t=>t.endsWith(`
|
|
1797
|
-
`)?t:`${t}
|
|
1798
|
-
`,ld=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=IY({type:t,result:i,verboseInfo:r}),a=xY(e,s),o=AY(a,r,n);Lb(OY,o)},IY=({type:t,result:e,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:t,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:e,options:s}),xY=(t,e)=>t.split(`
|
|
1799
|
-
`).map(n=>NY({...e,message:n})),NY=t=>({verboseLine:SY(t),verboseObject:t}),OY=2,h_=t=>{const e=typeof t=="string"?t:Ed(t);return Sv(e).replaceAll(" "," ".repeat(FY))},FY=2,LY=(t,e)=>{bv(e)&&ld({type:"command",verboseMessage:t,verboseInfo:e})},MY=(t,e,n)=>{qY(t);const r=BY(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},BY=t=>bv({verbose:t})?zY++:void 0;let zY=0n;const qY=t=>{for(const e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Tv.includes(e)&&!Rv(e)){const n=Tv.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},m_=()=>Td.bigint(),g_=t=>Number(Td.bigint()-t)/1e6,y_=(t,e,n)=>{const r=m_(),{command:i,escapedCommand:s}=oY(t,e),a=a_(n,"verbose"),o=MY(a,s,{...n});return LY(s,o),{command:i,escapedCommand:s,startTime:r,verboseInfo:o}};var Gs={exports:{}},Cv,w_;function jY(){if(w_)return Cv;w_=1,Cv=r,r.sync=i;var t=ea;function e(s,a){var o=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return!0;for(var u=0;u<o.length;u++){var c=o[u].toLowerCase();if(c&&s.substr(-c.length).toLowerCase()===c)return!0}return!1}function n(s,a,o){return!s.isSymbolicLink()&&!s.isFile()?!1:e(a,o)}function r(s,a,o){t.stat(s,function(u,c){o(u,u?!1:n(c,s,a))})}function i(s,a){return n(t.statSync(s),s,a)}return Cv}var Av,v_;function UY(){if(v_)return Av;v_=1,Av=e,e.sync=n;var t=ea;function e(s,a,o){t.stat(s,function(u,c){o(u,u?!1:r(c,a))})}function n(s,a){return r(t.statSync(s),a)}function r(s,a){return s.isFile()&&i(s,a)}function i(s,a){var o=s.mode,u=s.uid,c=s.gid,l=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),d=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),f=parseInt("100",8),p=parseInt("010",8),h=parseInt("001",8),w=f|p,D=o&h||o&p&&c===d||o&f&&u===l||o&w&&l===0;return D}return Av}var _v,b_;function GY(){if(b_)return _v;b_=1;var t;process.platform==="win32"||e3.TESTING_WINDOWS?t=jY():t=UY(),_v=e,e.sync=n;function e(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(a,o){e(r,i||{},function(u,c){u?o(u):a(c)})})}t(r,i||{},function(a,o){a&&(a.code==="EACCES"||i&&i.ignoreErrors)&&(a=null,o=!1),s(a,o)})}function n(r,i){try{return t.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return _v}var Pv,D_;function WY(){if(D_)return Pv;D_=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=fr,n=t?";":":",r=GY(),i=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),s=(u,c)=>{const l=c.colon||n,d=u.match(/\//)||t&&u.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(c.path||process.env.PATH||"").split(l)],f=t?c.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=t?f.split(l):[""];return t&&u.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:d,pathExt:p,pathExtExe:f}},a=(u,c,l)=>{typeof c=="function"&&(l=c,c={}),c||(c={});const{pathEnv:d,pathExt:f,pathExtExe:p}=s(u,c),h=[],w=g=>new Promise((v,R)=>{if(g===d.length)return c.all&&h.length?v(h):R(i(u));const k=d[g],A=/^".*"$/.test(k)?k.slice(1,-1):k,j=e.join(A,u),W=!A&&/^\.[\\\/]/.test(u)?u.slice(0,2)+j:j;v(D(W,g,0))}),D=(g,v,R)=>new Promise((k,A)=>{if(R===f.length)return k(w(v+1));const j=f[R];r(g+j,{pathExt:p},(W,Z)=>{if(!W&&Z)if(c.all)h.push(g+j);else return k(g+j);return k(D(g,v,R+1))})});return l?w(0).then(g=>l(null,g),l):w(0)},o=(u,c)=>{c=c||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(u,c),p=[];for(let h=0;h<l.length;h++){const w=l[h],D=/^".*"$/.test(w)?w.slice(1,-1):w,g=e.join(D,u),v=!D&&/^\.[\\\/]/.test(u)?u.slice(0,2)+g:g;for(let R=0;R<d.length;R++){const k=v+d[R];try{if(r.sync(k,{pathExt:f}))if(c.all)p.push(k);else return k}catch{}}}if(c.all&&p.length)return p;if(c.nothrow)return null;throw i(u)};return Pv=a,a.sync=o,Pv}var Uh={exports:{}},E_;function HY(){if(E_)return Uh.exports;E_=1;const t=(e={})=>{const n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return Uh.exports=t,Uh.exports.default=t,Uh.exports}var Iv,R_;function VY(){if(R_)return Iv;R_=1;const t=fr,e=WY(),n=HY();function r(s,a){const o=s.options.env||process.env,u=process.cwd(),c=s.options.cwd!=null,l=c&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let d;try{d=e.sync(s.command,{path:o[n({env:o})],pathExt:a?t.delimiter:void 0})}catch{}finally{l&&process.chdir(u)}return d&&(d=t.resolve(c?s.options.cwd:"",d)),d}function i(s){return r(s)||r(s,!0)}return Iv=i,Iv}var Gh={},T_;function KY(){if(T_)return Gh;T_=1;const t=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(t,"^$1"),r}function n(r,i){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(t,"^$1"),i&&(r=r.replace(t,"^$1")),r}return Gh.command=e,Gh.argument=n,Gh}var xv,S_;function YY(){return S_||(S_=1,xv=/^#!(.*)/),xv}var Nv,$_;function XY(){if($_)return Nv;$_=1;const t=YY();return Nv=(e="")=>{const n=e.match(t);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},Nv}var Ov,k_;function JY(){if(k_)return Ov;k_=1;const t=ea,e=XY();function n(r){const s=Buffer.alloc(150);let a;try{a=t.openSync(r,"r"),t.readSync(a,s,0,150,0),t.closeSync(a)}catch{}return e(s.toString())}return Ov=n,Ov}var Fv,C_;function QY(){if(C_)return Fv;C_=1;const t=fr,e=VY(),n=KY(),r=JY(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function o(l){l.file=e(l);const d=l.file&&r(l.file);return d?(l.args.unshift(l.file),l.command=d,e(l)):l.file}function u(l){if(!i)return l;const d=o(l),f=!s.test(d);if(l.options.forceShell||f){const p=a.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(w=>n.argument(w,p));const h=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${h}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}function c(l,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const p={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?p:u(p)}return Fv=c,Fv}var Lv,A_;function ZY(){if(A_)return Lv;A_=1;const t=process.platform==="win32";function e(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}function n(s,a){if(!t)return;const o=s.emit;s.emit=function(u,c){if(u==="exit"){const l=r(c,a);if(l)return o.call(s,"error",l)}return o.apply(s,arguments)}}function r(s,a){return t&&s===1&&!a.file?e(a.original,"spawn"):null}function i(s,a){return t&&s===1&&!a.file?e(a.original,"spawnSync"):null}return Lv={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},Lv}var __;function eX(){if(__)return Gs.exports;__=1;const t=jb,e=QY(),n=ZY();function r(s,a,o){const u=e(s,a,o),c=t.spawn(u.command,u.args,u.options);return n.hookChildProcess(c,u),c}function i(s,a,o){const u=e(s,a,o),c=t.spawnSync(u.command,u.args,u.options);return c.error=c.error||n.verifyENOENTSync(c.status,u),c}return Gs.exports=r,Gs.exports.spawn=r,Gs.exports.sync=i,Gs.exports._parse=e,Gs.exports._enoent=n,Gs.exports}var tX=eX();const nX=vy(tX);function P_(t={}){const{env:e=process.env,platform:n=process.platform}=t;return n!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}const rX=({cwd:t=tt.cwd(),path:e=tt.env[P_()],preferLocal:n=!0,execPath:r=tt.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?gm(t):t,a=Pr.resolve(s),o=[];return n&&iX(o,a),i&&sX(o,r,a),[...o,e].join(Pr.delimiter)},iX=(t,e)=>{let n;for(;n!==e;)t.push(Pr.join(e,"node_modules/.bin")),n=e,e=Pr.resolve(e,"..")},sX=(t,e,n)=>{const r=e instanceof URL?gm(e):e;t.push(Pr.resolve(n,r,".."))},aX=({env:t=tt.env,...e}={})=>{t={...t};const n=P_({env:t});return e.path=t[n],t[n]=rX(e),t},oX=(t,e,n)=>{const r=n?zv:Bv,i=t instanceof dd?{}:{cause:t};return new r(e,i)};class dd extends Error{}const I_=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,x_,{value:!0,writable:!1,enumerable:!1,configurable:!1})},uX=t=>Mv(t)&&x_ in t,x_=Symbol("isExecaError"),Mv=t=>Object.prototype.toString.call(t)==="[object Error]";class Bv extends Error{}I_(Bv,Bv.name);class zv extends Error{}I_(zv,zv.name);const cX=()=>{const t=O_-N_+1;return Array.from({length:t},lX)},lX=(t,e)=>({name:`SIGRT${e+1}`,number:N_+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),N_=34,O_=64,dX=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],F_=()=>{const t=cX();return[...dX,...t].map(fX)},fX=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:a}}=Qi,o=a!==void 0;return{name:t,number:o?a:e,description:n,supported:o,action:r,forced:i,standard:s}},pX=()=>{const t=F_();return Object.fromEntries(t.map(hX))},hX=({name:t,number:e,description:n,supported:r,action:i,forced:s,standard:a})=>[t,{name:t,number:e,description:n,supported:r,action:i,forced:s,standard:a}],mX=pX(),gX=()=>{const t=F_(),e=O_+1,n=Array.from({length:e},(r,i)=>yX(i,t));return Object.assign({},...n)},yX=(t,e)=>{const n=wX(t,e);if(n===void 0)return{};const{name:r,description:i,supported:s,action:a,forced:o,standard:u}=n;return{[t]:{name:r,number:t,description:i,supported:s,action:a,forced:o,standard:u}}},wX=(t,e)=>{const n=e.find(({name:r})=>Qi.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};gX();const vX=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return L_(t,e)},bX=t=>t===0?t:L_(t,"`subprocess.kill()`'s argument"),L_=(t,e)=>{if(Number.isInteger(t))return DX(t,e);if(typeof t=="string")return RX(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
1800
|
-
${qv()}`)},DX=(t,e)=>{if(M_.has(t))return M_.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
1801
|
-
${qv()}`)},EX=()=>new Map(Object.entries(Qi.signals).reverse().map(([t,e])=>[e,t])),M_=EX(),RX=(t,e)=>{if(t in Qi.signals)return t;throw t.toUpperCase()in Qi.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
1802
|
-
${qv()}`)},qv=()=>`Available signal names: ${TX()}.
|
|
1803
|
-
Available signal numbers: ${SX()}.`,TX=()=>Object.keys(Qi.signals).sort().map(t=>`'${t}'`).join(", "),SX=()=>[...new Set(Object.values(Qi.signals).sort((t,e)=>t-e))].join(", "),B_=t=>mX[t].description,$X=t=>{if(t===!1)return t;if(t===!0)return kX;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},kX=1e3*5,CX=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},a,o)=>{const{signal:u,error:c}=AX(a,o,n);_X(c,r);const l=t(u);return PX({kill:t,signal:u,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},AX=(t,e,n)=>{const[r=n,i]=Mv(t)?[void 0,t]:[t,e];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!Mv(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:bX(r),error:i}},_X=(t,e)=>{t!==void 0&&e.reject(t)},PX=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:a})=>{e===r&&i&&z_({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:a.signal})},z_=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await tD(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},q_=async(t,e)=>{t.aborted||await wn(t,"abort",{signal:e})},IX=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},xX=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[NX(t,e,r,i)],NX=async(t,e,n,{signal:r})=>{throw await q_(e,r),n.terminationReason??="cancel",t.kill(),e.reason},jv=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{OX(t,e,n),j_(t,e,r)},OX=(t,e,n)=>{if(!n)throw new Error(`${or(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},j_=(t,e,n)=>{if(!n)throw new Error(`${or(t,e)} cannot be used: the ${zi(e)} has already exited or disconnected.`)},FX=t=>{throw new Error(`${or("getOneMessage",t)} could not complete: the ${zi(t)} exited or disconnected.`)},LX=t=>{throw new Error(`${or("sendMessage",t)} failed: the ${zi(t)} is sending a message too, instead of listening to incoming messages.
|
|
1804
|
-
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
1805
|
-
|
|
1806
|
-
const [receivedMessage] = await Promise.all([
|
|
1807
|
-
${or("getOneMessage",t)},
|
|
1808
|
-
${or("sendMessage",t,"message, {strict: true}")},
|
|
1809
|
-
]);`)},U_=(t,e)=>new Error(`${or("sendMessage",e)} failed when sending an acknowledgment response to the ${zi(e)}.`,{cause:t}),MX=t=>{throw new Error(`${or("sendMessage",t)} failed: the ${zi(t)} is not listening to incoming messages.`)},BX=t=>{throw new Error(`${or("sendMessage",t)} failed: the ${zi(t)} exited without listening to incoming messages.`)},zX=()=>new Error(`\`cancelSignal\` aborted: the ${zi(!0)} disconnected.`),qX=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},jX=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${or(e,n)} cannot be used: the ${zi(n)} is disconnecting.`,{cause:t})},UX=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(GX(t))throw new Error(`${or(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},GX=({code:t,message:e})=>WX.has(t)||HX.some(n=>e.includes(n)),WX=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),HX=["could not be cloned","circular structure","call stack size exceeded"],or=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${VX(e)}${t}(${n})`,VX=t=>t?"":"subprocess.",zi=t=>t?"parent process":"subprocess",Uv=t=>{t.connected&&t.disconnect()},fd=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},G_=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=Ws.get(t),s=W_(i,e,!0),a=t.stdio[s];if(a===null)throw new TypeError(H_(s,e,r,!0));return a},Gv=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=Ws.get(t),s=W_(i,e,!1),a=s==="all"?t.all:t.stdio[s];if(a==null)throw new TypeError(H_(s,e,r,!1));return a},Ws=new WeakMap,W_=(t,e,n)=>{const r=KX(e,n);return YX(r,e,n,t),r},KX=(t,e)=>{const n=u_(t);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${pd(e)}" must not be "${t}".
|
|
1810
|
-
It must be ${r} or "fd3", "fd4" (and so on).
|
|
1811
|
-
It is optional and defaults to "${i}".`)},YX=(t,e,n,r)=>{const i=r[V_(t)];if(i===void 0)throw new TypeError(`"${pd(n)}" must not be ${e}. That file descriptor does not exist.
|
|
1812
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${pd(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${pd(n)}" must not be ${e}. It must be a writable stream, not readable.`)},H_=(t,e,n,r)=>{if(t==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=XX(t,n);return`The "${i}: ${Wv(s)}" option is incompatible with using "${pd(r)}: ${Wv(e)}".
|
|
1813
|
-
Please set this option with "pipe" instead.`},XX=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=V_(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},V_=t=>t==="all"?1:t,pd=t=>t?"to":"from",Wv=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",Wh=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),rD(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},K_=(t,e)=>{e&&Hv(t)},Hv=t=>{t.refCounted()},Y_=(t,e)=>{e&&Vv(t)},Vv=t=>{t.unrefCounted()},JX=(t,e)=>{e&&(Vv(t),Vv(t))},QX=(t,e)=>{e&&(Hv(t),Hv(t))},ZX=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(aJ(i)||wJ(i))return;Hh.has(t)||Hh.set(t,[]);const s=Hh.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await dJ(t,r,i),await nD.yield();const a=await sJ({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",a),r.emit("message:done")}},eJ=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{nP();const s=Hh.get(t);for(;s?.length>0;)await wn(r,"message:done");t.removeListener("message",i),QX(e,n),r.connected=!1,r.emit("disconnect")},Hh=new WeakMap,Vh=(t,e,n)=>{if(Kh.has(t))return Kh.get(t);const r=new gx;return r.connected=!0,Kh.set(t,r),tJ({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},Kh=new WeakMap,tJ=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=ZX.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",eJ.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),JX(n,r)},X_=t=>{const e=Kh.get(t);return e===void 0?t.channel!==null:e.connected},nJ=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=Vh(t,e,n),a=Kv(t,s);return{id:rJ++,type:Xh,message:r,hasListeners:a}};let rJ=0n;const iJ=(t,e)=>{if(!(e?.type!==Xh||e.hasListeners))for(const{id:n}of t)n!==void 0&&Yh[n].resolve({isDeadlock:!0,hasListeners:!1})},sJ=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Xh||!e.connected)return t;const{id:s,message:a}=t,o={id:s,type:J_,message:Kv(e,i)};try{await Q_({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},o)}catch(u){i.emit("strict:error",u)}return a},aJ=t=>{if(t?.type!==J_)return!1;const{id:e,message:n}=t;return Yh[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},oJ=async(t,e,n)=>{if(t?.type!==Xh)return;const r=fd();Yh[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:a}=await Promise.race([r,uJ(e,n,i)]);s&&LX(n),a||MX(n)}finally{i.abort(),delete Yh[t.id]}},Yh={},uJ=async(t,e,{signal:n})=>{Wh(t,1,n),await wn(t,"disconnect",{signal:n}),BX(e)},Xh="execa:ipc:request",J_="execa:ipc:response",cJ=(t,e,n)=>{hd.has(t)||hd.set(t,new Set);const r=hd.get(t),i=fd(),s=n?e.id:void 0,a={onMessageSent:i,id:s};return r.add(a),{outgoingMessages:r,outgoingMessage:a}},lJ=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},dJ=async(t,e,n)=>{for(;!Kv(t,e)&&hd.get(t)?.size>0;){const r=[...hd.get(t)];iJ(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},hd=new WeakMap,Kv=(t,e)=>e.listenerCount("message")>fJ(t),fJ=t=>Ws.has(t)&&!cd(Ws.get(t).options.buffer,"ipc")?1:0,Q_=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const a="sendMessage";return jv({methodName:a,isSubprocess:n,ipc:r,isConnected:t.connected}),pJ({anyProcess:t,channel:e,methodName:a,isSubprocess:n,message:i,strict:s})},pJ=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const a=nJ({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),o=cJ(t,a,s);try{await Z_({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:a,message:i})}catch(u){throw Uv(t),u}finally{lJ(o)}},Z_=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=hJ(t);try{await Promise.all([oJ(r,t,n),s(r)])}catch(a){throw jX({error:a,methodName:e,isSubprocess:n}),UX({error:a,methodName:e,isSubprocess:n,message:i}),a}},hJ=t=>{if(Yv.has(t))return Yv.get(t);const e=q1(t.send.bind(t));return Yv.set(t,e),e},Yv=new WeakMap,mJ=(t,e)=>{const n="cancelSignal";return j_(n,!1,t.connected),Z_({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:tP,message:e},message:e})},gJ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await yJ({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),Xv.signal),yJ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!eP){if(eP=!0,!r){qX();return}if(e===null){nP();return}Vh(t,e,n),await nD.yield()}};let eP=!1;const wJ=t=>t?.type!==tP?!1:(Xv.abort(t.message),!0),tP="execa:ipc:cancel",nP=()=>{Xv.abort(zX())},Xv=new AbortController,vJ=({gracefulCancel:t,cancelSignal:e,ipc:n,serialization:r})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},bJ=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[DJ({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],DJ=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await q_(e,i);const s=EJ(e);throw await mJ(t,s),z_({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},EJ=({reason:t})=>{if(!(t instanceof DOMException))return t;const e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e},RJ=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},TJ=(t,e,n,r)=>e===0||e===void 0?[]:[SJ(t,e,n,r)],SJ=async(t,e,n,{signal:r})=>{throw await tD(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new dd},$J=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},kJ=(t,e,{node:n=!1,nodePath:r=cx,nodeOptions:i=lx.filter(u=>!u.startsWith("--inspect")),cwd:s,execPath:a,...o})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const u=yv(r,'The "nodePath" option'),c=Pr.resolve(s,u),l={...o,nodePath:c,node:n,cwd:s};if(!n)return[t,e,l];if(Pr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...i,t,...e],{ipc:!0,...l,shell:!1}]},CJ=({ipcInput:t,ipc:e,serialization:n})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");PJ[n](t)}},AJ=t=>{try{wx(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},_J=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},PJ={advanced:AJ,json:_J},IJ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},xJ=({encoding:t})=>{if(Jv.has(t))return;const e=OJ(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Jh(t)}\`.
|
|
1814
|
-
Please rename it to ${Jh(e)}.`);const n=[...Jv].map(r=>Jh(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Jh(t)}\`.
|
|
1815
|
-
Please rename it to one of: ${n}.`)},NJ=new Set(["utf8","utf16le"]),Hs=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Jv=new Set([...NJ,...Hs]),OJ=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in rP)return rP[e];if(Jv.has(e))return e},rP={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Jh=t=>typeof t=="string"?`"${t}"`:String(t),FJ=(t=iP())=>{const e=yv(t,'The "cwd" option');return Pr.resolve(e)},iP=()=>{try{return tt.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
1816
|
-
${t.message}`,t}},LJ=(t,e)=>{if(e===iP())return t;let n;try{n=P1(e)}catch(r){return`The "cwd" option is invalid: ${e}.
|
|
1817
|
-
${r.message}
|
|
1818
|
-
${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
1819
|
-
${t}`},sP=(t,e,n)=>{n.cwd=FJ(n.cwd);const[r,i,s]=kJ(t,e,n),{command:a,args:o,options:u}=nX._parse(r,i,s),c=YK(u),l=MJ(c);return RJ(l),xJ(l),CJ(l),IX(l),vJ(l),l.shell=X0(l.shell),l.env=BJ(l),l.killSignal=vX(l.killSignal),l.forceKillAfterDelay=$X(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!Hs.has(l.encoding)&&l.buffer[f]),tt.platform==="win32"&&Pr.basename(a,".exe")==="cmd"&&o.unshift("/q"),{file:a,commandArguments:o,options:l}},MJ=({extendEnv:t=!0,preferLocal:e=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:o=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:h="advanced",...w})=>({...w,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:a,all:o,windowsHide:u,killSignal:c,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:f,ipc:p,serialization:h}),BJ=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const a=e?{...tt.env,...t}:t;return n||r?aX({env:a,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):a};function Qv(t){if(typeof t=="string")return zJ(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return qJ(t)}const zJ=t=>t.at(-1)===aP?t.slice(0,t.at(-2)===oP?-2:-1):t,qJ=t=>t.at(-1)===jJ?t.subarray(0,t.at(-2)===UJ?-2:-1):t,aP=`
|
|
1820
|
-
`,jJ=aP.codePointAt(0),oP="\r",UJ=oP.codePointAt(0);function Vs(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function uP(t,{checkOpen:e=!0}={}){return Vs(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Qh(t,{checkOpen:e=!0}={}){return Vs(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function cP(t,e){return uP(t,e)&&Qh(t,e)}const GJ=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let WJ=class{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#i(e);return this.#r?this.#r.then(n,n):n()}async#s(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(n){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),n}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const n=this.#e.cancel(e);return this.#e.releaseLock(),await n,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Zv=Symbol();function lP(){return this[Zv].next()}Object.defineProperty(lP,"name",{value:"next"});function dP(t){return this[Zv].return(t)}Object.defineProperty(dP,"name",{value:"return"});const HJ=Object.create(GJ,{next:{enumerable:!0,configurable:!0,writable:!0,value:lP},return:{enumerable:!0,configurable:!0,writable:!0,value:dP}});function VJ({preventCancel:t=!1}={}){const e=this.getReader(),n=new WJ(e,t),r=Object.create(HJ);return r[Zv]=n,r}const KJ=t=>{if(Qh(t,{checkOpen:!1})&&eb.on!==void 0)return XJ(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(YJ.call(t)==="[object ReadableStream]")return VJ.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:YJ}=Object.prototype,XJ=async function*(t){const e=new AbortController,n={};JJ(t,e,n);try{for await(const[r]of eb.on(t,"data",{signal:e.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!e.signal.aborted)throw r}finally{t.destroy()}},JJ=async(t,e,n)=>{try{await eb.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},eb={},tb=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:o},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{const c=KJ(t),l=e();l.length=0;try{for await(const d of c){const f=ZJ(d),p=n[f](d,l);fP({convertedChunk:p,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:u})}return QJ({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,maxBuffer:u}),o(l)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=o(l),f}},QJ=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const a=i(t);a!==void 0&&fP({convertedChunk:a,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},fP=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const a=n(t),o=e.length+a;if(o<=s){pP(t,e,i,o);return}const u=r(t,s-e.length);throw u!==void 0&&pP(u,e,i,s),new Zh},pP=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},ZJ=t=>{const e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=hP.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&hP.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:hP}=Object.prototype;class Zh extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Ks=t=>t,nb=()=>{},mP=({contents:t})=>t,gP=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},yP=t=>t.length;async function eQ(t,e){return tb(t,iQ,e)}const tQ=()=>({contents:[]}),nQ=()=>1,rQ=(t,{contents:e})=>(e.push(t),e),iQ={init:tQ,convertChunk:{string:Ks,buffer:Ks,arrayBuffer:Ks,dataView:Ks,typedArray:Ks,others:Ks},getSize:nQ,truncateChunk:nb,addChunk:rQ,getFinalChunk:nb,finalize:mP};async function sQ(t,e){return tb(t,hQ,e)}const aQ=()=>({contents:new ArrayBuffer(0)}),oQ=t=>uQ.encode(t),uQ=new TextEncoder,wP=t=>new Uint8Array(t),vP=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),cQ=(t,e)=>t.slice(0,e),lQ=(t,{contents:e,length:n},r)=>{const i=EP()?fQ(e,r):dQ(e,r);return new Uint8Array(i).set(t,n),i},dQ=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(bP(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},fQ=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:bP(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},bP=t=>DP**Math.ceil(Math.log(t)/Math.log(DP)),DP=2,pQ=({contents:t,length:e})=>EP()?t:t.slice(0,e),EP=()=>"resize"in ArrayBuffer.prototype,hQ={init:aQ,convertChunk:{string:oQ,buffer:wP,arrayBuffer:wP,dataView:vP,typedArray:vP,others:gP},getSize:yP,truncateChunk:cQ,addChunk:lQ,getFinalChunk:nb,finalize:pQ};async function mQ(t,e){return tb(t,bQ,e)}const gQ=()=>({contents:"",textDecoder:new TextDecoder}),em=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),yQ=(t,{contents:e})=>e+t,wQ=(t,e)=>t.slice(0,e),vQ=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},bQ={init:gQ,convertChunk:{string:Ks,buffer:em,arrayBuffer:em,dataView:em,typedArray:em,others:gP},getSize:yP,truncateChunk:wQ,addChunk:yQ,getFinalChunk:vQ,finalize:mP},DQ=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Zh))throw t;if(s==="all")return t;const a=EQ(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:a},e.destroy(),t},EQ=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",RQ=(t,e,n)=>{if(e.length!==n)return;const r=new Zh;throw r.maxBufferInfo={fdNumber:"ipc"},r},TQ=(t,e)=>{const{streamName:n,threshold:r,unit:i}=SQ(t,e);return`Command's ${n} was larger than ${r} ${i}`},SQ=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=t;delete t.maxBufferInfo;const i=cd(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:s_(n),threshold:i,unit:r}},$Q=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>rb(n)),kQ=(t,e,n)=>{if(!e)return t;const r=rb(n);return t.length>r?t.slice(0,r):t},rb=([,t])=>t,CQ=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:a,escapedCommand:o,timedOut:u,isCanceled:c,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h,maxBuffer:w,timeout:D,cwd:g})=>{const v=r?.code,R=AQ({originalError:r,timedOut:u,timeout:D,isMaxBuffer:d,maxBuffer:w,errorCode:v,signal:i,signalDescription:s,exitCode:a,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h}),k=PQ(r,g),A=k===void 0?"":`
|
|
1821
|
-
${k}`,j=`${R}: ${o}${A}`,W=e===void 0?[t[2],t[1]]:[e],Z=[j,...W,...t.slice(3),n.map(J=>IQ(J)).join(`
|
|
1822
|
-
`)].map(J=>Sv(Qv(xQ(J)))).filter(Boolean).join(`
|
|
1823
|
-
|
|
1824
|
-
`);return{originalMessage:k,shortMessage:j,message:Z}},AQ=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:a,signalDescription:o,exitCode:u,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{const h=_Q(d,f);return e?`Command timed out after ${n} milliseconds${h}`:l?a===void 0?`Command was gracefully canceled with exit code ${u}`:d?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${a} (${o})`:c?`Command was canceled${h}`:r?`${TQ(t,i)}${h}`:s!==void 0?`Command failed with ${s}${h}`:d?`Command was killed with ${p} (${B_(p)})${h}`:a!==void 0?`Command was killed with ${a} (${o})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},_Q=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",PQ=(t,e)=>{if(t instanceof dd)return;const n=uX(t)?t.originalMessage:String(t?.message??t),r=Sv(LJ(n,e));return r===""?void 0:r},IQ=t=>typeof t=="string"?t:Ed(t),xQ=t=>Array.isArray(t)?t.map(e=>Qv(RP(e))).filter(Boolean).join(`
|
|
1825
|
-
`):RP(t),RP=t=>typeof t=="string"?t:ar(t)?e_(t):"",TP=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>SP({command:t,escapedCommand:e,cwd:s,durationMs:g_(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),ib=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>sb({error:t,command:e,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:a}),sb=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:h,timeout:w=h,forceKillAfterDelay:D,killSignal:g,cwd:v,maxBuffer:R},isSync:k})=>{const{exitCode:A,signal:j,signalDescription:W}=OQ(c,l),{originalMessage:Z,shortMessage:J,message:de}=CQ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:j,signalDescription:W,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,forceKillAfterDelay:D,killSignal:g,maxBuffer:R,timeout:w,cwd:v}),N=oX(t,de,k);return Object.assign(N,NQ({error:N,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:A,signal:j,signalDescription:W,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:Z,shortMessage:J})),N},NQ=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:d,stdio:f,all:p,ipcOutput:h,cwd:w,originalMessage:D,shortMessage:g})=>SP({shortMessage:g,originalMessage:D,command:e,escapedCommand:n,cwd:w,durationMs:g_(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:l!==void 0,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:h,pipedFrom:[]}),SP=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),OQ=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:B_(e);return{exitCode:n,signal:r,signalDescription:i}},$P=t=>Number.isFinite(t)?t:0;function FQ(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc($P(t*1e3)%1e3),nanoseconds:Math.trunc($P(t*1e6)%1e3)}}function LQ(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function MQ(t){switch(typeof t){case"number":{if(Number.isFinite(t))return FQ(t);break}case"bigint":return LQ(t)}throw new TypeError("Expected a finite number or bigint")}const BQ=t=>t===0||t===0n,zQ=(t,e)=>e===1||e===1n?t:`${t}s`,qQ=1e-7,jQ=24n*60n*60n*1000n;function kP(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,d)=>{const f=Math.floor(l*10**d+qQ);return(Math.round(f)/10**d).toFixed(d)},a=(l,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&BQ(l)&&!(e.colonNotation&&f==="m"))){if(p??=String(l),e.colonNotation){const h=p.includes(".")?p.split(".")[0].length:p.length,w=i.length>0?2:1;p="0".repeat(Math.max(0,w-h))+p}else p+=e.verbose?" "+zQ(d,l):f;i.push(p)}},o=MQ(t),u=BigInt(o.days);if(e.hideYearAndDays?a(BigInt(u)*24n+BigInt(o.hours),"hour","h"):(e.hideYear?a(u,"day","d"):(a(u/365n,"year","y"),a(u%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(o.seconds),d=Number(o.milliseconds),f=Number(o.microseconds),p=Number(o.nanoseconds);if(a(l,"second","s"),e.formatSubMilliseconds)a(d,"millisecond","ms"),a(f,"microsecond","\xB5s"),a(p,"nanosecond","ns");else{const h=d+f/1e3+p/1e6,w=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,D=h>=1?Math.round(h):Math.ceil(h),g=w?h.toFixed(w):D;a(Number.parseFloat(g),"millisecond","ms",g)}}else{const l=(n?Number(t%jQ):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");a(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(c)}const UQ=(t,e)=>{t.failed&&ld({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},GQ=(t,e)=>{bv(e)&&(UQ(t,e),WQ(t,e))},WQ=(t,e)=>{const n=`(done in ${kP(t.durationMs)})`;ld({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},ab=(t,e,{reject:n})=>{if(GQ(t,e),t.failed&&n)throw t;return t},HQ=(t,e)=>Qa(t)?"asyncGenerator":IP(t)?"generator":ub(t)?"fileUrl":QQ(t)?"filePath":tZ(t)?"webStream":Vs(t,{checkOpen:!1})?"native":ar(t)?"uint8Array":nZ(t)?"asyncIterable":rZ(t)?"iterable":lb(t)?CP({transform:t},e):XQ(t)?VQ(t,e):"native",VQ=(t,e)=>cP(t.transform,{checkOpen:!1})?KQ(t,e):lb(t.transform)?CP(t,e):YQ(t,e),KQ=(t,e)=>(AP(t,e,"Duplex stream"),"duplex"),CP=(t,e)=>(AP(t,e,"web TransformStream"),"webTransform"),AP=({final:t,binary:e,objectMode:n},r,i)=>{_P(t,`${r}.final`,i),_P(e,`${r}.binary`,i),ob(n,`${r}.objectMode`)},_P=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},YQ=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!PP(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(cP(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(lb(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!PP(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return ob(n,`${i}.binary`),ob(r,`${i}.objectMode`),Qa(t)||Qa(e)?"asyncGenerator":"generator"},ob=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},PP=t=>Qa(t)||IP(t),Qa=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",IP=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",XQ=t=>tn(t)&&(t.transform!==void 0||t.final!==void 0),ub=t=>Object.prototype.toString.call(t)==="[object URL]",JQ=t=>ub(t)&&t.protocol!=="file:",QQ=t=>tn(t)&&Object.keys(t).length===1&&xP(t.file),xP=t=>typeof t=="string",ZQ=(t,e)=>t==="native"&&typeof e=="string"&&!eZ.has(e),eZ=new Set(["ipc","ignore","inherit","overlapped","pipe"]),NP=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",cb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",tZ=t=>NP(t)||cb(t),lb=t=>NP(t?.readable)&&cb(t?.writable),nZ=t=>OP(t)&&typeof t[Symbol.asyncIterator]=="function",rZ=t=>OP(t)&&typeof t[Symbol.iterator]=="function",OP=t=>typeof t=="object"&&t!==null,Ys=new Set(["generator","asyncGenerator","duplex","webTransform"]),FP=new Set(["fileUrl","filePath","fileNumber"]),LP=new Set(["fileUrl","filePath"]),iZ=new Set([...LP,"webStream","nodeStream"]),sZ=new Set(["webTransform","duplex"]),tm={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},MP=(t,e,n,r)=>r==="output"?aZ(t,e,n):oZ(t,e,n),aZ=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},oZ=(t,e,n)=>{const r=e===0?t===!0:n[e-1].value.readableObjectMode,i=e!==n.length-1&&(t??r);return{writableObjectMode:r,readableObjectMode:i}},uZ=(t,e)=>{const n=t.findLast(({type:r})=>Ys.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},cZ=(t,e,n,r)=>[...t.filter(({type:i})=>!Ys.has(i)),...lZ(t,e,n,r)],lZ=(t,e,n,{encoding:r})=>{const i=t.filter(({type:a})=>Ys.has(a)),s=Array.from({length:i.length});for(const[a,o]of Object.entries(i))s[a]=dZ({stdioItem:o,index:Number(a),newTransforms:s,optionName:e,direction:n,encoding:r});return mZ(s,n)},dZ=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>e==="duplex"?fZ({stdioItem:t,optionName:i}):e==="webTransform"?pZ({stdioItem:t,index:n,newTransforms:r,direction:s}):hZ({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:a}),fZ=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:n,readableObjectMode:r}}},pZ=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=tn(e)?e:{transform:e},{writableObjectMode:o,readableObjectMode:u}=MP(a,n,r,i);return{...t,value:{transform:s,writableObjectMode:o,readableObjectMode:u}}},hZ=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:a,final:o,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=tn(e)?e:{transform:e},d=u||Hs.has(s),{writableObjectMode:f,readableObjectMode:p}=MP(l,n,r,i);return{...t,value:{transform:a,final:o,binary:d,preserveNewlines:c,writableObjectMode:f,readableObjectMode:p}}},mZ=(t,e)=>e==="input"?t.reverse():t,gZ=(t,e,n)=>{const r=t.map(i=>yZ(i,e));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??bZ},yZ=({type:t,value:e},n)=>wZ[n]??BP[t](e),wZ=["input","output","output"],Za=()=>{},db=()=>"input",BP={generator:Za,asyncGenerator:Za,fileUrl:Za,filePath:Za,iterable:db,asyncIterable:db,uint8Array:db,webStream:t=>cb(t)?"output":"input",nodeStream(t){return Qh(t,{checkOpen:!1})?uP(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Za,duplex:Za,native(t){const e=vZ(t);if(e!==void 0)return e;if(Vs(t,{checkOpen:!1}))return BP.nodeStream(t)}},vZ=t=>{if([0,tt.stdin].includes(t))return"input";if([1,2,tt.stdout,tt.stderr].includes(t))return"output"},bZ="output",DZ=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,EZ=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const a=RZ(t,r).map((o,u)=>zP(o,u));return s?SZ(a,n,i):DZ(a,e)},RZ=(t,e)=>{if(t===void 0)return Cr.map(r=>e[r]);if(TZ(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Cr.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,Cr.length);return Array.from({length:n},(r,i)=>t[i])},TZ=t=>Cr.some(e=>t[e]!==void 0),zP=(t,e)=>Array.isArray(t)?t.map(n=>zP(n,e)):t??(e>=Cr.length?"ignore":"pipe"),SZ=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!Dv(n,i)&&$Z(r)?"ignore":r),$Z=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),kZ=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?CZ({stdioItem:t,fdNumber:r,direction:i}):PZ({stdioItem:t,fdNumber:r}),CZ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=AZ({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(Vs(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},AZ=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=_Z(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(Qb.isatty(i))throw new TypeError(`The \`${e}: ${Wv(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:ud(mm(i)),optionName:e}}},_Z=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=vv.indexOf(t);if(n!==-1)return n},PZ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:qP(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:qP(e,e,n),optionName:n}:Vs(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,qP=(t,e,n)=>{const r=vv[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},IZ=({input:t,inputFile:e},n)=>n===0?[...xZ(t),...OZ(e)]:[],xZ=t=>t===void 0?[]:[{type:NZ(t),value:t,optionName:"input"}],NZ=t=>{if(Qh(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(ar(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},OZ=t=>t===void 0?[]:[{...FZ(t),optionName:"inputFile"}],FZ=t=>{if(ub(t))return{type:"fileUrl",value:t};if(xP(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},LZ=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),MZ=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=BZ(i,t);if(a.length!==0){if(s){zZ({otherStdioItems:a,type:t,value:e,optionName:n,direction:r});return}if(iZ.has(t))return jP({otherStdioItems:a,type:t,value:e,optionName:n,direction:r});sZ.has(t)&&jZ({otherStdioItems:a,type:t,value:e,optionName:n})}},BZ=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),zZ=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{LP.has(e)&&jP({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},jP=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(o=>qZ(o,n));if(s.length===0)return;const a=s.find(o=>o.direction!==i);return UP(a,r,e),i==="output"?s[0].stream:void 0},qZ=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,jZ=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);UP(i,r,e)},UP=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${tm[n]} that is the same.`)},GP=(t,e,n,r)=>{const s=EZ(e,n,r).map((o,u)=>UZ({stdioOption:o,fdNumber:u,options:e,isSync:r})),a=JZ({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=a.map(({stdioItems:o})=>eee(o)),a},UZ=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=s_(e),{stdioItems:s,isStdioArray:a}=GZ({stdioOption:t,fdNumber:e,options:n,optionName:i}),o=gZ(s,e,i),u=s.map(d=>kZ({stdioItem:d,isStdioArray:a,fdNumber:e,direction:o,isSync:r})),c=cZ(u,i,o,n),l=uZ(c,o);return XZ(c,l),{direction:o,objectMode:l,stdioItems:c}},GZ=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(u=>WZ(u,r)),...IZ(n,e)],a=LZ(s),o=a.length>1;return HZ(a,o,r),KZ(a),{stdioItems:a,isStdioArray:o}},WZ=(t,e)=>({type:HQ(t,e),value:t,optionName:e}),HZ=(t,e,n)=>{if(t.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(e){for(const{value:r,optionName:i}of t)if(VZ.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},VZ=new Set(["ignore","ipc"]),KZ=t=>{for(const e of t)YZ(e)},YZ=({type:t,value:e,optionName:n})=>{if(JQ(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
1826
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(ZQ(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},XZ=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>FP.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},JZ=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(QZ({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw WP(i),s}},QZ=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:a})=>{const o=n.map(u=>ZZ({stdioItem:u,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:a}));return{direction:t,objectMode:e,stdioItems:o}},ZZ=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const a=MZ({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...t,stream:a}:{...t,...e[n][t.type](t,r)}},WP=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!Us(n)&&n.destroy()},eee=t=>{if(t.length>1)return t.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:e,value:n}]=t;return e==="native"?n:"pipe"},tee=(t,e)=>GP(ree,t,e,!0),Ar=({type:t,optionName:e})=>{HP(e,tm[t])},nee=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&HP(t,`"${e}"`),{}),HP=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},VP={generator(){},asyncGenerator:Ar,webStream:Ar,nodeStream:Ar,webTransform:Ar,duplex:Ar,asyncIterable:Ar,native:nee},ree={input:{...VP,fileUrl:({value:t})=>({contents:[ud(mm(t))]}),filePath:({value:{file:t}})=>({contents:[ud(mm(t))]}),fileNumber:Ar,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...VP,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Ar,string:Ar,uint8Array:Ar}},eo=(t,{stripFinalNewline:e},n)=>KP(e,n)&&t!==void 0&&!Array.isArray(t)?Qv(t):t,KP=(t,e)=>e==="all"?t[1]||t[2]:t[e],YP=(t,e,n,r)=>t||n?void 0:QP(e,r),XP=(t,e,n)=>n?t.flatMap(r=>JP(r,e)):JP(t,e),JP=(t,e)=>{const{transform:n,final:r}=QP(e,{});return[...n(t),...r()]},QP=(t,e)=>(e.previousChunks="",{transform:iee.bind(void 0,e,t),final:aee.bind(void 0,e)}),iee=function*(t,e,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=t,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
|
|
1827
|
-
`){const a=see(n,s,e,t);let o=n.slice(i+1,s+1-a);r.length>0&&(o=fb(r,o),r=""),yield o,i=s}i!==n.length-1&&(r=fb(r,n.slice(i+1))),t.previousChunks=r},see=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),aee=function*({previousChunks:t}){t.length>0&&(yield t)},oee=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:uee.bind(void 0,r)},uee=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?cee:dee;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},fb=(t,e)=>`${t}${e}`,cee={windowsNewline:`\r
|
|
1828
|
-
`,unixNewline:`
|
|
1829
|
-
`,LF:`
|
|
1830
|
-
`,concatBytes:fb},lee=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},dee={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:lee},fee=(t,e)=>t?void 0:pee.bind(void 0,e),pee=function*(t,e){if(typeof e!="string"&&!ar(e)&&!Tm.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},hee=(t,e)=>t?mee.bind(void 0,e):gee.bind(void 0,e),mee=function*(t,e){ZP(t,e),yield e},gee=function*(t,e){if(ZP(t,e),typeof e!="string"&&!ar(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},ZP=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
1831
|
-
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
1832
|
-
if (condition) { yield value; }`)},eI=(t,e,n)=>{if(n)return;if(t)return{transform:yee.bind(void 0,new TextEncoder)};const r=new eD(e);return{transform:wee.bind(void 0,r),final:vee.bind(void 0,r)}},yee=function*(t,e){Tm.isBuffer(e)?yield ud(e):typeof e=="string"?yield t.encode(e):yield e},wee=function*(t,e){yield ar(e)?t.write(e):e},vee=function*(t){const e=t.end();e!==""&&(yield e)},tI=Zs(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),pb=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=Ree}=e[n];for await(const i of r(t))yield*pb(i,e,n+1)},bee=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*Dee(n,Number(e),t)},Dee=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*pb(r,n,e+1)},Eee=Zs(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Ree=function*(t){yield t},nI=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},Tee=(t,e)=>[...e.flatMap(n=>[...md(n,t,0)]),...hb(t)],md=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=$ee}=e[n];for(const i of r(t))yield*md(i,e,n+1)},hb=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*See(n,Number(e),t)},See=function*(t,e,n){if(t!==void 0)for(const r of t())yield*md(r,n,e+1)},$ee=function*(t){yield t},rI=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const o={},u=sI(t,a,s),c=Qa(e),l=Qa(n),d=c?tI.bind(void 0,pb,o):nI.bind(void 0,md),f=c||l?tI.bind(void 0,bee,o):nI.bind(void 0,hb),p=c||l?Eee.bind(void 0,o):void 0;return{stream:new vx({writableObjectMode:r,writableHighWaterMark:$d(r),readableObjectMode:i,readableHighWaterMark:$d(i),transform(w,D,g){d([w,u,0],this,g)},flush(w){f([u],this,w)},destroy:p})}},iI=(t,e,n,r)=>{const i=e.filter(({type:a})=>a==="generator"),s=r?i.reverse():i;for(const{value:a,optionName:o}of s){const u=sI(a,n,o);t=Tee(u,t)}return t},sI=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,o)=>{const u={};return[{transform:fee(r,o)},eI(n,a,r),YP(n,s,r,u),{transform:t,final:e},{transform:hee(i,o)},oee({binary:n,preserveNewlines:s,readableObjectMode:i,state:u})].filter(Boolean)},kee=(t,e)=>{for(const n of Cee(t))Aee(t,n,e)},Cee=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Aee=(t,e,n)=>{const{stdioItems:r}=t[e],i=r.filter(({contents:o})=>o!==void 0);if(i.length===0)return;if(e!==0){const[{type:o,optionName:u}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${tm[o]} with synchronous methods.`)}const a=i.map(({contents:o})=>o).map(o=>_ee(o,r));n.input=wv(a)},_ee=(t,e)=>{const n=iI(t,e,"utf8",!0);return Pee(n),wv(n)},Pee=t=>{const e=t.find(n=>typeof n!="string"&&!ar(n));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)},aI=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&Dv(n,r)&&!Hs.has(e)&&Iee(r)&&(t.some(({type:i,value:s})=>i==="native"&&xee.has(s))||t.every(({type:i})=>Ys.has(i))),Iee=t=>t===1||t===2,xee=new Set(["pipe","overlapped"]),Nee=async(t,e,n,r)=>{for await(const i of t)Fee(e)||oI(i,n,r)},Oee=(t,e,n)=>{for(const r of t)oI(r,e,n)},Fee=t=>t._readableState.pipes.length>0,oI=(t,e,n)=>{const r=h_(t);ld({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},Lee=({fileDescriptors:t,syncResult:{output:e},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};const s={},a=new Set([]);return{output:e.map((u,c)=>Mee({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},Mee=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:o,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;const f=kQ(t,s,d),p=ud(f),{stdioItems:h,objectMode:w}=e[n],D=Bee([p],h,u,r),{serializedResult:g,finalResult:v=g}=zee({chunks:D,objectMode:w,encoding:u,lines:c,stripFinalNewline:l,fdNumber:n});qee({serializedResult:g,fdNumber:n,state:r,verboseInfo:a,encoding:u,stdioItems:h,objectMode:w});const R=o[n]?v:void 0;try{return r.error===void 0&&jee(g,h,i),R}catch(k){return r.error=k,R}},Bee=(t,e,n,r)=>{try{return iI(t,e,n,!1)}catch(i){return r.error=i,t}},zee=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:wv(t)};const a=BK(t,n);return r[s]?{serializedResult:a,finalResult:XP(a,!i[s],e)}:{serializedResult:a}},qee=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!aI({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const o=XP(t,!1,a);try{Oee(o,e,r)}catch(u){n.error??=u}},jee=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>FP.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?I1(r,t):(n.add(i),Lb(r,t))}},Uee=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,eo(e,n,"all")]:Array.isArray(e)?[eo(t,n,"all"),...e]:ar(t)&&ar(e)?t_([t,e]):`${t}${e}`},Gee=async(t,e)=>{const[n,r]=await Wee(t);return e.isForcefullyTerminated??=!1,[n,r]},Wee=async t=>{const[e,n]=await Promise.allSettled([wn(t,"spawn"),wn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?uI(t):n.value},uI=async t=>{try{return await wn(t,"exit")}catch{return uI(t)}},Hee=async t=>{const[e,n]=await t;if(!Vee(e,n)&&cI(e,n))throw new dd;return[e,n]},Vee=(t,e)=>t===void 0&&e===void 0,cI=(t,e)=>t!==0||e!==null,Kee=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Yee(t,e,n),a=s?.code==="ETIMEDOUT",o=$Q(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:a,isMaxBuffer:o}},Yee=(t,e,n)=>t!==void 0?t:cI(e,n)?new dd:void 0,Xee=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:o,verboseInfo:u,options:c,fileDescriptors:l}=Jee(t,e,n),d=ete({file:r,commandArguments:i,options:c,command:s,escapedCommand:a,verboseInfo:u,fileDescriptors:l,startTime:o});return ab(d,u,c)},Jee=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=y_(t,e,n),o=Qee(n),{file:u,commandArguments:c,options:l}=sP(t,e,o);Zee(l);const d=tee(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:d}},Qee=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Zee=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&nm("ipcInput"),t&&nm("ipc: true"),n&&nm("detached: true"),r&&nm("cancelSignal")},nm=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},ete=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:o})=>{const u=tte({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o});if(u.failed)return u;const{resultError:c,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p}=Kee(u,n),{output:h,error:w=c}=Lee({fileDescriptors:a,syncResult:u,options:n,isMaxBuffer:p,verboseInfo:s}),D=h.map((v,R)=>eo(v,n,R)),g=eo(Uee(h,n),n,"all");return rte({error:w,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p,stdio:D,all:g,options:n,command:r,escapedCommand:i,startTime:o})},tte=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{kee(s,n);const o=nte(n);return fx(t,e,o)}catch(o){return ib({error:o,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},nte=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:rb(e)}),rte=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:a,options:o,command:u,escapedCommand:c,startTime:l})=>t===void 0?TP({command:u,escapedCommand:c,stdio:s,all:a,ipcOutput:[],options:o,startTime:l}):sb({error:t,command:u,escapedCommand:c,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:a,ipcOutput:[],options:o,startTime:l,isSync:!0}),ite=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(jv({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:X_(t)}),ste({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),ste=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{K_(e,i);const s=Vh(t,e,n),a=new AbortController;try{return await Promise.race([ate(s,r,a),ote(s,n,a),ute(s,n,a)])}catch(o){throw Uv(t),o}finally{a.abort(),Y_(e,i)}},ate=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await wn(t,"message",{signal:n});return r}for await(const[r]of Sd(t,"message",{signal:n}))if(e(r))return r},ote=async(t,e,{signal:n})=>{await wn(t,"disconnect",{signal:n}),FX(e)},ute=async(t,e,{signal:n})=>{const[r]=await wn(t,"strict:error",{signal:n});throw U_(r,e)},cte=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>lI({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),lI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{jv({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:X_(t)}),K_(e,s);const a=Vh(t,e,n),o=new AbortController,u={};return lte(t,a,o),dte({ipcEmitter:a,isSubprocess:n,controller:o,state:u}),fte({anyProcess:t,channel:e,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:o,state:u,reference:s})},lte=async(t,e,n)=>{try{await wn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},dte=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await wn(t,"strict:error",{signal:n.signal});r.error=U_(i,e),n.abort()}catch{}},fte=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:a,reference:o}){try{for await(const[u]of Sd(n,"message",{signal:s.signal}))dI(a),yield u}catch{dI(a)}finally{s.abort(),Y_(e,o),r||Uv(t),i&&await t}},dI=({error:t})=>{if(t)throw t},pte=(t,{ipc:e})=>{Object.assign(t,fI(t,!1,e))},hte=()=>{const t=tt,e=!0,n=tt.channel!==void 0;return{...fI(t,e,n),getCancelSignal:gJ.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},fI=(t,e,n)=>({sendMessage:Q_.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:ite.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:cte.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),mte=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{WP(r);const o=new Zb;gte(o,r),Object.assign(o,{readable:yte,writable:wte,duplex:vte});const u=ib({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),c=bte(u,a,i);return{subprocess:o,promise:c}},gte=(t,e)=>{const n=gd(),r=gd(),i=gd(),s=Array.from({length:e.length-3},gd),a=gd(),o=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:a,stdio:o})},gd=()=>{const t=new iD;return t.end(),t},yte=()=>new Zi({read(){}}),wte=()=>new Em({write(){}}),vte=()=>new Rm({read(){},write(){}}),bte=async(t,e,n)=>ab(t,e,n),Dte=(t,e)=>GP(Ete,t,e,!1),yd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${tm[t]}.`)},pI={fileNumber:yd,generator:rI,asyncGenerator:rI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:Rm.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Ete={input:{...pI,fileUrl:({value:t})=>({stream:Mb(t)}),filePath:({value:{file:t}})=>({stream:Mb(t)}),webStream:({value:t})=>({stream:Zi.fromWeb(t)}),iterable:({value:t})=>({stream:Zi.from(t)}),asyncIterable:({value:t})=>({stream:Zi.from(t)}),string:({value:t})=>({stream:Zi.from(t)}),uint8Array:({value:t})=>({stream:Zi.from(Tm.from(t))})},output:{...pI,fileUrl:({value:t})=>({stream:Bb(t)}),filePath:({value:{file:t}})=>({stream:Bb(t)}),webStream:({value:t})=>({stream:Em.fromWeb(t)}),iterable:yd,asyncIterable:yd,string:yd,uint8Array:yd}};function mb(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)gb(i);const e=t.some(({readableObjectMode:i})=>i),n=Rte(t,e),r=new Tte({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const Rte=(t,e)=>{if(t.length===0)return $d(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class Tte extends iD{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(gb(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Ste(this,this.#e,this.#s);const n=Cte({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#s});this.#i.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(gb(e),!this.#e.has(e))return!1;const n=this.#i.get(e);return n===void 0?!1:(this.#i.delete(e),e.unpipe(this),await n,!0)}}const Ste=async(t,e,n)=>{rm(t,Nte);const r=new AbortController;try{await Promise.race([$te(t,r),kte(t,e,n,r)])}finally{r.abort(),rm(t,-2)}},$te=async(t,{signal:e})=>{try{await ci(t,{signal:e,cleanup:!0})}catch(n){throw hI(t,n),n}},kte=async(t,e,n,{signal:r})=>{for await(const[i]of Sd(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},gb=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Cte=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{rm(t,Ote);const o=new AbortController;try{await Promise.race([Ate(s,e,o),_te({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:o}),Pte({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:o})])}finally{o.abort(),rm(t,-1)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?yb(t):Ite(t))},Ate=async(t,e,{signal:n})=>{try{await t,n.aborted||yb(e)}catch(r){n.aborted||hI(e,r)}},_te=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await ci(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(a){if(s.aborted||!n.has(e))return;mI(a)?i.add(e):gI(t,a)}},Pte=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await wn(t,i,{signal:s}),!t.readable)return wn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},Ite=t=>{t.writable&&t.end()},hI=(t,e)=>{mI(e)?yb(t):gI(t,e)},mI=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",yb=t=>{(t.readable||t.writable)&&t.destroy()},gI=(t,e)=>{t.destroyed||(t.once("error",xte),t.destroy(e))},xte=()=>{},rm=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},Nte=2,Ote=1,im=(t,e)=>{t.pipe(e),Fte(t,e),Lte(t,e)},Fte=async(t,e)=>{if(!(Us(t)||Us(e))){try{await ci(t,{cleanup:!0,readable:!0,writable:!1})}catch{}yI(e)}},yI=t=>{t.writable&&t.end()},Lte=async(t,e)=>{if(!(Us(t)||Us(e))){try{await ci(e,{cleanup:!0,readable:!1,writable:!0})}catch{}wI(t)}},wI=t=>{t.readable&&t.destroy()},Mte=(t,e,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:a}]of Object.entries(e)){for(const{stream:o}of s.filter(({type:u})=>Ys.has(u)))Bte(t,o,a,i);for(const{stream:o}of s.filter(({type:u})=>!Ys.has(u)))qte({subprocess:t,stream:o,direction:a,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const a=s.length===1?s[0]:mb(s);im(a,i)}},Bte=(t,e,n,r)=>{n==="output"?im(t.stdio[r],e):im(e,t.stdio[r]);const i=zte[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},zte=["stdin","stdout","stderr"],qte=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;jte(e,s);const[a,o]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],u=i.get(a)??[];i.set(a,[...u,o])},jte=(t,{signal:e})=>{Us(t)&&Wh(t,Ute,e)},Ute=2,to=[];to.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&to.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&to.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const sm=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",wb=Symbol.for("signal-exit emitter"),vb=globalThis,Gte=Object.defineProperty.bind(Object);class Wte{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vb[wb])return vb[wb];Gte(vb,wb,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const r=this.listeners[e],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const s of this.listeners[e])i=s(n,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",n,r)||i),i}}class vI{}const Hte=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class Vte extends vI{onExit(){return()=>{}}load(){}unload(){}}class Kte extends vI{#e=bb.platform==="win32"?"SIGINT":"SIGHUP";#t=new Wte;#n;#r;#s;#i={};#a=!1;constructor(e){super(),this.#n=e,this.#i={};for(const n of to)this.#i[n]=()=>{const r=this.#n.listeners(n);let{count:i}=this.#t;const s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const a=this.#t.emit("exit",null,n),o=n==="SIGHUP"?this.#e:n;a||e.kill(e.pid,o)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!sm(this.#n))return()=>{};this.#a===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#t.count+=1;for(const e of to)try{const n=this.#i[e];n&&this.#n.on(e,n)}catch{}this.#n.emit=(e,...n)=>this.#u(e,...n),this.#n.reallyExit=e=>this.#o(e)}}unload(){this.#a&&(this.#a=!1,to.forEach(e=>{const n=this.#i[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,n)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#s,this.#t.count-=1)}#o(e){return sm(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#s.call(this.#n,this.#n.exitCode)):0}#u(e,...n){const r=this.#r;if(e==="exit"&&sm(this.#n)){typeof n[0]=="number"&&(this.#n.exitCode=n[0]);const i=r.call(this.#n,e,...n);return this.#t.emit("exit",this.#n.exitCode,null),i}else return r.call(this.#n,e,...n)}}const bb=globalThis.process,{onExit:Yte,load:Cae,unload:Aae}=Hte(sm(bb)?new Kte(bb):new Vte),Xte=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=Yte(()=>{t.kill()});rD(r,()=>{i()})},Jte=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=m_(),{destination:a,destinationStream:o,destinationError:u,from:c,unpipeSignal:l}=Qte(n,r,i),{sourceStream:d,sourceError:f}=ene(t,c),{options:p,fileDescriptors:h}=Ws.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:a,destinationStream:o,destinationError:u,unpipeSignal:l,fileDescriptors:h,startTime:s}},Qte=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=Zte(t,e,...n),o=G_(r,s);return{destination:r,destinationStream:o,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},Zte=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(bI,t)(n,...r),pipeOptions:t};if(typeof n=="string"||n instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,a]=J0(n,...r);return{destination:e(bI)(i,s,a),pipeOptions:a}}if(Ws.has(n)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},bI=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),ene=(t,e)=>{try{return{sourceStream:Gv(t,e)}}catch(n){return{sourceError:n}}},tne=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const o=nne({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(o!==void 0)throw DI({error:o,fileDescriptors:i,sourceOptions:s,startTime:a})},nne=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return wI(t),r;if(e!==void 0)return yI(n),e},DI=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>ib({error:t,command:EI,escapedCommand:EI,fileDescriptors:e,options:n,startTime:r,isSync:!1}),EI="source.pipe(destination)",rne=async t=>{const[{status:e,reason:n,value:r=n},{status:i,reason:s,value:a=s}]=await t;if(a.pipedFrom.includes(r)||a.pipedFrom.push(r),i==="rejected")throw a;if(e==="rejected")throw r;return a},ine=(t,e,n)=>{const r=am.has(e)?ane(t,e):sne(t,e);return Wh(t,une,n.signal),Wh(e,cne,n.signal),one(e),r},sne=(t,e)=>{const n=mb([t]);return im(n,e),am.set(e,n),n},ane=(t,e)=>{const n=am.get(e);return n.add(t),n},one=async t=>{try{await ci(t,{cleanup:!0,readable:!1,writable:!0})}catch{}am.delete(t)},am=new WeakMap,une=2,cne=1,lne=(t,e)=>t===void 0?[]:[dne(t,e)],dne=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await j1(t,e),await n.remove(e);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw DI({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},Db=(t,...e)=>{if(tn(e[0]))return Db.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Jte(t,...e),i=fne({...r,destination:n});return i.pipe=Db.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},fne=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:o,fileDescriptors:u,startTime:c})=>{const l=pne(t,i);tne({sourceStream:e,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:u,sourceOptions:n,startTime:c});const d=new AbortController;try{const f=ine(e,s,d);return await Promise.race([rne(l),...lne(o,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:u,startTime:c})])}finally{d.abort()}},pne=(t,e)=>Promise.allSettled([t,e]),RI=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return hne(e,a),SI({stream:t,controller:a,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},hne=async(t,e)=>{try{await t}catch{}finally{e.abort()}},TI=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;mne(e,a,t);const o=t.readableObjectMode&&!s;return SI({stream:t,controller:a,binary:r==="buffer",shouldEncode:!o,encoding:r,shouldSplit:!o&&n,preserveNewlines:!i})},mne=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},SI=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const o=Sd(t,"data",{signal:e.signal,highWaterMark:kI,highWatermark:kI});return gne({onStdoutChunk:o,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},$I=$d(!0),kI=$I,gne=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const o=yne({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[u]of t)yield*md(u,o,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*hb(o)}},yne=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[eI(t,n,!e),YP(t,i,!r,{})].filter(Boolean),wne=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:a,allMixed:o,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{const d=vne({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:o,verboseInfo:c,streamInfo:l});if(!i){await Promise.all([bne(t),d]);return}const f=KP(u,n),p=TI({stream:t,onStreamEnd:e,lines:a,encoding:r,stripFinalNewline:f,allMixed:o}),[h]=await Promise.all([Dne({stream:t,iterable:p,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),d]);return h},vne=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!aI({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const o=TI({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Nee(o,t,n,s)},bne=async t=>{await hx(),t.readableFlowing===null&&t.resume()},Dne=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return e||a?await eQ(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await sQ(n,{maxBuffer:s})):await mQ(n,{maxBuffer:s})}catch(o){return AI(DQ({error:o,stream:t,readableObjectMode:e,lines:a,encoding:i,fdNumber:r}))}},CI=async t=>{try{return await t}catch(e){return AI(e)}},AI=({bufferedData:t})=>FK(t)?new Uint8Array(t):t,Eb=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=Ene(t,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],ci(t,{cleanup:!0,signal:a.signal})])}catch(o){s.stdinCleanedUp||Sne(o,e,n,r)}finally{a.abort()}},Ene=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&Rne(t,n,r),r},Rne=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{Tne(e,n),r.call(t,...i)}},Tne=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},Sne=(t,e,n,r)=>{if(!$ne(t,e,n,r))throw t},$ne=(t,e,n,r=!0)=>n.propagating?PI(t)||Rb(t):(n.propagating=!0,_I(n,e)===r?PI(t):Rb(t)),_I=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Rb=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PI=t=>t?.code==="EPIPE",kne=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>t.stdio.map((u,c)=>II({stream:u,fdNumber:c,encoding:e,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:o})),II=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:u,streamInfo:c})=>{if(!t)return;const l=Eb(t,e,c);if(_I(c,e)){await l;return}const[d]=await Promise.all([wne({stream:t,onStreamEnd:l,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:u,streamInfo:c}),l]);return d},Cne=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?mb([t,e].filter(Boolean)):void 0,Ane=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>II({..._ne(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Pne(t),stripFinalNewline:s,verboseInfo:a,streamInfo:o}),_ne=({stdout:t,stderr:e,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:n,buffer:s}},Pne=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,Ine=t=>Dv(t,"ipc"),xne=(t,e)=>{const n=h_(t);ld({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},Nne=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=Ine(s),o=cd(e,"ipc"),u=cd(n,"ipc");for await(const c of lI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))o&&(RQ(t,i,u),i.push(c)),a&&xne(c,s);return i},One=async(t,e)=>(await Promise.allSettled([t]),e),Fne=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:w,onInternalError:D,controller:g})=>{const v=Gee(t,f),R={originalStreams:w,fileDescriptors:h,subprocess:t,exitPromise:v,propagating:!1},k=kne({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:R}),A=Ane({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:R}),j=[],W=Nne({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:j,verboseInfo:p}),Z=Lne(w,t,R),J=Mne(h,R);try{return await Promise.race([Promise.all([{},Hee(v),Promise.all(k),A,W,IJ(t,d),...Z,...J]),D,Bne(t,g),...TJ(t,s,f,g),...xX({subprocess:t,cancelSignal:a,gracefulCancel:o,context:f,controller:g}),...bJ({subprocess:t,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:u,context:f,controller:g})])}catch(de){return f.terminationReason??="other",Promise.all([{error:de},v,Promise.all(k.map(N=>CI(N))),CI(A),One(W,j),Promise.allSettled(Z),Promise.allSettled(J)])}},Lne=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:Eb(r,i,n)),Mne=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>Vs(s,{checkOpen:!1})&&!Us(s)).map(({type:i,value:s,stream:a=s})=>Eb(a,r,e,{isSameDirection:Ys.has(i),stopOnExit:i==="native"}))),Bne=async(t,{signal:e})=>{const[n]=await wn(t,"error",{signal:e});throw n},zne=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Tb=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=fd();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},om=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},xI=async t=>{if(t!==void 0)try{await NI(t)}catch{}},qne=async t=>{if(t!==void 0)try{await OI(t)}catch{}},NI=async t=>{await ci(t,{cleanup:!0,readable:!1,writable:!0})},OI=async t=>{await ci(t,{cleanup:!0,readable:!0,writable:!1})},FI=async(t,e)=>{if(await t,e)throw e},LI=(t,e,n)=>{n&&!Rb(n)?t.destroy(n):e&&t.destroy()},jne=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||Hs.has(n),{subprocessStdout:o,waitReadableDestroy:u}=MI(t,r,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:d}=BI(o,a),{read:f,onStdoutDataDone:p}=zI({subprocessStdout:o,subprocess:t,binary:a,encoding:n,preserveNewlines:s}),h=new Zi({read:f,destroy:Zs(jI.bind(void 0,{subprocessStdout:o,subprocess:t,waitReadableDestroy:u})),highWaterMark:d,objectMode:l,encoding:c});return qI({subprocessStdout:o,onStdoutDataDone:p,readable:h,subprocess:t}),h},MI=(t,e,n)=>{const r=Gv(t,e),i=Tb(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},BI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:$I},zI=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=fd(),a=RI({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Une(this,a,s)},onStdoutDataDone:s}},Une=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},qI=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await OI(t),await r,await xI(i),await e,n.readable&&n.push(null)}catch(s){await xI(i),UI(n,s)}},jI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await om(n,e)&&(UI(t,r),await FI(e,r))},UI=(t,e)=>{LI(t,t.readable,e)},Gne=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=GI(t,n,e),a=new Em({...WI(r,t,i),destroy:Zs(VI.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return HI(r,a),a},GI=(t,e,n)=>{const r=G_(t,e),i=Tb(n,r,"writableFinal"),s=Tb(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},WI=(t,e,n)=>({write:Wne.bind(void 0,t),final:Zs(Hne.bind(void 0,t,e,n))}),Wne=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},Hne=async(t,e,n)=>{await om(n,e)&&(t.writable&&t.end(),await e)},HI=async(t,e,n)=>{try{await NI(t),e.writable&&e.end()}catch(r){await qne(n),KI(e,r)}},VI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await om(n,e),await om(r,e)&&(KI(t,i),await FI(e,i))},KI=(t,e)=>{LI(t,t.writable,e)},Vne=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const o=s||Hs.has(n),{subprocessStdout:u,waitReadableDestroy:c}=MI(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=GI(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:w}=BI(u,o),{read:D,onStdoutDataDone:g}=zI({subprocessStdout:u,subprocess:t,binary:o,encoding:n,preserveNewlines:a}),v=new Rm({read:D,...WI(l,t,d),destroy:Zs(Kne.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:w,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:h,writableObjectMode:l.writableObjectMode,encoding:p});return qI({subprocessStdout:u,onStdoutDataDone:g,readable:v,subprocess:t,subprocessStdin:l}),HI(l,v,u),v},Kne=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([jI({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},a),VI({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},YI=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||Hs.has(e),a=Gv(t,n),o=RI({subprocessStdout:a,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return Yne(o,a,t)},Yne=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},Xne=(t,{encoding:e})=>{const n=zne();t.readable=jne.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=Gne.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=Vne.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=YI.bind(void 0,t,e),t[Symbol.asyncIterator]=YI.bind(void 0,t,e,{})},Jne=(t,e)=>{for(const[n,r]of Zne){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},Qne=(async()=>{})().constructor.prototype,Zne=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Qne,t)]),ere=(t,e,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:o,startTime:u,verboseInfo:c,options:l,fileDescriptors:d}=tre(t,e,n),{subprocess:f,promise:p}=rre({file:i,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:a,escapedCommand:o,fileDescriptors:d});return f.pipe=Db.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Jne(f,p),Ws.set(f,{options:l,fileDescriptors:d}),f},tre=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=y_(t,e,n),{file:o,commandArguments:u,options:c}=sP(t,e,n),l=nre(c),d=Dte(l,a);return{file:o,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:d}},nre=({timeout:t,signal:e,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t}},rre=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:o})=>{let u;try{u=px(t,e,n)}catch(h){return mte({error:h,command:s,escapedCommand:a,fileDescriptors:o,options:n,startTime:r,verboseInfo:i})}const c=new AbortController;yx(Number.POSITIVE_INFINITY,c.signal);const l=[...u.stdio];Mte(u,o,c),Xte(u,n,c);const d={},f=fd();u.kill=CX.bind(void 0,{kill:u.kill.bind(u),options:n,onInternalError:f,context:d,controller:c}),u.all=Cne(u,n),Xne(u,n),pte(u,n);const p=ire({subprocess:u,options:n,startTime:r,verboseInfo:i,fileDescriptors:o,originalStreams:l,command:s,escapedCommand:a,context:d,onInternalError:f,controller:c});return{subprocess:u,promise:p}},ire=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:a,escapedCommand:o,context:u,onInternalError:c,controller:l})=>{const[d,[f,p],h,w,D]=await Fne({subprocess:t,options:e,context:u,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();const g=h.map((k,A)=>eo(k,e,A)),v=eo(w,e,"all"),R=sre({errorInfo:d,exitCode:f,signal:p,stdio:g,all:v,ipcOutput:D,context:u,options:e,command:a,escapedCommand:o,startTime:n});return ab(R,r,e)},sre=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:a,options:o,command:u,escapedCommand:c,startTime:l})=>"error"in t?sb({error:t.error,command:u,escapedCommand:c,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Zh,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:o,startTime:l,isSync:!1}):TP({command:u,escapedCommand:c,stdio:r,all:i,ipcOutput:s,options:o,startTime:l}),Sb=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,are(r,t[r],i)]));return{...t,...n}},are=(t,e,n)=>ore.has(t)&&tn(e)&&tn(n)?{...e,...n}:n,ore=new Set(["env",...c_]),Xs=(t,e,n,r)=>{const i=(a,o,u)=>Xs(a,o,n,u),s=(...a)=>ure({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(s,i,e),s},ure=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(tn(s))return i(t,Sb(n,s),r);const{file:o,commandArguments:u,options:c,isSync:l}=cre({mapArguments:t,firstArgument:s,nextArguments:a,deepOptions:e,boundOptions:n});return l?Xee(o,u,c):ere(o,u,c,i)},cre=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=UK(e)?GK(e,n):[e,...n],[a,o,u]=J0(...s),c=Sb(Sb(r,i),u),{file:l=a,commandArguments:d=o,options:f=c,isSync:p=!1}=t({file:a,commandArguments:o,options:c});return{file:l,commandArguments:d,options:f,isSync:p}},lre=({file:t,commandArguments:e})=>XI(t,e),dre=({file:t,commandArguments:e})=>({...XI(t,e),isSync:!0}),XI=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);const[n,...r]=fre(t);return{file:n,commandArguments:r}},fre=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);const e=t.trim();if(e==="")return[];const n=[];for(const r of e.split(pre)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},pre=/ +/g,hre=(t,e,n)=>{t.sync=e(gre,n),t.s=t.sync},mre=({options:t})=>JI(t),gre=({options:t})=>({...JI(t),isSync:!0}),JI=t=>({options:{...yre(t),...t}}),yre=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},wre={preferLocal:!0},$b=Xs(()=>({}));Xs(()=>({isSync:!0})),Xs(lre),Xs(dre),Xs($J),Xs(mre,{},wre,hre),hte();const kb=Yw(mx().length||1);class vre{constructor(e="dot"){this.path=e}async unflatten(e){return await kb(async()=>{const n=Mt.withTag("graphviz-binary"),r=await $b("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return r instanceof Error&&(r.stdout?n.warn(`Command: '${r.command}' failed: ${r.stderr}
|
|
1833
|
-
|
|
1834
|
-
but returned
|
|
1835
|
-
${r.stdout}`):n.error(`Command: '${r.command}' failed: ${r.stderr}
|
|
1836
|
-
|
|
1837
|
-
nothing returned, ignoring...`)),r.stdout&&(e=r.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await kb(async()=>{const n=Mt.withTag("graphviz-binary"),r=await $b(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(r instanceof Error){if(!r.stdout)throw n.error(`Command: '${r.command}' nothing returned and failed: "${r.stderr}"`),n.warn(`FAILED DOT:
|
|
1838
|
-
${e}`),r;n.warn(`Command: '${r.command}' returned result but also failed "${r.stderr}"`)}return r.stdout})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await kb(async()=>{const n=Mt.withTag("graphviz-binary"),r=await $b(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(r instanceof Error){if(n.warn(`DOT:
|
|
1839
|
-
${e}`),!r.stdout)throw n.error(`Command: '${r.command}' nothing returned and failed: ${r.stderr}`),r;n.warn(`Command: '${r.command}' returned result but also failed ${r.stderr}`)}return r.stdout})}}const QI="1.20.2",bre=t=>{Cb.forEach(e=>{Dre(t,e)})},Cb=["name","message","stack","cause","errors"],Dre=(t,e)=>{const n=Ab(t,e);if(n!==void 0){if(Ere(n)){si(t,e,t[e]);return}Rre(n)&&ZI(t,e,n)}},Ab=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:Ab(r,e)},Ere=({get:t,set:e})=>t!==void 0&&e===void 0,Rre=({enumerable:t,writable:e})=>t||!e,si=(t,e,n)=>{ZI(t,e,{value:n})},ZI=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},Tre=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(Sre).map(e).filter(Boolean);si(t,"errors",n)}else $re(t)?si(t,"errors",[]):t.errors!==void 0&&kre(t)},Sre=t=>t!==void 0,$re=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),kre=t=>{delete t.errors,t.errors!==void 0&&si(t,"errors",[])},Cre=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:si(t,"cause",n)},Are=t=>_re(t)||Pre(t),_re=t=>{try{return t instanceof Error}catch{return!1}},Pre=t=>{try{return Ire.has(Object.prototype.toString.call(t))}catch{return!1}},Ire=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),xre=t=>!Object.isExtensible(t)||Cb.some(e=>Nre(t,e)||Ore(t,e)),Nre=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},Ore=(t,e)=>{try{return t[e],!1}catch{return!0}},_b=t=>{const e=Fre(t.message,t.name);si(t,"stack",e)},Fre=(t="",e="Error")=>{const n=Lre(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},Lre=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},Mre=t=>{const e={};for(const n of Bre(t))try{const r=t[n],{enumerable:i,configurable:s,writable:a=!0}=Ab(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:a})}catch{}return e},Bre=t=>{const e=zre(t);for(const n of Cb)qre(t,n)&&e.push(n);return e},zre=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},qre=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},e1=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...a}=Mre(t),o=jre(n,a),u=Hre(e,o);return n===o&&Vre(u,a),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([c,l])=>{Kre(u,c,l)}),r===void 0&&_b(u),u},jre=(t,e)=>typeof t=="string"&&t!==""?t:Wre(Ure(e)),Ure=t=>{try{return JSON.stringify(t)}catch{return Gre(t)}},Gre=t=>{try{return String(t)}catch{return"Invalid error"}},Wre=t=>t.length<t1?t:`${t.slice(0,t1)}...`,t1=1e3,Hre=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in n1?new n1[t](e):new Error(e),n1={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},Vre=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},Kre=(t,e,n)=>{n!==void 0&&si(t,e,n)},Yre=t=>{try{const e=new Error(String(t));return _b(e),e}catch(e){return e}},{toString:Xre}=Object.prototype,Jre=t=>Qre(t)?e1(t):Are(t)?Zre(t)?e1(t):t:Yre(t),Qre=t=>{try{return tn(t)}catch{return!1}},Zre=t=>eie(t)||xre(t)||tie(t),eie=t=>{try{return Xre.call(t)==="[object Object]"}catch{return!0}},tie=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),um=(t,{shallow:e=!1}={})=>r1(t,[],e),r1=(t,e,n)=>{if(e.includes(t))return;const r=n?nie:s=>r1(s,[...e,t],n),i=Jre(t);return rie(i,r),i},nie=t=>t,rie=(t,e)=>{iie(t),sie(t),aie(t),Cre(t,e),Tre(t,e),bre(t)},iie=t=>{if(cm(t.name))return;const e=Object.getPrototypeOf(t).name,n=cm(e)?e:t.constructor.name;si(t,"name",n)},sie=t=>{cm(t.message)||si(t,"message","")},aie=t=>{cm(t.stack)||_b(t)},cm=t=>typeof t=="string"&&t!=="",oie=(t,e,n=t.name)=>{if(uie(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},uie=t=>{if(!cie(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!i1(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!lie(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},cie=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,i1=t=>t!==null&&(t.name==="Error"||i1(Object.getPrototypeOf(t))),lie=t=>typeof t.prototype.constructor=="function",s1=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},die=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(fie(t,e),u1(t,"constructor"),pie(t,e))},fie=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},pie=(t,e)=>{u1(t,"name");const n=a1(e.prototype);t.name!==n&&s1(t,"name",n)},a1=t=>hie(t)??mie(t)??a1(Object.getPrototypeOf(t)),hie=t=>Object.hasOwn(t,"name")&&o1(t.name)?t.name:void 0,mie=t=>typeof t.constructor=="function"&&o1(t.constructor.name)?t.constructor.name:void 0,o1=t=>typeof t=="string"&&t!=="",u1=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},gie=(t,e)=>{if(!yie(t,e))return;const n=vie(t,e);s1(t,"stack",n)},yie=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&wie(),wie=()=>{class t extends Error{}const e={value:c1,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(c1)},c1="SetErrorClassError",vie=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=bie(n,t),[i,s]=r.find(([a])=>e.includes(a));return e.replace(i,s)},bie=(t,e)=>[[`
|
|
1840
|
-
${t}: `,`
|
|
1841
|
-
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],Die=(t,e,n)=>{const r=um(t),i=oie(r,e,n);return die(r,e),gie(r,i),r},Eie=(t,e)=>e.configurable===!1?Rie(t,e):$ie(t,e),Rie=(t,e)=>({...e,...Tie(t,e),...Sie(t,e)}),Tie=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},Sie=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},$ie=(t,e)=>{const n=wd(t.enumerable,e.enumerable,!0),r=wd(t.writable,e.writable,!0),i=wd(t.configurable,e.configurable,!0);return{...kie(t,e,r),enumerable:n,configurable:i}},kie=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!l1(t)&&!l1(e)?{value:e.value,writable:n}:{get:wd(t.get,e.get),set:wd(t.set,e.set)},l1=({get:t,set:e})=>t!==void 0||e!==void 0,wd=(t,e,n)=>t??e??n,Cie=(t,e,n)=>{if(!Aie(t))throw new TypeError(`Argument must be an object: ${t}`);if(!_ie(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return Pie(n)},Aie=t=>typeof t=="object"&&t!==null,_ie=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},Pie=t=>{if(!tn(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,...o}=t,u="value"in t;return Iie({enumerable:e,writable:n,configurable:r,get:s,set:a,unknownProps:o,hasValue:u}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,hasValue:u}},Iie=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:a})=>{d1(a,r,"get"),d1(a,i,"set"),Pb(t,"enumerable"),Pb(e,"writable"),Pb(n,"configurable"),Nie(s)},d1=(t,e,n)=>{if(xie(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},xie=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},Pb=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},Nie=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},Oie=(t,e,n)=>{const r=Cie(t,e,n),i=f1(t,e),s=Eie(r,i);return Fie(t,e,s),t},f1=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:f1(r,e)},Fie=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},Lie=(t,e,n)=>{if(n!==void 0)return p1(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return p1(t,e)},p1=(t,e,n)=>{const r=Mie(e);Oie(t,e,{value:n,...r})},Mie=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},Bie=t=>zie(t)||qie(t),zie=t=>{try{return t instanceof Error}catch{return!1}},qie=t=>{try{return jie.has(Object.prototype.toString.call(t))}catch{return!1}},jie=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),Uie=(t,e,n={})=>{if(h1(t,"First argument"),h1(e,"Second argument"),!tn(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},h1=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!Gie(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},Gie=t=>tn(t)||Bie(t),Wie=({error:t,props:e,propName:n,soft:r})=>Hie(n)||!Yie.call(e,n)||r&&t[n]!==void 0,Hie=t=>t in Vie||Kie.has(t),Vie=new Error("check"),Kie=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:Yie}=Object.prototype,Xie=(t,e,n)=>{const{soft:r}=Uie(t,e,n);for(const i of Reflect.ownKeys(e))Jie({error:t,props:e,propName:i,soft:r});return t},Jie=({error:t,props:e,propName:n,soft:r})=>{Wie({error:t,props:e,propName:n,soft:r})||Lie(t,n,e[n])},lm=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},Qie=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);lm(t,"errors",n)},Zie=({target:t,source:e,parent:n,child:r})=>{if(!m1(t)){ese(t,e);return}m1(e)&&lm(t,"errors",[...r.errors,...n.errors])},ese=(t,e)=>{e.errors!==void 0&&lm(t,"errors",e.errors)},m1=t=>t.errors!==void 0&&t.errors.length!==0,tse=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},nse=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?rse({name:t,stack:e,newMessage:n,currentMessage:r}):sse(t,e,n),rse=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=ise(t,n,r),[s,a]=i.find(([o])=>e.includes(o));return e.replace(s,a)},ise=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
1842
|
-
${n}`,`
|
|
1843
|
-
${e}`],[` ${n}`,` ${e}`],[n,e]],sse=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
1844
|
-
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
1845
|
-
`):`${r}${i}
|
|
1846
|
-
${e}`},ase=(t,e,n)=>{const r=um(t),i=tse(r,e,n);return y1(r,"message",e),ose(r,e,i),r},ose=(t,e,n)=>{if(e===n||!use())return;const r=nse(t,e,n);y1(t,"stack",r)},use=()=>{const{stack:t}=new Error(g1);return typeof t=="string"&&t.includes(g1)},g1="set-error-message test message",y1=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},cse=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=um(t),i=lse(e,r.message);return ase(r,i,n)},lse=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:dse(n,r,t)},dse=(t,e,n)=>t.endsWith(fse)?n.endsWith(pse)?`${t}
|
|
1847
|
-
${e}`:`${t} ${e}`:`${e}
|
|
1848
|
-
${t}`,fse=":",pse=`
|
|
1849
|
-
`,hse=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,cse(n,i,r.message)},mse=(t,e)=>w1(t)===e,w1=t=>typeof t=="object"&&t!==null?t.stack:void 0,gse=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(lm(e,"stack",n.stack),n),yse=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},wse=t=>v1(t,[]).error,v1=(t,e)=>{if(e.includes(t))return{};const n=c=>v1(c,[...e,t]),r=w1(t),i=um(t,{shallow:!0}),s=mse(i,r);Qie(i,n);const{parent:a,childHasStack:o}=vse(i,n);return{error:a,errorHasStack:s||o}},vse=(t,e)=>{const n=yse(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:bse({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},bse=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],a=gse({wrap:r,target:i,source:s,childHasStack:n}),o=Die(i,i.constructor,a.name),u=hse({parent:t,child:e,target:o,stackError:a});return Zie({target:u,source:s,parent:t,child:e}),Xie(u,s,{soft:!r})},dm=Object.create(null),vd=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?dm:globalThis),qi=new Proxy(dm,{get(t,e){return vd()[e]??dm[e]},has(t,e){const n=vd();return e in n||e in dm},set(t,e,n){const r=vd(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=vd(!0);return delete n[e],!0},ownKeys(){const t=vd(!0);return Object.keys(t)}}),Dse=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Ese=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Rse(){if(globalThis.process?.env)for(const t of Ese){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const b1=Rse();b1.name;function Js(t){return t?t!=="false":!1}const Tse=globalThis.process?.platform||"",fm=Js(qi.CI)||b1.ci!==!1,D1=Js(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);Js(qi.DEBUG);const Sse=Dse==="test"||Js(qi.TEST);Js(qi.MINIMAL);const $se=/^win/i.test(Tse);!Js(qi.NO_COLOR)&&(Js(qi.FORCE_COLOR)||(D1||$se)&&qi.TERM);const kse=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(kse?.split(".")[0]);const Cse=globalThis.process||Object.create(null),E1={versions:{}};new Proxy(Cse,{get(t,e){if(e==="env")return qi;if(e in t)return t[e];if(e in E1)return E1[e]}});const Ase=globalThis.process?.release?.name==="node",_se=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Pse=!!globalThis.Deno,Ise=!!globalThis.fastly,xse=!!globalThis.Netlify,Nse=!!globalThis.EdgeRuntime,Ose=globalThis.navigator?.userAgent==="Cloudflare-Workers",Fse=[[xse,"netlify"],[Nse,"edge-light"],[Ose,"workerd"],[Ise,"fastly"],[Pse,"deno"],[_se,"bun"],[Ase,"node"]];function Lse(){const t=Fse.find(e=>e[0]);if(t)return{name:t[1]}}const Mse=Lse();Mse?.name;const R1=pt.bold(pt.bgRed(pt.white("ERROR"))),T1=pt.bold(pt.yellow("WARN")),Bse=pt.bold(pt.green("INFO"));function S1(t){const e=bx("info",{prefix:t,allowClearScreen:!fm}),n=!fm;return{...e,info(r,i){e.info(`${Bse} ${r}`,{timestamp:n,...i})},warn(r,i){if(r instanceof Error){e.warn(`${T1} ${pt.red(r.name+" "+r.message)}
|
|
1850
|
-
${Ed(r,{colors:!0})}`,{timestamp:n,...i});return}e.warn(`${T1} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){const s=wse(r);e.error(`${R1} ${pt.red(s.message)}
|
|
1851
|
-
${Ed(s,{colors:!0})}`,{timestamp:n,error:r,...i});return}e.error(`${R1} ${r}`,{timestamp:n,...i})}}}const Ib=()=>{},zse={info:Ib,warn:Ib,error:Ib},qse=1e6;function $1(t){const[e,n]=Td(t),r=e*1e3+n/qse;return{ms:r,pretty:kP(r)}}function jse(t){const e=Td();return{stopAndLog(n="done in "){n=pt.green(`${n}${$1(e).pretty}`),t?t.info(n):Mt.success(n)}}}class Use{constructor(e){this.services=e}isInitialized=!1;async initWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;n.info(`${pt.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger,n=this.services.likec4.ModelBuilder,r=this.services.shared.workspace.LangiumDocuments,i=this.services.shared.workspace.DocumentBuilder,s=r.all.toArray();if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${pt.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const a=await n.buildComputedModel(),o=Du(a?.views??{}).length;if(o===0){e.warn(`${pt.dim("workspace:")} no views found`);return}e.info(`${pt.dim("workspace:")} ${pt.green(`\u2713 computed ${o} views`)}`);const u=await this.services.likec4.Views.diagrams();u.length===o?e.info(`${pt.dim("workspace:")} ${pt.green("\u2713 all views layouted")}`):e.warn(`${pt.dim("workspace:")} ${pt.yellow(`\u2717 layouted ${u.length} views`)}`)}}function Gse(t){return e=>new t(e)}const Wse={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:Gse(Use)}};function k1(t){const e=km(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=zse;break;case"vite":n=S1("c4:lsp ");break;case"default":n=Mt.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${pt.dim("version")} ${QI}`),n.info(`${pt.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new m0(r===!0?new vre:new g0)}};return KW(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&xe.setReporters([{log:({level:s,...a},o)=>{const u=a.tag||"",c=a.args.map(d=>Rj(d)?d.stack??d.message:typeof d=="string"?d:String(d));u&&c.unshift(`[${u}]`);const l=c.join(" ");switch(!0){case s>=mt.debug:break;case s>=mt.info:{n.info(l);break}case s>=mt.log:{n.info(l);break}case s>=mt.warn:{n.warn(l);break}case s>=mt.fatal:{n.error(l);break}}}}]),NK(e.useFileSystem?XW:{},Wse,i).likec4}const C1=t=>new Error(`Invalid model:
|
|
1852
|
-
${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
|
|
1853
|
-
`)}`);class ji{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=k1(km(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Wt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=Rt.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const a=new ji(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&a.hasErrors()?(a.dispose(),Promise.reject(C1(a))):a}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=N1(e);if(!x1(r))throw new Error(`Workspace not found: ${r}`);let i=ji.likec4Instances.get(r);if(!i){const s=k1(km(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:F1(r).toString(),name:O1(r)}),await s.cli.Workspace.init(),i=new ji(r,s,n?.printErrors??!0),ji.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(C1(i))):i}modelComputedRef;modelLayoutedRef;logger;get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(){let e=this.modelComputedRef?.deref();if(!e){const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!n)throw new Error("Failed to build model");const r=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(n);e=sD.create(r),this.modelComputedRef=new WeakRef(e)}return e}async layoutedModel(){let e=this.modelLayoutedRef?.deref();if(!e){const n=await this.langium.likec4.ModelBuilder.buildComputedModel();if(!n)throw new Error("Failed to build model");const r=await this.viewsService.diagrams();e=sD.create({...n,__:"layouted",views:xy(r,Eu("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===mu.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}hasErrors(){return this.LangiumDocuments.all.some(e=>e.diagnostics?.some(n=>n.severity===mu.Error)??!1)}printErrors(){let e=!1;for(const n of this.LangiumDocuments.all){const r=n.diagnostics?.filter(i=>i.severity===1);if(r&&r.length>0){e=!0;const i=r.flatMap(s=>{const a=s.range.start.line,o=s.message.split(`
|
|
1854
|
-
`);return o.length>10&&(o.length=10,o.push("...")),o.map((u,c)=>c===0?" "+pt.dim(`Line ${a}: `)+pt.red(u):" ".repeat(10)+pt.red(u))}).join(`
|
|
1855
|
-
`);this.logger.error(`Invalid ${n.uri.fsPath}
|
|
1856
|
-
${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){this.modelLayoutedRef=void 0,this.modelComputedRef=void 0;const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[Wt.file(e)]:[],n?[Wt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(i),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of ji.likec4Instances)n===this&&ji.likec4Instances.delete(e)}}export{Mt as H,ji as L,kD as N,na as T,sa as a,_y as b,ze as c,ae as d,Yw as e,n$ as f,ht as g,S1 as h,bt as i,av as j,l7 as k,nr as l,Da as m,yt as n,$1 as o,pt as p,uv as q,ys as r,jse as s,e$ as t,s$ as u,mt as v,c7 as w,Ye as x,QI as y};
|