likec4 1.27.2 → 1.28.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/__app__/src/main.js +725 -626
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +548 -545
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.10Nsb-Q7.mjs +2192 -0
- package/dist/shared/{likec4.CfxVv3pJ.mjs → likec4.7Lz9HWDi.mjs} +1 -1
- package/dist/shared/{likec4.QmEWuoHf.d.mts → likec4.DwrogUe0.d.mts} +22 -22
- package/dist/vite-plugin/index.d.mts +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +21 -21
- package/react/index.d.mts +473 -195
- package/react/index.mjs +27 -27
- package/dist/shared/likec4.D_S6au6n.mjs +0 -2199
|
@@ -1,2199 +0,0 @@
|
|
|
1
|
-
import*as i0 from"node:fs";import{existsSync as o_}from"node:fs";import Ii,{resolve as a_,basename as u_}from"node:path";import{fileURLToPath as c_,pathToFileURL as l_}from"node:url";import{isatty as d_}from"tty";import f_,{stripVTControlCharacters as p_}from"node:util";import h_ from"util";import Oi from"path";import m_ from"os";import g_ from"crypto";import y_ from"net";import v_ from"url";import Na from"fs";import w_ from"child_process";import{BiMap as b_,nonNullable as Wt,invariant as Ie,defaultTheme as Yt,
|
|
2
|
-
DefaultRelationshipColor as Ia,nonexhaustive as qe,hierarchyDistance as E_,DefaultThemeColor as Ao,nameFromFqn as am,isThemeColor as s0,compareFqnHierarchically as $_,DefaultArrowType as gs,ComputedNode as Bd,extractStep as D_,ComputedView as Oa,delay as R_,DefaultLineStyle as k_,hasAtLeast as T_,LikeC4Model as ys,stringHash as C_,ThemeColors as A_,AsFqn as S_,ancestorsFqn as __,compareNatural as o0,DeploymentElement as a0,computeColorValues as P_,sortByFqnHierarchically as u0,parentFqn as c0,isScopedElementView as x_,
|
|
3
|
-
FqnRef as La,isSameHierarchy as l0,isAncestor as um,FqnExpr as Fa,isNonEmptyArray as Gn,LinkedList as d0,isAutoLayoutDirection as N_,isOrOperator as f0,isAndOperator as p0}from"@likec4/core";import{ComputedNode as h0,DefaultShapeSize as I_,DefaultTextSize as O_,DefaultPaddingSize as L_,AsFqn as F_}from"@likec4/core/types";import{EventEmitter as M_}from"events";import{Buffer as cm}from"buffer";import{Graphviz as lm}from"@hpcc-js/wasm-graphviz";import{resolveRulesExtendedViews as B_}from"@likec4/core/compute-view";
|
|
4
|
-
import{MultiMap as er,DefaultWeakMap as m0,compareNatural as g0,sortNaturalByFqn as q_,ancestorsFqn as j_}from"@likec4/core/utils";import Li,{hrtime as y0}from"node:process";import G_ from"boxen";import{spawn as U_}from"node:child_process";import{once as v0,on as W_}from"node:events";import{stat as z_}from"node:fs/promises";import{pipeline as H_}from"node:stream/promises";import V_ from"node:os";import w0 from"fs/promises";import{LikeC4Model as K_}from"@likec4/core/model";const X_={},So=Y_(globalThis,
|
|
5
|
-
X_);function Y_(t,e){return new Proxy(t,{get(n,r,i){return r in e?e[r]:t[r]},set(n,r,i){return r in e&&delete e[r],t[r]=i,!0},deleteProperty(n,r){let i=!1;return r in e&&(delete e[r],i=!0),r in t&&(delete t[r],i=!0),i},ownKeys(n){const r=Reflect.ownKeys(t),i=Reflect.ownKeys(e),s=new Set(i);return[...r.filter(o=>!s.has(o)),...i]},defineProperty(n,r,i){return r in e&&delete e[r],Reflect.defineProperty(t,r,i),!0},getOwnPropertyDescriptor(n,r){return r in e?Reflect.getOwnPropertyDescriptor(e,r):Reflect.
|
|
6
|
-
getOwnPropertyDescriptor(t,r)},has(n,r){return r in e||r in t}})}function b0(t){return typeof t=="function"?t:J_(t)}function J_(t){if(t==null)return()=>!1;if(t==="fatal")return e=>e.level==="fatal";if(t==="error")return e=>e.level==="fatal"||e.level==="error";if(t==="warning")return e=>e.level==="fatal"||e.level==="error"||e.level==="warning";if(t==="info")return e=>e.level==="fatal"||e.level==="error"||e.level==="warning"||e.level==="info";if(t==="debug")return()=>!0;throw new TypeError(`Invali\
|
|
7
|
-
d log level: ${t}.`)}const E0=["debug","info","warning","error","fatal"];function $0(t,e){const n=E0.indexOf(t);if(n<0)throw new TypeError(`Invalid log level: ${JSON.stringify(t)}.`);const r=E0.indexOf(e);if(r<0)throw new TypeError(`Invalid log level: ${JSON.stringify(e)}.`);return n-r}function Q_(t=[]){return jn.getLogger(t)}const dm=Symbol.for("logtape.rootLogger");class jn{static getLogger(e=[]){let n=dm in So?So[dm]??null:null;return n==null&&(n=new jn(null,[]),So[dm]=n),typeof e=="string"?n.
|
|
8
|
-
getChild(e):e.length===0?n:n.getChild(e)}constructor(e,n){Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"category",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sinks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parentSinks",{enumerable:!0,configurable:!0,
|
|
9
|
-
writable:!0,value:"inherit"}),Object.defineProperty(this,"filters",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lowestLevel",{enumerable:!0,configurable:!0,writable:!0,value:"debug"}),Object.defineProperty(this,"contextLocalStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.parent=e,this.children={},this.category=n,this.sinks=[],this.filters=[]}getChild(e){const n=typeof e=="string"?e:e[0],r=this.children[n];let i=r instanceof jn?r:r?.
|
|
10
|
-
deref();return i==null&&(i=new jn(this,[...this.category,n]),this.children[n]="WeakRef"in So?new WeakRef(i):i),typeof e=="string"||e.length===1?i:i.getChild(e.slice(1))}reset(){for(;this.sinks.length>0;)this.sinks.shift();for(this.parentSinks="inherit";this.filters.length>0;)this.filters.shift();this.lowestLevel="debug"}resetDescendants(){for(const e of Object.values(this.children)){const n=e instanceof jn?e:e.deref();n?.resetDescendants()}this.reset()}with(e){return new Qw(this,{...e})}filter(e){
|
|
11
|
-
for(const n of this.filters)if(!n(e))return!1;return this.filters.length<1?this.parent?.filter(e)??!0:!0}*getSinks(e){if(!(this.lowestLevel===null||$0(e,this.lowestLevel)<0)){if(this.parent!=null&&this.parentSinks==="inherit")for(const n of this.parent.getSinks(e))yield n;for(const n of this.sinks)yield n}}emit(e,n){if(!(this.lowestLevel===null||$0(e.level,this.lowestLevel)<0||!this.filter(e))){for(const r of this.getSinks(e.level))if(!n?.has(r))try{r(e)}catch(i){const s=new Set(n);s.add(r),Z_.log(
|
|
12
|
-
"fatal","Failed to emit a log record to sink {sink}: {error}",{sink:r,error:i,record:e},s)}}}log(e,n,r,i){const s=jn.getLogger().contextLocalStorage?.getStore()??{};let o;const a=typeof r=="function"?{category:this.category,level:e,timestamp:Date.now(),get message(){return D0(n,this.properties)},rawMessage:n,get properties(){return o==null&&(o={...s,...r()}),o}}:{category:this.category,level:e,timestamp:Date.now(),message:D0(n,{...s,...r}),rawMessage:n,properties:{...s,...r}};this.emit(a,i)}logLazily(e,n,r={}){
|
|
13
|
-
const i=jn.getLogger().contextLocalStorage?.getStore()??{};let s,o;function a(){if((o==null||s==null)&&(o=n((u,...c)=>(s=u,R0(u,c))),s==null))throw new TypeError("No log record was made.");return[o,s]}this.emit({category:this.category,level:e,get message(){return a()[0]},get rawMessage(){return a()[1]},timestamp:Date.now(),properties:{...i,...r}})}logTemplate(e,n,r,i={}){const s=jn.getLogger().contextLocalStorage?.getStore()??{};this.emit({category:this.category,level:e,message:R0(n,r),rawMessage:n,
|
|
14
|
-
timestamp:Date.now(),properties:{...s,...i}})}debug(e,...n){typeof e=="string"?this.log("debug",e,n[0]??{}):typeof e=="function"?this.logLazily("debug",e):this.logTemplate("debug",e,n)}info(e,...n){typeof e=="string"?this.log("info",e,n[0]??{}):typeof e=="function"?this.logLazily("info",e):this.logTemplate("info",e,n)}warn(e,...n){typeof e=="string"?this.log("warning",e,n[0]??{}):typeof e=="function"?this.logLazily("warning",e):this.logTemplate("warning",e,n)}error(e,...n){typeof e=="string"?this.
|
|
15
|
-
log("error",e,n[0]??{}):typeof e=="function"?this.logLazily("error",e):this.logTemplate("error",e,n)}fatal(e,...n){typeof e=="string"?this.log("fatal",e,n[0]??{}):typeof e=="function"?this.logLazily("fatal",e):this.logTemplate("fatal",e,n)}}class Qw{constructor(e,n){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.logger=e,this.properties=n}get category(){
|
|
16
|
-
return this.logger.category}get parent(){return this.logger.parent}getChild(e){return this.logger.getChild(e).with(this.properties)}with(e){return new Qw(this.logger,{...this.properties,...e})}log(e,n,r,i){this.logger.log(e,n,typeof r=="function"?()=>({...this.properties,...r()}):{...this.properties,...r},i)}logLazily(e,n){this.logger.logLazily(e,n,this.properties)}logTemplate(e,n,r){this.logger.logTemplate(e,n,r,this.properties)}debug(e,...n){typeof e=="string"?this.log("debug",e,n[0]??{}):typeof e==
|
|
17
|
-
"function"?this.logLazily("debug",e):this.logTemplate("debug",e,n)}info(e,...n){typeof e=="string"?this.log("info",e,n[0]??{}):typeof e=="function"?this.logLazily("info",e):this.logTemplate("info",e,n)}warn(e,...n){typeof e=="string"?this.log("warning",e,n[0]??{}):typeof e=="function"?this.logLazily("warning",e):this.logTemplate("warning",e,n)}error(e,...n){typeof e=="string"?this.log("error",e,n[0]??{}):typeof e=="function"?this.logLazily("error",e):this.logTemplate("error",e,n)}fatal(e,...n){typeof e==
|
|
18
|
-
"string"?this.log("fatal",e,n[0]??{}):typeof e=="function"?this.logLazily("fatal",e):this.logTemplate("fatal",e,n)}}const Z_=jn.getLogger(["logtape","meta"]);function D0(t,e){const n=[];let r="";for(let i=0;i<t.length;i++){const s=t.charAt(i),o=t.charAt(i+1);if(s==="{"&&o==="{")r=r+s,i++;else if(s==="}"&&o==="}")r=r+s,i++;else if(s==="{")n.push(r),r="";else if(s==="}"){let a;r.match(/^\s|\s$/)?a=r in e?e[r]:e[r.trim()]:a=e[r],n.push(a),r=""}else r=r+s}return n.push(r),n}function R0(t,e){const n=[];
|
|
19
|
-
for(let r=0;r<t.length;r++)n.push(t[r]),r<e.length&&n.push(e[r]);return n}function Fi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function eP(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.
|
|
20
|
-
getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function k0(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 fm,T0;function tP(){if(T0)return fm;T0=1;let t=null;if(typeof window>"u"&&("process"in globalThis&&"versions"in globalThis.process&&"node"in globalThis.process.
|
|
21
|
-
versions&&typeof globalThis.caches>"u"&&typeof globalThis.addEventListener!="function"||"Bun"in globalThis))try{t=[k0][0](`${["node","util"].join(":")}`)}catch{t=null}return fm=t,fm}var nP=tP();const qd=Fi(nP),pm={debug:"DBG",info:"INF",warning:"WRN",error:"ERR",fatal:"FTL"},C0="Deno"in globalThis&&"inspect"in globalThis.Deno&&typeof globalThis.Deno.inspect=="function"?(t,e)=>globalThis.Deno.inspect(t,{strAbbreviateSize:1/0,iterableLimit:1/0,...e}):qd!=null&&"inspect"in qd&&typeof qd.inspect=="f\
|
|
22
|
-
unction"?(t,e)=>qd.inspect(t,{maxArrayLength:1/0,maxStringLength:1/0,...e}):t=>JSON.stringify(t);function A0(t={}){const e=t.timestamp==null||t.timestamp==="date-time-timezone"?o=>new Date(o).toISOString().replace("T"," ").replace("Z"," +00:00"):t.timestamp==="date-time-tz"?o=>new Date(o).toISOString().replace("T"," ").replace("Z"," +00"):t.timestamp==="date-time"?o=>new Date(o).toISOString().replace("T"," ").replace("Z",""):t.timestamp==="time-timezone"?o=>new Date(o).toISOString().replace(/.*T/,
|
|
23
|
-
"").replace("Z"," +00:00"):t.timestamp==="time-tz"?o=>new Date(o).toISOString().replace(/.*T/,"").replace("Z"," +00"):t.timestamp==="time"?o=>new Date(o).toISOString().replace(/.*T/,"").replace("Z",""):t.timestamp==="date"?o=>new Date(o).toISOString().replace(/T.*/,""):t.timestamp==="rfc3339"?o=>new Date(o).toISOString():t.timestamp,n=t.category??"\xB7",r=t.value??C0,i=t.level==null||t.level==="ABBR"?o=>pm[o]:t.level==="abbr"?o=>pm[o].toLowerCase():t.level==="FULL"?o=>o.toUpperCase():t.level==="\
|
|
24
|
-
full"?o=>o:t.level==="L"?o=>o.charAt(0).toUpperCase():t.level==="l"?o=>o.charAt(0):t.level,s=t.format??(({timestamp:o,level:a,category:u,message:c})=>`${o} [${a}] ${u}: ${c}`);return o=>{let a="";for(let d=0;d<o.message.length;d++)d%2===0?a+=o.message[d]:a+=r(o.message[d]);const u=e(o.timestamp),c=i(o.level),l=typeof n=="function"?n(o.category):o.category.join(n);return`${s({timestamp:u,level:c,category:l,message:a,record:o})}
|
|
25
|
-
`}}A0();const hm="\x1B[0m",mm={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},gm={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",strikethrough:"\x1B[9m"},rP={debug:"blue",info:"green",warning:"yellow",error:"red",fatal:"magenta"};function S0(t={}){const e=t.format,n=typeof t.timestampStyle>"u"?"dim":t.timestampStyle,r=t.timestampColor??null,i=`${n==null?"":gm[n]}${r==null?"":mm[r]}`,s=n==null&&
|
|
26
|
-
r==null?"":hm,o=typeof t.levelStyle>"u"?"bold":t.levelStyle,a=t.levelColors??rP,u=typeof t.categoryStyle>"u"?"dim":t.categoryStyle,c=t.categoryColor??null,l=`${u==null?"":gm[u]}${c==null?"":mm[c]}`,f=u==null&&c==null?"":hm;return A0({timestamp:"date-time-tz",value(d){return C0(d,{colors:!0})},...t,format({timestamp:d,level:p,category:h,message:v,record:b}){const y=a[b.level];return d=`${i}${d}${s}`,p=`${o==null?"":gm[o]}${y==null?"":mm[y]}${p}${o==null&&y==null?"":hm}`,e==null?`${d} ${p} ${l}${h}\
|
|
27
|
-
:${f} ${v}`:e({timestamp:d,level:p,category:`${l}${h}${f}`,message:v,record:b})}})}S0();const iP={debug:"background-color: gray; color: white;",info:"background-color: white; color: black;",warning:"background-color: orange; color: black;",error:"background-color: red; color: white;",fatal:"background-color: maroon; color: white;"};function sP(t){let e="";const n=[];for(let s=0;s<t.message.length;s++)s%2===0?e+=t.message[s]:(e+="%o",n.push(t.message[s]));const r=new Date(t.timestamp);return[`%c${`${r.
|
|
28
|
-
getUTCHours().toString().padStart(2,"0")}:${r.getUTCMinutes().toString().padStart(2,"0")}:${r.getUTCSeconds().toString().padStart(2,"0")}.${r.getUTCMilliseconds().toString().padStart(3,"0")}`} %c${pm[t.level]}%c %c${t.category.join("\xB7")} %c${e}`,"color: gray;",iP[t.level],"background-color: default;","color: gray;","color: default;",...n]}function _0(t={}){const e=t.formatter??sP,n={debug:"debug",info:"info",warning:"warn",error:"error",fatal:"error",...t.levelMap??{}},r=t.console??globalThis.
|
|
29
|
-
console;return i=>{const s=e(i),o=n[i.level];if(o===void 0)throw new TypeError(`Invalid log level: ${i.level}.`);if(typeof s=="string"){const a=s.replace(/\r?\n$/,"");r[o](a)}else r[o](...s)}}let ym=null;const P0=new Set,jd=new Set,oP=new Set;function aP(t){return t.category.length===0||t.category.length===1&&t.category[0]==="logtape"||t.category.length===2&&t.category[0]==="logtape"&&t.category[1]==="meta"}function uP(t){if(ym!=null&&!t.reset)throw new vs("Already configured; if you want to res\
|
|
30
|
-
et, turn on the reset flag.");if(oP.size>0)throw new vs("Previously configured async disposables are still active. Use configure() instead or explicitly dispose them using dispose().");x0();try{cP(t,!1)}catch(e){throw e instanceof vs&&x0(),e}}function cP(t,e){ym=t;let n=!1,r=!1;for(const s of t.loggers){aP(s)&&(n=!0);const o=jn.getLogger(s.category);for(const a of s.sinks??[]){const u=t.sinks[a];if(!u)throw new vs(`Sink not found: ${a}.`);o.sinks.push(u)}o.parentSinks=s.parentSinks??"inherit",s.
|
|
31
|
-
lowestLevel!==void 0&&(o.lowestLevel=s.lowestLevel),s.level!==void 0&&(r=!0,o.filters.push(b0(s.level)));for(const a of s.filters??[]){const u=t.filters?.[a];if(u===void 0)throw new vs(`Filter not found: ${a}.`);o.filters.push(b0(u))}P0.add(o)}jn.getLogger().contextLocalStorage=t.contextLocalStorage;for(const s of Object.values(t.sinks)){if(Symbol.asyncDispose in s)throw new vs("Async disposables cannot be used with configureSync().");Symbol.dispose in s&&jd.add(s)}for(const s of Object.values(t.
|
|
32
|
-
filters??{}))if(!(s==null||typeof s=="string")){if(Symbol.asyncDispose in s)throw new vs("Async disposables cannot be used with configureSync().");Symbol.dispose in s&&jd.add(s)}"process"in So&&!("Deno"in So)?process.on("exit",vm):addEventListener("unload",vm);const i=jn.getLogger(["logtape","meta"]);n||i.sinks.push(_0()),i.info("LogTape loggers are configured. Note that LogTape itself uses the meta logger, which has category {metaLoggerCategory}. The meta logger purposes to log internal error\
|
|
33
|
-
s such as sink exceptions. If you are seeing this message, the meta logger is automatically configured. It's recommended to configure the meta logger with a separate sink so that you can easily notice if logging itself fails or is misconfigured. To turn off this message, configure the meta logger with higher log levels than {dismissLevel}. See also <https://logtape.org/manual/categories#meta-logger>.",{metaLoggerCategory:["logtape","meta"],dismissLevel:"info"}),r&&i.warn("The level option is\
|
|
34
|
-
deprecated in favor of lowestLevel option. Please update your configuration. See also <https://logtape.org/manual/levels#configuring-severity-levels>.")}function x0(){vm(),lP()}function lP(){const t=jn.getLogger([]);t.resetDescendants(),delete t.contextLocalStorage,P0.clear(),ym=null}function vm(){for(const t of jd)t[Symbol.dispose]();jd.clear()}class vs extends Error{constructor(e){super(e),this.name="ConfigureError"}}const dP=t=>{wm.forEach(e=>{fP(t,e)})},wm=["name","message","stack","cause",
|
|
35
|
-
"errors"],fP=(t,e)=>{const n=bm(t,e);if(n!==void 0){if(pP(n)){Kr(t,e,t[e]);return}hP(n)&&N0(t,e,n)}},bm=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:bm(r,e)},pP=({get:t,set:e})=>t!==void 0&&e===void 0,hP=({enumerable:t,writable:e})=>t||!e,Kr=(t,e,n)=>{N0(t,e,{value:n})},N0=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},mP=(t,e)=>{if(Array.isArray(
|
|
36
|
-
t.errors)){const n=t.errors.filter(gP).map(e).filter(Boolean);Kr(t,"errors",n)}else yP(t)?Kr(t,"errors",[]):t.errors!==void 0&&vP(t)},gP=t=>t!==void 0,yP=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),vP=t=>{delete t.errors,t.errors!==void 0&&Kr(t,"errors",[])},wP=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:Kr(t,"cause",n)},I0=t=>bP(t)||EP(t),bP=t=>{try{return t instanceof Error}catch{return!1}},
|
|
37
|
-
EP=t=>{try{return $P.has(Object.prototype.toString.call(t))}catch{return!1}},$P=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function Gd(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 DP=t=>!Object.isExtensible(t)||wm.some(e=>RP(t,e)||kP(t,e)),RP=(t,e)=>{const n=Object.getOwnPropertyDescriptor(
|
|
38
|
-
t,e);return n!==void 0&&!n.configurable},kP=(t,e)=>{try{return t[e],!1}catch{return!0}},Em=t=>{const e=TP(t.message,t.name);Kr(t,"stack",e)},TP=(t="",e="Error")=>{const n=CP(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},CP=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},AP=t=>{const e={};for(const n of SP(t))try{const r=t[n],{enumerable:i,configurable:s,
|
|
39
|
-
writable:o=!0}=bm(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},SP=t=>{const e=_P(t);for(const n of wm)PP(t,n)&&e.push(n);return e},_P=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},PP=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},O0=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=AP(t),a=xP(n,o),u=LP(e,a);return n===a&&FP(u,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([c,l])=>{MP(u,c,l)}),r===void 0&&
|
|
40
|
-
Em(u),u},xP=(t,e)=>typeof t=="string"&&t!==""?t:OP(NP(e)),NP=t=>{try{return JSON.stringify(t)}catch{return IP(t)}},IP=t=>{try{return String(t)}catch{return"Invalid error"}},OP=t=>t.length<L0?t:`${t.slice(0,L0)}...`,L0=1e3,LP=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in F0?new F0[t](e):new Error(e),F0={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},FP=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},MP=(t,e,n)=>{n!==void 0&&Kr(t,
|
|
41
|
-
e,n)},BP=t=>{try{const e=new Error(String(t));return Em(e),e}catch(e){return e}},{toString:qP}=Object.prototype,jP=t=>GP(t)?O0(t):I0(t)?UP(t)?O0(t):t:BP(t),GP=t=>{try{return Gd(t)}catch{return!1}},UP=t=>WP(t)||DP(t)||zP(t),WP=t=>{try{return qP.call(t)==="[object Object]"}catch{return!0}},zP=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Ud=(t,{shallow:e=!1}={})=>M0(t,[],e),M0=(t,e,n)=>{if(e.includes(
|
|
42
|
-
t))return;const r=n?HP:s=>M0(s,[...e,t],n),i=jP(t);return VP(i,r),i},HP=t=>t,VP=(t,e)=>{KP(t),XP(t),YP(t),wP(t,e),mP(t,e),dP(t)},KP=t=>{if(Wd(t.name))return;const e=Object.getPrototypeOf(t).name,n=Wd(e)?e:t.constructor.name;Kr(t,"name",n)},XP=t=>{Wd(t.message)||Kr(t,"message","")},YP=t=>{Wd(t.stack)||Em(t)},Wd=t=>typeof t=="string"&&t!=="",JP=(t,e,n=t.name)=>{if(QP(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},QP=t=>{if(!ZP(t))throw new TypeError(`Erro\
|
|
43
|
-
rClass must be a class: ${t}`);if(!B0(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!ex(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},ZP=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,B0=t=>t!==null&&(t.name==="Error"||B0(Object.getPrototypeOf(t))),ex=t=>typeof t.prototype.constructor=="function",q0=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},tx=(t,e)=>{Object.
|
|
44
|
-
getPrototypeOf(t)!==e.prototype&&(nx(t,e),U0(t,"constructor"),rx(t,e))},nx=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},rx=(t,e)=>{U0(t,"name");const n=j0(e.prototype);t.name!==n&&q0(t,"name",n)},j0=t=>ix(t)??sx(t)??j0(Object.getPrototypeOf(t)),ix=t=>Object.hasOwn(t,"name")&&G0(t.name)?t.name:void 0,sx=t=>typeof t.constructor=="function"&&G0(t.constructor.name)?t.constructor.name:void 0,G0=t=>typeof t=="string"&&t!=="",U0=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},ox=(t,e)=>{if(!ax(t,e))return;const n=cx(
|
|
45
|
-
t,e);q0(t,"stack",n)},ax=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&ux(),ux=()=>{class t extends Error{}const e={value:W0,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(W0)},W0="SetErrorClassError",cx=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=lx(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},lx=(t,e)=>[[
|
|
46
|
-
`
|
|
47
|
-
${t}: `,`
|
|
48
|
-
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],dx=(t,e,n)=>{const r=Ud(t),i=JP(r,e,n);return tx(r,e),ox(r,i),r},fx=(t,e)=>e.configurable===!1?px(t,e):gx(t,e),px=(t,e)=>({...e,...hx(t,e),...mx(t,e)}),hx=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},mx=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},gx=(t,e)=>{const n=Ma(t.enumerable,e.enumerable,!0),r=Ma(t.writable,e.writable,!0),i=Ma(t.configurable,e.configurable,!0);return{...yx(t,e,r),enumerable:n,configurable:i}},
|
|
49
|
-
yx=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!z0(t)&&!z0(e)?{value:e.value,writable:n}:{get:Ma(t.get,e.get),set:Ma(t.set,e.set)},z0=({get:t,set:e})=>t!==void 0||e!==void 0,Ma=(t,e,n)=>t??e??n,vx=(t,e,n)=>{if(!wx(t))throw new TypeError(`Argument must be an object: ${t}`);if(!bx(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return Ex(n)},wx=t=>typeof t=="object"&&t!==null,bx=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},Ex=t=>{if(!Gd(
|
|
50
|
-
t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,...a}=t,u="value"in t;return $x({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:u}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:u}},$x=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{H0(o,r,"get"),H0(o,i,"set"),$m(t,"enumerable"),$m(e,"writable"),$m(n,"configurable"),Rx(s)},H0=(t,e,n)=>{
|
|
51
|
-
if(Dx(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},Dx=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},$m=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},Rx=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},kx=(t,e,n)=>{const r=vx(
|
|
52
|
-
t,e,n),i=V0(t,e),s=fx(r,i);return Tx(t,e,s),t},V0=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:V0(r,e)},Tx=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},Cx=(t,e,n)=>{if(n!==void 0)return K0(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return K0(t,e)},K0=(t,e,n)=>{const r=Ax(e);kx(t,e,{value:n,...r})},Ax=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},Sx=(t,e,n={})=>{if(X0(t,"First argument"),X0(
|
|
53
|
-
e,"Second argument"),!Gd(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}},X0=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!_x(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},_x=t=>Gd(t)||I0(t),Px=({error:t,props:e,propName:n,soft:r})=>xx(n)||!Ox.call(e,n)||r&&t[n]!==void 0,xx=t=>t in Nx||Ix.has(t),Nx=new Error("check"),
|
|
54
|
-
Ix=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:Ox}=Object.prototype,Lx=(t,e,n)=>{const{soft:r}=Sx(t,e,n);for(const i of Reflect.ownKeys(e))Fx({error:t,props:e,propName:i,soft:r});return t},Fx=({error:t,props:e,propName:n,soft:r})=>{Px({error:t,props:e,propName:n,soft:r})||Cx(t,n,e[n])},zd=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},Mx=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);zd(t,"error\
|
|
55
|
-
s",n)},Bx=({target:t,source:e,parent:n,child:r})=>{if(!Y0(t)){qx(t,e);return}Y0(e)&&zd(t,"errors",[...r.errors,...n.errors])},qx=(t,e)=>{e.errors!==void 0&&zd(t,"errors",e.errors)},Y0=t=>t.errors!==void 0&&t.errors.length!==0,jx=(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},Gx=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?Ux({name:t,stack:e,newMessage:n,
|
|
56
|
-
currentMessage:r}):zx(t,e,n),Ux=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=Wx(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},Wx=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
57
|
-
${n}`,`
|
|
58
|
-
${e}`],[` ${n}`,` ${e}`],[n,e]],zx=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
59
|
-
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
60
|
-
`):`${r}${i}
|
|
61
|
-
${e}`},Hx=(t,e,n)=>{const r=Ud(t),i=jx(r,e,n);return Q0(r,"message",e),Vx(r,e,i),r},Vx=(t,e,n)=>{if(e===n||!Kx())return;const r=Gx(t,e,n);Q0(t,"stack",r)},Kx=()=>{const{stack:t}=new Error(J0);return typeof t=="string"&&t.includes(J0)},J0="set-error-message test message",Q0=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},Xx=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Ud(t),i=Yx(e,r.message);
|
|
62
|
-
return Hx(r,i,n)},Yx=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:Jx(n,r,t)},Jx=(t,e,n)=>t.endsWith(Qx)?n.endsWith(Zx)?`${t}
|
|
63
|
-
${e}`:`${t} ${e}`:`${e}
|
|
64
|
-
${t}`,Qx=":",Zx=`
|
|
65
|
-
`,e1=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message,s=r.message;return n.message=e.message,Xx(n,i,s)},t1=(t,e)=>Z0(t)===e,Z0=t=>typeof t=="object"&&t!==null?t.stack:void 0,n1=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(zd(e,"stack",n.stack),n),r1=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},eb=t=>tb(t,[]).error,tb=(t,e)=>{if(e.includes(t))return{};const n=u=>tb(u,[...e,t]),r=Z0(t),i=Ud(t,{shallow:!0}),s=t1(
|
|
66
|
-
i,r);Mx(i,n);const{parent:o,childHasStack:a}=i1(i,n);return{error:o,errorHasStack:s||a}},i1=(t,e)=>{const n=r1(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:s1({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},s1=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=n1({wrap:r,target:i,source:s,childHasStack:n}),a=dx(i,i.constructor,o.name),u=e1({parent:t,child:e,
|
|
67
|
-
target:a,stackError:o});return Bx({target:u,source:s,parent:t,child:e}),Lx(u,s,{soft:!r})};function nb(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]=nb(t)(i,s);return t.delete(n),r}}function o1(t,{indentation:e}={}){return JSON.stringify(t,nb(new WeakSet),e)}const rb=t=>t.split(`
|
|
68
|
-
`).map(e=>e.trim().replace("file://",""));function Dm(t,e=2){return t=Array.isArray(t)?t:t.split(`
|
|
69
|
-
`),t.map(n=>`${" ".repeat(e)}${n}`).join(`
|
|
70
|
-
`)}function hr(t){if(typeof t=="string")return t;if(t instanceof Error){const e=eb(t);if(e.stack){const n=rb(e.stack);return e.message+`
|
|
71
|
-
`+Dm(n.slice(1))}return e.message}return o1(t)}function a1(t){const e=Object.values(t.properties).filter(n=>n instanceof Error).map(n=>{const r=eb(n);return r.stack&&(r.stack=rb(r.stack).join(`
|
|
72
|
-
`)),r});return e.length===0?null:e.length===1?e[0]:new AggregateError(e)}function u1(t,e){const n=a1(t.record);if(n){let r=n.message;return n.stack&&(r=r+`
|
|
73
|
-
`+Dm(n.stack.split(`
|
|
74
|
-
`).slice(1))),r=`${f1.red}${r}${d1}`,{...t,message:t.message+`
|
|
75
|
-
`+Dm(r)}}return t}const c1={debug:"DEBUG",info:"INFO ",warning:"WARN ",error:"ERROR",fatal:"FATAL"},l1=t=>c1[t],d1="\x1B[0m",f1={red:"\x1B[31m"};function p1(t){const e=({timestamp:n,level:r,category:i,message:s})=>`${n} ${r} ${i} ${s}`;return S0({timestamp:"time",level:l1,categoryStyle:"bold",categoryColor:"cyan",category:".",...t,format:n=>e(u1(n))})}function ib(t){return _0({formatter:p1(),...t})}const vn=Q_("likec4");function h1(t){return vn.getChild(t)}let m1=!1;function g1(t){try{m1=!0;const e=t?.
|
|
76
|
-
sinks??{};uP({...t,sinks:{...e,console:e.console??ib()},loggers:[{category:["logtape","meta"],sinks:["console"],lowestLevel:"warning"},...t?.loggers??[{category:"likec4",sinks:["console"],lowestLevel:"debug"}]]})}catch(e){console.error(e)}}function Rm(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\
|
|
77
|
-
]":!0}function km(t,e,n=".",r){if(!Rm(e))return km(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(r&&r(i,s,o,n)||(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:Rm(o)&&Rm(i[s])?i[s]=km(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function y1(t){return(...e)=>e.reduce((n,r)=>km(n,r,"",t),{})}const Tm=y1();function Rt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function tr(t){return typeof t==
|
|
78
|
-
"object"&&t!==null&&typeof t.$refText=="string"}function v1(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Hd(t){return typeof t=="object"&&t!==null&&Rt(t.container)&&tr(t.reference)&&typeof t.message=="string"}class sb{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return Rt(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!==
|
|
79
|
-
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 Mi(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ws(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function ob(t){return Mi(t)&&typeof t.fullText=="string"}class Zt{constructor(e,n){this.startFn=e,this.
|
|
80
|
-
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(
|
|
81
|
-
r)}toString(){return this.join()}concat(e){return new Zt(()=>({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 Pn})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=w1(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;){
|
|
82
|
-
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 Zt(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Pn:{done:!1,value:e(i)}})}filter(e){return new Zt(this.
|
|
83
|
-
startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Pn})}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.
|
|
84
|
-
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 Zt(()=>({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(Vd(
|
|
85
|
-
s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Pn})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Zt(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Vd(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Pn})}head(){const n=this.iterator().next();if(!n.done)return n.
|
|
86
|
-
value}tail(e=1){return new Zt(()=>{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 Zt(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Pn:this.nextFn(n.state)))}distinct(e){return new Zt(()=>({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 Pn})}exclude(e,n){const r=new Set;for(const i of e){
|
|
87
|
-
const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function w1(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Vd(t){return!!t&&typeof t[Symbol.iterator]=="function"}const bs=new Zt(()=>{},()=>Pn),Pn=Object.freeze({done:!0,value:void 0});function We(...t){if(t.length===1){const e=t[0];if(e instanceof Zt)return e;if(Vd(e))return new Zt(()=>e[Symbol.iterator](),n=>n.next());
|
|
88
|
-
if(typeof e.length=="number")return new Zt(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Pn)}return t.length>1?new Zt(()=>({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++];Vd(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.
|
|
89
|
-
iterator||e.array||e.collIndex<t.length);return Pn}):bs}class _o extends Zt{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 o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(n(o.value)[Symbol.iterator]()),o}return Pn})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{
|
|
90
|
-
e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Cm;(function(t){function e(s){return s.reduce((o,a)=>o+a,0)}t.sum=e;function n(s){return s.reduce((o,a)=>o*a,0)}t.product=n;function r(s){return s.reduce((o,a)=>Math.min(o,a))}t.min=r;function i(s){return s.reduce((o,a)=>Math.max(o,a))}t.max=i})(Cm||(Cm={}));function Kd(t){return new _o(t,e=>Mi(e)?e.content:[],{includeRoot:!0})}function b1(t){return Kd(t).filter(ws)}function E1(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}
|
|
91
|
-
function Am(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Xd(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Xr;(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"})(Xr||(Xr={}));function $1(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=
|
|
92
|
-
e.start.character)return Xr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Xr.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?Xr.Inside:n?Xr.OverlapBack:r?Xr.OverlapFront:Xr.Outside}function ab(t,e){return $1(t,e)>Xr.After}const ub=/^[\w\p{L}]$/u;function Es(t,e,n=ub){if(t){if(e>0){const r=e-
|
|
93
|
-
t.offset,i=t.text.charAt(r);n.test(i)||e--}return lb(t,e)}}function Sm(t,e){if(t){const n=D1(t,!0);if(n&&cb(n,e))return n;if(ob(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(cb(s,e))return s}}}}function cb(t,e){return ws(t)&&e.includes(t.tokenType.name)}function lb(t,e){if(ws(t))return t;if(Mi(t)){const n=db(t,e,!1);if(n)return lb(n,e)}}function _m(t,e){if(ws(t))return t;if(Mi(t)){const n=db(t,e,!0);if(n)return _m(n,e)}}function db(t,e,n){let r=0,i=t.
|
|
94
|
-
content.length-1,s;for(;r<=i;){const o=Math.floor((r+i)/2),a=t.content[o];if(a.offset<=e&&a.end>e)return a;a.end<=e?(s=n?a:void 0,r=o+1):i=o-1}return s}function D1(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 R1(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 k1(t,e){
|
|
95
|
-
const n=T1(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function T1(t,e){const n=fb(t),r=fb(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const o=n[s],a=r[s];if(o.parent===a.parent)i={parent:o.parent,a:o.index,b:a.index};else break}return i}function fb(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()}class pb extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Ba(t){
|
|
96
|
-
throw new Error("Error! The input value was not handled.")}const Yd="AbstractRule",Jd="AbstractType",Pm="Condition",hb="TypeDefinition",xm="ValueLiteral",qa="AbstractElement";function Nm(t){return Je.isInstance(t,qa)}const Qd="ArrayLiteral",ja="ArrayType";function C1(t){return Je.isInstance(t,ja)}const Ga="BooleanLiteral";function A1(t){return Je.isInstance(t,Ga)}const Ua="Conjunction";function S1(t){return Je.isInstance(t,Ua)}const Wa="Disjunction";function _1(t){return Je.isInstance(t,Wa)}const Zd="\
|
|
97
|
-
Grammar",Im="GrammarImport",za="InferredType";function mb(t){return Je.isInstance(t,za)}const Ha="Interface";function gb(t){return Je.isInstance(t,Ha)}const Om="NamedArgument",Va="Negation";function P1(t){return Je.isInstance(t,Va)}const ef="NumberLiteral",tf="Parameter",Ka="ParameterReference";function x1(t){return Je.isInstance(t,Ka)}const Xa="ParserRule";function ln(t){return Je.isInstance(t,Xa)}const Ya="ReferenceType";function N1(t){return Je.isInstance(t,Ya)}const nf="ReturnType";function I1(t){
|
|
98
|
-
return Je.isInstance(t,nf)}const Ja="SimpleType";function yb(t){return Je.isInstance(t,Ja)}const rf="StringLiteral",Po="TerminalRule";function Yr(t){return Je.isInstance(t,Po)}const Qa="Type";function Lm(t){return Je.isInstance(t,Qa)}const Fm="TypeAttribute",Za="UnionType";function O1(t){return Je.isInstance(t,Za)}const eu="Action";function $s(t){return Je.isInstance(t,eu)}const tu="Alternatives";function Mm(t){return Je.isInstance(t,tu)}const nu="Assignment";function Nr(t){return Je.isInstance(
|
|
99
|
-
t,nu)}const ru="CharacterRange";function L1(t){return Je.isInstance(t,ru)}const iu="CrossReference";function su(t){return Je.isInstance(t,iu)}const ou="EndOfFile";function F1(t){return Je.isInstance(t,ou)}const au="Group";function Bi(t){return Je.isInstance(t,au)}const uu="Keyword";function Ir(t){return Je.isInstance(t,uu)}const cu="NegatedToken";function M1(t){return Je.isInstance(t,cu)}const lu="RegexToken";function B1(t){return Je.isInstance(t,lu)}const du="RuleCall";function Jr(t){return Je.
|
|
100
|
-
isInstance(t,du)}const fu="TerminalAlternatives";function q1(t){return Je.isInstance(t,fu)}const pu="TerminalGroup";function j1(t){return Je.isInstance(t,pu)}const hu="TerminalRuleCall";function vb(t){return Je.isInstance(t,hu)}const mu="UnorderedGroup";function Bm(t){return Je.isInstance(t,mu)}const gu="UntilToken";function G1(t){return Je.isInstance(t,gu)}const yu="Wildcard";function U1(t){return Je.isInstance(t,yu)}class wb extends sb{getAllTypes(){return[qa,Yd,Jd,eu,tu,Qd,ja,nu,Ga,ru,Pm,Ua,iu,
|
|
101
|
-
Wa,ou,Zd,Im,au,za,Ha,uu,Om,cu,Va,ef,tf,Ka,Xa,Ya,lu,nf,du,Ja,rf,fu,pu,Po,hu,Qa,Fm,hb,Za,mu,gu,xm,yu]}computeIsSubtype(e,n){switch(e){case eu:case tu:case nu:case ru:case iu:case ou:case au:case uu:case cu:case lu:case du:case fu:case pu:case hu:case mu:case gu:case yu:return this.isSubtype(qa,n);case Qd:case ef:case rf:return this.isSubtype(xm,n);case ja:case Ya:case Ja:case Za:return this.isSubtype(hb,n);case Ga:return this.isSubtype(Pm,n)||this.isSubtype(xm,n);case Ua:case Wa:case Va:case Ka:return this.
|
|
102
|
-
isSubtype(Pm,n);case za:case Ha:case Qa:return this.isSubtype(Jd,n);case Xa:return this.isSubtype(Yd,n)||this.isSubtype(Jd,n);case Po:return this.isSubtype(Yd,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 Jd;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Yd;case"Grammar:usedGrammar\
|
|
103
|
-
s":return Zd;case"NamedArgument:parameter":case"ParameterReference:parameter":return tf;case"TerminalRuleCall:rule":return Po;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case qa:return{name:qa,properties:[{name:"cardinality"},{name:"lookahead"}]};case Qd:return{name:Qd,properties:[{name:"elements",defaultValue:[]}]};case ja:return{name:ja,properties:[{name:"elementType"}]};case Ga:return{name:Ga,properties:[{name:"true",defaultValue:!1}]};case Ua:return{
|
|
104
|
-
name:Ua,properties:[{name:"left"},{name:"right"}]};case Wa:return{name:Wa,properties:[{name:"left"},{name:"right"}]};case Zd:return{name:Zd,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 Im:return{name:Im,properties:[{name:"pa\
|
|
105
|
-
th"}]};case za:return{name:za,properties:[{name:"name"}]};case Ha:return{name:Ha,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Om:return{name:Om,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Va:return{name:Va,properties:[{name:"value"}]};case ef:return{name:ef,properties:[{name:"value"}]};case tf:return{name:tf,properties:[{name:"name"}]};case Ka:return{name:Ka,properties:[{name:"parameter"}]};case Xa:
|
|
106
|
-
return{name:Xa,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 Ya:return{name:Ya,properties:[{name:"referenceType"}]};case nf:return{name:nf,properties:[{name:"name"}]};case Ja:return{name:Ja,properties:[{name:"primit\
|
|
107
|
-
iveType"},{name:"stringType"},{name:"typeRef"}]};case rf:return{name:rf,properties:[{name:"value"}]};case Po:return{name:Po,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Qa:return{name:Qa,properties:[{name:"name"},{name:"type"}]};case Fm:return{name:Fm,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Za:return{name:Za,properties:[{name:"types",defaultValue:[]}]};case eu:
|
|
108
|
-
return{name:eu,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case tu:return{name:tu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case nu:return{name:nu,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case ru:return{name:ru,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case iu:return{
|
|
109
|
-
name:iu,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case ou:return{name:ou,properties:[{name:"cardinality"},{name:"lookahead"}]};case au:return{name:au,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case uu:return{name:uu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case cu:return{name:cu,properties:[{name:"cardinality"},{name:"\
|
|
110
|
-
lookahead"},{name:"terminal"}]};case lu:return{name:lu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case du:return{name:du,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case fu:return{name:fu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case pu:return{name:pu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case hu:return{name:hu,properties:[
|
|
111
|
-
{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case mu:return{name:mu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case gu:return{name:gu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case yu:return{name:yu,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Je=new wb;function qm(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{Rt(
|
|
112
|
-
r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):Rt(n)&&(n.$container=t,n.$containerProperty=e))}function wn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function qi(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function lt(t){const n=sf(t).$document;if(!n)throw new Error("AST node has no document.");return n}function sf(t){for(;t.$container;)t=t.$container;return t}function vu(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Zt(
|
|
113
|
-
()=>({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(Rt(s)){if(r.keyIndex++,jm(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const o=r.arrayIndex++,a=s[o];if(Rt(a)&&jm(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return Pn})}function Or(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new _o(t,n=>vu(n,e))}function Qr(t,e){if(t){
|
|
114
|
-
if(e?.range&&!jm(t,e.range))return new _o(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new _o(t,n=>vu(n,e),{includeRoot:!0})}function jm(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?ab(r,e):!1}function of(t){return new Zt(()=>({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(tr(r))return e.keyIndex++,{done:!1,value:{reference:r,
|
|
115
|
-
container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(tr(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Pn})}function W1(t,e=lt(t).parseResult.value){const n=[];return Qr(e).forEach(r=>{of(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),We(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.
|
|
116
|
-
name]=bb(i.defaultValue))}function bb(t){return Array.isArray(t)?[...t.map(bb)]:t}function Um(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(Rt(i))n[r]=Um(i,e);else if(tr(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)Rt(o)?s.push(Um(o,e)):tr(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return qm(n),n}const wu={__proto__:null,assignMandatoryProperties:Gm,copyAstNode:Um,findLocalReferences:W1,
|
|
117
|
-
findRootNode:sf,getContainerOfType:wn,getDocument:lt,hasContainerOfType:qi,linkContentToContainer:qm,streamAllContents:Or,streamAst:Qr,streamContents:vu,streamReferences:of};function Ae(t){return t.charCodeAt(0)}function Wm(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function bu(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function xo(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function z1(){throw Error("Internal Error - Shoul\
|
|
118
|
-
d never get here!")}function Eb(t){return t.type==="Character"}const af=[];for(let t=Ae("0");t<=Ae("9");t++)af.push(t);const uf=[Ae("_")].concat(af);for(let t=Ae("a");t<=Ae("z");t++)uf.push(t);for(let t=Ae("A");t<=Ae("Z");t++)uf.push(t);const $b=[Ae(" "),Ae("\f"),Ae(`
|
|
119
|
-
`),Ae("\r"),Ae(" "),Ae("\v"),Ae(" "),Ae("\xA0"),Ae("\u1680"),Ae("\u2000"),Ae("\u2001"),Ae("\u2002"),Ae("\u2003"),Ae("\u2004"),Ae("\u2005"),Ae("\u2006"),Ae("\u2007"),Ae("\u2008"),Ae("\u2009"),Ae("\u200A"),Ae("\u2028"),Ae("\u2029"),Ae("\u202F"),Ae("\u205F"),Ae("\u3000"),Ae("\uFEFF")],H1=/[0-9a-fA-F]/,cf=/[0-9]/,V1=/[1-9]/;class Db{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=
|
|
120
|
-
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":bu(r,"global");break;case"i":bu(r,"ignoreCase");break;case"m":bu(r,"multiLine");break;case"u":bu(r,"unicode");break;case"y":bu(r,"sticky");break}if(this.idx!==this.input.length)
|
|
121
|
-
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(){
|
|
122
|
-
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}xo(n);const r=this.disjunction();return this.consumeChar("\
|
|
123
|
-
)"),{type:n,value:r,loc:this.loc(e)}}return z1()}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;xo(
|
|
124
|
-
n);break}if(!(e===!0&&n===void 0)&&xo(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()),xo(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),
|
|
125
|
-
e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Ae(`
|
|
126
|
-
`),Ae("\r"),Ae("\u2028"),Ae("\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.
|
|
127
|
-
regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=af;break;case"D":e=af,n=!0;break;case"s":e=$b;break;case"S":e=$b,n=!0;break;case"w":e=uf;break;case"W":e=uf,n=!0;break}if(xo(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Ae("\f");break;case"n":e=Ae(`
|
|
128
|
-
`);break;case"r":e=Ae("\r");break;case"t":e=Ae(" ");break;case"v":e=Ae("\v");break}if(xo(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:Ae("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){
|
|
129
|
-
return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Ae(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
130
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Ae(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,Eb(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,Eb(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.
|
|
131
|
-
value})}else Wm(r.value,e),e.push(Ae("-")),Wm(i.value,e)}else Wm(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
132
|
-
`: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:Ae("\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"\
|
|
133
|
-
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(V1.test(e)===!1)throw Error("Expecting a\
|
|
134
|
-
positive integer");for(;cf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(cf.test(e)===!1)throw Error("Expecting an integer");for(;cf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
135
|
-
`: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:Ae(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 cf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
136
|
-
`: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(){
|
|
137
|
-
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`
|
|
138
|
-
`: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(H1.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: "+
|
|
139
|
-
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 lf{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"Sta\
|
|
140
|
-
rtAnchor":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.
|
|
141
|
-
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 Rb=/\r?\n/gm,K1=new Db;class X1 extends lf{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){
|
|
142
|
-
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===`
|
|
143
|
-
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=df(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=!!`
|
|
144
|
-
`.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 zm=new X1;function Y1(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),zm.reset(t),zm.visit(K1.pattern(t)),zm.multiline}catch{return!1}}const J1=`\f
|
|
145
|
-
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Hm(t){const e=typeof t=="string"?new RegExp(t):t;return J1.some(n=>e.test(n))}function df(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q1(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:df(e)).join("")}function Z1(t,e){const n=eN(t),r=e.match(n);return!!r&&r[0].length>0}function eN(t){typeof t=="stri\
|
|
146
|
-
ng"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(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"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=r,o=o.exec(n)||
|
|
147
|
-
[],u(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=r,o=o.exec(n),o?a(o[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"!":o=r,r+=3,i(),s+=n.substr(o,r-o);break;case"<":switch(n[r+3]){case"=":case"!":o=r,r+=4,i(),s+=n.substr(o,r-o);break;default:a(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else a(1),s+=i()+"|$)";break;case")":return++r,
|
|
148
|
-
s;default:u(1);break}return s}return new RegExp(i(),t.flags)}function ff(t){return t.rules.find(e=>ln(e)&&e.entry)}function kb(t){return t.rules.filter(e=>Yr(e)&&e.hidden)}function Vm(t,e){const n=new Set,r=ff(t);if(!r)return new Set(t.rules);const i=[r].concat(kb(t));for(const o of i)Tb(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||Yr(o)&&o.hidden)&&s.add(o);return s}function Tb(t,e,n){e.add(t.name),Or(t).forEach(r=>{if(Jr(r)||n&&vb(r)){const i=r.rule.ref;i&&!e.has(i.name)&&Tb(i,
|
|
149
|
-
e,n)}})}function Km(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Qm(t.type.ref);return e?.terminal}}function Cb(t){return t.hidden&&!Hm(Du(t))}function No(t,e){return!t||!e?[]:Xm(t,e,t.astNode,!0)}function dn(t,e,n){if(!t||!e)return;const r=Xm(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 Xm(t,e,n,r){if(!r){const i=wn(t.grammarSource,Nr);if(i&&i.feature===e)return[t]}return Mi(t)&&t.astNode===n?t.content.flatMap(i=>Xm(i,e,
|
|
150
|
-
n,!1)):[]}function Ym(t,e){return t?Jm(t,e,t?.astNode):[]}function Eu(t,e,n){if(!t)return;const r=Jm(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 Jm(t,e,n){if(t.astNode!==n)return[];if(Ir(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Kd(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?Ir(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function Ab(t){
|
|
151
|
-
var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=wn(t.grammarSource,Nr);if(r)return r;t=t.container}}function Qm(t){let e=t;return mb(e)&&($s(e.$container)?e=e.$container.$container:ln(e.$container)?e=e.$container:Ba(e.$container)),Sb(t,e,new Map)}function Sb(t,e,n){var r;function i(s,o){let a;return wn(s,Nr)||(a=Sb(o,o,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of Or(e)){if(Nr(s)&&s.feature.toLowerCase()==="name")return n.
|
|
152
|
-
set(t,s),s;if(Jr(s)&&ln(s.rule.ref))return i(s,s.rule.ref);if(yb(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function _b(t){const e=t.$container;if(Bi(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if($s(s))return s;{const o=Or(n[i]).find($s);if(o)return o}}}if(Nm(e))return _b(e)}function Io(t,e){return t==="?"||t==="*"||Bi(e)&&!!e.guardCondition}function Pb(t){return t==="*"||t==="+"}function tN(t){return t==="+="}function pf(t){return xb(
|
|
153
|
-
t,new Set)}function xb(t,e){if(e.has(t))return!0;e.add(t);for(const n of Or(t))if(Jr(n)){if(!n.rule.ref||ln(n.rule.ref)&&!xb(n.rule.ref,e))return!1}else{if(Nr(n))return!1;if($s(n))return!1}return!!t.definition}function nN(t){return Zm(t.type,new Set)}function Zm(t,e){if(e.has(t))return!0;if(e.add(t),C1(t))return!1;if(N1(t))return!1;if(O1(t))return t.types.every(n=>Zm(n,e));if(yb(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;
|
|
154
|
-
return Lm(n)?Zm(n.type,e):!1}else return!1}else return!1}function Ds(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(ln(e))return e.name;if(gb(e)||Lm(e))return e.name}}}function $u(t){var e;if(ln(t))return pf(t)?t.name:(e=Ds(t))!==null&&e!==void 0?e:t.name;if(gb(t)||Lm(t)||I1(t))return t.name;if($s(t)){const n=Nb(t);if(n)return n}else if(mb(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Nb(t){
|
|
155
|
-
var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return $u(t.type.ref)}function rN(t){var e,n,r;return Yr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":pf(t)?t.name:(r=Ds(t))!==null&&r!==void 0?r:t.name}function Ib(t){var e,n,r;return Yr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=Ds(t))!==null&&r!==void 0?r:t.name}function Du(t){const e={s:!1,i:!1,u:!1},n=Oo(t.definition,e),r=Object.
|
|
156
|
-
entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const eg=/[\s\S]/.source;function Oo(t,e){if(q1(t))return iN(t);if(j1(t))return sN(t);if(L1(t))return uN(t);if(vb(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Zr(Oo(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(M1(t))return aN(t);if(G1(t))return oN(t);if(B1(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes(
|
|
157
|
-
"i"),e.s=i.includes("s"),e.u=i.includes("u")),Zr(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(U1(t))return Zr(eg,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function iN(t){return Zr(t.elements.map(e=>Oo(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function sN(t){return Zr(t.elements.map(e=>Oo(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function oN(t){return Zr(`${eg}*\
|
|
158
|
-
?${Oo(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function aN(t){return Zr(`(?!${Oo(t.terminal)})${eg}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function uN(t){return t.right?Zr(`[${tg(t.left)}-${tg(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):Zr(tg(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function tg(t){return df(t.value)}function Zr(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==
|
|
159
|
-
void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const ng={__proto__:null,findAssignment:Ab,findNameAssignment:Qm,findNodeForKeyword:Eu,findNodeForProperty:dn,findNodesForKeyword:Ym,findNodesForKeywordInternal:Jm,findNodesForProperty:No,getActionAtElement:_b,getActionType:Nb,getAllReachableRules:Vm,getCrossReferenceTerminal:Km,getEntryRule:ff,getExplicitRuleType:Ds,getHiddenRules:kb,getRuleType:Ib,getRuleTypeName:rN,getTypeName:$u,isArrayCardinality:Pb,isArrayOperator:tN,isCommentTerminal:Cb,
|
|
160
|
-
isDataType:nN,isDataTypeRule:pf,isOptionalCardinality:Io,terminalRegex:Du};function cN(t){const e=[],n=t.Grammar;for(const r of n.rules)Yr(r)&&Cb(r)&&Y1(Du(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:ub}}var Ob=typeof global=="object"&&global&&global.Object===Object&&global,lN=typeof self=="object"&&self&&self.Object===Object&&self,Lr=Ob||lN||Function("return this")(),nr=Lr.Symbol,Lb=Object.prototype,dN=Lb.hasOwnProperty,fN=Lb.toString,Ru=nr?nr.toStringTag:void 0;function pN(t){
|
|
161
|
-
var e=dN.call(t,Ru),n=t[Ru];try{t[Ru]=void 0;var r=!0}catch{}var i=fN.call(t);return r&&(e?t[Ru]=n:delete t[Ru]),i}var hN=Object.prototype,mN=hN.toString;function gN(t){return mN.call(t)}var yN="[object Null]",vN="[object Undefined]",Fb=nr?nr.toStringTag:void 0;function ji(t){return t==null?t===void 0?vN:yN:Fb&&Fb in Object(t)?pN(t):gN(t)}function mr(t){return t!=null&&typeof t=="object"}var wN="[object Symbol]";function ku(t){return typeof t=="symbol"||mr(t)&&ji(t)==wN}function hf(t,e){for(var n=-1,
|
|
162
|
-
r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Qe=Array.isArray,Mb=nr?nr.prototype:void 0,Bb=Mb?Mb.toString:void 0;function qb(t){if(typeof t=="string")return t;if(Qe(t))return hf(t,qb)+"";if(ku(t))return Bb?Bb.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var bN=/\s/;function EN(t){for(var e=t.length;e--&&bN.test(t.charAt(e)););return e}var $N=/^\s+/;function DN(t){return t&&t.slice(0,EN(t)+1).replace($N,"")}function rr(t){var e=typeof t;return t!=null&&(e=="object"||
|
|
163
|
-
e=="function")}var jb=NaN,RN=/^[-+]0x[0-9a-f]+$/i,kN=/^0b[01]+$/i,TN=/^0o[0-7]+$/i,CN=parseInt;function AN(t){if(typeof t=="number")return t;if(ku(t))return jb;if(rr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=rr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=DN(t);var n=kN.test(t);return n||TN.test(t)?CN(t.slice(2),n?2:8):RN.test(t)?jb:+t}var SN=1/0,_N=17976931348623157e292;function PN(t){if(!t)return t===0?t:0;if(t=AN(t),t===SN||t===-1/0){var e=t<0?-1:1;return e*_N}return t===t?
|
|
164
|
-
t:0}function mf(t){var e=PN(t),n=e%1;return e===e?n?e-n:e:0}function Rs(t){return t}var xN="[object AsyncFunction]",NN="[object Function]",IN="[object GeneratorFunction]",ON="[object Proxy]";function ei(t){if(!rr(t))return!1;var e=ji(t);return e==NN||e==IN||e==xN||e==ON}var rg=Lr["__core-js_shared__"],Gb=function(){var t=/[^.]+$/.exec(rg&&rg.keys&&rg.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function LN(t){return!!Gb&&Gb in t}var FN=Function.prototype,MN=FN.toString;function ks(t){if(t!=
|
|
165
|
-
null){try{return MN.call(t)}catch{}try{return t+""}catch{}}return""}var BN=/[\\^$.*+?()[\]{}|]/g,qN=/^\[object .+?Constructor\]$/,jN=Function.prototype,GN=Object.prototype,UN=jN.toString,WN=GN.hasOwnProperty,zN=RegExp("^"+UN.call(WN).replace(BN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HN(t){if(!rr(t)||LN(t))return!1;var e=ei(t)?zN:qN;return e.test(ks(t))}function VN(t,e){return t?.[e]}function Ts(t,e){var n=VN(t,e);return HN(n)?n:void 0}var ig=Ts(
|
|
166
|
-
Lr,"WeakMap"),Ub=Object.create,KN=function(){function t(){}return function(e){if(!rr(e))return{};if(Ub)return Ub(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function XN(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 zt(){}function YN(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 eI(t){var e=0,
|
|
167
|
-
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 tI(t){return function(){return t}}var gf=function(){try{var t=Ts(Object,"defineProperty");return t({},"",{}),t}catch{}}(),nI=gf?function(t,e){return gf(t,"toString",{configurable:!0,enumerable:!1,value:tI(e),writable:!0})}:Rs,rI=eI(nI);function Wb(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function zb(t,e,n,r){for(var i=t.length,
|
|
168
|
-
s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function iI(t){return t!==t}function sI(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function sg(t,e,n){return e===e?sI(t,e,n):zb(t,iI,n)}function Hb(t,e){var n=t==null?0:t.length;return!!n&&sg(t,e,0)>-1}var oI=9007199254740991,aI=/^(?:0|[1-9]\d*)$/;function yf(t,e){var n=typeof t;return e=e??oI,!!e&&(n=="number"||n!="symbol"&&aI.test(t))&&t>-1&&t%1==0&&t<e}function og(t,e,n){e=="__proto__"&&gf?gf(t,e,{configurable:!0,enumerable:!0,
|
|
169
|
-
value:n,writable:!0}):t[e]=n}function Tu(t,e){return t===e||t!==t&&e!==e}var uI=Object.prototype,cI=uI.hasOwnProperty;function vf(t,e,n){var r=t[e];(!(cI.call(t,e)&&Tu(r,n))||n===void 0&&!(e in t))&&og(t,e,n)}function Cu(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],u=void 0;u===void 0&&(u=t[a]),i?og(n,a,u):vf(n,a,u)}return n}var Vb=Math.max;function lI(t,e,n){return e=Vb(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=Vb(r.length-e,0),o=Array(s);++i<s;)
|
|
170
|
-
o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),XN(t,this,a)}}function ag(t,e){return rI(lI(t,e,Rs),t+"")}var dI=9007199254740991;function ug(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=dI}function Fr(t){return t!=null&&ug(t.length)&&!ei(t)}function Kb(t,e,n){if(!rr(n))return!1;var r=typeof e;return(r=="number"?Fr(n)&&yf(e,n.length):r=="string"&&e in n)?Tu(n[e],t):!1}function fI(t){return ag(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=
|
|
171
|
-
t.length>3&&typeof s=="function"?(i--,s):void 0,o&&Kb(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var pI=Object.prototype;function Au(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||pI;return t===n}function hI(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var mI="[object Arguments]";function Xb(t){return mr(t)&&ji(t)==mI}var Yb=Object.prototype,gI=Yb.hasOwnProperty,yI=Yb.propertyIsEnumerable,wf=Xb(function(){return arguments}())?
|
|
172
|
-
Xb:function(t){return mr(t)&&gI.call(t,"callee")&&!yI.call(t,"callee")};function vI(){return!1}var Jb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qb=Jb&&typeof module=="object"&&module&&!module.nodeType&&module,wI=Qb&&Qb.exports===Jb,Zb=wI?Lr.Buffer:void 0,bI=Zb?Zb.isBuffer:void 0,Su=bI||vI,EI="[object Arguments]",$I="[object Array]",DI="[object Boolean]",RI="[object Date]",kI="[object Error]",TI="[object Function]",CI="[object Map]",AI="[object Number]",SI="[object Object]",_I="\
|
|
173
|
-
[object RegExp]",PI="[object Set]",xI="[object String]",NI="[object WeakMap]",II="[object ArrayBuffer]",OI="[object DataView]",LI="[object Float32Array]",FI="[object Float64Array]",MI="[object Int8Array]",BI="[object Int16Array]",qI="[object Int32Array]",jI="[object Uint8Array]",GI="[object Uint8ClampedArray]",UI="[object Uint16Array]",WI="[object Uint32Array]",wt={};wt[LI]=wt[FI]=wt[MI]=wt[BI]=wt[qI]=wt[jI]=wt[GI]=wt[UI]=wt[WI]=!0,wt[EI]=wt[$I]=wt[II]=wt[DI]=wt[OI]=wt[RI]=wt[kI]=wt[TI]=wt[CI]=wt[AI]=
|
|
174
|
-
wt[SI]=wt[_I]=wt[PI]=wt[xI]=wt[NI]=!1;function zI(t){return mr(t)&&ug(t.length)&&!!wt[ji(t)]}function bf(t){return function(e){return t(e)}}var eE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_u=eE&&typeof module=="object"&&module&&!module.nodeType&&module,HI=_u&&_u.exports===eE,cg=HI&&Ob.process,Gi=function(){try{var t=_u&&_u.require&&_u.require("util").types;return t||cg&&cg.binding&&cg.binding("util")}catch{}}(),tE=Gi&&Gi.isTypedArray,lg=tE?bf(tE):zI,VI=Object.prototype,KI=VI.
|
|
175
|
-
hasOwnProperty;function nE(t,e){var n=Qe(t),r=!n&&wf(t),i=!n&&!r&&Su(t),s=!n&&!r&&!i&&lg(t),o=n||r||i||s,a=o?hI(t.length,String):[],u=a.length;for(var c in t)(e||KI.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||yf(c,u)))&&a.push(c);return a}function rE(t,e){return function(n){return t(e(n))}}var XI=rE(Object.keys,Object),YI=Object.prototype,JI=YI.hasOwnProperty;function iE(t){if(!Au(t))return XI(t);var e=[];for(var n in Object(t))
|
|
176
|
-
JI.call(t,n)&&n!="constructor"&&e.push(n);return e}function ir(t){return Fr(t)?nE(t):iE(t)}var QI=Object.prototype,ZI=QI.hasOwnProperty,Un=fI(function(t,e){if(Au(e)||Fr(e)){Cu(e,ir(e),t);return}for(var n in e)ZI.call(e,n)&&vf(t,n,e[n])});function eO(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var tO=Object.prototype,nO=tO.hasOwnProperty;function rO(t){if(!rr(t))return eO(t);var e=Au(t),n=[];for(var r in t)r=="constructor"&&(e||!nO.call(t,r))||n.push(r);return n}function dg(t){
|
|
177
|
-
return Fr(t)?nE(t,!0):rO(t)}var iO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sO=/^\w*$/;function fg(t,e){if(Qe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||ku(t)?!0:sO.test(t)||!iO.test(t)||e!=null&&t in Object(e)}var Pu=Ts(Object,"create");function oO(){this.__data__=Pu?Pu(null):{},this.size=0}function aO(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var uO="__lodash_hash_undefined__",cO=Object.prototype,lO=cO.hasOwnProperty;
|
|
178
|
-
function dO(t){var e=this.__data__;if(Pu){var n=e[t];return n===uO?void 0:n}return lO.call(e,t)?e[t]:void 0}var fO=Object.prototype,pO=fO.hasOwnProperty;function hO(t){var e=this.__data__;return Pu?e[t]!==void 0:pO.call(e,t)}var mO="__lodash_hash_undefined__";function gO(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Pu&&e===void 0?mO:e,this}function Cs(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])}}Cs.prototype.clear=oO,Cs.prototype.delete=
|
|
179
|
-
aO,Cs.prototype.get=dO,Cs.prototype.has=hO,Cs.prototype.set=gO;function yO(){this.__data__=[],this.size=0}function Ef(t,e){for(var n=t.length;n--;)if(Tu(t[n][0],e))return n;return-1}var vO=Array.prototype,wO=vO.splice;function bO(t){var e=this.__data__,n=Ef(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():wO.call(e,n,1),--this.size,!0}function EO(t){var e=this.__data__,n=Ef(e,t);return n<0?void 0:e[n][1]}function $O(t){return Ef(this.__data__,t)>-1}function DO(t,e){var n=this.__data__,r=Ef(
|
|
180
|
-
n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ti(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])}}ti.prototype.clear=yO,ti.prototype.delete=bO,ti.prototype.get=EO,ti.prototype.has=$O,ti.prototype.set=DO;var xu=Ts(Lr,"Map");function RO(){this.size=0,this.__data__={hash:new Cs,map:new(xu||ti),string:new Cs}}function kO(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function $f(t,e){
|
|
181
|
-
var n=t.__data__;return kO(e)?n[typeof e=="string"?"string":"hash"]:n.map}function TO(t){var e=$f(this,t).delete(t);return this.size-=e?1:0,e}function CO(t){return $f(this,t).get(t)}function AO(t){return $f(this,t).has(t)}function SO(t,e){var n=$f(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ni(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])}}ni.prototype.clear=RO,ni.prototype.delete=TO,ni.prototype.get=CO,ni.prototype.has=AO,
|
|
182
|
-
ni.prototype.set=SO;var _O="Expected a function";function pg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(_O);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 o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(pg.Cache||ni),n}pg.Cache=ni;var PO=500;function xO(t){var e=pg(t,function(r){return n.size===PO&&n.clear(),r}),n=e.cache;return e}var NO=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
|
|
183
|
-
IO=/\\(\\)?/g,OO=xO(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(NO,function(n,r,i,s){e.push(i?s.replace(IO,"$1"):r||n)}),e});function LO(t){return t==null?"":qb(t)}function Df(t,e){return Qe(t)?t:fg(t,e)?[t]:OO(LO(t))}function Nu(t){if(typeof t=="string"||ku(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function hg(t,e){e=Df(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Nu(e[n++])];return n&&n==r?t:void 0}function FO(t,e,n){var r=t==null?void 0:hg(t,e);return r===
|
|
184
|
-
void 0?n:r}function mg(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var sE=nr?nr.isConcatSpreadable:void 0;function MO(t){return Qe(t)||wf(t)||!!(sE&&t&&t[sE])}function gg(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=MO),i||(i=[]);++s<o;){var a=t[s];n(a)?mg(i,a):r||(i[i.length]=a)}return i}function sr(t){var e=t==null?0:t.length;return e?gg(t):[]}var oE=rE(Object.getPrototypeOf,Object);function aE(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>>>
|
|
185
|
-
0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function BO(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 qO(){this.__data__=new ti,this.size=0}function jO(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function GO(t){return this.__data__.get(t)}function UO(t){return this.__data__.has(t)}var WO=200;function zO(t,e){var n=this.__data__;if(n instanceof ti){var r=n.__data__;if(!xu||r.length<WO-1)return r.push([t,e]),this.
|
|
186
|
-
size=++n.size,this;n=this.__data__=new ni(r)}return n.set(t,e),this.size=n.size,this}function Mr(t){var e=this.__data__=new ti(t);this.size=e.size}Mr.prototype.clear=qO,Mr.prototype.delete=jO,Mr.prototype.get=GO,Mr.prototype.has=UO,Mr.prototype.set=zO;function HO(t,e){return t&&Cu(e,ir(e),t)}function VO(t,e){return t&&Cu(e,dg(e),t)}var uE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cE=uE&&typeof module=="object"&&module&&!module.nodeType&&module,KO=cE&&cE.exports===uE,lE=KO?Lr.
|
|
187
|
-
Buffer:void 0,dE=lE?lE.allocUnsafe:void 0;function XO(t,e){var n=t.length,r=dE?dE(n):new t.constructor(n);return t.copy(r),r}function yg(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function fE(){return[]}var YO=Object.prototype,JO=YO.propertyIsEnumerable,pE=Object.getOwnPropertySymbols,vg=pE?function(t){return t==null?[]:(t=Object(t),yg(pE(t),function(e){return JO.call(t,e)}))}:fE;function QO(t,e){return Cu(t,vg(t),e)}var ZO=Object.getOwnPropertySymbols,
|
|
188
|
-
hE=ZO?function(t){for(var e=[];t;)mg(e,vg(t)),t=oE(t);return e}:fE;function eL(t,e){return Cu(t,hE(t),e)}function mE(t,e,n){var r=e(t);return Qe(t)?r:mg(r,n(t))}function wg(t){return mE(t,ir,vg)}function tL(t){return mE(t,dg,hE)}var bg=Ts(Lr,"DataView"),Eg=Ts(Lr,"Promise"),Lo=Ts(Lr,"Set"),gE="[object Map]",nL="[object Object]",yE="[object Promise]",vE="[object Set]",wE="[object WeakMap]",bE="[object DataView]",rL=ks(bg),iL=ks(xu),sL=ks(Eg),oL=ks(Lo),aL=ks(ig),or=ji;(bg&&or(new bg(new ArrayBuffer(
|
|
189
|
-
1)))!=bE||xu&&or(new xu)!=gE||Eg&&or(Eg.resolve())!=yE||Lo&&or(new Lo)!=vE||ig&&or(new ig)!=wE)&&(or=function(t){var e=ji(t),n=e==nL?t.constructor:void 0,r=n?ks(n):"";if(r)switch(r){case rL:return bE;case iL:return gE;case sL:return yE;case oL:return vE;case aL:return wE}return e});var uL=Object.prototype,cL=uL.hasOwnProperty;function lL(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&cL.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Rf=Lr.Uint8Array;function dL(t){
|
|
190
|
-
var e=new t.constructor(t.byteLength);return new Rf(e).set(new Rf(t)),e}function fL(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var pL=/\w*$/;function hL(t){var e=new t.constructor(t.source,pL.exec(t));return e.lastIndex=t.lastIndex,e}var EE=nr?nr.prototype:void 0,$E=EE?EE.valueOf:void 0;function mL(t){return $E?Object($E.call(t)):{}}function gL(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var yL="[object Boolean]",vL="[object Date]",wL="[ob\
|
|
191
|
-
ject Map]",bL="[object Number]",EL="[object RegExp]",$L="[object Set]",DL="[object String]",RL="[object Symbol]",kL="[object ArrayBuffer]",TL="[object DataView]",CL="[object Float32Array]",AL="[object Float64Array]",SL="[object Int8Array]",_L="[object Int16Array]",PL="[object Int32Array]",xL="[object Uint8Array]",NL="[object Uint8ClampedArray]",IL="[object Uint16Array]",OL="[object Uint32Array]";function LL(t,e,n){var r=t.constructor;switch(e){case kL:return dL(t);case yL:case vL:return new r(+t);case TL:
|
|
192
|
-
return fL(t);case CL:case AL:case SL:case _L:case PL:case xL:case NL:case IL:case OL:return gL(t);case wL:return new r;case bL:case DL:return new r(t);case EL:return hL(t);case $L:return new r;case RL:return mL(t)}}function FL(t){return typeof t.constructor=="function"&&!Au(t)?KN(oE(t)):{}}var ML="[object Map]";function BL(t){return mr(t)&&or(t)==ML}var DE=Gi&&Gi.isMap,qL=DE?bf(DE):BL,jL="[object Set]";function GL(t){return mr(t)&&or(t)==jL}var RE=Gi&&Gi.isSet,UL=RE?bf(RE):GL,WL=2,kE="[object Ar\
|
|
193
|
-
guments]",zL="[object Array]",HL="[object Boolean]",VL="[object Date]",KL="[object Error]",TE="[object Function]",XL="[object GeneratorFunction]",YL="[object Map]",JL="[object Number]",CE="[object Object]",QL="[object RegExp]",ZL="[object Set]",eF="[object String]",tF="[object Symbol]",nF="[object WeakMap]",rF="[object ArrayBuffer]",iF="[object DataView]",sF="[object Float32Array]",oF="[object Float64Array]",aF="[object Int8Array]",uF="[object Int16Array]",cF="[object Int32Array]",lF="[object Ui\
|
|
194
|
-
nt8Array]",dF="[object Uint8ClampedArray]",fF="[object Uint16Array]",pF="[object Uint32Array]",gt={};gt[kE]=gt[zL]=gt[rF]=gt[iF]=gt[HL]=gt[VL]=gt[sF]=gt[oF]=gt[aF]=gt[uF]=gt[cF]=gt[YL]=gt[JL]=gt[CE]=gt[QL]=gt[ZL]=gt[eF]=gt[tF]=gt[lF]=gt[dF]=gt[fF]=gt[pF]=!0,gt[KL]=gt[TE]=gt[nF]=!1;function kf(t,e,n,r,i,s){var o,a=e&WL;if(o!==void 0)return o;if(!rr(t))return t;var u=Qe(t);if(u)return o=lL(t),YN(t,o);var c=or(t),l=c==TE||c==XL;if(Su(t))return XO(t);if(c==CE||c==kE||l&&!i)return o=l?{}:FL(t),a?eL(t,
|
|
195
|
-
VO(o,t)):QO(t,HO(o,t));if(!gt[c])return i?t:{};o=LL(t,c),s||(s=new Mr);var f=s.get(t);if(f)return f;s.set(t,o),UL(t)?t.forEach(function(h){o.add(kf(h,e,n,h,t,s))}):qL(t)&&t.forEach(function(h,v){o.set(v,kf(h,e,n,v,t,s))});var d=wg,p=u?void 0:d(t);return Wb(p||t,function(h,v){p&&(v=h,h=t[v]),vf(o,v,kf(h,e,n,v,t,s))}),o}var hF=4;function nn(t){return kf(t,hF)}function Iu(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 mF="__lodash_hash_undefined__";function gF(t){
|
|
196
|
-
return this.__data__.set(t,mF),this}function yF(t){return this.__data__.has(t)}function Fo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ni;++e<n;)this.add(t[e])}Fo.prototype.add=Fo.prototype.push=gF,Fo.prototype.has=yF;function AE(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 $g(t,e){return t.has(e)}var vF=1,wF=2;function SE(t,e,n,r,i,s){var o=n&vF,a=t.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&
|
|
197
|
-
l==t;var f=-1,d=!0,p=n&wF?new Fo:void 0;for(s.set(t,e),s.set(e,t);++f<a;){var h=t[f],v=e[f];if(r)var b=o?r(v,h,f,e,t,s):r(h,v,f,t,e,s);if(b!==void 0){if(b)continue;d=!1;break}if(p){if(!AE(e,function(y,E){if(!$g(p,E)&&(h===y||i(h,y,n,r,s)))return p.push(E)})){d=!1;break}}else if(!(h===v||i(h,v,n,r,s))){d=!1;break}}return s.delete(t),s.delete(e),d}function bF(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Dg(t){var e=-1,n=Array(t.size);return t.forEach(function(r){
|
|
198
|
-
n[++e]=r}),n}var EF=1,$F=2,DF="[object Boolean]",RF="[object Date]",kF="[object Error]",TF="[object Map]",CF="[object Number]",AF="[object RegExp]",SF="[object Set]",_F="[object String]",PF="[object Symbol]",xF="[object ArrayBuffer]",NF="[object DataView]",_E=nr?nr.prototype:void 0,Rg=_E?_E.valueOf:void 0;function IF(t,e,n,r,i,s,o){switch(n){case NF:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case xF:return!(t.byteLength!=e.byteLength||!s(new Rf(t),new Rf(
|
|
199
|
-
e)));case DF:case RF:case CF:return Tu(+t,+e);case kF:return t.name==e.name&&t.message==e.message;case AF:case _F:return t==e+"";case TF:var a=bF;case SF:var u=r&EF;if(a||(a=Dg),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;r|=$F,o.set(t,e);var l=SE(a(t),a(e),r,i,s,o);return o.delete(t),l;case PF:if(Rg)return Rg.call(t)==Rg.call(e)}return!1}var OF=1,LF=Object.prototype,FF=LF.hasOwnProperty;function MF(t,e,n,r,i,s){var o=n&OF,a=wg(t),u=a.length,c=wg(e),l=c.length;if(u!=l&&!o)return!1;
|
|
200
|
-
for(var f=u;f--;){var d=a[f];if(!(o?d in e:FF.call(e,d)))return!1}var p=s.get(t),h=s.get(e);if(p&&h)return p==e&&h==t;var v=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<u;){d=a[f];var y=t[d],E=e[d];if(r)var R=o?r(E,y,d,e,t,s):r(y,E,d,t,e,s);if(!(R===void 0?y===E||i(y,E,n,r,s):R)){v=!1;break}b||(b=d=="constructor")}if(v&&!b){var A=t.constructor,N=e.constructor;A!=N&&"constructor"in t&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof N=="function"&&N instanceof N)&&(v=!1)}return s.delete(
|
|
201
|
-
t),s.delete(e),v}var BF=1,PE="[object Arguments]",xE="[object Array]",Tf="[object Object]",qF=Object.prototype,NE=qF.hasOwnProperty;function jF(t,e,n,r,i,s){var o=Qe(t),a=Qe(e),u=o?xE:or(t),c=a?xE:or(e);u=u==PE?Tf:u,c=c==PE?Tf:c;var l=u==Tf,f=c==Tf,d=u==c;if(d&&Su(t)){if(!Su(e))return!1;o=!0,l=!1}if(d&&!l)return s||(s=new Mr),o||lg(t)?SE(t,e,n,r,i,s):IF(t,e,u,n,r,i,s);if(!(n&BF)){var p=l&&NE.call(t,"__wrapped__"),h=f&&NE.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,b=h?e.value():e;return s||
|
|
202
|
-
(s=new Mr),i(v,b,n,r,s)}}return d?(s||(s=new Mr),MF(t,e,n,r,i,s)):!1}function kg(t,e,n,r,i){return t===e?!0:t==null||e==null||!mr(t)&&!mr(e)?t!==t&&e!==e:jF(t,e,n,r,kg,i)}var GF=1,UF=2;function WF(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],u=t[a],c=o[1];if(o[2]){if(u===void 0&&!(a in t))return!1}else{var l=new Mr,f;if(!(f===void 0?kg(c,u,GF|UF,r,l):f))return!1}}return!0}function IE(t){
|
|
203
|
-
return t===t&&!rr(t)}function zF(t){for(var e=ir(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,IE(i)]}return e}function OE(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function HF(t){var e=zF(t);return e.length==1&&e[0][2]?OE(e[0][0],e[0][1]):function(n){return n===t||WF(n,t,e)}}function VF(t,e){return t!=null&&e in Object(t)}function LE(t,e,n){e=Df(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Nu(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=
|
|
204
|
-
i?s:(i=t==null?0:t.length,!!i&&ug(i)&&yf(o,i)&&(Qe(t)||wf(t)))}function KF(t,e){return t!=null&&LE(t,e,VF)}var XF=1,YF=2;function JF(t,e){return fg(t)&&IE(e)?OE(Nu(t),e):function(n){var r=FO(n,t);return r===void 0&&r===e?KF(n,t):kg(e,r,XF|YF)}}function QF(t){return function(e){return e?.[t]}}function ZF(t){return function(e){return hg(e,t)}}function eM(t){return fg(t)?QF(Nu(t)):ZF(t)}function gr(t){return typeof t=="function"?t:t==null?Rs:typeof t=="object"?Qe(t)?JF(t[0],t[1]):HF(t):eM(t)}function tM(t,e,n,r){
|
|
205
|
-
for(var i=-1,s=t==null?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function nM(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var u=o[++i];if(n(s[u],u,s)===!1)break}return e}}var rM=nM();function iM(t,e){return t&&rM(t,e,ir)}function sM(t,e){return function(n,r){if(n==null)return n;if(!Fr(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var As=sM(iM);function oM(t,e,n,r){return As(t,function(i,s,o){e(r,i,n(i),o)}),r}function aM(t,e){
|
|
206
|
-
return function(n,r){var i=Qe(n)?tM:oM,s=e?e():{};return i(n,t,gr(r),s)}}var FE=Object.prototype,uM=FE.hasOwnProperty,Tg=ag(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Kb(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=dg(s),a=-1,u=o.length;++a<u;){var c=o[a],l=t[c];(l===void 0||Tu(l,FE[c])&&!uM.call(t,c))&&(t[c]=s[c])}return t});function ME(t){return mr(t)&&Fr(t)}var cM=200;function lM(t,e,n,r){var i=-1,s=Hb,o=!0,a=t.length,u=[],c=e.length;if(!a)return u;e.length>=cM&&(s=
|
|
207
|
-
$g,o=!1,e=new Fo(e));e:for(;++i<a;){var l=t[i],f=l;if(l=l!==0?l:0,o&&f===f){for(var d=c;d--;)if(e[d]===f)continue e;u.push(l)}else s(e,f,r)||u.push(l)}return u}var Cf=ag(function(t,e){return ME(t)?lM(t,gg(e,1,ME,!0)):[]});function Mo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function rn(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:mf(e),aE(t,e<0?0:e,r)):[]}function Ou(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:mf(e),e=r-e,aE(t,0,e<0?0:e)):[]}function dM(t){return typeof t==
|
|
208
|
-
"function"?t:Rs}function ke(t,e){var n=Qe(t)?Wb:As;return n(t,dM(e))}function fM(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 pM(t,e){var n=!0;return As(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function yr(t,e,n){var r=Qe(t)?fM:pM;return r(t,gr(e))}function BE(t,e){var n=[];return As(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function Wn(t,e){var n=Qe(t)?yg:BE;return n(t,gr(e))}function hM(t){return function(e,n,r){var i=Object(e);if(!Fr(e)){var s=gr(
|
|
209
|
-
n);e=ir(e),n=function(a){return s(i[a],a,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}var mM=Math.max;function gM(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:mf(n);return i<0&&(i=mM(r+i,0)),zb(t,gr(e),i)}var Bo=hM(gM);function vr(t){return t&&t.length?t[0]:void 0}function yM(t,e){var n=-1,r=Fr(t)?Array(t.length):[];return As(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function ve(t,e){var n=Qe(t)?hf:yM;return n(t,gr(e))}function zn(t,e){return gg(ve(t,e))}var vM=Object.prototype,
|
|
210
|
-
wM=vM.hasOwnProperty,bM=aM(function(t,e,n){wM.call(t,n)?t[n].push(e):og(t,n,[e])}),EM=Object.prototype,$M=EM.hasOwnProperty;function DM(t,e){return t!=null&&$M.call(t,e)}function Te(t,e){return t!=null&&LE(t,e,DM)}var RM="[object String]";function xn(t){return typeof t=="string"||!Qe(t)&&mr(t)&&ji(t)==RM}function kM(t,e){return hf(e,function(n){return t[n]})}function Ht(t){return t==null?[]:kM(t,ir(t))}var TM=Math.max;function bn(t,e,n,r){t=Fr(t)?t:Ht(t),n=n?mf(n):0;var i=t.length;return n<0&&(n=
|
|
211
|
-
TM(i+n,0)),xn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&sg(t,e,n)>-1}function qE(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return sg(t,e,i)}var CM="[object Map]",AM="[object Set]",SM=Object.prototype,_M=SM.hasOwnProperty;function dt(t){if(t==null)return!0;if(Fr(t)&&(Qe(t)||typeof t=="string"||typeof t.splice=="function"||Su(t)||lg(t)||wf(t)))return!t.length;var e=or(t);if(e==CM||e==AM)return!t.size;if(Au(t))return!iE(t).length;for(var n in t)if(_M.call(t,n))return!1;return!0}var PM="[object R\
|
|
212
|
-
egExp]";function xM(t){return mr(t)&&ji(t)==PM}var jE=Gi&&Gi.isRegExp,ri=jE?bf(jE):xM;function ii(t){return t===void 0}function NM(t,e){return t<e}function IM(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!ku(o):n(o,a)))var a=o,u=s}return u}function OM(t){return t&&t.length?IM(t,Rs,NM):void 0}var LM="Expected a function";function FM(t){if(typeof t!="function")throw new TypeError(LM);return function(){var e=arguments;switch(e.length){case 0:return!t.call(
|
|
213
|
-
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 MM(t,e,n,r){if(!rr(t))return t;e=Df(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var u=Nu(e[i]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=o){var l=a[u];c=void 0,c===void 0&&(c=rr(l)?l:yf(e[i+1])?[]:{})}vf(a,u,c),a=a[u]}return t}function BM(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=hg(t,o);n(
|
|
214
|
-
a,o)&&MM(s,Df(o,t),a)}return s}function wr(t,e){if(t==null)return{};var n=hf(tL(t),function(r){return[r]});return e=gr(e),BM(t,n,function(r,i){return e(r,i[0])})}function qM(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function En(t,e,n){var r=Qe(t)?BO:qM,i=arguments.length<3;return r(t,gr(e),n,i,As)}function Af(t,e){var n=Qe(t)?yg:BE;return n(t,FM(gr(e)))}function jM(t,e){var n;return As(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function GE(t,e,n){var r=Qe(t)?AE:jM;return r(
|
|
215
|
-
t,gr(e))}var GM=1/0,UM=Lo&&1/Dg(new Lo([,-0]))[1]==GM?function(t){return new Lo(t)}:zt,WM=200;function UE(t,e,n){var r=-1,i=Hb,s=t.length,o=!0,a=[],u=a;if(s>=WM){var c=e?null:UM(t);if(c)return Dg(c);o=!1,i=$g,u=new Fo}else u=e?[]:a;e:for(;++r<s;){var l=t[r],f=e?e(l):l;if(l=l!==0?l:0,o&&f===f){for(var d=u.length;d--;)if(u[d]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,n)||(u!==a&&u.push(f),a.push(l))}return a}function Cg(t){return t&&t.length?UE(t):[]}function zM(t,e){return t&&t.length?UE(t,
|
|
216
|
-
gr(e)):[]}function Ag(t){console&&console.error&&console.error(`Error: ${t}`)}function WE(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function zE(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function HE(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function HM(t){return VM(t)?t.LABEL:t.name}function VM(t){return xn(t.LABEL)&&t.LABEL!==""}class Br{get definition(){return this._definition}set definition(e){
|
|
217
|
-
this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),ke(this.definition,n=>{n.accept(e)})}}class $n extends Br{constructor(e){super([]),this.idx=1,Un(this,wr(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class qo extends Br{constructor(e){super(e.definition),this.orgText="",Un(this,wr(e,n=>n!==void 0))}}class Nn extends Br{constructor(e){super(e.definition),this.ignoreAmbiguities=
|
|
218
|
-
!1,Un(this,wr(e,n=>n!==void 0))}}class sn extends Br{constructor(e){super(e.definition),this.idx=1,Un(this,wr(e,n=>n!==void 0))}}class Hn extends Br{constructor(e){super(e.definition),this.idx=1,Un(this,wr(e,n=>n!==void 0))}}class Vn extends Br{constructor(e){super(e.definition),this.idx=1,Un(this,wr(e,n=>n!==void 0))}}class St extends Br{constructor(e){super(e.definition),this.idx=1,Un(this,wr(e,n=>n!==void 0))}}class In extends Br{constructor(e){super(e.definition),this.idx=1,Un(this,wr(e,n=>n!==
|
|
219
|
-
void 0))}}class On 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,Un(this,wr(e,n=>n!==void 0))}}class bt{constructor(e){this.idx=1,Un(this,wr(e,n=>n!==void 0))}accept(e){e.visit(this)}}function KM(t){return ve(t,Sf)}function Sf(t){function e(n){return ve(n,Sf)}if(t instanceof $n){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return xn(t.label)&&(n.
|
|
220
|
-
label=t.label),n}else{if(t instanceof Nn)return{type:"Alternative",definition:e(t.definition)};if(t instanceof sn)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Hn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Vn)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Sf(new bt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof In)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Sf(new bt(
|
|
221
|
-
{terminalType:t.separator})),definition:e(t.definition)};if(t instanceof St)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof On)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof bt){const n={type:"Terminal",name:t.terminalType.name,label:HM(t.terminalType),idx:t.idx};xn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=ri(r)?r.source:r),n}else{if(t instanceof qo)return{type:"Rul\
|
|
222
|
-
e",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class jo{visit(e){const n=e;switch(n.constructor){case $n:return this.visitNonTerminal(n);case Nn:return this.visitAlternative(n);case sn:return this.visitOption(n);case Hn:return this.visitRepetitionMandatory(n);case Vn:return this.visitRepetitionMandatoryWithSeparator(n);case In:return this.visitRepetitionWithSeparator(n);case St:return this.visitRepetition(n);case On:return this.visitAlternation(
|
|
223
|
-
n);case bt:return this.visitTerminal(n);case qo: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 XM(t){return t instanceof Nn||t instanceof sn||t instanceof St||t instanceof Hn||t instanceof Vn||t instanceof In||t instanceof bt||t instanceof
|
|
224
|
-
qo}function _f(t,e=[]){return t instanceof sn||t instanceof St||t instanceof In?!0:t instanceof On?GE(t.definition,r=>_f(r,e)):t instanceof $n&&bn(e,t)?!1:t instanceof Br?(t instanceof $n&&e.push(t),yr(t.definition,r=>_f(r,e))):!1}function YM(t){return t instanceof On}function qr(t){if(t instanceof $n)return"SUBRULE";if(t instanceof sn)return"OPTION";if(t instanceof On)return"OR";if(t instanceof Hn)return"AT_LEAST_ONE";if(t instanceof Vn)return"AT_LEAST_ONE_SEP";if(t instanceof In)return"MANY_SE\
|
|
225
|
-
P";if(t instanceof St)return"MANY";if(t instanceof bt)return"CONSUME";throw Error("non exhaustive match")}class Pf{walk(e,n=[]){ke(e.definition,(r,i)=>{const s=rn(e.definition,i+1);if(r instanceof $n)this.walkProdRef(r,s,n);else if(r instanceof bt)this.walkTerminal(r,s,n);else if(r instanceof Nn)this.walkFlat(r,s,n);else if(r instanceof sn)this.walkOption(r,s,n);else if(r instanceof Hn)this.walkAtLeastOne(r,s,n);else if(r instanceof Vn)this.walkAtLeastOneSep(r,s,n);else if(r instanceof In)this.walkManySep(
|
|
226
|
-
r,s,n);else if(r instanceof St)this.walkMany(r,s,n);else if(r instanceof On)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 sn({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=VE(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new sn({definition:e.definition})].concat(
|
|
227
|
-
n,r);this.walk(e,i)}walkManySep(e,n,r){const i=VE(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);ke(e.definition,s=>{const o=new Nn({definition:[s]});this.walk(o,i)})}}function VE(t,e,n){return[new sn({definition:[new bt({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Lu(t){if(t instanceof $n)return Lu(t.referencedRule);if(t instanceof bt)return ZM(t);if(XM(t))return JM(t);if(YM(t))return QM(t);throw Error("non exhaustive match")}function JM(t){let e=[];const n=t.
|
|
228
|
-
definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=_f(s),e=e.concat(Lu(s)),r=r+1,i=n.length>r;return Cg(e)}function QM(t){const e=ve(t.definition,n=>Lu(n));return Cg(sr(e))}function ZM(t){return[t.terminalType]}const KE="_~IN~_";class e2 extends Pf{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=n2(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new Nn({definition:s}),
|
|
229
|
-
a=Lu(o);this.follows[i]=a}}function t2(t){const e={};return ke(t,n=>{const r=new e2(n).startWalking();Un(e,r)}),e}function n2(t,e){return t.name+e+KE}let xf={};const r2=new Db;function Nf(t){const e=t.toString();if(xf.hasOwnProperty(e))return xf[e];{const n=r2.pattern(e);return xf[e]=n,n}}function i2(){xf={}}const XE="Complement Sets are not supported for first char optimization",If=`Unable to use "first char" lexer optimizations:
|
|
230
|
-
`;function s2(t,e=!1){try{const n=Nf(t);return Sg(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===XE)e&&WE(`${If} Unable to optimize: < ${t.toString()} >
|
|
231
|
-
Complement Sets cannot be automatically optimized.
|
|
232
|
-
This will disable the lexer's first char optimizations.
|
|
233
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
|
|
234
|
-
This will disable the lexer's first char optimizations.
|
|
235
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Ag(`${If}
|
|
236
|
-
Failed parsing: < ${t.toString()} >
|
|
237
|
-
Using the @chevrotain/regexp-to-ast library
|
|
238
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function Sg(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Sg(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 o=s;switch(o.type){case"Character":Of(o.value,e,n);break;case"\
|
|
239
|
-
Set":if(o.complement===!0)throw Error(XE);ke(o.value,u=>{if(typeof u=="number")Of(u,e,n);else{const c=u;if(n===!0)for(let l=c.from;l<=c.to;l++)Of(l,e,n);else{for(let l=c.from;l<=c.to&&l<Mu;l++)Of(l,e,n);if(c.to>=Mu){const l=c.from>=Mu?c.from:Mu,f=c.to,d=Ui(l),p=Ui(f);for(let h=d;h<=p;h++)e[h]=h}}}});break;case"Group":Sg(o.value,e,n);break;default:throw Error("Non Exhaustive Match")}const a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&_g(o)===!1||o.type!=="Group"&&a===!1)break}
|
|
240
|
-
break;default:throw Error("non exhaustive match!")}return Ht(e)}function Of(t,e,n){const r=Ui(t);e[r]=r,n===!0&&o2(t,e)}function o2(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Ui(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Ui(i.charCodeAt(0));e[s]=s}}}function YE(t,e){return Bo(t.value,n=>{if(typeof n=="number")return bn(e,n);{const r=n;return Bo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function _g(t){const e=t.quantifier;return e&&e.atLeast===0?
|
|
241
|
-
!0:t.value?Qe(t.value)?yr(t.value,_g):_g(t.value):!1}class a2 extends lf{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){bn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?YE(e,this.targetCharCodes)===void 0&&(this.found=!0):YE(e,this.targetCharCodes)!==void 0&&
|
|
242
|
-
(this.found=!0)}}function Pg(t,e){if(e instanceof RegExp){const n=Nf(e),r=new a2(t);return r.visit(n),r.found}else return Bo(e,n=>bn(t,n.charCodeAt(0)))!==void 0}const Ss="PATTERN",Fu="defaultMode",Lf="modes";let JE=typeof new RegExp("(?:)").sticky=="boolean";function u2(t,e){e=Tg(e,{useSticky:JE,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
243
|
-
`],tracer:(E,R)=>R()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{P2()});let r;n("Reject Lexer.NA",()=>{r=Af(t,E=>E[Ss]===Ln.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=ve(r,E=>{const R=E[Ss];if(ri(R)){const A=R.source;return A.length===1&&A!=="^"&&A!=="$"&&A!=="."&&!R.ignoreCase?A:A.length===2&&A[0]==="\\"&&!bn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],A[1])?A[1]:e.useSticky?ZE(R):QE(R)}else{if(ei(R))return i=!0,{exec:R};if(typeof R=="object")return i=
|
|
244
|
-
!0,R;if(typeof R=="string"){if(R.length===1)return R;{const A=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),N=new RegExp(A);return e.useSticky?ZE(N):QE(N)}}else throw Error("non exhaustive match")}})});let o,a,u,c,l;n("misc mapping",()=>{o=ve(r,E=>E.tokenTypeIdx),a=ve(r,E=>{const R=E.GROUP;if(R!==Ln.SKIPPED){if(xn(R))return R;if(ii(R))return!1;throw Error("non exhaustive match")}}),u=ve(r,E=>{const R=E.LONGER_ALT;if(R)return Qe(R)?ve(R,N=>qE(r,N)):[qE(r,R)]}),c=ve(r,E=>E.PUSH_MODE),l=ve(r,E=>Te(E,"POP\
|
|
245
|
-
_MODE"))});let f;n("Line Terminator Handling",()=>{const E=n$(e.lineTerminatorCharacters);f=ve(r,R=>!1),e.positionTracking!=="onlyOffset"&&(f=ve(r,R=>Te(R,"LINE_BREAKS")?!!R.LINE_BREAKS:t$(R,E)===!1&&Pg(E,R.PATTERN)))});let d,p,h,v;n("Misc Mapping #2",()=>{d=ve(r,e$),p=ve(s,A2),h=En(r,(E,R)=>{const A=R.GROUP;return xn(A)&&A!==Ln.SKIPPED&&(E[A]=[]),E},{}),v=ve(s,(E,R)=>({pattern:s[R],longerAlt:u[R],canLineTerminator:f[R],isCustom:d[R],short:p[R],group:a[R],push:c[R],pop:l[R],tokenTypeIdx:o[R],tokenType:r[R]}))});
|
|
246
|
-
let b=!0,y=[];return e.safeMode||n("First Char Optimization",()=>{y=En(r,(E,R,A)=>{if(typeof R.PATTERN=="string"){const N=R.PATTERN.charCodeAt(0),K=Ui(N);xg(E,K,v[A])}else if(Qe(R.START_CHARS_HINT)){let N;ke(R.START_CHARS_HINT,K=>{const J=typeof K=="string"?K.charCodeAt(0):K,se=Ui(J);N!==se&&(N=se,xg(E,se,v[A]))})}else if(ri(R.PATTERN))if(R.PATTERN.unicode)b=!1,e.ensureOptimizations&&Ag(`${If} Unable to analyze < ${R.PATTERN.toString()} > pattern.
|
|
247
|
-
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
248
|
-
This will disable the lexer's first char optimizations.
|
|
249
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const N=s2(R.PATTERN,e.ensureOptimizations);dt(N)&&(b=!1),ke(N,K=>{xg(E,K,v[A])})}else e.ensureOptimizations&&Ag(`${If} TokenType: <${R.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
250
|
-
This will disable the lexer's first char optimizations.
|
|
251
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return E},[])}),{emptyGroups:h,patternIdxToConfig:v,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:b}}function c2(t,e){let n=[];const r=d2(t);n=n.concat(r.errors);const i=f2(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(l2(s)),n=n.concat(b2(s)),n=n.concat(E2(s,e)),n=n.concat($2(s)),n}function l2(t){let e=[];const n=Wn(t,r=>ri(r[Ss]));return e=e.concat(h2(n)),e=e.concat(y2(
|
|
252
|
-
n)),e=e.concat(v2(n)),e=e.concat(w2(n)),e=e.concat(m2(n)),e}function d2(t){const e=Wn(t,i=>!Te(i,Ss)),n=ve(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:_t.MISSING_PATTERN,tokenTypes:[i]})),r=Cf(t,e);return{errors:n,valid:r}}function f2(t){const e=Wn(t,i=>{const s=i[Ss];return!ri(s)&&!ei(s)&&!Te(s,"exec")&&!xn(s)}),n=ve(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or \
|
|
253
|
-
an Object matching the {ICustomPattern} interface.",type:_t.INVALID_PATTERN,tokenTypes:[i]})),r=Cf(t,e);return{errors:n,valid:r}}const p2=/[^\\][$]/;function h2(t){class e extends lf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Wn(t,i=>{const s=i.PATTERN;try{const o=Nf(s),a=new e;return a.visit(o),a.found}catch{return p2.test(s.source)}});return ve(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
254
|
-
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
255
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_t.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function m2(t){const e=Wn(t,r=>r.PATTERN.test(""));return ve(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:_t.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const g2=/[^\\[][\^]|^\^/;function y2(t){class e extends lf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Wn(t,i=>{const s=i.PATTERN;
|
|
256
|
-
try{const o=Nf(s),a=new e;return a.visit(o),a.found}catch{return g2.test(s.source)}});return ve(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
257
|
-
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
258
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_t.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function v2(t){const e=Wn(t,r=>{const i=r[Ss];return i instanceof RegExp&&(i.multiline||i.global)});return ve(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:_t.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function w2(t){const e=[];let n=ve(t,s=>En(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!bn(e,a)&&a.
|
|
259
|
-
PATTERN!==Ln.NA&&(e.push(a),o.push(a)),o),[]));n=Iu(n);const r=Wn(n,s=>s.length>1);return ve(r,s=>{const o=ve(s,u=>u.name);return{message:`The same RegExp pattern ->${vr(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:_t.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function b2(t){const e=Wn(t,r=>{if(!Te(r,"GROUP"))return!1;const i=r.GROUP;return i!==Ln.SKIPPED&&i!==Ln.NA&&!xn(i)});return ve(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be\
|
|
260
|
-
Lexer.SKIPPED/Lexer.NA/A String",type:_t.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function E2(t,e){const n=Wn(t,i=>i.PUSH_MODE!==void 0&&!bn(e,i.PUSH_MODE));return ve(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:_t.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function $2(t){const e=[],n=En(t,(r,i,s)=>{const o=i.PATTERN;return o===Ln.NA||(xn(o)?r.push({str:o,idx:s,tokenType:i}):ri(o)&&R2(o)&&r.push({str:o.
|
|
261
|
-
source,idx:s,tokenType:i})),r},[]);return ke(t,(r,i)=>{ke(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&D2(s,r.PATTERN)){const u=`Token: ->${a.name}<- can never be matched.
|
|
262
|
-
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
263
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:_t.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function D2(t,e){if(ri(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ei(e))return e(t,0,[],{});if(Te(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function R2(t){return Bo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function QE(t){
|
|
264
|
-
const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function ZE(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function k2(t,e,n){const r=[];return Te(t,Fu)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Fu+`> property in its definition
|
|
265
|
-
`,type:_t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Te(t,Lf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Lf+`> property in its definition
|
|
266
|
-
`,type:_t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Te(t,Lf)&&Te(t,Fu)&&!Te(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Fu}: <${t.defaultMode}>which does not exist
|
|
267
|
-
`,type:_t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Te(t,Lf)&&ke(t.modes,(i,s)=>{ke(i,(o,a)=>{if(ii(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
|
|
268
|
-
`,type:_t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Te(o,"LONGER_ALT")){const u=Qe(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];ke(u,c=>{!ii(c)&&!bn(i,c)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${s}>
|
|
269
|
-
`,type:_t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function T2(t,e,n){const r=[];let i=!1;const s=Iu(sr(Ht(t.modes))),o=Af(s,u=>u[Ss]===Ln.NA),a=n$(n);return e&&ke(o,u=>{const c=t$(u,a);if(c!==!1){const f={message:_2(u,c),type:c.issue,tokenType:u};r.push(f)}else Te(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):Pg(a,u.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
270
|
-
This Lexer has been defined to track line and column information,
|
|
271
|
-
But none of the Token Types can be identified as matching a line terminator.
|
|
272
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
273
|
-
for details.`,type:_t.NO_LINE_BREAKS_FLAGS}),r}function C2(t){const e={},n=ir(t);return ke(n,r=>{const i=t[r];if(Qe(i))e[r]=[];else throw Error("non exhaustive match")}),e}function e$(t){const e=t.PATTERN;if(ri(e))return!1;if(ei(e))return!0;if(Te(e,"exec"))return!0;if(xn(e))return!1;throw Error("non exhaustive match")}function A2(t){return xn(t)&&t.length===1?t.charCodeAt(0):!1}const S2={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.
|
|
274
|
-
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 t$(t,e){if(Te(t,"LINE_BREAKS"))return!1;if(ri(t.PATTERN)){try{Pg(e,t.PATTERN)}catch(n){return{issue:_t.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(xn(t.PATTERN))return!1;if(e$(t))return{issue:_t.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function _2(t,e){if(e.issue===_t.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usag\
|
|
275
|
-
e in pattern.
|
|
276
|
-
The problem is in the <${t.name}> Token Type
|
|
277
|
-
Root cause: ${e.errMsg}.
|
|
278
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===_t.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
279
|
-
The problem is in the <${t.name}> Token Type
|
|
280
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function n$(t){return ve(t,n=>xn(n)?n.charCodeAt(0):n)}function xg(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Mu=256;let Ff=[];function Ui(t){return t<Mu?t:Ff[t]}function P2(){if(dt(Ff)){Ff=new Array(65536);for(let t=0;t<65536;t++)Ff[t]=t>255?255+~~(t/255):t}}function Bu(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===
|
|
281
|
-
!0}function Mf(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let r$=1;const i$={};function qu(t){const e=x2(t);N2(e),O2(e),I2(e),ke(e,n=>{n.isParent=n.categoryMatches.length>0})}function x2(t){let e=nn(t),n=t,r=!0;for(;r;){n=Iu(sr(ve(n,s=>s.CATEGORIES)));const i=Cf(n,e);e=e.concat(i),dt(i)?r=!1:n=i}return e}function N2(t){ke(t,e=>{o$(e)||(i$[r$]=e,e.tokenTypeIdx=r$++),a$(e)&&!Qe(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),a$(e)||(e.CATEGORIES=[]),L2(e)||(e.categoryMatches=[]),F2(e)||(e.categoryMatchesMap=
|
|
282
|
-
{})})}function I2(t){ke(t,e=>{e.categoryMatches=[],ke(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(i$[r].tokenTypeIdx)})})}function O2(t){ke(t,e=>{s$([],e)})}function s$(t,e){ke(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),ke(e.CATEGORIES,n=>{const r=t.concat(e);bn(r,n)||s$(r,n)})}function o$(t){return Te(t,"tokenTypeIdx")}function a$(t){return Te(t,"CATEGORIES")}function L2(t){return Te(t,"categoryMatches")}function F2(t){return Te(t,"categoryMatchesMap")}function M2(t){return Te(t,"t\
|
|
283
|
-
okenTypeIdx")}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 _t;(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.
|
|
284
|
-
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=
|
|
285
|
-
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"})(_t||(_t={}));const ju={deferDefinitionErrorsHandling:!1,
|
|
286
|
-
positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
287
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ng,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ju);class Ln{constructor(e,n=ju){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.
|
|
288
|
-
traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);const{time:a,value:u}=zE(s),c=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
289
|
-
a boolean 2nd argument is no longer supported`);this.config=Un({},ju,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===ju.lineTerminatorsPattern)this.config.lineTerminatorsPattern=S2;else if(this.config.lineTerminatorCharacters===
|
|
290
|
-
ju.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
291
|
-
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),Qe(e)?i={modes:{defaultMode:nn(e)},defaultMode:Fu}:(s=!1,i=nn(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",
|
|
292
|
-
()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(k2(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(T2(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},ke(i.modes,(a,u)=>{i.modes[u]=Af(a,c=>ii(c))});const o=ir(i.modes);if(ke(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),
|
|
293
|
-
this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(c2(a,o))}),dt(this.lexerDefinitionErrors)){qu(a);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=u2(a,{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]=
|
|
294
|
-
c.charCodeToPatternIdxToConfig,this.emptyGroups=Un({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!dt(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const u=ve(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
|
|
295
|
-
`);throw new Error(`Errors detected in definition of Lexer:
|
|
296
|
-
`+u)}ke(this.lexerDefinitionWarning,a=>{WE(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(JE?(this.chopInput=Rs,this.match=this.matchWithTest):(this.updateLastIndex=zt,this.match=this.matchWithExec),s&&(this.handleModes=zt),this.trackStartLines===!1&&(this.computeNewColumn=Rs),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=zt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.
|
|
297
|
-
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 Optim\
|
|
298
|
-
ization Warnings",()=>{const a=En(this.canModeBeOptimized,(u,c,l)=>(c===!1&&u.push(l),u),[]);if(n.ensureOptimizations&&!dt(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
|
|
299
|
-
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
300
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{i2()}),this.TRACE_INIT("toFastProperties",()=>{HE(this)})})}tokenize(e,n=this.defaultMode){if(!dt(this.lexerDefinitionErrors)){const i=ve(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
301
|
-
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
302
|
-
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,o,a,u,c,l,f,d,p,h,v,b,y;const E=e,R=E.length;let A=0,N=0;const K=this.hasCustom?0:Math.floor(e.length/10),J=new Array(K),se=[];let ie=this.trackStartLines?1:void 0,we=this.trackStartLines?1:void 0;const B=C2(this.emptyGroups),T=this.trackStartLines,D=this.config.lineTerminatorsPattern;let M=0,S=[],P=[];const O=[],Z=[];Object.freeze(Z);let H;function C(){return S}function ne(Se){const le=Ui(Se),$e=P[le];return $e===void 0?Z:$e}
|
|
303
|
-
const ye=Se=>{if(O.length===1&&Se.tokenType.PUSH_MODE===void 0){const le=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Se);se.push({offset:Se.startOffset,line:Se.startLine,column:Se.startColumn,length:Se.image.length,message:le})}else{O.pop();const le=Mo(O);S=this.patternIdxToConfig[le],P=this.charCodeToPatternIdxToConfig[le],M=S.length;const $e=this.canModeBeOptimized[le]&&this.config.safeMode===!1;P&&$e?H=ne:H=C}};function Pe(Se){O.push(Se),P=this.charCodeToPatternIdxToConfig[Se],
|
|
304
|
-
S=this.patternIdxToConfig[Se],M=S.length,M=S.length;const le=this.canModeBeOptimized[Se]&&this.config.safeMode===!1;P&&le?H=ne:H=C}Pe.call(this,n);let F;const V=this.config.recoveryEnabled;for(;A<R;){u=null;const Se=E.charCodeAt(A),le=H(Se),$e=le.length;for(r=0;r<$e;r++){F=le[r];const xe=F.pattern;c=null;const de=F.short;if(de!==!1?Se===de&&(u=xe):F.isCustom===!0?(y=xe.exec(E,A,J,B),y!==null?(u=y[0],y.payload!==void 0&&(c=y.payload)):u=null):(this.updateLastIndex(xe,A),u=this.match(xe,e,A)),u!==
|
|
305
|
-
null){if(a=F.longerAlt,a!==void 0){const I=a.length;for(s=0;s<I;s++){const G=S[a[s]],pe=G.pattern;if(l=null,G.isCustom===!0?(y=pe.exec(E,A,J,B),y!==null?(o=y[0],y.payload!==void 0&&(l=y.payload)):o=null):(this.updateLastIndex(pe,A),o=this.match(pe,e,A)),o&&o.length>u.length){u=o,c=l,F=G;break}}}break}}if(u!==null){if(f=u.length,d=F.group,d!==void 0&&(p=F.tokenTypeIdx,h=this.createTokenInstance(u,A,p,F.tokenType,ie,we,f),this.handlePayload(h,c),d===!1?N=this.addToken(J,N,h):B[d].push(h)),e=this.chopInput(
|
|
306
|
-
e,f),A=A+f,we=this.computeNewColumn(we,f),T===!0&&F.canLineTerminator===!0){let xe=0,de,I;D.lastIndex=0;do de=D.test(u),de===!0&&(I=D.lastIndex-1,xe++);while(de===!0);xe!==0&&(ie=ie+xe,we=f-I,this.updateTokenEndLineColumnLocation(h,d,I,xe,ie,we,f))}this.handleModes(F,ye,Pe,h)}else{const xe=A,de=ie,I=we;let G=V===!1;for(;G===!1&&A<R;)for(e=this.chopInput(e,1),A++,i=0;i<M;i++){const pe=S[i],U=pe.pattern,fe=pe.short;if(fe!==!1?E.charCodeAt(A)===fe&&(G=!0):pe.isCustom===!0?G=U.exec(E,A,J,B)!==null:(this.
|
|
307
|
-
updateLastIndex(U,A),G=U.exec(e)!==null),G===!0)break}if(v=A-xe,we=this.computeNewColumn(we,v),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(E,xe,v,de,I),se.push({offset:xe,line:de,column:I,length:v,message:b}),V===!1)break}}return this.hasCustom||(J.length=N),{tokens:J,groups:B,errors:se}}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=
|
|
308
|
-
n}updateTokenEndLineColumnLocation(e,n,r,i,s,o,a){let u,c;n!==void 0&&(u=r===a-1,c=u?-1:0,i===1&&u===!0||(e.endLine=s+c,e.endColumn=o-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,o){return{image:e,startOffset:n,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:n+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+
|
|
309
|
-
a-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}}Ln.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 \
|
|
310
|
-
to for example to completely ignore whitespace.",Ln.NA=/NOT_APPLICABLE/;function Go(t){return u$(t)?t.LABEL:t.name}function u$(t){return xn(t.LABEL)&&t.LABEL!==""}const B2="parent",c$="categories",l$="label",d$="group",f$="push_mode",p$="pop_mode",h$="longer_alt",m$="line_breaks",g$="start_chars_hint";function y$(t){return q2(t)}function q2(t){const e=t.pattern,n={};if(n.name=t.name,ii(e)||(n.PATTERN=e),Te(t,B2))throw`The parent property is no longer supported.
|
|
311
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Te(t,c$)&&(n.CATEGORIES=t[c$]),qu([n]),Te(t,l$)&&(n.LABEL=t[l$]),Te(t,d$)&&(n.GROUP=t[d$]),Te(t,p$)&&(n.POP_MODE=t[p$]),Te(t,f$)&&(n.PUSH_MODE=t[f$]),Te(t,h$)&&(n.LONGER_ALT=t[h$]),Te(t,m$)&&(n.LINE_BREAKS=t[m$]),Te(t,g$)&&(n.START_CHARS_HINT=t[g$]),n}const Wi=y$({name:"EOF",pattern:Ln.NA});qu([Wi]);function Ig(t,e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:o,
|
|
312
|
-
endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function v$(t,e){return Bu(t,e)}const Uo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${u$(t)?`--> ${Go(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}){
|
|
313
|
-
const s="Expecting: ",a=`
|
|
314
|
-
but found: '`+vr(e).image+"'";if(r)return s+r+a;{const u=En(t,(d,p)=>d.concat(p),[]),c=ve(u,d=>`[${ve(d,p=>Go(p)).join(", ")}]`),f=`one of these possible Token sequences:
|
|
315
|
-
${ve(c,(d,p)=>` ${p+1}. ${d}`).join(`
|
|
316
|
-
`)}`;return s+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
|
|
317
|
-
but found: '`+vr(e).image+"'";if(n)return i+n+o;{const u=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
318
|
-
<${ve(t,c=>`[${ve(c,l=>Go(l)).join(",")}]`).join(" ,")}>`;return i+u+o}}};Object.freeze(Uo);const j2={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
319
|
-
inside top level rule: ->`+t.name+"<-"}},_s={buildDuplicateFoundError(t,e){function n(l){return l instanceof bt?l.terminalType.name:l instanceof $n?l.nonTerminalName:""}const r=t.name,i=vr(e),s=i.idx,o=qr(i),a=n(i),u=s>0;let c=`->${o}${u?s:""}<- ${a?`with argument: ->${a}<-`:""}
|
|
320
|
-
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
321
|
-
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
322
|
-
`;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
|
|
323
|
-
`),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
324
|
-
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
325
|
-
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
326
|
-
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
327
|
-
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=ve(t.prefixPath,i=>Go(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
328
|
-
in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
329
|
-
<${e}> may appears as a prefix path in all these alternatives.
|
|
330
|
-
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
331
|
-
For Further details.`},buildAlternationAmbiguityError(t){const e=ve(t.prefixPath,i=>Go(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,
|
|
332
|
-
<${e}> may appears as a prefix path in all these alternatives.
|
|
333
|
-
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
334
|
-
For Further details.`,r},buildEmptyRepetitionError(t){let e=qr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
335
|
-
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.
|
|
336
|
-
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
337
|
-
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
338
|
-
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=ve(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
339
|
-
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
340
|
-
without consuming any Tokens. The grammar path that causes this is:
|
|
341
|
-
${r}
|
|
342
|
-
To fix this refactor your grammar to remove the left recursion.
|
|
343
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof qo?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function G2(t,e){const n=new U2(t,e);return n.resolveRefs(),n.errors}class U2 extends jo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){
|
|
344
|
-
ke(Ht(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:Dn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class W2 extends Pf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=
|
|
345
|
-
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=nn(this.path.ruleStack).reverse(),this.occurrenceStack=nn(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===
|
|
346
|
-
this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){dt(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class z2 extends W2{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=
|
|
347
|
-
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 Nn({definition:i});this.possibleTokTypes=Lu(s),this.found=!0}}}class Bf extends Pf{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}}
|
|
348
|
-
class H2 extends Bf{walkMany(e,n,r){if(e.idx===this.occurrence){const i=vr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof bt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class w$ extends Bf{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=vr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof bt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class V2 extends Bf{walkAtLeastOne(e,n,r){
|
|
349
|
-
if(e.idx===this.occurrence){const i=vr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof bt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class b$ extends Bf{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=vr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof bt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Og(t,e,n=[]){n=nn(n);let r=[],i=0;function s(a){
|
|
350
|
-
return a.concat(rn(t,i+1))}function o(a){const u=Og(s(a),e,n);return r.concat(u)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof Nn)return o(a.definition);if(a instanceof $n)return o(a.definition);if(a instanceof sn)r=o(a.definition);else if(a instanceof Hn){const u=a.definition.concat([new St({definition:a.definition})]);return o(u)}else if(a instanceof Vn){const u=[new Nn({definition:a.definition}),new St({definition:[new bt({terminalType:a.separator})].concat(a.definition)})];return o(
|
|
351
|
-
u)}else if(a instanceof In){const u=a.definition.concat([new St({definition:[new bt({terminalType:a.separator})].concat(a.definition)})]);r=o(u)}else if(a instanceof St){const u=a.definition.concat([new St({definition:a.definition})]);r=o(u)}else{if(a instanceof On)return ke(a.definition,u=>{dt(u.definition)===!1&&(r=o(u.definition))}),r;if(a instanceof bt)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:rn(t,i)}),r}function E$(t,e,n,r){const i="\
|
|
352
|
-
EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const u=e.length,c=u-r-1,l=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!dt(f);){const d=f.pop();if(d===o){a&&Mo(f).idx<=c&&f.pop();continue}const p=d.def,h=d.idx,v=d.ruleStack,b=d.occurrenceStack;if(dt(p))continue;const y=p[0];if(y===i){const E={idx:h,def:rn(p),ruleStack:Ou(v),occurrenceStack:Ou(b)};f.push(E)}else if(y instanceof bt)if(h<u-1){const E=h+1,R=e[E];if(n(R,y.terminalType)){const A={idx:E,def:rn(p),ruleStack:v,
|
|
353
|
-
occurrenceStack:b};f.push(A)}}else if(h===u-1)l.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:v,occurrenceStack:b}),a=!0;else throw Error("non exhaustive match");else if(y instanceof $n){const E=nn(v);E.push(y.nonTerminalName);const R=nn(b);R.push(y.idx);const A={idx:h,def:y.definition.concat(s,rn(p)),ruleStack:E,occurrenceStack:R};f.push(A)}else if(y instanceof sn){const E={idx:h,def:rn(p),ruleStack:v,occurrenceStack:b};f.push(E),f.push(o);const R={idx:h,def:y.definition.
|
|
354
|
-
concat(rn(p)),ruleStack:v,occurrenceStack:b};f.push(R)}else if(y instanceof Hn){const E=new St({definition:y.definition,idx:y.idx}),R=y.definition.concat([E],rn(p)),A={idx:h,def:R,ruleStack:v,occurrenceStack:b};f.push(A)}else if(y instanceof Vn){const E=new bt({terminalType:y.separator}),R=new St({definition:[E].concat(y.definition),idx:y.idx}),A=y.definition.concat([R],rn(p)),N={idx:h,def:A,ruleStack:v,occurrenceStack:b};f.push(N)}else if(y instanceof In){const E={idx:h,def:rn(p),ruleStack:v,occurrenceStack:b};
|
|
355
|
-
f.push(E),f.push(o);const R=new bt({terminalType:y.separator}),A=new St({definition:[R].concat(y.definition),idx:y.idx}),N=y.definition.concat([A],rn(p)),K={idx:h,def:N,ruleStack:v,occurrenceStack:b};f.push(K)}else if(y instanceof St){const E={idx:h,def:rn(p),ruleStack:v,occurrenceStack:b};f.push(E),f.push(o);const R=new St({definition:y.definition,idx:y.idx}),A=y.definition.concat([R],rn(p)),N={idx:h,def:A,ruleStack:v,occurrenceStack:b};f.push(N)}else if(y instanceof On)for(let E=y.definition.length-
|
|
356
|
-
1;E>=0;E--){const R=y.definition[E],A={idx:h,def:R.definition.concat(rn(p)),ruleStack:v,occurrenceStack:b};f.push(A),f.push(o)}else if(y instanceof Nn)f.push({idx:h,def:y.definition.concat(rn(p)),ruleStack:v,occurrenceStack:b});else if(y instanceof qo)f.push(K2(y,h,v,b));else throw Error("non exhaustive match")}return l}function K2(t,e,n,r){const i=nn(n);i.push(t.name);const s=nn(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var kt;(function(t){t[t.OPTION=0]="OPTION",
|
|
357
|
-
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"})(kt||(kt={}));function Lg(t){if(t instanceof sn||t==="Option")return kt.OPTION;if(t instanceof St||t==="Repetition")return kt.REPETITION;if(t instanceof Hn||t==="RepetitionMandatory")return kt.REPETITION_MANDATORY;if(t instanceof Vn||t==="Rep\
|
|
358
|
-
etitionMandatoryWithSeparator")return kt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof In||t==="RepetitionWithSeparator")return kt.REPETITION_WITH_SEPARATOR;if(t instanceof On||t==="Alternation")return kt.ALTERNATION;throw Error("non exhaustive match")}function $$(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Lg(r);return s===kt.ALTERNATION?qf(e,n,i):jf(e,n,s,i)}function X2(t,e,n,r,i,s){const o=qf(t,e,n),a=T$(o)?Mf:Bu;return s(o,r,a,i)}function Y2(t,e,n,r,i,s){const o=jf(t,e,
|
|
359
|
-
i,n),a=T$(o)?Mf:Bu;return s(o[0],a,r)}function J2(t,e,n,r){const i=t.length,s=yr(t,o=>yr(o,a=>a.length===1));if(e)return function(o){const a=ve(o,u=>u.GATE);for(let u=0;u<i;u++){const c=t[u],l=c.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<l;d++){const p=c[d],h=p.length;for(let v=0;v<h;v++){const b=this.LA(v+1);if(n(b,p[v])===!1)continue e}return u}}};if(s&&!r){const o=ve(t,u=>sr(u)),a=En(o,(u,c,l)=>(ke(c,f=>{Te(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=l),ke(f.categoryMatches,d=>{
|
|
360
|
-
Te(u,d)||(u[d]=l)})}),u),{});return function(){const u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const a=t[o],u=a.length;e:for(let c=0;c<u;c++){const l=a[c],f=l.length;for(let d=0;d<f;d++){const p=this.LA(d+1);if(n(p,l[d])===!1)continue e}return o}}}}function Q2(t,e,n){const r=yr(t,s=>s.length===1),i=t.length;if(r&&!n){const s=sr(t);if(s.length===1&&dt(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{
|
|
361
|
-
const o=En(s,(a,u,c)=>(a[u.tokenTypeIdx]=!0,ke(u.categoryMatches,l=>{a[l]=!0}),a),[]);return function(){const a=this.LA(1);return o[a.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const o=t[s],a=o.length;for(let u=0;u<a;u++){const c=this.LA(u+1);if(e(c,o[u])===!1)continue e}return!0}return!1}}class Z2 extends Pf{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){
|
|
362
|
-
return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,kt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,kt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,kt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,kt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(
|
|
363
|
-
e,kt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class D$ extends jo{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,kt.OPTION)}visitRepetition(e){this.checkIsTarget(e,kt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,kt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){
|
|
364
|
-
this.checkIsTarget(e,kt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,kt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,kt.ALTERNATION)}}function R$(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Fg(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 o=e[s];i.push(o+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){const u="_"+r.categoryMatches[a];i.push(
|
|
365
|
-
o+u)}}e=i}return e}function eB(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 o=e[s];if(i[o]===!0)return!1}}return!0}function k$(t,e){const n=ve(t,o=>Og([o],1)),r=R$(n.length),i=ve(n,o=>{const a={};return ke(o,u=>{const c=Fg(u.partialPath);ke(c,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=R$(a.length);for(let u=0;u<a.length;u++){const c=a[u];for(let l=0;l<c.length;l++){const f=c[l].partialPath,d=c[l].suffixDef,p=Fg(f);if(eB(i,
|
|
366
|
-
p,u)||dt(d)||f.length===e){const v=r[u];if(Mg(v,f)===!1){v.push(f);for(let b=0;b<p.length;b++){const y=p[b];i[u][y]=!0}}}else{const v=Og(d,o+1,f);s[u]=s[u].concat(v),ke(v,b=>{const y=Fg(b.partialPath);ke(y,E=>{i[u][E]=!0})})}}}}return r}function qf(t,e,n,r){const i=new D$(t,kt.ALTERNATION,r);return e.accept(i),k$(i.result,n)}function jf(t,e,n,r){const i=new D$(t,n);e.accept(i);const s=i.result,a=new Z2(e,t,n).startWalking(),u=new Nn({definition:s}),c=new Nn({definition:a});return k$([u,c],r)}function Mg(t,e){
|
|
367
|
-
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],o=r[i];if((s===o||o.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function tB(t,e){return t.length<e.length&&yr(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function T$(t){return yr(t,e=>yr(e,n=>yr(n,r=>dt(r.categoryMatches))))}function nB(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.
|
|
368
|
-
grammarName});return ve(e,n=>Object.assign({type:Dn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function rB(t,e,n,r){const i=zn(t,u=>iB(u,n)),s=gB(t,e,n),o=zn(t,u=>fB(u,n)),a=zn(t,u=>aB(u,t,r,n));return i.concat(s,o,a)}function iB(t,e){const n=new oB;t.accept(n);const r=n.allProductions,i=bM(r,sB),s=wr(i,a=>a.length>1);return ve(Ht(s),a=>{const u=vr(a),c=e.buildDuplicateFoundError(t,a),l=qr(u),f={message:c,type:Dn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:u.idx},d=C$(u);return d&&(f.parameter=
|
|
369
|
-
d),f})}function sB(t){return`${qr(t)}_#_${t.idx}_#_${C$(t)}`}function C$(t){return t instanceof bt?t.terminalType.name:t instanceof $n?t.nonTerminalName:""}class oB extends jo{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.
|
|
370
|
-
push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function aB(t,e,n,r){const i=[];if(En(e,(o,a)=>a.name===t.name?o+1:o,0)>1){const o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:Dn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function uB(t,e,n){const r=[];let i;return bn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}\
|
|
371
|
-
<-as it is not defined in any of the super grammars `,r.push({message:i,type:Dn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function A$(t,e,n,r=[]){const i=[],s=Gf(e.definition);if(dt(s))return[];{const o=t.name;bn(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:Dn.LEFT_RECURSION,ruleName:o});const u=Cf(s,r.concat([t])),c=zn(u,l=>{const f=nn(r);return f.push(l),A$(t,l,n,f)});return i.concat(c)}}function Gf(t){let e=[];if(dt(t))return e;const n=vr(t);if(n instanceof
|
|
372
|
-
$n)e.push(n.referencedRule);else if(n instanceof Nn||n instanceof sn||n instanceof Hn||n instanceof Vn||n instanceof In||n instanceof St)e=e.concat(Gf(n.definition));else if(n instanceof On)e=sr(ve(n.definition,s=>Gf(s.definition)));else if(!(n instanceof bt))throw Error("non exhaustive match");const r=_f(n),i=t.length>1;if(r&&i){const s=rn(t);return e.concat(Gf(s))}else return e}class Bg extends jo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(
|
|
373
|
-
e)}}function cB(t,e){const n=new Bg;t.accept(n);const r=n.alternations;return zn(r,s=>{const o=Ou(s.definition);return zn(o,(a,u)=>{const c=E$([a],[],Bu,1);return dt(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:u}),type:Dn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:u+1}]:[]})})}function lB(t,e,n){const r=new Bg;t.accept(r);let i=r.alternations;return i=Af(i,o=>o.ignoreAmbiguities===!0),zn(i,o=>{const a=o.idx,u=o.maxLookahead||e,c=qf(
|
|
374
|
-
a,t,u,o),l=hB(c,o,t,n),f=mB(c,o,t,n);return l.concat(f)})}class dB extends jo{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 fB(t,e){const n=new Bg;t.accept(n);const r=n.alternations;return zn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError(
|
|
375
|
-
{topLevelRule:t,alternation:s}),type:Dn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function pB(t,e,n){const r=[];return ke(t,i=>{const s=new dB;i.accept(s);const o=s.allProductions;ke(o,a=>{const u=Lg(a),c=a.maxLookahead||e,l=a.idx,d=jf(l,i,u,c)[0];if(dt(sr(d))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:Dn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function hB(t,e,n,r){const i=[],s=En(t,(a,u,c)=>(e.definition[c].ignoreAmbiguities===!0||
|
|
376
|
-
ke(u,l=>{const f=[c];ke(t,(d,p)=>{c!==p&&Mg(d,l)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Mg(i,l)&&(i.push(l),a.push({alts:f,path:l}))}),a),[]);return ve(s,a=>{const u=ve(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:Dn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function mB(t,e,n,r){const i=En(t,(o,a,u)=>{const c=ve(a,l=>({idx:u,path:l}));return o.concat(
|
|
377
|
-
c)},[]);return Iu(zn(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const u=o.idx,c=o.path,l=Wn(i,d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<u&&tB(d.path,c));return ve(l,d=>{const p=[d.idx+1,u+1],h=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:d.path}),type:Dn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:h,alternatives:p}})}))}function gB(t,e,n){const r=[],i=ve(e,s=>s.name);return ke(
|
|
378
|
-
t,s=>{const o=s.name;if(bn(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:Dn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function yB(t){const e=Tg(t,{errMsgProvider:j2}),n={};return ke(t.rules,r=>{n[r.name]=r}),G2(n,e.errMsgProvider)}function vB(t){return t=Tg(t,{errMsgProvider:_s}),rB(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const S$="MismatchedTokenException",_$="NoViableAltException",P$="EarlyExitException",x$="NotAllInputParsedException",N$=[S$,_$,P$,
|
|
379
|
-
x$];Object.freeze(N$);function Uf(t){return bn(N$,t.name)}class Wf 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 I$ extends Wf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=S$}}class wB extends Wf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=_$}}class bB extends Wf{constructor(e,n){super(e,n),this.name=x$}}class EB extends Wf{constructor(e,n,r){
|
|
380
|
-
super(e,n),this.previousToken=r,this.name=P$}}const qg={},O$="InRuleRecoveryException";class $B extends Error{constructor(e){super(e),this.name=O$}}class DB{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Te(e,"recoveryEnabled")?e.recoveryEnabled:si.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=RB)}getTokenToInsert(e){const n=Ig(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){
|
|
381
|
-
return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[];let u=!1;const c=this.LA(1);let l=this.LA(1);const f=()=>{const d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:d,ruleName:this.getCurrRuleFullName()}),h=new I$(p,c,this.LA(0));h.resyncedTokens=Ou(a),this.SAVE_ERROR(h)};for(;!u;)if(this.tokenMatcher(l,i)){f();return}else if(r.call(this)){f(),e.apply(this,n);return}else this.tokenMatcher(l,s)?
|
|
382
|
-
u=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,a));this.importLexerState(o)}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(
|
|
383
|
-
e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new $B("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||dt(n))return!1;const r=this.LA(1);return Bo(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){
|
|
384
|
-
const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return bn(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Bo(e,s=>v$(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.
|
|
385
|
-
shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return ve(e,(r,i)=>i===0?qg:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ve(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return sr(e)}getFollowSetFromFollowKey(e){if(e===qg)return[Wi];const n=e.ruleName+e.idxInCallingRule+KE+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){
|
|
386
|
-
return this.tokenMatcher(e,Wi)||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 Ou(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=nn(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return ve(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function RB(t,e,n,r,i,s,o){
|
|
387
|
-
const a=this.getKeyForAutomaticLookahead(r,i);let u=this.firstAfterRepMap[a];if(u===void 0){const d=this.getCurrRuleFullName(),p=this.getGAstProductions()[d];u=new s(p,i).startWalking(),this.firstAfterRepMap[a]=u}let c=u.token,l=u.occurrence;const f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&c===void 0&&(c=Wi,l=1),!(c===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,l,o)&&this.tryInRepetitionRecovery(t,e,n,c)}const kB=4,zi=8,L$=1<<zi,F$=2<<zi,jg=3<<zi,Gg=4<<zi,Ug=5<<zi,zf=6<<zi;
|
|
388
|
-
function Wg(t,e,n){return n|e|t}class zg{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:si.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(dt(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 zn(e,n=>A$(n,n,_s))}validateEmptyOrAlternatives(e){
|
|
389
|
-
return zn(e,n=>cB(n,_s))}validateAmbiguousAlternationAlternatives(e,n){return zn(e,r=>lB(r,n,_s))}validateSomeNonEmptyLookaheadPath(e,n){return pB(e,n,_s)}buildLookaheadForAlternation(e){return X2(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,J2)}buildLookaheadForOptional(e){return Y2(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Lg(e.prodType),Q2)}}class TB{initLooksAhead(e){this.dynamicTokensEnabled=Te(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:
|
|
390
|
-
si.dynamicTokensEnabled,this.maxLookahead=Te(e,"maxLookahead")?e.maxLookahead:si.maxLookahead,this.lookaheadStrategy=Te(e,"lookaheadStrategy")?e.lookaheadStrategy:new zg({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){ke(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=AB(n);ke(r,c=>{const l=c.idx===0?"":c.idx;this.TRACE_INIT(
|
|
391
|
-
`${qr(c)}${l}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:n,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Wg(this.fullRuleNameToShort[n.name],L$,c.idx);this.setLaFuncCache(d,f)})}),ke(i,c=>{this.computeLookaheadFunc(n,c.idx,jg,"Repetition",c.maxLookahead,qr(c))}),ke(s,c=>{this.computeLookaheadFunc(n,c.idx,F$,"Option",c.maxLookahead,qr(c))}),ke(o,c=>{this.computeLookaheadFunc(
|
|
392
|
-
n,c.idx,Gg,"RepetitionMandatory",c.maxLookahead,qr(c))}),ke(a,c=>{this.computeLookaheadFunc(n,c.idx,zf,"RepetitionMandatoryWithSeparator",c.maxLookahead,qr(c))}),ke(u,c=>{this.computeLookaheadFunc(n,c.idx,Ug,"RepetitionWithSeparator",c.maxLookahead,qr(c))})})})}computeLookaheadFunc(e,n,r,i,s,o){this.TRACE_INIT(`${o}${n===0?"":n}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,
|
|
393
|
-
prodType:i}),u=Wg(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(u,a)})}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 CB extends jo{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.
|
|
394
|
-
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){
|
|
395
|
-
this.dslMethods.alternation.push(e)}}const Hf=new CB;function AB(t){Hf.reset(),t.accept(Hf);const e=Hf.dslMethods;return Hf.reset(),e}function M$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function B$(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&&
|
|
396
|
-
(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function SB(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function _B(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const PB="name";function q$(t,e){Object.defineProperty(t,PB,{enumerable:!1,configurable:!0,writable:!1,value:e})}function xB(t,e){const n=ir(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],o=t[s],a=o.length;for(let u=0;u<a;u++){const c=o[u];c.tokenTypeIdx===void 0&&
|
|
397
|
-
this[c.name](c.children,e)}}}function NB(t,e){const n=function(){};q$(n,t+"BaseSemantics");const r={visit:function(i,s){if(Qe(i)&&(i=i[0]),!ii(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=OB(this,e);if(!dt(i)){const s=ve(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
398
|
-
${s.join(`
|
|
399
|
-
|
|
400
|
-
`).replace(/\n/g,`
|
|
401
|
-
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function IB(t,e,n){const r=function(){};q$(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return ke(e,s=>{i[s]=xB}),r.prototype=i,r.prototype.constructor=r,r}var Hg;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Hg||(Hg={}));function OB(t,e){return LB(t,e)}function LB(t,e){const n=Wn(e,i=>ei(t[i])===!1),r=ve(n,i=>({msg:`Missing visitor method: <${i}> o\
|
|
402
|
-
n ${t.constructor.name} CST Visitor.`,type:Hg.MISSING_METHOD,methodName:i}));return Iu(r)}class FB{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Te(e,"nodeLocationTracking")?e.nodeLocationTracking:si.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=zt,this.cstFinallyStateUpdate=zt,this.cstPostTerminal=zt,this.cstPostNonTerminal=zt,this.cstPostRule=zt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=
|
|
403
|
-
B$,this.setNodeLocationFromNode=B$,this.cstPostRule=zt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=M$,this.setNodeLocationFromNode=M$,this.cstPostRule=zt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):
|
|
404
|
-
(this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=zt,this.setNodeLocationFromNode=zt,this.cstPostRule=zt,this.setInitialNodeLocation=zt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,
|
|
405
|
-
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.
|
|
406
|
-
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.
|
|
407
|
-
length-1];SB(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];_B(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(ii(this.baseCstVisitorConstructor)){const e=NB(this.className,ir(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ii(this.baseCstVisitorWithDefaultsConstructor)){const e=IB(
|
|
408
|
-
this.className,ir(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 MB{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=
|
|
409
|
-
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)):Xf}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?Xf:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){
|
|
410
|
-
this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class BB{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(
|
|
411
|
-
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){
|
|
412
|
-
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(
|
|
413
|
-
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.
|
|
414
|
-
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(
|
|
415
|
-
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){
|
|
416
|
-
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(
|
|
417
|
-
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=Yf){if(bn(this.definedRulesNames,
|
|
418
|
-
e)){const o={message:_s.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Dn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=Yf){const i=uB(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.
|
|
419
|
-
saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Uf(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return KM(Ht(this.gastProductionsCache))}}class qB{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Mf,this.subruleIdx=0,this.definedRulesNames=[],this.
|
|
420
|
-
tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Te(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
421
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
422
|
-
For Further details.`);if(Qe(e)){if(dt(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
423
|
-
Note that the first argument for the parser constructor
|
|
424
|
-
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.
|
|
425
|
-
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
426
|
-
For Further details.`)}if(Qe(e))this.tokensMap=En(e,(s,o)=>(s[o.name]=o,s),{});else if(Te(e,"modes")&&yr(sr(Ht(e.modes)),M2)){const s=sr(Ht(e.modes)),o=Cg(s);this.tokensMap=En(o,(a,u)=>(a[u.name]=u,a),{})}else if(rr(e))this.tokensMap=nn(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=Wi;const r=Te(e,"modes")?sr(Ht(e.modes)):Ht(e),i=yr(r,s=>dt(s.categoryMatches));this.
|
|
427
|
-
tokenMatcher=i?Mf:Bu,qu(Ht(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'
|
|
428
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Te(r,"resyncEnabled")?r.resyncEnabled:Yf.resyncEnabled,s=Te(r,"recoveryValueFunc")?r.recoveryValueFunc:Yf.recoveryValueFunc,o=this.ruleShortNameIdx<<kB+zi;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...l){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l);const f=this.CST_STACK[this.CST_STACK.
|
|
429
|
-
length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l)}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(Uf(e)){const o=e;if(s){const a=this.
|
|
430
|
-
findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),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,o.partialCstResult=u}throw o}}else{if(i)return this.moveToTerminatedState(),r(e);throw o}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(F$,n);return this.optionInternalLogic(e,n,
|
|
431
|
-
r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const o=e.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Gg,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 o=n.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(
|
|
432
|
-
this)}}else s=n;if(i.call(this)===!0){let o=this.doSingleRepetition(s);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,kt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Gg,e,V2)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(zf,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(
|
|
433
|
-
this)===!0){i.call(this);const a=()=>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,a,i,b$],a,zf,e,b$)}else throw this.raiseEarlyExitException(e,kt.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!="f\
|
|
434
|
-
unction"){s=n.DEF;const a=n.GATE;if(a!==void 0){const u=i;i=()=>a.call(this)&&u.call(this)}}else s=n;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,jg,e,H2,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Ug,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 a=()=>this.tokenMatcher(this.
|
|
435
|
-
LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,w$],a,Ug,e,w$)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,zf,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(L$,n),
|
|
436
|
-
i=Qe(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,i);if(o!==void 0)return i[o].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 bB(n,e))}}subruleInternal(e,n,r){let i;try{
|
|
437
|
-
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 Uf(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):
|
|
438
|
-
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 I$(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.
|
|
439
|
-
isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===O$?r:s}}else throw r}saveRecogState(){const e=this.errors,n=nn(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.
|
|
440
|
-
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),Wi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class jB{initErrorHandler(e){this.
|
|
441
|
-
_errors=[],this.errorMessageProvider=Te(e,"errorMessageProvider")?e.errorMessageProvider:si.errorMessageProvider}SAVE_ERROR(e){if(Uf(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:nn(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return nn(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],
|
|
442
|
-
a=jf(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:a,actual:u,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new EB(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=qf(e,i,this.maxLookahead),o=[];for(let c=1;c<=this.maxLookahead;c++)o.push(this.LA(c));const a=this.LA(0),u=this.
|
|
443
|
-
errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new wB(u,this.LA(1),a))}}class GB{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(ii(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return E$([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=vr(e.ruleStack),i=this.getGAstProductions()[n];return new z2(
|
|
444
|
-
i,e).startWalking()}}const Vf={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Vf);const j$=!0,G$=Math.pow(2,zi)-1,U$=y$({name:"RECORDING_PHASE_TOKEN",pattern:Ln.NA});qu([U$]);const W$=Ig(U$,`This IToken indicates the Parser is in Recording Phase
|
|
445
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(W$);const UB={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
446
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class WB{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(
|
|
447
|
-
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.
|
|
448
|
-
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[`\
|
|
449
|
-
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 Xf}topLevelRuleRecord(e,n){try{const r=new qo({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),
|
|
450
|
-
n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
451
|
-
This error was thrown during the "grammar recording phase" For more info see:
|
|
452
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Gu.call(this,sn,e,n)}atLeastOneInternalRecord(e,n){Gu.call(this,Hn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Gu.call(this,Vn,n,e,j$)}manyInternalRecord(e,n){Gu.call(this,St,n,e)}manySepFirstInternalRecord(e,n){Gu.call(this,In,n,e,j$)}orInternalRecord(e,n){return zB.call(this,e,n)}subruleInternalRecord(e,n,r){if(Kf(n),!e||Te(e,"ruleName")===!1){const a=new Error(`<SUBRULE${z$(
|
|
453
|
-
n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
454
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Mo(this.recordingProdStack),s=e.ruleName,o=new $n({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?UB:Vf}consumeInternalRecord(e,n,r){if(Kf(n),!o$(e)){const o=new Error(`<CONSUME${z$(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
455
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Mo(this.recordingProdStack),s=new bt({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),W$}}function Gu(t,e,n,r=!1){Kf(n);const i=Mo(this.recordingProdStack),s=ei(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),Te(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.
|
|
456
|
-
pop(),Vf}function zB(t,e){Kf(e);const n=Mo(this.recordingProdStack),r=Qe(t)===!1,i=r===!1?t:t.DEF,s=new On({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});Te(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=GE(i,a=>ei(a.GATE));return s.hasPredicates=o,n.definition.push(s),ke(i,a=>{const u=new Nn({definition:[]});s.definition.push(u),Te(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Te(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.
|
|
457
|
-
push(u),a.ALT.call(this),this.recordingProdStack.pop()}),Vf}function z$(t){return t===0?"":`${t}`}function Kf(t){if(t<0||t>G$){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
458
|
-
Idx value must be a none negative value smaller than ${G$+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class HB{initPerformanceTracer(e){if(Te(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=si.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&&
|
|
459
|
-
console.log(`${r}--> <${e}>`);const{time:i,value:s}=zE(n),o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function VB(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 Xf=Ig(Wi,"",NaN,NaN,
|
|
460
|
-
NaN,NaN,NaN,NaN);Object.freeze(Xf);const si=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Uo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Yf=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Dn;(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",
|
|
461
|
-
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_LOOKAH\
|
|
462
|
-
EAD_VALIDATION"})(Dn||(Dn={}));function H$(t=void 0){return function(){return t}}class Fd{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",()=>{HE(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),ke(this.definedRulesNames,
|
|
463
|
-
i=>{const o=this[i].originalGrammarAction;let a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=yB({rules:Ht(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(dt(r)&&this.skipValidations===!1){const i=vB({rules:Ht(this.gastProductionsCache),tokenTypes:Ht(this.tokensMap),errMsgProvider:_s,
|
|
464
|
-
grammarName:n}),s=nB({lookaheadStrategy:this.lookaheadStrategy,rules:Ht(this.gastProductionsCache),tokenTypes:Ht(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),dt(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=t2(Ht(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:Ht(
|
|
465
|
-
this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ht(this.gastProductionsCache))})),!Fd.DEFER_DEFINITION_ERRORS_HANDLING&&!dt(this.definitionErrors))throw e=ve(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
466
|
-
${e.join(`
|
|
467
|
-
-------------------------------
|
|
468
|
-
`)}`)})}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),Te(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
469
|
-
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
470
|
-
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
471
|
-
For further details.`);this.skipValidations=Te(n,"skipValidations")?n.skipValidations:si.skipValidations}}Fd.DEFER_DEFINITION_ERRORS_HANDLING=!1,VB(Fd,[DB,TB,FB,MB,qB,BB,jB,GB,WB,HB]);class KB extends Fd{constructor(e,n=si){const r=nn(n);r.outputCst=!1,super(e,r)}}function Wo(t,e,n){return`${t.name}_${e}_${n}`}const Hi=1,XB=2,V$=4,K$=5,Uu=7,YB=8,JB=9,QB=10,ZB=11,X$=12;class Vg{constructor(e){this.target=e}isEpsilon(){return!1}}class Kg extends Vg{constructor(e,n){super(e),this.tokenType=n}}class Y$ extends Vg{constructor(e){
|
|
472
|
-
super(e)}isEpsilon(){return!0}}class Xg extends Vg{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function eq(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};tq(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Ps(e,i,i);s!==void 0&&fq(e,i,s)}return e}function tq(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Jt(t,i,void 0,{type:XB}),o=Jt(t,i,void 0,{type:Uu});s.stop=o,t.ruleToStartState.
|
|
473
|
-
set(i,s),t.ruleToStopState.set(i,o)}}function J$(t,e,n){return n instanceof bt?Yg(t,e,n.terminalType,n):n instanceof $n?dq(t,e,n):n instanceof On?oq(t,e,n):n instanceof sn?aq(t,e,n):n instanceof St?nq(t,e,n):n instanceof In?rq(t,e,n):n instanceof Hn?iq(t,e,n):n instanceof Vn?sq(t,e,n):Ps(t,e,n)}function nq(t,e,n){const r=Jt(t,e,n,{type:K$});Vi(t,r);const i=zo(t,e,r,n,Ps(t,e,n));return Z$(t,e,n,i)}function rq(t,e,n){const r=Jt(t,e,n,{type:K$});Vi(t,r);const i=zo(t,e,r,n,Ps(t,e,n)),s=Yg(t,e,n.separator,
|
|
474
|
-
n);return Z$(t,e,n,i,s)}function iq(t,e,n){const r=Jt(t,e,n,{type:V$});Vi(t,r);const i=zo(t,e,r,n,Ps(t,e,n));return Q$(t,e,n,i)}function sq(t,e,n){const r=Jt(t,e,n,{type:V$});Vi(t,r);const i=zo(t,e,r,n,Ps(t,e,n)),s=Yg(t,e,n.separator,n);return Q$(t,e,n,i,s)}function oq(t,e,n){const r=Jt(t,e,n,{type:Hi});Vi(t,r);const i=ve(n.definition,o=>J$(t,e,o));return zo(t,e,r,n,...i)}function aq(t,e,n){const r=Jt(t,e,n,{type:Hi});Vi(t,r);const i=zo(t,e,r,n,Ps(t,e,n));return uq(t,e,n,i)}function Ps(t,e,n){const r=Wn(
|
|
475
|
-
ve(n.definition,i=>J$(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:lq(t,r)}function Q$(t,e,n,r,i){const s=r.left,o=r.right,a=Jt(t,e,n,{type:ZB});Vi(t,a);const u=Jt(t,e,n,{type:X$});return s.loopback=a,u.loopback=a,t.decisionMap[Wo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,Bt(o,a),i===void 0?(Bt(a,s),Bt(a,u)):(Bt(a,u),Bt(a,i.left),Bt(i.right,s)),{left:s,right:u}}function Z$(t,e,n,r,i){const s=r.left,o=r.right,a=Jt(t,e,n,{type:QB});Vi(t,a);const u=Jt(
|
|
476
|
-
t,e,n,{type:X$}),c=Jt(t,e,n,{type:JB});return a.loopback=c,u.loopback=c,Bt(a,s),Bt(a,u),Bt(o,c),i!==void 0?(Bt(c,u),Bt(c,i.left),Bt(i.right,s)):Bt(c,a),t.decisionMap[Wo(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:u}}function uq(t,e,n,r){const i=r.left,s=r.right;return Bt(i,s),t.decisionMap[Wo(e,"Option",n.idx)]=i,r}function Vi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function zo(t,e,n,r,...i){const s=Jt(t,e,r,{type:YB,start:n});n.
|
|
477
|
-
end=s;for(const a of i)a!==void 0?(Bt(n,a.left),Bt(a.right,s)):Bt(n,s);const o={left:n,right:s};return t.decisionMap[Wo(e,cq(r),r.idx)]=n,o}function cq(t){if(t instanceof On)return"Alternation";if(t instanceof sn)return"Option";if(t instanceof St)return"Repetition";if(t instanceof In)return"RepetitionWithSeparator";if(t instanceof Hn)return"RepetitionMandatory";if(t instanceof Vn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function lq(t,e){const n=e.
|
|
478
|
-
length;for(let s=0;s<n-1;s++){const o=e[s];let a;o.left.transitions.length===1&&(a=o.left.transitions[0]);const u=a instanceof Xg,c=a,l=e[s+1].left;o.left.type===Hi&&o.right.type===Hi&&a!==void 0&&(u&&c.followState===o.right||a.target===o.right)?(u?c.followState=l:a.target=l,pq(t,o.right)):Bt(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Yg(t,e,n,r){const i=Jt(t,e,r,{type:Hi}),s=Jt(t,e,r,{type:Hi});return Jg(i,new Kg(s,n)),{left:i,right:s}}function dq(t,e,n){const r=n.
|
|
479
|
-
referencedRule,i=t.ruleToStartState.get(r),s=Jt(t,e,n,{type:Hi}),o=Jt(t,e,n,{type:Hi}),a=new Xg(i,r,o);return Jg(s,a),{left:s,right:o}}function fq(t,e,n){const r=t.ruleToStartState.get(e);Bt(r,n.left);const i=t.ruleToStopState.get(e);return Bt(n.right,i),{left:r,right:i}}function Bt(t,e){const n=new Y$(e);Jg(t,n)}function Jt(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(
|
|
480
|
-
i),i}function Jg(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function pq(t,e){t.states.splice(t.states.indexOf(e),1)}const Jf={};class Qg{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=eD(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ve(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.
|
|
481
|
-
map)e+=n+":";return e}}function eD(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function hq(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 tD{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.
|
|
482
|
-
predicates[r]===!0?"1":"0";return e}}const nD=new tD;class mq extends zg{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=eq(e.rules),this.dfas=gq(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,u=Wo(r,"Alternation",n),l=this.atn.decisionMap[u].decision,
|
|
483
|
-
f=ve($$({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),d=>ve(d,p=>p[0]));if(rD(f,!1)&&!s){const d=En(f,(p,h,v)=>(ke(h,b=>{b&&(p[b.tokenTypeIdx]=v,ke(b.categoryMatches,y=>{p[y]=v}))}),p),{});return i?function(p){var h;const v=this.LA(1),b=d[v.tokenTypeIdx];if(p!==void 0&&b!==void 0){const y=(h=p[b])===null||h===void 0?void 0:h.GATE;if(y!==void 0&&y.call(this)===!1)return}return b}:function(){const p=this.LA(1);return d[p.tokenTypeIdx]}}else return i?function(d){const p=new tD,h=d===
|
|
484
|
-
void 0?0:d.length;for(let b=0;b<h;b++){const y=d?.[b].GATE;p.set(b,y===void 0||y.call(this))}const v=Zg.call(this,o,l,p,a);return typeof v=="number"?v:void 0}:function(){const d=Zg.call(this,o,l,nD,a);return typeof d=="number"?d:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,u=Wo(r,i,n),l=this.atn.decisionMap[u].decision,f=ve($$({maxLookahead:1,occurrence:n,prodType:i,rule:r}),d=>ve(d,p=>p[0]));if(rD(f)&&f[0][0]&&
|
|
485
|
-
!s){const d=f[0],p=sr(d);if(p.length===1&&dt(p[0].categoryMatches)){const v=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const h=En(p,(v,b)=>(b!==void 0&&(v[b.tokenTypeIdx]=!0,ke(b.categoryMatches,y=>{v[y]=!0})),v),{});return function(){const v=this.LA(1);return h[v.tokenTypeIdx]===!0}}}return function(){const d=Zg.call(this,o,l,nD,a);return typeof d=="object"?!1:d===0}}}function rD(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===
|
|
486
|
-
void 0){if(e)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const a of o)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function gq(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=hq(t.decisionStates[r],r);return n}function Zg(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=Cq(i.atnStartState);s=oD(i,iD(a)),i.start=s}return yq.apply(this,[i,s,n,r])}function yq(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){
|
|
487
|
-
let u=Dq(i,a);if(u===void 0&&(u=vq.apply(this,[t,i,a,s,n,r])),u===Jf)return $q(o,i,a);if(u.isAcceptState===!0)return u.prediction;i=u,o.push(a),a=this.LA(s++)}}function vq(t,e,n,r,i,s){const o=Rq(e.configs,n,i);if(o.size===0)return sD(t,e,n,Jf),Jf;let a=iD(o);const u=Tq(o,i);if(u!==void 0)a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u;else if(Pq(o)){const c=OM(o.alts);a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c,wq.apply(this,[t,r,o.alts,s])}return a=sD(t,e,n,a),a}function wq(t,e,n,r){
|
|
488
|
-
const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,u=bq({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(u)}function bq(t){const e=ve(t.prefixPath,i=>Go(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Eq(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
489
|
-
<${e}> may appears as a prefix path in all these alternatives.
|
|
490
|
-
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
491
|
-
For Further details.`,r}function Eq(t){if(t instanceof $n)return"SUBRULE";if(t instanceof sn)return"OPTION";if(t instanceof On)return"OR";if(t instanceof Hn)return"AT_LEAST_ONE";if(t instanceof Vn)return"AT_LEAST_ONE_SEP";if(t instanceof In)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof bt)return"CONSUME";throw Error("non exhaustive match")}function $q(t,e,n){const r=zn(e.configs.elements,s=>s.state.transitions),i=zM(r.filter(s=>s instanceof Kg).map(s=>s.tokenType),s=>s.tokenTypeIdx);
|
|
492
|
-
return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function Dq(t,e){return t.edges[e.tokenTypeIdx]}function Rq(t,e,n){const r=new Qg,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===Uu){i.push(o);continue}const a=o.state.transitions.length;for(let u=0;u<a;u++){const c=o.state.transitions[u],l=kq(c,e);l!==void 0&&r.add({state:l,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Qg;for(const o of r.elements)Qf(o,s)}if(i.length>0&&
|
|
493
|
-
!Sq(s))for(const o of i)s.add(o);return s}function kq(t,e){if(t instanceof Kg&&v$(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 iD(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function sD(t,e,n,r){return r=oD(t,r),e.edges[n.tokenTypeIdx]=r,r}function oD(t,e){if(e===Jf)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=
|
|
494
|
-
e,e)}function Cq(t){const e=new Qg,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};Qf(s,e)}return e}function Qf(t,e){const n=t.state;if(n.type===Uu){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Qf(o,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],o=Aq(t,s);o!==void 0&&Qf(o,e)}}function Aq(t,e){if(e instanceof Y$)return{state:e.target,
|
|
495
|
-
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 Sq(t){for(const e of t.elements)if(e.state.type===Uu)return!0;return!1}function _q(t){for(const e of t.elements)if(e.state.type!==Uu)return!1;return!0}function Pq(t){if(_q(t))return!0;const e=xq(t.elements);return Nq(e)&&!Iq(e)}function xq(t){const e=new Map;for(const n of t){const r=eD(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Nq(t){
|
|
496
|
-
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 aD;(function(t){function e(n){return typeof n=="string"}t.is=e})(aD||(aD={}));var ey;(function(t){function e(n){return typeof n=="string"}t.is=e})(ey||(ey={}));var uD;(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})(uD||(uD=
|
|
497
|
-
{}));var Zf;(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})(Zf||(Zf={}));var st;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Zf.MAX_VALUE),i===Number.MAX_VALUE&&(i=Zf.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&j.uinteger(i.line)&&j.uinteger(i.character)}t.is=n})(st||(st={}));var Ye;(function(t){function e(r,i,s,o){if(j.uinteger(r)&&j.uinteger(i)&&j.uinteger(
|
|
498
|
-
s)&&j.uinteger(o))return{start:st.create(r,i),end:st.create(s,o)};if(st.is(r)&&st.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&st.is(i.start)&&st.is(i.end)}t.is=n})(Ye||(Ye={}));var ep;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&Ye.is(i.range)&&(j.string(i.uri)||j.undefined(i.uri))}t.is=n})(ep||(ep={}));
|
|
499
|
-
var cD;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&Ye.is(i.targetRange)&&j.string(i.targetUri)&&Ye.is(i.targetSelectionRange)&&(Ye.is(i.originSelectionRange)||j.undefined(i.originSelectionRange))}t.is=n})(cD||(cD={}));var ty;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.numberRange(
|
|
500
|
-
i.red,0,1)&&j.numberRange(i.green,0,1)&&j.numberRange(i.blue,0,1)&&j.numberRange(i.alpha,0,1)}t.is=n})(ty||(ty={}));var lD;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&Ye.is(i.range)&&ty.is(i.color)}t.is=n})(lD||(lD={}));var dD;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.string(i.label)&&(j.undefined(i.textEdit)||Fn.is(i))&&(j.undefined(
|
|
501
|
-
i.additionalTextEdits)||j.typedArray(i.additionalTextEdits,Fn.is))}t.is=n})(dD||(dD={}));var fD;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(fD||(fD={}));var pD;(function(t){function e(r,i,s,o,a,u){const c={startLine:r,endLine:i};return j.defined(s)&&(c.startCharacter=s),j.defined(o)&&(c.endCharacter=o),j.defined(a)&&(c.kind=a),j.defined(u)&&(c.collapsedText=u),c}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.uinteger(i.startLine)&&j.uinteger(i.startLine)&&
|
|
502
|
-
(j.undefined(i.startCharacter)||j.uinteger(i.startCharacter))&&(j.undefined(i.endCharacter)||j.uinteger(i.endCharacter))&&(j.undefined(i.kind)||j.string(i.kind))}t.is=n})(pD||(pD={}));var ny;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&ep.is(i.location)&&j.string(i.message)}t.is=n})(ny||(ny={}));var xs;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(xs||(xs={}));var hD;(function(t){t.Unnecessary=1,t.Deprecated=2})(hD||
|
|
503
|
-
(hD={}));var mD;(function(t){function e(n){const r=n;return j.objectLiteral(r)&&j.string(r.href)}t.is=e})(mD||(mD={}));var tp;(function(t){function e(r,i,s,o,a,u){let c={range:r,message:i};return j.defined(s)&&(c.severity=s),j.defined(o)&&(c.code=o),j.defined(a)&&(c.source=a),j.defined(u)&&(c.relatedInformation=u),c}t.create=e;function n(r){var i;let s=r;return j.defined(s)&&Ye.is(s.range)&&j.string(s.message)&&(j.number(s.severity)||j.undefined(s.severity))&&(j.integer(s.code)||j.string(s.code)||
|
|
504
|
-
j.undefined(s.code))&&(j.undefined(s.codeDescription)||j.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(j.string(s.source)||j.undefined(s.source))&&(j.undefined(s.relatedInformation)||j.typedArray(s.relatedInformation,ny.is))}t.is=n})(tp||(tp={}));var Ho;(function(t){function e(r,i,...s){let o={title:r,command:i};return j.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.title)&&j.string(i.command)}t.is=n})(Ho||(Ho={}));
|
|
505
|
-
var Fn;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const o=s;return j.objectLiteral(o)&&j.string(o.newText)&&Ye.is(o.range)}t.is=i})(Fn||(Fn={}));var ry;(function(t){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.string(
|
|
506
|
-
i.label)&&(j.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(j.string(i.description)||i.description===void 0)}t.is=n})(ry||(ry={}));var Vo;(function(t){function e(n){const r=n;return j.string(r)}t.is=e})(Vo||(Vo={}));var gD;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){const o=s;return Fn.
|
|
507
|
-
is(o)&&(ry.is(o.annotationId)||Vo.is(o.annotationId))}t.is=i})(gD||(gD={}));var iy;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&cy.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(iy||(iy={}));var sy;(function(t){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind===
|
|
508
|
-
"create"&&j.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||j.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||j.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(sy||(sy={}));var oy;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let i=r;return i&&i.
|
|
509
|
-
kind==="rename"&&j.string(i.oldUri)&&j.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||j.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||j.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(oy||(oy={}));var ay;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;
|
|
510
|
-
return i&&i.kind==="delete"&&j.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||j.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||j.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(ay||(ay={}));var uy;(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=>j.string(i.kind)?sy.is(i)||oy.is(i)||ay.is(i):iy.is(i)))}t.
|
|
511
|
-
is=e})(uy||(uy={}));var yD;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)}t.is=n})(yD||(yD={}));var vD;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)&&j.integer(i.version)}t.is=n})(vD||(vD={}));var cy;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)&&(i.version===null||j.integer(i.version))}
|
|
512
|
-
t.is=n})(cy||(cy={}));var wD;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)&&j.string(i.languageId)&&j.integer(i.version)&&j.string(i.text)}t.is=n})(wD||(wD={}));var ly;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(ly||(ly={}));var Wu;(function(t){function e(n){const r=n;return j.objectLiteral(n)&&ly.is(r.kind)&&j.
|
|
513
|
-
string(r.value)}t.is=e})(Wu||(Wu={}));var Pt;(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})(Pt||(Pt={}));var Mn;(function(t){t.PlainText=1,t.Snippet=2})(Mn||(Mn={}));var bD;(function(t){t.Deprecated=1})(bD||(bD={}));var ED;
|
|
514
|
-
(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&&j.string(i.newText)&&Ye.is(i.insert)&&Ye.is(i.replace)}t.is=n})(ED||(ED={}));var $D;(function(t){t.asIs=1,t.adjustIndentation=2})($D||($D={}));var DD;(function(t){function e(n){const r=n;return r&&(j.string(r.detail)||r.detail===void 0)&&(j.string(r.description)||r.description===void 0)}t.is=e})(DD||(DD={}));var RD;(function(t){function e(n){return{label:n}}t.create=e})(RD||(RD={}));var kD;
|
|
515
|
-
(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(kD||(kD={}));var np;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return j.string(i)||j.objectLiteral(i)&&j.string(i.language)&&j.string(i.value)}t.is=n})(np||(np={}));var TD;(function(t){function e(n){let r=n;return!!r&&j.objectLiteral(r)&&(Wu.is(r.contents)||np.is(r.contents)||j.typedArray(r.contents,np.is))&&(n.range===void 0||Ye.is(n.range))}t.
|
|
516
|
-
is=e})(TD||(TD={}));var CD;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(CD||(CD={}));var AD;(function(t){function e(n,r,...i){let s={label:n};return j.defined(r)&&(s.documentation=r),j.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(AD||(AD={}));var SD;(function(t){t.Text=1,t.Read=2,t.Write=3})(SD||(SD={}));var _D;(function(t){function e(n,r){let i={range:n};return j.number(r)&&(i.kind=r),i}t.create=e})(_D||(_D={}));var br;(function(t){t.File=1,
|
|
517
|
-
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})(br||(br={}));var PD;(function(t){t.Deprecated=1})(PD||(PD={}));var xD;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}
|
|
518
|
-
t.create=e})(xD||(xD={}));var ND;(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})(ND||(ND={}));var ID;(function(t){function e(r,i,s,o,a,u){let c={name:r,detail:i,kind:s,range:o,selectionRange:a};return u!==void 0&&(c.children=u),c}t.create=e;function n(r){let i=r;return i&&j.string(i.name)&&j.number(i.kind)&&Ye.is(i.range)&&Ye.is(i.selectionRange)&&(i.detail===void 0||j.string(i.detail))&&(i.deprecated===void 0||
|
|
519
|
-
j.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(ID||(ID={}));var OD;(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"})(OD||(OD={}));var rp;(function(t){t.Invoked=1,t.Automatic=2})(rp||(rp={}));var LD;
|
|
520
|
-
(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return j.defined(i)&&j.typedArray(i.diagnostics,tp.is)&&(i.only===void 0||j.typedArray(i.only,j.string))&&(i.triggerKind===void 0||i.triggerKind===rp.Invoked||i.triggerKind===rp.Automatic)}t.is=n})(LD||(LD={}));var FD;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Ho.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.
|
|
521
|
-
kind=s),o}t.create=e;function n(r){let i=r;return i&&j.string(i.title)&&(i.diagnostics===void 0||j.typedArray(i.diagnostics,tp.is))&&(i.kind===void 0||j.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ho.is(i.command))&&(i.isPreferred===void 0||j.boolean(i.isPreferred))&&(i.edit===void 0||uy.is(i.edit))}t.is=n})(FD||(FD={}));var MD;(function(t){function e(r,i){let s={range:r};return j.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return j.defined(i)&&Ye.is(
|
|
522
|
-
i.range)&&(j.undefined(i.command)||Ho.is(i.command))}t.is=n})(MD||(MD={}));var BD;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.uinteger(i.tabSize)&&j.boolean(i.insertSpaces)}t.is=n})(BD||(BD={}));var qD;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return j.defined(i)&&Ye.is(i.range)&&(j.undefined(i.target)||j.string(i.target))}t.is=n})(qD||(qD={}));var jD;(function(t){function e(r,i){
|
|
523
|
-
return{range:r,parent:i}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&Ye.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(jD||(jD={}));var Ne;(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="ke\
|
|
524
|
-
yword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Ne||(Ne={}));var ze;(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"})(ze||(ze={}));var GD;(function(t){function e(n){const r=n;return j.
|
|
525
|
-
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})(GD||(GD={}));var UD;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ye.is(i.range)&&j.string(i.text)}t.is=n})(UD||(UD={}));var WD;(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&&Ye.is(i.range)&&j.boolean(i.caseSensitiveLookup)&&
|
|
526
|
-
(j.string(i.variableName)||i.variableName===void 0)}t.is=n})(WD||(WD={}));var zD;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ye.is(i.range)&&(j.string(i.expression)||i.expression===void 0)}t.is=n})(zD||(zD={}));var HD;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return j.defined(i)&&Ye.is(r.stoppedLocation)}t.is=n})(HD||(HD={}));var dy;(function(t){t.Type=1,t.Parameter=2;function e(n){
|
|
527
|
-
return n===1||n===2}t.is=e})(dy||(dy={}));var fy;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&(i.tooltip===void 0||j.string(i.tooltip)||Wu.is(i.tooltip))&&(i.location===void 0||ep.is(i.location))&&(i.command===void 0||Ho.is(i.command))}t.is=n})(fy||(fy={}));var VD;(function(t){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&st.is(i.position)&&(j.
|
|
528
|
-
string(i.label)||j.typedArray(i.label,fy.is))&&(i.kind===void 0||dy.is(i.kind))&&i.textEdits===void 0||j.typedArray(i.textEdits,Fn.is)&&(i.tooltip===void 0||j.string(i.tooltip)||Wu.is(i.tooltip))&&(i.paddingLeft===void 0||j.boolean(i.paddingLeft))&&(i.paddingRight===void 0||j.boolean(i.paddingRight))}t.is=n})(VD||(VD={}));var KD;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(KD||(KD={}));var XD;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,
|
|
529
|
-
command:s}}t.create=e})(XD||(XD={}));var YD;(function(t){function e(n){return{items:n}}t.create=e})(YD||(YD={}));var JD;(function(t){t.Invoked=0,t.Automatic=1})(JD||(JD={}));var QD;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(QD||(QD={}));var ZD;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(ZD||(ZD={}));var eR;(function(t){function e(n){const r=n;return j.objectLiteral(r)&&ey.is(r.uri)&&j.string(r.name)}t.is=e})(eR||(eR={}));var tR;(function(t){
|
|
530
|
-
function e(s,o,a,u){return new Oq(s,o,a,u)}t.create=e;function n(s){let o=s;return!!(j.defined(o)&&j.string(o.uri)&&(j.undefined(o.languageId)||j.string(o.languageId))&&j.uinteger(o.lineCount)&&j.func(o.getText)&&j.func(o.positionAt)&&j.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),u=i(o,(l,f)=>{let d=l.range.start.line-f.range.start.line;return d===0?l.range.start.character-f.range.start.character:d}),c=a.length;for(let l=u.length-1;l>=0;l--){let f=u[l],d=s.offsetAt(f.range.start),
|
|
531
|
-
p=s.offsetAt(f.range.end);if(p<=c)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");c=d}return a}t.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,u=s.slice(0,a),c=s.slice(a);i(u,o),i(c,o);let l=0,f=0,d=0;for(;l<u.length&&f<c.length;)o(u[l],c[f])<=0?s[d++]=u[l++]:s[d++]=c[f++];for(;l<u.length;)s[d++]=u[l++];for(;f<c.length;)s[d++]=c[f++];return s}})(tR||(tR={}));let Oq=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,
|
|
532
|
-
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(
|
|
533
|
-
i);r=s==="\r"||s===`
|
|
534
|
-
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
535
|
-
`&&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 st.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return st.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.
|
|
536
|
-
max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var j;(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 o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,h,v){return e.call(p)==="[object Number]"&&h<=p&&p<=v}t.numberRange=a;function u(p){
|
|
537
|
-
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 f(p){return p!==null&&typeof p=="object"}t.objectLiteral=f;function d(p,h){return Array.isArray(p)&&p.every(h)}t.typedArray=d})(j||(j={}));class Lq{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?
|
|
538
|
-
e:this.rootNode}buildRootNode(e){return this.rootNode=new rR(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new hy;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new py(e.startOffset,e.image.length,Am(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(
|
|
539
|
-
e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const o=new py(s.startOffset,s.image.length,Am(s),s.tokenType,!0);o.root=this.rootNode,n.push(o)}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=
|
|
540
|
-
e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class nR{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(){
|
|
541
|
-
return this.root.fullText.substring(this.offset,this.end)}}class py extends nR{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 hy extends nR{constructor(){super(...arguments),this.content=new Zw(this)}get children(){return this.
|
|
542
|
-
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.
|
|
543
|
-
_rangeCache}else return{start:st.create(0,0),end:st.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 Zw extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Zw.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.
|
|
544
|
-
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 rR extends hy{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const my=Symbol("Datatype");function gy(t){return t.$type===my}const iR="\u200B",sR=t=>t.endsWith(iR)?t:t+iR;class oR{constructor(e){this._unorderedGroups=new Map,this.allRules=
|
|
545
|
-
new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new jq(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.
|
|
546
|
-
IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Fq extends oR{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Lq,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(sR(
|
|
547
|
-
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(pf(e))return my;{const n=Ds(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,
|
|
548
|
-
{});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 o={$type:e};this.stack.push(o),e===my&&(o.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;
|
|
549
|
-
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 o=this.nodeBuilder.buildLeafNode(i,r),{assignment:a,isCrossRef:u}=this.getAssignment(r),c=this.current;if(a){const l=Ir(r)?i.image:this.converter.convert(i.image,o);this.assign(a.operator,a.feature,l,o,u)}else if(gy(c)){let l=i.
|
|
550
|
-
image;Ir(r)||(l=this.converter.convert(l,o).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 o;!this.isRecording()&&!r&&(o=this.nodeBuilder.buildCompositeNode(i));const a=this.wrapper.wrapSubrule(e,n,s);!this.isRecording()&&o&&o.length>0&&this.performSubruleAssignment(a,i,o)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.
|
|
551
|
-
operator,i.feature,e,r,s);else if(!i){const o=this.current;if(gy(o))o.value+=e.toString();else if(typeof e=="object"&&e){const u=this.assignWithoutOverride(e,o);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=
|
|
552
|
-
e}}construct(){if(this.isRecording())return;const e=this.current;return qm(e),this.nodeBuilder.construct(e),this.stack.pop(),gy(e)?this.converter.convert(e.value,e.$cstNode):(Gm(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=wn(e,Nr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?su(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const o=this.current;let a;switch(s&&typeof r=="string"?a=this.linker.buildReference(o,n,i,r):a=r,e){case"=":{
|
|
553
|
-
o[n]=a;break}case"?=":{o[n]=!0;break}case"+=":Array.isArray(o[n])||(o[n]=[]),o[n].push(a)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const o=e[i];o===void 0?e[i]=s:Array.isArray(o)&&Array.isArray(s)&&(s.push(...o),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 Mq{buildMismatchTokenMessage(e){return Uo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Uo.buildNotAllInputParsedMessage(
|
|
554
|
-
e)}buildNoViableAltMessage(e){return Uo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Uo.buildEarlyExitMessage(e)}}class aR extends Mq{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 Bq extends oR{constructor(){
|
|
555
|
-
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(sR(e.name),this.startImplementation(
|
|
556
|
-
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){
|
|
557
|
-
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 qq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new aR};
|
|
558
|
-
class jq extends KB{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},qq),{lookaheadStrategy:r?new zg({maxLookahead:n.maxLookahead}):new mq({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){
|
|
559
|
-
this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function uR(t,e,n){return Gq({parser:e,tokens:n,ruleNames:new Map},t),e}function Gq(t,e){const n=Vm(e,!1),r=We(e.rules).filter(ln).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,Ns(s,i.definition))}}function Ns(t,e,n=!1){let r;if(Ir(e))r=Xq(t,e);else if($s(e))r=Uq(t,e);else if(Nr(e))r=Ns(t,e.terminal);else if(su(e))
|
|
560
|
-
r=cR(t,e);else if(Jr(e))r=Wq(t,e);else if(Mm(e))r=Hq(t,e);else if(Bm(e))r=Vq(t,e);else if(Bi(e))r=Kq(t,e);else if(F1(e)){const i=t.consume++;r=()=>t.parser.consume(i,Wi,e)}else throw new pb(e.$cstNode,`Unexpected element type: ${e.$type}`);return lR(t,n?void 0:ip(e),r,e.cardinality)}function Uq(t,e){const n=$u(e);return()=>t.parser.action(n,e)}function Wq(t,e){const n=e.rule.ref;if(ln(n)){const r=t.subrule++,i=n.fragment,s=e.arguments.length>0?zq(n,e.arguments):()=>({});return o=>t.parser.subrule(
|
|
561
|
-
r,dR(t,n),i,e,s(o))}else if(Yr(n)){const r=t.consume++,i=yy(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Ba();else throw new pb(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function zq(t,e){const n=e.map(r=>oi(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const o=t.parameters[s],a=n[s];i[o.name]=a(r)}return i}}function oi(t){if(_1(t)){const e=oi(t.left),n=oi(t.right);return r=>e(r)||n(r)}else if(S1(t)){const e=oi(t.left),n=oi(t.right);return r=>e(r)&&n(r)}else if(P1(t)){
|
|
562
|
-
const e=oi(t.value);return n=>!e(n)}else if(x1(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(A1(t)){const e=!!t.true;return()=>e}Ba()}function Hq(t,e){if(e.elements.length===1)return Ns(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Ns(t,i,!0)},o=ip(i);o&&(s.GATE=oi(o)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const o={ALT:()=>s.ALT(i)},a=s.GATE;return a&&(o.GATE=()=>a(i)),o}))}}function Vq(t,e){if(e.elements.length===1)
|
|
563
|
-
return Ns(t,e.elements[0]);const n=[];for(const a of e.elements){const u={ALT:Ns(t,a,!0)},c=ip(a);c&&(u.GATE=oi(c)),n.push(u)}const r=t.or++,i=(a,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${a}_${c}`},s=a=>t.parser.alternatives(r,n.map((u,c)=>{const l={ALT:()=>!0},f=t.parser;l.ALT=()=>{if(u.ALT(a),!f.isRecording()){const p=i(r,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);const h=f.unorderedGroups.get(p);typeof h?.[c]>"u"&&(h[c]=!0)}};const d=u.GATE;return d?l.GATE=()=>d(a):
|
|
564
|
-
l.GATE=()=>{const p=f.unorderedGroups.get(i(r,f));return!p?.[c]},l})),o=lR(t,ip(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function Kq(t,e){const n=e.elements.map(r=>Ns(t,r));return r=>n.forEach(i=>i(r))}function ip(t){if(Bi(t))return t.guardCondition}function cR(t,e,n=e.terminal){if(n)if(Jr(n)&&ln(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;return s=>t.parser.subrule(i,dR(t,r),!1,e,s)}else if(Jr(n)&&Yr(n.rule.ref)){const r=t.consume++,i=yy(
|
|
565
|
-
t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Ir(n)){const r=t.consume++,i=yy(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=Qm(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+$u(e.type.ref));return cR(t,e,i)}}function Xq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error(
|
|
566
|
-
"Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function lR(t,e,n,r){const i=e&&oi(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:H$(),GATE:()=>!i(o)}])}else return n;if(r==="*"){const s=t.many++;return o=>t.parser.many(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else if(r==="+"){const s=t.many++;if(i){const o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:H$(),
|
|
567
|
-
GATE:()=>!i(a)}])}else return o=>t.parser.atLeastOne(s,{DEF:()=>n(o)})}else if(r==="?"){const s=t.optional++;return o=>t.parser.optional(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else Ba()}function dR(t,e){const n=Yq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Yq(t,e){if(ln(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!ln(r);)(Bi(r)||Mm(r)||Bm(r))&&(i=r.elements.indexOf(n).toString()+":"+i),
|
|
568
|
-
n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function yy(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Jq(t){const e=t.Grammar,n=t.parser.Lexer,r=new Bq(t);return uR(e,r,n.definition),r.finalize(),r}function Qq(t){const e=Zq(t);return e.finalize(),e}function Zq(t){const e=t.Grammar,n=t.parser.Lexer,r=new Fq(t);return uR(e,r,n.definition)}class ej{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=We(Vm(e,!1)),i=this.buildTerminalTokens(
|
|
569
|
-
r),s=this.buildKeywordTokens(r,i,n);return i.forEach(o=>{const a=o.PATTERN;typeof a=="object"&&a&&"test"in a&&Hm(a)?s.unshift(o):s.push(o)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Yr).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Du(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.
|
|
570
|
-
name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Hm(n)?Ln.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(ln).flatMap(i=>Or(i).filter(Ir)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.
|
|
571
|
-
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(Q1(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&Z1("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class tj{convert(e,n){let r=n.grammarSource;if(su(r)&&(r=Km(r)),Jr(r)){const i=r.rule.
|
|
572
|
-
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 ai.convertInt(n);case"STRING":return ai.convertString(n);case"ID":return ai.convertID(n)}switch((i=Ib(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return ai.convertNumber(n);case"boolean":return ai.convertBoolean(n);case"bigint":return ai.convertBigint(n);case"date":return ai.convertDate(n);default:return n}}}
|
|
573
|
-
var ai;(function(t){function e(c){let l="";for(let f=1;f<c.length-1;f++){const d=c.charAt(f);if(d==="\\"){const p=c.charAt(++f);l+=n(p)}else l+=d}return l}t.convertString=e;function n(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
574
|
-
`;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 o(c){return new Date(c)}t.convertDate=o;function a(c){return Number(c)}t.convertNumber=a;function u(c){return c.toLowerCase()==="true"}t.convertBoolean=u})(ai||(ai={}));var Is={},sp={},fR;function Os(){if(fR)return sp;fR=1,Object.
|
|
575
|
-
defineProperty(sp,"__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||(e={})),sp.default=e,sp}var on={},pR;function zu(){if(pR)return on;pR=1,Object.defineProperty(on,"__esModule",{value:!0}),on.stringArray=on.array=on.func=on.error=on.number=on.string=on.boolean=void 0;function t(a){return a===!0||a===
|
|
576
|
-
!1}on.boolean=t;function e(a){return typeof a=="string"||a instanceof String}on.string=e;function n(a){return typeof a=="number"||a instanceof Number}on.number=n;function r(a){return a instanceof Error}on.error=r;function i(a){return typeof a=="function"}on.func=i;function s(a){return Array.isArray(a)}on.array=s;function o(a){return s(a)&&a.every(u=>e(u))}return on.stringArray=o,on}var Ls={},hR;function Ko(){if(hR)return Ls;hR=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.Emitter=Ls.Event=
|
|
577
|
-
void 0;const t=Os();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Ls.Event=e={}));class n{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let u=0,c=this._callbacks.length;u<c;u++)if(this._callbacks[u]===s)if(this._contexts[u]===o){this._callbacks.splice(u,1),this._contexts.splice(u,1);
|
|
578
|
-
return}else a=!0;if(a)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 o=[],a=this._callbacks.slice(0),u=this._contexts.slice(0);for(let c=0,l=a.length;c<l;c++)try{o.push(a[c].apply(u[c],s))}catch(f){(0,t.default)().console.error(f)}return o}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(){
|
|
579
|
-
return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),u.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(u),u}),this._event}fire(s){this._callbacks&&
|
|
580
|
-
this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Ls.Emitter=r,r._noop=function(){},Ls}var mR;function op(){if(mR)return Is;mR=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.CancellationTokenSource=Is.CancellationToken=void 0;const t=Os(),e=zu(),n=Ko();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,
|
|
581
|
-
onCancellationRequested:n.Event.None});function u(c){const l=c;return l&&(l===a.None||l===a.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}a.is=u})(r||(Is.CancellationToken=r={}));const i=Object.freeze(function(a,u){const c=(0,t.default)().timer.setTimeout(a.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(){
|
|
582
|
-
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 o{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 Is.CancellationTokenSource=o,Is}var ft=op();
|
|
583
|
-
function nj(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let ap=0,rj=10;function ij(){return ap=performance.now(),new ft.CancellationTokenSource}const up=Symbol("OperationCancelled");function cp(t){return t===up}async function qt(t){if(t===ft.CancellationToken.None)return;const e=performance.now();if(e-ap>=rj&&(ap=e,await nj(),ap=performance.now()),t.isCancellationRequested)throw up}class vy{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),
|
|
584
|
-
this),this.reject=r=>(n(r),this)})}}class Md{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(const r of e)if(Md.isIncremental(r)){const i=vR(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.
|
|
585
|
-
end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let c=this._lineOffsets;const l=gR(r.text,!1,s);if(u-a===l.length)for(let d=0,p=l.length;d<p;d++)c[d+a+1]=l[d];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));const f=r.text.length-(o-s);if(f!==0)for(let d=a+1+l.length,p=c.length;d<p;d++)c[d]=c[d]+f}else if(Md.isFull(r))this._content=r.text,
|
|
586
|
-
this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gR(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const n=this.getLineOffsets();let r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){const o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.
|
|
587
|
-
getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&yR(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||
|
|
588
|
-
typeof n.rangeLength=="number")}static isFull(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var lp;(function(t){function e(i,s,o,a){return new Md(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Md)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const o=i.getText(),a=wy(s.map(sj),(l,f)=>{const d=l.range.start.line-f.range.start.line;return d===0?l.range.
|
|
589
|
-
start.character-f.range.start.character:d});let u=0;const c=[];for(const l of a){const f=i.offsetAt(l.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&c.push(o.substring(u,f)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(lp||(lp={}));function wy(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);wy(r,e),wy(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=
|
|
590
|
-
i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function gR(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);yR(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function yR(t){return t===13||t===10}function vR(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 sj(t){const e=vR(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var wR;(()=>{
|
|
591
|
-
var t={975:B=>{function T(S){if(typeof S!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(S))}function D(S,P){for(var O,Z="",H=0,C=-1,ne=0,ye=0;ye<=S.length;++ye){if(ye<S.length)O=S.charCodeAt(ye);else{if(O===47)break;O=47}if(O===47){if(!(C===ye-1||ne===1))if(C!==ye-1&&ne===2){if(Z.length<2||H!==2||Z.charCodeAt(Z.length-1)!==46||Z.charCodeAt(Z.length-2)!==46){if(Z.length>2){var Pe=Z.lastIndexOf("/");if(Pe!==Z.length-1){Pe===-1?(Z="",H=0):H=(Z=Z.slice(0,Pe)).length-
|
|
592
|
-
1-Z.lastIndexOf("/"),C=ye,ne=0;continue}}else if(Z.length===2||Z.length===1){Z="",H=0,C=ye,ne=0;continue}}P&&(Z.length>0?Z+="/..":Z="..",H=2)}else Z.length>0?Z+="/"+S.slice(C+1,ye):Z=S.slice(C+1,ye),H=ye-C-1;C=ye,ne=0}else O===46&&ne!==-1?++ne:ne=-1}return Z}var M={resolve:function(){for(var S,P="",O=!1,Z=arguments.length-1;Z>=-1&&!O;Z--){var H;Z>=0?H=arguments[Z]:(S===void 0&&(S=process.cwd()),H=S),T(H),H.length!==0&&(P=H+"/"+P,O=H.charCodeAt(0)===47)}return P=D(P,!O),O?P.length>0?"/"+P:"/":P.length>
|
|
593
|
-
0?P:"."},normalize:function(S){if(T(S),S.length===0)return".";var P=S.charCodeAt(0)===47,O=S.charCodeAt(S.length-1)===47;return(S=D(S,!P)).length!==0||P||(S="."),S.length>0&&O&&(S+="/"),P?"/"+S:S},isAbsolute:function(S){return T(S),S.length>0&&S.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var S,P=0;P<arguments.length;++P){var O=arguments[P];T(O),O.length>0&&(S===void 0?S=O:S+="/"+O)}return S===void 0?".":M.normalize(S)},relative:function(S,P){if(T(S),T(P),S===P||(S=
|
|
594
|
-
M.resolve(S))===(P=M.resolve(P)))return"";for(var O=1;O<S.length&&S.charCodeAt(O)===47;++O);for(var Z=S.length,H=Z-O,C=1;C<P.length&&P.charCodeAt(C)===47;++C);for(var ne=P.length-C,ye=H<ne?H:ne,Pe=-1,F=0;F<=ye;++F){if(F===ye){if(ne>ye){if(P.charCodeAt(C+F)===47)return P.slice(C+F+1);if(F===0)return P.slice(C+F)}else H>ye&&(S.charCodeAt(O+F)===47?Pe=F:F===0&&(Pe=0));break}var V=S.charCodeAt(O+F);if(V!==P.charCodeAt(C+F))break;V===47&&(Pe=F)}var Se="";for(F=O+Pe+1;F<=Z;++F)F!==Z&&S.charCodeAt(F)!==
|
|
595
|
-
47||(Se.length===0?Se+="..":Se+="/..");return Se.length>0?Se+P.slice(C+Pe):(C+=Pe,P.charCodeAt(C)===47&&++C,P.slice(C))},_makeLong:function(S){return S},dirname:function(S){if(T(S),S.length===0)return".";for(var P=S.charCodeAt(0),O=P===47,Z=-1,H=!0,C=S.length-1;C>=1;--C)if((P=S.charCodeAt(C))===47){if(!H){Z=C;break}}else H=!1;return Z===-1?O?"/":".":O&&Z===1?"//":S.slice(0,Z)},basename:function(S,P){if(P!==void 0&&typeof P!="string")throw new TypeError('"ext" argument must be a string');T(S);var O,
|
|
596
|
-
Z=0,H=-1,C=!0;if(P!==void 0&&P.length>0&&P.length<=S.length){if(P.length===S.length&&P===S)return"";var ne=P.length-1,ye=-1;for(O=S.length-1;O>=0;--O){var Pe=S.charCodeAt(O);if(Pe===47){if(!C){Z=O+1;break}}else ye===-1&&(C=!1,ye=O+1),ne>=0&&(Pe===P.charCodeAt(ne)?--ne==-1&&(H=O):(ne=-1,H=ye))}return Z===H?H=ye:H===-1&&(H=S.length),S.slice(Z,H)}for(O=S.length-1;O>=0;--O)if(S.charCodeAt(O)===47){if(!C){Z=O+1;break}}else H===-1&&(C=!1,H=O+1);return H===-1?"":S.slice(Z,H)},extname:function(S){T(S);for(var P=-1,
|
|
597
|
-
O=0,Z=-1,H=!0,C=0,ne=S.length-1;ne>=0;--ne){var ye=S.charCodeAt(ne);if(ye!==47)Z===-1&&(H=!1,Z=ne+1),ye===46?P===-1?P=ne:C!==1&&(C=1):P!==-1&&(C=-1);else if(!H){O=ne+1;break}}return P===-1||Z===-1||C===0||C===1&&P===Z-1&&P===O+1?"":S.slice(P,Z)},format:function(S){if(S===null||typeof S!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof S);return function(P,O){var Z=O.dir||O.root,H=O.base||(O.name||"")+(O.ext||"");return Z?Z===O.root?Z+H:Z+"/"+
|
|
598
|
-
H:H}(0,S)},parse:function(S){T(S);var P={root:"",dir:"",base:"",ext:"",name:""};if(S.length===0)return P;var O,Z=S.charCodeAt(0),H=Z===47;H?(P.root="/",O=1):O=0;for(var C=-1,ne=0,ye=-1,Pe=!0,F=S.length-1,V=0;F>=O;--F)if((Z=S.charCodeAt(F))!==47)ye===-1&&(Pe=!1,ye=F+1),Z===46?C===-1?C=F:V!==1&&(V=1):C!==-1&&(V=-1);else if(!Pe){ne=F+1;break}return C===-1||ye===-1||V===0||V===1&&C===ye-1&&C===ne+1?ye!==-1&&(P.base=P.name=ne===0&&H?S.slice(1,ye):S.slice(ne,ye)):(ne===0&&H?(P.name=S.slice(1,C),P.base=
|
|
599
|
-
S.slice(1,ye)):(P.name=S.slice(ne,C),P.base=S.slice(ne,ye)),P.ext=S.slice(C,ye)),ne>0?P.dir=S.slice(0,ne-1):H&&(P.dir="/"),P},sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,B.exports=M}},e={};function n(B){var T=e[B];if(T!==void 0)return T.exports;var D=e[B]={exports:{}};return t[B](D,D.exports,n),D.exports}n.d=(B,T)=>{for(var D in T)n.o(T,D)&&!n.o(B,D)&&Object.defineProperty(B,D,{enumerable:!0,get:T[D]})},n.o=(B,T)=>Object.prototype.hasOwnProperty.call(B,T),n.r=B=>{typeof Symbol<"u"&&Symbol.
|
|
600
|
-
toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>d,Utils:()=>we}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function u(B,T){if(!B.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${B.authority}", path: "${B.path}", query: "${B.
|
|
601
|
-
query}", fragment: "${B.fragment}"}`);if(B.scheme&&!s.test(B.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(B.path){if(B.authority){if(!o.test(B.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(a.test(B.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}
|
|
602
|
-
const c="",l="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{static isUri(T){return T instanceof d||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,D,M,S,P,O=!1){typeof T=="object"?(this.scheme=T.scheme||c,this.authority=T.authority||c,this.path=
|
|
603
|
-
T.path||c,this.query=T.query||c,this.fragment=T.fragment||c):(this.scheme=function(Z,H){return Z||H?Z:"file"}(T,O),this.authority=D||c,this.path=function(Z,H){switch(Z){case"https":case"http":case"file":H?H[0]!==l&&(H=l+H):H=l}return H}(this.scheme,M||c),this.query=S||c,this.fragment=P||c,u(this,O))}get fsPath(){return E(this)}with(T){if(!T)return this;let{scheme:D,authority:M,path:S,query:P,fragment:O}=T;return D===void 0?D=this.scheme:D===null&&(D=c),M===void 0?M=this.authority:M===null&&(M=c),
|
|
604
|
-
S===void 0?S=this.path:S===null&&(S=c),P===void 0?P=this.query:P===null&&(P=c),O===void 0?O=this.fragment:O===null&&(O=c),D===this.scheme&&M===this.authority&&S===this.path&&P===this.query&&O===this.fragment?this:new h(D,M,S,P,O)}static parse(T,D=!1){const M=f.exec(T);return M?new h(M[2]||c,K(M[4]||c),K(M[5]||c),K(M[7]||c),K(M[9]||c),D):new h(c,c,c,c,c)}static file(T){let D=c;if(i&&(T=T.replace(/\\/g,l)),T[0]===l&&T[1]===l){const M=T.indexOf(l,2);M===-1?(D=T.substring(2),T=l):(D=T.substring(2,M),
|
|
605
|
-
T=T.substring(M)||l)}return new h("file",D,T,c,c)}static from(T){const D=new h(T.scheme,T.authority,T.path,T.query,T.fragment);return u(D,!0),D}toString(T=!1){return R(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof d)return T;{const D=new h(T);return D._formatted=T.external,D._fsPath=T._sep===p?T.fsPath:null,D}}return T}}const p=i?1:void 0;class h extends d{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=E(this)),this._fsPath}toString(T=!1){return T?
|
|
606
|
-
R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=p),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const v={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"\
|
|
607
|
-
%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(B,T,D){let M,S=-1;for(let P=0;P<B.length;P++){const O=B.charCodeAt(P);if(O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||T&&O===47||D&&O===91||D&&O===93||D&&O===58)S!==-1&&(M+=encodeURIComponent(B.substring(S,P)),S=-1),M!==void 0&&(M+=B.charAt(P));else{M===void 0&&(M=B.substr(0,P));const Z=v[O];Z!==void 0?(S!==-1&&(M+=encodeURIComponent(B.substring(S,P)),S=-1),M+=Z):S===-1&&(S=P)}}return S!==
|
|
608
|
-
-1&&(M+=encodeURIComponent(B.substring(S))),M!==void 0?M:B}function y(B){let T;for(let D=0;D<B.length;D++){const M=B.charCodeAt(D);M===35||M===63?(T===void 0&&(T=B.substr(0,D)),T+=v[M]):T!==void 0&&(T+=B[D])}return T!==void 0?T:B}function E(B,T){let D;return D=B.authority&&B.path.length>1&&B.scheme==="file"?`//${B.authority}${B.path}`:B.path.charCodeAt(0)===47&&(B.path.charCodeAt(1)>=65&&B.path.charCodeAt(1)<=90||B.path.charCodeAt(1)>=97&&B.path.charCodeAt(1)<=122)&&B.path.charCodeAt(2)===58?B.path[1].
|
|
609
|
-
toLowerCase()+B.path.substr(2):B.path,i&&(D=D.replace(/\//g,"\\")),D}function R(B,T){const D=T?y:b;let M="",{scheme:S,authority:P,path:O,query:Z,fragment:H}=B;if(S&&(M+=S,M+=":"),(P||S==="file")&&(M+=l,M+=l),P){let C=P.indexOf("@");if(C!==-1){const ne=P.substr(0,C);P=P.substr(C+1),C=ne.lastIndexOf(":"),C===-1?M+=D(ne,!1,!1):(M+=D(ne.substr(0,C),!1,!1),M+=":",M+=D(ne.substr(C+1),!1,!0)),M+="@"}P=P.toLowerCase(),C=P.lastIndexOf(":"),C===-1?M+=D(P,!1,!0):(M+=D(P.substr(0,C),!1,!0),M+=P.substr(C))}if(O){
|
|
610
|
-
if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){const C=O.charCodeAt(1);C>=65&&C<=90&&(O=`/${String.fromCharCode(C+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){const C=O.charCodeAt(0);C>=65&&C<=90&&(O=`${String.fromCharCode(C+32)}:${O.substr(2)}`)}M+=D(O,!0,!1)}return Z&&(M+="?",M+=D(Z,!1,!1)),H&&(M+="#",M+=T?H:b(H,!1,!1)),M}function A(B){try{return decodeURIComponent(B)}catch{return B.length>3?B.substr(0,3)+A(B.substr(3)):B}}const N=/(%[0-9A-Za-z][0-9A-Za-z])+/g;
|
|
611
|
-
function K(B){return B.match(N)?B.replace(N,T=>A(T)):B}var J=n(975);const se=J.posix||J,ie="/";var we;(function(B){B.joinPath=function(T,...D){return T.with({path:se.join(T.path,...D)})},B.resolvePath=function(T,...D){let M=T.path,S=!1;M[0]!==ie&&(M=ie+M,S=!0);let P=se.resolve(M,...D);return S&&P[0]===ie&&!T.authority&&(P=P.substring(1)),T.with({path:P})},B.dirname=function(T){if(T.path.length===0||T.path===ie)return T;let D=se.dirname(T.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),T.
|
|
612
|
-
with({path:D})},B.basename=function(T){return se.basename(T.path)},B.extname=function(T){return se.extname(T.path)}})(we||(we={})),wR=r})();const{URI:Et,Utils:Hu}=wR;var pt;(function(t){t.basename=Hu.basename,t.dirname=Hu.dirname,t.extname=Hu.extname,t.joinPath=Hu.joinPath,t.resolvePath=Hu.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function n(s,o){return s?.toString()===o?.toString()}t.equals=n;function r(s,o){const a=typeof s=="string"?Et.parse(
|
|
613
|
-
s).path:s.path,u=typeof o=="string"?Et.parse(o).path:o.path,c=a.split("/").filter(h=>h.length>0),l=u.split("/").filter(h=>h.length>0);if(e){const h=/^[A-Z]:$/;if(c[0]&&h.test(c[0])&&(c[0]=c[0].toLowerCase()),l[0]&&h.test(l[0])&&(l[0]=l[0].toLowerCase()),c[0]!==l[0])return u.substring(1)}let f=0;for(;f<c.length&&c[f]===l[f];f++);const d="../".repeat(c.length-f),p=l.slice(f).join("/");return d+p}t.relative=r;function i(s){return Et.parse(s.toString()).toString()}t.normalize=i})(pt||(pt={}));var je;
|
|
614
|
-
(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"})(je||(je={}));class oj{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ft.CancellationToken.None){const r=await this.fileSystemProvider.readFile(
|
|
615
|
-
e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Et.parse(e.uri),ft.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ft.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.
|
|
616
|
-
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:je.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,
|
|
617
|
-
uri:n,state:je.Parsed,references:[],get textDocument(){return o()}}}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,o=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),a=o?o.getText():await this.fileSystemProvider.readFile(e.uri);if(o)Object.defineProperty(e,"textDocument",{value:o});else{const u=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:u})}return s!==
|
|
618
|
-
a&&(e.parseResult=await this.parseAsync(e.uri,a,n),e.parseResult.value.$document=e),e.state=je.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=lp.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class bR{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=
|
|
619
|
-
e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return We(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){
|
|
620
|
-
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=je.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.
|
|
621
|
-
get(n);return r&&(r.state=je.Changed,this.documentMap.delete(n)),r}}const by=Symbol("ref_resolving");class aj{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=ft.CancellationToken.None){for(const r of Qr(e.parseResult.value))await qt(n),of(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){
|
|
622
|
-
i._ref=by;try{const s=this.getCandidate(e);if(Hd(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const o=this.loadAstNode(s);i._ref=o??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const o=(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}': ${o}`})}n.references.
|
|
623
|
-
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,o={$refNode:r,$refText:i,get ref(){var a;if(Rt(this._ref))return this._ref;if(v1(this._nodeDescription)){const u=s.loadAstNode(this._nodeDescription);this._ref=u??s.createLinkingError({reference:o,container:e,property:n},this._nodeDescription)}else if(this.
|
|
624
|
-
_ref===void 0){this._ref=by;const u=sf(e).$document,c=s.getLinkedNode({reference:o,container:e,property:n});if(c.error&&u&&u.state<je.ComputedScopes)return this._ref=void 0;this._ref=(a=c.node)!==null&&a!==void 0?a:c.error,this._nodeDescription=c.descr,u?.references.push(this)}else if(this._ref===by)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return Rt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},
|
|
625
|
-
get error(){return Hd(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(Hd(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 \
|
|
626
|
-
'${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=sf(e.container).$document;r&&r.state<je.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 n\
|
|
627
|
-
ot resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function dp(t){return typeof t.name=="string"}class ER{getName(e){if(dp(e))return e.name}getNameNode(e){return dn(e.$cstNode,"name")}}class uj{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=Ab(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(tr(i))return i.ref;if(Array.isArray(i)){for(const s of i)
|
|
628
|
-
if(tr(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||E1(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&&
|
|
629
|
-
(i=i.filter(s=>pt.equals(s.sourceUri,n.documentUri))),r.push(...i),We(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=lt(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Xd(n),local:!0}}}}class Fs{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Cm.sum(We(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(
|
|
630
|
-
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.
|
|
631
|
-
forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return We(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return We(this.map.keys())}values(){return We(this.map.values()).flat()}entriesGroupedByKey(){return We(this.map.entries())}}class $R{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.
|
|
632
|
-
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 DR{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=ft.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=vu,i=ft.CancellationToken.None){
|
|
633
|
-
const s=[];this.exportNode(e,s,n);for(const o of r(e))await qt(i),this.exportNode(o,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=ft.CancellationToken.None){const r=e.parseResult.value,i=new Fs;for(const s of Or(r))await qt(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,
|
|
634
|
-
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 Ey{constructor(e,n,r){var i;this.
|
|
635
|
-
elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const o=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(o,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=We(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const RR={getElement(){},
|
|
636
|
-
getAllElements(){return bs}};class kR{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 cj extends kR{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,
|
|
637
|
-
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 lj extends kR{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();
|
|
638
|
-
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 fp extends cj{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.
|
|
639
|
-
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 TR{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 fp(e.shared)}getScope(e){const n=[],r=this.reflection.
|
|
640
|
-
getReferenceType(e),i=lt(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(We(a).filter(u=>this.reflection.isSubtype(u.type,r))),o=o.$container}while(o)}let s=this.getGlobalScope(r,e);for(let o=n.length-1;o>=0;o--)s=this.createScope(n[o],s);return s}createScope(e,n,r){return new Ms(We(e),n,r)}createScopeForNodes(e,n,r){const i=We(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new Ms(
|
|
641
|
-
i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new Ey(this.indexManager.allElements(e)))}}function dj(t){return typeof t.$comment=="string"}function CR(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class fj{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.
|
|
642
|
-
NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(a,u)=>this.replacer(a,u,r),o=i?(a,u)=>i(a,u,s):s;try{return this.currentDocument=lt(e),JSON.stringify(e,o,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:o,uriConverter:a}){var u,c,l,f;if(!this.ignoreProperties.has(e))if(tr(n)){const d=n.ref,p=r?n.$refText:
|
|
643
|
-
void 0;if(d){const h=lt(d);let v="";this.currentDocument&&this.currentDocument!==h&&(a?v=a(h.uri,n):v=h.uri.toString());const b=this.astNodeLocator.getAstNodePath(d);return{$ref:`${v}#${b}`,$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(Rt(n)){let d;if(s&&(d=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&d?.$textRegion&&(d.$textRegion.documentURI=(l=this.currentDocument)===
|
|
644
|
-
null||l===void 0?void 0:l.uri.toString())),i&&!e&&(d??(d=Object.assign({},n)),d.$sourceText=(f=n.$cstNode)===null||f===void 0?void 0:f.text),o){d??(d=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(d.$comment=p.replace(/\r/g,""))}return d??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(
|
|
645
|
-
"$")).forEach(s=>{const o=No(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[u,c]of Object.entries(e))if(Array.isArray(c))for(let l=0;l<c.length;l++){const f=c[l];CR(f)?c[l]=this.reviveReference(e,u,n,f,r):Rt(f)&&this.linkNode(f,n,r,e,u,l)}else CR(c)?e[u]=this.reviveReference(e,u,n,c,r):Rt(c)&&this.linkNode(c,n,r,e,u);const a=e;a.$container=i,a.$containerProperty=s,a.$containerIndex=o}reviveReference(e,n,r,i,s){let o=i.$refText,a=i.$error;if(i.$ref){const u=this.
|
|
646
|
-
getRefNode(r,i.$ref,s.uriConverter);if(Rt(u))return o||(o=this.nameProvider.getName(u)),{$refText:o??"",ref:u};a=u}if(a){const u={$refText:o??""};return u.error={container:e,property:n,message:a,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):Et.parse(n),c=this.langiumDocuments.getDocument(u);return c?c.parseResult.value:"Could not find document\
|
|
647
|
-
for URI: "+n}const s=r?r(n.substring(0,i)):Et.parse(n.substring(0,i)),o=this.langiumDocuments.getDocument(s);if(!o)return"Could not find document for URI: "+n;if(i===n.length-1)return o.parseResult.value;const a=this.astNodeLocator.getAstNode(o.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}}class pj{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.
|
|
648
|
-
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 regi\
|
|
649
|
-
stry 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 a=this.languageIdMap.get(i);if(a)return a}const s=pt.extname(e),o=this.fileExtensionMap.get(s);if(!o)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 o}hasServices(e){
|
|
650
|
-
try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Vu(t){return{code:t}}var pp;(function(t){t.all=["fast","slow","built-in"]})(pp||(pp={}));class hj{constructor(e){this.entries=new Fs,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(
|
|
651
|
-
e)){const o=s;if(Array.isArray(o))for(const a of o){const u={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,u)}else if(typeof o=="function"){const a={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,a)}else Ba()}}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(cp(s))throw s;console.error(`${n}:`,s),s instanceof
|
|
652
|
-
Error&&s.stack&&console.error(s.stack);const o=s instanceof Error?s.message:String(s);r("error",`${n}: ${o}`,{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=We(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,"A\
|
|
653
|
-
n 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,o,a)=>{await this.handleException(()=>e.call(r,i,s,o,a),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class mj{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=ft.
|
|
654
|
-
CancellationToken.None){const i=e.parseResult,s=[];if(await qt(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Er.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Er.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=
|
|
655
|
-
o.data)===null||a===void 0?void 0:a.code)===Er.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(cp(o))throw o;console.error("An error occurred during validation:",o)}return await qt(r),s}processLexingErrors(e,n,r){var i,s,o;const a=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const u of a){const c=(o=u.severity)!==null&&o!==void 0?o:"error",l={severity:$y(c),range:{start:{line:u.line-1,character:u.
|
|
656
|
-
column-1},end:{line:u.line-1,character:u.column+u.length-1}},message:u.message,data:yj(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 o=i.previousToken;if(isNaN(o.startOffset)){const a={line:0,character:0};s={start:a,end:a}}else{const a={line:o.endLine-1,character:o.endColumn};s={start:a,end:a}}}}else s=Am(i.token);if(s){const o={severity:$y("error"),range:s,message:i.message,data:Vu(
|
|
657
|
-
Er.ParsingError),source:this.getSource()};n.push(o)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const o={node:s.container,property:s.property,index:s.index,data:{code:Er.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,n,r=ft.CancellationToken.None){const i=[],s=(o,a,u)=>{i.push(this.toDiagnostic(o,a,u))};return await this.validateAstBefore(e,n,
|
|
658
|
-
s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=ft.CancellationToken.None){var s;const o=this.validationRegistry.checksBefore;for(const a of o)await qt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=ft.CancellationToken.None){await Promise.all(Qr(e).map(async s=>{await qt(i);const o=this.validationRegistry.getChecks(s.$type,n.categories);for(const a of o)await a(s,r,i)}))}async validateAstAfter(e,n,r,i=ft.
|
|
659
|
-
CancellationToken.None){var s;const o=this.validationRegistry.checksAfter;for(const a of o)await qt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:gj(r),severity:$y(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 gj(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=dn(t.node.$cstNode,
|
|
660
|
-
t.property,t.index):typeof t.keyword=="string"&&(e=Eu(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 $y(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 yj(t){switch(t){case"error":return Vu(Er.LexingError);case"warning":return Vu(Er.LexingWarning);case"info":return Vu(Er.LexingInfo);case"hint":return Vu(
|
|
661
|
-
Er.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Er;(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"})(Er||(Er={}));class AR{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??lt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.
|
|
662
|
-
getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let o;const a=()=>{var u;return o??(o=Xd((u=this.nameProvider.getNameNode(e))!==null&&u!==void 0?u:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:Xd(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class vj{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ft.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Qr(i))await qt(n),
|
|
663
|
-
of(s).filter(o=>!Hd(o)).forEach(o=>{const a=this.createDescription(o);a&&r.push(a)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=lt(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Xd(r),local:pt.equals(n.documentUri,i)}}}class wj{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.
|
|
664
|
-
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 o=s.indexOf(this.indexSeparator);if(o>0){const a=s.substring(0,o),u=parseInt(s.substring(o+1)),c=i[a];return c?.[u]}return i[s]},e)}}
|
|
665
|
-
var bj=Ko();class Ej{constructor(e){this._ready=new vy,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new bj.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.
|
|
666
|
-
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){
|
|
667
|
-
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 Bs;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Bs||(Bs={}));class $j{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Fs,
|
|
668
|
-
this.documentPhaseListeners=new Fs,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=je.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=ft.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===je.Validated){if(typeof n.
|
|
669
|
-
validation=="boolean"&&n.validation)o.state=je.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const u=this.buildState.get(a),c=(i=u?.result)===null||i===void 0?void 0:i.validationChecks;if(c){const f=((s=n.validation.categories)!==null&&s!==void 0?s:pp.all).filter(d=>!c.includes(d));f.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:f})},result:u.result}),o.state=je.
|
|
670
|
-
IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=je.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ft.CancellationToken.None){this.currentState=je.Changed;for(const o of n)this.langiumDocuments.deleteDocument(o),this.buildState.delete(o.toString()),this.indexManager.remove(o);for(const o of e){if(!this.langiumDocuments.invalidateDocument(o)){const u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);u.state=je.Changed,
|
|
671
|
-
this.langiumDocuments.addDocument(u)}this.buildState.delete(o.toString())}const i=We(e).concat(n).map(o=>o.toString()).toSet();this.langiumDocuments.all.filter(o=>!i.has(o.uri.toString())&&this.shouldRelink(o,i)).forEach(o=>{this.serviceRegistry.getServices(o.uri).references.Linker.unlink(o),o.state=Math.min(o.state,je.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await qt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<je.Linked||!(!((a=
|
|
672
|
-
this.buildState.get(o.uri.toString()))===null||a===void 0)&&a.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){
|
|
673
|
-
return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),Bs.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,je.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,je.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,je.ComputedScopes,r,async s=>{
|
|
674
|
-
const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,je.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,je.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,je.Validated,r,s=>this.validate(s,r));for(const s of e){const o=this.buildState.get(s.uri.toString());
|
|
675
|
-
o&&(o.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(a=>a.state<n);for(const a of s)await qt(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r);const o=e.filter(a=>a.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),Bs.create(()=>{
|
|
676
|
-
this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Bs.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=ft.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(up):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),u.dispose(),
|
|
677
|
-
i){const c=this.langiumDocuments.getDocument(i);s(c?.uri)}else s(void 0)}),u=r.onCancellationRequested(()=>{a.dispose(),u.dispose(),o(up)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const o of s)try{await o(e,r)}catch(a){if(!cp(a))throw a}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const o of s)await qt(r),await o(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){
|
|
678
|
-
var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,u=await s.validateDocument(e,a,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=a?.categories)!==null&&i!==void 0?i:pp.all;c.result.validationChecks?c.result.validationChecks.push(...l):c.result.validationChecks=[...l]}}getBuildOptions(e){
|
|
679
|
-
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 SR{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new lj,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=lt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{pt.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),
|
|
680
|
-
We(i)}allElements(e,n){let r=We(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(a=>this.astReflection.isSubtype(a.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.
|
|
681
|
-
delete(n)}async updateContent(e,n=ft.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=ft.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(
|
|
682
|
-
e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class _R{constructor(e){this.initialBuildOptions={},this._ready=new vy,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=
|
|
683
|
-
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=ft.CancellationToken.None){const r=await this.performStartup(e);await qt(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(
|
|
684
|
-
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 Et.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async o=>{if(this.includeEntry(e,o,r)){if(o.isDirectory)await this.traverseFolder(
|
|
685
|
-
e,o.uri,r,i);else if(o.isFile){const a=await this.langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}includeEntry(e,n,r){const i=pt.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=pt.extname(n.uri);return r.includes(s)}return!1}}class Dj{buildUnexpectedCharactersMessage(e,n,r,i,s){return Ng.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return Ng.buildUnableToPopLexerModeMessage(e)}}const Rj={
|
|
686
|
-
mode:"full"};class kj{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=xR(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Ln(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.
|
|
687
|
-
tokenTypes}tokenize(e,n=Rj){var r,i,s;const o=this.chevrotainLexer.tokenize(e);return{tokens:o.tokens,errors:o.errors,hidden:(r=o.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(xR(e))return e;const n=PR(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function Tj(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function PR(t){return t&&"modes"in t&&"de\
|
|
688
|
-
faultMode"in t}function xR(t){return!Tj(t)&&!PR(t)}function Cj(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=st.create(0,0));const s=NR(t),o=Ry(r),a=_j({lines:s,position:i,options:o});return Oj({index:0,tokens:a,position:i})}function Aj(t,e){const n=Ry(e),r=NR(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return!!o?.exec(i)&&!!a?.exec(s)}function NR(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Rb)}const IR=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,
|
|
689
|
-
Sj=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function _j(t){var e,n,r;const i=[];let s=t.position.line,o=t.position.character;for(let a=0;a<t.lines.length;a++){const u=a===0,c=a===t.lines.length-1;let l=t.lines[a],f=0;if(u&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(f=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(f=p.index+p[0].length)}if(c){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);
|
|
690
|
-
p&&(l=l.substring(0,p.index))}if(l=l.substring(0,Ij(l)),Dy(l,f)>=l.length){if(i.length>0){const p=st.create(s,o);i.push({type:"break",content:"",range:Ye.create(p,p)})}}else{IR.lastIndex=f;const p=IR.exec(l);if(p){const h=p[0],v=p[1],b=st.create(s,o+f),y=st.create(s,o+f+h.length);i.push({type:"tag",content:v,range:Ye.create(b,y)}),f+=h.length,f=Dy(l,f)}if(f<l.length){const h=l.substring(f),v=Array.from(h.matchAll(Sj));i.push(...Pj(v,h,s,o+f))}}s++,o=0}return i.length>0&&i[i.length-1].type==="bre\
|
|
691
|
-
ak"?i.slice(0,-1):i}function Pj(t,e,n,r){const i=[];if(t.length===0){const s=st.create(n,r),o=st.create(n,r+e.length);i.push({type:"text",content:e,range:Ye.create(s,o)})}else{let s=0;for(const a of t){const u=a.index,c=e.substring(s,u);c.length>0&&i.push({type:"text",content:e.substring(s,u),range:Ye.create(st.create(n,s+r),st.create(n,u+r))});let l=c.length+1;const f=a[1];if(i.push({type:"inline-tag",content:f,range:Ye.create(st.create(n,s+l+r),st.create(n,s+l+f.length+r))}),l+=f.length,a.length===
|
|
692
|
-
4){l+=a[2].length;const d=a[3];i.push({type:"text",content:d,range:Ye.create(st.create(n,s+l+r),st.create(n,s+l+d.length+r))})}else i.push({type:"text",content:"",range:Ye.create(st.create(n,s+l+r),st.create(n,s+l+r))});s=u+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Ye.create(st.create(n,s+r),st.create(n,s+r+o.length))})}return i}const xj=/\S/,Nj=/\s*$/;function Dy(t,e){const n=t.substring(e).match(xj);return n?e+n.index:t.length}function Ij(t){const e=t.match(
|
|
693
|
-
Nj);if(e&&typeof e.index=="number")return e.index}function Oj(t){var e,n,r,i;const s=st.create(t.position.line,t.position.character);if(t.tokens.length===0)return new MR([],Ye.create(s,s));const o=[];for(;t.index<t.tokens.length;){const c=Lj(t,o[o.length-1]);c&&o.push(c)}const a=(n=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,u=(i=(r=o[o.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new MR(o,Ye.create(a,u))}function Lj(t,e){const n=t.
|
|
694
|
-
tokens[t.index];if(n.type==="tag")return LR(t,!1);if(n.type==="text"||n.type==="inline-tag")return OR(t);Fj(n,e),t.index++}function Fj(t,e){if(e){const n=new BR("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function OR(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(Mj(t)),r=e,e=t.tokens[t.index];return new Cy(i,Ye.create(n.range.start,r.range.end))}function Mj(t){return t.tokens[t.index].type==="inline-tag"?LR(t,!0):
|
|
695
|
-
FR(t)}function LR(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=FR(t);return new Ty(r,new Cy([s],s.range),e,Ye.create(n.range.start,s.range.end))}else{const s=OR(t);return new Ty(r,s,e,Ye.create(n.range.start,s.range.end))}else{const s=n.range;return new Ty(r,new Cy([],s),e,s)}}function FR(t){const e=t.tokens[t.index++];return new BR(e.content,e.range)}function Ry(t){if(!t)return Ry({start:"/**",end:"*/",line:"*"});const{start:e,end:n,
|
|
696
|
-
line:r}=t;return{start:ky(e,!0),end:ky(n,!1),line:ky(r,!0)}}function ky(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?df(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class MR{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.
|
|
697
|
-
elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=qR(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+=qR(n)+i}return n.trim()}}class Ty{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}
|
|
698
|
-
${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=Bj(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.
|
|
699
|
-
content.inlines.length>1&&(i=`${i}
|
|
700
|
-
${n}`),this.inline?`{${i}}`:i}}function Bj(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let o=e;if(s>0){const u=Dy(e,s);o=e.substring(u),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(o=`\`${o}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,o))!==null&&i!==void 0?i:qj(e,o)}}function qj(t,e){try{return Et.parse(t,!0),`[${e}](${t})`}catch{return t}}class Cy{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";
|
|
701
|
-
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+=`
|
|
702
|
-
`)}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+=`
|
|
703
|
-
`)}return n}}class BR{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function qR(t){return t.endsWith(`
|
|
704
|
-
`)?`
|
|
705
|
-
`:`
|
|
706
|
-
|
|
707
|
-
`}class jj{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&Aj(n))return Cj(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 o=s.
|
|
708
|
-
nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,u=s.documentUri.with({fragment:`L${o},${a}`});return`[${r}](${u.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=lt(e).precomputedScopes;if(!i)return;let s=e;do{const a=i.get(s).find(u=>u.name===n);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class Gj{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){
|
|
709
|
-
var n;return dj(e)?e.$comment:(n=Sm(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class Uj{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class Wj{constructor(){this.previousTokenSource=new ft.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=ij();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){
|
|
710
|
-
return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ft.CancellationToken.None){const i=new vy,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})=>{
|
|
711
|
-
try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){cp(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class zj{constructor(e){this.grammarElementIdMap=new $R,this.tokenTypeIdMap=new $R,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.
|
|
712
|
-
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 Qr(e))n.set(i,{});if(e.$cstNode)for(const i of Kd(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.
|
|
713
|
-
$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 o=[];r[i]=o;for(const a of s)Rt(a)?o.push(this.dehydrateAstNode(a,n)):tr(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else Rt(s)?r[i]=this.dehydrateAstNode(s,n):tr(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)),
|
|
714
|
-
r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return ob(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Mi(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):ws(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(
|
|
715
|
-
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 Qr(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Kd(e.$cstNode)){let o;"fullText"in s?(o=new rR(s.fullText),i=o):"content"in s?o=new hy:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(r.set(s,o),o.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){
|
|
716
|
-
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 o=[];r[i]=o;for(const a of s)Rt(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):tr(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else Rt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):tr(s)?r[i]=this.hydrateReference(s,r,i,n):s!==
|
|
717
|
-
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),Mi(i))for(const s of e.content){const o=this.hydrateCstNode(s,n,r++);i.content.push(o)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),
|
|
718
|
-
r=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,u=e.endColumn,c=e.hidden;return new py(r,i,{start:{line:s,character:o},end:{line:a,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(){
|
|
719
|
-
let e=0;for(const n of Qr(this.grammar))Nm(n)&&this.grammarElementIdMap.set(n,e++)}}function jR(t){return{documentation:{CommentProvider:e=>new Gj(e),DocumentationProvider:e=>new jj(e)},parser:{AsyncParser:e=>new Uj(e),GrammarConfig:e=>cN(e),LangiumParser:e=>Qq(e),CompletionParser:e=>Jq(e),ValueConverter:()=>new tj,TokenBuilder:()=>new ej,Lexer:e=>new kj(e),ParserErrorMessageProvider:()=>new aR,LexerErrorMessageProvider:()=>new Dj},workspace:{AstNodeLocator:()=>new wj,AstNodeDescriptionProvider:e=>new AR(
|
|
720
|
-
e),ReferenceDescriptionProvider:e=>new vj(e)},references:{Linker:e=>new aj(e),NameProvider:()=>new ER,ScopeProvider:e=>new TR(e),ScopeComputation:e=>new DR(e),References:e=>new uj(e)},serializer:{Hydrator:e=>new zj(e),JsonSerializer:e=>new fj(e)},validation:{DocumentValidator:e=>new mj(e),ValidationRegistry:e=>new hj(e)},shared:()=>t.shared}}function GR(t){return{ServiceRegistry:e=>new pj(e),workspace:{LangiumDocuments:e=>new bR(e),LangiumDocumentFactory:e=>new oj(e),DocumentBuilder:e=>new $j(e),
|
|
721
|
-
IndexManager:e=>new SR(e),WorkspaceManager:e=>new _R(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Wj,ConfigurationProvider:e=>new Ej(e)}}}var hp;(function(t){t.merge=(e,n)=>gp(gp({},e),n)})(hp||(hp={}));function mp(t,e,n,r,i,s,o,a,u){const c=[t,e,n,r,i,s,o,a,u].reduce(gp,{});return WR(c)}const UR=Symbol("isProxy");function Ay(t){if(t&&t[UR])for(const e of Object.values(t))Ay(e);return t}function WR(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error(
|
|
722
|
-
"Cannot set property on injected service container")},get:(r,i)=>i===UR?!0:HR(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(HR(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const zR=Symbol();function HR(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]===zR)throw new Error('Cycle detected. Please make "'+
|
|
723
|
-
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]=zR;try{t[e]=typeof i=="function"?i(r):WR(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function gp(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]=gp(i,r):t[n]=r}}return t}class Hj{readFile(){throw new Error("No fil\
|
|
724
|
-
e system is available.")}async readDirectory(){return[]}}const VR={fileSystemProvider:()=>new Hj},Vj={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Kj={AstReflection:()=>new wb};function Xj(){const t=mp(GR(VR),Kj),e=mp(jR({shared:t}),Vj);return t.ServiceRegistry.register(e),e}function Yj(t){var e;const n=Xj(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Et.parse(`memory://${(e=
|
|
725
|
-
r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var Jj={done:!0,hasNext:!1},Ku={done:!1,hasNext:!1},Qj=()=>Jj,Zj=t=>({hasNext:!0,next:t,done:!1});function Xe(t,...e){let n=t,r=e.map(s=>"lazy"in s?eG(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!tG(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 o=[];for(let u of n)if(KR(u,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function KR(t,e,n){
|
|
726
|
-
if(n.length===0)return e.push(t),!1;let r=t,i=Ku,s=!1;for(let[o,a]of n.entries()){let{index:u,items:c}=a;if(c.push(r),i=a(r,u,c),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(KR(l,e,n.slice(o+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function eG(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function tG(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in
|
|
727
|
-
t}function XR(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return Xe(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>Xe(i,r),r)}throw new Error("Wrong number of arguments")}function nG(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function ut(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return nG(t,e,n);throw new Error("Wrong number of arguments")}function yp(...t){return ut(Object.values,t)}function Xo(...t){
|
|
728
|
-
return XR(rG,t)}function rG(){let t=new Set;return e=>t.has(e)?Ku:(t.add(e),{done:!1,hasNext:!0,next:e})}function iG(...t){return ut(sG,t,oG)}var sG=(t,e)=>e<0?[]:t.slice(0,e);function oG(t){if(t<=0)return Qj;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function jr(...t){return ut(aG,t)}var aG=(t,e)=>t.length>=e,YR={asc:(t,e)=>t>e,desc:(t,e)=>t<e};function uG(t,e){let[n,...r]=e;if(!cG(n)){let s=Sy(...r);return t(n,s)}let i=Sy(n,...r);return s=>t(s,i)}function Sy(t,e,...n){let r=typeof t==
|
|
729
|
-
"function"?t:t[0],i=typeof t=="function"?"asc":t[1],{[i]:s}=YR,o=e===void 0?void 0:Sy(e,...n);return(a,u)=>{let c=r(a),l=r(u);return s(c,l)?1:s(l,c)?-1:o?.(a,u)??0}}function cG(t){if(JR(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;let[e,n,...r]=t;return JR(e)&&typeof n=="string"&&n in YR&&r.length===0}var JR=t=>typeof t=="function"&&t.length===1;function lG(...t){return ut(dG,t)}function dG(t,e){return e(t),t}function QR(...t){return ut(fG,t)}function fG(t,e){let n=[...t];return n.
|
|
730
|
-
sort(e),n}function pG(...t){return uG(hG,t)}var hG=(t,e)=>[...t].sort(e);function _y(...t){return ut(mG,t)}var mG=(t,e,n)=>t.reduce(e,n);function gG(...t){return ut(yG,t)}function yG(t){return[...t].reverse()}function ui(...t){return ut(vG,t)}var vG=(t,e)=>t[e];function Yo(...t){return ut(wG,t)}function wG(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function ce(t){return!!t}function Xu(...t){return ut(Object.keys,t)}function Yu(...t){return ut(bG,t)}var bG=t=>t.
|
|
731
|
-
at(-1);function xt(...t){return ut(EG,t,$G)}var EG=(t,e)=>t.map(e),$G=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function Gr(...t){return ut(DG,t)}function DG(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function vp(t){return typeof t=="number"&&!Number.isNaN(t)}function RG(t){return t instanceof Promise}function Py(t){return typeof t=="string"}function jt(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function fn(t){
|
|
732
|
-
return t!=null}function kG(t){return e=>!t(e)}function Tt(t){return t==null}function TG(t){return Array.isArray(t)}function xy(t){return typeof t=="boolean"}function an(t){return t!==void 0}function CG(t,{triggerAt:e="end",minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:s=AG}){let o,a,u,c,l=()=>{let p=u;p!==void 0&&(u=void 0,t(p),a=setTimeout(f,i))},f=()=>{clearTimeout(a),a=void 0,o===void 0&&l()},d=()=>{clearTimeout(o),o=void 0,c=void 0,a===void 0&&l()};return{call:(...p)=>{let h=o===
|
|
733
|
-
void 0&&a===void 0;if((e!=="start"||h)&&(u=s(u,...p)),!(o===void 0&&!h)){{clearTimeout(o);let v=Date.now();c??=v;let b=Math.min(n,r-(v-c));o=setTimeout(d,b)}e!=="end"&&h&&l()}},cancel:()=>{clearTimeout(o),o=void 0,c=void 0,clearTimeout(a),a=void 0,u=void 0},flush:()=>{d(),f()},get isIdle(){return o===void 0&&a===void 0}}}var AG=()=>"";function Jo(...t){return ut(SG,t)}var SG=(t,e)=>{let n=new Map;for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let o=n.get(s);o===void 0&&(o=[],n.set(s,o)),
|
|
734
|
-
o.push(i)}}return Object.fromEntries(n)};function _G(){return PG}var PG=t=>t;function Ju(...t){return ut(xG,t)}function xG(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function ci(...t){return ut(NG,t,IG)}var NG=(t,e)=>t.flatMap(e),IG=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 OG(...t){return ut(LG,t,FG)}function LG(t,e){return t.forEach(e),t}var FG=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,
|
|
735
|
-
next:e});function ZR(...t){return ut(MG,t)}function MG(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function BG(...t){return ut(Object.fromEntries,t)}function Qu(...t){return ut(Object.entries,t)}function He(...t){return ut(qG,t,jG)}var qG=(t,e)=>t.filter(e),jG=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:Ku,ek=t=>Object.assign(t,{single:!0});function tk(...t){return ut(GG,t,ek(UG))}var GG=(t,e)=>t.find(e),UG=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:Ku;function nk(...t){return ut(
|
|
736
|
-
WG,t)}var WG=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Qo(...t){return ut(zG,t,ek(HG))}var zG=([t])=>t,HG=()=>VG,VG=t=>({hasNext:!0,next:t,done:!0});function rk(...t){return ut(KG,t)}var KG=(t,e)=>[...t,...e];function XG(...t){return XR(YG,t)}function YG(t){if(t.length===0)return Zj;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),Ku)}}function JG(...t){return ut(
|
|
737
|
-
QG,t)}var QG=(t,e)=>e.some(n=>n(t));function ZG(...t){return ut(e3,t)}function e3(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 ik(...t){return ut(t3,t)}var t3=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,
|
|
738
|
-
n3={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,
|
|
739
|
-
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]},r3=Object.entries(n3);function Ny(t){return String(t)}Ny.open="",Ny.close="";function i3(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("--colo\
|
|
740
|
-
r")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function s3(t=!1){let e=i3(t),n=(o,a,u,c)=>{let l="",f=0;do l+=o.substring(f,c)+u,f=c+a.length,c=o.indexOf(a,f);while(~c);return l+o.substring(f)},r=(o,a,u=o)=>{let c=l=>{let f=String(l),d=f.indexOf(a,o.length);return~d?o+n(f,a,u,d)+a:o+f+a};return c.open=o,c.close=a,c},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of r3)i[o]=e?r(s(a[0]),s(a[1]),a[2]):Ny;return i}var o3=process.env.FORCE_TTY!==void 0||
|
|
741
|
-
d_(1),Gt=s3(o3),qs={},It={},sk;function Iy(){if(sk)return It;sk=1,Object.defineProperty(It,"__esModule",{value:!0}),It.thenable=It.typedArray=It.stringArray=It.array=It.func=It.error=It.number=It.string=It.boolean=void 0;function t(c){return c===!0||c===!1}It.boolean=t;function e(c){return typeof c=="string"||c instanceof String}It.string=e;function n(c){return typeof c=="number"||c instanceof Number}It.number=n;function r(c){return c instanceof Error}It.error=r;function i(c){return typeof c=="f\
|
|
742
|
-
unction"}It.func=i;function s(c){return Array.isArray(c)}It.array=s;function o(c){return s(c)&&c.every(l=>e(l))}It.stringArray=o;function a(c,l){return Array.isArray(c)&&c.every(l)}It.typedArray=a;function u(c){return c&&i(c.then)}return It.thenable=u,It}var Ze={},js={},Gs={},wp={},Oy={},Ee={},ok;function ak(){if(ok)return Ee;ok=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.Message=Ee.NotificationType9=Ee.NotificationType8=Ee.NotificationType7=Ee.NotificationType6=Ee.NotificationType5=Ee.
|
|
743
|
-
NotificationType4=Ee.NotificationType3=Ee.NotificationType2=Ee.NotificationType1=Ee.NotificationType0=Ee.NotificationType=Ee.RequestType9=Ee.RequestType8=Ee.RequestType7=Ee.RequestType6=Ee.RequestType5=Ee.RequestType4=Ee.RequestType3=Ee.RequestType2=Ee.RequestType1=Ee.RequestType=Ee.RequestType0=Ee.AbstractMessageSignature=Ee.ParameterStructures=Ee.ResponseError=Ee.ErrorCodes=void 0;const t=zu();var e;(function(T){T.ParseError=-32700,T.InvalidRequest=-32600,T.MethodNotFound=-32601,T.InvalidParams=
|
|
744
|
-
-32602,T.InternalError=-32603,T.jsonrpcReservedErrorRangeStart=-32099,T.serverErrorStart=-32099,T.MessageWriteError=-32099,T.MessageReadError=-32098,T.PendingResponseRejected=-32097,T.ConnectionInactive=-32096,T.ServerNotInitialized=-32002,T.UnknownErrorCode=-32001,T.jsonrpcReservedErrorRangeEnd=-32e3,T.serverErrorEnd=-32e3})(e||(Ee.ErrorCodes=e={}));class n extends Error{constructor(D,M,S){super(M),this.code=t.number(D)?D:e.UnknownErrorCode,this.data=S,Object.setPrototypeOf(this,n.prototype)}toJson(){
|
|
745
|
-
const D={code:this.code,message:this.message};return this.data!==void 0&&(D.data=this.data),D}}Ee.ResponseError=n;class r{constructor(D){this.kind=D}static is(D){return D===r.auto||D===r.byName||D===r.byPosition}toString(){return this.kind}}Ee.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(D,M){this.method=D,this.numberOfParams=M}get parameterStructures(){return r.auto}}Ee.AbstractMessageSignature=i;class s extends i{constructor(D){
|
|
746
|
-
super(D,0)}}Ee.RequestType0=s;class o extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.RequestType=o;class a extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.RequestType1=a;class u extends i{constructor(D){super(D,2)}}Ee.RequestType2=u;class c extends i{constructor(D){super(D,3)}}Ee.RequestType3=c;class l extends i{constructor(D){
|
|
747
|
-
super(D,4)}}Ee.RequestType4=l;class f extends i{constructor(D){super(D,5)}}Ee.RequestType5=f;class d extends i{constructor(D){super(D,6)}}Ee.RequestType6=d;class p extends i{constructor(D){super(D,7)}}Ee.RequestType7=p;class h extends i{constructor(D){super(D,8)}}Ee.RequestType8=h;class v extends i{constructor(D){super(D,9)}}Ee.RequestType9=v;class b extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.NotificationType=
|
|
748
|
-
b;class y extends i{constructor(D){super(D,0)}}Ee.NotificationType0=y;class E extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.NotificationType1=E;class R extends i{constructor(D){super(D,2)}}Ee.NotificationType2=R;class A extends i{constructor(D){super(D,3)}}Ee.NotificationType3=A;class N extends i{constructor(D){super(D,4)}}Ee.NotificationType4=N;class K extends i{constructor(D){super(D,5)}}Ee.NotificationType5=
|
|
749
|
-
K;class J extends i{constructor(D){super(D,6)}}Ee.NotificationType6=J;class se extends i{constructor(D){super(D,7)}}Ee.NotificationType7=se;class ie extends i{constructor(D){super(D,8)}}Ee.NotificationType8=ie;class we extends i{constructor(D){super(D,9)}}Ee.NotificationType9=we;var B;return function(T){function D(P){const O=P;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}T.isRequest=D;function M(P){const O=P;return O&&t.string(O.method)&&P.id===void 0}T.isNotification=M;function S(P){
|
|
750
|
-
const O=P;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}T.isResponse=S}(B||(Ee.Message=B={})),Ee}var li={},uk;function ck(){if(uk)return li;uk=1;var t;Object.defineProperty(li,"__esModule",{value:!0}),li.LRUCache=li.LinkedMap=li.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||(li.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=
|
|
751
|
-
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,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let u=this._map.get(s);if(u)u.value=o,a!==e.None&&this.touch(u,a);else{switch(u={key:s,value:o,next:void 0,previous:void 0},a){case e.
|
|
752
|
-
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 o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.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.
|
|
753
|
-
_size--,s.value}forEach(s,o){const a=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}values(){const s=this.
|
|
754
|
-
_state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,
|
|
755
|
-
done:!0}}};return a}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.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&&
|
|
756
|
-
!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 o=s.next,a=s.previous;if(!o||!a)throw new Error(
|
|
757
|
-
"Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(a.previous=u,u.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,u=s.previous;s===this._head?(a.previous=
|
|
758
|
-
void 0,this._head=a):(a.previous=u,u.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}li.LinkedMap=n;class r extends n{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),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.
|
|
759
|
-
min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return li.LRUCache=r,li}var Zu={},lk;function a3(){if(lk)return Zu;lk=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(Zu.Disposable=t={})),Zu}var Us={},
|
|
760
|
-
dk;function u3(){if(dk)return Us;dk=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.SharedArrayReceiverStrategy=Us.SharedArraySenderStrategy=void 0;const t=op();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=e.Continue,this.buffers.set(a.id,u),a.$cancellationData=u}async sendCancellation(a,u){const c=this.buffers.get(u);if(c===void 0)
|
|
761
|
-
return;const l=new Int32Array(c,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Us.SharedArraySenderStrategy=n;class r{constructor(a){this.data=new Int32Array(a,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(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){
|
|
762
|
-
this.kind="request"}createCancellationTokenSource(a){const u=a.$cancellationData;return u===void 0?new t.CancellationTokenSource:new i(u)}}return Us.SharedArrayReceiverStrategy=s,Us}var di={},ec={},fk;function pk(){if(fk)return ec;fk=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.Semaphore=void 0;const t=Os();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.
|
|
763
|
-
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()},
|
|
764
|
-
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 ec.Semaphore=e,ec}var hk;function c3(){if(hk)return di;hk=1,Object.defineProperty(di,"__esModule",{value:!0}),di.ReadableStreamMessageReader=di.AbstractMessageReader=di.MessageReader=void 0;const t=Os(),e=zu(),n=Ko(),r=pk();var i;(function(u){function c(l){let f=l;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&
|
|
765
|
-
e.func(f.onPartialMessage)}u.is=c})(i||(di.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.
|
|
766
|
-
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"}`)}}di.AbstractMessageReader=s;var o;(function(u){function c(l){let f,d;const p=new Map;let h;const v=new Map;if(l===void 0||typeof l=="string")f=l??"utf-8";else{if(f=l.charset??"utf-8",l.contentDecoder!==void 0&&(d=l.contentDecoder,p.set(d.name,d)),l.contentDecoders!==void 0)for(const b of l.contentDecoders)p.set(
|
|
767
|
-
b.name,b);if(l.contentTypeDecoder!==void 0&&(h=l.contentTypeDecoder,v.set(h.name,h)),l.contentTypeDecoders!==void 0)for(const b of l.contentTypeDecoders)v.set(b.name,b)}return h===void 0&&(h=(0,t.default)().applicationJson.decoder,v.set(h.name,h)),{charset:f,contentDecoder:d,contentDecoders:p,contentTypeDecoder:h,contentTypeDecoders:v}}u.fromOptions=c})(o||(o={}));class a extends s{constructor(c,l){super(),this.readable=c,this.options=o.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(
|
|
768
|
-
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(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),
|
|
769
|
-
l}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const d=f.get("content-length");if(!d){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
770
|
-
${JSON.stringify(Object.fromEntries(f))}`));return}const p=parseInt(d);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${d}`));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 f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,d=await this.options.
|
|
771
|
-
contentTypeDecoder.decode(f,this.options);this.callback(d)}).catch(f=>{this.fireError(f)})}}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}),
|
|
772
|
-
this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return di.ReadableStreamMessageReader=a,di}var fi={},mk;function l3(){if(mk)return fi;mk=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.WriteableStreamMessageWriter=fi.AbstractMessageWriter=fi.MessageWriter=void 0;const t=Os(),e=zu(),n=pk(),r=Ko(),i="Content-Length: ",s=`\r
|
|
773
|
-
`;var o;(function(l){function f(d){let p=d;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=f})(o||(fi.MessageWriter=o={}));class a{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(f,d,p){this.errorEmitter.fire([this.asError(f),d,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(
|
|
774
|
-
void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}fi.AbstractMessageWriter=a;var u;(function(l){function f(d){return d===void 0||typeof d=="string"?{charset:d??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:d.charset??"utf-8",contentEncoder:d.contentEncoder,contentTypeEncoder:d.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=f})(u||(u={}));class c extends a{constructor(f,d){
|
|
775
|
-
super(),this.writable=f,this.options=u.fromOptions(d),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,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(f,h,p)},p=>{throw this.
|
|
776
|
-
fireError(p),p}))}async doWrite(f,d,p){try{return await this.writable.write(d.join(""),"ascii"),this.writable.write(p)}catch(h){return this.handleError(h,f),Promise.reject(h)}}handleError(f,d){this.errorCount++,this.fireError(f,d,this.errorCount)}end(){this.writable.end()}}return fi.WriteableStreamMessageWriter=c,fi}var tc={},gk;function d3(){if(gk)return tc;gk=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
|
|
777
|
-
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,u=0,c=0;e:for(;a<this._chunks.length;){const p=this._chunks[a];for(u=0;u<p.length;){switch(p[u]){case t:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:
|
|
778
|
-
o=2;break;case 3:o=4,u++;break e;default:o=0}break;default:o=0}u++}c+=p.byteLength,a++}if(o!==4)return;const l=this._read(c+u),f=new Map,d=this.toString(l,"ascii").split(n);if(d.length<2)return f;for(let p=0;p<d.length-2;p++){const h=d[p],v=h.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
|
|
779
|
-
${h}`);const b=h.substr(0,v),y=h.substr(v+1).trim();f.set(s?b.toLowerCase():b,y)}return f}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(
|
|
780
|
-
c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,l}const o=this.allocNative(s);let a=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const l=c.slice(0,s);o.set(l,a),a+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else o.set(c,a),a+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return o}}return tc.AbstractMessageBuffer=r,tc}var Ly={},yk;function f3(){return yk||(yk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.
|
|
781
|
-
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=Os(),n=zu(),r=ak(),i=ck(),s=Ko(),o=op();var a;(function(D){D.type=new r.NotificationType(
|
|
782
|
-
"$/cancelRequest")})(a||(a={}));var u;(function(D){function M(S){return typeof S=="string"||typeof S=="number"}D.is=M})(u||(t.ProgressToken=u={}));var c;(function(D){D.type=new r.NotificationType("$/progress")})(c||(c={}));class l{constructor(){}}t.ProgressType=l;var f;(function(D){function M(S){return n.func(S)}D.is=M})(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var d;(function(D){D[D.Off=0]="Off",D[D.Messages=1]="Messages",D[D.Compact=2]="Compact",
|
|
783
|
-
D[D.Verbose=3]="Verbose"})(d||(t.Trace=d={}));var p;(function(D){D.Off="off",D.Messages="messages",D.Compact="compact",D.Verbose="verbose"})(p||(t.TraceValues=p={})),function(D){function M(P){if(!n.string(P))return D.Off;switch(P=P.toLowerCase(),P){case"off":return D.Off;case"messages":return D.Messages;case"compact":return D.Compact;case"verbose":return D.Verbose;default:return D.Off}}D.fromString=M;function S(P){switch(P){case D.Off:return"off";case D.Messages:return"messages";case D.Compact:return"\
|
|
784
|
-
compact";case D.Verbose:return"verbose";default:return"off"}}D.toString=S}(d||(t.Trace=d={}));var h;(function(D){D.Text="text",D.JSON="json"})(h||(t.TraceFormat=h={})),function(D){function M(S){return n.string(S)?(S=S.toLowerCase(),S==="json"?D.JSON:D.Text):D.Text}D.fromString=M}(h||(t.TraceFormat=h={}));var v;(function(D){D.type=new r.NotificationType("$/setTrace")})(v||(t.SetTraceNotification=v={}));var b;(function(D){D.type=new r.NotificationType("$/logTrace")})(b||(t.LogTraceNotification=b={}));
|
|
785
|
-
var y;(function(D){D[D.Closed=1]="Closed",D[D.Disposed=2]="Disposed",D[D.AlreadyListening=3]="AlreadyListening"})(y||(t.ConnectionErrors=y={}));class E extends Error{constructor(M,S){super(S),this.code=M,Object.setPrototypeOf(this,E.prototype)}}t.ConnectionError=E;var R;(function(D){function M(S){const P=S;return P&&n.func(P.cancelUndispatched)}D.is=M})(R||(t.ConnectionStrategy=R={}));var A;(function(D){function M(S){const P=S;return P&&(P.kind===void 0||P.kind==="id")&&n.func(P.createCancellationTokenSource)&&
|
|
786
|
-
(P.dispose===void 0||n.func(P.dispose))}D.is=M})(A||(t.IdCancellationReceiverStrategy=A={}));var N;(function(D){function M(S){const P=S;return P&&P.kind==="request"&&n.func(P.createCancellationTokenSource)&&(P.dispose===void 0||n.func(P.dispose))}D.is=M})(N||(t.RequestCancellationReceiverStrategy=N={}));var K;(function(D){D.Message=Object.freeze({createCancellationTokenSource(S){return new o.CancellationTokenSource}});function M(S){return A.is(S)||N.is(S)}D.is=M})(K||(t.CancellationReceiverStrategy=
|
|
787
|
-
K={}));var J;(function(D){D.Message=Object.freeze({sendCancellation(S,P){return S.sendNotification(a.type,{id:P})},cleanup(S){}});function M(S){const P=S;return P&&n.func(P.sendCancellation)&&n.func(P.cleanup)}D.is=M})(J||(t.CancellationSenderStrategy=J={}));var se;(function(D){D.Message=Object.freeze({receiver:K.Message,sender:J.Message});function M(S){const P=S;return P&&K.is(P.receiver)&&J.is(P.sender)}D.is=M})(se||(t.CancellationStrategy=se={}));var ie;(function(D){function M(S){const P=S;return P&&
|
|
788
|
-
n.func(P.handleMessage)}D.is=M})(ie||(t.MessageStrategy=ie={}));var we;(function(D){function M(S){const P=S;return P&&(se.is(P.cancellationStrategy)||R.is(P.connectionStrategy)||ie.is(P.messageStrategy))}D.is=M})(we||(t.ConnectionOptions=we={}));var B;(function(D){D[D.New=1]="New",D[D.Listening=2]="Listening",D[D.Closed=3]="Closed",D[D.Disposed=4]="Disposed"})(B||(B={}));function T(D,M,S,P){const O=S!==void 0?S:t.NullLogger;let Z=0,H=0,C=0;const ne="2.0";let ye;const Pe=new Map;let F;const V=new Map,
|
|
789
|
-
Se=new Map;let le,$e=new i.LinkedMap,xe=new Map,de=new Set,I=new Map,G=d.Off,pe=h.Text,U,fe=B.New;const Ke=new s.Emitter,it=new s.Emitter,ue=new s.Emitter,Oe=new s.Emitter,re=new s.Emitter,De=P&&P.cancellationStrategy?P.cancellationStrategy:se.Message;function Ge($){if($===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+$.toString()}function vt($){return $===null?"res-unknown-"+(++C).toString():"res-"+$.toString()}function et(){return"\
|
|
790
|
-
not-"+(++H).toString()}function Kt($,W){r.Message.isRequest(W)?$.set(Ge(W.id),W):r.Message.isResponse(W)?$.set(vt(W.id),W):$.set(et(),W)}function en($){}function gn(){return fe===B.Listening}function X(){return fe===B.Closed}function Y(){return fe===B.Disposed}function he(){(fe===B.New||fe===B.Listening)&&(fe=B.Closed,it.fire(void 0))}function tn($){Ke.fire([$,void 0,void 0])}function Xt($){Ke.fire($)}D.onClose(he),D.onError(tn),M.onClose(he),M.onError(Xt);function _r(){le||$e.size===0||(le=(0,e.
|
|
791
|
-
default)().timer.setImmediate(()=>{le=void 0,us()}))}function Pi($){r.Message.isRequest($)?ls($):r.Message.isNotification($)?xi($):r.Message.isResponse($)?ds($):Ni($)}function us(){if($e.size===0)return;const $=$e.shift();try{const W=P?.messageStrategy;ie.is(W)?W.handleMessage($,Pi):Pi($)}finally{_r()}}const cs=$=>{try{if(r.Message.isNotification($)&&$.method===a.type.method){const W=$.params.id,te=Ge(W),oe=$e.get(te);if(r.Message.isRequest(oe)){const Be=P?.connectionStrategy,tt=Be&&Be.cancelUndispatched?
|
|
792
|
-
Be.cancelUndispatched(oe,en):void 0;if(tt&&(tt.error!==void 0||tt.result!==void 0)){$e.delete(te),I.delete(W),tt.id=oe.id,Pr(tt,$.method,Date.now()),M.write(tt).catch(()=>O.error("Sending response for canceled message failed."));return}}const Ue=I.get(W);if(Ue!==void 0){Ue.cancel(),Vr($);return}else de.add(W)}Kt($e,$)}finally{_r()}};function ls($){if(Y())return;function W(Le,at,nt){const Ut={jsonrpc:ne,id:$.id};Le instanceof r.ResponseError?Ut.error=Le.toJson():Ut.result=Le===void 0?null:Le,Pr(Ut,
|
|
793
|
-
at,nt),M.write(Ut).catch(()=>O.error("Sending response failed."))}function te(Le,at,nt){const Ut={jsonrpc:ne,id:$.id,error:Le.toJson()};Pr(Ut,at,nt),M.write(Ut).catch(()=>O.error("Sending response failed."))}function oe(Le,at,nt){Le===void 0&&(Le=null);const Ut={jsonrpc:ne,id:$.id,result:Le};Pr(Ut,at,nt),M.write(Ut).catch(()=>O.error("Sending response failed."))}hs($);const Ue=Pe.get($.method);let Be,tt;Ue&&(Be=Ue.type,tt=Ue.handler);const be=Date.now();if(tt||ye){const Le=$.id??String(Date.now()),
|
|
794
|
-
at=A.is(De.receiver)?De.receiver.createCancellationTokenSource(Le):De.receiver.createCancellationTokenSource($);$.id!==null&&de.has($.id)&&at.cancel(),$.id!==null&&I.set(Le,at);try{let nt;if(tt)if($.params===void 0){if(Be!==void 0&&Be.numberOfParams!==0){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${$.method} defines ${Be.numberOfParams} params but received none.`),$.method,be);return}nt=tt(at.token)}else if(Array.isArray($.params)){if(Be!==void 0&&Be.parameterStructures===r.ParameterStructures.
|
|
795
|
-
byName){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${$.method} defines parameters by name but received parameters by position`),$.method,be);return}nt=tt(...$.params,at.token)}else{if(Be!==void 0&&Be.parameterStructures===r.ParameterStructures.byPosition){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${$.method} defines parameters by position but received parameters by name`),$.method,be);return}nt=tt($.params,at.token)}else ye&&(nt=ye($.method,$.params,at.token));const Ut=nt;
|
|
796
|
-
nt?Ut.then?Ut.then(yn=>{I.delete(Le),W(yn,$.method,be)},yn=>{I.delete(Le),yn instanceof r.ResponseError?te(yn,$.method,be):yn&&n.string(yn.message)?te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed with message: ${yn.message}`),$.method,be):te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed unexpectedly without providing any details.`),$.method,be)}):(I.delete(Le),W(nt,$.method,be)):(I.delete(Le),oe(nt,$.method,be))}catch(nt){I.delete(Le),nt instanceof
|
|
797
|
-
r.ResponseError?W(nt,$.method,be):nt&&n.string(nt.message)?te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed with message: ${nt.message}`),$.method,be):te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed unexpectedly without providing any details.`),$.method,be)}}else te(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${$.method}`),$.method,be)}function ds($){if(!Y())if($.id===null)$.error?O.error(`Received response message \
|
|
798
|
-
without id: Error is:
|
|
799
|
-
${JSON.stringify($.error,void 0,4)}`):O.error("Received response message without id. No further error information provided.");else{const W=$.id,te=xe.get(W);if(ms($,te),te!==void 0){xe.delete(W);try{if($.error){const oe=$.error;te.reject(new r.ResponseError(oe.code,oe.message,oe.data))}else if($.result!==void 0)te.resolve($.result);else throw new Error("Should never happen.")}catch(oe){oe.message?O.error(`Response handler '${te.method}' failed with message: ${oe.message}`):O.error(`Response hand\
|
|
800
|
-
ler '${te.method}' failed unexpectedly.`)}}}}function xi($){if(Y())return;let W,te;if($.method===a.type.method){const oe=$.params.id;de.delete(oe),Vr($);return}else{const oe=V.get($.method);oe&&(te=oe.handler,W=oe.type)}if(te||F)try{if(Vr($),te)if($.params===void 0)W!==void 0&&W.numberOfParams!==0&&W.parameterStructures!==r.ParameterStructures.byName&&O.error(`Notification ${$.method} defines ${W.numberOfParams} params but received none.`),te();else if(Array.isArray($.params)){const oe=$.params;
|
|
801
|
-
$.method===c.type.method&&oe.length===2&&u.is(oe[0])?te({token:oe[0],value:oe[1]}):(W!==void 0&&(W.parameterStructures===r.ParameterStructures.byName&&O.error(`Notification ${$.method} defines parameters by name but received parameters by position`),W.numberOfParams!==$.params.length&&O.error(`Notification ${$.method} defines ${W.numberOfParams} params but received ${oe.length} arguments`)),te(...oe))}else W!==void 0&&W.parameterStructures===r.ParameterStructures.byPosition&&O.error(`Notificatio\
|
|
802
|
-
n ${$.method} defines parameters by position but received parameters by name`),te($.params);else F&&F($.method,$.params)}catch(oe){oe.message?O.error(`Notification handler '${$.method}' failed with message: ${oe.message}`):O.error(`Notification handler '${$.method}' failed unexpectedly.`)}else ue.fire($)}function Ni($){if(!$){O.error("Received empty message.");return}O.error(`Received message which is neither a response nor a notification message:
|
|
803
|
-
${JSON.stringify($,null,4)}`);const W=$;if(n.string(W.id)||n.number(W.id)){const te=W.id,oe=xe.get(te);oe&&oe.reject(new Error("The received response has neither a result nor an error property."))}}function _n($){if($!=null)switch(G){case d.Verbose:return JSON.stringify($,null,4);case d.Compact:return JSON.stringify($);default:return}}function fs($){if(!(G===d.Off||!U))if(pe===h.Text){let W;(G===d.Verbose||G===d.Compact)&&$.params&&(W=`Params: ${_n($.params)}
|
|
804
|
-
|
|
805
|
-
`),U.log(`Sending request '${$.method} - (${$.id})'.`,W)}else Zn("send-request",$)}function ps($){if(!(G===d.Off||!U))if(pe===h.Text){let W;(G===d.Verbose||G===d.Compact)&&($.params?W=`Params: ${_n($.params)}
|
|
806
|
-
|
|
807
|
-
`:W=`No parameters provided.
|
|
808
|
-
|
|
809
|
-
`),U.log(`Sending notification '${$.method}'.`,W)}else Zn("send-notification",$)}function Pr($,W,te){if(!(G===d.Off||!U))if(pe===h.Text){let oe;(G===d.Verbose||G===d.Compact)&&($.error&&$.error.data?oe=`Error data: ${_n($.error.data)}
|
|
810
|
-
|
|
811
|
-
`:$.result?oe=`Result: ${_n($.result)}
|
|
812
|
-
|
|
813
|
-
`:$.error===void 0&&(oe=`No result returned.
|
|
814
|
-
|
|
815
|
-
`)),U.log(`Sending response '${W} - (${$.id})'. Processing request took ${Date.now()-te}ms`,oe)}else Zn("send-response",$)}function hs($){if(!(G===d.Off||!U))if(pe===h.Text){let W;(G===d.Verbose||G===d.Compact)&&$.params&&(W=`Params: ${_n($.params)}
|
|
816
|
-
|
|
817
|
-
`),U.log(`Received request '${$.method} - (${$.id})'.`,W)}else Zn("receive-request",$)}function Vr($){if(!(G===d.Off||!U||$.method===b.type.method))if(pe===h.Text){let W;(G===d.Verbose||G===d.Compact)&&($.params?W=`Params: ${_n($.params)}
|
|
818
|
-
|
|
819
|
-
`:W=`No parameters provided.
|
|
820
|
-
|
|
821
|
-
`),U.log(`Received notification '${$.method}'.`,W)}else Zn("receive-notification",$)}function ms($,W){if(!(G===d.Off||!U))if(pe===h.Text){let te;if((G===d.Verbose||G===d.Compact)&&($.error&&$.error.data?te=`Error data: ${_n($.error.data)}
|
|
822
|
-
|
|
823
|
-
`:$.result?te=`Result: ${_n($.result)}
|
|
824
|
-
|
|
825
|
-
`:$.error===void 0&&(te=`No result returned.
|
|
826
|
-
|
|
827
|
-
`)),W){const oe=$.error?` Request failed: ${$.error.message} (${$.error.code}).`:"";U.log(`Received response '${W.method} - (${$.id})' in ${Date.now()-W.timerStart}ms.${oe}`,te)}else U.log(`Received response ${$.id} without active response promise.`,te)}else Zn("receive-response",$)}function Zn($,W){if(!U||G===d.Off)return;const te={isLSPMessage:!0,type:$,message:W,timestamp:Date.now()};U.log(te)}function pr(){if(X())throw new E(y.Closed,"Connection is closed.");if(Y())throw new E(y.Disposed,"Co\
|
|
828
|
-
nnection is disposed.")}function Co(){if(gn())throw new E(y.AlreadyListening,"Connection is already listening")}function q(){if(!gn())throw new Error("Call listen() first.")}function w($){return $===void 0?null:$}function _($){if($!==null)return $}function m($){return $!=null&&!Array.isArray($)&&typeof $=="object"}function k($,W){switch($){case r.ParameterStructures.auto:return m(W)?_(W):[w(W)];case r.ParameterStructures.byName:if(!m(W))throw new Error("Received parameters by name but param is n\
|
|
829
|
-
ot an object literal.");return _(W);case r.ParameterStructures.byPosition:return[w(W)];default:throw new Error(`Unknown parameter structure ${$.toString()}`)}}function g($,W){let te;const oe=$.numberOfParams;switch(oe){case 0:te=void 0;break;case 1:te=k($.parameterStructures,W[0]);break;default:te=[];for(let Ue=0;Ue<W.length&&Ue<oe;Ue++)te.push(w(W[Ue]));if(W.length<oe)for(let Ue=W.length;Ue<oe;Ue++)te.push(null);break}return te}const x={sendNotification:($,...W)=>{pr();let te,oe;if(n.string($)){
|
|
830
|
-
te=$;const Be=W[0];let tt=0,be=r.ParameterStructures.auto;r.ParameterStructures.is(Be)&&(tt=1,be=Be);let Le=W.length;const at=Le-tt;switch(at){case 0:oe=void 0;break;case 1:oe=k(be,W[tt]);break;default:if(be===r.ParameterStructures.byName)throw new Error(`Received ${at} parameters for 'by Name' notification parameter structure.`);oe=W.slice(tt,Le).map(nt=>w(nt));break}}else{const Be=W;te=$.method,oe=g($,Be)}const Ue={jsonrpc:ne,method:te,params:oe};return ps(Ue),M.write(Ue).catch(Be=>{throw O.error(
|
|
831
|
-
"Sending notification failed."),Be})},onNotification:($,W)=>{pr();let te;return n.func($)?F=$:W&&(n.string($)?(te=$,V.set($,{type:void 0,handler:W})):(te=$.method,V.set($.method,{type:$,handler:W}))),{dispose:()=>{te!==void 0?V.delete(te):F=void 0}}},onProgress:($,W,te)=>{if(Se.has(W))throw new Error(`Progress handler for token ${W} already registered`);return Se.set(W,te),{dispose:()=>{Se.delete(W)}}},sendProgress:($,W,te)=>x.sendNotification(c.type,{token:W,value:te}),onUnhandledProgress:Oe.event,
|
|
832
|
-
sendRequest:($,...W)=>{pr(),q();let te,oe,Ue;if(n.string($)){te=$;const Le=W[0],at=W[W.length-1];let nt=0,Ut=r.ParameterStructures.auto;r.ParameterStructures.is(Le)&&(nt=1,Ut=Le);let yn=W.length;o.CancellationToken.is(at)&&(yn=yn-1,Ue=at);const xr=yn-nt;switch(xr){case 0:oe=void 0;break;case 1:oe=k(Ut,W[nt]);break;default:if(Ut===r.ParameterStructures.byName)throw new Error(`Received ${xr} parameters for 'by Name' request parameter structure.`);oe=W.slice(nt,yn).map(s_=>w(s_));break}}else{const Le=W;
|
|
833
|
-
te=$.method,oe=g($,Le);const at=$.numberOfParams;Ue=o.CancellationToken.is(Le[at])?Le[at]:void 0}const Be=Z++;let tt;Ue&&(tt=Ue.onCancellationRequested(()=>{const Le=De.sender.sendCancellation(x,Be);return Le===void 0?(O.log(`Received no promise from cancellation strategy when cancelling id ${Be}`),Promise.resolve()):Le.catch(()=>{O.log(`Sending cancellation messages for id ${Be} failed`)})}));const be={jsonrpc:ne,id:Be,method:te,params:oe};return fs(be),typeof De.sender.enableCancellation=="fun\
|
|
834
|
-
ction"&&De.sender.enableCancellation(be),new Promise(async(Le,at)=>{const nt=xr=>{Le(xr),De.sender.cleanup(Be),tt?.dispose()},Ut=xr=>{at(xr),De.sender.cleanup(Be),tt?.dispose()},yn={method:te,timerStart:Date.now(),resolve:nt,reject:Ut};try{await M.write(be),xe.set(Be,yn)}catch(xr){throw O.error("Sending request failed."),yn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,xr.message?xr.message:"Unknown reason")),xr}})},onRequest:($,W)=>{pr();let te=null;return f.is($)?(te=void 0,ye=$):n.
|
|
835
|
-
string($)?(te=null,W!==void 0&&(te=$,Pe.set($,{handler:W,type:void 0}))):W!==void 0&&(te=$.method,Pe.set($.method,{type:$,handler:W})),{dispose:()=>{te!==null&&(te!==void 0?Pe.delete(te):ye=void 0)}}},hasPendingResponse:()=>xe.size>0,trace:async($,W,te)=>{let oe=!1,Ue=h.Text;te!==void 0&&(n.boolean(te)?oe=te:(oe=te.sendNotification||!1,Ue=te.traceFormat||h.Text)),G=$,pe=Ue,G===d.Off?U=void 0:U=W,oe&&!X()&&!Y()&&await x.sendNotification(v.type,{value:d.toString($)})},onError:Ke.event,onClose:it.event,
|
|
836
|
-
onUnhandledNotification:ue.event,onDispose:re.event,end:()=>{M.end()},dispose:()=>{if(Y())return;fe=B.Disposed,re.fire(void 0);const $=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const W of xe.values())W.reject($);xe=new Map,I=new Map,de=new Set,$e=new i.LinkedMap,n.func(M.dispose)&&M.dispose(),n.func(D.dispose)&&D.dispose()},listen:()=>{pr(),Co(),fe=B.Listening,D.listen(cs)},inspect:()=>{(0,e.default)().console.log("ins\
|
|
837
|
-
pect")}};return x.onNotification(b.type,$=>{if(G===d.Off||!U)return;const W=G===d.Verbose||G===d.Compact;U.log($.message,W?$.verbose:void 0)}),x.onNotification(c.type,$=>{const W=Se.get($.token);W?W($.value):Oe.fire($)}),x}t.createMessageConnection=T}(Ly)),Ly}var vk;function Fy(){return vk||(vk=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=
|
|
838
|
-
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.
|
|
839
|
-
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=ak();Object.defineProperty(t,"Me\
|
|
840
|
-
ssage",{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(){
|
|
841
|
-
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.
|
|
842
|
-
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(
|
|
843
|
-
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.
|
|
844
|
-
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}});
|
|
845
|
-
const n=ck();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=a3();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ko();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,
|
|
846
|
-
get:function(){return i.Emitter}});const s=op();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=u3();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});
|
|
847
|
-
const a=c3();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const u=l3();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",
|
|
848
|
-
{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const c=d3();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const l=f3();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){
|
|
849
|
-
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}}),
|
|
850
|
-
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}}),
|
|
851
|
-
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",
|
|
852
|
-
{enumerable:!0,get:function(){return l.MessageStrategy}});const f=Os();t.RAL=f.default}(Oy)),Oy}var wk;function p3(){if(wk)return wp;wk=1,Object.defineProperty(wp,"__esModule",{value:!0});const t=h_,e=Fy();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.
|
|
853
|
-
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),
|
|
854
|
-
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,f)=>{const d=p=>{p==null?l():f(p)};typeof u=="string"?this.stream.write(u,c,d):this.stream.write(
|
|
855
|
-
u,d)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:a=>new n(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,u)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(a,void 0,0),u.charset))}catch(c){return Promise.reject(c)}}}),decoder:Object.freeze({name:"application/json",decode:(a,u)=>{try{return a instanceof Buffer?Promise.resolve(JSON.parse(a.toString(u.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(
|
|
856
|
-
u.charset).decode(a)))}catch(c){return Promise.reject(c)}}})}),stream:Object.freeze({asReadableStream:a=>new r(a),asWritableStream:a=>new i(a)}),console,timer:Object.freeze({setTimeout(a,u,...c){const l=setTimeout(a,u,...c);return{dispose:()=>clearTimeout(l)}},setImmediate(a,...u){const c=setImmediate(a,...u);return{dispose:()=>clearImmediate(c)}},setInterval(a,u,...c){const l=setInterval(a,u,...c);return{dispose:()=>clearInterval(l)}}})});function o(){return s}return function(a){function u(){e.
|
|
857
|
-
RAL.install(s)}a.install=u}(o||(o={})),wp.default=o,wp}var bk;function Ws(){return bk||(bk=1,function(t){var e=Gs&&Gs.__createBinding||(Object.create?function(B,T,D,M){M===void 0&&(M=D);var S=Object.getOwnPropertyDescriptor(T,D);(!S||("get"in S?!T.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return T[D]}}),Object.defineProperty(B,M,S)}:function(B,T,D,M){M===void 0&&(M=D),B[M]=T[D]}),n=Gs&&Gs.__exportStar||function(B,T){for(var D in B)D!=="default"&&!Object.prototype.
|
|
858
|
-
hasOwnProperty.call(T,D)&&e(T,B,D)};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=p3();r.default.install();const i=Oi,s=m_,o=g_,a=y_,u=Fy();n(Fy(),t);
|
|
859
|
-
class c extends u.AbstractMessageReader{constructor(T){super(),this.process=T;let D=this.process;D.on("error",M=>this.fireError(M)),D.on("close",()=>this.fireClose())}listen(T){return this.process.on("message",T),u.Disposable.create(()=>this.process.off("message",T))}}t.IPCMessageReader=c;class l extends u.AbstractMessageWriter{constructor(T){super(),this.process=T,this.errorCount=0;const D=this.process;D.on("error",M=>this.fireError(M)),D.on("close",()=>this.fireClose)}write(T){try{return typeof this.
|
|
860
|
-
process.send=="function"&&this.process.send(T,void 0,void 0,D=>{D?(this.errorCount++,this.handleError(D,T)):this.errorCount=0}),Promise.resolve()}catch(D){return this.handleError(D,T),Promise.reject(D)}}handleError(T,D){this.errorCount++,this.fireError(T,D,this.errorCount)}end(){}}t.IPCMessageWriter=l;class f extends u.AbstractMessageReader{constructor(T){super(),this.onData=new u.Emitter,T.on("close",()=>this.fireClose),T.on("error",D=>this.fireError(D)),T.on("message",D=>{this.onData.fire(D)})}listen(T){
|
|
861
|
-
return this.onData.event(T)}}t.PortMessageReader=f;class d extends u.AbstractMessageWriter{constructor(T){super(),this.port=T,this.errorCount=0,T.on("close",()=>this.fireClose()),T.on("error",D=>this.fireError(D))}write(T){try{return this.port.postMessage(T),Promise.resolve()}catch(D){return this.handleError(D,T),Promise.reject(D)}}handleError(T,D){this.errorCount++,this.fireError(T,D,this.errorCount)}end(){}}t.PortMessageWriter=d;class p extends u.ReadableStreamMessageReader{constructor(T,D="ut\
|
|
862
|
-
f-8"){super((0,r.default)().stream.asReadableStream(T),D)}}t.SocketMessageReader=p;class h extends u.WriteableStreamMessageWriter{constructor(T,D){super((0,r.default)().stream.asWritableStream(T),D),this.socket=T}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=h;class v extends u.ReadableStreamMessageReader{constructor(T,D){super((0,r.default)().stream.asReadableStream(T),D)}}t.StreamMessageReader=v;class b extends u.WriteableStreamMessageWriter{constructor(T,D){super((0,r.
|
|
863
|
-
default)().stream.asWritableStream(T),D)}}t.StreamMessageWriter=b;const y=process.env.XDG_RUNTIME_DIR,E=new Map([["linux",107],["darwin",103]]);function R(){const B=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${B}-sock`;let T;y?T=i.join(y,`vscode-ipc-${B}.sock`):T=i.join(s.tmpdir(),`vscode-${B}.sock`);const D=E.get(process.platform);return D!==void 0&&T.length>D&&(0,r.default)().console.warn(`WARNING: IPC handle "${T}" is longer than ${D}\
|
|
864
|
-
characters.`),T}t.generateRandomPipeName=R;function A(B,T="utf-8"){let D;const M=new Promise((S,P)=>{D=S});return new Promise((S,P)=>{let O=(0,a.createServer)(Z=>{O.close(),D([new p(Z,T),new h(Z,T)])});O.on("error",P),O.listen(B,()=>{O.removeListener("error",P),S({onConnected:()=>M})})})}t.createClientPipeTransport=A;function N(B,T="utf-8"){const D=(0,a.createConnection)(B);return[new p(D,T),new h(D,T)]}t.createServerPipeTransport=N;function K(B,T="utf-8"){let D;const M=new Promise((S,P)=>{D=S});
|
|
865
|
-
return new Promise((S,P)=>{const O=(0,a.createServer)(Z=>{O.close(),D([new p(Z,T),new h(Z,T)])});O.on("error",P),O.listen(B,"127.0.0.1",()=>{O.removeListener("error",P),S({onConnected:()=>M})})})}t.createClientSocketTransport=K;function J(B,T="utf-8"){const D=(0,a.createConnection)(B,"127.0.0.1");return[new p(D,T),new h(D,T)]}t.createServerSocketTransport=J;function se(B){const T=B;return T.read!==void 0&&T.addListener!==void 0}function ie(B){const T=B;return T.write!==void 0&&T.addListener!==void 0}
|
|
866
|
-
function we(B,T,D,M){D||(D=u.NullLogger);const S=se(B)?new v(B):B,P=ie(T)?new b(T):T;return u.ConnectionStrategy.is(M)&&(M={connectionStrategy:M}),(0,u.createMessageConnection)(S,P,D,M)}t.createMessageConnection=we}(Gs)),Gs}var My,Ek;function $k(){return Ek||(Ek=1,My=Ws()),My}var zs={},bp={exports:{}},Dk;function By(){return Dk||(Dk=1,function(t,e){(function(n){{var r=n(k0,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=
|
|
867
|
-
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=
|
|
868
|
-
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=
|
|
869
|
-
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(w){function _(m){return typeof m=="string"}w.is=
|
|
870
|
-
_})(i||(r.DocumentUri=i={}));var s;(function(w){function _(m){return typeof m=="string"}w.is=_})(s||(r.URI=s={}));var o;(function(w){w.MIN_VALUE=-2147483648,w.MAX_VALUE=2147483647;function _(m){return typeof m=="number"&&w.MIN_VALUE<=m&&m<=w.MAX_VALUE}w.is=_})(o||(r.integer=o={}));var a;(function(w){w.MIN_VALUE=0,w.MAX_VALUE=2147483647;function _(m){return typeof m=="number"&&w.MIN_VALUE<=m&&m<=w.MAX_VALUE}w.is=_})(a||(r.uinteger=a={}));var u;(function(w){function _(k,g){return k===Number.MAX_VALUE&&
|
|
871
|
-
(k=a.MAX_VALUE),g===Number.MAX_VALUE&&(g=a.MAX_VALUE),{line:k,character:g}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&q.uinteger(g.line)&&q.uinteger(g.character)}w.is=m})(u||(r.Position=u={}));var c;(function(w){function _(k,g,x,$){if(q.uinteger(k)&&q.uinteger(g)&&q.uinteger(x)&&q.uinteger($))return{start:u.create(k,g),end:u.create(x,$)};if(u.is(k)&&u.is(g))return{start:k,end:g};throw new Error("Range#create called with invalid arguments[".concat(k,", ").concat(g,", ").concat(x,
|
|
872
|
-
", ").concat($,"]"))}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&u.is(g.start)&&u.is(g.end)}w.is=m})(c||(r.Range=c={}));var l;(function(w){function _(k,g){return{uri:k,range:g}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&c.is(g.range)&&(q.string(g.uri)||q.undefined(g.uri))}w.is=m})(l||(r.Location=l={}));var f;(function(w){function _(k,g,x,$){return{targetUri:k,targetRange:g,targetSelectionRange:x,originSelectionRange:$}}w.create=_;function m(k){var g=k;return q.objectLiteral(
|
|
873
|
-
g)&&c.is(g.targetRange)&&q.string(g.targetUri)&&c.is(g.targetSelectionRange)&&(c.is(g.originSelectionRange)||q.undefined(g.originSelectionRange))}w.is=m})(f||(r.LocationLink=f={}));var d;(function(w){function _(k,g,x,$){return{red:k,green:g,blue:x,alpha:$}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&q.numberRange(g.red,0,1)&&q.numberRange(g.green,0,1)&&q.numberRange(g.blue,0,1)&&q.numberRange(g.alpha,0,1)}w.is=m})(d||(r.Color=d={}));var p;(function(w){function _(k,g){return{range:k,
|
|
874
|
-
color:g}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&c.is(g.range)&&d.is(g.color)}w.is=m})(p||(r.ColorInformation=p={}));var h;(function(w){function _(k,g,x){return{label:k,textEdit:g,additionalTextEdits:x}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&q.string(g.label)&&(q.undefined(g.textEdit)||J.is(g))&&(q.undefined(g.additionalTextEdits)||q.typedArray(g.additionalTextEdits,J.is))}w.is=m})(h||(r.ColorPresentation=h={}));var v;(function(w){w.Comment="comment",w.Imports=
|
|
875
|
-
"imports",w.Region="region"})(v||(r.FoldingRangeKind=v={}));var b;(function(w){function _(k,g,x,$,W,te){var oe={startLine:k,endLine:g};return q.defined(x)&&(oe.startCharacter=x),q.defined($)&&(oe.endCharacter=$),q.defined(W)&&(oe.kind=W),q.defined(te)&&(oe.collapsedText=te),oe}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&q.uinteger(g.startLine)&&q.uinteger(g.startLine)&&(q.undefined(g.startCharacter)||q.uinteger(g.startCharacter))&&(q.undefined(g.endCharacter)||q.uinteger(g.endCharacter))&&
|
|
876
|
-
(q.undefined(g.kind)||q.string(g.kind))}w.is=m})(b||(r.FoldingRange=b={}));var y;(function(w){function _(k,g){return{location:k,message:g}}w.create=_;function m(k){var g=k;return q.defined(g)&&l.is(g.location)&&q.string(g.message)}w.is=m})(y||(r.DiagnosticRelatedInformation=y={}));var E;(function(w){w.Error=1,w.Warning=2,w.Information=3,w.Hint=4})(E||(r.DiagnosticSeverity=E={}));var R;(function(w){w.Unnecessary=1,w.Deprecated=2})(R||(r.DiagnosticTag=R={}));var A;(function(w){function _(m){var k=m;
|
|
877
|
-
return q.objectLiteral(k)&&q.string(k.href)}w.is=_})(A||(r.CodeDescription=A={}));var N;(function(w){function _(k,g,x,$,W,te){var oe={range:k,message:g};return q.defined(x)&&(oe.severity=x),q.defined($)&&(oe.code=$),q.defined(W)&&(oe.source=W),q.defined(te)&&(oe.relatedInformation=te),oe}w.create=_;function m(k){var g,x=k;return q.defined(x)&&c.is(x.range)&&q.string(x.message)&&(q.number(x.severity)||q.undefined(x.severity))&&(q.integer(x.code)||q.string(x.code)||q.undefined(x.code))&&(q.undefined(
|
|
878
|
-
x.codeDescription)||q.string((g=x.codeDescription)===null||g===void 0?void 0:g.href))&&(q.string(x.source)||q.undefined(x.source))&&(q.undefined(x.relatedInformation)||q.typedArray(x.relatedInformation,y.is))}w.is=m})(N||(r.Diagnostic=N={}));var K;(function(w){function _(k,g){for(var x=[],$=2;$<arguments.length;$++)x[$-2]=arguments[$];var W={title:k,command:g};return q.defined(x)&&x.length>0&&(W.arguments=x),W}w.create=_;function m(k){var g=k;return q.defined(g)&&q.string(g.title)&&q.string(g.command)}
|
|
879
|
-
w.is=m})(K||(r.Command=K={}));var J;(function(w){function _(x,$){return{range:x,newText:$}}w.replace=_;function m(x,$){return{range:{start:x,end:x},newText:$}}w.insert=m;function k(x){return{range:x,newText:""}}w.del=k;function g(x){var $=x;return q.objectLiteral($)&&q.string($.newText)&&c.is($.range)}w.is=g})(J||(r.TextEdit=J={}));var se;(function(w){function _(k,g,x){var $={label:k};return g!==void 0&&($.needsConfirmation=g),x!==void 0&&($.description=x),$}w.create=_;function m(k){var g=k;return q.
|
|
880
|
-
objectLiteral(g)&&q.string(g.label)&&(q.boolean(g.needsConfirmation)||g.needsConfirmation===void 0)&&(q.string(g.description)||g.description===void 0)}w.is=m})(se||(r.ChangeAnnotation=se={}));var ie;(function(w){function _(m){var k=m;return q.string(k)}w.is=_})(ie||(r.ChangeAnnotationIdentifier=ie={}));var we;(function(w){function _(x,$,W){return{range:x,newText:$,annotationId:W}}w.replace=_;function m(x,$,W){return{range:{start:x,end:x},newText:$,annotationId:W}}w.insert=m;function k(x,$){return{
|
|
881
|
-
range:x,newText:"",annotationId:$}}w.del=k;function g(x){var $=x;return J.is($)&&(se.is($.annotationId)||ie.is($.annotationId))}w.is=g})(we||(r.AnnotatedTextEdit=we={}));var B;(function(w){function _(k,g){return{textDocument:k,edits:g}}w.create=_;function m(k){var g=k;return q.defined(g)&&ne.is(g.textDocument)&&Array.isArray(g.edits)}w.is=m})(B||(r.TextDocumentEdit=B={}));var T;(function(w){function _(k,g,x){var $={kind:"create",uri:k};return g!==void 0&&(g.overwrite!==void 0||g.ignoreIfExists!==
|
|
882
|
-
void 0)&&($.options=g),x!==void 0&&($.annotationId=x),$}w.create=_;function m(k){var g=k;return g&&g.kind==="create"&&q.string(g.uri)&&(g.options===void 0||(g.options.overwrite===void 0||q.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||q.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||ie.is(g.annotationId))}w.is=m})(T||(r.CreateFile=T={}));var D;(function(w){function _(k,g,x,$){var W={kind:"rename",oldUri:k,newUri:g};return x!==void 0&&(x.overwrite!==void 0||x.
|
|
883
|
-
ignoreIfExists!==void 0)&&(W.options=x),$!==void 0&&(W.annotationId=$),W}w.create=_;function m(k){var g=k;return g&&g.kind==="rename"&&q.string(g.oldUri)&&q.string(g.newUri)&&(g.options===void 0||(g.options.overwrite===void 0||q.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||q.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||ie.is(g.annotationId))}w.is=m})(D||(r.RenameFile=D={}));var M;(function(w){function _(k,g,x){var $={kind:"delete",uri:k};return g!==void 0&&
|
|
884
|
-
(g.recursive!==void 0||g.ignoreIfNotExists!==void 0)&&($.options=g),x!==void 0&&($.annotationId=x),$}w.create=_;function m(k){var g=k;return g&&g.kind==="delete"&&q.string(g.uri)&&(g.options===void 0||(g.options.recursive===void 0||q.boolean(g.options.recursive))&&(g.options.ignoreIfNotExists===void 0||q.boolean(g.options.ignoreIfNotExists)))&&(g.annotationId===void 0||ie.is(g.annotationId))}w.is=m})(M||(r.DeleteFile=M={}));var S;(function(w){function _(m){var k=m;return k&&(k.changes!==void 0||
|
|
885
|
-
k.documentChanges!==void 0)&&(k.documentChanges===void 0||k.documentChanges.every(function(g){return q.string(g.kind)?T.is(g)||D.is(g)||M.is(g):B.is(g)}))}w.is=_})(S||(r.WorkspaceEdit=S={}));var P=function(){function w(_,m){this.edits=_,this.changeAnnotations=m}return w.prototype.insert=function(_,m,k){var g,x;if(k===void 0?g=J.insert(_,m):ie.is(k)?(x=k,g=we.insert(_,m,k)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(k),g=we.insert(_,m,x)),this.edits.push(
|
|
886
|
-
g),x!==void 0)return x},w.prototype.replace=function(_,m,k){var g,x;if(k===void 0?g=J.replace(_,m):ie.is(k)?(x=k,g=we.replace(_,m,k)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(k),g=we.replace(_,m,x)),this.edits.push(g),x!==void 0)return x},w.prototype.delete=function(_,m){var k,g;if(m===void 0?k=J.del(_):ie.is(m)?(g=m,k=we.del(_,m)):(this.assertChangeAnnotations(this.changeAnnotations),g=this.changeAnnotations.manage(m),k=we.del(_,g)),this.edits.push(k),
|
|
887
|
-
g!==void 0)return g},w.prototype.add=function(_){this.edits.push(_)},w.prototype.all=function(){return this.edits},w.prototype.clear=function(){this.edits.splice(0,this.edits.length)},w.prototype.assertChangeAnnotations=function(_){if(_===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},w}(),O=function(){function w(_){this._annotations=_===void 0?Object.create(null):_,this._counter=0,this._size=0}return w.prototype.all=function(){return this._annotations},
|
|
888
|
-
Object.defineProperty(w.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),w.prototype.manage=function(_,m){var k;if(ie.is(_)?k=_:(k=this.nextId(),m=_),this._annotations[k]!==void 0)throw new Error("Id ".concat(k," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(k));return this._annotations[k]=m,this._size++,k},w.prototype.nextId=function(){return this._counter++,this._counter.toString()},w}(),Z=function(){function w(_){
|
|
889
|
-
var m=this;this._textEditChanges=Object.create(null),_!==void 0?(this._workspaceEdit=_,_.documentChanges?(this._changeAnnotations=new O(_.changeAnnotations),_.changeAnnotations=this._changeAnnotations.all(),_.documentChanges.forEach(function(k){if(B.is(k)){var g=new P(k.edits,m._changeAnnotations);m._textEditChanges[k.textDocument.uri]=g}})):_.changes&&Object.keys(_.changes).forEach(function(k){var g=new P(_.changes[k]);m._textEditChanges[k]=g})):this._workspaceEdit={}}return Object.defineProperty(
|
|
890
|
-
w.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}),w.prototype.getTextEditChange=function(_){if(ne.is(_)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document cha\
|
|
891
|
-
nges.");var m={uri:_.uri,version:_.version},k=this._textEditChanges[m.uri];if(!k){var g=[],x={textDocument:m,edits:g};this._workspaceEdit.documentChanges.push(x),k=new P(g,this._changeAnnotations),this._textEditChanges[m.uri]=k}return k}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var k=this._textEditChanges[_];if(!k){var g=[];this._workspaceEdit.changes[_]=g,k=new P(g),this._textEditChanges[_]=k}
|
|
892
|
-
return k}},w.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},w.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},w.prototype.createFile=function(_,m,k){if(this.initDocumentChanges(),
|
|
893
|
-
this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;se.is(m)||ie.is(m)?g=m:k=m;var x,$;if(g===void 0?x=T.create(_,k):($=ie.is(g)?g:this._changeAnnotations.manage(g),x=T.create(_,k,$)),this._workspaceEdit.documentChanges.push(x),$!==void 0)return $},w.prototype.renameFile=function(_,m,k,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document\
|
|
894
|
-
changes.");var x;se.is(k)||ie.is(k)?x=k:g=k;var $,W;if(x===void 0?$=D.create(_,m,g):(W=ie.is(x)?x:this._changeAnnotations.manage(x),$=D.create(_,m,g,W)),this._workspaceEdit.documentChanges.push($),W!==void 0)return W},w.prototype.deleteFile=function(_,m,k){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;se.is(m)||ie.is(m)?g=m:k=m;var x,$;if(g===void 0?x=M.create(_,k):($=ie.is(g)?g:this._changeAnnotations.
|
|
895
|
-
manage(g),x=M.create(_,k,$)),this._workspaceEdit.documentChanges.push(x),$!==void 0)return $},w}();r.WorkspaceChange=Z;var H;(function(w){function _(k){return{uri:k}}w.create=_;function m(k){var g=k;return q.defined(g)&&q.string(g.uri)}w.is=m})(H||(r.TextDocumentIdentifier=H={}));var C;(function(w){function _(k,g){return{uri:k,version:g}}w.create=_;function m(k){var g=k;return q.defined(g)&&q.string(g.uri)&&q.integer(g.version)}w.is=m})(C||(r.VersionedTextDocumentIdentifier=C={}));var ne;(function(w){
|
|
896
|
-
function _(k,g){return{uri:k,version:g}}w.create=_;function m(k){var g=k;return q.defined(g)&&q.string(g.uri)&&(g.version===null||q.integer(g.version))}w.is=m})(ne||(r.OptionalVersionedTextDocumentIdentifier=ne={}));var ye;(function(w){function _(k,g,x,$){return{uri:k,languageId:g,version:x,text:$}}w.create=_;function m(k){var g=k;return q.defined(g)&&q.string(g.uri)&&q.string(g.languageId)&&q.integer(g.version)&&q.string(g.text)}w.is=m})(ye||(r.TextDocumentItem=ye={}));var Pe;(function(w){w.PlainText=
|
|
897
|
-
"plaintext",w.Markdown="markdown";function _(m){var k=m;return k===w.PlainText||k===w.Markdown}w.is=_})(Pe||(r.MarkupKind=Pe={}));var F;(function(w){function _(m){var k=m;return q.objectLiteral(m)&&Pe.is(k.kind)&&q.string(k.value)}w.is=_})(F||(r.MarkupContent=F={}));var V;(function(w){w.Text=1,w.Method=2,w.Function=3,w.Constructor=4,w.Field=5,w.Variable=6,w.Class=7,w.Interface=8,w.Module=9,w.Property=10,w.Unit=11,w.Value=12,w.Enum=13,w.Keyword=14,w.Snippet=15,w.Color=16,w.File=17,w.Reference=18,
|
|
898
|
-
w.Folder=19,w.EnumMember=20,w.Constant=21,w.Struct=22,w.Event=23,w.Operator=24,w.TypeParameter=25})(V||(r.CompletionItemKind=V={}));var Se;(function(w){w.PlainText=1,w.Snippet=2})(Se||(r.InsertTextFormat=Se={}));var le;(function(w){w.Deprecated=1})(le||(r.CompletionItemTag=le={}));var $e;(function(w){function _(k,g,x){return{newText:k,insert:g,replace:x}}w.create=_;function m(k){var g=k;return g&&q.string(g.newText)&&c.is(g.insert)&&c.is(g.replace)}w.is=m})($e||(r.InsertReplaceEdit=$e={}));var xe;
|
|
899
|
-
(function(w){w.asIs=1,w.adjustIndentation=2})(xe||(r.InsertTextMode=xe={}));var de;(function(w){function _(m){var k=m;return k&&(q.string(k.detail)||k.detail===void 0)&&(q.string(k.description)||k.description===void 0)}w.is=_})(de||(r.CompletionItemLabelDetails=de={}));var I;(function(w){function _(m){return{label:m}}w.create=_})(I||(r.CompletionItem=I={}));var G;(function(w){function _(m,k){return{items:m||[],isIncomplete:!!k}}w.create=_})(G||(r.CompletionList=G={}));var pe;(function(w){function _(k){
|
|
900
|
-
return k.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}w.fromPlainText=_;function m(k){var g=k;return q.string(g)||q.objectLiteral(g)&&q.string(g.language)&&q.string(g.value)}w.is=m})(pe||(r.MarkedString=pe={}));var U;(function(w){function _(m){var k=m;return!!k&&q.objectLiteral(k)&&(F.is(k.contents)||pe.is(k.contents)||q.typedArray(k.contents,pe.is))&&(m.range===void 0||c.is(m.range))}w.is=_})(U||(r.Hover=U={}));var fe;(function(w){function _(m,k){return k?{label:m,documentation:k}:{label:m}}w.create=
|
|
901
|
-
_})(fe||(r.ParameterInformation=fe={}));var Ke;(function(w){function _(m,k){for(var g=[],x=2;x<arguments.length;x++)g[x-2]=arguments[x];var $={label:m};return q.defined(k)&&($.documentation=k),q.defined(g)?$.parameters=g:$.parameters=[],$}w.create=_})(Ke||(r.SignatureInformation=Ke={}));var it;(function(w){w.Text=1,w.Read=2,w.Write=3})(it||(r.DocumentHighlightKind=it={}));var ue;(function(w){function _(m,k){var g={range:m};return q.number(k)&&(g.kind=k),g}w.create=_})(ue||(r.DocumentHighlight=ue=
|
|
902
|
-
{}));var Oe;(function(w){w.File=1,w.Module=2,w.Namespace=3,w.Package=4,w.Class=5,w.Method=6,w.Property=7,w.Field=8,w.Constructor=9,w.Enum=10,w.Interface=11,w.Function=12,w.Variable=13,w.Constant=14,w.String=15,w.Number=16,w.Boolean=17,w.Array=18,w.Object=19,w.Key=20,w.Null=21,w.EnumMember=22,w.Struct=23,w.Event=24,w.Operator=25,w.TypeParameter=26})(Oe||(r.SymbolKind=Oe={}));var re;(function(w){w.Deprecated=1})(re||(r.SymbolTag=re={}));var De;(function(w){function _(m,k,g,x,$){var W={name:m,kind:k,
|
|
903
|
-
location:{uri:x,range:g}};return $&&(W.containerName=$),W}w.create=_})(De||(r.SymbolInformation=De={}));var Ge;(function(w){function _(m,k,g,x){return x!==void 0?{name:m,kind:k,location:{uri:g,range:x}}:{name:m,kind:k,location:{uri:g}}}w.create=_})(Ge||(r.WorkspaceSymbol=Ge={}));var vt;(function(w){function _(k,g,x,$,W,te){var oe={name:k,detail:g,kind:x,range:$,selectionRange:W};return te!==void 0&&(oe.children=te),oe}w.create=_;function m(k){var g=k;return g&&q.string(g.name)&&q.number(g.kind)&&
|
|
904
|
-
c.is(g.range)&&c.is(g.selectionRange)&&(g.detail===void 0||q.string(g.detail))&&(g.deprecated===void 0||q.boolean(g.deprecated))&&(g.children===void 0||Array.isArray(g.children))&&(g.tags===void 0||Array.isArray(g.tags))}w.is=m})(vt||(r.DocumentSymbol=vt={}));var et;(function(w){w.Empty="",w.QuickFix="quickfix",w.Refactor="refactor",w.RefactorExtract="refactor.extract",w.RefactorInline="refactor.inline",w.RefactorRewrite="refactor.rewrite",w.Source="source",w.SourceOrganizeImports="source.organi\
|
|
905
|
-
zeImports",w.SourceFixAll="source.fixAll"})(et||(r.CodeActionKind=et={}));var Kt;(function(w){w.Invoked=1,w.Automatic=2})(Kt||(r.CodeActionTriggerKind=Kt={}));var en;(function(w){function _(k,g,x){var $={diagnostics:k};return g!=null&&($.only=g),x!=null&&($.triggerKind=x),$}w.create=_;function m(k){var g=k;return q.defined(g)&&q.typedArray(g.diagnostics,N.is)&&(g.only===void 0||q.typedArray(g.only,q.string))&&(g.triggerKind===void 0||g.triggerKind===Kt.Invoked||g.triggerKind===Kt.Automatic)}w.is=
|
|
906
|
-
m})(en||(r.CodeActionContext=en={}));var gn;(function(w){function _(k,g,x){var $={title:k},W=!0;return typeof g=="string"?(W=!1,$.kind=g):K.is(g)?$.command=g:$.edit=g,W&&x!==void 0&&($.kind=x),$}w.create=_;function m(k){var g=k;return g&&q.string(g.title)&&(g.diagnostics===void 0||q.typedArray(g.diagnostics,N.is))&&(g.kind===void 0||q.string(g.kind))&&(g.edit!==void 0||g.command!==void 0)&&(g.command===void 0||K.is(g.command))&&(g.isPreferred===void 0||q.boolean(g.isPreferred))&&(g.edit===void 0||
|
|
907
|
-
S.is(g.edit))}w.is=m})(gn||(r.CodeAction=gn={}));var X;(function(w){function _(k,g){var x={range:k};return q.defined(g)&&(x.data=g),x}w.create=_;function m(k){var g=k;return q.defined(g)&&c.is(g.range)&&(q.undefined(g.command)||K.is(g.command))}w.is=m})(X||(r.CodeLens=X={}));var Y;(function(w){function _(k,g){return{tabSize:k,insertSpaces:g}}w.create=_;function m(k){var g=k;return q.defined(g)&&q.uinteger(g.tabSize)&&q.boolean(g.insertSpaces)}w.is=m})(Y||(r.FormattingOptions=Y={}));var he;(function(w){
|
|
908
|
-
function _(k,g,x){return{range:k,target:g,data:x}}w.create=_;function m(k){var g=k;return q.defined(g)&&c.is(g.range)&&(q.undefined(g.target)||q.string(g.target))}w.is=m})(he||(r.DocumentLink=he={}));var tn;(function(w){function _(k,g){return{range:k,parent:g}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&c.is(g.range)&&(g.parent===void 0||w.is(g.parent))}w.is=m})(tn||(r.SelectionRange=tn={}));var Xt;(function(w){w.namespace="namespace",w.type="type",w.class="class",w.enum="enum",w.
|
|
909
|
-
interface="interface",w.struct="struct",w.typeParameter="typeParameter",w.parameter="parameter",w.variable="variable",w.property="property",w.enumMember="enumMember",w.event="event",w.function="function",w.method="method",w.macro="macro",w.keyword="keyword",w.modifier="modifier",w.comment="comment",w.string="string",w.number="number",w.regexp="regexp",w.operator="operator",w.decorator="decorator"})(Xt||(r.SemanticTokenTypes=Xt={}));var _r;(function(w){w.declaration="declaration",w.definition="de\
|
|
910
|
-
finition",w.readonly="readonly",w.static="static",w.deprecated="deprecated",w.abstract="abstract",w.async="async",w.modification="modification",w.documentation="documentation",w.defaultLibrary="defaultLibrary"})(_r||(r.SemanticTokenModifiers=_r={}));var Pi;(function(w){function _(m){var k=m;return q.objectLiteral(k)&&(k.resultId===void 0||typeof k.resultId=="string")&&Array.isArray(k.data)&&(k.data.length===0||typeof k.data[0]=="number")}w.is=_})(Pi||(r.SemanticTokens=Pi={}));var us;(function(w){
|
|
911
|
-
function _(k,g){return{range:k,text:g}}w.create=_;function m(k){var g=k;return g!=null&&c.is(g.range)&&q.string(g.text)}w.is=m})(us||(r.InlineValueText=us={}));var cs;(function(w){function _(k,g,x){return{range:k,variableName:g,caseSensitiveLookup:x}}w.create=_;function m(k){var g=k;return g!=null&&c.is(g.range)&&q.boolean(g.caseSensitiveLookup)&&(q.string(g.variableName)||g.variableName===void 0)}w.is=m})(cs||(r.InlineValueVariableLookup=cs={}));var ls;(function(w){function _(k,g){return{range:k,
|
|
912
|
-
expression:g}}w.create=_;function m(k){var g=k;return g!=null&&c.is(g.range)&&(q.string(g.expression)||g.expression===void 0)}w.is=m})(ls||(r.InlineValueEvaluatableExpression=ls={}));var ds;(function(w){function _(k,g){return{frameId:k,stoppedLocation:g}}w.create=_;function m(k){var g=k;return q.defined(g)&&c.is(k.stoppedLocation)}w.is=m})(ds||(r.InlineValueContext=ds={}));var xi;(function(w){w.Type=1,w.Parameter=2;function _(m){return m===1||m===2}w.is=_})(xi||(r.InlayHintKind=xi={}));var Ni;(function(w){
|
|
913
|
-
function _(k){return{value:k}}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&(g.tooltip===void 0||q.string(g.tooltip)||F.is(g.tooltip))&&(g.location===void 0||l.is(g.location))&&(g.command===void 0||K.is(g.command))}w.is=m})(Ni||(r.InlayHintLabelPart=Ni={}));var _n;(function(w){function _(k,g,x){var $={position:k,label:g};return x!==void 0&&($.kind=x),$}w.create=_;function m(k){var g=k;return q.objectLiteral(g)&&u.is(g.position)&&(q.string(g.label)||q.typedArray(g.label,Ni.is))&&(g.
|
|
914
|
-
kind===void 0||xi.is(g.kind))&&g.textEdits===void 0||q.typedArray(g.textEdits,J.is)&&(g.tooltip===void 0||q.string(g.tooltip)||F.is(g.tooltip))&&(g.paddingLeft===void 0||q.boolean(g.paddingLeft))&&(g.paddingRight===void 0||q.boolean(g.paddingRight))}w.is=m})(_n||(r.InlayHint=_n={}));var fs;(function(w){function _(m){return{kind:"snippet",value:m}}w.createSnippet=_})(fs||(r.StringValue=fs={}));var ps;(function(w){function _(m,k,g,x){return{insertText:m,filterText:k,range:g,command:x}}w.create=_})(
|
|
915
|
-
ps||(r.InlineCompletionItem=ps={}));var Pr;(function(w){function _(m){return{items:m}}w.create=_})(Pr||(r.InlineCompletionList=Pr={}));var hs;(function(w){w.Invoked=0,w.Automatic=1})(hs||(r.InlineCompletionTriggerKind=hs={}));var Vr;(function(w){function _(m,k){return{range:m,text:k}}w.create=_})(Vr||(r.SelectedCompletionInfo=Vr={}));var ms;(function(w){function _(m,k){return{triggerKind:m,selectedCompletionInfo:k}}w.create=_})(ms||(r.InlineCompletionContext=ms={}));var Zn;(function(w){function _(m){
|
|
916
|
-
var k=m;return q.objectLiteral(k)&&s.is(k.uri)&&q.string(k.name)}w.is=_})(Zn||(r.WorkspaceFolder=Zn={})),r.EOL=[`
|
|
917
|
-
`,`\r
|
|
918
|
-
`,"\r"];var pr;(function(w){function _(x,$,W,te){return new Co(x,$,W,te)}w.create=_;function m(x){var $=x;return!!(q.defined($)&&q.string($.uri)&&(q.undefined($.languageId)||q.string($.languageId))&&q.uinteger($.lineCount)&&q.func($.getText)&&q.func($.positionAt)&&q.func($.offsetAt))}w.is=m;function k(x,$){for(var W=x.getText(),te=g($,function(Le,at){var nt=Le.range.start.line-at.range.start.line;return nt===0?Le.range.start.character-at.range.start.character:nt}),oe=W.length,Ue=te.length-1;Ue>=
|
|
919
|
-
0;Ue--){var Be=te[Ue],tt=x.offsetAt(Be.range.start),be=x.offsetAt(Be.range.end);if(be<=oe)W=W.substring(0,tt)+Be.newText+W.substring(be,W.length);else throw new Error("Overlapping edit");oe=tt}return W}w.applyEdits=k;function g(x,$){if(x.length<=1)return x;var W=x.length/2|0,te=x.slice(0,W),oe=x.slice(W);g(te,$),g(oe,$);for(var Ue=0,Be=0,tt=0;Ue<te.length&&Be<oe.length;){var be=$(te[Ue],oe[Be]);be<=0?x[tt++]=te[Ue++]:x[tt++]=oe[Be++]}for(;Ue<te.length;)x[tt++]=te[Ue++];for(;Be<oe.length;)x[tt++]=
|
|
920
|
-
oe[Be++];return x}})(pr||(r.TextDocument=pr={}));var Co=function(){function w(_,m,k,g){this._uri=_,this._languageId=m,this._version=k,this._content=g,this._lineOffsets=void 0}return Object.defineProperty(w.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"version",{get:function(){return this._version},enumerable:!1,
|
|
921
|
-
configurable:!0}),w.prototype.getText=function(_){if(_){var m=this.offsetAt(_.start),k=this.offsetAt(_.end);return this._content.substring(m,k)}return this._content},w.prototype.update=function(_,m){this._content=_.text,this._version=m,this._lineOffsets=void 0},w.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var _=[],m=this._content,k=!0,g=0;g<m.length;g++){k&&(_.push(g),k=!1);var x=m.charAt(g);k=x==="\r"||x===`
|
|
922
|
-
`,x==="\r"&&g+1<m.length&&m.charAt(g+1)===`
|
|
923
|
-
`&&g++}k&&m.length>0&&_.push(m.length),this._lineOffsets=_}return this._lineOffsets},w.prototype.positionAt=function(_){_=Math.max(Math.min(_,this._content.length),0);var m=this.getLineOffsets(),k=0,g=m.length;if(g===0)return u.create(0,_);for(;k<g;){var x=Math.floor((k+g)/2);m[x]>_?g=x:k=x+1}var $=k-1;return u.create($,_-m[$])},w.prototype.offsetAt=function(_){var m=this.getLineOffsets();if(_.line>=m.length)return this._content.length;if(_.line<0)return 0;var k=m[_.line],g=_.line+1<m.length?m[_.
|
|
924
|
-
line+1]:this._content.length;return Math.max(Math.min(k+_.character,g),k)},Object.defineProperty(w.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),w}(),q;(function(w){var _=Object.prototype.toString;function m(be){return typeof be<"u"}w.defined=m;function k(be){return typeof be>"u"}w.undefined=k;function g(be){return be===!0||be===!1}w.boolean=g;function x(be){return _.call(be)==="[object String]"}w.string=x;function $(be){return _.call(
|
|
925
|
-
be)==="[object Number]"}w.number=$;function W(be,Le,at){return _.call(be)==="[object Number]"&&Le<=be&&be<=at}w.numberRange=W;function te(be){return _.call(be)==="[object Number]"&&-2147483648<=be&&be<=2147483647}w.integer=te;function oe(be){return _.call(be)==="[object Number]"&&0<=be&&be<=2147483647}w.uinteger=oe;function Ue(be){return _.call(be)==="[object Function]"}w.func=Ue;function Be(be){return be!==null&&typeof be=="object"}w.objectLiteral=Be;function tt(be,Le){return Array.isArray(be)&&
|
|
926
|
-
be.every(Le)}w.typedArray=tt})(q||(q={}))})}(bp,bp.exports)),bp.exports}var Rn={},Rk;function Ct(){if(Rk)return Rn;Rk=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.ProtocolNotificationType=Rn.ProtocolNotificationType0=Rn.ProtocolRequestType=Rn.ProtocolRequestType0=Rn.RegistrationType=Rn.MessageDirection=void 0;const t=Ws();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(Rn.MessageDirection=e={}));class n{constructor(u){this.method=
|
|
927
|
-
u}}Rn.RegistrationType=n;class r extends t.RequestType0{constructor(u){super(u)}}Rn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(u){super(u,t.ParameterStructures.byName)}}Rn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(u){super(u)}}Rn.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(u){super(u,t.ParameterStructures.byName)}}return Rn.ProtocolNotificationType=o,Rn}var qy={},Ot={},kk;function jy(){if(kk)return Ot;kk=1,Object.defineProperty(
|
|
928
|
-
Ot,"__esModule",{value:!0}),Ot.objectLiteral=Ot.typedArray=Ot.stringArray=Ot.array=Ot.func=Ot.error=Ot.number=Ot.string=Ot.boolean=void 0;function t(c){return c===!0||c===!1}Ot.boolean=t;function e(c){return typeof c=="string"||c instanceof String}Ot.string=e;function n(c){return typeof c=="number"||c instanceof Number}Ot.number=n;function r(c){return c instanceof Error}Ot.error=r;function i(c){return typeof c=="function"}Ot.func=i;function s(c){return Array.isArray(c)}Ot.array=s;function o(c){return s(
|
|
929
|
-
c)&&c.every(l=>e(l))}Ot.stringArray=o;function a(c,l){return Array.isArray(c)&&c.every(l)}Ot.typedArray=a;function u(c){return c!==null&&typeof c=="object"}return Ot.objectLiteral=u,Ot}var nc={},Tk;function h3(){if(Tk)return nc;Tk=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.ImplementationRequest=void 0;const t=Ct();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(nc.ImplementationRequest=
|
|
930
|
-
e={})),nc}var rc={},Ck;function m3(){if(Ck)return rc;Ck=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.TypeDefinitionRequest=void 0;const t=Ct();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(rc.TypeDefinitionRequest=e={})),rc}var Hs={},Ak;function g3(){if(Ak)return Hs;Ak=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.DidChangeWorkspaceFoldersNotification=Hs.WorkspaceFoldersRequest=
|
|
931
|
-
void 0;const t=Ct();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(Hs.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(Hs.DidChangeWorkspaceFoldersNotification=n={})),Hs}var ic={},Sk;function y3(){if(Sk)return ic;Sk=1,Object.defineProperty(
|
|
932
|
-
ic,"__esModule",{value:!0}),ic.ConfigurationRequest=void 0;const t=Ct();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(ic.ConfigurationRequest=e={})),ic}var Vs={},_k;function v3(){if(_k)return Vs;_k=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.ColorPresentationRequest=Vs.DocumentColorRequest=void 0;const t=Ct();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=
|
|
933
|
-
t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Vs.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(Vs.ColorPresentationRequest=n={})),Vs}var Ks={},Pk;function w3(){if(Pk)return Ks;Pk=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.FoldingRangeRefreshRequest=Ks.FoldingRangeRequest=void 0;const t=Ct();var e;(function(r){
|
|
934
|
-
r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ks.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||(Ks.FoldingRangeRefreshRequest=n={})),Ks}var sc={},xk;function b3(){if(xk)return sc;xk=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.DeclarationRequest=void 0;
|
|
935
|
-
const t=Ct();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(sc.DeclarationRequest=e={})),sc}var oc={},Nk;function E3(){if(Nk)return oc;Nk=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.SelectionRangeRequest=void 0;const t=Ct();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(
|
|
936
|
-
n.method)}(e||(oc.SelectionRangeRequest=e={})),oc}var pi={},Ik;function $3(){if(Ik)return pi;Ik=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.WorkDoneProgressCancelNotification=pi.WorkDoneProgressCreateRequest=pi.WorkDoneProgress=void 0;const t=Ws(),e=Ct();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(pi.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=
|
|
937
|
-
new e.ProtocolRequestType(s.method)})(r||(pi.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||(pi.WorkDoneProgressCancelNotification=i={})),pi}var hi={},Ok;function D3(){if(Ok)return hi;Ok=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.CallHierarchyOutgoingCallsRequest=hi.CallHierarchyIncomingCallsRequest=hi.CallHierarchyPrepareRequest=
|
|
938
|
-
void 0;const t=Ct();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(hi.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(hi.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=
|
|
939
|
-
t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(hi.CallHierarchyOutgoingCallsRequest=r={})),hi}var kn={},Lk;function R3(){if(Lk)return kn;Lk=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.SemanticTokensRefreshRequest=kn.SemanticTokensRangeRequest=kn.SemanticTokensDeltaRequest=kn.SemanticTokensRequest=kn.SemanticTokensRegistrationType=kn.TokenFormat=void 0;const t=Ct();var e;(function(a){a.Relative="relative"})(e||(kn.TokenFormat=e={}));var n;(function(a){
|
|
940
|
-
a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(kn.SemanticTokensRegistrationType=n={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(r||(kn.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(
|
|
941
|
-
a.method),a.registrationMethod=n.method})(i||(kn.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(s||(kn.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)}(o||(kn.SemanticTokensRefreshRequest=
|
|
942
|
-
o={})),kn}var ac={},Fk;function k3(){if(Fk)return ac;Fk=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.ShowDocumentRequest=void 0;const t=Ct();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(ac.ShowDocumentRequest=e={})),ac}var uc={},Mk;function T3(){if(Mk)return uc;Mk=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.LinkedEditingRangeRequest=void 0;const t=Ct();var e;return function(n){
|
|
943
|
-
n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(uc.LinkedEditingRangeRequest=e={})),uc}var un={},Bk;function C3(){if(Bk)return un;Bk=1,Object.defineProperty(un,"__esModule",{value:!0}),un.WillDeleteFilesRequest=un.DidDeleteFilesNotification=un.DidRenameFilesNotification=un.WillRenameFilesRequest=un.DidCreateFilesNotification=un.WillCreateFilesRequest=un.FileOperationPatternKind=void 0;const t=Ct();var e;
|
|
944
|
-
(function(u){u.file="file",u.folder="folder"})(e||(un.FileOperationPatternKind=e={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(un.WillCreateFilesRequest=n={}));var r;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(r||(un.DidCreateFilesNotification=r={}));var i;(function(u){u.method=
|
|
945
|
-
"workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(i||(un.WillRenameFilesRequest=i={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(s||(un.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(
|
|
946
|
-
u.method)})(o||(un.DidDeleteFilesNotification=o={}));var a;return function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)}(a||(un.WillDeleteFilesRequest=a={})),un}var mi={},qk;function A3(){if(qk)return mi;qk=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.MonikerRequest=mi.MonikerKind=mi.UniquenessLevel=void 0;const t=Ct();var e;(function(i){i.document="document",i.project="project",i.group="group",i.
|
|
947
|
-
scheme="scheme",i.global="global"})(e||(mi.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(mi.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(mi.MonikerRequest=r={})),mi}var gi={},jk;function S3(){if(jk)return gi;jk=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.TypeHierarchySubtypesRequest=gi.TypeHierarchySupertypesRequest=
|
|
948
|
-
gi.TypeHierarchyPrepareRequest=void 0;const t=Ct();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(gi.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(gi.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarch\
|
|
949
|
-
y/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(gi.TypeHierarchySubtypesRequest=r={})),gi}var Xs={},Gk;function _3(){if(Gk)return Xs;Gk=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.InlineValueRefreshRequest=Xs.InlineValueRequest=void 0;const t=Ct();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Xs.InlineValueRequest=
|
|
950
|
-
e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Xs.InlineValueRefreshRequest=n={})),Xs}var yi={},Uk;function P3(){if(Uk)return yi;Uk=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.InlayHintRefreshRequest=yi.InlayHintResolveRequest=yi.InlayHintRequest=void 0;const t=Ct();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,
|
|
951
|
-
i.type=new t.ProtocolRequestType(i.method)})(e||(yi.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(yi.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||(yi.InlayHintRefreshRequest=r={})),yi}var Kn={},Wk;function x3(){if(Wk)return Kn;
|
|
952
|
-
Wk=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.DiagnosticRefreshRequest=Kn.WorkspaceDiagnosticRequest=Kn.DocumentDiagnosticRequest=Kn.DocumentDiagnosticReportKind=Kn.DiagnosticServerCancellationData=void 0;const t=Ws(),e=jy(),n=Ct();var r;(function(u){function c(l){const f=l;return f&&e.boolean(f.retriggerRequest)}u.is=c})(r||(Kn.DiagnosticServerCancellationData=r={}));var i;(function(u){u.Full="full",u.Unchanged="unchanged"})(i||(Kn.DocumentDiagnosticReportKind=i={}));var s;(function(u){
|
|
953
|
-
u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(s||(Kn.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(o||(Kn.WorkspaceDiagnosticRequest=o={}));var a;return function(u){u.method="workspace/diagnostic/refresh",u.
|
|
954
|
-
messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)}(a||(Kn.DiagnosticRefreshRequest=a={})),Kn}var At={},zk;function N3(){if(zk)return At;zk=1,Object.defineProperty(At,"__esModule",{value:!0}),At.DidCloseNotebookDocumentNotification=At.DidSaveNotebookDocumentNotification=At.DidChangeNotebookDocumentNotification=At.NotebookCellArrayChange=At.DidOpenNotebookDocumentNotification=At.NotebookDocumentSyncRegistrationType=At.NotebookDocument=At.NotebookCell=At.
|
|
955
|
-
ExecutionSummary=At.NotebookCellKind=void 0;const t=By(),e=jy(),n=Ct();var r;(function(p){p.Markup=1,p.Code=2;function h(v){return v===1||v===2}p.is=h})(r||(At.NotebookCellKind=r={}));var i;(function(p){function h(y,E){const R={executionOrder:y};return(E===!0||E===!1)&&(R.success=E),R}p.create=h;function v(y){const E=y;return e.objectLiteral(E)&&t.uinteger.is(E.executionOrder)&&(E.success===void 0||e.boolean(E.success))}p.is=v;function b(y,E){return y===E?!0:y==null||E===null||E===void 0?!1:y.executionOrder===
|
|
956
|
-
E.executionOrder&&y.success===E.success}p.equals=b})(i||(At.ExecutionSummary=i={}));var s;(function(p){function h(E,R){return{kind:E,document:R}}p.create=h;function v(E){const R=E;return e.objectLiteral(R)&&r.is(R.kind)&&t.DocumentUri.is(R.document)&&(R.metadata===void 0||e.objectLiteral(R.metadata))}p.is=v;function b(E,R){const A=new Set;return E.document!==R.document&&A.add("document"),E.kind!==R.kind&&A.add("kind"),E.executionSummary!==R.executionSummary&&A.add("executionSummary"),(E.metadata!==
|
|
957
|
-
void 0||R.metadata!==void 0)&&!y(E.metadata,R.metadata)&&A.add("metadata"),(E.executionSummary!==void 0||R.executionSummary!==void 0)&&!i.equals(E.executionSummary,R.executionSummary)&&A.add("executionSummary"),A}p.diff=b;function y(E,R){if(E===R)return!0;if(E==null||R===null||R===void 0||typeof E!=typeof R||typeof E!="object")return!1;const A=Array.isArray(E),N=Array.isArray(R);if(A!==N)return!1;if(A&&N){if(E.length!==R.length)return!1;for(let K=0;K<E.length;K++)if(!y(E[K],R[K]))return!1}if(e.objectLiteral(
|
|
958
|
-
E)&&e.objectLiteral(R)){const K=Object.keys(E),J=Object.keys(R);if(K.length!==J.length||(K.sort(),J.sort(),!y(K,J)))return!1;for(let se=0;se<K.length;se++){const ie=K[se];if(!y(E[ie],R[ie]))return!1}}return!0}})(s||(At.NotebookCell=s={}));var o;(function(p){function h(b,y,E,R){return{uri:b,notebookType:y,version:E,cells:R}}p.create=h;function v(b){const y=b;return e.objectLiteral(y)&&e.string(y.uri)&&t.integer.is(y.version)&&e.typedArray(y.cells,s.is)}p.is=v})(o||(At.NotebookDocument=o={}));var a;
|
|
959
|
-
(function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(a||(At.NotebookDocumentSyncRegistrationType=a={}));var u;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(u||(At.DidOpenNotebookDocumentNotification=u={}));var c;(function(p){function h(b){const y=b;return e.objectLiteral(y)&&
|
|
960
|
-
t.uinteger.is(y.start)&&t.uinteger.is(y.deleteCount)&&(y.cells===void 0||e.typedArray(y.cells,s.is))}p.is=h;function v(b,y,E){const R={start:b,deleteCount:y};return E!==void 0&&(R.cells=E),R}p.create=v})(c||(At.NotebookCellArrayChange=c={}));var l;(function(p){p.method="notebookDocument/didChange",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(l||(At.DidChangeNotebookDocumentNotification=l={}));var f;(function(p){
|
|
961
|
-
p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(f||(At.DidSaveNotebookDocumentNotification=f={}));var d;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method}(d||(At.DidCloseNotebookDocumentNotification=d={})),At}var cc={},Hk;function I3(){if(Hk)
|
|
962
|
-
return cc;Hk=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.InlineCompletionRequest=void 0;const t=Ct();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(cc.InlineCompletionRequest=e={})),cc}var Vk;function O3(){return Vk||(Vk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=
|
|
963
|
-
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=
|
|
964
|
-
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=
|
|
965
|
-
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=
|
|
966
|
-
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=
|
|
967
|
-
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=
|
|
968
|
-
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=
|
|
969
|
-
t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=Ct(),n=By(),r=jy(),i=h3();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=m3();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=g3();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),
|
|
970
|
-
Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=y3();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const u=v3();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});
|
|
971
|
-
const c=w3();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const l=b3();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const f=E3();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const d=$3();
|
|
972
|
-
Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=D3();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),
|
|
973
|
-
Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const h=R3();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,
|
|
974
|
-
"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 v=k3();Object.defineProperty(
|
|
975
|
-
t,"ShowDocumentRequest",{enumerable:!0,get:function(){return v.ShowDocumentRequest}});const b=T3();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});const y=C3();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(t,"Wil\
|
|
976
|
-
lCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,
|
|
977
|
-
get:function(){return y.WillDeleteFilesRequest}});const E=A3();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return E.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return E.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return E.MonikerRequest}});const R=S3();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.TypeHierarchyPrepareRequest}}),Object.defineProperty(
|
|
978
|
-
t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySupertypesRequest}});const A=_3();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return A.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return A.InlineValueRefreshRequest}});const N=P3();Object.defineProperty(
|
|
979
|
-
t,"InlayHintRequest",{enumerable:!0,get:function(){return N.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return N.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return N.InlayHintRefreshRequest}});const K=x3();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return K.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnost\
|
|
980
|
-
icReportKind",{enumerable:!0,get:function(){return K.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return K.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return K.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return K.DiagnosticRefreshRequest}});const J=N3();Object.defineProperty(t,"NotebookCellKind",
|
|
981
|
-
{enumerable:!0,get:function(){return J.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return J.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return J.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return J.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return J.NotebookDocumentSyncRegistrationType}}),Object.
|
|
982
|
-
defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return J.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidSaveNotebookDocumentNotification}}),
|
|
983
|
-
Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidCloseNotebookDocumentNotification}});const se=I3();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return se.InlineCompletionRequest}});var ie;(function(m){function k(g){const x=g;return r.string(x)||r.string(x.language)||r.string(x.scheme)||r.string(x.pattern)}m.is=k})(ie||(t.TextDocumentFilter=ie={}));var we;(function(m){function k(g){const x=g;return r.objectLiteral(
|
|
984
|
-
x)&&(r.string(x.notebookType)||r.string(x.scheme)||r.string(x.pattern))}m.is=k})(we||(t.NotebookDocumentFilter=we={}));var B;(function(m){function k(g){const x=g;return r.objectLiteral(x)&&(r.string(x.notebook)||we.is(x.notebook))&&(x.language===void 0||r.string(x.language))}m.is=k})(B||(t.NotebookCellTextDocumentFilter=B={}));var T;(function(m){function k(g){if(!Array.isArray(g))return!1;for(let x of g)if(!r.string(x)&&!ie.is(x)&&!B.is(x))return!1;return!0}m.is=k})(T||(t.DocumentSelector=T={}));
|
|
985
|
-
var D;(function(m){m.method="client/registerCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(D||(t.RegistrationRequest=D={}));var M;(function(m){m.method="client/unregisterCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(M||(t.UnregistrationRequest=M={}));var S;(function(m){m.Create="create",m.Rename="rename",m.Delete="delete"})(S||(t.ResourceOperationKind=S={}));var P;(function(m){
|
|
986
|
-
m.Abort="abort",m.Transactional="transactional",m.TextOnlyTransactional="textOnlyTransactional",m.Undo="undo"})(P||(t.FailureHandlingKind=P={}));var O;(function(m){m.UTF8="utf-8",m.UTF16="utf-16",m.UTF32="utf-32"})(O||(t.PositionEncodingKind=O={}));var Z;(function(m){function k(g){const x=g;return x&&r.string(x.id)&&x.id.length>0}m.hasId=k})(Z||(t.StaticRegistrationOptions=Z={}));var H;(function(m){function k(g){const x=g;return x&&(x.documentSelector===null||T.is(x.documentSelector))}m.is=k})(H||
|
|
987
|
-
(t.TextDocumentRegistrationOptions=H={}));var C;(function(m){function k(x){const $=x;return r.objectLiteral($)&&($.workDoneProgress===void 0||r.boolean($.workDoneProgress))}m.is=k;function g(x){const $=x;return $&&r.boolean($.workDoneProgress)}m.hasWorkDoneProgress=g})(C||(t.WorkDoneProgressOptions=C={}));var ne;(function(m){m.method="initialize",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ne||(t.InitializeRequest=ne={}));var ye;(function(m){
|
|
988
|
-
m.unknownProtocolVersion=1})(ye||(t.InitializeErrorCodes=ye={}));var Pe;(function(m){m.method="initialized",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Pe||(t.InitializedNotification=Pe={}));var F;(function(m){m.method="shutdown",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType0(m.method)})(F||(t.ShutdownRequest=F={}));var V;(function(m){m.method="exit",m.messageDirection=e.MessageDirection.clientToServer,
|
|
989
|
-
m.type=new e.ProtocolNotificationType0(m.method)})(V||(t.ExitNotification=V={}));var Se;(function(m){m.method="workspace/didChangeConfiguration",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Se||(t.DidChangeConfigurationNotification=Se={}));var le;(function(m){m.Error=1,m.Warning=2,m.Info=3,m.Log=4,m.Debug=5})(le||(t.MessageType=le={}));var $e;(function(m){m.method="window/showMessage",m.messageDirection=e.MessageDirection.serverToClient,m.
|
|
990
|
-
type=new e.ProtocolNotificationType(m.method)})($e||(t.ShowMessageNotification=$e={}));var xe;(function(m){m.method="window/showMessageRequest",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(xe||(t.ShowMessageRequest=xe={}));var de;(function(m){m.method="window/logMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(de||(t.LogMessageNotification=de={}));var I;(function(m){m.method="telem\
|
|
991
|
-
etry/event",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(I||(t.TelemetryEventNotification=I={}));var G;(function(m){m.None=0,m.Full=1,m.Incremental=2})(G||(t.TextDocumentSyncKind=G={}));var pe;(function(m){m.method="textDocument/didOpen",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(pe||(t.DidOpenTextDocumentNotification=pe={}));var U;(function(m){function k(x){let $=x;return $!=null&&
|
|
992
|
-
typeof $.text=="string"&&$.range!==void 0&&($.rangeLength===void 0||typeof $.rangeLength=="number")}m.isIncremental=k;function g(x){let $=x;return $!=null&&typeof $.text=="string"&&$.range===void 0&&$.rangeLength===void 0}m.isFull=g})(U||(t.TextDocumentContentChangeEvent=U={}));var fe;(function(m){m.method="textDocument/didChange",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(fe||(t.DidChangeTextDocumentNotification=fe={}));var Ke;(function(m){
|
|
993
|
-
m.method="textDocument/didClose",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Ke||(t.DidCloseTextDocumentNotification=Ke={}));var it;(function(m){m.method="textDocument/didSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(it||(t.DidSaveTextDocumentNotification=it={}));var ue;(function(m){m.Manual=1,m.AfterDelay=2,m.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var Oe;(function(m){
|
|
994
|
-
m.method="textDocument/willSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Oe||(t.WillSaveTextDocumentNotification=Oe={}));var re;(function(m){m.method="textDocument/willSaveWaitUntil",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(re||(t.WillSaveTextDocumentWaitUntilRequest=re={}));var De;(function(m){m.method="workspace/didChangeWatchedFiles",m.messageDirection=e.MessageDirection.clientToServer,
|
|
995
|
-
m.type=new e.ProtocolNotificationType(m.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var Ge;(function(m){m.Created=1,m.Changed=2,m.Deleted=3})(Ge||(t.FileChangeType=Ge={}));var vt;(function(m){function k(g){const x=g;return r.objectLiteral(x)&&(n.URI.is(x.baseUri)||n.WorkspaceFolder.is(x.baseUri))&&r.string(x.pattern)}m.is=k})(vt||(t.RelativePattern=vt={}));var et;(function(m){m.Create=1,m.Change=2,m.Delete=4})(et||(t.WatchKind=et={}));var Kt;(function(m){m.method="textDocument/pub\
|
|
996
|
-
lishDiagnostics",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(Kt||(t.PublishDiagnosticsNotification=Kt={}));var en;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.TriggerForIncompleteCompletions=3})(en||(t.CompletionTriggerKind=en={}));var gn;(function(m){m.method="textDocument/completion",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(gn||(t.CompletionRequest=gn={}));var X;(function(m){m.
|
|
997
|
-
method="completionItem/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(X||(t.CompletionResolveRequest=X={}));var Y;(function(m){m.method="textDocument/hover",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Y||(t.HoverRequest=Y={}));var he;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.ContentChange=3})(he||(t.SignatureHelpTriggerKind=he={}));var tn;(function(m){m.method="textDocument/sig\
|
|
998
|
-
natureHelp",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(tn||(t.SignatureHelpRequest=tn={}));var Xt;(function(m){m.method="textDocument/definition",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Xt||(t.DefinitionRequest=Xt={}));var _r;(function(m){m.method="textDocument/references",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(_r||(t.ReferencesRequest=
|
|
999
|
-
_r={}));var Pi;(function(m){m.method="textDocument/documentHighlight",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Pi||(t.DocumentHighlightRequest=Pi={}));var us;(function(m){m.method="textDocument/documentSymbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(us||(t.DocumentSymbolRequest=us={}));var cs;(function(m){m.method="textDocument/codeAction",m.messageDirection=e.MessageDirection.clientToServer,
|
|
1000
|
-
m.type=new e.ProtocolRequestType(m.method)})(cs||(t.CodeActionRequest=cs={}));var ls;(function(m){m.method="codeAction/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ls||(t.CodeActionResolveRequest=ls={}));var ds;(function(m){m.method="workspace/symbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ds||(t.WorkspaceSymbolRequest=ds={}));var xi;(function(m){m.method="workspaceSymbol/reso\
|
|
1001
|
-
lve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(xi||(t.WorkspaceSymbolResolveRequest=xi={}));var Ni;(function(m){m.method="textDocument/codeLens",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ni||(t.CodeLensRequest=Ni={}));var _n;(function(m){m.method="codeLens/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(_n||(t.CodeLensResolveRequest=
|
|
1002
|
-
_n={}));var fs;(function(m){m.method="workspace/codeLens/refresh",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType0(m.method)})(fs||(t.CodeLensRefreshRequest=fs={}));var ps;(function(m){m.method="textDocument/documentLink",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ps||(t.DocumentLinkRequest=ps={}));var Pr;(function(m){m.method="documentLink/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.
|
|
1003
|
-
type=new e.ProtocolRequestType(m.method)})(Pr||(t.DocumentLinkResolveRequest=Pr={}));var hs;(function(m){m.method="textDocument/formatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(hs||(t.DocumentFormattingRequest=hs={}));var Vr;(function(m){m.method="textDocument/rangeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Vr||(t.DocumentRangeFormattingRequest=Vr={}));var ms;(function(m){
|
|
1004
|
-
m.method="textDocument/rangesFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ms||(t.DocumentRangesFormattingRequest=ms={}));var Zn;(function(m){m.method="textDocument/onTypeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Zn||(t.DocumentOnTypeFormattingRequest=Zn={}));var pr;(function(m){m.Identifier=1})(pr||(t.PrepareSupportDefaultBehavior=pr={}));var Co;(function(m){m.method=
|
|
1005
|
-
"textDocument/rename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Co||(t.RenameRequest=Co={}));var q;(function(m){m.method="textDocument/prepareRename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(q||(t.PrepareRenameRequest=q={}));var w;(function(m){m.method="workspace/executeCommand",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(w||(t.ExecuteCommandRequest=
|
|
1006
|
-
w={}));var _;(function(m){m.method="workspace/applyEdit",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType("workspace/applyEdit")})(_||(t.ApplyWorkspaceEditRequest=_={}))}(qy)),qy}var lc={},Kk;function L3(){if(Kk)return lc;Kk=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.createProtocolConnection=void 0;const t=Ws();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return lc.createProtocolConnection=
|
|
1007
|
-
e,lc}var Xk;function F3(){return Xk||(Xk=1,function(t){var e=zs&&zs.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,c)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),n=zs&&zs.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(
|
|
1008
|
-
t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Ws(),t),n(By(),t),n(Ct(),t),n(O3(),t);var r=L3();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={}))}(zs)),zs}var Yk;function Lt(){return Yk||
|
|
1009
|
-
(Yk=1,function(t){var e=js&&js.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,c)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),n=js&&js.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.
|
|
1010
|
-
createProtocolConnection=void 0;const r=$k();n($k(),t),n(F3(),t);function i(s,o,a,u){return(0,r.createMessageConnection)(s,o,a,u)}t.createProtocolConnection=i}(js)),js}var Xn={},Jk;function Qk(){if(Jk)return Xn;Jk=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(){
|
|
1011
|
-
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.
|
|
1012
|
-
_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(a){return r.test(a)}Xn.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}Xn.parse=s;function o(){return n().asHex()}return Xn.generateUuid=
|
|
1013
|
-
o,Xn}var vi={},Zk;function M3(){if(Zk)return vi;Zk=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.attachPartialResult=vi.ProgressFeature=vi.attachWorkDone=void 0;const t=Lt(),e=Qk();class n{constructor(d,p){this._connection=d,this._token=p,n.Instances.set(this._token,this)}begin(d,p,h,v){let b={kind:"begin",title:d,percentage:p,message:h,cancellable:v};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,b)}report(d,p){let h={kind:"report"};typeof d=="number"?(h.percentage=d,
|
|
1014
|
-
p!==void 0&&(h.message=p)):h.message=d,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(d,p){super(d,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(){}}
|
|
1015
|
-
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 o(f,d){if(d===void 0||d.workDoneToken===void 0)return new i;const p=d.workDoneToken;return delete d.workDoneToken,new n(f,p)}vi.attachWorkDone=o;const a=f=>class extends f{constructor(){super(),this._progressSupported=!1}initialize(d){super.initialize(d),d?.window?.workDoneProgress===!0&&(this._progressSupported=
|
|
1016
|
-
!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let h=n.Instances.get(p.token);(h instanceof r||h instanceof s)&&h.cancel()}))}attachWorkDoneProgress(d){return d===void 0?new i:new n(this.connection,d)}createWorkDoneProgress(){if(this._progressSupported){const d=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:d}).then(()=>new r(this.connection,d))}else return Promise.resolve(new s)}};vi.ProgressFeature=a;var u;(function(f){
|
|
1017
|
-
f.type=new t.ProgressType})(u||(u={}));class c{constructor(d,p){this._connection=d,this._token=p}report(d){this._connection.sendProgress(u.type,this._token,d)}}function l(f,d){if(d===void 0||d.partialResultToken===void 0)return;const p=d.partialResultToken;return delete d.partialResultToken,new c(f,p)}return vi.attachPartialResult=l,vi}var dc={},eT;function B3(){if(eT)return dc;eT=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.ConfigurationFeature=void 0;const t=Lt(),e=Iy(),n=r=>class extends r{getConfiguration(i){
|
|
1018
|
-
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(o=>Array.isArray(o)?Array.isArray(i)?o:o[0]:Array.isArray(i)?[]:null)}};return dc.ConfigurationFeature=n,dc}var fc={},tT;function q3(){if(tT)return fc;tT=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.WorkspaceFoldersFeature=void 0;const t=Lt(),e=n=>class extends n{constructor(){
|
|
1019
|
-
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(){
|
|
1020
|
-
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 fc.WorkspaceFoldersFeature=e,fc}var pc={},nT;function j3(){if(nT)
|
|
1021
|
-
return pc;nT=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.CallHierarchyFeature=void 0;const t=Lt(),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,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.
|
|
1022
|
-
CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return pc.CallHierarchyFeature=e,pc}var wi={},rT;function iT(){if(rT)return wi;rT=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.SemanticTokensBuilder=wi.SemanticTokensDiff=wi.SemanticTokensFeature=void 0;const t=Lt(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.
|
|
1023
|
-
type),on:s=>{const o=t.SemanticTokensRequest.type;return this.connection.onRequest(o,(a,u)=>s(a,u,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onDelta:s=>{const o=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(o,(a,u)=>s(a,u,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onRange:s=>{const o=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(o,(a,u)=>s(a,u,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(
|
|
1024
|
-
o,a)))}}}};wi.SemanticTokensFeature=e;class n{constructor(s,o){this.originalSequence=s,this.modifiedSequence=o}computeDiff(){const s=this.originalSequence.length,o=this.modifiedSequence.length;let a=0;for(;a<o&&a<s&&this.originalSequence[a]===this.modifiedSequence[a];)a++;if(a<o&&a<s){let u=s-1,c=o-1;for(;u>=a&&c>=a&&this.originalSequence[u]===this.modifiedSequence[c];)u--,c--;(u<a||c<a)&&(u++,c++);const l=u-a+1,f=this.modifiedSequence.slice(a,c+1);return f.length===1&&f[0]===this.originalSequence[u]?
|
|
1025
|
-
[{start:a,deleteCount:l-1}]:[{start:a,deleteCount:l,data:f}]}else return a<o?[{start:a,deleteCount:0,data:this.modifiedSequence.slice(a)}]:a<s?[{start:a,deleteCount:s-a}]:[]}}wi.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,o,a,u,c){let l=s,f=o;this._dataLen>0&&(l-=this._prevLine,l===0&&(f-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=
|
|
1026
|
-
f,this._data[this._dataLen++]=a,this._data[this._dataLen++]=u,this._data[this._dataLen++]=c,this._prevLine=s,this._prevChar=o}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 wi.SemanticTokensBuilder=
|
|
1027
|
-
r,wi}var hc={},sT;function G3(){if(sT)return hc;sT=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.ShowDocumentFeature=void 0;const t=Lt(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return hc.ShowDocumentFeature=e,hc}var mc={},oT;function U3(){if(oT)return mc;oT=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.FileOperationsFeature=void 0;const t=Lt(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(
|
|
1028
|
-
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(
|
|
1029
|
-
t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return mc.FileOperationsFeature=e,mc}var gc={},aT;function W3(){if(aT)return gc;aT=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.LinkedEditingRangeFeature=void 0;const t=Lt(),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 gc.LinkedEditingRangeFeature=e,gc}var yc={},uT;function z3(){if(uT)return yc;uT=1,Object.defineProperty(
|
|
1030
|
-
yc,"__esModule",{value:!0}),yc.TypeHierarchyFeature=void 0;const t=Lt(),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,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.
|
|
1031
|
-
connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return yc.TypeHierarchyFeature=e,yc}var vc={},cT;function H3(){if(cT)return vc;cT=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.InlineValueFeature=void 0;const t=Lt(),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(
|
|
1032
|
-
i)))}}};return vc.InlineValueFeature=e,vc}var wc={},lT;function V3(){if(lT)return wc;lT=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.FoldingRangeFeature=void 0;const t=Lt(),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,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return wc.FoldingRangeFeature=
|
|
1033
|
-
e,wc}var bc={},dT;function K3(){if(dT)return bc;dT=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.InlayHintFeature=void 0;const t=Lt(),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 bc.InlayHintFeature=e,bc}var Ec={},fT;function X3(){
|
|
1034
|
-
if(fT)return Ec;fT=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.DiagnosticFeature=void 0;const t=Lt(),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(
|
|
1035
|
-
i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Ec.DiagnosticFeature=e,Ec}var Ys={},$c={},pT;function hT(){if(pT)return $c;pT=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.TextDocuments=void 0;const t=Lt();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.
|
|
1036
|
-
_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=
|
|
1037
|
-
t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const o=s.textDocument,a=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,a);const u=Object.freeze({document:a});this._onDidOpen.fire(u),this._onDidChangeContent.fire(u)})),i.push(r.onDidChangeTextDocument(s=>{const o=s.textDocument,a=s.contentChanges;if(a.length===0)return;const{version:u}=o;if(u==null)throw new Error(`Received document change event for ${o.uri}\
|
|
1038
|
-
without valid version identifier`);let c=this._syncedDocuments.get(o.uri);c!==void 0&&(c=this._configuration.update(c,a,u),this._syncedDocuments.set(o.uri,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),i.push(r.onDidCloseTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),i.push(r.onWillSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.
|
|
1039
|
-
uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,o)=>{let a=this._syncedDocuments.get(s.textDocument.uri);return a!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:a,reason:s.reason}),o):[]})),i.push(r.onDidSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),t.Disposable.create(()=>{i.forEach(s=>s.
|
|
1040
|
-
dispose())})}}return $c.TextDocuments=e,$c}var mT;function gT(){if(mT)return Ys;mT=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.NotebookDocuments=Ys.NotebookSyncFeature=void 0;const t=Lt(),e=hT(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:o=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,a=>{o(a)}),onDidChangeNotebookDocument:o=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,a=>{o(a)}),onDidSaveNotebookDocument:o=>this.
|
|
1041
|
-
connection.onNotification(t.DidSaveNotebookDocumentNotification.type,a=>{o(a)}),onDidCloseNotebookDocument:o=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,a=>{o(a)})}}};Ys.NotebookSyncFeature=n;class r{onDidOpenTextDocument(o){return this.openHandler=o,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(o){this.openHandler&&this.openHandler(o)}onDidChangeTextDocument(o){return this.changeHandler=o,t.Disposable.create(()=>{this.changeHandler=o})}changeTextDocument(o){
|
|
1042
|
-
this.changeHandler&&this.changeHandler(o)}onDidCloseTextDocument(o){return this.closeHandler=o,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(o){this.closeHandler&&this.closeHandler(o)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(o){o instanceof e.TextDocuments?this._cellTextDocuments=o:this._cellTextDocuments=
|
|
1043
|
-
new e.TextDocuments(o),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(o){return this._cellTextDocuments.get(o.document)}getNotebookDocument(o){return this.notebookDocuments.get(o)}getNotebookCell(o){const a=this.notebookCellMap.get(o);return a&&a[0]}findNotebookDocumentForCell(o){const a=typeof o==
|
|
1044
|
-
"string"?o:o.document,u=this.notebookCellMap.get(a);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(o){const a=new r,u=[];return u.push(this.cellTextDocuments.listen(a)),u.push(o.notebooks.synchronization.onDidOpenNotebookDocument(c=>{this.notebookDocuments.set(c.notebookDocument.uri,c.notebookDocument);for(const l of c.cellTextDocuments)
|
|
1045
|
-
a.openTextDocument({textDocument:l});this.updateCellMap(c.notebookDocument),this._onDidOpen.fire(c.notebookDocument)})),u.push(o.notebooks.synchronization.onDidChangeNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l===void 0)return;l.version=c.notebookDocument.version;const f=l.metadata;let d=!1;const p=c.change;p.metadata!==void 0&&(d=!0,l.metadata=p.metadata);const h=[],v=[],b=[],y=[];if(p.cells!==void 0){const K=p.cells;if(K.structure!==void 0){const J=K.structure.
|
|
1046
|
-
array;if(l.cells.splice(J.start,J.deleteCount,...J.cells!==void 0?J.cells:[]),K.structure.didOpen!==void 0)for(const se of K.structure.didOpen)a.openTextDocument({textDocument:se}),h.push(se.uri);if(K.structure.didClose)for(const se of K.structure.didClose)a.closeTextDocument({textDocument:se}),v.push(se.uri)}if(K.data!==void 0){const J=new Map(K.data.map(se=>[se.document,se]));for(let se=0;se<=l.cells.length;se++){const ie=J.get(l.cells[se].document);if(ie!==void 0){const we=l.cells.splice(se,1,
|
|
1047
|
-
ie);if(b.push({old:we[0],new:ie}),J.delete(ie.document),J.size===0)break}}}if(K.textContent!==void 0)for(const J of K.textContent)a.changeTextDocument({textDocument:J.document,contentChanges:J.changes}),y.push(J.document.uri)}this.updateCellMap(l);const E={notebookDocument:l};d&&(E.metadata={old:f,new:l.metadata});const R=[];for(const K of h)R.push(this.getNotebookCell(K));const A=[];for(const K of v)A.push(this.getNotebookCell(K));const N=[];for(const K of y)N.push(this.getNotebookCell(K));(R.length>
|
|
1048
|
-
0||A.length>0||b.length>0||N.length>0)&&(E.cells={added:R,removed:A,changed:{data:b,textContent:N}}),(E.metadata!==void 0||E.cells!==void 0)&&this._onDidChange.fire(E)})),u.push(o.notebooks.synchronization.onDidSaveNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),u.push(o.notebooks.synchronization.onDidCloseNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const f of c.
|
|
1049
|
-
cellTextDocuments)a.closeTextDocument({textDocument:f});this.notebookDocuments.delete(c.notebookDocument.uri);for(const f of l.cells)this.notebookCellMap.delete(f.document)}})),t.Disposable.create(()=>{u.forEach(c=>c.dispose())})}updateCellMap(o){for(const a of o.cells)this.notebookCellMap.set(a.document,[a,o])}}return Ys.NotebookDocuments=i,Ys}var Dc={},yT;function Y3(){if(yT)return Dc;yT=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.MonikerFeature=void 0;const t=Lt(),e=n=>class extends n{get moniker(){
|
|
1050
|
-
return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Dc.MonikerFeature=e,Dc}var vT;function wT(){if(vT)return Ze;vT=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.createConnection=Ze.combineFeatures=Ze.combineNotebooksFeatures=Ze.combineLanguagesFeatures=Ze.combineWorkspaceFeatures=Ze.combineWindowFeatures=Ze.combineClientFeatures=Ze.combineTracerFeatures=Ze.combineTelemetryFeatures=
|
|
1051
|
-
Ze.combineConsoleFeatures=Ze._NotebooksImpl=Ze._LanguagesImpl=Ze.BulkUnregistration=Ze.BulkRegistration=Ze.ErrorMessageTracker=void 0;const t=Lt(),e=Iy(),n=Qk(),r=M3(),i=B3(),s=q3(),o=j3(),a=iT(),u=G3(),c=U3(),l=W3(),f=z3(),d=H3(),p=V3(),h=K3(),v=X3(),b=gT(),y=Y3();function E(de){if(de!==null)return de}class R{constructor(){this._messages=Object.create(null)}add(I){let G=this._messages[I];G||(G=0),G++,this._messages[I]=G}sendErrors(I){Object.keys(this._messages).forEach(G=>{I.window.showErrorMessage(
|
|
1052
|
-
G)})}}Ze.ErrorMessageTracker=R;class A{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,G){
|
|
1053
|
-
this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:I,message:G}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class N{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,...G){let pe={type:t.MessageType.Error,message:I,actions:G};return this.connection.sendRequest(
|
|
1054
|
-
t.ShowMessageRequest.type,pe).then(E)}showWarningMessage(I,...G){let pe={type:t.MessageType.Warning,message:I,actions:G};return this.connection.sendRequest(t.ShowMessageRequest.type,pe).then(E)}showInformationMessage(I,...G){let pe={type:t.MessageType.Info,message:I,actions:G};return this.connection.sendRequest(t.ShowMessageRequest.type,pe).then(E)}}const K=(0,u.ShowDocumentFeature)((0,r.ProgressFeature)(N));var J;(function(de){function I(){return new se}de.create=I})(J||(Ze.BulkRegistration=J={}));
|
|
1055
|
-
class se{constructor(){this._registrations=[],this._registered=new Set}add(I,G){const pe=e.string(I)?I:I.method;if(this._registered.has(pe))throw new Error(`${pe} is already added to this registration`);const U=n.generateUuid();this._registrations.push({id:U,method:pe,registerOptions:G||{}}),this._registered.add(pe)}asRegistrationParams(){return{registrations:this._registrations}}}var ie;(function(de){function I(){return new we(void 0,[])}de.create=I})(ie||(Ze.BulkUnregistration=ie={}));class we{constructor(I,G){
|
|
1056
|
-
this._connection=I,this._unregistrations=new Map,G.forEach(pe=>{this._unregistrations.set(pe.method,pe)})}get isAttached(){return!!this._connection}attach(I){this._connection=I}add(I){this._unregistrations.set(I.method,I)}dispose(){let I=[];for(let pe of this._unregistrations.values())I.push(pe);let G={unregisterations:I};this._connection.sendRequest(t.UnregistrationRequest.type,G).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(I){const G=e.string(I)?I:I.
|
|
1057
|
-
method,pe=this._unregistrations.get(G);if(!pe)return!1;let U={unregisterations:[pe]};return this._connection.sendRequest(t.UnregistrationRequest.type,U).then(()=>{this._unregistrations.delete(G)},fe=>{this._connection.console.info(`Un-registering request handler for ${pe.id} failed.`)}),!0}}class B{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,G,pe){
|
|
1058
|
-
return I instanceof se?this.registerMany(I):I instanceof we?this.registerSingle1(I,G,pe):this.registerSingle2(I,G)}registerSingle1(I,G,pe){const U=e.string(G)?G:G.method,fe=n.generateUuid();let Ke={registrations:[{id:fe,method:U,registerOptions:pe||{}}]};return I.isAttached||I.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,Ke).then(it=>(I.add({id:fe,method:U}),I),it=>(this.connection.console.info(`Registering request handler for ${U} failed.`),Promise.reject(it)))}registerSingle2(I,G){
|
|
1059
|
-
const pe=e.string(I)?I:I.method,U=n.generateUuid();let fe={registrations:[{id:U,method:pe,registerOptions:G||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,fe).then(Ke=>t.Disposable.create(()=>{this.unregisterSingle(U,pe).catch(()=>{this.connection.console.info(`Un-registering capability with id ${U} failed.`)})}),Ke=>(this.connection.console.info(`Registering request handler for ${pe} failed.`),Promise.reject(Ke)))}unregisterSingle(I,G){let pe={unregisterations:[{id:I,method:G}]};
|
|
1060
|
-
return this.connection.sendRequest(t.UnregistrationRequest.type,pe).catch(()=>{this.connection.console.info(`Un-registering request handler for ${I} failed.`)})}registerMany(I){let G=I.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,G).then(()=>new we(this._connection,G.registrations.map(pe=>({id:pe.id,method:pe.method}))),pe=>(this.connection.console.info("Bulk registration failed."),Promise.reject(pe)))}}class T{constructor(){}attach(I){this._connection=I}get connection(){
|
|
1061
|
-
if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}applyEdit(I){function G(U){return U&&!!U.edit}let pe=G(I)?I:{edit:I};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,pe)}}const D=(0,c.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(T)));class M{constructor(){this._trace=t.Trace.Off}attach(I){this._connection=I}get connection(){if(!this._connection)
|
|
1062
|
-
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,G){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:I,verbose:this._trace===t.Trace.Verbose?G:void 0}).catch(()=>{})}}class S{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){
|
|
1063
|
-
this.connection.sendNotification(t.TelemetryEventNotification.type,I).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class P{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,G){return(0,r.attachPartialResult)(
|
|
1064
|
-
this.connection,G)}}Ze._LanguagesImpl=P;const O=(0,p.FoldingRangeFeature)((0,y.MonikerFeature)((0,v.DiagnosticFeature)((0,h.InlayHintFeature)((0,d.InlineValueFeature)((0,f.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(P)))))))));class Z{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){
|
|
1065
|
-
return(0,r.attachWorkDone)(this.connection,I)}attachPartialResultProgress(I,G){return(0,r.attachPartialResult)(this.connection,G)}}Ze._NotebooksImpl=Z;const H=(0,b.NotebookSyncFeature)(Z);function C(de,I){return function(G){return I(de(G))}}Ze.combineConsoleFeatures=C;function ne(de,I){return function(G){return I(de(G))}}Ze.combineTelemetryFeatures=ne;function ye(de,I){return function(G){return I(de(G))}}Ze.combineTracerFeatures=ye;function Pe(de,I){return function(G){return I(de(G))}}Ze.combineClientFeatures=
|
|
1066
|
-
Pe;function F(de,I){return function(G){return I(de(G))}}Ze.combineWindowFeatures=F;function V(de,I){return function(G){return I(de(G))}}Ze.combineWorkspaceFeatures=V;function Se(de,I){return function(G){return I(de(G))}}Ze.combineLanguagesFeatures=Se;function le(de,I){return function(G){return I(de(G))}}Ze.combineNotebooksFeatures=le;function $e(de,I){function G(U,fe,Ke){return U&&fe?Ke(U,fe):U||fe}return{__brand:"features",console:G(de.console,I.console,C),tracer:G(de.tracer,I.tracer,ye),telemetry:G(
|
|
1067
|
-
de.telemetry,I.telemetry,ne),client:G(de.client,I.client,Pe),window:G(de.window,I.window,F),workspace:G(de.workspace,I.workspace,V),languages:G(de.languages,I.languages,Se),notebooks:G(de.notebooks,I.notebooks,le)}}Ze.combineFeatures=$e;function xe(de,I,G){const pe=G&&G.console?new(G.console(A)):new A,U=de(pe);pe.rawAttach(U);const fe=G&&G.tracer?new(G.tracer(M)):new M,Ke=G&&G.telemetry?new(G.telemetry(S)):new S,it=G&&G.client?new(G.client(B)):new B,ue=G&&G.window?new(G.window(K)):new K,Oe=G&&G.
|
|
1068
|
-
workspace?new(G.workspace(D)):new D,re=G&&G.languages?new(G.languages(O)):new O,De=G&&G.notebooks?new(G.notebooks(H)):new H,Ge=[pe,fe,Ke,it,ue,Oe,re,De];function vt(X){return X instanceof Promise?X:e.thenable(X)?new Promise((Y,he)=>{X.then(tn=>Y(tn),tn=>he(tn))}):Promise.resolve(X)}let et,Kt,en,gn={listen:()=>U.listen(),sendRequest:(X,...Y)=>U.sendRequest(e.string(X)?X:X.method,...Y),onRequest:(X,Y)=>U.onRequest(X,Y),sendNotification:(X,Y)=>{const he=e.string(X)?X:X.method;return U.sendNotification(
|
|
1069
|
-
he,Y)},onNotification:(X,Y)=>U.onNotification(X,Y),onProgress:U.onProgress,sendProgress:U.sendProgress,onInitialize:X=>(Kt=X,{dispose:()=>{Kt=void 0}}),onInitialized:X=>U.onNotification(t.InitializedNotification.type,X),onShutdown:X=>(et=X,{dispose:()=>{et=void 0}}),onExit:X=>(en=X,{dispose:()=>{en=void 0}}),get console(){return pe},get telemetry(){return Ke},get tracer(){return fe},get client(){return it},get window(){return ue},get workspace(){return Oe},get languages(){return re},get notebooks(){
|
|
1070
|
-
return De},onDidChangeConfiguration:X=>U.onNotification(t.DidChangeConfigurationNotification.type,X),onDidChangeWatchedFiles:X=>U.onNotification(t.DidChangeWatchedFilesNotification.type,X),__textDocumentSync:void 0,onDidOpenTextDocument:X=>U.onNotification(t.DidOpenTextDocumentNotification.type,X),onDidChangeTextDocument:X=>U.onNotification(t.DidChangeTextDocumentNotification.type,X),onDidCloseTextDocument:X=>U.onNotification(t.DidCloseTextDocumentNotification.type,X),onWillSaveTextDocument:X=>U.
|
|
1071
|
-
onNotification(t.WillSaveTextDocumentNotification.type,X),onWillSaveTextDocumentWaitUntil:X=>U.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,X),onDidSaveTextDocument:X=>U.onNotification(t.DidSaveTextDocumentNotification.type,X),sendDiagnostics:X=>U.sendNotification(t.PublishDiagnosticsNotification.type,X),onHover:X=>U.onRequest(t.HoverRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onCompletion:X=>U.onRequest(t.CompletionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),
|
|
1072
|
-
(0,r.attachPartialResult)(U,Y))),onCompletionResolve:X=>U.onRequest(t.CompletionResolveRequest.type,X),onSignatureHelp:X=>U.onRequest(t.SignatureHelpRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onDeclaration:X=>U.onRequest(t.DeclarationRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onDefinition:X=>U.onRequest(t.DefinitionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onTypeDefinition:X=>U.onRequest(
|
|
1073
|
-
t.TypeDefinitionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onImplementation:X=>U.onRequest(t.ImplementationRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onReferences:X=>U.onRequest(t.ReferencesRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onDocumentHighlight:X=>U.onRequest(t.DocumentHighlightRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,
|
|
1074
|
-
Y))),onDocumentSymbol:X=>U.onRequest(t.DocumentSymbolRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onWorkspaceSymbol:X=>U.onRequest(t.WorkspaceSymbolRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onWorkspaceSymbolResolve:X=>U.onRequest(t.WorkspaceSymbolResolveRequest.type,X),onCodeAction:X=>U.onRequest(t.CodeActionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onCodeActionResolve:X=>U.
|
|
1075
|
-
onRequest(t.CodeActionResolveRequest.type,(Y,he)=>X(Y,he)),onCodeLens:X=>U.onRequest(t.CodeLensRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onCodeLensResolve:X=>U.onRequest(t.CodeLensResolveRequest.type,(Y,he)=>X(Y,he)),onDocumentFormatting:X=>U.onRequest(t.DocumentFormattingRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onDocumentRangeFormatting:X=>U.onRequest(t.DocumentRangeFormattingRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),
|
|
1076
|
-
void 0)),onDocumentOnTypeFormatting:X=>U.onRequest(t.DocumentOnTypeFormattingRequest.type,(Y,he)=>X(Y,he)),onRenameRequest:X=>U.onRequest(t.RenameRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onPrepareRename:X=>U.onRequest(t.PrepareRenameRequest.type,(Y,he)=>X(Y,he)),onDocumentLinks:X=>U.onRequest(t.DocumentLinkRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onDocumentLinkResolve:X=>U.onRequest(t.DocumentLinkResolveRequest.type,(Y,he)=>X(Y,
|
|
1077
|
-
he)),onDocumentColor:X=>U.onRequest(t.DocumentColorRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onColorPresentation:X=>U.onRequest(t.ColorPresentationRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onFoldingRanges:X=>U.onRequest(t.FoldingRangeRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onSelectionRanges:X=>U.onRequest(t.SelectionRangeRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(
|
|
1078
|
-
U,Y),(0,r.attachPartialResult)(U,Y))),onExecuteCommand:X=>U.onRequest(t.ExecuteCommandRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),dispose:()=>U.dispose()};for(let X of Ge)X.attach(gn);return U.onRequest(t.InitializeRequest.type,X=>{I.initialize(X),e.string(X.trace)&&(fe.trace=t.Trace.fromString(X.trace));for(let Y of Ge)Y.initialize(X.capabilities);if(Kt){let Y=Kt(X,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(U,X),void 0);return vt(Y).then(he=>{if(he instanceof t.
|
|
1079
|
-
ResponseError)return he;let tn=he;tn||(tn={capabilities:{}});let Xt=tn.capabilities;Xt||(Xt={},tn.capabilities=Xt),Xt.textDocumentSync===void 0||Xt.textDocumentSync===null?Xt.textDocumentSync=e.number(gn.__textDocumentSync)?gn.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Xt.textDocumentSync)&&!e.number(Xt.textDocumentSync.change)&&(Xt.textDocumentSync.change=e.number(gn.__textDocumentSync)?gn.__textDocumentSync:t.TextDocumentSyncKind.None);for(let _r of Ge)_r.fillServerCapabilities(Xt);
|
|
1080
|
-
return tn})}else{let Y={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let he of Ge)he.fillServerCapabilities(Y.capabilities);return Y}}),U.onRequest(t.ShutdownRequest.type,()=>{if(I.shutdownReceived=!0,et)return et(new t.CancellationTokenSource().token)}),U.onNotification(t.ExitNotification.type,()=>{try{en&&en()}finally{I.shutdownReceived?I.exit(0):I.exit(1)}}),U.onNotification(t.SetTraceNotification.type,X=>{fe.trace=t.Trace.fromString(X.value)}),gn}return Ze.createConnection=
|
|
1081
|
-
xe,Ze}var Tn={},bT;function J3(){if(bT)return Tn;bT=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.resolveModulePath=Tn.FileSystem=Tn.resolveGlobalYarnPath=Tn.resolveGlobalNodePath=Tn.resolve=Tn.uriToFilePath=void 0;const t=v_,e=Oi,n=Na,r=w_;function i(f){let d=t.parse(f);if(d.protocol!=="file:"||!d.path)return;let p=d.path.split("/");for(var h=0,v=p.length;h<v;h++)p[h]=decodeURIComponent(p[h]);if(process.platform==="win32"&&p.length>1){let b=p[0],y=p[1];b.length===0&&y.length>1&&y[1]===
|
|
1082
|
-
":"&&p.shift()}return e.normalize(p.join("/"))}Tn.uriToFilePath=i;function s(){return process.platform==="win32"}function o(f,d,p,h){const v="NODE_PATH",b=["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((y,E)=>{let R=process.env,A=Object.create(null);Object.keys(R).forEach(N=>A[N]=R[N]),
|
|
1083
|
-
d&&n.existsSync(d)&&(A[v]?A[v]=d+e.delimiter+A[v]:A[v]=d,h&&h(`NODE_PATH value is: ${A[v]}`)),A.ELECTRON_RUN_AS_NODE="1";try{let N=(0,r.fork)("",[],{cwd:p,env:A,execArgv:["-e",b]});if(N.pid===void 0){E(new Error(`Starting process to resolve node module ${f} failed`));return}N.on("error",J=>{E(J)}),N.on("message",J=>{J.c==="r"&&(N.send({c:"e"}),J.s?y(J.r):E(new Error(`Failed to resolve module: ${f}`)))});let K={c:"rs",a:f};N.send(K)}catch(N){E(N)}})}Tn.resolve=o;function a(f){let d="npm";const p=Object.
|
|
1084
|
-
create(null);Object.keys(process.env).forEach(b=>p[b]=process.env[b]),p.NO_UPDATE_NOTIFIER="true";const h={encoding:"utf8",env:p};s()&&(d="npm.cmd",h.shell=!0);let v=()=>{};try{process.on("SIGPIPE",v);let b=(0,r.spawnSync)(d,["config","get","prefix"],h).stdout;if(!b){f&&f("'npm config get prefix' didn't return a value.");return}let y=b.trim();return f&&f(`'npm config get prefix' value is: ${y}`),y.length>0?s()?e.join(y,"node_modules"):e.join(y,"lib","node_modules"):void 0}catch{return}finally{process.
|
|
1085
|
-
removeListener("SIGPIPE",v)}}Tn.resolveGlobalNodePath=a;function u(f){let d="yarn",p={encoding:"utf8"};s()&&(d="yarn.cmd",p.shell=!0);let h=()=>{};try{process.on("SIGPIPE",h);let v=(0,r.spawnSync)(d,["global","dir","--json"],p),b=v.stdout;if(!b){f&&(f("'yarn global dir' didn't return a value."),v.stderr&&f(v.stderr));return}let y=b.trim().split(/\r?\n/);for(let E of y)try{let R=JSON.parse(E);if(R.type==="log")return e.join(R.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener(
|
|
1086
|
-
"SIGPIPE",h)}}Tn.resolveGlobalYarnPath=u;var c;(function(f){let d;function p(){return d!==void 0||(process.platform==="win32"?d=!1:d=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),d}f.isCaseSensitive=p;function h(v,b){return p()?e.normalize(b).indexOf(e.normalize(v))===0:e.normalize(b).toLowerCase().indexOf(e.normalize(v).toLowerCase())===0}f.isParent=h})(c||(Tn.FileSystem=c={}));function l(f,d,p,h){return p?(e.isAbsolute(p)||(p=e.join(f,p)),o(d,p,p,h).then(v=>c.
|
|
1087
|
-
isParent(p,v)?v:Promise.reject(new Error(`Failed to load ${d} from node path location.`))).then(void 0,v=>o(d,a(h),f,h))):o(d,a(h),f,h)}return Tn.resolveModulePath=l,Tn}var Gy,ET;function $T(){return ET||(ET=1,Gy=Lt()),Gy}var Js={},Rc={},DT;function Q3(){if(DT)return Rc;DT=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.InlineCompletionFeature=void 0;const t=Lt(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,
|
|
1088
|
-
this.attachWorkDoneProgress(i)))}}};return Rc.InlineCompletionFeature=e,Rc}var RT;function Z3(){return RT||(RT=1,function(t){var e=Js&&Js.__createBinding||(Object.create?function(u,c,l,f){f===void 0&&(f=l);var d=Object.getOwnPropertyDescriptor(c,l);(!d||("get"in d?!c.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(u,f,d)}:function(u,c,l,f){f===void 0&&(f=l),u[f]=c[l]}),n=Js&&Js.__exportStar||function(u,c){for(var l in u)l!=="default"&&
|
|
1089
|
-
!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=iT();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=Q3();n(Lt(),t);const s=hT();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=gT();Object.defineProperty(t,"NotebookDocument\
|
|
1090
|
-
s",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(wT(),t);var a;(function(u){u.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(Js)),Js}var kT;function TT(){return kT||(kT=1,function(t){var e=qs&&qs.__createBinding||(Object.create?function(y,E,R,A){A===void 0&&(A=R);var N=Object.getOwnPropertyDescriptor(E,R);(!N||("get"in N?!E.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return E[R]}}),Object.defineProperty(
|
|
1091
|
-
y,A,N)}:function(y,E,R,A){A===void 0&&(A=R),y[A]=E[R]}),n=qs&&qs.__exportStar||function(y,E){for(var R in y)R!=="default"&&!Object.prototype.hasOwnProperty.call(E,R)&&e(E,y,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=f_,i=Iy(),s=wT(),o=J3(),a=$T();n($T(),t),n(Z3(),t);var u;(function(y){y.uriToFilePath=o.uriToFilePath,y.resolveGlobalNodePath=o.resolveGlobalNodePath,y.resolveGlobalYarnPath=o.resolveGlobalYarnPath,y.resolve=o.resolve,y.resolveModulePath=
|
|
1092
|
-
o.resolveModulePath})(u||(t.Files=u={}));function c(){}let l=!1,f;function d(){const y="--clientProcessId";function E(R){try{let A=parseInt(R);isNaN(A)||(f=setInterval(()=>{try{process.kill(A,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let R=2;R<process.argv.length;R++){let A=process.argv[R];if(A===y&&R+1<process.argv.length){E(process.argv[R+1]);return}else{let N=A.split("=");N[0]===y&&E(N[1])}}}d();const p={initialize:y=>{const E=y.processId;i.number(E)&&f===void 0&&setInterval(()=>{try{process.
|
|
1093
|
-
kill(E,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(y){l=y},exit:y=>{process.exit(y)}};function h(y,E,R,A){let N,K,J,se;return y!==void 0&&y.__brand==="features"&&(N=y,y=E,E=R,R=A),a.ConnectionStrategy.is(y)||a.ConnectionOptions.is(y)?se=y:(K=y,J=E,se=R),v(K,J,se,N)}t.createConnection=h;function v(y,E,R,A){let N=!1;if(!y&&!E&&process.argv.length>2){let ie,we,B=process.argv.slice(2);for(let T=0;T<B.length;T++){let D=B[T];if(D==="--node-ipc"){y=new a.IPCMessageReader(
|
|
1094
|
-
process),E=new a.IPCMessageWriter(process);break}else if(D==="--stdio"){N=!0,y=process.stdin,E=process.stdout;break}else if(D==="--socket"){ie=parseInt(B[T+1]);break}else if(D==="--pipe"){we=B[T+1];break}else{var K=D.split("=");if(K[0]==="--socket"){ie=parseInt(K[1]);break}else if(K[0]==="--pipe"){we=K[1];break}}}if(ie){let T=(0,a.createServerSocketTransport)(ie);y=T[0],E=T[1]}else if(we){let T=(0,a.createServerPipeTransport)(we);y=T[0],E=T[1]}}var J="Use arguments of createConnection or set com\
|
|
1095
|
-
mand line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!y)throw new Error("Connection input stream is not set. "+J);if(!E)throw new Error("Connection output stream is not set. "+J);if(i.func(y.read)&&i.func(y.on)){let ie=y;ie.on("end",()=>{process.exit(l?0:1)}),ie.on("close",()=>{process.exit(l?0:1)})}const se=ie=>{const we=(0,a.createProtocolConnection)(y,E,ie,R);return N&&b(ie),we};return(0,s.createConnection)(se,p,A)}function b(y){function E(A){return A.map(N=>typeof N=="str\
|
|
1096
|
-
ing"?N:(0,r.inspect)(N)).join(" ")}const R=new Map;console.assert=function(N,...K){if(!N)if(K.length===0)y.error("Assertion failed");else{const[J,...se]=K;y.error(`Assertion failed: ${J} ${E(se)}`)}},console.count=function(N="default"){const K=String(N);let J=R.get(K)??0;J+=1,R.set(K,J),y.log(`${K}: ${K}`)},console.countReset=function(N){N===void 0?R.clear():R.delete(String(N))},console.debug=function(...N){y.log(E(N))},console.dir=function(N,K){y.log((0,r.inspect)(N,K))},console.log=function(...N){
|
|
1097
|
-
y.log(E(N))},console.error=function(...N){y.error(E(N))},console.trace=function(...N){const K=new Error().stack.replace(/(.+\n){2}/,"");let J="Trace";N.length!==0&&(J+=`: ${E(N)}`),y.log(`${J}
|
|
1098
|
-
${K}`)},console.warn=function(...N){y.warn(E(N))}}}(qs)),qs}var ge=TT();function CT(t,e){const n={stacks:t,tokens:e};return e4(n),n.stacks.flat().forEach(i=>{i.property=void 0}),ST(n.stacks).map(i=>i[i.length-1])}function Uy(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],o=e.feature;if(r.has(o))return[];Bi(o)||r.add(o);let a,u=o;for(;u.$container;)if(Bi(u.$container)){a=u.$container;break}else if(Nm(u.$container))u=u.$container;else break;if(Pb(u.cardinality)){const c=Zo({next:{feature:u,
|
|
1099
|
-
type:e.type},cardinalities:n,visited:r,plus:i});for(const l of c)i.add(l.feature);s.push(...c)}if(a){const c=a.elements.indexOf(u);c!==void 0&&c<a.elements.length-1&&s.push(...AT({feature:a,type:e.type},c+1,n,r,i)),s.every(l=>Io(l.feature.cardinality,l.feature)||Io(n.get(l.feature))||i.has(l.feature))&&s.push(...Uy({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function Wy(t){return Rt(t)&&(t={feature:t}),Zo({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}
|
|
1100
|
-
function Zo(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:u,type:c}=i;if(Bi(u))return o.has(u)?[]:(o.add(u),AT(i,0,s,o,a).map(l=>Ep(l,u.cardinality,s)));if(Mm(u)||Bm(u))return u.elements.flatMap(l=>Zo({next:{feature:l,type:c,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>Ep(l,u.cardinality,s));if(Nr(u)){const l={feature:u.terminal,type:c,property:(e=i.property)!==null&&e!==void 0?e:u.feature};return Zo({next:l,cardinalities:s,
|
|
1101
|
-
visited:o,plus:a}).map(f=>Ep(f,u.cardinality,s))}else{if($s(u))return Uy({next:{feature:u,type:$u(u),property:(n=i.property)!==null&&n!==void 0?n:u.feature},cardinalities:s,visited:o,plus:a});if(Jr(u)&&ln(u.rule.ref)){const l=u.rule.ref,f={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=Ds(l))!==null&&r!==void 0?r:l.name,property:i.property};return Zo({next:f,cardinalities:s,visited:o,plus:a}).map(d=>Ep(d,u.cardinality,s))}else return[i]}}function Ep(t,e,n){return n.set(t.feature,e),t}
|
|
1102
|
-
function AT(t,e,n,r,i){var s;const o=[];let a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],type:t.type},o.push(...Zo({next:a,cardinalities:n,visited:r,plus:i})),!!Io((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function e4(t){for(const e of t.tokens){const n=ST(t.stacks,e);t.stacks=n}}function ST(t,e){const n=[];for(const r of t)n.push(...t4(r,e));return n}function t4(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(n4)),
|
|
1103
|
-
i=[];for(;t.length>0;){const s=t.pop(),o=Uy({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?zy(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>Io(a.feature.cardinality,a.feature)||Io(n.get(a.feature))))break}return i}function n4(t){if(t.cardinality==="+")return!0;const e=wn(t,Nr);return!!(e&&e.cardinality==="+")}function zy(t,e){if(Ir(t))return t.value===e.image;if(Jr(t))return r4(t.rule.ref,e);if(su(t)){const n=Km(t);if(n)return zy(n,e)}return!1}function r4(t,e){return ln(
|
|
1104
|
-
t)?Wy(t.definition).some(r=>zy(r.feature,e)):Yr(t)?Du(t).test(e.image):!1}function i4(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 _T{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.
|
|
1105
|
-
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),o=(c,l)=>{const f=this.fillCompletionItem(c,l);f&&i.push(f)},a=c=>Ir(c.feature)?c.feature.
|
|
1106
|
-
value:c.feature,u=[];for(const c of s)if(await Promise.all(We(c.features).distinct(a).exclude(u).map(l=>this.completionFor(c,l,o))),u.push(...c.features),!this.continueCompletion(i))break;return ge.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return We(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=ff(
|
|
1107
|
-
this.grammar),c=Wy({feature:u.definition,type:Ds(u)});return s.length>0?(s.shift(),CT(c.map(l=>[l]),s)):c}const o=[...s].splice(i.tokenIndex);return CT([i.elementStack.map(u=>({feature:u}))],o)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument,a=o.getText(),u=o.offsetAt(n),c={document:e,textDocument:o,offset:u,position:n},l=this.findDataTypeRuleStart(s,u);if(l){const[E,R]=l,A=(r=_m(s,E))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.
|
|
1108
|
-
assign({},c),{node:A,tokenOffset:E,tokenEndOffset:R,features:this.findFeaturesAt(o,E)})}const{nextTokenStart:f,nextTokenEnd:d,previousTokenStart:p,previousTokenEnd:h}=this.backtrackToAnyToken(a,u);let v=f;u<=f&&p!==void 0&&(v=p);const b=(i=_m(s,v))===null||i===void 0?void 0:i.astNode;let y=!0;if(p!==void 0&&h!==void 0&&h===u&&(yield Object.assign(Object.assign({},c),{node:b,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(o,p)}),y=this.performNextTokenCompletion(e,a.substring(p,h),p,h),
|
|
1109
|
-
y&&(yield Object.assign(Object.assign({},c),{node:b,tokenOffset:h,tokenEndOffset:h,features:this.findFeaturesAt(o,h)}))),b)y&&(yield Object.assign(Object.assign({},c),{node:b,tokenOffset:f,tokenEndOffset:d,features:this.findFeaturesAt(o,f)}));else{const E=ff(this.grammar);if(!E)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},c),{tokenOffset:f,tokenEndOffset:d,features:Wy(E.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){
|
|
1110
|
-
var r,i;let s=Es(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=wn(s?.grammarSource,ln))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=wn(s?.grammarSource,ln))===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?
|
|
1111
|
-
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(Ir(n.feature))return this.completionForKeyword(e,n.feature,r);if(su(n.feature)&&e.node)return this.completionForCrossReference(
|
|
1112
|
-
e,n,r)}completionForCrossReference(e,n,r){const i=wn(n.feature,Nr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},Gm(this.astReflection,s));const o={reference:{$refText:""},container:s,property:i.feature};try{for(const a of this.getReferenceCandidates(o,e))r(e,this.createReferenceCompletionItem(a))}catch(a){console.error(a)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.
|
|
1113
|
-
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.
|
|
1114
|
-
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 o;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?o=n.textEdit.newText:typeof n.insertText=="string"?o=n.insertText:o=s;const a=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(
|
|
1115
|
-
e,s,o);return a?{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:a,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().
|
|
1116
|
-
substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const o=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:r,range:{start:o,end:a}}}else return}}class s4{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,o=Es(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(o)return this.
|
|
1117
|
-
collectLocationLinks(o,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=lt(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class PT{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,
|
|
1118
|
-
this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=Es(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=pt.equals(lt(o).uri,e.uri),u={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,u).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.
|
|
1119
|
-
range)}}class o4{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){
|
|
1120
|
-
const r=[];for(const i of vu(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class a4{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.
|
|
1121
|
-
LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=We(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.
|
|
1122
|
-
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([Et.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=We(e.changes).filter(i=>i.type!==ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Et.parse(i.uri)).toArray(),r=We(e.changes).filter(i=>i.type===ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Et.parse(i.
|
|
1123
|
-
uri)).toArray();this.fireDocumentUpdate(n,r)}}class u4{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=o=>i.push(o);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=Or(i).iterator();let o;do if(o=s.next(),!o.done){const a=o.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,n),this.shouldProcessContent(a)||
|
|
1124
|
-
s.prune()}while(!o.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 b1(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,ge.FoldingRangeKind.Comment);o&&r(o)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let o=i.end;if(!(o.line-s.line<2))return this.
|
|
1125
|
-
includeLastFoldingLine(n,r)||(o=e.textDocument.positionAt(e.textDocument.offsetAt({line:o.line,character:0})-1)),ge.FoldingRange.create(s.line,o.line,s.character,o.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 c4{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const o=n.length;for(let a=0;a<o;a++){const u=n.charCodeAt(a),c=e.charCodeAt(s);if((u===c||this.toUpperCharCode(u)===
|
|
1126
|
-
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 xT<=e&&e<=NT&&l4<=n&&n<=d4||e===IT&&n!==IT}toUpperCharCode(e){return xT<=e&&e<=NT?e-32:e}}const xT=97,NT=122,l4=65,d4=90,IT=95;class OT{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;
|
|
1127
|
-
if(s){const o=e.textDocument.offsetAt(n.position),a=Es(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){const u=this.references.findDeclaration(a);if(u)return this.getAstNodeHoverContent(u)}}}}class f4 extends OT{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 $p=Lt();const p4={[ge.SemanticTokenTypes.class]:0,[ge.
|
|
1128
|
-
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.
|
|
1129
|
-
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},h4={[ge.SemanticTokenModifiers.abstract]:1,[ge.SemanticTokenModifiers.async]:2,[ge.SemanticTokenModifiers.declaration]:4,[ge.SemanticTokenModifiers.defaultLibrary]:8,[ge.SemanticTokenModifiers.definition]:16,[ge.SemanticTokenModifiers.deprecated]:32,
|
|
1130
|
-
[ge.SemanticTokenModifiers.documentation]:64,[ge.SemanticTokenModifiers.modification]:128,[ge.SemanticTokenModifiers.readonly]:256,[ge.SemanticTokenModifiers.static]:512};function m4(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const o of t)o&&(o.legend.tokenTypes.forEach((a,u)=>{const c=e[u];if(c&&c!==a)throw new Error(`Cannot merge '${c}' and '${a}' token types. They use the same index ${u}.`);e[u]=a}),o.legend.tokenModifiers.forEach((a,u)=>{const c=n[u];if(c&&c!==a)throw new Error(`Cannot merge \
|
|
1131
|
-
'${c}' and '${a}' token modifier. They use the same index ${u}.`);n[u]=a}),o.full?typeof o.full=="object"&&!o.full.delta&&(i=!1):r=!1,o.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class g4 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(){
|
|
1132
|
-
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 y4{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===
|
|
1133
|
-
void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return p4}get tokenModifiers(){return h4}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=ft.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.
|
|
1134
|
-
computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=ft.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=ft.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,
|
|
1135
|
-
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(
|
|
1136
|
-
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 g4;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=Qr(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await qt(r);const a=o.value;this.highlightElement(a,n)==="prune"&&s.prune()}while(!o.done)}highlightToken(e){var n;const{range:r,type:i}=e;
|
|
1137
|
-
let s=e.modifier;if(this.currentRange&&!ab(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const o=this.tokenTypes[i];let a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const f=this.tokenModifiers[l];a|=f}}const u=r.start.line,c=r.end.line;if(u===c){const l=r.start.character,f=r.end.character-l;this.currentTokensBuilder.push(u,l,f,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,f=this.
|
|
1138
|
-
currentDocument.textDocument.offsetAt(r.start),d=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(u,l,d-f,o,a)}else{const l=r.start;let f=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(l.line,l.character,f-l.character-1,o,a);for(let d=u+1;d<c;d++){const p=f;f=this.currentDocument.textDocument.offsetAt({line:d+1,character:0}),this.currentTokensBuilder.push(d,0,f-p-1,o,a)}this.currentTokensBuilder.push(c,0,r.end.character,
|
|
1139
|
-
o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=dn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...No(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:o}=e,a=[];if(typeof s=="number"){const u=Eu(n.$cstNode,r,s);u&&a.push(u)}else a.push(...Ym(n.$cstNode,r));for(const u of a)this.highlightNode({node:u,type:i,modifier:o})}highlightNode(e){
|
|
1140
|
-
const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var LT;(function(t){function e(r,i,s){const o=new Map;Object.entries(i).forEach(([c,l])=>o.set(l,c));let a=0,u=0;return n(r.data,5).map(c=>{a+=c[0],c[0]!==0&&(u=0),u+=c[1];const l=c[2];return{offset:s.textDocument.offsetAt({line:a,character:u}),tokenType:o.get(c[3]),tokenModifiers:c[4],text:s.textDocument.getText({start:{line:a,character:u},end:{line:a,character:u+l}})}})}t.decode=e;function n(r,i){const s=[];
|
|
1141
|
-
for(let o=0;o<r.length;o+=i){const a=r.slice(o,o+i);s.push(a)}return s}})(LT||(LT={}));function v4(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 w4{constructor(e){this.onInitializeEmitter=new $p.Emitter,this.onInitializedEmitter=
|
|
1142
|
-
new $p.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){
|
|
1143
|
-
var n,r,i,s;const o=this.services.lsp.DocumentUpdateHandler,a=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,u=this.services.ServiceRegistry.all,c=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.Formatter}),l=u.map(H=>{var C,ne;return(ne=(C=H.lsp)===null||C===void 0?void 0:C.Formatter)===null||ne===void 0?void 0:ne.formatOnTypeOptions}).find(H=>!!H),f=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.CodeActionProvider}),
|
|
1144
|
-
d=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider}),p=m4(u.map(H=>{var C,ne;return(ne=(C=H.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider)===null||ne===void 0?void 0:ne.semanticTokensOptions})),h=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,v=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.DocumentLinkProvider}),b=v4(u.map(H=>{var C,ne;return(ne=(C=H.lsp)===
|
|
1145
|
-
null||C===void 0?void 0:C.SignatureHelp)===null||ne===void 0?void 0:ne.signatureHelpOptions})),y=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.TypeProvider}),E=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.ImplementationProvider}),R=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.CompletionProvider}),A=i4(u.map(H=>{var C,ne;return(ne=(C=H.lsp)===null||C===void 0?void 0:C.CompletionProvider)===null||ne===void 0?void 0:ne.completionOptions})),
|
|
1146
|
-
N=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.ReferencesProvider}),K=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.DocumentSymbolProvider}),J=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.DefinitionProvider}),se=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.DocumentHighlightProvider}),ie=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.FoldingRangeProvider}),we=this.hasService(H=>{
|
|
1147
|
-
var C;return(C=H.lsp)===null||C===void 0?void 0:C.HoverProvider}),B=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.RenameProvider}),T=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.CallHierarchyProvider}),D=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.TypeHierarchyProvider}),M=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.CodeLensProvider}),S=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?
|
|
1148
|
-
void 0:C.DeclarationProvider}),P=this.hasService(H=>{var C;return(C=H.lsp)===null||C===void 0?void 0:C.InlayHintProvider}),O=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:$p.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:R?
|
|
1149
|
-
A:void 0,referencesProvider:N,documentSymbolProvider:K,definitionProvider:J,typeDefinitionProvider:y,documentHighlightProvider:se,codeActionProvider:f,documentFormattingProvider:c,documentRangeFormattingProvider:c,documentOnTypeFormattingProvider:l,foldingRangeProvider:ie,hoverProvider:we,renameProvider:B?{prepareProvider:!0}:void 0,semanticTokensProvider:d?p:void 0,signatureHelpProvider:b,implementationProvider:E,callHierarchyProvider:T?{}:void 0,typeHierarchyProvider:D?{}:void 0,documentLinkProvider:v?
|
|
1150
|
-
{resolveProvider:!1}:void 0,codeLensProvider:M?{resolveProvider:!1}:void 0,declarationProvider:S,inlayHintProvider:P?{resolveProvider:!1}:void 0,workspaceSymbolProvider:O?{resolveProvider:!!O.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){
|
|
1151
|
-
const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register($p.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 b4{getSymbolKind(e){
|
|
1152
|
-
return ge.SymbolKind.Field}getCompletionItemKind(e){return ge.CompletionItemKind.Reference}}class E4{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=Es(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(
|
|
1153
|
-
e);if(s){const o={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,o).forEach(a=>{i.push(ge.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class $4{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 o=e.textDocument.offsetAt(n.position),a=Es(s,o,this.grammarConfig.nameRegexp);
|
|
1154
|
-
if(!a)return;const u=this.references.findDeclaration(a);if(!u)return;const c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(u,c).forEach(f=>{const d=Fn.replace(f.segment.range,n.newName),p=f.sourceUri.toString();i[p]?i[p].push(d):i[p]=[d]}),{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=Es(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.
|
|
1155
|
-
references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&dp(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class FT{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=ft.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await qt(n),this.fuzzyMatcher.match(i,s.name)){const o=this.
|
|
1156
|
-
getWorkspaceSymbol(s);o&&r.push(o)}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 MT{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(){
|
|
1157
|
-
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(pt.normalize(e))}set(e){const n=pt.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){
|
|
1158
|
-
const n=pt.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=pt.normalize(i.uri),o=this._configuration.create(s,i.languageId,
|
|
1159
|
-
i.version,i.text);this._syncedDocuments.set(s,o);const a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const a=pt.normalize(i.uri);let u=this._syncedDocuments.get(a);u!==void 0&&(u=this._configuration.update(u,s,o),this._syncedDocuments.
|
|
1160
|
-
set(a,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),n.push(e.onDidCloseTextDocument(r=>{const i=pt.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(pt.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil(
|
|
1161
|
-
(r,i)=>{const s=this._syncedDocuments.get(pt.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(pt.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ge.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}class D4{constructor(e){this.notebookDocuments=new Map,this.notebookCellMap=new Map,
|
|
1162
|
-
this._onDidOpen=new ge.Emitter,this._onDidSave=new ge.Emitter,this._onDidChange=new ge.Emitter,this._onDidClose=new ge.Emitter,"listen"in e?this._cellTextDocuments=e:this._cellTextDocuments=new MT(e)}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(pt.normalize(e))}getNotebookCell(e){const n=this.notebookCellMap.get(pt.normalize(e));return n&&n[0]}findNotebookDocumentForCell(e){
|
|
1163
|
-
const n=typeof e=="string"||"scheme"in e?e:e.document,r=this.notebookCellMap.get(pt.normalize(n));return r&&r[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(e){const n=new Pa,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{const s=pt.normalize(i.notebookDocument.uri);this.notebookDocuments.
|
|
1164
|
-
set(s,i.notebookDocument);for(const o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const s=pt.normalize(i.notebookDocument.uri),o=this.notebookDocuments.get(s);if(o===void 0)return;o.version=i.notebookDocument.version;const a=o.metadata;let u=!1;const c=i.change;c.metadata!==void 0&&(u=!0,o.metadata=c.metadata);const l=[],f=[],d=[],p=[];
|
|
1165
|
-
if(c.cells!==void 0){const E=c.cells;if(E.structure!==void 0){const R=E.structure.array;if(o.cells.splice(R.start,R.deleteCount,...R.cells!==void 0?R.cells:[]),E.structure.didOpen!==void 0)for(const A of E.structure.didOpen)n.openTextDocument({textDocument:A}),l.push(A.uri);if(E.structure.didClose)for(const A of E.structure.didClose)n.closeTextDocument({textDocument:A}),f.push(A.uri)}if(E.data!==void 0){const R=new Map(E.data.map(A=>[A.document,A]));for(let A=0;A<=o.cells.length;A++){const N=R.get(
|
|
1166
|
-
o.cells[A].document);if(N!==void 0){const K=o.cells.splice(A,1,N);if(d.push({old:K[0],new:N}),R.delete(N.document),R.size===0)break}}}if(E.textContent!==void 0)for(const R of E.textContent)n.changeTextDocument({textDocument:R.document,contentChanges:R.changes}),p.push(R.document.uri)}this.updateCellMap(o);const h={notebookDocument:o};u&&(h.metadata={old:a,new:o.metadata});const v=[];for(const E of l)v.push(this.getNotebookCell(E));const b=[];for(const E of f)b.push(this.getNotebookCell(E));const y=[];
|
|
1167
|
-
for(const E of p)y.push(this.getNotebookCell(E));(v.length>0||b.length>0||d.length>0||y.length>0)&&(h.cells={added:v,removed:b,changed:{data:d,textContent:y}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const s=this.getNotebookDocument(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const s=pt.normalize(i.notebookDocument.uri),
|
|
1168
|
-
o=this.notebookDocuments.get(s);if(o!==void 0){this._onDidClose.fire(o);for(const a of i.cellTextDocuments)n.closeTextDocument({textDocument:a});this.notebookDocuments.delete(s);for(const a of o.cells)this.notebookCellMap.delete(a.document)}})),ge.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}class Pa{onDidOpenTextDocument(e){return this.openHandler=e,ge.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){
|
|
1169
|
-
this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,ge.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,ge.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return Pa.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return Pa.NULL_DISPOSE}onDidSaveTextDocument(){
|
|
1170
|
-
return Pa.NULL_DISPOSE}}Pa.NULL_DISPOSE=Object.freeze({dispose:()=>{}});function R4(t){return hp.merge(jR(t),k4(t))}function k4(t){return{lsp:{CompletionProvider:e=>new _T(e),DocumentSymbolProvider:e=>new o4(e),HoverProvider:e=>new f4(e),FoldingRangeProvider:e=>new u4(e),ReferencesProvider:e=>new E4(e),DefinitionProvider:e=>new s4(e),DocumentHighlightProvider:e=>new PT(e),RenameProvider:e=>new $4(e)},shared:()=>t.shared}}function T4(t){return hp.merge(GR(t),C4(t))}function C4(t){return{lsp:{Connection:()=>t.
|
|
1171
|
-
connection,LanguageServer:e=>new w4(e),DocumentUpdateHandler:e=>new a4(e),WorkspaceSymbolProvider:e=>new FT(e),NodeKindProvider:()=>new b4,FuzzyMatcher:()=>new c4},workspace:{TextDocuments:()=>new MT(lp),NotebookDocuments:e=>new D4(e.workspace.TextDocuments)}}}class A4{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new S4(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){
|
|
1172
|
-
const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var o;return(o=s.line)!==null&&o!==void 0?o:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var o;return(o=s.token.startLine)!==null&&o!==void 0?o: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.
|
|
1173
|
-
isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(a,u,c)=>{var l,f;const d=this.nodeModeToKey(a,u),p=i.get(d),h=(l=c.options.priority)!==null&&l!==void 0?l:0,v=(f=p?.options.priority)!==null&&f!==void 0?f:0;(!p||v<=h)&&i.set(d,c)};this.collector=s,this.iterateAstFormatting(e,r);const o=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,o)}avoidOverlappingEdits(e,n){const r=[];
|
|
1174
|
-
for(const i of n){let s=r[r.length-1];for(;s;){const o=e.offsetAt(i.range.start),a=e.offsetAt(s.range.end);if(o<a)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=Or(r).iterator();let s;do if(s=i.next(),!s.done){const o=s.value;this.insideRange(o.$cstNode.range,n)?this.format(o):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||
|
|
1175
|
-
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},o=[],u=this.iterateCstTree(e,s).iterator();let c,l;do if(l=u.next(),!l.done){const f=l.value,d=ws(f),p=this.nodeModeToKey(f,"prepend"),h=n.get(p);if(n.delete(p),h){const y=this.createTextEdit(
|
|
1176
|
-
c,f,h,s);for(const E of y)E&&this.insideRange(E.range,i)&&o.push(E)}const v=this.nodeModeToKey(f,"append"),b=n.get(v);if(n.delete(v),b){const y=R1(f);if(y){const E=this.createTextEdit(f,y,b,s);for(const R of E)R&&this.insideRange(R.range,i)&&o.push(R)}}if(!h&&f.hidden){const y=this.createHiddenTextEdits(c,f,void 0,s);for(const E of y)E&&this.insideRange(E.range,i)&&o.push(E)}d&&(c=f)}while(!l.done);return o}createHiddenTextEdits(e,n,r,i){var s;const o=n.range.start.line;if(e&&e.range.end.line===
|
|
1177
|
-
o)return[];const a=[],u={start:{character:0,line:o},end:n.range.start},c=i.document.getText(u),l=this.findFittingMove(u,(s=r?.moves)!==null&&s!==void 0?s:[],i),f=this.getExistingIndentationCharacterCount(c,i),p=this.getIndentationCharacterCount(i,l)-f;if(p===0)return[];let h="";p>0&&(h=(i.options.insertSpaces?" ":" ").repeat(p));const v=n.text.split(`
|
|
1178
|
-
`);v[0]=c+v[0];for(let b=0;b<v.length;b++){const y=o+b,E={character:0,line:y};if(p>0)a.push({newText:h,range:{start:E,end:E}});else{const R=v[b];let A=0;for(;A<R.length;A++){const N=R.charAt(A);if(N!==" "&&N!==" ")break}a.push({newText:"",range:{start:E,end:{line:y,character:Math.min(A,Math.abs(p))}}})}}return a}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){
|
|
1179
|
-
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 o={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},a=this.findFittingMove(o,r.moves,i);if(!a)return[];const u=a.characters,c=a.lines,l=a.
|
|
1180
|
-
tabs,f=i.indentation;i.indentation+=l??0;const d=[];return u!==void 0?e?.hidden||d.push(this.createSpaceTextEdit(o,u,r.options)):c!==void 0?d.push(this.createLineTextEdit(o,c,i,r.options)):l!==void 0&&d.push(this.createTabTextEdit(o,!!e,i)),ws(n)&&(i.indentation=f),d}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.
|
|
1181
|
-
fitIntoOptions(n,s,i);const a=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
|
|
1182
|
-
`.repeat(n)}${a}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),o=n?1:0,a=Math.max(e.end.line-e.start.line,o);return{newText:`${`
|
|
1183
|
-
`.repeat(a)}${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 _o(i,s=>this.iterateCst(s,n)):bs}iterateCst(e,n){if(!Mi(e))return bs;const r=n.indentation;
|
|
1184
|
-
return new Zt(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,Pn))}}class S4{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new Sr(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new Sr(n,this.collector)}property(e,n){const r=dn(this.astNode.$cstNode,e,n);return new Sr(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=No(this.astNode.
|
|
1185
|
-
$cstNode,r);n.push(...i)}return new Sr(n,this.collector)}keyword(e,n){const r=Eu(this.astNode.$cstNode,e,n);return new Sr(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Ym(this.astNode.$cstNode,r);n.push(...i)}return new Sr(n,this.collector)}cst(e){return new Sr([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new Sr([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new Sr(k1(s,o),this.
|
|
1186
|
-
collector)}}class Sr{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 Sr(this.nodes.slice(e,n),this.collector)}}var Ki;(function(t){function e(...l){return{options:{},moves:l.flatMap(f=>f.moves).sort(c)}}t.fit=e;function n(l){
|
|
1187
|
-
return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,f){return{options:f??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return o(1,l)}t.newLine=s;function o(l,f){return{options:f??{},moves:[{lines:l}]}}t.newLines=o;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function u(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=u;function c(l,f){var d,p,h,v,b,y;const E=(d=l.lines)!==null&&d!==void 0?d:0,R=(p=f.lines)!==null&&p!==void 0?p:0,A=(h=
|
|
1188
|
-
l.tabs)!==null&&h!==void 0?h:0,N=(v=f.tabs)!==null&&v!==void 0?v:0,K=(b=l.characters)!==null&&b!==void 0?b:0,J=(y=f.characters)!==null&&y!==void 0?y:0;return E<R?-1:E>R?1:A<N?-1:A>N?1:K<J?-1:K>J?1:0}})(Ki||(Ki={}));var Hy,BT;function _4(){return BT||(BT=1,Hy=TT()),Hy}_4();var Qs={},kc={},Tc={},Zs={},$r={},bi={},qT;function jT(){if(qT)return bi;qT=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.normalizePath=bi.convertSlashes=bi.cleanPath=void 0;const t=Oi;function e(s){let o=(0,t.normalize)(
|
|
1189
|
-
s);return o.length>1&&o[o.length-1]===t.sep&&(o=o.substring(0,o.length-1)),o}bi.cleanPath=e;const n=/[\\/]/g;function r(s,o){return s.replace(n,o)}bi.convertSlashes=r;function i(s,o){const{resolvePaths:a,normalizePath:u,pathSeparator:c}=o,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,t.resolve)(s)),(u||l)&&(s=e(s)),s===".")return"";const f=s[s.length-1]!==c;return r(f?s+c:s,c)}return bi.normalizePath=i,bi}var Ei={},GT;function P4(){if(GT)return Ei;GT=1,Object.defineProperty(
|
|
1190
|
-
Ei,"__esModule",{value:!0}),Ei.build=Ei.joinDirectoryPath=Ei.joinPathWithBasePath=void 0;const t=Oi,e=jT();function n(a,u){return u+a}Ei.joinPathWithBasePath=n;function r(a,u){return function(c,l){return l.startsWith(a)?l.replace(a,"")+c:(0,e.convertSlashes)((0,t.relative)(a,l),u.pathSeparator)+u.pathSeparator+c}}function i(a){return a}function s(a,u,c){return u+a+c}Ei.joinDirectoryPath=s;function o(a,u){const{relativePaths:c,includeBasePath:l}=u;return c&&a?r(a,u):l?n:i}return Ei.build=o,Ei}var Cc={},
|
|
1191
|
-
UT;function x4(){if(UT)return Cc;UT=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.build=void 0;function t(o){return function(a,u){u.push(a.substring(o.length)||".")}}function e(o){return function(a,u,c){const l=a.substring(o.length)||".";c.every(f=>f(l,!0))&&u.push(l)}}const n=(o,a)=>{a.push(o||".")},r=(o,a,u)=>{const c=o||".";u.every(l=>l(c,!0))&&a.push(c)},i=()=>{};function s(o,a){const{includeDirs:u,filters:c,relativePaths:l}=a;return u?l?c&&c.length?e(o):t(o):c&&c.length?r:n:i}return Cc.
|
|
1192
|
-
build=s,Cc}var Ac={},WT;function N4(){if(WT)return Ac;WT=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.build=void 0;const t=(o,a,u,c)=>{c.every(l=>l(o,!1))&&u.files++},e=(o,a,u,c)=>{c.every(l=>l(o,!1))&&a.push(o)},n=(o,a,u,c)=>{u.files++},r=(o,a)=>{a.push(o)},i=()=>{};function s(o){const{excludeFiles:a,filters:u,onlyCounts:c}=o;return a?i:u&&u.length?c?t:e:c?n:r}return Ac.build=s,Ac}var Sc={},zT;function I4(){if(zT)return Sc;zT=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.build=
|
|
1193
|
-
void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return Sc.build=n,Sc}var _c={},HT;function O4(){if(HT)return _c;HT=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.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 _c.build=n,_c}var eo={},VT;function L4(){if(VT)return eo;VT=1;var t=eo&&eo.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(eo,"__esModule",{value:!0}),
|
|
1194
|
-
eo.build=void 0;const e=t(Na),n=Oi,r=function(u,c,l){const{queue:f,options:{suppressErrors:d}}=c;f.enqueue(),e.default.realpath(u,(p,h)=>{if(p)return f.dequeue(d?null:p,c);e.default.stat(h,(v,b)=>{if(v)return f.dequeue(d?null:v,c);if(b.isDirectory()&&o(u,h,c))return f.dequeue(null,c);l(b,h),f.dequeue(null,c)})})},i=function(u,c,l){const{queue:f,options:{suppressErrors:d}}=c;f.enqueue();try{const p=e.default.realpathSync(u),h=e.default.statSync(p);if(h.isDirectory()&&o(u,p,c))return;l(h,p)}catch(p){
|
|
1195
|
-
if(!d)throw p}};function s(u,c){return!u.resolveSymlinks||u.excludeSymlinks?null:c?i:r}eo.build=s;function o(u,c,l){if(l.options.useRealPaths)return a(c,l);let f=(0,n.dirname)(u),d=1;for(;f!==l.root&&d<2;){const p=l.symlinks.get(f);!!p&&(p===c||p.startsWith(c)||c.startsWith(p))?d++:f=(0,n.dirname)(f)}return l.symlinks.set(u,c),d>1}function a(u,c){return c.visited.includes(u+c.options.pathSeparator)}return eo}var Pc={},KT;function F4(){if(KT)return Pc;KT=1,Object.defineProperty(Pc,"__esModule",{value:!0}),
|
|
1196
|
-
Pc.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,f,d)=>(u(f,d,l.counts,l.options.suppressErrors),null),s=(l,f,d)=>(u(f,d,l.paths,l.options.suppressErrors),null),o=(l,f,d)=>(u(f,d,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),a=(l,f,d)=>(u(f,d,l.groups,l.options.suppressErrors),null);function u(l,f,d,p){f(l&&!p?l:null,d)}function c(l,f){const{onlyCounts:d,group:p,maxFiles:h}=l;return d?f?t:i:p?f?e:a:h?f?r:o:f?n:s}return Pc.
|
|
1197
|
-
build=c,Pc}var to={},XT;function M4(){if(XT)return to;XT=1;var t=to&&to.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(to,"__esModule",{value:!0}),to.build=void 0;const e=t(Na),n={withFileTypes:!0},r=(o,a,u,c,l)=>{if(c<0)return o.queue.dequeue(null,o);o.visited.push(a),o.counts.directories++,o.queue.enqueue(),e.default.readdir(a||".",n,(f,d=[])=>{l(d,u,c),o.queue.dequeue(o.options.suppressErrors?null:f,o)})},i=(o,a,u,c,l)=>{if(c<0)return;o.visited.push(a),
|
|
1198
|
-
o.counts.directories++;let f=[];try{f=e.default.readdirSync(a||".",n)}catch(d){if(!o.options.suppressErrors)throw d}l(f,u,c)};function s(o){return o?i:r}return to.build=s,to}var xc={},YT;function B4(){if(YT)return xc;YT=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.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 xc.Queue=t,xc}var Nc={},JT;function q4(){if(JT)return Nc;JT=
|
|
1199
|
-
1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.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 Nc.Counter=t,Nc}var QT;function ZT(){if(QT)return $r;QT=1;var t=$r&&$r.__createBinding||(Object.create?function(b,y,E,R){R===void 0&&(R=E);var A=Object.getOwnPropertyDescriptor(y,E);(!A||("get"in A?!y.__esModule:A.
|
|
1200
|
-
writable||A.configurable))&&(A={enumerable:!0,get:function(){return y[E]}}),Object.defineProperty(b,R,A)}:function(b,y,E,R){R===void 0&&(R=E),b[R]=y[E]}),e=$r&&$r.__setModuleDefault||(Object.create?function(b,y){Object.defineProperty(b,"default",{enumerable:!0,value:y})}:function(b,y){b.default=y}),n=$r&&$r.__importStar||function(b){if(b&&b.__esModule)return b;var y={};if(b!=null)for(var E in b)E!=="default"&&Object.prototype.hasOwnProperty.call(b,E)&&t(y,b,E);return e(y,b),y};Object.defineProperty(
|
|
1201
|
-
$r,"__esModule",{value:!0}),$r.Walker=void 0;const r=Oi,i=jT(),s=n(P4()),o=n(x4()),a=n(N4()),u=n(I4()),c=n(O4()),l=n(L4()),f=n(F4()),d=n(M4()),p=B4(),h=q4();class v{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(y,E,R){this.isSynchronous=!R,this.callbackInvoker=f.build(E,this.isSynchronous),this.root=(0,i.normalizePath)(y,E),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new h.Counter,
|
|
1202
|
-
options:E,queue:new p.Queue((A,N)=>this.callbackInvoker(N,A,R)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,E),this.pushDirectory=o.build(this.root,E),this.pushFile=a.build(E),this.getArray=u.build(E),this.groupFiles=c.build(E),this.resolveSymlink=l.build(E,this.isSynchronous),this.walkDirectory=d.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.
|
|
1203
|
-
state,null):null}walk=(y,E,R)=>{const{paths:A,options:{filters:N,resolveSymlinks:K,excludeSymlinks:J,exclude:se,maxFiles:ie,signal:we,useRealPaths:B,pathSeparator:T}}=this.state;if(we&&we.aborted||ie&&A.length>ie)return;this.pushDirectory(E,A,N);const D=this.getArray(this.state.paths);for(let M=0;M<y.length;++M){const S=y[M];if(S.isFile()||S.isSymbolicLink()&&!K&&!J){const P=this.joinPath(S.name,E);this.pushFile(P,D,this.state.counts,N)}else if(S.isDirectory()){let P=s.joinDirectoryPath(S.name,E,
|
|
1204
|
-
this.state.options.pathSeparator);if(se&&se(S.name,P))continue;this.walkDirectory(this.state,P,P,R-1,this.walk)}else if(S.isSymbolicLink()&&this.resolveSymlink){let P=s.joinPathWithBasePath(S.name,E);this.resolveSymlink(P,this.state,(O,Z)=>{if(O.isDirectory()){if(Z=(0,i.normalizePath)(Z,this.state.options),se&&se(S.name,B?Z:P+T))return;this.walkDirectory(this.state,Z,B?Z:P+T,R-1,this.walk)}else{Z=B?Z:P;const H=(0,r.basename)(Z),C=(0,i.normalizePath)((0,r.dirname)(Z),this.state.options);Z=this.joinPath(
|
|
1205
|
-
H,C),this.pushFile(Z,D,this.state.counts,N)}})}}this.groupFiles(this.state.groups,E,D)}}return $r.Walker=v,$r}var eC;function j4(){if(eC)return Zs;eC=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.callback=Zs.promise=void 0;const t=ZT();function e(r,i){return new Promise((s,o)=>{n(r,i,(a,u)=>{if(a)return o(a);s(u)})})}Zs.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return Zs.callback=n,Zs}var Ic={},tC;function G4(){if(tC)return Ic;tC=1,Object.defineProperty(Ic,"__esModule",{value:!0}),
|
|
1206
|
-
Ic.sync=void 0;const t=ZT();function e(n,r){return new t.Walker(n,r).start()}return Ic.sync=e,Ic}var nC;function U4(){if(nC)return Tc;nC=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.APIBuilder=void 0;const t=j4(),e=G4();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 Tc.APIBuilder=n,Tc}var Vy={},Ky,rC;
|
|
1207
|
-
function Dp(){if(rC)return Ky;rC=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",o="(?=.)",a="[^/]",u=`(?:${s}|$)`,c=`(?:^|${s})`,l=`${n}{1,2}${u}`,f=`(?!${n})`,d=`(?!${c}${l})`,p=`(?!${n}{0,1}${u})`,h=`(?!${l})`,v=`[^.${s}]`,b=`${a}*?`,E={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:a,END_ANCHOR:u,DOTS_SLASH:l,NO_DOT:f,NO_DOTS:d,NO_DOT_SLASH:p,NO_DOTS_SLASH:h,QMARK_NO_DOT:v,STAR:b,START_ANCHOR:c,SEP:"/"},R={...E,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}\
|
|
1208
|
-
*?`,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:"\\"},A={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",
|
|
1209
|
-
upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Ky={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:A,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,
|
|
1210
|
-
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,
|
|
1211
|
-
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(N){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${N.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"\
|
|
1212
|
-
(?:",close:")"}}},globChars(N){return N===!0?R:E}},Ky}var iC;function Rp(){return iC||(iC=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Dp();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.
|
|
1213
|
-
platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,o=>o==="\\"?"":o),t.escapeLast=(s,o,a)=>{const u=s.lastIndexOf(o,a);return u===-1?s:s[u-1]==="\\"?t.escapeLast(s,o,u-1):`${s.slice(0,u)}\\${s.slice(u)}`},t.removePrefix=(s,o={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),o.prefix="./"),a},t.wrapOutput=(s,o={},a={})=>{const u=a.contains?"":"^",c=a.contains?"":"$";let l=`${u}\
|
|
1214
|
-
(?:${s})${c}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:o}={})=>{const a=s.split(o?/[\\/]/:"/"),u=a[a.length-1];return u===""?a[a.length-2]:u}}(Vy)),Vy}var Xy,sC;function W4(){if(sC)return Xy;sC=1;const t=Rp(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:d,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:h,
|
|
1215
|
-
CHAR_RIGHT_SQUARE_BRACKET:v}=Dp(),b=R=>R===a||R===r,y=R=>{R.isPrefix!==!0&&(R.depth=R.isGlobstar?1/0:1)};return Xy=(R,A)=>{const N=A||{},K=R.length-1,J=N.parts===!0||N.scanToEnd===!0,se=[],ie=[],we=[];let B=R,T=-1,D=0,M=0,S=!1,P=!1,O=!1,Z=!1,H=!1,C=!1,ne=!1,ye=!1,Pe=!1,F=!1,V=0,Se,le,$e={value:"",depth:0,isGlob:!1};const xe=()=>T>=K,de=()=>B.charCodeAt(T+1),I=()=>(Se=le,B.charCodeAt(++T));for(;T<K;){le=I();let Ke;if(le===r){ne=$e.backslashes=!0,le=I(),le===u&&(C=!0);continue}if(C===!0||le===u){for(V++;xe()!==
|
|
1216
|
-
!0&&(le=I());){if(le===r){ne=$e.backslashes=!0,I();continue}if(le===u){V++;continue}if(C!==!0&&le===s&&(le=I())===s){if(S=$e.isBrace=!0,O=$e.isGlob=!0,F=!0,J===!0)continue;break}if(C!==!0&&le===i){if(S=$e.isBrace=!0,O=$e.isGlob=!0,F=!0,J===!0)continue;break}if(le===p&&(V--,V===0)){C=!1,S=$e.isBrace=!0,F=!0;break}}if(J===!0)continue;break}if(le===a){if(se.push(T),ie.push($e),$e={value:"",depth:0,isGlob:!1},F===!0)continue;if(Se===s&&T===D+1){D+=2;continue}M=T+1;continue}if(N.noext!==!0&&(le===f||
|
|
1217
|
-
le===n||le===e||le===d||le===o)===!0&&de()===c){if(O=$e.isGlob=!0,Z=$e.isExtglob=!0,F=!0,le===o&&T===D&&(Pe=!0),J===!0){for(;xe()!==!0&&(le=I());){if(le===r){ne=$e.backslashes=!0,le=I();continue}if(le===h){O=$e.isGlob=!0,F=!0;break}}continue}break}if(le===e){if(Se===e&&(H=$e.isGlobstar=!0),O=$e.isGlob=!0,F=!0,J===!0)continue;break}if(le===d){if(O=$e.isGlob=!0,F=!0,J===!0)continue;break}if(le===l){for(;xe()!==!0&&(Ke=I());){if(Ke===r){ne=$e.backslashes=!0,I();continue}if(Ke===v){P=$e.isBracket=!0,
|
|
1218
|
-
O=$e.isGlob=!0,F=!0;break}}if(J===!0)continue;break}if(N.nonegate!==!0&&le===o&&T===D){ye=$e.negated=!0,D++;continue}if(N.noparen!==!0&&le===c){if(O=$e.isGlob=!0,J===!0){for(;xe()!==!0&&(le=I());){if(le===c){ne=$e.backslashes=!0,le=I();continue}if(le===h){F=!0;break}}continue}break}if(O===!0){if(F=!0,J===!0)continue;break}}N.noext===!0&&(Z=!1,O=!1);let G=B,pe="",U="";D>0&&(pe=B.slice(0,D),B=B.slice(D),M-=D),G&&O===!0&&M>0?(G=B.slice(0,M),U=B.slice(M)):O===!0?(G="",U=B):G=B,G&&G!==""&&G!=="/"&&G!==
|
|
1219
|
-
B&&b(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),N.unescape===!0&&(U&&(U=t.removeBackslashes(U)),G&&ne===!0&&(G=t.removeBackslashes(G)));const fe={prefix:pe,input:R,start:D,base:G,glob:U,isBrace:S,isBracket:P,isGlob:O,isExtglob:Z,isGlobstar:H,negated:ye,negatedExtglob:Pe};if(N.tokens===!0&&(fe.maxDepth=0,b(le)||ie.push($e),fe.tokens=ie),N.parts===!0||N.tokens===!0){let Ke;for(let it=0;it<se.length;it++){const ue=Ke?Ke+1:D,Oe=se[it],re=R.slice(ue,Oe);N.tokens&&(it===0&&D!==0?(ie[it].isPrefix=!0,
|
|
1220
|
-
ie[it].value=pe):ie[it].value=re,y(ie[it]),fe.maxDepth+=ie[it].depth),(it!==0||re!=="")&&we.push(re),Ke=Oe}if(Ke&&Ke+1<R.length){const it=R.slice(Ke+1);we.push(it),N.tokens&&(ie[ie.length-1].value=it,y(ie[ie.length-1]),fe.maxDepth+=ie[ie.length-1].depth)}fe.slashes=se,fe.parts=we}return fe},Xy}var Yy,oC;function z4(){if(oC)return Yy;oC=1;const t=Dp(),e=Rp(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(l,f)=>{if(typeof f.expandRange==
|
|
1221
|
-
"function")return f.expandRange(...l,f);l.sort();const d=`[${l.join("-")}]`;try{new RegExp(d)}catch{return l.map(h=>e.escapeRegex(h)).join("..")}return d},u=(l,f)=>`Missing ${l}: "${f}" - use "\\\\${f}" to match literal characters`,c=(l,f)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;const d={...f},p=typeof d.maxLength=="number"?Math.min(n,d.maxLength):n;let h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);const v={
|
|
1222
|
-
type:"bos",value:"",output:d.prepend||""},b=[v],y=d.capture?"":"?:",E=t.globChars(d.windows),R=t.extglobChars(E),{DOT_LITERAL:A,PLUS_LITERAL:N,SLASH_LITERAL:K,ONE_CHAR:J,DOTS_SLASH:se,NO_DOT:ie,NO_DOT_SLASH:we,NO_DOTS_SLASH:B,QMARK:T,QMARK_NO_DOT:D,STAR:M,START_ANCHOR:S}=E,P=ue=>`(${y}(?:(?!${S}${ue.dot?se:A}).)*?)`,O=d.dot?"":ie,Z=d.dot?T:D;let H=d.bash===!0?P(d):M;d.capture&&(H=`(${H})`),typeof d.noext=="boolean"&&(d.noextglob=d.noext);const C={input:l,index:-1,start:0,dot:d.dot===!0,consumed:"",
|
|
1223
|
-
output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};l=e.removePrefix(l,C),h=l.length;const ne=[],ye=[],Pe=[];let F=v,V;const Se=()=>C.index===h-1,le=C.peek=(ue=1)=>l[C.index+ue],$e=C.advance=()=>l[++C.index]||"",xe=()=>l.slice(C.index+1),de=(ue="",Oe=0)=>{C.consumed+=ue,C.index+=Oe},I=ue=>{C.output+=ue.output!=null?ue.output:ue.value,de(ue.value)},G=()=>{let ue=1;for(;le()==="!"&&(le(2)!=="("||le(3)==="?");)$e(),C.start++,ue++;return ue%2===0?!1:
|
|
1224
|
-
(C.negated=!0,C.start++,!0)},pe=ue=>{C[ue]++,Pe.push(ue)},U=ue=>{C[ue]--,Pe.pop()},fe=ue=>{if(F.type==="globstar"){const Oe=C.braces>0&&(ue.type==="comma"||ue.type==="brace"),re=ue.extglob===!0||ne.length&&(ue.type==="pipe"||ue.type==="paren");ue.type!=="slash"&&ue.type!=="paren"&&!Oe&&!re&&(C.output=C.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=H,C.output+=F.output)}if(ne.length&&ue.type!=="paren"&&(ne[ne.length-1].inner+=ue.value),(ue.value||ue.output)&&I(ue),F&&F.type===
|
|
1225
|
-
"text"&&ue.type==="text"){F.output=(F.output||F.value)+ue.value,F.value+=ue.value;return}ue.prev=F,b.push(ue),F=ue},Ke=(ue,Oe)=>{const re={...R[Oe],conditions:1,inner:""};re.prev=F,re.parens=C.parens,re.output=C.output;const De=(d.capture?"(":"")+re.open;pe("parens"),fe({type:ue,value:Oe,output:C.output?"":J}),fe({type:"paren",extglob:!0,value:$e(),output:De}),ne.push(re)},it=ue=>{let Oe=ue.close+(d.capture?")":""),re;if(ue.type==="negate"){let De=H;if(ue.inner&&ue.inner.length>1&&ue.inner.includes(
|
|
1226
|
-
"/")&&(De=P(d)),(De!==H||Se()||/^\)+$/.test(xe()))&&(Oe=ue.close=`)$))${De}`),ue.inner.includes("*")&&(re=xe())&&/^\.[^\\/.]+$/.test(re)){const Ge=c(re,{...f,fastpaths:!1}).output;Oe=ue.close=`)${Ge})${De})`}ue.prev.type==="bos"&&(C.negatedExtglob=!0)}fe({type:"paren",extglob:!0,value:V,output:Oe}),U("parens")};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let ue=!1,Oe=l.replace(s,(re,De,Ge,vt,et,Kt)=>vt==="\\"?(ue=!0,re):vt==="?"?De?De+vt+(et?T.repeat(et.length):""):Kt===0?Z+(et?T.repeat(
|
|
1227
|
-
et.length):""):T.repeat(Ge.length):vt==="."?A.repeat(Ge.length):vt==="*"?De?De+vt+(et?H:""):H:De?re:`\\${re}`);return ue===!0&&(d.unescape===!0?Oe=Oe.replace(/\\/g,""):Oe=Oe.replace(/\\+/g,re=>re.length%2===0?"\\\\":re?"\\":"")),Oe===l&&d.contains===!0?(C.output=l,C):(C.output=e.wrapOutput(Oe,C,f),C)}for(;!Se();){if(V=$e(),V==="\0")continue;if(V==="\\"){const re=le();if(re==="/"&&d.bash!==!0||re==="."||re===";")continue;if(!re){V+="\\",fe({type:"text",value:V});continue}const De=/^\\+/.exec(xe());
|
|
1228
|
-
let Ge=0;if(De&&De[0].length>2&&(Ge=De[0].length,C.index+=Ge,Ge%2!==0&&(V+="\\")),d.unescape===!0?V=$e():V+=$e(),C.brackets===0){fe({type:"text",value:V});continue}}if(C.brackets>0&&(V!=="]"||F.value==="["||F.value==="[^")){if(d.posix!==!1&&V===":"){const re=F.value.slice(1);if(re.includes("[")&&(F.posix=!0,re.includes(":"))){const De=F.value.lastIndexOf("["),Ge=F.value.slice(0,De),vt=F.value.slice(De+2),et=r[vt];if(et){F.value=Ge+et,C.backtrack=!0,$e(),!v.output&&b.indexOf(F)===1&&(v.output=J);
|
|
1229
|
-
continue}}}(V==="["&&le()!==":"||V==="-"&&le()==="]")&&(V=`\\${V}`),V==="]"&&(F.value==="["||F.value==="[^")&&(V=`\\${V}`),d.posix===!0&&V==="!"&&F.value==="["&&(V="^"),F.value+=V,I({value:V});continue}if(C.quotes===1&&V!=='"'){V=e.escapeRegex(V),F.value+=V,I({value:V});continue}if(V==='"'){C.quotes=C.quotes===1?0:1,d.keepQuotes===!0&&fe({type:"text",value:V});continue}if(V==="("){pe("parens"),fe({type:"paren",value:V});continue}if(V===")"){if(C.parens===0&&d.strictBrackets===!0)throw new SyntaxError(
|
|
1230
|
-
u("opening","("));const re=ne[ne.length-1];if(re&&C.parens===re.parens+1){it(ne.pop());continue}fe({type:"paren",value:V,output:C.parens?")":"\\)"}),U("parens");continue}if(V==="["){if(d.nobracket===!0||!xe().includes("]")){if(d.nobracket!==!0&&d.strictBrackets===!0)throw new SyntaxError(u("closing","]"));V=`\\${V}`}else pe("brackets");fe({type:"bracket",value:V});continue}if(V==="]"){if(d.nobracket===!0||F&&F.type==="bracket"&&F.value.length===1){fe({type:"text",value:V,output:`\\${V}`});continue}
|
|
1231
|
-
if(C.brackets===0){if(d.strictBrackets===!0)throw new SyntaxError(u("opening","["));fe({type:"text",value:V,output:`\\${V}`});continue}U("brackets");const re=F.value.slice(1);if(F.posix!==!0&&re[0]==="^"&&!re.includes("/")&&(V=`/${V}`),F.value+=V,I({value:V}),d.literalBrackets===!1||e.hasRegexChars(re))continue;const De=e.escapeRegex(F.value);if(C.output=C.output.slice(0,-F.value.length),d.literalBrackets===!0){C.output+=De,F.value=De;continue}F.value=`(${y}${De}|${F.value})`,C.output+=F.value;continue}
|
|
1232
|
-
if(V==="{"&&d.nobrace!==!0){pe("braces");const re={type:"brace",value:V,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};ye.push(re),fe(re);continue}if(V==="}"){const re=ye[ye.length-1];if(d.nobrace===!0||!re){fe({type:"text",value:V,output:V});continue}let De=")";if(re.dots===!0){const Ge=b.slice(),vt=[];for(let et=Ge.length-1;et>=0&&(b.pop(),Ge[et].type!=="brace");et--)Ge[et].type!=="dots"&&vt.unshift(Ge[et].value);De=a(vt,d),C.backtrack=!0}if(re.comma!==!0&&re.dots!==!0){const Ge=C.
|
|
1233
|
-
output.slice(0,re.outputIndex),vt=C.tokens.slice(re.tokensIndex);re.value=re.output="\\{",V=De="\\}",C.output=Ge;for(const et of vt)C.output+=et.output||et.value}fe({type:"brace",value:V,output:De}),U("braces"),ye.pop();continue}if(V==="|"){ne.length>0&&ne[ne.length-1].conditions++,fe({type:"text",value:V});continue}if(V===","){let re=V;const De=ye[ye.length-1];De&&Pe[Pe.length-1]==="braces"&&(De.comma=!0,re="|"),fe({type:"comma",value:V,output:re});continue}if(V==="/"){if(F.type==="dot"&&C.index===
|
|
1234
|
-
C.start+1){C.start=C.index+1,C.consumed="",C.output="",b.pop(),F=v;continue}fe({type:"slash",value:V,output:K});continue}if(V==="."){if(C.braces>0&&F.type==="dot"){F.value==="."&&(F.output=A);const re=ye[ye.length-1];F.type="dots",F.output+=V,F.value+=V,re.dots=!0;continue}if(C.braces+C.parens===0&&F.type!=="bos"&&F.type!=="slash"){fe({type:"text",value:V,output:A});continue}fe({type:"dot",value:V,output:A});continue}if(V==="?"){if(!(F&&F.value==="(")&&d.noextglob!==!0&&le()==="("&&le(2)!=="?"){
|
|
1235
|
-
Ke("qmark",V);continue}if(F&&F.type==="paren"){const De=le();let Ge=V;(F.value==="("&&!/[!=<:]/.test(De)||De==="<"&&!/<([!=]|\w+>)/.test(xe()))&&(Ge=`\\${V}`),fe({type:"text",value:V,output:Ge});continue}if(d.dot!==!0&&(F.type==="slash"||F.type==="bos")){fe({type:"qmark",value:V,output:D});continue}fe({type:"qmark",value:V,output:T});continue}if(V==="!"){if(d.noextglob!==!0&&le()==="("&&(le(2)!=="?"||!/[!=<:]/.test(le(3)))){Ke("negate",V);continue}if(d.nonegate!==!0&&C.index===0){G();continue}}if(V===
|
|
1236
|
-
"+"){if(d.noextglob!==!0&&le()==="("&&le(2)!=="?"){Ke("plus",V);continue}if(F&&F.value==="("||d.regex===!1){fe({type:"plus",value:V,output:N});continue}if(F&&(F.type==="bracket"||F.type==="paren"||F.type==="brace")||C.parens>0){fe({type:"plus",value:V});continue}fe({type:"plus",value:N});continue}if(V==="@"){if(d.noextglob!==!0&&le()==="("&&le(2)!=="?"){fe({type:"at",extglob:!0,value:V,output:""});continue}fe({type:"text",value:V});continue}if(V!=="*"){(V==="$"||V==="^")&&(V=`\\${V}`);const re=i.
|
|
1237
|
-
exec(xe());re&&(V+=re[0],C.index+=re[0].length),fe({type:"text",value:V});continue}if(F&&(F.type==="globstar"||F.star===!0)){F.type="star",F.star=!0,F.value+=V,F.output=H,C.backtrack=!0,C.globstar=!0,de(V);continue}let ue=xe();if(d.noextglob!==!0&&/^\([^?]/.test(ue)){Ke("star",V);continue}if(F.type==="star"){if(d.noglobstar===!0){de(V);continue}const re=F.prev,De=re.prev,Ge=re.type==="slash"||re.type==="bos",vt=De&&(De.type==="star"||De.type==="globstar");if(d.bash===!0&&(!Ge||ue[0]&&ue[0]!=="/")){
|
|
1238
|
-
fe({type:"star",value:V,output:""});continue}const et=C.braces>0&&(re.type==="comma"||re.type==="brace"),Kt=ne.length&&(re.type==="pipe"||re.type==="paren");if(!Ge&&re.type!=="paren"&&!et&&!Kt){fe({type:"star",value:V,output:""});continue}for(;ue.slice(0,3)==="/**";){const en=l[C.index+4];if(en&&en!=="/")break;ue=ue.slice(3),de("/**",3)}if(re.type==="bos"&&Se()){F.type="globstar",F.value+=V,F.output=P(d),C.output=F.output,C.globstar=!0,de(V);continue}if(re.type==="slash"&&re.prev.type!=="bos"&&!vt&&
|
|
1239
|
-
Se()){C.output=C.output.slice(0,-(re.output+F.output).length),re.output=`(?:${re.output}`,F.type="globstar",F.output=P(d)+(d.strictSlashes?")":"|$)"),F.value+=V,C.globstar=!0,C.output+=re.output+F.output,de(V);continue}if(re.type==="slash"&&re.prev.type!=="bos"&&ue[0]==="/"){const en=ue[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(re.output+F.output).length),re.output=`(?:${re.output}`,F.type="globstar",F.output=`${P(d)}${K}|${K}${en})`,F.value+=V,C.output+=re.output+F.output,C.globstar=!0,de(
|
|
1240
|
-
V+$e()),fe({type:"slash",value:"/",output:""});continue}if(re.type==="bos"&&ue[0]==="/"){F.type="globstar",F.value+=V,F.output=`(?:^|${K}|${P(d)}${K})`,C.output=F.output,C.globstar=!0,de(V+$e()),fe({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-F.output.length),F.type="globstar",F.output=P(d),F.value+=V,C.output+=F.output,C.globstar=!0,de(V);continue}const Oe={type:"star",value:V,output:H};if(d.bash===!0){Oe.output=".*?",(F.type==="bos"||F.type==="slash")&&(Oe.output=O+Oe.
|
|
1241
|
-
output),fe(Oe);continue}if(F&&(F.type==="bracket"||F.type==="paren")&&d.regex===!0){Oe.output=V,fe(Oe);continue}(C.index===C.start||F.type==="slash"||F.type==="dot")&&(F.type==="dot"?(C.output+=we,F.output+=we):d.dot===!0?(C.output+=B,F.output+=B):(C.output+=O,F.output+=O),le()!=="*"&&(C.output+=J,F.output+=J)),fe(Oe)}for(;C.brackets>0;){if(d.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C.output=e.escapeLast(C.output,"["),U("brackets")}for(;C.parens>0;){if(d.strictBrackets===!0)throw new SyntaxError(
|
|
1242
|
-
u("closing",")"));C.output=e.escapeLast(C.output,"("),U("parens")}for(;C.braces>0;){if(d.strictBrackets===!0)throw new SyntaxError(u("closing","}"));C.output=e.escapeLast(C.output,"{"),U("braces")}if(d.strictSlashes!==!0&&(F.type==="star"||F.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${K}?`}),C.backtrack===!0){C.output="";for(const ue of C.tokens)C.output+=ue.output!=null?ue.output:ue.value,ue.suffix&&(C.output+=ue.suffix)}return C};return c.fastpaths=(l,f)=>{const d={...f},p=typeof d.
|
|
1243
|
-
maxLength=="number"?Math.min(n,d.maxLength):n,h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);l=o[l]||l;const{DOT_LITERAL:v,SLASH_LITERAL:b,ONE_CHAR:y,DOTS_SLASH:E,NO_DOT:R,NO_DOTS:A,NO_DOTS_SLASH:N,STAR:K,START_ANCHOR:J}=t.globChars(d.windows),se=d.dot?A:R,ie=d.dot?N:R,we=d.capture?"":"?:",B={negated:!1,prefix:""};let T=d.bash===!0?".*?":K;d.capture&&(T=`(${T})`);const D=O=>O.noglobstar===!0?T:`(${we}(?:(?!${J}${O.dot?E:v}).)*?)`,M=O=>{switch(O){case"\
|
|
1244
|
-
*":return`${se}${y}${T}`;case".*":return`${v}${y}${T}`;case"*.*":return`${se}${T}${v}${y}${T}`;case"*/*":return`${se}${T}${b}${y}${ie}${T}`;case"**":return se+D(d);case"**/*":return`(?:${se}${D(d)}${b})?${ie}${y}${T}`;case"**/*.*":return`(?:${se}${D(d)}${b})?${ie}${T}${v}${y}${T}`;case"**/.*":return`(?:${se}${D(d)}${b})?${v}${y}${T}`;default:{const Z=/^(.*?)\.(\w+)$/.exec(O);if(!Z)return;const H=M(Z[1]);return H?H+v+Z[2]:void 0}}},S=e.removePrefix(l,B);let P=M(S);return P&&d.strictSlashes!==!0&&
|
|
1245
|
-
(P+=`${b}?`),P},Yy=c,Yy}var Jy,aC;function H4(){if(aC)return Jy;aC=1;const t=W4(),e=z4(),n=Rp(),r=Dp(),i=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,a,u=!1)=>{if(Array.isArray(o)){const b=o.map(E=>s(E,a,u));return E=>{for(const R of b){const A=R(E);if(A)return A}return!1}}const c=i(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const l=a||{},f=l.windows,d=c?s.compileRe(o,a):s.makeRe(o,a,!1,!0),p=d.state;delete d.state;
|
|
1246
|
-
let h=()=>!1;if(l.ignore){const b={...a,ignore:null,onMatch:null,onResult:null};h=s(l.ignore,b,u)}const v=(b,y=!1)=>{const{isMatch:E,match:R,output:A}=s.test(b,d,a,{glob:o,posix:f}),N={glob:o,state:p,regex:d,posix:f,input:b,output:A,match:R,isMatch:E};return typeof l.onResult=="function"&&l.onResult(N),E===!1?(N.isMatch=!1,y?N:!1):h(b)?(typeof l.onIgnore=="function"&&l.onIgnore(N),N.isMatch=!1,y?N:!1):(typeof l.onMatch=="function"&&l.onMatch(N),y?N:!0)};return u&&(v.state=p),v};return s.test=(o,a,u,{
|
|
1247
|
-
glob:c,posix:l}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const f=u||{},d=f.format||(l?n.toPosixSlashes:null);let p=o===c,h=p&&d?d(o):o;return p===!1&&(h=d?d(o):o,p=h===c),(p===!1||f.capture===!0)&&(f.matchBase===!0||f.basename===!0?p=s.matchBase(o,a,u,l):p=a.exec(h)),{isMatch:!!p,match:p,output:h}},s.matchBase=(o,a,u)=>(a instanceof RegExp?a:s.makeRe(a,u)).test(n.basename(o)),s.isMatch=(o,a,u)=>s(a,u)(o),s.parse=(o,a)=>Array.
|
|
1248
|
-
isArray(o)?o.map(u=>s.parse(u,a)):e(o,{...a,fastpaths:!1}),s.scan=(o,a)=>t(o,a),s.compileRe=(o,a,u=!1,c=!1)=>{if(u===!0)return o.output;const l=a||{},f=l.contains?"":"^",d=l.contains?"":"$";let p=`${f}(?:${o.output})${d}`;o&&o.negated===!0&&(p=`^(?!${p}).*$`);const h=s.toRegex(p,a);return c===!0&&(h.state=o),h},s.makeRe=(o,a={},u=!1,c=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&
|
|
1249
|
-
(l.output=e.fastpaths(o,a)),l.output||(l=e(o,a)),s.compileRe(l,a,u,c)},s.toRegex=(o,a)=>{try{const u=a||{};return new RegExp(o,u.flags||(u.nocase?"i":""))}catch(u){if(a&&a.debug===!0)throw u;return/$^/}},s.constants=r,Jy=s,Jy}var Qy,uC;function V4(){if(uC)return Qy;uC=1;const t=H4(),e=Rp();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),Qy=n,Qy}var cC;function K4(){if(cC)return kc;cC=1,Object.defineProperty(
|
|
1250
|
-
kc,"__esModule",{value:!0}),kc.Builder=void 0;const t=Oi,e=U4();var n=null;try{require.resolve("picomatch"),n=V4()}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(){
|
|
1251
|
-
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.
|
|
1252
|
-
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,o){return this.options={...this.options,...o},new e.APIBuilder(s||".",this.options)}glob(...s){
|
|
1253
|
-
return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...o){const a=this.globFunction||n;if(!a)throw new Error("Please specify a glob function to use glob matching.");var u=this.globCache[s.join("\0")];return u||(u=a(s,...o),this.globCache[s.join("\0")]=u),this.options.filters.push(c=>u(c)),this}}return kc.Builder=r,kc}var Zy={},lC;function X4(){return lC||(lC=1,Object.defineProperty(Zy,"__esModule",{value:!0})),Zy}var dC;function Y4(){return dC||(dC=
|
|
1254
|
-
1,function(t){var e=Qs&&Qs.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,u)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),n=Qs&&Qs.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.fdir=
|
|
1255
|
-
void 0;const r=K4();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(X4(),t)}(Qs)),Qs}var J4=Y4();class Q4{constructor(){this.encoding="utf-8"}readFile(e){return i0.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await i0.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:pt.joinPath(e,r.name)}))}}const kp="DeploymentElement";function ev(t){return z.isInstance(t,kp)}const tv="\
|
|
1256
|
-
DeploymentNodeOrElementKind",Tp="DeploymentViewRule";function Z4(t){return z.isInstance(t,Tp)}const Oc="DynamicViewRule";function Cp(t){return z.isInstance(t,Oc)}const Lc="ElementExpression";function nv(t){return z.isInstance(t,Lc)}const Ap="ElementPredicate";function e8(t){return z.isInstance(t,Ap)}const Sp="ElementPredicateOrWhere";function t8(t){return z.isInstance(t,Sp)}const _p="ElementPredicateOrWhereV2";function n8(t){return z.isInstance(t,_p)}const no="ElementProperty";function r8(t){return z.
|
|
1257
|
-
isInstance(t,no)}const rv="ExpressionV2";function i8(t){return z.isInstance(t,rv)}const iv="ExtendElementProperty",Fc="FqnExpr";function s8(t){return z.isInstance(t,Fc)}const sv="FqnReferenceable",ro="LikeC4View";function ov(t){return z.isInstance(t,ro)}const Pp="MetadataProperty";function Xi(t){return z.isInstance(t,Pp)}const av="Predicate";function o8(t){return z.isInstance(t,av)}const Mc="Referenceable",xp="RelationExpr";function fC(t){return z.isInstance(t,xp)}const Np="RelationExpression";function uv(t){
|
|
1258
|
-
return z.isInstance(t,Np)}const Ip="RelationPredicate";function a8(t){return z.isInstance(t,Ip)}const Op="RelationPredicateOrWhere";function u8(t){return z.isInstance(t,Op)}const Lp="RelationPredicateOrWhereV2";function c8(t){return z.isInstance(t,Lp)}const Bc="RelationProperty",Fp="RelationshipStyleProperty";function pC(t){return z.isInstance(t,Fp)}const cv="SizeProperty";function l8(t){return z.isInstance(t,cv)}const ea="StringProperty";function hC(t){return z.isInstance(t,ea)}const ta="StyleP\
|
|
1259
|
-
roperty";function lv(t){return z.isInstance(t,ta)}const Mp="ViewProperty";function d8(t){return z.isInstance(t,Mp)}const qc="ViewRule";function f8(t){return z.isInstance(t,qc)}const Bp="ViewRulePredicate";function qp(t){return z.isInstance(t,Bp)}const jp="ViewRuleStyleOrGlobalRef";function dv(t){return z.isInstance(t,jp)}const jc="WhereElement";function mC(t){return z.isInstance(t,jc)}const Gc="WhereElementExpression";function p8(t){return z.isInstance(t,Gc)}const gC="WhereExpression",Gp="WhereK\
|
|
1260
|
-
indEqual";function h8(t){return z.isInstance(t,Gp)}const Uc="WhereRelation";function yC(t){return z.isInstance(t,Uc)}const Wc="WhereRelationExpression";function m8(t){return z.isInstance(t,Wc)}const Up="WhereTagEqual";function g8(t){return z.isInstance(t,Up)}const zc="ArrowProperty";function Hc(t){return z.isInstance(t,zc)}const Vc="BorderProperty";function Wp(t){return z.isInstance(t,Vc)}const Kc="ColorProperty";function io(t){return z.isInstance(t,Kc)}const so="CustomColor",zp="CustomElementPr\
|
|
1261
|
-
operties";function y8(t){return z.isInstance(t,zp)}const Hp="CustomRelationProperties";function v8(t){return z.isInstance(t,Hp)}const Yi="DeployedInstance";function Bn(t){return z.isInstance(t,Yi)}const Vp="DeployedInstanceBody";function w8(t){return z.isInstance(t,Vp)}const Ur="DeploymentNode";function qn(t){return z.isInstance(t,Ur)}const Kp="DeploymentNodeBody";function b8(t){return z.isInstance(t,Kp)}const $i="DeploymentNodeKind";function E8(t){return z.isInstance(t,$i)}const Xp="DeploymentR\
|
|
1262
|
-
elation";function Ji(t){return z.isInstance(t,Xp)}const Yp="DeploymentRelationBody";function $8(t){return z.isInstance(t,Yp)}const Xc="DeploymentView";function fv(t){return z.isInstance(t,Xc)}const Jp="DeploymentViewBody";function D8(t){return z.isInstance(t,Jp)}const Yc="DeploymentViewRulePredicate";function na(t){return z.isInstance(t,Yc)}const Qp="DeploymentViewRulePredicateExpression";function R8(t){return z.isInstance(t,Qp)}const Jc="DeploymentViewRuleStyle";function vC(t){return z.isInstance(
|
|
1263
|
-
t,Jc)}const Qc="DirectedRelationExpr";function pv(t){return z.isInstance(t,Qc)}const Zc="DirectedRelationExpression";function hv(t){return z.isInstance(t,Zc)}const ra="DynamicView";function wC(t){return z.isInstance(t,ra)}const Zp="DynamicViewBody";function k8(t){return z.isInstance(t,Zp)}const el="DynamicViewGlobalPredicateRef";function bC(t){return z.isInstance(t,el)}const tl="DynamicViewIncludePredicate";function T8(t){return z.isInstance(t,tl)}const eh="DynamicViewParallelSteps";function mv(t){
|
|
1264
|
-
return z.isInstance(t,eh)}const th="DynamicViewPredicateIterator";function EC(t){return z.isInstance(t,th)}const gv="DynamicViewRef",nh="DynamicViewStep";function yv(t){return z.isInstance(t,nh)}const Dr="Element";function pn(t){return z.isInstance(t,Dr)}const rh="ElementBody";function nl(t){return z.isInstance(t,rh)}const rl="ElementDescedantsExpression";function vv(t){return z.isInstance(t,rl)}const ih="ElementExpressionsIterator";function C8(t){return z.isInstance(t,ih)}const Di="ElementKind";
|
|
1265
|
-
function $C(t){return z.isInstance(t,Di)}const il="ElementKindExpression";function sh(t){return z.isInstance(t,il)}const sl="ElementPredicateWhere";function wv(t){return z.isInstance(t,sl)}const ol="ElementPredicateWhereV2";function A8(t){return z.isInstance(t,ol)}const al="ElementPredicateWith";function oh(t){return z.isInstance(t,al)}const ul="ElementRef";function cl(t){return z.isInstance(t,ul)}const ll="ElementStringProperty";function dl(t){return z.isInstance(t,ll)}const fl="ElementStylePro\
|
|
1266
|
-
perty";function Qi(t){return z.isInstance(t,fl)}const pl="ElementTagExpression";function ah(t){return z.isInstance(t,pl)}const ia="ElementView";function uh(t){return z.isInstance(t,ia)}const ch="ElementViewBody";function DC(t){return z.isInstance(t,ch)}const bv="ElementViewRef",hl="ExcludePredicate";function ml(t){return z.isInstance(t,hl)}const gl="ExpandElementExpression";function RC(t){return z.isInstance(t,gl)}const yl="ExtendDeployment";function oo(t){return z.isInstance(t,yl)}const lh="Ext\
|
|
1267
|
-
endDeploymentBody";function S8(t){return z.isInstance(t,lh)}const ao="ExtendElement";function sa(t){return z.isInstance(t,ao)}const dh="ExtendElementBody";function kC(t){return z.isInstance(t,dh)}const fh="FqnExpressions";function _8(t){return z.isInstance(t,fh)}const ph="FqnRef";function TC(t){return z.isInstance(t,ph)}const vl="FqnRefExpr";function Ev(t){return z.isInstance(t,vl)}const oa="GlobalDynamicPredicateGroup";function wl(t){return z.isInstance(t,oa)}const aa="GlobalPredicateGroup";function bl(t){
|
|
1268
|
-
return z.isInstance(t,aa)}const ua="Globals";function $v(t){return z.isInstance(t,ua)}const hh="GlobalStyle";function ca(t){return z.isInstance(t,hh)}const mh="GlobalStyleGroup";function uo(t){return z.isInstance(t,mh)}const El="GlobalStyleId",$l="IconProperty";function Wr(t){return z.isInstance(t,$l)}const Dl="IncludePredicate";function gh(t){return z.isInstance(t,Dl)}const Rl="IncomingRelationExpr";function Dv(t){return z.isInstance(t,Rl)}const kl="IncomingRelationExpression";function CC(t){return z.
|
|
1269
|
-
isInstance(t,kl)}const Tl="InOutRelationExpr";function AC(t){return z.isInstance(t,Tl)}const Cl="InOutRelationExpression";function Rv(t){return z.isInstance(t,Cl)}const Ri="LibIcon";function P8(t){return z.isInstance(t,Ri)}const yh="LikeC4Grammar";function x8(t){return z.isInstance(t,yh)}const vh="LikeC4Lib";function SC(t){return z.isInstance(t,vh)}const Al="LineProperty";function Sl(t){return z.isInstance(t,Al)}const _l="LinkProperty";function wh(t){return z.isInstance(t,_l)}const Pl="MetadataA\
|
|
1270
|
-
ttribute";function N8(t){return z.isInstance(t,Pl)}const xl="MetadataBody";function I8(t){return z.isInstance(t,xl)}const la="Model";function _C(t){return z.isInstance(t,la)}const da="ModelDeployments";function PC(t){return z.isInstance(t,da)}const fa="ModelViews";function Nl(t){return z.isInstance(t,fa)}const Il="MultipleProperty";function kv(t){return z.isInstance(t,Il)}const bh="NavigateToProperty";function Eh(t){return z.isInstance(t,bh)}const Ol="NotationProperty";function pa(t){return z.isInstance(
|
|
1271
|
-
t,Ol)}const Ll="NotesProperty";function xC(t){return z.isInstance(t,Ll)}const Fl="OpacityProperty";function $h(t){return z.isInstance(t,Fl)}const Ml="OutgoingRelationExpr";function Tv(t){return z.isInstance(t,Ml)}const Bl="OutgoingRelationExpression";function Cv(t){return z.isInstance(t,Bl)}const ql="PaddingSizeProperty";function Av(t){return z.isInstance(t,ql)}const Dh="Predicates";function NC(t){return z.isInstance(t,Dh)}const Rh="Relation";function ki(t){return z.isInstance(t,Rh)}const kh="Re\
|
|
1272
|
-
lationBody";function O8(t){return z.isInstance(t,kh)}const jl="RelationNavigateToProperty";function Gl(t){return z.isInstance(t,jl)}const Ul="RelationPredicateWhere";function Sv(t){return z.isInstance(t,Ul)}const Wl="RelationPredicateWhereV2";function L8(t){return z.isInstance(t,Wl)}const zl="RelationPredicateWith";function _v(t){return z.isInstance(t,zl)}const Zi="RelationshipKind";function F8(t){return z.isInstance(t,Zi)}const Hl="RelationStringProperty";function Vl(t){return z.isInstance(t,Hl)}
|
|
1273
|
-
const Kl="RelationStyleProperty";function Th(t){return z.isInstance(t,Kl)}const Xl="ShapeProperty";function Ch(t){return z.isInstance(t,Xl)}const Yl="ShapeSizeProperty";function Pv(t){return z.isInstance(t,Yl)}const Ah="SpecificationColor";function Sh(t){return z.isInstance(t,Ah)}const ha="SpecificationDeploymentNodeKind";function ma(t){return z.isInstance(t,ha)}const ga="SpecificationElementKind";function ya(t){return z.isInstance(t,ga)}const Jl="SpecificationElementStringProperty";function xv(t){
|
|
1274
|
-
return z.isInstance(t,Jl)}const va="SpecificationRelationshipKind";function wa(t){return z.isInstance(t,va)}const Ql="SpecificationRelationshipStringProperty";function IC(t){return z.isInstance(t,Ql)}const ba="SpecificationRule";function Nv(t){return z.isInstance(t,ba)}const Ea="SpecificationTag";function _h(t){return z.isInstance(t,Ea)}const Ph="StrictFqnElementRef";function OC(t){return z.isInstance(t,Ph)}const xh="StrictFqnRef";function LC(t){return z.isInstance(t,xh)}const es="Tag";function FC(t){
|
|
1275
|
-
return z.isInstance(t,es)}const Nh="Tags";function Iv(t){return z.isInstance(t,Nh)}const Zl="TextSizeProperty";function Ov(t){return z.isInstance(t,Zl)}const Lv="ViewRef",ed="ViewRuleAutoLayout";function td(t){return z.isInstance(t,ed)}const nd="ViewRuleGlobalPredicateRef";function Fv(t){return z.isInstance(t,nd)}const rd="ViewRuleGlobalStyle";function Mv(t){return z.isInstance(t,rd)}const id="ViewRuleGroup";function Ih(t){return z.isInstance(t,id)}const sd="ViewRuleStyle";function od(t){return z.
|
|
1276
|
-
isInstance(t,sd)}const ad="ViewStringProperty";function M8(t){return z.isInstance(t,ad)}const ud="WhereBinaryExpression";function B8(t){return z.isInstance(t,ud)}const cd="WhereElementKind";function q8(t){return z.isInstance(t,cd)}const ld="WhereElementNegation";function MC(t){return z.isInstance(t,ld)}const dd="WhereElementTag";function j8(t){return z.isInstance(t,dd)}const fd="WhereRelationKind";function BC(t){return z.isInstance(t,fd)}const pd="WhereRelationNegation";function qC(t){return z.isInstance(
|
|
1277
|
-
t,pd)}const hd="WhereRelationParticipantKind";function jC(t){return z.isInstance(t,hd)}const md="WhereRelationParticipantTag";function GC(t){return z.isInstance(t,md)}const gd="WhereRelationTag";function G8(t){return z.isInstance(t,gd)}const yd="WildcardExpression";function co(t){return z.isInstance(t,yd)}class UC extends sb{getAllTypes(){return[zc,Vc,Kc,so,zp,Hp,Yi,Vp,kp,Ur,Kp,$i,tv,Xp,Yp,Xc,Jp,Tp,Yc,Qp,Jc,Qc,Zc,ra,Zp,el,tl,eh,th,gv,Oc,nh,Dr,rh,rl,Lc,ih,Di,il,Ap,Sp,_p,sl,ol,al,no,ul,ll,fl,pl,ia,
|
|
1278
|
-
ch,bv,hl,gl,rv,yl,lh,ao,dh,iv,Fc,fh,ph,vl,sv,oa,aa,hh,mh,El,ua,$l,Tl,Cl,Dl,Rl,kl,Ri,yh,vh,ro,Al,_l,Pl,xl,Pp,la,da,fa,Il,bh,Ol,Ll,Fl,Ml,Bl,ql,av,Dh,Mc,Rh,kh,xp,Np,jl,Ip,Op,Lp,Ul,Wl,zl,Bc,Hl,Kl,Zi,Fp,Xl,Yl,cv,Ah,ha,ga,Jl,va,Ql,ba,Ea,Ph,xh,ea,ta,es,Nh,Zl,Mp,Lv,qc,ed,nd,rd,id,Bp,sd,jp,ad,ud,jc,Gc,cd,ld,dd,gC,Gp,Uc,Wc,fd,pd,hd,md,gd,Up,yd]}computeIsSubtype(e,n){switch(e){case zc:case Al:return this.isSubtype(Fp,n);case Vc:case Il:case Fl:case Xl:return this.isSubtype(ta,n);case Kc:return this.isSubtype(
|
|
1279
|
-
Fp,n)||this.isSubtype(ta,n);case Yi:case Ur:return this.isSubtype(kp,n)||this.isSubtype(Mc,n);case $i:case Di:return this.isSubtype(tv,n);case Xc:case ra:case ia:return this.isSubtype(ro,n);case Yc:case Jc:return this.isSubtype(Tp,n);case Qc:case Rl:case Tl:case Ml:return this.isSubtype(xp,n);case Zc:case kl:case Cl:case Bl:return this.isSubtype(Np,n);case el:case tl:return this.isSubtype(Oc,n);case Dr:return this.isSubtype(sv,n)||this.isSubtype(Mc,n);case rl:case il:case ul:case pl:case gl:return this.
|
|
1280
|
-
isSubtype(Lc,n);case Lc:case sl:return this.isSubtype(Sp,n);case Ap:case Ip:return this.isSubtype(av,n);case Sp:case al:return this.isSubtype(Ap,n);case _p:case Lp:return this.isSubtype(rv,n);case ol:case Fc:return this.isSubtype(_p,n);case ll:return this.isSubtype(no,n)||this.isSubtype(ea,n);case fl:return this.isSubtype(no,n);case hl:case Dl:return this.isSubtype(Bp,n);case yl:case ao:case Mc:return this.isSubtype(sv,n);case vl:return this.isSubtype(Fc,n);case $l:return this.isSubtype(no,n)||this.
|
|
1281
|
-
isSubtype(ta,n);case _l:return this.isSubtype(no,n)||this.isSubtype(iv,n)||this.isSubtype(Bc,n)||this.isSubtype(Mp,n);case Pl:case Ol:case Ll:case Jl:case Ql:return this.isSubtype(ea,n);case xl:return this.isSubtype(Pp,n);case Pp:return this.isSubtype(no,n)||this.isSubtype(iv,n)||this.isSubtype(Bc,n);case ql:case Yl:case Zl:return this.isSubtype(cv,n)||this.isSubtype(ta,n);case xp:case Wl:return this.isSubtype(Lp,n);case Np:case Ul:return this.isSubtype(Op,n);case jl:case Kl:return this.isSubtype(
|
|
1282
|
-
Bc,n);case Op:case zl:return this.isSubtype(Ip,n);case Hl:return this.isSubtype(Bc,n)||this.isSubtype(ea,n);case ed:return this.isSubtype(Tp,n)||this.isSubtype(Oc,n)||this.isSubtype(qc,n);case nd:case id:case Bp:return this.isSubtype(qc,n);case rd:case sd:return this.isSubtype(jp,n);case jp:return this.isSubtype(Oc,n)||this.isSubtype(qc,n);case ad:return this.isSubtype(ea,n)||this.isSubtype(Mp,n);case ud:return this.isSubtype(Gc,n)||this.isSubtype(Wc,n);case jc:case ld:return this.isSubtype(Gc,n);case Gc:case Wc:
|
|
1283
|
-
return this.isSubtype(gC,n);case cd:return this.isSubtype(jc,n)||this.isSubtype(Gp,n);case dd:return this.isSubtype(jc,n)||this.isSubtype(Up,n);case Uc:case pd:return this.isSubtype(Wc,n);case fd:case hd:return this.isSubtype(Gp,n)||this.isSubtype(Uc,n);case md:case gd:return this.isSubtype(Uc,n)||this.isSubtype(Up,n);case yd:return this.isSubtype(Lc,n)||this.isSubtype(Fc,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColo\
|
|
1284
|
-
r":return so;case"DeploymentNode:kind":return $i;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return Zi;case"DynamicViewGlobalPredicateRef:predicate":return oa;case"DynamicViewRef:view":return ra;case"Element:kind":case"ElementKindExpression:kind":return Di;case"ElementRef:el":case"StrictFqnElementRef:el":return Dr;case"ElementTagExpression:tag":case"Tags:values":case"\
|
|
1285
|
-
WhereElementTag:value":case"WhereRelationParticipantTag:value":case"WhereRelationTag:value":return es;case"ElementViewRef:view":return ia;case"FqnRef:value":case"StrictFqnRef:value":return Mc;case"IconProperty:libicon":return Ri;case"ViewRef:view":return ro;case"ViewRuleGlobalPredicateRef:predicate":return aa;case"ViewRuleGlobalStyle:style":return El;case"WhereElementKind:value":case"WhereRelationParticipantKind:value":return tv;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){
|
|
1286
|
-
switch(e){case zc:return{name:zc,properties:[{name:"key"},{name:"value"}]};case Vc:return{name:Vc,properties:[{name:"key"},{name:"value"}]};case Kc:return{name:Kc,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case so:return{name:so,properties:[{name:"name"}]};case zp:return{name:zp,properties:[{name:"props",defaultValue:[]}]};case Hp:return{name:Hp,properties:[{name:"props",defaultValue:[]}]};case Yi:return{name:Yi,properties:[{name:"body"},{name:"element"},{name:"name"},{name:"\
|
|
1287
|
-
title"}]};case Vp:return{name:Vp,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Ur:return{name:Ur,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case Kp:return{name:Kp,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case $i:return{name:$i,properties:[{name:"name"}]};case Xp:return{name:Xp,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Yp:
|
|
1288
|
-
return{name:Yp,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Xc:return{name:Xc,properties:[{name:"body"},{name:"name"}]};case Jp:return{name:Jp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Yc:return{name:Yc,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case Qp:return{name:Qp,properties:[{name:"prev"},{name:"value"}]};case Jc:return{name:Jc,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case Qc:return{
|
|
1289
|
-
name:Qc,properties:[{name:"source"},{name:"target"}]};case Zc:return{name:Zc,properties:[{name:"source"},{name:"target"}]};case ra:return{name:ra,properties:[{name:"body"},{name:"name"}]};case Zp:return{name:Zp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case el:return{name:el,properties:[{name:"predicate"}]};case tl:return{name:tl,properties:[{name:"predicates"}]};case eh:return{name:eh,properties:[{name:"steps",defaultValue:[]}]};case th:
|
|
1290
|
-
return{name:th,properties:[{name:"prev"},{name:"value"}]};case gv:return{name:gv,properties:[{name:"view"}]};case nh:return{name:nh,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case Dr:return{name:Dr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case rh:return{name:rh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case rl:return{
|
|
1291
|
-
name:rl,properties:[{name:"parent"},{name:"suffix"}]};case ih:return{name:ih,properties:[{name:"prev"},{name:"value"}]};case Di:return{name:Di,properties:[{name:"name"}]};case il:return{name:il,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case sl:return{name:sl,properties:[{name:"subject"},{name:"where"}]};case ol:return{name:ol,properties:[{name:"subject"},{name:"where"}]};case al:return{name:al,properties:[{name:"custom"},{name:"subject"}]};case ul:return{name:ul,properties:[{name:"\
|
|
1292
|
-
el"},{name:"parent"}]};case ll:return{name:ll,properties:[{name:"key"},{name:"value"}]};case fl:return{name:fl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case pl:return{name:pl,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case ia:return{name:ia,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case ch:return{name:ch,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case bv:return{name:bv,properties:[{name:"\
|
|
1293
|
-
view"}]};case hl:return{name:hl,properties:[{name:"predicates"}]};case gl:return{name:gl,properties:[{name:"expand"}]};case yl:return{name:yl,properties:[{name:"body"},{name:"deploymentNode"}]};case lh:return{name:lh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case ao:return{name:ao,properties:[{name:"body"},{name:"element"}]};case dh:return{name:dh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case fh:
|
|
1294
|
-
return{name:fh,properties:[{name:"prev"},{name:"value"}]};case ph:return{name:ph,properties:[{name:"parent"},{name:"value"}]};case vl:return{name:vl,properties:[{name:"ref"},{name:"selector"}]};case oa:return{name:oa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case aa:return{name:aa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case ua:return{name:ua,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{name:"styles",defaultValue:[]}]};case hh:return{
|
|
1295
|
-
name:hh,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case mh:return{name:mh,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case El:return{name:El,properties:[{name:"name"}]};case $l:return{name:$l,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case Dl:return{name:Dl,properties:[{name:"predicates"}]};case Rl:return{name:Rl,properties:[{name:"to"}]};case kl:return{name:kl,properties:[{name:"to"}]};case Tl:return{name:Tl,properties:[{name:"inout"}]};case Cl:
|
|
1296
|
-
return{name:Cl,properties:[{name:"inout"}]};case Ri:return{name:Ri,properties:[{name:"name"}]};case yh:return{name:yh,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case vh:return{name:vh,properties:[{name:"icons",defaultValue:[]}]};case Al:return{name:Al,properties:[{name:"key"},{name:"value"}]};case _l:return{name:_l,properties:[
|
|
1297
|
-
{name:"key"},{name:"title"},{name:"value"}]};case Pl:return{name:Pl,properties:[{name:"key"},{name:"value"}]};case xl:return{name:xl,properties:[{name:"props",defaultValue:[]}]};case la:return{name:la,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case da:return{name:da,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case fa:return{name:fa,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case Il:return{name:Il,properties:[{name:"\
|
|
1298
|
-
key"},{name:"value"}]};case bh:return{name:bh,properties:[{name:"key"},{name:"value"}]};case Ol:return{name:Ol,properties:[{name:"key"},{name:"value"}]};case Ll:return{name:Ll,properties:[{name:"key"},{name:"value"}]};case Fl:return{name:Fl,properties:[{name:"key"},{name:"value"}]};case Ml:return{name:Ml,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Bl:return{name:Bl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case ql:
|
|
1299
|
-
return{name:ql,properties:[{name:"key"},{name:"value"}]};case Dh:return{name:Dh,properties:[{name:"prev"},{name:"value"}]};case Rh:return{name:Rh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case kh:return{name:kh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case jl:return{name:jl,properties:[{name:"key"},{name:"value"}]};case Ul:return{name:Ul,properties:[{name:"subject"},{name:"where"}]};case Wl:return{
|
|
1300
|
-
name:Wl,properties:[{name:"subject"},{name:"where"}]};case zl:return{name:zl,properties:[{name:"custom"},{name:"subject"}]};case Zi:return{name:Zi,properties:[{name:"name"}]};case Hl:return{name:Hl,properties:[{name:"key"},{name:"value"}]};case Kl:return{name:Kl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Xl:return{name:Xl,properties:[{name:"key"},{name:"value"}]};case Yl:return{name:Yl,properties:[{name:"key"},{name:"value"}]};case Ah:return{name:Ah,properties:[{name:"color"},
|
|
1301
|
-
{name:"name"}]};case ha:return{name:ha,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case ga:return{name:ga,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Jl:return{name:Jl,properties:[{name:"key"},{name:"value"}]};case va:return{name:va,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Ql:return{name:Ql,properties:[{name:"key"},{name:"value"}]};case ba:return{name:ba,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},
|
|
1302
|
-
{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case Ea:return{name:Ea,properties:[{name:"tag"}]};case Ph:return{name:Ph,properties:[{name:"el"},{name:"parent"}]};case xh:return{name:xh,properties:[{name:"parent"},{name:"value"}]};case es:return{name:es,properties:[{name:"name"}]};case Nh:return{name:Nh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Zl:return{name:Zl,properties:[{name:"key"},{name:"value"}]};case Lv:
|
|
1303
|
-
return{name:Lv,properties:[{name:"view"}]};case ed:return{name:ed,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case nd:return{name:nd,properties:[{name:"predicate"}]};case rd:return{name:rd,properties:[{name:"style"}]};case id:return{name:id,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case sd:return{name:sd,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case ad:return{name:ad,properties:[{name:"key"},{name:"v\
|
|
1304
|
-
alue"}]};case ud:return{name:ud,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case cd:return{name:cd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case ld:return{name:ld,properties:[{name:"value"}]};case dd:return{name:dd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case fd:return{name:fd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case pd:return{name:pd,properties:[{name:"value"}]};case hd:
|
|
1305
|
-
return{name:hd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case md:return{name:md,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case gd:return{name:gd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case yd:return{name:yd,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const z=new UC;let WC;const U8=()=>WC??(WC=Yj(`{"$type":"\
|
|
1306
|
-
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"\
|
|
1307
|
-
:{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},"d\
|
|
1308
|
-
efinesHiddenTokens":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":"}"},\
|
|
1309
|
-
{"$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@154"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$t\
|
|
1310
|
-
ype":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"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@159"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"par\
|
|
1311
|
-
ameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"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@1\
|
|
1312
|
-
58"},"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@159"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRule","definition"\
|
|
1313
|
-
:{"$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","fe\
|
|
1314
|
-
ature":"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":\
|
|
1315
|
-
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":"Ru\
|
|
1316
|
-
leCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"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"\
|
|
1317
|
-
,"elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationDeploymentNodeK\
|
|
1318
|
-
ind","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@143"}\
|
|
1319
|
-
,"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,\
|
|
1320
|
-
"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@153"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":fa\
|
|
1321
|
-
lse,"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"\
|
|
1322
|
-
,"elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"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":"=","ter\
|
|
1323
|
-
minal":{"$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@177"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name"\
|
|
1324
|
-
:"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@27"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByN\
|
|
1325
|
-
ame":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":"#/\
|
|
1326
|
-
rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$r\
|
|
1327
|
-
ef":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$\
|
|
1328
|
-
ref":"#/rules@177"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"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":[],"wildca\
|
|
1329
|
-
rd":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"\
|
|
1330
|
-
$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"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":"Altern\
|
|
1331
|
-
atives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSt\
|
|
1332
|
-
ringProperty","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@177"},"arguments":[]}},{"$type":"Keyword","value":";","cardina\
|
|
1333
|
-
lity":"?"}]},"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@24"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arg\
|
|
1334
|
-
uments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":\
|
|
1335
|
-
"#/rules@23"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"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,"hiddenT\
|
|
1336
|
-
okens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StrictFqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignm\
|
|
1337
|
-
ent","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"StrictFqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"Cross\
|
|
1338
|
-
Reference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"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":"\
|
|
1339
|
-
RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyn\
|
|
1340
|
-
tax":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@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$\
|
|
1341
|
-
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@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragmen\
|
|
1342
|
-
t":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@27/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}]},{"$ty\
|
|
1343
|
-
pe":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@27/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$r\
|
|
1344
|
-
ef":"#/rules@157"},"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@25"},"arguments":[]}},{"$type":"Group","elements\
|
|
1345
|
-
":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body",\
|
|
1346
|
-
"operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"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@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","fea\
|
|
1347
|
-
ture":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"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@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$\
|
|
1348
|
-
type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"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"\
|
|
1349
|
-
:[{"$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@177"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"\
|
|
1350
|
-
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@146"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$ty\
|
|
1351
|
-
pe":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"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":"Rul\
|
|
1352
|
-
eCall","rule":{"$ref":"#/rules@34"},"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@178"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"As\
|
|
1353
|
-
signment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"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":"{"\
|
|
1354
|
-
},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"\
|
|
1355
|
-
LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type\
|
|
1356
|
-
":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment"\
|
|
1357
|
-
,"feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}]}],"cardinality":"?"},{"$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":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword",\
|
|
1358
|
-
"value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":\
|
|
1359
|
-
{"$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@37"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":f\
|
|
1360
|
-
alse,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@38"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","\
|
|
1361
|
-
value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"de\
|
|
1362
|
-
finesHiddenTokens":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@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"argum\
|
|
1363
|
-
ents":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHidd\
|
|
1364
|
-
enTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{\
|
|
1365
|
-
"$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@177"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":fal\
|
|
1366
|
-
se,"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"\
|
|
1367
|
-
:{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","na\
|
|
1368
|
-
me":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},\
|
|
1369
|
-
"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":\
|
|
1370
|
-
false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","n\
|
|
1371
|
-
ame":"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@51"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wild\
|
|
1372
|
-
card":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","featu\
|
|
1373
|
-
re":"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@157"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"argu\
|
|
1374
|
-
ments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"A\
|
|
1375
|
-
lternatives","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@53"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":\
|
|
1376
|
-
"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"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@54"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"\
|
|
1377
|
-
$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall"\
|
|
1378
|
-
,"rule":{"$ref":"#/rules@68"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"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","ty\
|
|
1379
|
-
pe":{"$ref":"#/rules@125"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"\
|
|
1380
|
-
ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"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@92"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHidde\
|
|
1381
|
-
nTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator"\
|
|
1382
|
-
:"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","n\
|
|
1383
|
-
ame":"WhereElementOr","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":"or"}},{"$type":"Assignment","feature":"right","oper\
|
|
1384
|
-
ator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"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@62"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferr\
|
|
1385
|
-
edType":{"$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@62"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Wher\
|
|
1386
|
-
eElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenToke\
|
|
1387
|
-
ns":[],"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@59"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elem\
|
|
1388
|
-
ents":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type\
|
|
1389
|
-
":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@2"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpr\
|
|
1390
|
-
ession","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"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"\
|
|
1391
|
-
:[{"$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@161"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"Cros\
|
|
1392
|
-
sReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#\
|
|
1393
|
-
/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@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType\
|
|
1394
|
-
":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"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@170"},"arguments":[]}}]}],"cardinality":"?"}]},"definesHiddenTokens\
|
|
1395
|
-
":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"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":"Ru\
|
|
1396
|
-
leCall","rule":{"$ref":"#/rules@70"},"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@93"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"paramet\
|
|
1397
|
-
ers":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"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@71"},"argu\
|
|
1398
|
-
ments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":\
|
|
1399
|
-
"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":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@73\
|
|
1400
|
-
"},"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@74"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"\
|
|
1401
|
-
feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"\
|
|
1402
|
-
WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule",\
|
|
1403
|
-
"name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferr\
|
|
1404
|
-
edType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Wh\
|
|
1405
|
-
ereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantTag"}},{"$type":"A\
|
|
1406
|
-
ssignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecat\
|
|
1407
|
-
edSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantKind"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]},{"$type":"Assignment","feature\
|
|
1408
|
-
":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"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@78"},"arguments":[]},{"$type":\
|
|
1409
|
-
"RuleCall","rule":{"$ref":"#/rules@80"},"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@79"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutR\
|
|
1410
|
-
elationExpression"},"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@65"},"arguments":[]}}]},"definesHiddenTo\
|
|
1411
|
-
kens":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@81"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Ass\
|
|
1412
|
-
ignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"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@65"},"arguments":[]}},{"$type":"Altern\
|
|
1413
|
-
atives","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@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assi\
|
|
1414
|
-
gnment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"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":"\
|
|
1415
|
-
RuleCall","rule":{"$ref":"#/rules@65"},"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@65"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parame\
|
|
1416
|
-
ters":[],"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@85"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewGlobalPredicateRef","definition":{"$type":"\
|
|
1417
|
-
Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@126"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"val\
|
|
1418
|
-
ue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"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@56"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,\
|
|
1419
|
-
"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@82"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/ru\
|
|
1420
|
-
les@142"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"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":"C\
|
|
1421
|
-
rossReference","type":{"$ref":"#/rules@127"},"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@86"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"\
|
|
1422
|
-
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@46"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@179"},"arguments":[]}},{"$type":"Assignment","feature":"n\
|
|
1423
|
-
odeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@179"},"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":"?"},{"$t\
|
|
1424
|
-
ype":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"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","\
|
|
1425
|
-
value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"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","oper\
|
|
1426
|
-
ator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"Parse\
|
|
1427
|
-
rRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},{"$type":"RuleCall","r\
|
|
1428
|
-
ule":{"$ref":"#/rules@146"},"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"\
|
|
1429
|
-
:{"$ref":"#/rules@39"},"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@41"},"arguments":[]}}]},"define\
|
|
1430
|
-
sHiddenTokens":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@97"},"arguments":\
|
|
1431
|
-
[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"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","opera\
|
|
1432
|
-
tor":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}},{"$type":"RuleCall","rule":\
|
|
1433
|
-
{"$ref":"#/rules@175"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall\
|
|
1434
|
-
","rule":{"$ref":"#/rules@98"},"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@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operato\
|
|
1435
|
-
r":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":fals\
|
|
1436
|
-
e,"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@159"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"element","operator\
|
|
1437
|
-
":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hidd\
|
|
1438
|
-
enTokens":[],"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@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":\
|
|
1439
|
-
"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendDeployment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"deploymentNode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"\
|
|
1440
|
-
},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendDeploymentBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule"\
|
|
1441
|
-
:{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"paramet\
|
|
1442
|
-
ers":[],"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@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$re\
|
|
1443
|
-
f":"#/rules@172"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StrictFqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","\
|
|
1444
|
-
feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"StrictFqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReferenc\
|
|
1445
|
-
e","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"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@103"},"arguments":[]}},{"$typ\
|
|
1446
|
-
e":"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@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5\
|
|
1447
|
-
"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rul\
|
|
1448
|
-
e":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type\
|
|
1449
|
-
":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fr\
|
|
1450
|
-
agment":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@159"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]},"cardin\
|
|
1451
|
-
ality":"?"}]},"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@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":\
|
|
1452
|
-
"#/rules@44"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"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@111"},"argu\
|
|
1453
|
-
ments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"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@\
|
|
1454
|
-
123"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewR\
|
|
1455
|
-
ulePredicate","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@112"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"Par\
|
|
1456
|
-
serRule","name":"DeploymentViewRulePredicateExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DeploymentViewRulePredicateExpression"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$t\
|
|
1457
|
-
ype":"RuleCall","rule":{"$ref":"#/rules@113"},"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@115"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,\
|
|
1458
|
-
"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhereV2"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule\
|
|
1459
|
-
":{"$ref":"#/rules@59"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhereV2"},"feature":"subject","\
|
|
1460
|
-
operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"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":"Inferr\
|
|
1461
|
-
edType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"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":{\
|
|
1462
|
-
"$ref":"#/rules@103"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@170"},"arguments":[]}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements\
|
|
1463
|
-
":[{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"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@120"},"arguments":[]},{"$type":"Group","elements":[{"$t\
|
|
1464
|
-
ype":"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":{"\
|
|
1465
|
-
$ref":"#/rules@116"},"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@122"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpr"},"feature":\
|
|
1466
|
-
"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"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@116"}\
|
|
1467
|
-
,"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@159"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keywor\
|
|
1468
|
-
d","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"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":"="\
|
|
1469
|
-
,"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"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@116"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens\
|
|
1470
|
-
":[],"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@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rule\
|
|
1471
|
-
s@126"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]}]},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Glo\
|
|
1472
|
-
balPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"predicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@178"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":fals\
|
|
1473
|
-
e,"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@178"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/ru\
|
|
1474
|
-
les@83"},"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@178"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"\
|
|
1475
|
-
ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","el\
|
|
1476
|
-
ements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"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":\
|
|
1477
|
-
{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignme\
|
|
1478
|
-
nt","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"ent\
|
|
1479
|
-
ry":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@150"},"arguments":[]}},{"$type":\
|
|
1480
|
-
"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"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","fe\
|
|
1481
|
-
ature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@176"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MultipleProperty","definition":{"$type":"Group\
|
|
1482
|
-
","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@147"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconPr\
|
|
1483
|
-
operty","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@154"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value\
|
|
1484
|
-
","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"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":"Keywor\
|
|
1485
|
-
d","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"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":"RuleCa\
|
|
1486
|
-
ll","rule":{"$ref":"#/rules@148"},"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":"=","termin\
|
|
1487
|
-
al":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SizeValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"xs"},{"$type":"Keyword","value":"sm"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"lg"},{"$type":"Keyword","valu\
|
|
1488
|
-
e":"xl"},{"$type":"Keyword","value":"xsmall"},{"$type":"Keyword","value":"small"},{"$type":"Keyword","value":"medium"},{"$type":"Keyword","value":"large"},{"$type":"Keyword","value":"xlarge"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"size"}},{"$t\
|
|
1489
|
-
ype":"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":"PaddingSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{\
|
|
1490
|
-
"$type":"Keyword","value":"padding"}},{"$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":"TextSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","fea\
|
|
1491
|
-
ture":"key","operator":"=","terminal":{"$type":"Keyword","value":"textSize"}},{"$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":"StyleProperty","definition":{"$type":"Alternat\
|
|
1492
|
-
ives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall",\
|
|
1493
|
-
"rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"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","operato\
|
|
1494
|
-
r":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"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":"Assig\
|
|
1495
|
-
nment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"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\
|
|
1496
|
-
"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type\
|
|
1497
|
-
":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"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"}]},"definesHidden\
|
|
1498
|
-
Tokens":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","defini\
|
|
1499
|
-
tion":{"$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":[],"wi\
|
|
1500
|
-
ldcard":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":"Key\
|
|
1501
|
-
word","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","va\
|
|
1502
|
-
lue":"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","defin\
|
|
1503
|
-
ition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@171"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@180"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@179"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":\
|
|
1504
|
-
"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"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@167"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hid\
|
|
1505
|
-
denTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@171"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":\
|
|
1506
|
-
"RuleCall","rule":{"$ref":"#/rules@173"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"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@178"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},{"$type":"RuleCall\
|
|
1507
|
-
","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"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@178"},"arguments":[]},{"$type":"RuleCall","rule":{"$\
|
|
1508
|
-
ref":"#/rules@151"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"},{"$type":"Keyword","valu\
|
|
1509
|
-
e":"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@175"},"arguments":[]},{"$type":"RuleCall\
|
|
1510
|
-
","rule":{"$ref":"#/rules@174"},"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\
|
|
1511
|
-
":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"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":"LIN\
|
|
1512
|
-
E_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},{"$t\
|
|
1513
|
-
ype":"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":{"\
|
|
1514
|
-
$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,"hidd\
|
|
1515
|
-
en":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":"/\\"[^\\"]*\\"|'\
|
|
1516
|
-
[^']*'/"},"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":fals\
|
|
1517
|
-
e}],"types":[{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@37"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@38"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@107"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@45"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@30"}},{"$\
|
|
1518
|
-
type":"SimpleType","typeRef":{"$ref":"#/rules@34"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@91"}}]}},{"$type":"Type","name":"DeploymentNodeOrElementKind","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@3"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@7"}}]}},{"$type":"Type","name":"\
|
|
1519
|
-
WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@64/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@2/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@64/definition/el\
|
|
1520
|
-
ements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@3/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@59"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@71"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionTyp\
|
|
1521
|
-
e","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@7"}\
|
|
1522
|
-
},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@101"}}]}},{"$type":"Type","name":"SizeProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@139"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@140"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@141"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGr\
|
|
1523
|
-
ammars":[]}`)),Bv={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},W8={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},z8={AstReflection:()=>new UC},H8={Grammar:()=>U8(),LanguageMetaData:()=>Bv,parser:{ParserConfig:()=>W8}},V8=[...Object.entries({aws:["activate","alexa-for-business","amplify","apache-mxnet-on-aws","api-gateway","app-config","app-flow","app-mesh","app-runner","app-stream","app-sync","application-auto-scaling",
|
|
1524
|
-
"application-composer","application-cost-profiler","application-discovery-service","application-migration-service","artifact","athena","audit-manager","augmented-ai-a2i","aurora","auto-scaling","backint-agent","backup","batch","billing-conductor","bottlerocket","braket","budgets","certificate-manager","chatbot","chime","chime-sdk","chime-voice-connector","clean-rooms","client-vpn","cloud-control-api","cloud-development-kit","cloud-directory","cloud-formation","cloud-front","cloud-hsm","cloud-map",
|
|
1525
|
-
"cloud-search","cloud-shell","cloud-trail","cloud-wan","cloud-watch","cloud9","code-artifact","code-build","code-catalyst","code-commit","code-deploy","code-guru","code-pipeline","code-star","code-whisperer","cognito","command-line-interface","comprehend","comprehend-medical","compute-optimizer","config","connect","console-mobile-application","control-tower","corretto","cost-and-usage-report","cost-explorer","data-exchange","data-pipeline","data-sync","data-zone","database-migration-service","de\
|
|
1526
|
-
ep-composer","deep-learning-amis","deep-learning-containers","deep-lens","deep-racer","detective","dev-ops-guru","device-farm","direct-connect","directory-service","distro-for-open-telemetry","document-db","dynamo-db","ec2","ec2-auto-scaling","ec2-image-builder","ecs-anywhere","efs","eks-anywhere","eks-cloud","eks-distro","elasti-cache","elastic-beanstalk","elastic-block-store","elastic-container-registry","elastic-container-service","elastic-disaster-recovery","elastic-fabric-adapter","elastic-\
|
|
1527
|
-
inference","elastic-kubernetes-service","elastic-load-balancing","elastic-transcoder","elemental-appliances-software","elemental-conductor","elemental-delta","elemental-link","elemental-live","elemental-media-connect","elemental-media-convert","elemental-media-live","elemental-media-package","elemental-media-store","elemental-media-tailor","elemental-server","emr","event-bridge","express-workflows","fargate","fault-injection-simulator","file-cache","fin-space","firewall-manager","forecast","frau\
|
|
1528
|
-
d-detector","free-rtos","fsx","fsx-for-lustre","fsx-for-net-app-ontap","fsx-for-open-zfs","fsx-for-wfs","game-kit","game-lift","game-sparks","genomics-cli","global-accelerator","glue","glue-data-brew","glue-elastic-views","ground-station","guard-duty","health-lake","honeycode","iam-identity-center","identity-and-access-management","inspector","interactive-video-service","io-t-1-click","io-t-analytics","io-t-button","io-t-core","io-t-device-defender","io-t-device-management","io-t-edu-kit","io-t-\
|
|
1529
|
-
events","io-t-express-link","io-t-fleet-wise","io-t-greengrass","io-t-robo-runner","io-t-site-wise","io-t-things-graph","io-t-twin-maker","iq","kendra","key-management-service","keyspaces","kinesis","kinesis-data-analytics","kinesis-data-streams","kinesis-firehose","kinesis-video-streams","lake-formation","lambda","launch-wizard","lex","license-manager","lightsail","local-zones","location-service","lookout-for-equipment","lookout-for-metrics","lookout-for-vision","lumberyard","macie","mainframe-\
|
|
1530
|
-
modernization","managed-blockchain","managed-grafana","managed-service-for-prometheus","managed-services","managed-streaming-for-apache-kafka","managed-workflows-for-apache-airflow","management-console","marketplace-dark","marketplace-light","memory-db-for-redis","migration-evaluator","migration-hub","monitron","mq","neptune","network-firewall","neuron","nice-dcv","nice-engin-frame","nimble-studio","nitro-enclaves","omics","open-3d-engine","open-search-service","ops-works","organizations","outpo\
|
|
1531
|
-
sts-family","outposts-rack","outposts-servers","panorama","parallel-cluster","personal-health-dashboard","personalize","pinpoint","pinpoint-apis","polly","private-5g","private-certificate-authority","private-link","professional-services","proton","quantum-ledger-database","quick-sight","rds","rds-on-vmware","re-post","red-hat-open-shift-service-on-aws","redshift","rekognition","reserved-instance-reporting","resilience-hub","resource-access-manager","resource-explorer","robo-maker","route-53","s3\
|
|
1532
|
-
-on-outposts","sage-maker","sage-maker-ground-truth","sage-maker-studio-lab","savings-plans","secrets-manager","security-hub","security-lake","server-migration-service","serverless-application-repository","service-catalog","service-management-connector","shield","signer","sim-space-weaver","simple-email-service","simple-notification-service","simple-queue-service","simple-storage-service","simple-storage-service-glacier","site-to-site-vpn","snowball","snowball-edge","snowcone","snowmobile","step\
|
|
1533
|
-
-functions","storage-gateway","sumerian","supply-chain","support","systems-manager","tensor-flow-on-aws","textract","thinkbox-deadline","thinkbox-frost","thinkbox-krakatoa","thinkbox-sequoia","thinkbox-stoke","thinkbox-xmesh","timestream","tools-and-sdks","torch-serve","training-certification","transcribe","transfer-family","transit-gateway","translate","trusted-advisor","verified-access","verified-permissions","virtual-private-cloud","vmware-cloud-on-aws","vpc-lattice","waf","wavelength","well-\
|
|
1534
|
-
architected-tool","wickr","work-docs","work-docs-sdk","work-link","work-mail","work-spaces-family","x-ray"],azure:["abs-member","active-directory-connect-health","activity-log","administrative-units","advisor","ai-studio","aks-automatic","aks-istio","alerts","all-resources","analysis-services","anomaly-detector","api-center","api-connections","api-management-services","api-proxy","app-compliance-automation","app-configuration","app-registrations","app-service-certificates","app-service-domains",
|
|
1535
|
-
"app-service-environments","app-service-plans","app-services","app-space","app-space-component","applens","application-gateway-containers","application-gateways","application-group","application-insights","application-security-groups","aquila","arc-data-services","arc-kubernetes","arc-machines","arc-postgre-sql","arc-sql-managed-instance","arc-sql-server","atm-multistack","auto-scale","automanaged-vm","automation-accounts","availability-sets","avs-vm","azure-a","azure-ad-b2c","azure-api-for-fhir",
|
|
1536
|
-
"azure-applied-ai-services","azure-arc","azure-attestation","azure-backup-center","azure-blockchain-service","azure-center-for-sap","azure-chaos-studio","azure-cloud-shell","azure-communication-services","azure-communications-gateway","azure-compute-galleries","azure-cosmos-db","azure-data-catalog","azure-data-explorer-clusters","azure-database-maria-db-server","azure-database-migration-services","azure-database-my-sql-server","azure-database-postgre-sql-server","azure-database-postgre-sql-serve\
|
|
1537
|
-
r-group","azure-databox-gateway","azure-databricks","azure-deployment-environments","azure-dev-ops","azure-dev-tunnels","azure-edge-hardware-center","azure-experimentation-studio","azure-fileshares","azure-firewall-manager","azure-firewall-policy","azure-hcp-cache","azure-hpc-workbenches","azure-hybrid-center","azure-information-protection","azure-io-t-operations","azure-lighthouse","azure-load-testing","azure-managed-grafana","azure-maps-accounts","azure-media-service","azure-migrate","azure-mo\
|
|
1538
|
-
nitor-dashboard","azure-monitor-pipeline","azure-monitors-for-sap-solutions","azure-net-app-files","azure-network-function-manager","azure-network-function-manager-functions","azure-object-understanding","azure-open-ai","azure-operator-5g-core","azure-operator-insights","azure-operator-nexus","azure-operator-service-manager","azure-orbital","azure-programmable-connectivity","azure-purview-accounts","azure-quotas","azure-red-hat-open-shift","azure-sentinel","azure-service-bus","azure-sphere","azu\
|
|
1539
|
-
re-spring-apps","azure-sql","azure-sql-edge","azure-sql-server-stretch-databases","azure-sql-vm","azure-stack","azure-stack-edge","azure-stack-hci-sizer","azure-storage-mover","azure-support-center-blue","azure-sustainability","azure-synapse-analytics","azure-token-service","azure-video-indexer","azure-virtual-desktop","azure-vmware-solution","azure-workbooks","azurite","backlog","backup-vault","bare-metal-infrastructure","bastions","batch-accounts","batch-ai","biz-talk","blob-block","blob-page",
|
|
1540
|
-
"blockchain-applications","blueprints","bonsai","bot-services","branch","browser","bug","builds","business-process-tracking","cache","cache-redis","capacity","capacity-reservation-groups","cdn-profiles","central-service-instance-for-sap","ceres","change-analysis","client-apps","cloud-services-classic","cloud-services-extended-support","cloud-test","code","code-optimization","cognitive-search","cognitive-services","cognitive-services-decisions","collaborative-service","commit","community-images",
|
|
1541
|
-
"compliance","compliance-center","compute-fleet","computer-vision","conditional-access","confidential-ledgers","connected-cache","connected-vehicle-platform","connections","consortium","container-apps-environments","container-instances","container-registries","container-services-deprecated","content-moderators","content-safety","controls","controls-horizontal","cost-alerts","cost-analysis","cost-budgets","cost-export","cost-management","cost-management-and-billing","counter","cubes","custom-ip-p\
|
|
1542
|
-
refix","custom-vision","customer-lockbox-for-microsoft-azure","dashboard","dashboard-hub","data-box","data-collection-rules","data-factories","data-lake-analytics","data-lake-storage-gen1","data-lake-store-gen1","data-share-invitations","data-shares","database-instance-for-sap","ddo-s-protection-plans","dedicated-hsm","defender-cm-local-manager","defender-dcs-controller","defender-distributer-control-system","defender-engineering-station","defender-external-management","defender-freezer-monitor",
|
|
1543
|
-
"defender-historian","defender-hmi","defender-industrial-packaging-system","defender-industrial-printer","defender-industrial-robot","defender-industrial-scale-system","defender-marquee","defender-meter","defender-plc","defender-pneumatic-device","defender-programable-board","defender-relay","defender-robot-controller","defender-rtu","defender-sensor","defender-slot","defender-web-guiding-system","detonation","dev-console","dev-ops-starter","dev-test-labs","device-compliance","device-configurati\
|
|
1544
|
-
on","device-enrollment","device-provisioning-services","device-security-apple","device-security-google","device-security-windows","device-update-io-t-hub","devices","diagnostics-settings","digital-twins","disk-encryption-sets","disk-pool","disks","disks-classic","disks-snapshots","dns-multistack","dns-private-resolver","dns-security-policy","dns-zones","download","e-books","edge-management","education","elastic-job-agents","elastic-san","endpoint-analytics","enterprise-applications","entra-conne\
|
|
1545
|
-
ct","entra-connect-health","entra-connect-sync","entra-domain-services","entra-global-secure-access","entra-id-protection","entra-identity-custom-roles","entra-identity-licenses","entra-identity-risky-signins","entra-identity-risky-users","entra-identity-roles-and-administrators","entra-internet-access","entra-managed-identities","entra-private-access","entra-privleged-identity-management","entra-verified-id","error","event-grid-domains","event-grid-subscriptions","event-grid-topics","event-hub-\
|
|
1546
|
-
clusters","event-hubs","exchange-access","exchange-on-premises-access","express-route-circuits","express-route-direct","express-route-traffic-collector","extended-security-updates","extensions","external-identities","face-apis","feature-previews","fhir-service","fiji","file","files","firewalls","folder-blank","folder-website","form-recognizers","free-services","front-door-and-cdn-profiles","ftp","function-apps","gear","genomics","genomics-accounts","globe-error","globe-success","globe-warning","\
|
|
1547
|
-
groups","guide","hd-insight-clusters","hdi-aks-cluster","heart","help-and-support","host-groups","host-pools","hosts","ic-m-troubleshooting","identity-governance","identity-multi-factor-authentication","identity-secure-score","image","image-definitions","image-templates","image-versions","images","immersive-readers","import-export-jobs","industrial-io-t","information","infrastructure-backup","input-output","instance-pools","integration-accounts","integration-environments","integration-service-en\
|
|
1548
|
-
vironments","internet-analyzer-profiles","intune","intune-app-protection","intune-for-education","intune-trends","io-t-central-applications","io-t-edge","io-t-hub","ip-address-manager","ip-groups","journey-hub","key-vaults","keys","kubernetes-fleet-manager","kubernetes-services","lab-accounts","lab-services","language","language-understanding","launch-portal","learn","load-balancer-hub","load-balancers","load-test","load-testing","local-network-gateways","location","log-analytics-query-pack","lo\
|
|
1549
|
-
g-analytics-workspaces","log-streaming","logic-apps","logic-apps-custom-connector","machine-learning","machine-learning-studio-classic-web-services","machine-learning-studio-web-service-plans","machine-learning-studio-workspaces","machines-azure-arc","maintenance-configuration","managed-applications-center","managed-database","managed-desktop","managed-dev-ops-pools","managed-file-shares","managed-identities","managed-instance-apache-cassandra","managed-service-fabric","management-groups","manag\
|
|
1550
|
-
ement-portal","marketplace","marketplace-management","med-tech-service","media","media-file","mesh-applications","metrics","metrics-advisor","microsoft-defender-easm","microsoft-defender-for-cloud","microsoft-defender-for-io-t","microsoft-dev-box","mindaro","mission-landing-zone","mobile","mobile-engagement","mobile-networks","modular-data-center","module","monitor","monitor-health-models","multi-tenancy","multifactor-authentication","my-customers","nat","network-interfaces","network-managers","\
|
|
1551
|
-
network-security-groups","network-security-perimeters","network-watcher","notification-hub-namespaces","notification-hubs","offers","on-premises-data-gateways","open-supply-chain-platform","operation-log-classic","oracle-database","os-images-classic","osconfig","outbound-connection","partner-namespace","partner-registration","partner-topic","peering-service","peerings","personalizers","plans","policy","power","power-bi-embedded","power-platform","power-up","powershell","preview-features","privat\
|
|
1552
|
-
e-endpoints","private-link","private-link-service","private-link-services","process-explorer","production-ready-database","proximity-placement-groups","public-ip-addresses","public-ip-addresses-classic","public-ip-prefixes","qn-a-makers","quickstart-center","recent","recovery-services-vaults","region-management","relays","remote-rendering","reservations","reserved-capacity","reserved-ip-addresses-classic","resource-explorer","resource-graph-explorer","resource-group-list","resource-groups","reso\
|
|
1553
|
-
urce-guard","resource-linked","resource-management-private-link","resource-mover","resources-provider","restore-points","restore-points-collections","route-filters","route-tables","rtos","savings-plans","scheduler","scheduler-job-collections","scvmm-management-servers","search","search-grid","security","security-baselines","send-grid-accounts","server-farm","serverless-search","service-catalog-mad","service-endpoint-policies","service-fabric-clusters","service-health","service-providers","shared\
|
|
1554
|
-
-image-galleries","signal-r","software-as-a-service","software-updates","solutions","sonic-dash","spatial-anchor-accounts","speech-services","spot-vm","spot-vmss","sql-data-warehouses","sql-database","sql-elastic-pools","sql-managed-instance","sql-server","sql-server-registries","ssd","ssh-keys","ssis-lift-and-shift-ir","stack-hci-premium","static-apps","stor-simple-data-managers","stor-simple-device-managers","storage-accounts","storage-accounts-classic","storage-actions","storage-azure-files",
|
|
1555
|
-
"storage-container","storage-explorer","storage-functions","storage-queue","storage-sync-services","stream-analytics-jobs","subnet","subscriptions","system-topic","table","tag","tags","targets-management","template-specs","templates","tenant-properties","tenant-status","test-base","tfs-vc-repository","time-series-data-sets","time-series-insights-access-policies","time-series-insights-environments","time-series-insights-event-sources","toolbox","traffic-manager-profiles","translator-text","troubl\
|
|
1556
|
-
eshoot","universal-print","update-management-center","updates","user-privacy","user-settings","user-subscriptions","users","verifiable-credentials","verification-as-a-service","versions","video-analyzers","virtual-clusters","virtual-enclaves","virtual-instance-for-sap","virtual-machine","virtual-machines-classic","virtual-network-gateways","virtual-networks","virtual-networks-classic","virtual-router","virtual-visits-builder","virtual-wan-hub","virtual-wans","vm-app-definitions","vm-app-versions",
|
|
1557
|
-
"vm-image-version","vm-images-classic","vm-scale-sets","wac","wac-installer","web-app-database","web-application-firewall-policies-waf","web-jobs","web-slots","web-test","website-power","website-staging","windows-notification-services","windows10-core-services","workbooks","worker-container-app","workflow","workspace-gateway","workspaces"],gcp:["access-context-manager","administration","advanced-agent-modeling","advanced-solutions-lab","agent-assist","ai-hub","ai-platform","ai-platform-unified",
|
|
1558
|
-
"analytics-hub","anthos","anthos-config-management","anthos-service-mesh","api","api-analytics","api-monetization","apigee-api-platform","apigee-sense","app-engine","artifact-registry","asset-inventory","assured-workloads","auto-ml","auto-ml-natural-language","auto-ml-tables","auto-ml-translation","auto-ml-video-intelligence","auto-ml-vision","bare-metal-solutions","batch","beyondcorp","big-query","bigtable","billing","binary-authorization","catalog","certificate-authority-service","certificate-\
|
|
1559
|
-
manager","cloud-api-gateway","cloud-apis","cloud-armor","cloud-asset-inventory","cloud-audit-logs","cloud-build","cloud-cdn","cloud-code","cloud-composer","cloud-data-fusion","cloud-deploy","cloud-deployment-manager","cloud-dns","cloud-domains","cloud-ekm","cloud-endpoints","cloud-external-ip-addresses","cloud-firewall-rules","cloud-for-marketing","cloud-functions","cloud-generic","cloud-gpu","cloud-healthcare-api","cloud-healthcare-marketplace","cloud-hsm","cloud-ids","cloud-inference-api","clo\
|
|
1560
|
-
ud-interconnect","cloud-jobs-api","cloud-load-balancing","cloud-logging","cloud-media-edge","cloud-monitoring","cloud-nat","cloud-natural-language-api","cloud-network","cloud-ops","cloud-optimization-ai","cloud-optimization-ai-fleet-routing-api","cloud-router","cloud-routes","cloud-run","cloud-run-for-anthos","cloud-scheduler","cloud-security-scanner","cloud-shell","cloud-spanner","cloud-sql","cloud-storage","cloud-tasks","cloud-test-lab","cloud-tpu","cloud-translation-api","cloud-vision-api","c\
|
|
1561
|
-
loud-vpn","compute-engine","configuration-management","connectivity-test","connectors","contact-center-ai","container-optimized-os","container-registry","data-catalog","data-labeling","data-layers","data-loss-prevention-api","data-qn-a","data-studio","data-transfer","database-migration-service","dataflow","datalab","dataplex","datapol","dataprep","dataproc","dataproc-metastore","datashare","datastore","datastream","debugger","developer-portal","dialogflow","dialogflow-cx","dialogflow-insights","\
|
|
1562
|
-
document-ai","early-access-center","error-reporting","eventarc","filestore","financial-services-marketplace","firestore","fleet-engine","free-trial","game-servers","gce-systems-management","genomics","gke-on-prem","google-cloud-marketplace","google-kubernetes-engine","google-maps-platform","healthcare-nlp-api","home","identity-and-access-management","identity-aware-proxy","identity-platform","iot-core","iot-edge","key-access-justifications","key-management-service","kuberun","launcher","local-ss\
|
|
1563
|
-
d","looker","managed-service-for-microsoft-active-directory","media-translation-api","memorystore","migrate-for-anthos","migrate-for-compute-engine","my-cloud","network-connectivity-center","network-intelligence-center","network-security","network-tiers","network-topology","onboarding","os-configuration-management","os-inventory-management","os-patch-management","partner-interconnect","partner-portal","performance-dashboard","permissions","persistent-disk","phishing-protection","policy-analyzer",
|
|
1564
|
-
"premium-network-tier","private-connectivity","private-service-connect","producer-portal","profiler","project","pub-sub","quantum-engine","quotas","real-world-insights","recommendations-ai","release-notes","retail-api","risk-manager","runtime-config","secret-manager","security","security-command-center","security-health-advisor","security-key-enforcement","service-discovery","speech-to-text","stackdriver","standard-network-tier","stream-suite","support","tensorflow-enterprise","text-to-speech","\
|
|
1565
|
-
tools-for-powershell","trace","traffic-director","transfer","transfer-appliance","user-preferences","vertex-ai","video-intelligence-api","virtual-private-cloud","visual-inspection","vmware-engine","web-risk","web-security-scanner","workflows","workload-identity-pool"],tech:["aarch64","adobe-illustrator","adobe-photoshop","adobe-premiere-pro","adobe-xd","adonis-js","after-effects","airflow","akka","algolia","alpine-js","amazon-web-services","anaconda","android","android-studio","angular","angular\
|
|
1566
|
-
-js","ansible","ant-design","apache","apl","appcelerator","apple","apple-safari","appwrite","arch-linux","arduino","argo-cd","astro","atom","autodesk-maya","autodesk-shot-grid","awk","azios","azure","azure-devops","azure-sql-database","babel","backbone-js","ballerina","bamboo","bash","behance","bitbucket","blender","bootstrap","bower","browserstack","bulma","bun","c","cairo-graphics","cake-php","canva","capacitor","cassandra","cent-os","chrome","circle-ci","clarity","clion","clojure","clojure-sc\
|
|
1567
|
-
ript","cloudflare","cloudflare-workers","cmake","code-igniter","code-pen","codeac","codecov","coffee-script","composer","confluence","consul","contao","corejs","cosmosdb","couchdb","cplusplus","crystal","csharp","css3","cucumber","cypress","d3js","dart","data-grip","data-spell","dbeaver","debian","deno","devicon","digital-ocean","discord-js","django","django-rest","docker","doctrine","dropwizard","drupal","eclipse-ceylon","eclipse-ide","eclipse-vert-x","elasticbeats","elasticsearch","electron","\
|
|
1568
|
-
eleventy-11ty","elixir","elm","embedded-c","ember-js","envoy","erlang","eslint","express","facebook","fast-api","fastify","fauna","feathers","fedora","figma","file-zilla","firebase","firefox","flask","flutter","fortran","foundation","fsharp","gatling","gatsby","gazebo","gcc","gentoo","ghost","gimp","git","gitbook","github","github-actions","github-codespaces","gitlab","gitpod","gitter","gnu-emacs","go","go-land","godot-engine","google","google-cloud","gradle","grafana","grails","graphql","groovy",
|
|
1569
|
-
"grunt-js","gulp-js","hadoop","handlebars","hardhat","harvester","hashicorp-vault","haskell","haxe","helm","heroku","hibernate","homebrew","html5","hugo","ibm-spss-statistics","ie10","ifttt","influxdb","inkscape","insomnia","intellij-idea","ionic","jaeger","jamstack","jasmine","java","javascript","jeet","jekyll","jenkins","jest","jetbrains","jira","jira-align","jquery","json","jule","julia","junit","jupyter","k3os","k3s","kafka","kaggle","karate","karma","keras","kibana","knex-js","knockout","ko\
|
|
1570
|
-
tlin","krakenjs","ktor","kubernetes","labview","laravel","latex","less-js","linkedin","linux","liquibase","livewire","llvm","logstash","lua","lumen","magento","markdown","material-ui","materialize","matlab","matplotlib","maven","meteor-js","microsoft-sql-server","minitab","mob-x","mocha","modx","moleculer","mongodb","mongoose-js","moodle","ms-dos","mysql","nano","nerog","nestjs","net","net-core","network-x","new4j","nextjs","nginx","nhibernate","nim","nimble","nix","nodejs","nodemon","nodewebkit",
|
|
1571
|
-
"npm","nuget","num-py","nuxt-js","objective-c","ocaml","oh-my-zsh","okta","open-al","open-api","open-cl","open-cv","open-gl","open-stack","open-suse","open-telemetry","opera","oracle","p5js","packer","pandas","perl","pf-sense","phalcon","phoenix-framework","photon-engine","php","php-storm","playwrite","ploty","podman","polygon","portainer","postcss","postgresql","postman","powershell","processing","prometheus","protractor","purescript","putty","pycharm","pyscript","pytest","python","python-poetr\
|
|
1572
|
-
y","pytorch","qodana","qt","quarkus","quasar","qwik","r","rabbitmq","rancher","raspberrypi","reach","react","react-bootstrap","realm","red-cube-s-epic-compiler-thingy-programming-re-ct","redhat","redis","redux","ren-py","rider","robot-operating-system-ros","rocksdb","rollup-js","rspec","rstudio","ruby","ruby-mine","ruby-on-rails","rust","salesforce","sanity","sass","scala","scalingo","sdl","selenium","sema-software","sequelize","shopware","sketch","slack","socket-io","solid-js","solidity","sonar\
|
|
1573
|
-
qube","sourcetree","spark","splunk","spring","sql-developer","sqlalchemy","sqlite","ssh","stackoverflow","stata","storybook","streamlit","stylus","subversion","svelte","swagger","swift","symfony","tailwind-css","tauri","tensorflow","terraform","tex","the-algorithms","three-js","titanium-sdk","tomcat","tortoise-git","tower","traefik-mesh","traefik-proxy","travis-ci","trello","twitter","typescript","typo3","ubuntu","uml","unity","unix","unreal-engine","uwsgi","v8","vagrant","vala","vercel","veutif\
|
|
1574
|
-
y","vim","visualstudio","vite","vitejs","vscode","vsphere","vue","vue-storefront","vyper","webassembly","webflow","weblate","webpack","webstorm","windows8","windows11","woo-commerce","wordpress","xamarin","xcode","xml","yaml","yarn","yii-framework","yuno-host","zend-framework","zig"]})].flatMap(([t,e])=>e.map(n=>t+":"+n)),zC=["likec4lib {"," icons {",...V8.map(t=>" "+t)," }","}"].join(`
|
|
1575
|
-
`),HC="likec4builtin",K8=`${HC}:///likec4/lib/icons.c4`;function vd(t){return t.scheme===HC}const ot=vn.getChild("server");function qv(t){ot.error(hr(t))}function Re(t){ot.warn(hr(t))}const X8=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,VC=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Y8=/^([/\\]\s*){2,}[^/\\]/,J8=/^\.?\//;function KC(t){return["./","../"].some(e=>t.startsWith(e))}function lo(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?X8.test(t):VC.test(t)||(e.acceptRelative?Y8.test(t):!1)}function Q8(t="",e){
|
|
1576
|
-
return t.endsWith("/")}function Z8(t="",e){return(Q8(t)?t.slice(0,-1):t)||"/"}function XC(t="",e){return t.endsWith("/")?t:t+"/"}function Oh(t=""){return t.startsWith("/")}function YC(t=""){return(Oh(t)?t.slice(1):t)||"/"}function eU(t=""){return Oh(t)?t:"/"+t}function tU(t,e){if(nU(e))return t;const n=Z8(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function nU(t){return!t||t==="/"}function rU(t){return t&&t!=="/"}function iU(t,...e){let n=t||"";for(const r of e.
|
|
1577
|
-
filter(i=>rU(i)))if(n){const i=r.replace(J8,"");n=XC(n)+i}else n=r;return n}function sU(...t){const e=/\/(?!\/)/,n=t.filter(Boolean),r=[];let i=0;for(const o of n)if(!(!o||o==="/")){for(const[a,u]of o.split(e).entries())if(!(!u||u===".")){if(u===".."){if(r.length===1&&lo(r[0]))continue;r.pop(),i--;continue}if(a===1&&r[r.length-1]?.endsWith(":/")){r[r.length-1]+="/"+u;continue}r.push(u),i++}}let s=r.join("/");return i>=0?n[0]?.startsWith("/")&&!s.startsWith("/")?s="/"+s:n[0]?.startsWith("./")&&!s.
|
|
1578
|
-
startsWith("./")&&(s="./"+s):s="../".repeat(-1*i)+s,n[n.length-1]?.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}function oU(t){return jv(t,"")}function jv(t,e){let n=t.match(VC);return n||(n=t.match(/^\/{2,}/)),n?e+t.slice(n[0].length):e+t}const aU=Symbol.for("ufo:protocolRelative");function uU(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,f,d=""]=n;return{protocol:f.toLowerCase(),pathname:d,href:f+d,auth:"",host:"",search:"",hash:""}}if(!lo(t,{acceptRelative:!0}))
|
|
1579
|
-
return $a(t);const[,r="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:u,search:c,hash:l}=$a(a);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:o,pathname:u,search:c,hash:l,[aU]:!r}}function $a(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const cU=/\/([^/]+)$/;
|
|
1580
|
-
function lU(t="",{strict:e}){const{pathname:n}=uU(t),r=n.match(cU);return r?r[1]:void 0}var dU=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,fU=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,
|
|
1581
|
-
pU=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,
|
|
1582
|
-
Gv={Space_Separator:dU,ID_Start:fU,ID_Continue:pU},Ft={isSpaceSeparator(t){return typeof t=="string"&&Gv.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||Gv.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||Gv.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t==
|
|
1583
|
-
"string"&&/[0-9A-Fa-f]/.test(t)}};let Uv,Cn,Ti,Lh,ts,Rr,Qt,Wv,wd;var hU=function(e,n){Uv=String(e),Cn="start",Ti=[],Lh=0,ts=1,Rr=0,Qt=void 0,Wv=void 0,wd=void 0;do Qt=mU(),vU[Cn]();while(Qt.type!=="eof");return typeof n=="function"?zv({"":wd},"",n):wd};function zv(t,e,n){const r=t[e];if(r!=null&&typeof r=="object")if(Array.isArray(r))for(let i=0;i<r.length;i++){const s=String(i),o=zv(r,s,n);o===void 0?delete r[s]:Object.defineProperty(r,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else
|
|
1584
|
-
for(const i in r){const s=zv(r,i,n);s===void 0?delete r[i]:Object.defineProperty(r,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return n.call(t,e,r)}let Fe,_e,bd,Ci,Ve;function mU(){for(Fe="default",_e="",bd=!1,Ci=1;;){Ve=Ai();const t=JC[Fe]();if(t)return t}}function Ai(){if(Uv[Lh])return String.fromCodePoint(Uv.codePointAt(Lh))}function ee(){const t=Ai();return t===`
|
|
1585
|
-
`?(ts++,Rr=0):t?Rr+=t.length:Rr++,t&&(Lh+=t.length),t}const JC={default(){switch(Ve){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
1586
|
-
`:case"\r":case"\u2028":case"\u2029":ee();return;case"/":ee(),Fe="comment";return;case void 0:return ee(),$t("eof")}if(Ft.isSpaceSeparator(Ve)){ee();return}return JC[Cn]()},comment(){switch(Ve){case"*":ee(),Fe="multiLineComment";return;case"/":ee(),Fe="singleLineComment";return}throw Dt(ee())},multiLineComment(){switch(Ve){case"*":ee(),Fe="multiLineCommentAsterisk";return;case void 0:throw Dt(ee())}ee()},multiLineCommentAsterisk(){switch(Ve){case"*":ee();return;case"/":ee(),Fe="default";return;case void 0:
|
|
1587
|
-
throw Dt(ee())}ee(),Fe="multiLineComment"},singleLineComment(){switch(Ve){case`
|
|
1588
|
-
`:case"\r":case"\u2028":case"\u2029":ee(),Fe="default";return;case void 0:return ee(),$t("eof")}ee()},value(){switch(Ve){case"{":case"[":return $t("punctuator",ee());case"n":return ee(),fo("ull"),$t("null",null);case"t":return ee(),fo("rue"),$t("boolean",!0);case"f":return ee(),fo("alse"),$t("boolean",!1);case"-":case"+":ee()==="-"&&(Ci=-1),Fe="sign";return;case".":_e=ee(),Fe="decimalPointLeading";return;case"0":_e=ee(),Fe="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"\
|
|
1589
|
-
8":case"9":_e=ee(),Fe="decimalInteger";return;case"I":return ee(),fo("nfinity"),$t("numeric",1/0);case"N":return ee(),fo("aN"),$t("numeric",NaN);case'"':case"'":bd=ee()==='"',_e="",Fe="string";return}throw Dt(ee())},identifierNameStartEscape(){if(Ve!=="u")throw Dt(ee());ee();const t=Hv();switch(t){case"$":case"_":break;default:if(!Ft.isIdStartChar(t))throw QC();break}_e+=t,Fe="identifierName"},identifierName(){switch(Ve){case"$":case"_":case"\u200C":case"\u200D":_e+=ee();return;case"\\":ee(),Fe=
|
|
1590
|
-
"identifierNameEscape";return}if(Ft.isIdContinueChar(Ve)){_e+=ee();return}return $t("identifier",_e)},identifierNameEscape(){if(Ve!=="u")throw Dt(ee());ee();const t=Hv();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Ft.isIdContinueChar(t))throw QC();break}_e+=t,Fe="identifierName"},sign(){switch(Ve){case".":_e=ee(),Fe="decimalPointLeading";return;case"0":_e=ee(),Fe="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":_e=ee(),Fe="decimalInt\
|
|
1591
|
-
eger";return;case"I":return ee(),fo("nfinity"),$t("numeric",Ci*(1/0));case"N":return ee(),fo("aN"),$t("numeric",NaN)}throw Dt(ee())},zero(){switch(Ve){case".":_e+=ee(),Fe="decimalPoint";return;case"e":case"E":_e+=ee(),Fe="decimalExponent";return;case"x":case"X":_e+=ee(),Fe="hexadecimal";return}return $t("numeric",Ci*0)},decimalInteger(){switch(Ve){case".":_e+=ee(),Fe="decimalPoint";return;case"e":case"E":_e+=ee(),Fe="decimalExponent";return}if(Ft.isDigit(Ve)){_e+=ee();return}return $t("numeric",
|
|
1592
|
-
Ci*Number(_e))},decimalPointLeading(){if(Ft.isDigit(Ve)){_e+=ee(),Fe="decimalFraction";return}throw Dt(ee())},decimalPoint(){switch(Ve){case"e":case"E":_e+=ee(),Fe="decimalExponent";return}if(Ft.isDigit(Ve)){_e+=ee(),Fe="decimalFraction";return}return $t("numeric",Ci*Number(_e))},decimalFraction(){switch(Ve){case"e":case"E":_e+=ee(),Fe="decimalExponent";return}if(Ft.isDigit(Ve)){_e+=ee();return}return $t("numeric",Ci*Number(_e))},decimalExponent(){switch(Ve){case"+":case"-":_e+=ee(),Fe="decimalE\
|
|
1593
|
-
xponentSign";return}if(Ft.isDigit(Ve)){_e+=ee(),Fe="decimalExponentInteger";return}throw Dt(ee())},decimalExponentSign(){if(Ft.isDigit(Ve)){_e+=ee(),Fe="decimalExponentInteger";return}throw Dt(ee())},decimalExponentInteger(){if(Ft.isDigit(Ve)){_e+=ee();return}return $t("numeric",Ci*Number(_e))},hexadecimal(){if(Ft.isHexDigit(Ve)){_e+=ee(),Fe="hexadecimalInteger";return}throw Dt(ee())},hexadecimalInteger(){if(Ft.isHexDigit(Ve)){_e+=ee();return}return $t("numeric",Ci*Number(_e))},string(){switch(Ve){case"\
|
|
1594
|
-
\\":ee(),_e+=gU();return;case'"':if(bd)return ee(),$t("string",_e);_e+=ee();return;case"'":if(!bd)return ee(),$t("string",_e);_e+=ee();return;case`
|
|
1595
|
-
`:case"\r":throw Dt(ee());case"\u2028":case"\u2029":wU(Ve);break;case void 0:throw Dt(ee())}_e+=ee()},start(){switch(Ve){case"{":case"[":return $t("punctuator",ee())}Fe="value"},beforePropertyName(){switch(Ve){case"$":case"_":_e=ee(),Fe="identifierName";return;case"\\":ee(),Fe="identifierNameStartEscape";return;case"}":return $t("punctuator",ee());case'"':case"'":bd=ee()==='"',Fe="string";return}if(Ft.isIdStartChar(Ve)){_e+=ee(),Fe="identifierName";return}throw Dt(ee())},afterPropertyName(){if(Ve===
|
|
1596
|
-
":")return $t("punctuator",ee());throw Dt(ee())},beforePropertyValue(){Fe="value"},afterPropertyValue(){switch(Ve){case",":case"}":return $t("punctuator",ee())}throw Dt(ee())},beforeArrayValue(){if(Ve==="]")return $t("punctuator",ee());Fe="value"},afterArrayValue(){switch(Ve){case",":case"]":return $t("punctuator",ee())}throw Dt(ee())},end(){throw Dt(ee())}};function $t(t,e){return{type:t,value:e,line:ts,column:Rr}}function fo(t){for(const e of t){if(Ai()!==e)throw Dt(ee());ee()}}function gU(){switch(Ai()){case"\
|
|
1597
|
-
b":return ee(),"\b";case"f":return ee(),"\f";case"n":return ee(),`
|
|
1598
|
-
`;case"r":return ee(),"\r";case"t":return ee()," ";case"v":return ee(),"\v";case"0":if(ee(),Ft.isDigit(Ai()))throw Dt(ee());return"\0";case"x":return ee(),yU();case"u":return ee(),Hv();case`
|
|
1599
|
-
`:case"\u2028":case"\u2029":return ee(),"";case"\r":return ee(),Ai()===`
|
|
1600
|
-
`&&ee(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Dt(ee());case void 0:throw Dt(ee())}return ee()}function yU(){let t="",e=Ai();if(!Ft.isHexDigit(e)||(t+=ee(),e=Ai(),!Ft.isHexDigit(e)))throw Dt(ee());return t+=ee(),String.fromCodePoint(parseInt(t,16))}function Hv(){let t="",e=4;for(;e-- >0;){const n=Ai();if(!Ft.isHexDigit(n))throw Dt(ee());t+=ee()}return String.fromCodePoint(parseInt(t,16))}const vU={start(){if(Qt.type==="eof")throw po();Vv()},beforePropertyName(){
|
|
1601
|
-
switch(Qt.type){case"identifier":case"string":Wv=Qt.value,Cn="afterPropertyName";return;case"punctuator":Fh();return;case"eof":throw po()}},afterPropertyName(){if(Qt.type==="eof")throw po();Cn="beforePropertyValue"},beforePropertyValue(){if(Qt.type==="eof")throw po();Vv()},beforeArrayValue(){if(Qt.type==="eof")throw po();if(Qt.type==="punctuator"&&Qt.value==="]"){Fh();return}Vv()},afterPropertyValue(){if(Qt.type==="eof")throw po();switch(Qt.value){case",":Cn="beforePropertyName";return;case"}":Fh()}},
|
|
1602
|
-
afterArrayValue(){if(Qt.type==="eof")throw po();switch(Qt.value){case",":Cn="beforeArrayValue";return;case"]":Fh()}},end(){}};function Vv(){let t;switch(Qt.type){case"punctuator":switch(Qt.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Qt.value;break}if(wd===void 0)wd=t;else{const e=Ti[Ti.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,Wv,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")Ti.
|
|
1603
|
-
push(t),Array.isArray(t)?Cn="beforeArrayValue":Cn="beforePropertyName";else{const e=Ti[Ti.length-1];e==null?Cn="end":Array.isArray(e)?Cn="afterArrayValue":Cn="afterPropertyValue"}}function Fh(){Ti.pop();const t=Ti[Ti.length-1];t==null?Cn="end":Array.isArray(t)?Cn="afterArrayValue":Cn="afterPropertyValue"}function Dt(t){return Mh(t===void 0?`JSON5: invalid end of input at ${ts}:${Rr}`:`JSON5: invalid character '${ZC(t)}' at ${ts}:${Rr}`)}function po(){return Mh(`JSON5: invalid end of input at ${ts}\
|
|
1604
|
-
:${Rr}`)}function QC(){return Rr-=5,Mh(`JSON5: invalid identifier character at ${ts}:${Rr}`)}function wU(t){console.warn(`JSON5: '${ZC(t)}' in strings is not valid ECMAScript; consider escaping`)}function ZC(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const n=t.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return t}function Mh(t){const e=new SyntaxError(
|
|
1605
|
-
t);return e.lineNumber=ts,e.columnNumber=Rr,e}var bU=function(e,n,r){const i=[];let s="",o,a,u="",c;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(r=n.space,c=n.quote,n=n.replacer),typeof n=="function")a=n;else if(Array.isArray(n)){o=[];for(const v of n){let b;typeof v=="string"?b=v:(typeof v=="number"||v instanceof String||v instanceof Number)&&(b=String(v)),b!==void 0&&o.indexOf(b)<0&&o.push(b)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>
|
|
1606
|
-
0&&(r=Math.min(10,Math.floor(r)),u=" ".substr(0,r)):typeof r=="string"&&(u=r.substr(0,10)),l("",{"":e});function l(v,b){let y=b[v];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(v):typeof y.toJSON=="function"&&(y=y.toJSON(v))),a&&(y=a.call(b,v,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(
|
|
1607
|
-
y);if(typeof y=="object")return Array.isArray(y)?h(y):d(y)}function f(v){const b={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let E="";for(let A=0;A<v.length;A++){const N=v[A];switch(N){case"'":case'"':b[N]++,E+=N;continue;case"\0":if(Ft.isDigit(v[A+1])){E+="\\x00";continue}}if(y[N]){E+=y[N];continue}if(N<" "){let K=N.charCodeAt(0).toString(16);E+="\\x"+("00"+K).substring(K.length);
|
|
1608
|
-
continue}E+=N}const R=c||Object.keys(b).reduce((A,N)=>b[A]<b[N]?A:N);return E=E.replace(new RegExp(R,"g"),y[R]),R+E+R}function d(v){if(i.indexOf(v)>=0)throw TypeError("Converting circular structure to JSON5");i.push(v);let b=s;s=s+u;let y=o||Object.keys(v),E=[];for(const A of y){const N=l(A,v);if(N!==void 0){let K=p(A)+":";u!==""&&(K+=" "),K+=N,E.push(K)}}let R;if(E.length===0)R="{}";else{let A;if(u==="")A=E.join(","),R="{"+A+"}";else{let N=`,
|
|
1609
|
-
`+s;A=E.join(N),R=`{
|
|
1610
|
-
`+s+A+`,
|
|
1611
|
-
`+b+"}"}}return i.pop(),s=b,R}function p(v){if(v.length===0)return f(v);const b=String.fromCodePoint(v.codePointAt(0));if(!Ft.isIdStartChar(b))return f(v);for(let y=b.length;y<v.length;y++)if(!Ft.isIdContinueChar(String.fromCodePoint(v.codePointAt(y))))return f(v);return v}function h(v){if(i.indexOf(v)>=0)throw TypeError("Converting circular structure to JSON5");i.push(v);let b=s;s=s+u;let y=[];for(let R=0;R<v.length;R++){const A=l(String(R),v);y.push(A!==void 0?A:"null")}let E;if(y.length===0)E=
|
|
1612
|
-
"[]";else if(u==="")E="["+y.join(",")+"]";else{let R=`,
|
|
1613
|
-
`+s,A=y.join(R);E=`[
|
|
1614
|
-
`+s+A+`,
|
|
1615
|
-
`+b+"]"}return i.pop(),s=b,E}};const EU={parse:hU,stringify:bU};var eA=EU,Kv;function tA(t){return{lang:t?.lang??Kv?.lang,message:t?.message,abortEarly:t?.abortEarly??Kv?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Kv?.abortPipeEarly}}var $U;function DU(t){return $U?.get(t)}var RU;function kU(t){return RU?.get(t)}var TU;function CU(t,e){return TU?.get(t)?.get(e)}function AU(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="funct\
|
|
1616
|
-
ion"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function Ed(t,e,n,r,i){const s=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??AU(s),u={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=t.kind==="schema",l=i?.message??t.message??CU(t.reference,u.lang)??(c?kU(
|
|
1617
|
-
u.lang):null)??r.message??DU(u.lang);l!==void 0&&(u.message=typeof l=="function"?l(u):l),c&&(n.typed=!1),n.issues?n.issues.push(u):n.issues=[u]}function $d(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},tA())}}}var SU=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Bh(t){return{kind:"metadata",type:"description",reference:Bh,description:t}}function Xv(t){return{kind:"validation",type:"non_empty",reference:Xv,async:!1,
|
|
1618
|
-
expects:"!0",message:t,"~run"(e,n){return e.typed&&e.value.length===0&&Ed(this,"length",e,n,{received:"0"}),e}}}function _U(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function nA(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function rA(t,e){return{kind:"schema",type:"array",reference:rA,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return $d(this)},"~run"(n,r){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let s=0;s<
|
|
1619
|
-
i.length;s++){const o=i[s],a=this.item["~run"]({value:o},r);if(a.issues){const u={type:"array",origin:"value",input:i,key:s,value:o};for(const c of a.issues)c.path?c.path.unshift(u):c.path=[u],n.issues?.push(c);if(n.issues||(n.issues=a.issues),r.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else Ed(this,"type",n,r);return n}}}function iA(t,e){return{kind:"schema",type:"object",reference:iA,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return $d(this)},
|
|
1620
|
-
"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const s in this.entries){const o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=s in i?i[s]:nA(o),u=o["~run"]({value:a},r);if(u.issues){const c={type:"object",origin:"value",input:i,key:s,value:a};for(const l of u.issues)l.path?l.path.unshift(c):l.path=[c],n.issues?.push(l);if(n.issues||(n.issues=u.issues),r.abortEarly){n.typed=!1;break}}u.
|
|
1621
|
-
typed||(n.typed=!1),n.value[s]=u.value}else if(o.fallback!==void 0)n.value[s]=_U(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(Ed(this,"key",n,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}}else Ed(this,"type",n,r);return n}}}function Yv(t,e){return{kind:"schema",type:"optional",reference:Yv,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return $d(this)},"~\
|
|
1622
|
-
run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=nA(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function qh(t){return{kind:"schema",type:"string",reference:qh,expects:"string",async:!1,message:t,get"~standard"(){return $d(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:Ed(this,"type",e,n),e}}}function PU(t,e,n){const r=t["~run"]({value:e},tA(n));if(r.issues)throw new SU(r.issues);return r.value}function Jv(...t){return{...t[0],pipe:t,get"\
|
|
1623
|
-
~standard"(){return $d(this)},"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=r["~run"](e,n))}return e}}}const xU=iA({name:Jv(qh(),Xv(),Bh("Project name, must be unique in the workspace")),contactPerson:Yv(Jv(qh(),Xv(),Bh("A person who has been involved in creating or maintaining this project"))),exclude:Yv(Jv(rA(qh()),Bh('List of file patterns to exclude from the \
|
|
1624
|
-
project, default is ["node_modules"]')))});function NU(t){return IU(eA.parse(t))}function IU(t){return PU(xU,t)}const sA=ot.getChild("ProjectsManager");class Qn{constructor(e){this.services=e,sA.debug`created`}static DefaultProjectId="default";static ConfigFileNames=[".likec4rc",".likec4.config.json","likec4.config.json"];projectIdToFolder=new b_;_mappingsToProject;_projects=[];get defaultProjectId(){if(!(this._projects.length>1))return this._projects[0]?.id??Qn.DefaultProjectId}get all(){return jr(
|
|
1625
|
-
this._projects,1)?[...xt(this._projects,ui("id")),Qn.DefaultProjectId]:[Qn.DefaultProjectId]}getProject(e){if(e===Qn.DefaultProjectId)return{folder:this.services.workspace.WorkspaceManager.workspaceUri,config:{name:Qn.DefaultProjectId}};const n=Wt(this._projects.find(({id:r})=>r===e),`Project "${e}" not found`);return{folder:Et.parse(n.folder),config:n.config}}ensureProjectId(e){return e===Qn.DefaultProjectId?e:e?(Ie(this.projectIdToFolder.has(e),`Project ID ${e} is not registered`),e):Wt(this.defaultProjectId,
|
|
1626
|
-
()=>`Specify exact project, known: [${[...this.projectIdToFolder.keys()].join(", ")}]`)}hasMultipleProjects(){return this._projects.length>1}async loadConfigFile(e){if(e.isDirectory)return!1;const n=lU(e.uri.fsPath,{strict:!1});return n&&Qn.ConfigFileNames.includes(n)?(await this.registerProject(e.uri),!0):!1}async registerProject(e){if(Et.isUri(e)){const o=e,a=await this.services.workspace.FileSystemProvider.readFile(o),u=NU(a),c=sU(o.path,".."),l=o.with({path:c});return this.registerProject({config:u,
|
|
1627
|
-
folderUri:l})}const{config:n,folderUri:r}=e,i=n.name;if(this._projects.some(({id:o})=>o===i))throw new Error(`Project ID ${i} already registered`);let s;Et.isUri(r)?s=r.toString():s=lo(r)?r:jv(r,"file://"),this._projects=Xe([...this._projects,{folder:s,config:n,id:i}],pG([({folder:o})=>oU(o).split("/").length,"desc"])),this.projectIdToFolder.set(i,s),sA.debug`registered project ${i} folder: ${s})`}belongsTo(e){let n;return typeof e=="string"?n=lo(e)?e:jv(e,"file://"):Et.isUri(e)?n=e.toString():n=
|
|
1628
|
-
e.uri.toString(),this.mappingsToProject.get(n,()=>this.getProjectId(n))}getProjectId(e){return this._projects.find(({folder:n})=>e.toString().startsWith(n))?.id??Qn.DefaultProjectId}get mappingsToProject(){return this._mappingsToProject??=new fp(this.services),this._mappingsToProject}}const OU={fileSystemProvider:()=>new MU},LU=[...Bv.fileExtensions,...Qn.ConfigFileNames],FU=t=>LU.some(e=>t.endsWith(e));let MU=class extends Q4{async readFile(e){return vd(e)?Promise.resolve(zC):await super.readFile(
|
|
1629
|
-
e)}async readDirectory(e){const n=[];try{const r=await new J4.fdir().withSymlinks({resolvePaths:!1}).withFullPaths().filter(FU).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:Et.file(i)})}catch(r){qv(r)}return n}};var BU=Object.getOwnPropertyNames,qU=Object.getOwnPropertySymbols,jU=Object.prototype.hasOwnProperty;function oA(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function jh(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="o\
|
|
1630
|
-
bject")return t(n,r,i);var s=i.cache,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var u=t(n,r,i);return s.delete(n),s.delete(r),u}}function aA(t){return BU(t).concat(qU(t))}var GU=Object.hasOwn||function(t,e){return jU.call(t,e)};function ho(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var UU="__v",WU="__o",zU="_owner",uA=Object.getOwnPropertyDescriptor,cA=Object.keys;function HU(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;
|
|
1631
|
-
return!0}function VU(t,e){return ho(t.getTime(),e.getTime())}function KU(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function XU(t,e){return t===e}function lA(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(),o,a,u=0;(o=s.next())&&!o.done;){for(var c=e.entries(),l=!1,f=0;(a=c.next())&&!a.done;){if(i[f]){f++;continue}var d=o.value,p=a.value;if(n.equals(d[0],p[0],u,f,t,e,n)&&n.equals(d[1],p[1],d[0],p[0],t,e,n)){
|
|
1632
|
-
l=i[f]=!0;break}f++}if(!l)return!1;u++}return!0}var YU=ho;function JU(t,e,n){var r=cA(t),i=r.length;if(cA(e).length!==i)return!1;for(;i-- >0;)if(!fA(t,e,n,r[i]))return!1;return!0}function Dd(t,e,n){var r=aA(t),i=r.length;if(aA(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],!fA(t,e,n,s)||(o=uA(t,s),a=uA(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function QU(t,e){return ho(t.valueOf(),e.valueOf())}function ZU(t,e){
|
|
1633
|
-
return t.source===e.source&&t.flags===e.flags}function dA(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(),o,a;(o=s.next())&&!o.done;){for(var u=e.values(),c=!1,l=0;(a=u.next())&&!a.done;){if(!i[l]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){c=i[l]=!0;break}l++}if(!c)return!1}return!0}function eW(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 tW(t,e){return t.hostname===e.hostname&&t.pathname===
|
|
1634
|
-
e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function fA(t,e,n,r){return(r===zU||r===WU||r===UU)&&(t.$$typeof||e.$$typeof)?!0:GU(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var nW="[object Arguments]",rW="[object Boolean]",iW="[object Date]",sW="[object Error]",oW="[object Map]",aW="[object Number]",uW="[object Object]",cW="[object RegExp]",lW="[object Set]",dW="[object String]",fW="[object URL]",pW=Array.isArray,pA=typeof ArrayBuffer==
|
|
1635
|
-
"function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,hA=Object.assign,hW=Object.prototype.toString.call.bind(Object.prototype.toString);function mW(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,o=t.areNumbersEqual,a=t.areObjectsEqual,u=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,l=t.areSetsEqual,f=t.areTypedArraysEqual,d=t.areUrlsEqual;return function(h,v,b){if(h===v)return!0;if(h==null||v==null)return!1;var y=typeof h;if(y!==typeof v)
|
|
1636
|
-
return!1;if(y!=="object")return y==="number"?o(h,v,b):y==="function"?i(h,v,b):!1;var E=h.constructor;if(E!==v.constructor)return!1;if(E===Object)return a(h,v,b);if(pW(h))return e(h,v,b);if(pA!=null&&pA(h))return f(h,v,b);if(E===Date)return n(h,v,b);if(E===RegExp)return c(h,v,b);if(E===Map)return s(h,v,b);if(E===Set)return l(h,v,b);var R=hW(h);return R===iW?n(h,v,b):R===cW?c(h,v,b):R===oW?s(h,v,b):R===lW?l(h,v,b):R===uW?typeof h.then!="function"&&typeof v.then!="function"&&a(h,v,b):R===fW?d(h,v,b):
|
|
1637
|
-
R===sW?r(h,v,b):R===nW?a(h,v,b):R===rW||R===aW||R===dW?u(h,v,b):!1}}function gW(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Dd:HU,areDatesEqual:VU,areErrorsEqual:KU,areFunctionsEqual:XU,areMapsEqual:r?oA(lA,Dd):lA,areNumbersEqual:YU,areObjectsEqual:r?Dd:JU,arePrimitiveWrappersEqual:QU,areRegExpsEqual:ZU,areSetsEqual:r?oA(dA,Dd):dA,areTypedArraysEqual:r?Dd:eW,areUrlsEqual:tW};if(n&&(i=hA({},i,n(i))),e){var s=jh(i.areArraysEqual),o=jh(i.areMapsEqual),a=jh(i.areObjectsEqual),
|
|
1638
|
-
u=jh(i.areSetsEqual);i=hA({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:u})}return i}function yW(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function vW(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(),f=l.cache,d=f===void 0?e?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,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 o={cache:void 0,
|
|
1639
|
-
equals:i,meta:void 0,strict:s};return function(u,c){return n(u,c,o)}}var Qv=ns();ns({strict:!0}),ns({circular:!0}),ns({circular:!0,strict:!0}),ns({createInternalComparator:function(){return ho}}),ns({strict:!0,createInternalComparator:function(){return ho}}),ns({circular:!0,createInternalComparator:function(){return ho}}),ns({circular:!0,createInternalComparator:function(){return ho},strict:!0});function ns(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.
|
|
1640
|
-
createState,s=t.strict,o=s===void 0?!1:s,a=gW(t),u=mW(a),c=r?r(u):yW(u);return vW({circular:n,comparator:u,createState:i,equals:c,strict:o})}function mA(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:o,y:a,width:u,height:c}=s;return{...i,width:u,height:c,position:[o,a]}}),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 gA=(t,e)=>t.width>e.width+10||t.height>e.height+10;
|
|
1641
|
-
function wW(t,e){if(t.hash===e.hash)return{diagram:mA(t,e)};if(Qv(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||gA(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:mA(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.
|
|
1642
|
-
nodes[i.id];if(i.children.length>0||!s)return r;const o={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||gA(i,s)||(o.fixedsize={width:s.width,height:s.height}),r.push(o),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:Qu(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function yA(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Zv(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.
|
|
1643
|
-
id=="string"}function vA(t){return Zv(t)||yA(t)}function Rd(t){return typeof t=="string"||vA(t)}function bW(t){return Array.isArray(t)&&t.every(Rd)}function EW(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function wA(t){if(vA(t))return t;const[e,n,r]=t.split(":");return EW(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function $W(t){if(t.length<2&&(Rd(t[0])&&Rd(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>wA(e))}const Gh=Object.seal({Graph:null,
|
|
1644
|
-
Digraph:null,Subgraph:null,Node:null,Edge:null});function DW(t){return Object.assign(Object.seal(Object.assign({},Gh)),t)}function RW(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function ar(t,...e){return RW(t,...e)}const kW=t=>(...e)=>n=>t(n,...e),TW=t=>({[Symbol.iterator]:t}),kr=kW((t,e)=>Array.from(TW(function*(){for(const n of t)yield e(n)})));class bA{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){
|
|
1645
|
-
return{location:this.getLocation(),...n,type:e,children:r}}}const rt=bA.prototype.createElement.bind(new bA),CW=/\r?\n/;function Tr(t){return e=>e.join(t)}function AW(t){return e=>t+e+t}function rs(t,e){return n=>t+n+e}function Uh(t){return e=>t+e}const EA=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Wh=t=>t.split(CW),kd=(t,e,n)=>ar(Wh,kr(Uh(t==="space"?" ".repeat(e):`
|
|
1646
|
-
`)),Tr(n)),mo=t=>{switch(t){case"crlf":return`\r
|
|
1647
|
-
`;case"lf":return`
|
|
1648
|
-
`}},SW={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=mo(t.endOfLine);return ar(kr(t.print),Tr(n),kd(t.indentStyle,t.indentSize,n),rs(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},_W={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},PW={match(t){return t.type==="Comment"},print(t,e){const n=mo(t.endOfLine);switch(e.kind){case"Block":return ar(Wh,kr(
|
|
1649
|
-
Uh(" * ")),Tr(n),rs(`/**${n}`,`${n} */`))(e.value);case"Macro":return ar(Wh,kr(Uh("# ")),Tr(n))(e.value);case"Slash":default:return ar(Wh,kr(Uh("// ")),Tr(n))(e.value)}}},xW={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(mo(t.endOfLine))}},NW={match(t){return t.type==="Edge"},print(t,e){const n=ar(kr(t.print),Tr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=mo(t.endOfLine),i=ar(kr(t.print),Tr(r),kd(t.indentStyle,t.indentSize,
|
|
1650
|
-
r),rs(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},IW={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=mo(t.endOfLine),i=ar(kr(t.print),Tr(r),kd(t.indentStyle,t.indentSize,r),rs(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},OW=ar(EA,AW('"')),LW=rs("<",">"),FW={match(t){return t.type==="Literal"},print(t,e){
|
|
1651
|
-
switch(e.quoted){case"html":return LW(e.value);case!0:return OW(e.value);case!1:default:return EA(e.value)}}},MW={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=mo(t.endOfLine),i=ar(kr(t.print),Tr(r),kd(t.indentStyle,t.indentSize,r),rs(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},BW={match(t){return t.type==="NodeRefGroup"},print(t,e){return ar(kr(t.print),Tr(" "),rs("{","}"))(e.children)}},qW={match(t){return t.type==="Node\
|
|
1652
|
-
Ref"},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(":")}},jW={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=mo(t.endOfLine),i=ar(kr(t.print),Tr(r),kd(t.indentStyle,t.indentSize,r),rs(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},GW=[SW,_W,PW,xW,NW,IW,FW,MW,BW,qW,jW];class UW{options;#e=[...GW];constructor(e={}){
|
|
1653
|
-
this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,o={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(a){for(const u of n)if(u.match(a))return u.print(o,a);throw Error()}};return o.print(e)}}function WW(t,e){const n=new UW(e).print(t);if(!n)throw new Error;return n}function zh(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?rt("Attribute",{key:rt("Literal",{value:t,quoted:!1},[]),value:rt("Literal",{value:n.
|
|
1654
|
-
slice(1,n.length-1),quoted:"html"},[])},[]):rt("Attribute",{key:rt("Literal",{value:t,quoted:!1},[]),value:rt("Literal",{value:e,quoted:!0},[])},[])}return rt("Attribute",{key:rt("Literal",{value:t,quoted:!1},[]),value:rt("Literal",{value:String(e),quoted:!1},[])},[])}function go(t,e){return rt("Comment",{kind:e,value:t},[])}function $A(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield zh(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield go(n.comment,t.
|
|
1655
|
-
commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield go(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield go(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield go(n.comment,t.commentKind)),yield t.convert(n)}())}const zW={match(t){return t.$$type==="AttributeList"},convert(t,e){return rt("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>zh(n,r)))}},HW={match(t){return t.$$type==="Edge"},convert(t,e){
|
|
1656
|
-
return rt("Edge",{targets:e.targets.map(n=>Zv(n)?rt("NodeRef",{id:rt("Literal",{value:n.id,quoted:!0},[])},[]):yA(n)?rt("NodeRef",{id:rt("Literal",{value:n.id,quoted:!0},[]),port:n.port?rt("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?rt("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):rt("NodeRefGroup",{},n.map(r=>Zv(r)?rt("NodeRef",{id:rt("Literal",{value:r.id,quoted:!0},[])},[]):rt("NodeRef",{id:rt("Literal",{value:r.id,quoted:!0},[]),port:r.port?rt("Literal",{value:r.port,
|
|
1657
|
-
quoted:!0},[]):void 0,compass:r.compass?rt("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[go(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>zh(n,r))])}},VW={match(t){return t.$$type==="Graph"},convert(t,e){return rt("Dot",{},[...e.comment?[go(e.comment,t.commentKind)]:[],rt("Graph",{directed:e.directed,strict:e.strict,id:e.id?rt("Literal",{value:e.id,quoted:!0},[]):void 0},$A(t,e))])}},KW={match(t){return t.$$type==="Node"},convert(t,e){
|
|
1658
|
-
return rt("Node",{id:rt("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[go(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>zh(n,r))])}},XW={match(t){return t.$$type==="Subgraph"},convert(t,e){return rt("Subgraph",{id:e.id?rt("Literal",{value:e.id,quoted:!0},[]):void 0},$A(t,e))}},YW=[zW,HW,KW,VW,XW];class JW{options;#e=[...YW];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){
|
|
1659
|
-
for(const o of n)if(o.match(s))return o.convert(i,s);throw Error()}};return i.convert(e)}}function QW(t,e){return new JW(e).convert(t)}const L=new Proxy(Object.freeze({}),{get:(t,e)=>e});class ew{}class tw extends ew{#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(
|
|
1660
|
-
e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class nw extends tw{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class DA extends tw{#e=Gh;id;comment;attributes=Object.freeze({graph:new nw("Graph"),edge:new nw("Edge"),node:new nw("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,
|
|
1661
|
-
subgraphs:new Set};with(e){this.#e=DW(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){
|
|
1662
|
-
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=>bW(s)?$W(s):wA(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(o=>typeof o=="string"),r=e.find(o=>typeof o=="object"&&o!==null),i=e.find(o=>typeof o=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.
|
|
1663
|
-
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(a=>typeof a=="object"&&a!==null),s=n.find(a=>typeof a=="function"),o=this.getNode(r)??this.createNode(r);return i!==void 0&&o.attributes.apply(i),s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(a=>typeof a=="object"),s=n.find(a=>typeof a=="function"),o=this.createEdge(r,i);return s!==void 0&&s(
|
|
1664
|
-
o),o}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class RA extends DA{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 ZW extends RA{get directed(){return!0}}let ez=class extends RA{get directed(){return!1}};class tz extends DA{get $$type(){return"Subgraph"}id;constructor(...e){
|
|
1665
|
-
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 kA extends tw{comment}let nz=class extends ew{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new kA(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class rz extends ew{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){
|
|
1666
|
-
if(super(),this.targets=e,e.length<2&&(Rd(e[0])&&Rd(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new kA(n)}}Object.assign(Gh,{Graph:ez,Digraph:ZW,Subgraph:tz,Node:nz,Edge:rz});function TA(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"),o=n.find(u=>typeof u=="function"),a=new r(i,e,s);return a.with(this),typeof o=="function"&&o(a),a}}function CA(t,e=Gh){return Object.
|
|
1667
|
-
freeze({digraph:TA.call(e,!0,t),graph:TA.call(e,!1,t)})}const AA=CA(!1),iz=AA.digraph;AA.graph;const sz=CA(!0);function SA(t,e){const n=QW(t,e?.convert);return WW(n,e?.print)}var rw,_A;function oz(){if(_A)return rw;_A=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(`
|
|
1668
|
-
`).map(o=>t(o)).join(`
|
|
1669
|
-
`)}rw=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,o=typeof i.indent=="string"?i.indent:" ",a=i.newline||`
|
|
1670
|
-
`+o,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"),f=r.match(l)||[],d=o+f.map(function(p){return p.slice(-1)===`
|
|
1671
|
-
`&&(p=p.slice(0,p.length-1)),u(p)}).join(a);return i.trim===!0&&(d=e(d)),d};function n(r){return r}return rw}var az=oz();const uz=Fi(az),Hh={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<
|
|
1672
|
-
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 Hh.hue2rgb(s,i,t+1/3)*255;case"g":return Hh.hue2rgb(s,i,t)*255;case"b":return Hh.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),o=(i+s)/2;if(r==="l")return o*100;if(i===s)return 0;const a=i-s,u=o>.5?a/(2-i-s):a/(i+s);if(r==="s")return u*100;switch(i){case t:
|
|
1673
|
-
return((e-n)/a+(e<n?6:0))*60;case e:return((n-t)/a+2)*60;case n:return((t-e)/a+4)*60;default:return-1}}},cz={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},lz={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Me={channel:Hh,lang:cz,unit:lz},is={};for(let t=0;t<=255;t++)is[t]=Me.unit.dec2hex(t);const hn={ALL:0,RGB:1,HSL:2};class dz{constructor(){this.type=hn.ALL}get(){return this.type}set(e){if(this.type&&this.type!==
|
|
1674
|
-
e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=hn.ALL}is(e){return this.type===e}}class fz{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new dz}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=hn.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=Me.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=Me.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Me.channel.rgb2hsl(e,"l"))}_ensureRGB(){
|
|
1675
|
-
const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=Me.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=Me.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Me.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(hn.HSL)&&n!==void 0?n:(this._ensureHSL(),Me.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(hn.HSL)&&n!==void 0?n:(this._ensureHSL(),Me.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(hn.HSL)&&n!==void 0?n:(this._ensureHSL(),Me.
|
|
1676
|
-
channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(hn.RGB)&&n!==void 0?n:(this._ensureRGB(),Me.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(hn.RGB)&&n!==void 0?n:(this._ensureRGB(),Me.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(hn.RGB)&&n!==void 0?n:(this._ensureRGB(),Me.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(hn.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(hn.RGB),
|
|
1677
|
-
this.changed=!0,this.data.g=e}set b(e){this.type.set(hn.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(hn.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(hn.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(hn.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const iw=new fz({r:0,g:0,b:0,a:0},"transparent"),Da={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Da.re);if(!e)return;const n=e[1],
|
|
1678
|
-
r=parseInt(n,16),i=n.length,s=i%4===0,o=i>4,a=o?1:17,u=o?8:4,c=s?0:-1,l=o?255:15;return iw.set({r:(r>>u*(c+3)&l)*a,g:(r>>u*(c+2)&l)*a,b:(r>>u*(c+1)&l)*a,a:s?(r&l)*a/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${is[Math.round(e)]}${is[Math.round(n)]}${is[Math.round(r)]}${is[Math.round(i*255)]}`:`#${is[Math.round(e)]}${is[Math.round(n)]}${is[Math.round(r)]}`}},yo={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,
|
|
1679
|
-
hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(yo.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return Me.channel.clamp.h(parseFloat(n)*.9);case"rad":return Me.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Me.channel.clamp.h(parseFloat(n)*360)}}return Me.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(yo.re);if(!n)return;const[,r,i,s,o,a]=n;return iw.set({h:yo._hue2deg(r),s:Me.channel.clamp.s(parseFloat(
|
|
1680
|
-
i)),l:Me.channel.clamp.l(parseFloat(s)),a:o?Me.channel.clamp.a(a?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${Me.lang.round(e)}, ${Me.lang.round(n)}%, ${Me.lang.round(r)}%, ${i})`:`hsl(${Me.lang.round(e)}, ${Me.lang.round(n)}%, ${Me.lang.round(r)}%)`}},Td={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",
|
|
1681
|
-
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:"#8f\
|
|
1682
|
-
bc8f",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:"#cd5c\
|
|
1683
|
-
5c",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:"\
|
|
1684
|
-
#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:"\
|
|
1685
|
-
#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:"\
|
|
1686
|
-
#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=Td.colors[t];if(e)return Da.parse(e)},stringify:t=>{const e=Da.stringify(t);for(const n in Td.colors)if(Td.colors[n]===e)return n}},Cd={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,
|
|
1687
|
-
parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(Cd.re);if(!n)return;const[,r,i,s,o,a,u,c,l]=n;return iw.set({r:Me.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:Me.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:Me.channel.clamp.b(u?parseFloat(a)*2.55:parseFloat(a)),a:c?Me.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(${Me.lang.round(e)}, ${Me.lang.round(n)}, ${Me.lang.round(r)}, ${Me.lang.
|
|
1688
|
-
round(i)})`:`rgb(${Me.lang.round(e)}, ${Me.lang.round(n)}, ${Me.lang.round(r)})`}},ss={format:{keyword:Td,hex:Da,rgb:Cd,rgba:Cd,hsl:yo,hsla:yo},parse:t=>{if(typeof t!="string")return t;const e=Da.parse(t)||Cd.parse(t)||yo.parse(t)||Td.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(hn.HSL)||t.data.r===void 0?yo.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Cd.stringify(t):Da.
|
|
1689
|
-
stringify(t)},pz=(t,e)=>{const n=ss.parse(t);for(const r in e)n[r]=Me.channel.clamp[r](e[r]);return ss.stringify(n)},PA=t=>ss.format.hex.stringify(ss.parse(t)),hz=(t,e,n)=>{const r=ss.parse(t),i=r[e],s=Me.channel.clamp[e](i+n);return i!==s&&(r[e]=s),ss.stringify(r)},mz=(t,e)=>hz(t,"a",-.3),gz=(t,e)=>{const n=ss.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return pz(t,r)},yz=(t,e)=>{const n=ss.parse(t),r={},i=(s,o,a)=>o>0?(a-s)*o/100:s*o/100;for(const s in e)r[s]=i(n[s],e[s],Me.channel.max[s]);
|
|
1690
|
-
return gz(t,r)};function Yn(t){return t.children.length>0}function mn(t){switch(t){case"open":return"vee";default:return t}}function zr(t){return Array.isArray(t)?[zr(t[0]),zr(t[1])]:(Ie(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const xA=t=>(Ie(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),yt=t=>Math.ceil(t/72*1e3)/1e3,ur=t=>Math.ceil(t);ur(40).toString();function NA(t,e){return PA(yz(t,{l:-35-5*e,s:-15-5*e}))}function vz(t){return PA(mz(t))}function wz(t){
|
|
1691
|
-
return t.trim().replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function IA(t,{maxchars:e,maxLines:n,sanitize:r=_G()}){let i=uz(t,{width:e,indent:"",escape:r}).split(`
|
|
1692
|
-
`);return an(n)&&n>0&&i.length>n&&(i=i.slice(0,n-1)),i}function vo({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let o=IA(t,{maxchars:e,maxLines:r,sanitize:wz}).join("<BR/>");i&&(o=`<B>${o}</B>`);const a=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${ur(n)}"${a}>${o}</FONT>`}function sw(t){return Yt.textSizes[t]}function bz(t){switch(t){case"xs":case"sm":return 25;case"md":return 35;case"lg":case"xl":return 45;default:qe(t)}}function Ez(t,e,n){const r=["sm","xs"].includes(n.shape),i=ce(
|
|
1693
|
-
t.icon),s=[vo({text:t.title,fontsize:sw(n.text),maxchars:bz(n.shape),maxLines:r?1:3})];if(n.shape!=="xs"&&(ce(t.technology?.trim())&&s.push(vo({text:t.technology,fontsize:Math.ceil(sw(n.text)*.65),maxchars:i?35:45,maxLines:1,color:e.loContrast})),ce(t.description?.trim())&&s.push(vo({text:t.description,fontsize:Math.ceil(sw(n.text)*.75),maxchars:i?35:45,maxLines:r?3:5,color:e.loContrast}))),s.length===1&&!i)return`<${s[0]}>`;const o=i?(a,u,c)=>{let l=`<TD ALIGN="TEXT" BALIGN="LEFT">${a}</TD>`;if(u===
|
|
1694
|
-
0){const f=c.length>1?` ROWSPAN="${c.length}"`:"";let d=76;["xs","sm"].includes(n.shape)&&(d=16),(t.shape==="queue"||t.shape==="mobile")&&(d+=20),l=`<TD${f} WIDTH="${d}"> </TD>${l}`,l=`${l}<TD${f} WIDTH="16"> </TD>`}return`<TR>${l}</TR>`}:a=>`<TR><TD>${a}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="4">${s.map(o).join("")}</TABLE>>`}function $z(t,e){const n=vo({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE\
|
|
1695
|
-
BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const Vh=40,OA=5,ow=`BGCOLOR="${Yt.relationships[Ia].labelBgColor}A0"`;function LA({label:t,technology:e}){const n=[];if(ce(t?.trim())&&n.push(vo({text:t,maxchars:Vh,fontsize:14,maxLines:OA,bold:t==="[...]"})),ce(e?.trim())&&n.push(vo({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:Vh})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join(
|
|
1696
|
-
"");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${ow}>${r}</TABLE>>`}function Dz(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${ow}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${ur(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ce(e?.trim())?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${ow} CELLPADDING="3">`,vo({text:e,maxchars:Vh,fontsize:14,maxLines:5}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}var aw,FA;function uw(){if(FA)
|
|
1697
|
-
return aw;FA=1;function t(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,r=0;return new t(function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(function(){return{done:!0}});return e},t.fromSequence=function(e){var n=0,r=e.length;return new t(function(){return n>=r?{done:!0}:{done:!1,value:e[n++]}})},
|
|
1698
|
-
t.is=function(e){return e instanceof t?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},aw=t,aw}var Rz=uw();const cr=Fi(Rz);var Kh={},MA;function kz(){return MA||(MA=1,Kh.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Kh.SYMBOL_SUPPORT=typeof Symbol<"u"),Kh}var cw,BA;function qA(){if(BA)return cw;BA=1;var t=uw(),e=kz(),n=e.ARRAY_BUFFER_SUPPORT,r=e.SYMBOL_SUPPORT;function i(s){return typeof s=="string"||Array.isArray(s)||n&&ArrayBuffer.isView(s)?t.fromSequence(s):typeof s!="object"||s===null?
|
|
1699
|
-
null:r&&typeof s[Symbol.iterator]=="function"?s[Symbol.iterator]():typeof s.next=="function"?s:null}return cw=function(o){var a=i(o);if(!a)throw new Error("obliterator: target is not iterable nor a valid iterator.");return a},cw}var lw,jA;function Tz(){if(jA)return lw;jA=1;var t=qA();return lw=function(n,r){for(var i=arguments.length>1?r:1/0,s=i!==1/0?new Array(i):[],o,a=0,u=t(n);;){if(a===i)return s;if(o=u.next(),o.done)return a!==r&&(s.length=a),s;s[a++]=o.value}},lw}var Cz=Tz();const GA=Fi(Cz);
|
|
1700
|
-
var dw,UA;function Az(){if(UA)return dw;UA=1;var t=uw(),e=qA();return dw=function(){var r=arguments,i=null,s=-1;return new t(function(){var a=null;do{if(i===null){if(s++,s>=r.length)return{done:!0};i=e(r[s])}if(a=i.next(),a.done===!0){i=null;continue}break}while(!0);return a})},dw}var Sz=Az();const Si=Fi(Sz);function _z(){const t=arguments[0];for(let e=1,n=arguments.length;e<n;e++)if(arguments[e])for(const r in arguments[e])t[r]=arguments[e][r];return t}let Vt=_z;typeof Object.assign=="function"&&
|
|
1701
|
-
(Vt=Object.assign);function lr(t,e,n,r){const i=t._nodes.get(e);let s=null;return i&&(r==="mixed"?s=i.out&&i.out[n]||i.undirected&&i.undirected[n]:r==="directed"?s=i.out&&i.out[n]:s=i.undirected&&i.undirected[n]),s}function cn(t){return typeof t=="object"&&t!==null}function WA(t){let e;for(e in t)return!1;return!0}function dr(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function Cr(t,e,n){const r={enumerable:!0,configurable:!0};typeof n=="function"?r.get=
|
|
1702
|
-
n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r)}function zA(t){return!(!cn(t)||t.attributes&&!Array.isArray(t.attributes))}function Pz(){let t=Math.floor(Math.random()*256)&255;return()=>t++}class fw extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class me extends fw{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,me.prototype.constructor)}}class ae extends fw{constructor(e){
|
|
1703
|
-
super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ae.prototype.constructor)}}class Ce extends fw{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ce.prototype.constructor)}}function HA(t,e){this.key=t,this.attributes=e,this.clear()}HA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=
|
|
1704
|
-
0,this.in={},this.out={},this.undirected={}};function VA(t,e){this.key=t,this.attributes=e,this.clear()}VA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function KA(t,e){this.key=t,this.attributes=e,this.clear()}KA.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ra(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r}Ra.prototype.attach=function(){let t="\
|
|
1705
|
-
out",e="in";this.undirected&&(t=e="undirected");const n=this.source.key,r=this.target.key;this.source[t][r]=this,!(this.undirected&&n===r)&&(this.target[e][n]=this)},Ra.prototype.attachMulti=function(){let t="out",e="in";const n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");const i=this.source[t],s=i[r];if(typeof s>"u"){i[r]=this,this.undirected&&n===r||(this.target[e][n]=this);return}s.previous=this,this.next=s,i[r]=this,this.target[e][n]=this},Ra.prototype.detach=function(){
|
|
1706
|
-
const t=this.source.key,e=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t]},Ra.prototype.detachMulti=function(){const t=this.source.key,e=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,this.next!==
|
|
1707
|
-
void 0&&(this.next.previous=this.previous))};const XA=0,YA=1,xz=2,JA=3;function _i(t,e,n,r,i,s,o){let a,u,c,l;if(r=""+r,n===XA){if(a=t._nodes.get(r),!a)throw new ae(`Graph.${e}: could not find the "${r}" node in the graph.`);c=i,l=s}else if(n===JA){if(i=""+i,u=t._edges.get(i),!u)throw new ae(`Graph.${e}: could not find the "${i}" edge in the graph.`);const f=u.source.key,d=u.target.key;if(r===f)a=u.target;else if(r===d)a=u.source;else throw new ae(`Graph.${e}: the "${r}" node is not attached to \
|
|
1708
|
-
the "${i}" edge (${f}, ${d}).`);c=s,l=o}else{if(u=t._edges.get(r),!u)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`);n===YA?a=u.source:a=u.target,c=i,l=s}return[a,c,l]}function Nz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=_i(this,e,n,r,i,s);return o.attributes[a]}}function Iz(t,e,n){t.prototype[e]=function(r,i){const[s]=_i(this,e,n,r,i);return s.attributes}}function Oz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=_i(this,e,n,r,i,s);return o.attributes.hasOwnProperty(
|
|
1709
|
-
a)}}function Lz(t,e,n){t.prototype[e]=function(r,i,s,o){const[a,u,c]=_i(this,e,n,r,i,s,o);return a.attributes[u]=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:u}),this}}function Fz(t,e,n){t.prototype[e]=function(r,i,s,o){const[a,u,c]=_i(this,e,n,r,i,s,o);if(typeof c!="function")throw new me(`Graph.${e}: updater should be a function.`);const l=a.attributes,f=c(l[u]);return l[u]=f,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,
|
|
1710
|
-
name:u}),this}}function Mz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=_i(this,e,n,r,i,s);return delete o.attributes[a],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:a}),this}}function Bz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=_i(this,e,n,r,i,s);if(!cn(a))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=a,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function qz(t,e,n){
|
|
1711
|
-
t.prototype[e]=function(r,i,s){const[o,a]=_i(this,e,n,r,i,s);if(!cn(a))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return Vt(o.attributes,a),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:a}),this}}function jz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=_i(this,e,n,r,i,s);if(typeof a!="function")throw new me(`Graph.${e}: provided updater is not a function.`);return o.attributes=a(o.attributes),this.emit("nodeAttributesUpdat\
|
|
1712
|
-
ed",{key:o.key,type:"update",attributes:o.attributes}),this}}const Gz=[{name:t=>`get${t}Attribute`,attacher:Nz},{name:t=>`get${t}Attributes`,attacher:Iz},{name:t=>`has${t}Attribute`,attacher:Oz},{name:t=>`set${t}Attribute`,attacher:Lz},{name:t=>`update${t}Attribute`,attacher:Fz},{name:t=>`remove${t}Attribute`,attacher:Mz},{name:t=>`replace${t}Attributes`,attacher:Bz},{name:t=>`merge${t}Attributes`,attacher:qz},{name:t=>`update${t}Attributes`,attacher:jz}];function Uz(t){Gz.forEach(function({name:e,
|
|
1713
|
-
attacher:n}){n(t,e("Node"),XA),n(t,e("Source"),YA),n(t,e("Target"),xz),n(t,e("Opposite"),JA)})}function Wz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);
|
|
1714
|
-
const o=""+r,a=""+i;if(i=arguments[2],s=lr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]}}function zz(t,e,n){t.prototype[e]=function(r){
|
|
1715
|
-
let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,o=""+arguments[1];if(i=lr(this,s,o,n),!i)throw new ae(`Graph.${e}: could not find an edge for the given path ("${s}" - "${o}").`)}else{
|
|
1716
|
-
if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function Hz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);
|
|
1717
|
-
if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=lr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edg\
|
|
1718
|
-
e with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes.hasOwnProperty(i)}}function Vz(t,e,n){t.prototype[e]=function(r,i,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about\
|
|
1719
|
-
an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,u=""+i;if(i=arguments[2],s=arguments[3],o=lr(this,a,u,n),!o)throw new ae(`Graph.${e}: could not find an edge for the given path ("${a}" - "${u}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new ae(`Graph.${e}\
|
|
1720
|
-
: could not find the "${r}" edge in the graph.`)}return o.attributes[i]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function Kz(t,e,n){t.prototype[e]=function(r,i,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes \
|
|
1721
|
-
in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,u=""+i;if(i=arguments[2],s=arguments[3],o=lr(this,a,u,n),!o)throw new ae(`Graph.${e}: could not find an edge for the given path ("${a}" - "${u}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new ae(`Graph.${e}: could not find th\
|
|
1722
|
-
e "${r}" edge in the graph.`)}if(typeof s!="function")throw new me(`Graph.${e}: updater should be a function.`);return o.attributes[i]=s(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function Xz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}\
|
|
1723
|
-
: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=lr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this.
|
|
1724
|
-
_edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete s.attributes[i],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:i}),this}}function Yz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target\
|
|
1725
|
-
} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=lr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(
|
|
1726
|
-
`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=i,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function Jz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`G\
|
|
1727
|
-
raph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=lr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+
|
|
1728
|
-
r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return Vt(s.attributes,i),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:i}),this}}function Qz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.
|
|
1729
|
-
length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=lr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this k\
|
|
1730
|
-
ey could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new me(`Graph.${e}: provided updater is not a function.`);return s.attributes=i(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const Zz=[{name:t=>`get${t}Attribute`,attacher:Wz},{name:t=>`get${t}Attributes`,attacher:zz},{name:t=>`has${t}Attribute`,attacher:Hz},{name:t=>`se\
|
|
1731
|
-
t${t}Attribute`,attacher:Vz},{name:t=>`update${t}Attribute`,attacher:Kz},{name:t=>`remove${t}Attribute`,attacher:Xz},{name:t=>`replace${t}Attributes`,attacher:Yz},{name:t=>`merge${t}Attributes`,attacher:Jz},{name:t=>`update${t}Attributes`,attacher:Qz}];function e6(t){Zz.forEach(function({name:e,attacher:n}){n(t,e("Edge"),"mixed"),n(t,e("DirectedEdge"),"directed"),n(t,e("UndirectedEdge"),"undirected")})}const t6=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"o\
|
|
1732
|
-
utEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function n6(t,e,n,r){let i=!1;for(const s in e){if(s===r)continue;const o=e[s];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),t&&i)return o.key}}function r6(t,e,n,r){let i,s,o,a=!1;for(const u in e)if(u!==r){i=e[u];
|
|
1733
|
-
do{if(s=i.source,o=i.target,a=n(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected),t&&a)return i.key;i=i.next}while(i!==void 0)}}function pw(t,e){const n=Object.keys(t),r=n.length;let i,s=0;return new cr(function(){do if(i)i=i.next;else{if(s>=r)return{done:!0};const a=n[s++];if(a===e){i=void 0;continue}i=t[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.
|
|
1734
|
-
attributes,undirected:i.undirected}}})}function i6(t,e,n,r){const i=e[n];if(!i)return;const s=i.source,o=i.target;if(r(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected)&&t)return i.key}function s6(t,e,n,r){let i=e[n];if(!i)return;let s=!1;do{if(s=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&s)return i.key;i=i.next}while(i!==void 0)}function hw(t,e){let n=t[e];return n.next!==void 0?new cr(function(){if(!n)return{done:!0};
|
|
1735
|
-
const r={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:r}}):cr.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function o6(t,e){if(t.size===0)return[];if(e==="mixed"||e===t.type)return typeof Array.from=="funct\
|
|
1736
|
-
ion"?Array.from(t._edges.keys()):GA(t._edges.keys(),t._edges.size);const n=e==="undirected"?t.undirectedSize:t.directedSize,r=new Array(n),i=e==="undirected",s=t._edges.values();let o=0,a,u;for(;a=s.next(),a.done!==!0;)u=a.value,u.undirected===i&&(r[o++]=u.key);return r}function QA(t,e,n,r){if(e.size===0)return;const i=n!=="mixed"&&n!==e.type,s=n==="undirected";let o,a,u=!1;const c=e._edges.values();for(;o=c.next(),o.done!==!0;){if(a=o.value,i&&a.undirected!==s)continue;const{key:l,attributes:f,
|
|
1737
|
-
source:d,target:p}=a;if(u=r(l,f,d.key,p.key,d.attributes,p.attributes,a.undirected),t&&u)return l}}function a6(t,e){if(t.size===0)return cr.empty();const n=e!=="mixed"&&e!==t.type,r=e==="undirected",i=t._edges.values();return new cr(function(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(n&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.
|
|
1738
|
-
undirected},done:!1}})}function mw(t,e,n,r,i,s){const o=e?r6:n6;let a;if(n!=="undirected"&&(r!=="out"&&(a=o(t,i.in,s),t&&a)||r!=="in"&&(a=o(t,i.out,s,r?void 0:i.key),t&&a))||n!=="directed"&&(a=o(t,i.undirected,s),t&&a))return a}function u6(t,e,n,r){const i=[];return mw(!1,t,e,n,r,function(s){i.push(s)}),i}function c6(t,e,n){let r=cr.empty();return t!=="undirected"&&(e!=="out"&&typeof n.in<"u"&&(r=Si(r,pw(n.in))),e!=="in"&&typeof n.out<"u"&&(r=Si(r,pw(n.out,e?void 0:n.key)))),t!=="directed"&&typeof n.
|
|
1739
|
-
undirected<"u"&&(r=Si(r,pw(n.undirected))),r}function gw(t,e,n,r,i,s,o){const a=n?s6:i6;let u;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(u=a(t,i.in,s,o),t&&u)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==s)&&(u=a(t,i.out,s,o),t&&u))||e!=="directed"&&typeof i.undirected<"u"&&(u=a(t,i.undirected,s,o),t&&u))return u}function l6(t,e,n,r,i){const s=[];return gw(!1,t,e,n,r,i,function(o){s.push(o)}),s}function d6(t,e,n,r){let i=cr.empty();return t!=="undirected"&&(typeof n.in<"u"&&e!=="out"&&r in n.
|
|
1740
|
-
in&&(i=Si(i,hw(n.in,r))),typeof n.out<"u"&&e!=="in"&&r in n.out&&(e||n.key!==r)&&(i=Si(i,hw(n.out,r)))),t!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=Si(i,hw(n.undirected,r))),i}function f6(t,e){const{name:n,type:r,direction:i}=e;t.prototype[n]=function(s,o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return o6(this,r);if(arguments.length===1){s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new ae(`Graph.${n}: could not find the "${s}\
|
|
1741
|
-
" node in the graph.`);return u6(this.multi,r==="mixed"?this.type:r,i,a)}if(arguments.length===2){s=""+s,o=""+o;const a=this._nodes.get(s);if(!a)throw new ae(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(o))throw new ae(`Graph.${n}: could not find the "${o}" target node in the graph.`);return l6(r,this.multi,i,a,o)}throw new me(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function p6(t,e){const{name:n,type:r,direction:i}=e,
|
|
1742
|
-
s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(c,l,f){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return f=c,QA(!1,this,r,f);if(arguments.length===2){c=""+c,f=l;const d=this._nodes.get(c);if(typeof d>"u")throw new ae(`Graph.${s}: could not find the "${c}" node in the graph.`);return mw(!1,this.multi,r==="mixed"?this.type:r,i,d,f)}if(arguments.length===3){c=""+c,l=""+l;const d=this._nodes.get(c);if(!d)throw new ae(`Graph.${s}: could not fi\
|
|
1743
|
-
nd the "${c}" source node in the graph.`);if(!this._nodes.has(l))throw new ae(`Graph.${s}: could not find the "${l}" target node in the graph.`);return gw(!1,r,this.multi,i,d,l,f)}throw new me(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();let f;if(c.length===0){let d=0;r!=="directed"&&(d+=this.undirectedSize),r!=="undirected"&&(d+=
|
|
1744
|
-
this.directedSize),f=new Array(d);let p=0;c.push((h,v,b,y,E,R,A)=>{f[p++]=l(h,v,b,y,E,R,A)})}else f=[],c.push((d,p,h,v,b,y,E)=>{f.push(l(d,p,h,v,b,y,E))});return this[s].apply(this,c),f};const a="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop(),f=[];return c.push((d,p,h,v,b,y,E)=>{l(d,p,h,v,b,y,E)&&f.push(d)}),this[s].apply(this,c),f};const u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){let c=Array.prototype.
|
|
1745
|
-
slice.call(arguments);if(c.length<2||c.length>4)throw new me(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new me(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let l,f;c.length===2?(l=c[0],f=c[1],c=[]):c.length===3?(l=c[1],f=
|
|
1746
|
-
c[2],c=[c[0]]):c.length===4&&(l=c[2],f=c[3],c=[c[0],c[1]]);let d=f;return c.push((p,h,v,b,y,E,R)=>{d=l(d,p,h,v,b,y,E,R)}),this[s].apply(this,c),d}}function h6(t,e){const{name:n,type:r,direction:i}=e,s="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(u,c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return l=u,QA(!0,this,r,l);if(arguments.length===2){u=""+u,l=c;const f=this._nodes.get(u);if(typeof f>"u")throw new ae(`Graph.${s}: could not fi\
|
|
1747
|
-
nd the "${u}" node in the graph.`);return mw(!0,this.multi,r==="mixed"?this.type:r,i,f,l)}if(arguments.length===3){u=""+u,c=""+c;const f=this._nodes.get(u);if(!f)throw new ae(`Graph.${s}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(c))throw new ae(`Graph.${s}: could not find the "${c}" target node in the graph.`);return gw(!0,r,this.multi,i,f,c,l)}throw new me(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+n[0].
|
|
1748
|
-
toUpperCase()+n.slice(1,-1);t.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((f,d,p,h,v,b,y)=>c(f,d,p,h,v,b,y)),!!this[s].apply(this,u)};const a="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((f,d,p,h,v,b,y)=>!c(f,d,p,h,v,b,y)),!this[s].apply(this,u)}}function m6(t,e){const{name:n,type:r,direction:i}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(o,a){if(r!==
|
|
1749
|
-
"mixed"&&this.type!=="mixed"&&r!==this.type)return cr.empty();if(!arguments.length)return a6(this,r);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new ae(`Graph.${s}: could not find the "${o}" node in the graph.`);return c6(r,i,u)}if(arguments.length===2){o=""+o,a=""+a;const u=this._nodes.get(o);if(!u)throw new ae(`Graph.${s}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new ae(`Graph.${s}: could not find the "${a}" target node in \
|
|
1750
|
-
the graph.`);return d6(r,i,u,a)}throw new me(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function g6(t){t6.forEach(e=>{f6(t,e),p6(t,e),h6(t,e),m6(t,e)})}const y6=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"\
|
|
1751
|
-
undirectedNeighbors",type:"undirected"}];function Xh(){this.A=null,this.B=null}Xh.prototype.wrap=function(t){this.A===null?this.A=t:this.B===null&&(this.B=t)},Xh.prototype.has=function(t){return this.A!==null&&t in this.A||this.B!==null&&t in this.B};function Ad(t,e,n,r,i){for(const s in r){const o=r[s],a=o.source,u=o.target,c=a===n?u:a;if(e&&e.has(c.key))continue;const l=i(c.key,c.attributes);if(t&&l)return c.key}}function yw(t,e,n,r,i){if(e!=="mixed"){if(e==="undirected")return Ad(t,null,r,r.undirected,
|
|
1752
|
-
i);if(typeof n=="string")return Ad(t,null,r,r[n],i)}const s=new Xh;let o;if(e!=="undirected"){if(n!=="out"){if(o=Ad(t,null,r,r.in,i),t&&o)return o;s.wrap(r.in)}if(n!=="in"){if(o=Ad(t,s,r,r.out,i),t&&o)return o;s.wrap(r.out)}}if(e!=="directed"&&(o=Ad(t,s,r,r.undirected,i),t&&o))return o}function v6(t,e,n){if(t!=="mixed"){if(t==="undirected")return Object.keys(n.undirected);if(typeof e=="string")return Object.keys(n[e])}const r=[];return yw(!1,t,e,n,function(i){r.push(i)}),r}function Sd(t,e,n){const r=Object.
|
|
1753
|
-
keys(n),i=r.length;let s=0;return new cr(function(){let a=null;do{if(s>=i)return t&&t.wrap(n),{done:!0};const u=n[r[s++]],c=u.source,l=u.target;if(a=c===e?l:c,t&&t.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}})}function w6(t,e,n){if(t!=="mixed"){if(t==="undirected")return Sd(null,n,n.undirected);if(typeof e=="string")return Sd(null,n,n[e])}let r=cr.empty();const i=new Xh;return t!=="undirected"&&(e!=="out"&&(r=Si(r,Sd(i,n,n.in))),e!==
|
|
1754
|
-
"in"&&(r=Si(r,Sd(i,n,n.out)))),t!=="directed"&&(r=Si(r,Sd(i,n,n.undirected))),r}function b6(t,e){const{name:n,type:r,direction:i}=e;t.prototype[n]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new ae(`Graph.${n}: could not find the "${s}" node in the graph.`);return v6(r==="mixed"?this.type:r,i,o)}}function E6(t,e){const{name:n,type:r,direction:i}=e,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(c,l){
|
|
1755
|
-
if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new ae(`Graph.${s}: could not find the "${c}" node in the graph.`);yw(!1,r==="mixed"?this.type:r,i,f,l)};const o="map"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(c,l){const f=[];return this[s](c,(d,p)=>{f.push(l(d,p))}),f};const a="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(c,l){const f=[];return this[s](c,(d,p)=>{l(d,p)&&f.push(d)}),f};const u="reduce"+
|
|
1756
|
-
n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(c,l,f){if(arguments.length<3)throw new me(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d=f;return this[s](c,(p,h)=>{d=l(d,p,h)}),d}}function $6(t,e){const{name:n,type:r,direction:i}=e,s=n[0].toUpperCase()+n.slice(1,-1),o="find"+s;t.prototype[o]=function(c,l){if(r!=="mixed"&&this.type!==
|
|
1757
|
-
"mixed"&&r!==this.type)return;c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new ae(`Graph.${o}: could not find the "${c}" node in the graph.`);return yw(!0,r==="mixed"?this.type:r,i,f,l)};const a="some"+s;t.prototype[a]=function(c,l){return!!this[o](c,l)};const u="every"+s;t.prototype[u]=function(c,l){return!this[o](c,(d,p)=>!l(d,p))}}function D6(t,e){const{name:n,type:r,direction:i}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)
|
|
1758
|
-
return cr.empty();o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new ae(`Graph.${s}: could not find the "${o}" node in the graph.`);return w6(r==="mixed"?this.type:r,i,a)}}function R6(t){y6.forEach(e=>{b6(t,e),E6(t,e),$6(t,e),D6(t,e)})}function Yh(t,e,n,r,i){const s=r._nodes.values(),o=r.type;let a,u,c,l,f,d;for(;a=s.next(),a.done!==!0;){let p=!1;if(u=a.value,o!=="undirected"){l=u.out;for(c in l){f=l[c];do d=f.target,p=!0,i(u.key,d.key,u.attributes,d.attributes,f.key,f.attributes,f.undirected),
|
|
1759
|
-
f=f.next;while(f)}}if(o!=="directed"){l=u.undirected;for(c in l)if(!(e&&u.key>c)){f=l[c];do d=f.target,d.key!==c&&(d=f.source),p=!0,i(u.key,d.key,u.attributes,d.attributes,f.key,f.attributes,f.undirected),f=f.next;while(f)}}n&&!p&&i(u.key,null,u.attributes,null,null,null,null)}}function k6(t,e){const n={key:t};return WA(e.attributes)||(n.attributes=Vt({},e.attributes)),n}function T6(t,e,n){const r={key:e,source:n.source.key,target:n.target.key};return WA(n.attributes)||(r.attributes=Vt({},n.attributes)),
|
|
1760
|
-
t==="mixed"&&n.undirected&&(r.undirected=!0),r}function C6(t){if(!cn(t))throw new me('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new me("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!cn(t.attributes)||t.attributes===null))throw new me("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function A6(t){if(!cn(t))throw new me('Graph.impor\
|
|
1761
|
-
t: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new me("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new me("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!cn(t.attributes)||t.attributes===null))throw new me("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&typeof t.undirected!=
|
|
1762
|
-
"boolean")throw new me("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const S6=Pz(),_6=new Set(["directed","undirected","mixed"]),ZA=new Set(["domain","_events","_eventsCount","_maxListeners"]),P6=[{name:t=>`${t}Edge`,generateKey:!0},{name:t=>`${t}DirectedEdge`,generateKey:!0,type:"directed"},{name:t=>`${t}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:t=>`${t}EdgeWithKey`},{name:t=>`${t}DirectedEdgeWithKey`,type:"directed"},{name:t=>`${t}U\
|
|
1763
|
-
ndirectedEdgeWithKey`,type:"undirected"}],x6={allowSelfLoops:!0,multi:!1,type:"mixed"};function N6(t,e,n){if(n&&!cn(n))throw new me(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(e=""+e,n=n||{},t._nodes.has(e))throw new Ce(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function eS(t,e,n){const r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("\
|
|
1764
|
-
nodeAdded",{key:e,attributes:n}),r}function tS(t,e,n,r,i,s,o,a){if(!r&&t.type==="undirected")throw new Ce(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&t.type==="directed")throw new Ce(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(a&&!cn(a))throw new me(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`);if(s=""+s,o=""+o,a=a||
|
|
1765
|
-
{},!t.allowSelfLoops&&s===o)throw new Ce(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=t._nodes.get(s),c=t._nodes.get(o);if(!u)throw new ae(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new ae(`Graph.${e}: target node "${o}" not found.`);const l={key:null,undirected:r,source:s,target:o,attributes:a};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new Ce(`Grap\
|
|
1766
|
-
h.${e}: the "${i}" edge already exists in the graph.`);if(!t.multi&&(r?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new Ce(`Graph.${e}: an edge linking "${s}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const f=new Ra(r,i,u,c,a);t._edges.set(i,f);const d=s===o;return r?(u.undirectedDegree++,c.undirectedDegree++,d&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,c.
|
|
1767
|
-
inDegree++,d&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?f.attachMulti():f.attach(),r?t._undirectedSize++:t._directedSize++,l.key=i,t.emit("edgeAdded",l),i}function I6(t,e,n,r,i,s,o,a,u){if(!r&&t.type==="undirected")throw new Ce(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&t.type==="directed")throw new Ce(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph\
|
|
1768
|
-
. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(a){if(u){if(typeof a!="function")throw new me(`Graph.${e}: invalid updater function. Expecting a function but got "${a}"`)}else if(!cn(a))throw new me(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`)}s=""+s,o=""+o;let c;if(u&&(c=a,a=void 0),!t.allowSelfLoops&&s===o)throw new Ce(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' optio\
|
|
1769
|
-
n set to false.`);let l=t._nodes.get(s),f=t._nodes.get(o),d,p;if(!n&&(d=t._edges.get(i),d)){if((d.source.key!==s||d.target.key!==o)&&(!r||d.source.key!==o||d.target.key!==s))throw new Ce(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${s}" source & "${o}" target vs. ("${d.source.key}", "${d.target.key}").`);p=d}if(!p&&!t.multi&&l&&(p=r?l.undirected[o]:l.out[o]),p){const E=[p.key,!1,!1,!1];if(u?!c:!a)return E;if(u){const R=p.attributes;p.attributes=c(R),t.emit(
|
|
1770
|
-
"edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else Vt(p.attributes,a),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:a});return E}a=a||{},u&&c&&(a=c(a));const h={key:null,undirected:r,source:s,target:o,attributes:a};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new Ce(`Graph.${e}: the "${i}" edge already exists in the graph.`);let v=!1,b=!1;l||(l=eS(t,s,{}),v=!0,s===o&&(f=l,b=!0)),f||(f=eS(t,o,{}),b=!0),d=new Ra(
|
|
1771
|
-
r,i,l,f,a),t._edges.set(i,d);const y=s===o;return r?(l.undirectedDegree++,f.undirectedDegree++,y&&(l.undirectedLoops++,t._undirectedSelfLoopCount++)):(l.outDegree++,f.inDegree++,y&&(l.directedLoops++,t._directedSelfLoopCount++)),t.multi?d.attachMulti():d.attach(),r?t._undirectedSize++:t._directedSize++,h.key=i,t.emit("edgeAdded",h),[i,!0,v,b]}function ka(t,e){t._edges.delete(e.key);const{source:n,target:r,attributes:i}=e,s=e.undirected,o=n===r;s?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,
|
|
1772
|
-
t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),s?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:s})}class ct extends M_{constructor(e){if(super(),e=Vt({},x6,e),typeof e.multi!="boolean")throw new me(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!_6.has(e.type))throw new me(`Graph.con\
|
|
1773
|
-
structor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new me(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const n=e.type==="mixed"?HA:e.type==="directed"?VA:KA;dr(this,"NodeDataClass",n);const r="geid_"+S6()+"_";let i=0;const s=()=>{let o;do o=r+i++;while(this._edges.has(o));return o};dr(this,"_attributes",{}),dr(this,"_nodes",new Map),dr(
|
|
1774
|
-
this,"_edges",new Map),dr(this,"_directedSize",0),dr(this,"_undirectedSize",0),dr(this,"_directedSelfLoopCount",0),dr(this,"_undirectedSelfLoopCount",0),dr(this,"_edgeKeyGenerator",s),dr(this,"_options",e),ZA.forEach(o=>dr(this,o,this[o])),Cr(this,"order",()=>this._nodes.size),Cr(this,"size",()=>this._edges.size),Cr(this,"directedSize",()=>this._directedSize),Cr(this,"undirectedSize",()=>this._undirectedSize),Cr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),
|
|
1775
|
-
Cr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Cr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Cr(this,"multi",this._options.multi),Cr(this,"type",this._options.type),Cr(this,"allowSelfLoops",this._options.allowSelfLoops),Cr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,n){if(this.
|
|
1776
|
-
type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(n):!1}throw new me(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+
|
|
1777
|
-
e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(n):!1}throw new me(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,n){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?
|
|
1778
|
-
typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new me(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,n){if(this.type==="undirected")return;if(e=""+e,n=""+n,this.multi)throw new Ce("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & targe\
|
|
1779
|
-
t. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new ae(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new ae(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(e,n){if(this.type==="directed")return;if(e=""+e,n=""+n,this.multi)throw new Ce("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be mul\
|
|
1780
|
-
tiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new ae(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new ae(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(e,n){if(this.multi)throw new Ce("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges b\
|
|
1781
|
-
etween source & target. See #.edges instead.");e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new ae(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areDirectedNeighbors: could not find the "${e}" n\
|
|
1782
|
-
ode in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(e,n){e=
|
|
1783
|
-
""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)
|
|
1784
|
-
throw new ae(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inDeg\
|
|
1785
|
-
ree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(e){e=""+e;const n=this.
|
|
1786
|
-
_nodes.get(e);if(!n)throw new ae(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outboundDegree: coul\
|
|
1787
|
-
d not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inDegreeWithoutSe\
|
|
1788
|
-
lfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node i\
|
|
1789
|
-
n the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the \
|
|
1790
|
-
graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(e){
|
|
1791
|
-
e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.source: could not find the "${e}" edge in the graph.`);return n.source.key}target(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(
|
|
1792
|
-
`Graph.target: could not find the "${e}" edge in the graph.`);return n.target.key}extremities(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(e,n){e=""+e,n=""+n;const r=this._edges.get(n);if(!r)throw new ae(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,s=r.target.key;if(e===i)return s;if(e===s)return i;throw new ae(`Graph.opposite: the "${e}\
|
|
1793
|
-
" node is not attached to the "${n}" edge (${i}, ${s}).`)}hasExtremity(e,n){e=""+e,n=""+n;const r=this._edges.get(e);if(!r)throw new ae(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return n.undirected}isDirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.isDirected: could not f\
|
|
1794
|
-
ind the "${e}" edge in the graph.`);return!n.undirected}isSelfLoop(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return n.source===n.target}addNode(e,n){return N6(this,e,n).key}mergeNode(e,n){if(n&&!cn(n))throw new me(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);e=""+e,n=n||{};let r=this._nodes.get(e);return r?(n&&(Vt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.
|
|
1795
|
-
attributes,data:n})),[e,!1]):(r=new this.NodeDataClass(e,n),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:n}),[e,!0])}updateNode(e,n){if(n&&typeof n!="function")throw new me(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);e=""+e;let r=this._nodes.get(e);if(r){if(n){const s=r.attributes;r.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(
|
|
1796
|
-
e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do ka(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do ka(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do ka(this,r),r=r.next;while(r)}this._nodes.delete(e),this.
|
|
1797
|
-
emit("nodeDropped",{key:e,attributes:n.attributes})}dropEdge(e){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=lr(this,r,i,this.type),!n)throw new ae(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,n=this._edges.get(e),!n)throw new ae(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return ka(this,n),this}dropDirectedEdge(e,n){if(arguments.length<2)throw new Ce("Graph.dropDirectedEdge: it does not make sense to \
|
|
1798
|
-
try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ce("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,n=""+n;const r=lr(this,e,n,"directed");if(!r)throw new ae(`Graph.dropDirectedEdge: could not find a "${e}" -> "${n}" edge in the graph.`);return ka(this,r),this}dropUndirectedEdge(e,n){
|
|
1799
|
-
if(arguments.length<2)throw new Ce("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ce("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=lr(this,e,n,"undirected");if(!r)throw new ae(`Graph.dropUndirectedEdge: cou\
|
|
1800
|
-
ld not find a "${e}" -> "${n}" edge in the graph.`);return ka(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let n;for(;n=e.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,n){
|
|
1801
|
-
return this._attributes[e]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,n){if(typeof n!="function")throw new me("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),
|
|
1802
|
-
this}replaceAttributes(e){if(!cn(e))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!cn(e))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return Vt(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")
|
|
1803
|
-
throw new me("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,n){if(typeof e!="function")throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!zA(n))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.
|
|
1804
|
-
values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(e,n){if(typeof e!="function")throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!zA(n))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,s,o,a;for(;i=r.next(),i.done!==!0;)s=i.
|
|
1805
|
-
value,o=s.source,a=s.target,s.attributes=e(s.key,s.attributes,o.key,a.key,o.attributes,a.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new me("Graph.forEachAdjacencyEntry: expecting a callback.");Yh(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new me("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Yh(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=
|
|
1806
|
-
"function")throw new me("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Yh(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new me("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Yh(!1,!0,!0,this,e)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):GA(this._nodes.keys(),this._nodes.size)}forEachNode(e){if(typeof e!="function")throw new me("Graph.forEachNode: expecting a callback.");const n=this.
|
|
1807
|
-
_nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new me("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new me("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const s=new Array(this.order);let o=0;for(;r=n.next(),r.done!==!0;)i=r.value,s[o++]=e(
|
|
1808
|
-
i.key,i.attributes);return s}someNode(e){if(typeof e!="function")throw new me("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new me("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new me(
|
|
1809
|
-
"Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const s=[];for(;r=n.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&s.push(i.key);return s}reduceNodes(e,n){if(typeof e!="function")throw new me("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new me("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could \
|
|
1810
|
-
with a simple array.");let r=n;const i=this._nodes.values();let s,o;for(;s=i.next(),s.done!==!0;)o=s.value,r=e(r,o.key,o.attributes);return r}nodeEntries(){const e=this._nodes.values();return new cr(()=>{const n=e.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}})}export(){const e=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,s)=>{e[n++]=k6(s,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,s)=>{r[n++]=T6(
|
|
1811
|
-
this.type,s,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,n=!1){if(e instanceof ct)return e.forEachNode((u,c)=>{n?this.mergeNode(u,c):this.addNode(u,c)}),e.forEachEdge((u,c,l,f,d,p,h)=>{n?h?this.mergeUndirectedEdgeWithKey(u,l,f,c):this.mergeDirectedEdgeWithKey(u,l,f,c):h?this.addUndirectedEdgeWithKey(u,l,f,c):this.addDirectedEdgeWithKey(u,l,f,c)}),this;if(!cn(e))throw new me("Graph.import: invalid argu\
|
|
1812
|
-
ment. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!cn(e.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,s,o,a;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new me("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=s.length;r<i;r++){o=s[r],C6(o);const{key:u,attributes:c}=o;n?this.mergeNode(u,c):this.addNode(u,c)}}if(e.edges){
|
|
1813
|
-
let u=!1;if(this.type==="undirected"&&(u=!0),s=e.edges,!Array.isArray(s))throw new me("Graph.import: invalid edges. Expecting an array.");for(r=0,i=s.length;r<i;r++){a=s[r],A6(a);const{source:c,target:l,attributes:f,undirected:d=u}=a;let p;"key"in a?(p=n?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,p.call(this,a.key,c,l,f)):(p=n?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge,
|
|
1814
|
-
p.call(this,c,l,f))}}return this}nullCopy(e){const n=new ct(Vt({},this._options,e));return n.replaceAttributes(Vt({},this.getAttributes())),n}emptyCopy(e){const n=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const s=Vt({},r.attributes);r=new n.NodeDataClass(i,s),n._nodes.set(i,r)}),n}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new Ce(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean lo\
|
|
1815
|
-
sing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new Ce("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Ce("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not\
|
|
1816
|
-
because this would mean losing information about the current graph.");const n=this.emptyCopy(e),r=this._edges.values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,tS(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Vt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,o)=>{e[o]=s.attributes});const n={},r={};this._edges.forEach((s,o)=>{const a=s.undirected?"--":"->";let u="",c=s.source.key,l=s.target.
|
|
1817
|
-
key,f;s.undirected&&c>l&&(f=c,c=l,l=f);const d=`(${c})${a}(${l})`;o.startsWith("geid_")?this.multi&&(typeof r[d]>"u"?r[d]=0:r[d]++,u+=`${r[d]}. `):u+=`[${o}]: `,u+=d,n[u]=s.attributes});const i={};for(const s in this)this.hasOwnProperty(s)&&!ZA.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(i[s]=this[s]);return i.attributes=this._attributes,i.nodes=e,i.edges=n,dr(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(ct.prototype[Symbol.for("nodejs.util.inspect.custom")]=ct.prototype.
|
|
1818
|
-
inspect),P6.forEach(t=>{["add","merge","update"].forEach(e=>{const n=t.name(e),r=e==="add"?tS:I6;t.generateKey?ct.prototype[n]=function(i,s,o){return r(this,n,!0,(t.type||this.type)==="undirected",null,i,s,o,e==="update")}:ct.prototype[n]=function(i,s,o,a){return r(this,n,!1,(t.type||this.type)==="undirected",i,s,o,a,e==="update")}})}),Uz(ct),e6(ct),g6(ct),R6(ct);class nS extends ct{constructor(e){const n=Vt({type:"directed"},e);if("multi"in n&&n.multi!==!1)throw new me("DirectedGraph.from: inco\
|
|
1819
|
-
nsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new me('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class rS extends ct{constructor(e){const n=Vt({type:"undirected"},e);if("multi"in n&&n.multi!==!1)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new me('UndirectedGraph.from: inconsistent "'+n.type+'" type in given o\
|
|
1820
|
-
ptions!');super(n)}}class iS extends ct{constructor(e){const n=Vt({multi:!0},e);if("multi"in n&&n.multi!==!0)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class sS extends ct{constructor(e){const n=Vt({type:"directed",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new me('MultiDirectedGrap\
|
|
1821
|
-
h.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class oS extends ct{constructor(e){const n=Vt({type:"undirected",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new me('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Ta(t){t.from=function(e,n){const r=Vt({},e.options,n),i=new t(r);return i.
|
|
1822
|
-
import(e),i}}Ta(ct),Ta(nS),Ta(rS),Ta(iS),Ta(sS),Ta(oS),ct.Graph=ct,ct.DirectedGraph=nS,ct.UndirectedGraph=rS,ct.MultiGraph=iS,ct.MultiDirectedGraph=sS,ct.MultiUndirectedGraph=oS,ct.InvalidArgumentsGraphError=me,ct.NotFoundGraphError=ae,ct.UsageGraphError=Ce;const vw="dashed",ww=Yt.font,aS=h1("dot");class bw{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(Yn).map(r=>r.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(r=>this.compoundIds.has(r.source)||
|
|
1823
|
-
this.compoundIds.has(r.target)).map(r=>r.id):[]);for(const r of e.nodes)this.graphology.addNode(r.id,{origin:r,level:r.level,depth:r.depth??0,modelRef:h0.modelRef(r),deploymentRef:h0.deploymentRef(r),maxConnectedHierarchyDistance:0});for(const r of e.edges){let i=this.graphology.getNodeAttribute(r.source,"deploymentRef"),s=this.graphology.getNodeAttribute(r.target,"deploymentRef");(i===null||s===null)&&(i=this.graphology.getNodeAttribute(r.source,"modelRef"),s=this.graphology.getNodeAttribute(r.
|
|
1824
|
-
target,"modelRef"));let o=-1;i!==null&&s!==null?o=E_(i,s):aS.warn(`Edge ${r.id} of view ${e.id} is invalid, sourceFqn: ${i}, targetFqn: ${s}`),this.graphology.addEdgeWithKey(r.id,r.source,r.target,{origin:r,hierarchyDistance:o,weight:1}),o>this.graphology.getNodeAttribute(r.source,"maxConnectedHierarchyDistance")&&this.graphology.mergeNodeAttributes(r.source,{maxConnectedHierarchyDistance:o}),o>this.graphology.getNodeAttribute(r.target,"maxConnectedHierarchyDistance")&&this.graphology.mergeNodeAttributes(
|
|
1825
|
-
r.target,{maxConnectedHierarchyDistance:o})}this.graphology.forEachEdge((r,{hierarchyDistance:i},s,o,a,u)=>{const c=Math.max(a.maxConnectedHierarchyDistance,u.maxConnectedHierarchyDistance);if(c>i)this.graphology.mergeEdgeAttributes(r,{weight:c-i+1});else{const l=this.graphology.directedDegree(s),f=this.graphology.directedDegree(o);l===1&&f===1&&i>1&&this.graphology.mergeEdgeAttributes(r,{weight:i})}});const n=this.graphvizModel=this.createGraph();this.applyNodeAttributes(n.attributes.node),this.
|
|
1826
|
-
applyEdgeAttributes(n.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;graphology=new ct({allowSelfLoops:!0,multi:!0,type:"directed"});graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const o=this.generateGraphvizId(i),a=this.elementToSubgraph(i,s.subgraph(o));this.subgraphs.set(i.id,a);for(const u of i.children){const c=this.computedNode(u);if(Yn(c))n(c,a);else{const l=Wt(
|
|
1827
|
-
this.getGraphNode(c.id),`Graphviz Node not found for ${c.id}`);a.node(l.id)}}},r=[];for(const i of this.view.nodes)if(Yn(i))Tt(i.parent)&&r.push(i);else{const s=this.generateGraphvizId(i),o=this.elementToNode(i,e.node(s));this.nodes.set(i.id,o)}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),SA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){
|
|
1828
|
-
const e=this.view.autoLayout,n=iz({[L.bgcolor]:"transparent",[L.layout]:"dot",[L.compound]:!0,[L.rankdir]:e.direction,[L.TBbalance]:"min",[L.splines]:"spline",[L.outputorder]:"nodesfirst",[L.nodesep]:yt(e.nodeSep??110),[L.ranksep]:yt(e.rankSep??120),[L.pad]:yt(15),[L.fontname]:ww});return n.attributes.graph.apply({[L.fontsize]:ur(15),[L.labeljust]:e.direction==="RL"?"r":"l",[L.labelloc]:e.direction==="BT"?"b":"t",[L.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[L.fontname]:ww,[L.shape]:"rect",
|
|
1829
|
-
[L.fillcolor]:Yt.elements[Ao].fill,[L.fontcolor]:Yt.elements[Ao].hiContrast,[L.color]:Yt.elements[Ao].stroke,[L.style]:"filled",[L.penwidth]:0})}applyEdgeAttributes(e){e.apply({[L.arrowsize]:.75,[L.fontname]:ww,[L.fontsize]:ur(14),[L.penwidth]:ur(2),[L.color]:Yt.relationships[Ia].lineColor,[L.fontcolor]:Yt.relationships[Ia].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)}generateGraphvizId(e){const n=Yn(
|
|
1830
|
-
e);let r=am(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;r=am(e.id).toLowerCase();let s=1;do i=this.checkNodeId(r+"_"+s++,n);while(i===null);return i}elementToSubgraph(e,n){Ie(Yn(e),"node should be compound"),Ie(vp(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=vz(r.loContrast);return n.apply({[L.likec4_id]:e.id,[L.likec4_level]:e.level,[L.likec4_depth]:e.depth,[L.fillcolor]:NA(r.fill,e.depth),[L.color]:NA(r.stroke,e.depth),[L.style]:"f\
|
|
1831
|
-
illed",[L.margin]:ur(e.children.length>1?40:32)}),jt(e.title.trim())||n.set(L.label,$z(e,i)),n}elementToNode(e,n){Ie(!Yn(e),"node should not be compound");const r=ce(e.icon),i=this.getElementColorValues(e.color);let s=e.style.size,o=e.style.textSize,a=e.style.padding;!s&&o&&(s=o),!o&&s&&(o=s),!a&&s&&(a=s),s??=I_,o??=O_,a??=L_;const u=Yt.spacing[a];switch(n.attributes.apply({[L.likec4_id]:e.id,[L.likec4_level]:e.level,[L.label]:Ez(e,i,{shape:s,text:o}),[L.margin]:`${yt(r?8:u)},${yt(u)}`}),n.attributes.
|
|
1832
|
-
set(L.width,yt(Yt.sizes[s].width)),n.attributes.set(L.height,yt(Yt.sizes[s].height)),e.color!==Ao&&n.attributes.apply({[L.fillcolor]:i.fill,[L.fontcolor]:i.hiContrast,[L.color]:i.stroke}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[L.margin]:`${yt(r?8:u)},${yt(0)}`,[L.penwidth]:ur(2),[L.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[L.margin]:`${yt(r?8:u+4)},${yt(u+6)}`});break}case"mobile":{n.attributes.apply({[L.margin]:`${yt(r?8:u+4)},${yt(u)}`});break}case"queu\
|
|
1833
|
-
e":{n.attributes.apply({[L.width]:yt(Yt.sizes[s].width),[L.height]:yt(Yt.sizes[s].height-8),[L.margin]:`${yt(r?8:u+4)},${yt(u)}`});break}}return n}leafElements(e){return e===null?this.view.nodes.filter(n=>!Yn(n)):this.computedNode(e).children.flatMap(n=>{const r=this.computedNode(n);return Yn(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.computedNode(e).children.flatMap(n=>{const r=this.computedNode(n);return[r,...this.descendants(r.id)]})}computedNode(e){
|
|
1834
|
-
return Wt(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.computedNode(e),i=this.getGraphNode(e),s;return i||(Ie(Yn(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,Ie(s,`subgraph ${e} not found`),r=Wt(n(this.leafElements(e)),`leaf element in ${e} not found`),i=Wt(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}findInternalEdges(e){
|
|
1835
|
-
if(e===null)return this.view.edges.slice();const n=this.computedNode(e);return Xe(this.descendants(e),ci(r=>rk(r.inEdges,r.outEdges)),Xo(),XG(rk(n.inEdges,n.outEdges)),xt(r=>this.view.edges.find(i=>i.id===r)),He(ce))}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=Xe(this.view.nodes,He(Yn),xt(r=>r.id),QR($_),gG(),xt(r=>{const i=this.
|
|
1836
|
-
findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),He(({edges:r})=>r.length>1&&r.length<8),iG(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 o=Wt(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=Wt(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.
|
|
1837
|
-
set(L.group,r.id),a.attributes.set(L.group,r.id)}catch(o){aS.error(`Failed to assign group to edge ${s.id}`,{error:o})}}}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:o,...a}of n.nodes){const u=this.getGraphNode(o);if(!u)continue;const c=yt(a.center.x)+r,l=yt(e-a.center.y);a.fixedsize?u.attributes.apply({[L.pos]:`${c},${l}!`,[L.pin]:!0,[L.width]:yt(a.fixedsize.width),[L.height]:yt(a.fixedsize.height),[L.fixedsize]:!0}):u.attributes.set(L.pos,`${c}\
|
|
1838
|
-
,${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(L.weight),a.attributes.delete(L.minlen),a.attributes.delete(L.constraint);const u=n.edges.find(c=>c.id===o)?.dotpos;u&&!s&&a.attributes.set(L.pos,u)}return this.graphvizModel.apply({[L.layout]:"fdp",[L.overlap]:"vpsc",[L.sep]:"+50,50",[L.esep]:"+10,10",[L.start]:"random2",[L.splines]:"compound"}),this.graphvizModel.delete(L.compound),this.graphvizModel.delete(L.rankdir),this.graphvizModel.delete(L.nodesep),this.graphvizModel.delete(
|
|
1839
|
-
L.ranksep),this.graphvizModel.delete(L.pack),this.graphvizModel.delete(L.pad),this.graphvizModel.delete(L.packmode),this.graphvizModel.attributes.graph.delete(L.margin),this}getRelationshipColorValues(e){return s0(e)?Yt.relationships[e]:this.view.customColorDefinitions[e]?.relationships??Yt.relationships[Ao]}getElementColorValues(e){return s0(e)?Yt.elements[e]:this.view.customColorDefinitions[e]?.elements??Yt.elements[Ao]}}class O6 extends bw{createGraph(){const e=super.createGraph(),n=this.view.
|
|
1840
|
-
autoLayout;return e.delete(L.TBbalance),e.apply({[L.nodesep]:yt(n.nodeSep??130),[L.ranksep]:yt(n.rankSep??130)}),e}postBuild(e){Xe(this.view.nodes,xt(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),Jo(({node:n,graphvizNode:r})=>{if(r!=null)return Bd.modelRef(n)??void 0}),yp(),He(jr(2)),OG(n=>{e.subgraph({[L.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(Wt(i).id)})}),lG(()=>{e.set(L.newrank,!0),e.set(L.clusterrank,"global"),e.delete(L.pack),e.delete(L.packmode)}))}elementToSubgraph(e,n){
|
|
1841
|
-
const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(L.margin,ur(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,y=>Yu(y)),[u,c,l]=this.edgeEndpoint(i,Qo),f=fn(l)||fn(a),d=n.edge([o,c],{[L.likec4_id]:e.id,[L.style]:e.line??vw});l&&d.attributes.set(L.lhead,l),a&&d.attributes.set(L.ltail,a);const p=this.graphology.getEdgeAttribute(e.id,"weight");p>1&&!this.graphology.hasDirectedEdge(e.target,e.source)&&d.attributes.set(L.weight,p);const h=LA(e);if(h&&
|
|
1842
|
-
d.attributes.set(f?L.xlabel:L.label,h),e.color){const y=this.getRelationshipColorValues(e.color);d.attributes.apply({[L.color]:y.lineColor,[L.fontcolor]:y.labelColor})}let[v,b]=[e.head??gs,e.tail??"none"];return v==="none"&&b==="none"?(d.attributes.apply({[L.arrowtail]:"none",[L.arrowhead]:"none",[L.dir]:"none"}),d):e.dir==="both"?(d.attributes.apply({[L.arrowhead]:mn(v),[L.arrowtail]:mn(e.tail??v),[L.dir]:"both"}),!f&&Bd.modelRef(s)!==Bd.modelRef(u)&&d.attributes.set(L.constraint,!1),d):(v!==gs&&
|
|
1843
|
-
d.attributes.set(L.arrowhead,mn(v)),b!=="none"&&d.attributes.set(L.arrowtail,mn(b)),d)}}class e0 extends bw{static toDot(e){return new e0(e).print()}postBuild(e){e.delete(L.TBbalance)}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,u]=this.edgeEndpoint(i,A=>Yu(A)),[c,l,f]=this.edgeEndpoint(s,Qo),d=n.edge([a,l],{[L.likec4_id]:e.id,[L.style]:e.line??vw});if(f&&d.attributes.set(L.lhead,f),u&&d.attributes.set(L.ltail,u),e.color&&e.color!==Ia){const A=this.
|
|
1844
|
-
getRelationshipColorValues(e.color);d.attributes.apply({[L.color]:A.lineColor,[L.fontcolor]:A.labelColor})}const p=[e.label?.trim(),e.technology?.trim()].filter(ce).join(`
|
|
1845
|
-
`),h=D_(e.id),v=Dz(h,p);d.attributes.set(L.label,v);const b=this.graphology.getEdgeAttribute(e.id,"weight");e.source!==e.target&&b>1&&d.attributes.set(L.weight,b);const y=r.findIndex(A=>A.id===i);r.findIndex(A=>A.id===s)<y&&e.dir!=="back"&&d.attributes.apply({[L.constraint]:!1});let[E,R]=[e.head??gs,e.tail??"none"];return e.dir==="back"?(d.attributes.apply({[L.arrowtail]:mn(E),[L.minlen]:0,[L.dir]:"back"}),R!=="none"&&d.attributes.apply({[L.arrowhead]:mn(R),[L.dir]:"both"}),d):E==="none"&&R==="n\
|
|
1846
|
-
one"||E!=="none"&&R!=="none"?(d.attributes.apply({[L.arrowhead]:mn(E),[L.arrowtail]:mn(R),[L.dir]:"both"}),d):E==="none"?(d.attributes.delete(L.arrowhead),d.attributes.apply({[L.arrowtail]:mn(R),[L.minlen]:0,[L.dir]:"back"}),d):(E!==gs&&d.attributes.set(L.arrowhead,mn(E)),d)}}class L6 extends bw{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((s,o)=>(Yn(o)&&(n.add(o.id),s.push(o)),s),[]);let i=!1;for(const s of r){const o=Xe(s.children,He(l=>!this.compoundIds.has(l)),xt(
|
|
1847
|
-
l=>this.computedNode(l)),He(l=>l.inEdges.length===0&&l.outEdges.length===0));if(o.length<=2)continue;let a=2;switch(!0){case o.length>11:a=4;break;case o.length>4:a=3;break}const u=Wt(this.getSubgraph(s.id),`Subgraph not found for ${s.id}`);let c=null;ZG(o,a).forEach(l=>{const f=l.length>1?u.createSubgraph({[L.rank]:"same"}):null;l.forEach((d,p)=>{const h=this.getGraphNode(d.id);h&&(f?.node(h.id),p===0&&(c&&u.edge([c,h],{[L.style]:"invis"}),c=h))}),i=i||!!f})}i&&(e.set(L.newrank,!0),e.set(L.clusterrank,
|
|
1848
|
-
"global"))}addEdge(e,n){const[r,i]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,R=>Yu(R)),[u,c,l]=this.edgeEndpoint(i,Qo),f=e.parent,d=this.graphology.getEdgeAttributes(e.id),p=n.edge([o,c],{[L.likec4_id]:e.id,[L.style]:e.line??vw});l&&p.attributes.set(L.lhead,l),a&&p.attributes.set(L.ltail,a);const h=fn(l)||fn(a);!this.graphology.hasDirectedEdge(e.target,e.source)&&d.weight>1&&p.attributes.set(L.weight,d.weight);const v=LA(e);if(v&&p.attributes.set(h?L.xlabel:
|
|
1849
|
-
L.label,v),e.color){const R=this.getRelationshipColorValues(e.color);p.attributes.apply({[L.color]:R.lineColor,[L.fontcolor]:R.labelColor})}let[b,y]=[e.head??gs,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[L.arrowtail]:mn(b),[L.dir]:"back"}),y!=="none"&&p.attributes.apply({[L.arrowhead]:mn(y),[L.dir]:"both",[L.minlen]:0}),p;if(b==="none"&&y==="none")return p.attributes.apply({[L.arrowtail]:"none",[L.arrowhead]:"none",[L.dir]:"none",[L.minlen]:0,[L.constraint]:!1}),p;if(b!=="none"&&
|
|
1850
|
-
y!=="none")return p.attributes.apply({[L.arrowhead]:mn(b),[L.arrowtail]:mn(y),[L.dir]:"both",[L.minlen]:0}),p;if(b!==gs&&p.attributes.set(L.arrowhead,mn(b)),y!=="none"&&p.attributes.set(L.arrowtail,mn(y)),this.view.edges.length===1)return p;let E;return f===null&&s.parent==null&&u.parent==null?E=this.view.edges.filter(R=>{if(R.id===e.id||R.parent!==null||R.source===e.source&&R.target===e.target||R.source===e.target&&R.target===e.source)return!1;const A=this.computedNode(R.source),N=this.computedNode(
|
|
1851
|
-
R.target);return Yn(A)||Yn(N)?!1:A.parent==null&&N.parent==null}):E=this.findInternalEdges(f).filter(R=>!(R.id===e.id||R.source===e.source&&R.target===e.target||R.source===e.target&&R.target===e.source)),E.length===0&&(f===null||this.leafElements(f).length<=3)&&p.attributes.set(L.minlen,0),p}}function Jh(t){const[e,n,r,i]=t?t.split(",").map(a=>zr(+a)):[0,0,0,0],s=Math.round(r-e),o=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:o}}function F6(t){try{const[e,n]=t.split(",");
|
|
1852
|
-
return{x:zr(parseFloat(e)),y:zr(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function uS(t){const{x:e,y:n}=F6(t.pos),r=xA(parseFloat(t.width)),i=xA(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function cS(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,o=-1/0,a=13;try{for(const c of t){if(c.op==="F"){a=zr(c.size);continue}if(c.op==="T"){let l=zr(c.pt[0])-e,f=zr(c.width);switch(c.align){case"r":l-=
|
|
1853
|
-
f;break;case"c":l-=Math.round(f/2);break}r=Math.min(r,l),s=Math.max(s,l+f);let d=zr(c.pt[1])-n;i=Math.min(i,Math.round(d-a)),o=Math.max(o,d)}}}catch(c){return vn.warn(`Failed on parsing label draw ops:
|
|
1854
|
-
{labelDrawOps}`,{e:c,labelDrawOps:t}),null}if(r===1/0)return null;const u=2;return{x:r-u,y:i-u,width:s-r+2*u,height:o-i+2*u}}function lS({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");Ie(jr(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&vn.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>zr(s));return Ie(jr(i,2),`view ${n} edge ${e} should have at \
|
|
1855
|
-
least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
|
|
1856
|
-
${JSON.stringify(t,null,2)}`,{cause:r})}}function M6(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},u){const c=cS(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s&&c?IA(s,{maxchars:Vh,maxLines:OA}).join(`
|
|
1857
|
-
`):null,{id:e,source:n,target:r,label:s,...ce(o)&&{description:o},...ce(t.pos)&&{dotpos:t.pos},points:lS(t,u),labelBBox:c,...l?{dir:"back"}:{},...a}}function dS(t,e){const n=Jh(t.bb),{nodes:r,edges:i,manualLayout:s,...o}=e,a={...o,bounds:n,nodes:[],edges:[]},u=t.objects??[];for(const l of r){const f=u.find(d=>d.likec4_id===l.id);Ie(f,`View ${o.id} node ${l.id} not found in graphviz output`);try{const{x:d,y:p,width:h,height:v}="bb"in f?Jh(f.bb):uS(f),b=[d,p];a.nodes.push({...l,position:b,width:h,
|
|
1858
|
-
height:v,labelBBox:cS(f._ldraw_,b)??{x:d,y:p,width:h,height:v}})}catch(d){throw new Error(`Failed on parsing node ${l.id}:
|
|
1859
|
-
${JSON.stringify(f,null,2)}`,{cause:d})}}const c=t.edges??[];for(const l of i){const f=c.find(d=>d.likec4_id===l.id);if(!f){vn.warn`View ${o.id} edge ${l.id} not found in graphviz output, skipping`;continue}a.edges.push(M6(f,l,o.id))}return a}const Qh=t=>String(t+1).padStart(2,"0");function B6(t){const e=Jh(t.bb),n={nodes:[],edges:[],bounds:e},r=new Map,i=t.objects??[];for(const s of i){if(!s.likec4_type)continue;const o=Qh(s._gvid),a=s.likec4_path??"",u=r.get(s._gvid),{x:c,y:l,width:f,height:d}="\
|
|
1860
|
-
bb"in s?Jh(s.bb):uS(s),p={x:c,y:l};if(s.likec4_type==="view")Ie(s.likec4_id,`View ${s} has no likec4_id`),n.nodes.push({id:o,type:"view",parentId:u?.id??null,height:d,width:f,position:p,label:s.label??"",viewId:s.likec4_id});else{const h={id:o,type:s.likec4_type,parentId:u?.id??null,height:d,width:f,position:p,path:a,label:s.label??""},v=[..."subgraphs"in s?s.subgraphs:[],..."nodes"in s?s.nodes:[]];for(const b of v)r.set(b,h);n.nodes.push(h)}}for(const s of t.edges??[])try{const o=Qh(s.tail),a=Qh(
|
|
1861
|
-
s.head);n.edges.push({id:`link${Qh(s._gvid)}`,source:o,target:a,points:lS(s)})}catch(o){vn.warn(`Failed on parsing edge:
|
|
1862
|
-
{edge}`,{error:o,edge:s})}return n}const fS=Yt.font,Zh="/";class t0{static toDot(e){return new t0(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=sz.graph({[L.layout]:"osage",[L.pack]:ur(100),[L.packmode]:"array_ltc",[L.pad]:yt(15),[L.fontname]:fS,[L.splines]:"polyline",[L.esep]:"+20"});n.attributes.graph.apply({[L.fontsize]:ur(20),[L.labeljust]:"l",[L.labelloc]:"t"}),n.attributes.node.apply({[L.fontname]:fS,[L.shape]:"rect",[L.width]:yt(400),[L.height]:yt(300),
|
|
1863
|
-
[L.fixedsize]:!0,[L.fontsize]:10}),n.attributes.edge.apply({[L.penwidth]:ur(2)});const r=new Set(e.map(u=>u.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((u,c)=>{const l=u.relativePath?.split(Zh)??[""],f=c.relativePath?.split(Zh)??[""];l.push(u.title??"Untitled"),f.push(c.title??"Untitled");const d=l.length,p=f.length;switch(i=Math.max(i,d,p),!0){case d>p:return-1;case d<p:return 1;default:{for(let h=0;h<d;h++){const v=l[h].localeCompare(f[h]);if(v!==0)return v}return 0}}});const a=new Map;
|
|
1864
|
-
s.forEach((u,c)=>{this.addView(o?u:{...u,relativePath:""},c+i);const l=u.nodes.reduce((f,d)=>(d.navigateTo&&f.add(d.navigateTo),f),new Set);l.size>0&&a.set(u.id,l)});for(const[u,c]of a)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(Zh)?e.slice(0,e.lastIndexOf(Zh)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+
|
|
1865
|
-
1),{[L.likec4_type]:i?"file":"folder",[L.likec4_path]:e,[L.sortv]:this.subgraphs.size,[L.label]:ce(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,{[L.likec4_type]:"view",[L.likec4_id]:e.id,[L.sortv]:n,[L.label]:e.title||"Untitled"})}print(){return SA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const pS=t=>{switch(!0){case Oa.isDynamic(t):return new e0(t);case Oa.isDeployment(t):return new O6(
|
|
1866
|
-
t);case Oa.isElement(t):return new L6(t);default:qe(t)}},Ca=vn.getChild("graphviz-layouter");class hS{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async dotToJson(e){let n;try{n=await this.graphviz.layoutJson(e)}catch(r){throw Ca.error(hr(r)),Ca.error`Failed to convert DOT to JSON:\n${e}`,r}try{return JSON.parse(n)}catch(r){throw Ca.error(hr(r)),Ca.error`Failed to parse JSON:\n${n}\n. Generated from DOT:\n${e}`,r}}async layout(e){try{let n=await this.
|
|
1867
|
-
dot(e);const r=await this.dotToJson(n);let i=dS(r,e);if(e.manualLayout){const s=wW(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=pS(e);if(o.hasEdgesWithCompounds)Ca.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{o.applyManualLayout(s.relayout);const a=await this.dotToJson(o.print());i=dS(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
|
|
1868
|
-
`).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
|
|
1869
|
-
`),{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(`
|
|
1870
|
-
`).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
|
|
1871
|
-
`),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=pS(e).print();if(!Oa.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return Ca.warn(`Error during unflatten: ${e.id}`,{error: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=t0.toDot(e),r=await this.dotToJson(n);return B6(r)}}class q6{value;next;constructor(e){this.value=e}}class j6{#e;#t;#n;constructor(){this.clear()}enqueue(e){
|
|
1872
|
-
const n=new q6(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 mS(t){gS(t);const e=new j6;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(u,c,l)=>{const f=(async()=>u(...l))();c(f);
|
|
1873
|
-
try{await f}catch{}i()},o=(u,c,l)=>{new Promise(f=>{e.enqueue(f)}).then(s.bind(void 0,u,c,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(u,...c)=>new Promise(l=>{o(u,l,c)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(u){gS(u),t=u,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function gS(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expecte\
|
|
1874
|
-
d `concurrency` to be a number from 1 and up")}const G6=mS(1);class xa{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>xa._graphviz??=lm.load())}async attempt(e,n,r){return await G6(async()=>{const i=vn.getChild("graphviz-wasm");try{return await r()}catch(s){i.error(`FAILED GraphvizWasm.${e}`,{error:s}),i.warn("FAILED DOT:"),i.warn(n),lm.unload(),xa._graphviz=null}i.warn("Retrying..."),await R_(50,300);try{return await r()}finally{lm.unload(),xa._graphviz=null}})}async unflatten(e){
|
|
1875
|
-
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(
|
|
1876
|
-
e,"svg"))}}const _d=Symbol.for("idattr"),em={writeId(t,e){return t[_d]=e,t},readId(t){return t[_d]}},tm={writeId(t,e){return Tt(e)?t[_d]=void 0:t[_d]=e,t},readId(t){return t[_d]}};function wo(t){return t.textDocument.languageId===Bv.languageId}function yS({value:t}){const e=parseFloat(t);return isNaN(e)?100:ik(e,{min:0,max:100})}function Aa({value:t}){switch(t){case"xs":case"sm":case"md":case"lg":case"xl":return t;case"xsmall":return"xs";case"small":return"sm";case"medium":return"md";case"large":
|
|
1877
|
-
return"lg";case"xlarge":return"xl";default:qe(t)}}function os(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Wp(r):{ce(r.value)&&(n.border=r.value);break}case io(r):{const i=Pd(r);ce(i)&&(n.color=i);break}case Ch(r):{ce(r.value)&&(n.shape=r.value);break}case Wr(r):{const i=r.libicon?.ref?.name??r.value;ce(i)&&(n.icon=i);break}case $h(r):{n.opacity=yS(r);break}case kv(r):{n.multiple=xy(r.value)?r.value:!1;break}case Pv(r):{ce(r.value)&&(n.size=Aa(r));break}case Av(
|
|
1878
|
-
r):{ce(r.value)&&(n.padding=Aa(r));break}case Ov(r):{ce(r.value)&&(n.textSize=Aa(r));break}default:qe(r)}return n}function U6(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case io(r):{const i=Pd(r);ce(i)&&(n.color=i);break}case Sl(r):{n.line=r.value;break}case Hc(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:qe(r)}break}default:qe(r)}return n}function Ew(t,e){const{color:n,line:r,head:i,tail:s}=U6(t?.filter(pC),e);return{
|
|
1879
|
-
...n&&n!==Ia?{color:n}:{},...r&&r!==k_?{line:r}:{},...i&&i!==gs?{head:i}:{},...s?{tail:s}:{}}}function Pd(t){return t?.themeColor??t?.customColor?.$refText}function $w(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:qe(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function W6(t){switch(t){case"TB":return"TopBottom";case"BT":return"Botto\
|
|
1880
|
-
mTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:qe(t)}}function vS(t){if(nv(t))return t;if(wv(t))return t.subject;if(oh(t))return vS(t.subject);qe(t)}class z6{parser;locator;constructor(e){this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if(qn(e)){const n=lt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
|
|
1881
|
-
`)}if(Bn(e)){const n=lt(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(`
|
|
1882
|
-
`)}if(pn(e)){const n=lt(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
|
|
1883
|
-
`):void 0}}catch(n){Re(n)}}}function H6(t,e){return[t,e]=Dw(t,e)>0?[e,t]:[t,e],V6(t.range,e.range.start)}function Dw(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 V6(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 nm(t){return t.range.start.line!=t.range.end.line}const Q={newLine:Ki.newLine({allowMore:!0}),
|
|
1884
|
-
oneSpace:Ki.oneSpace(),noSpace:Ki.noSpace(),indent:Ki.indent({allowMore:!0}),noIndent:Ki.noIndent()};class K6 extends A4{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.
|
|
1885
|
-
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(
|
|
1886
|
-
e),this.formatTags(e)}formatTags(e){this.on(e,Iv,(n,r)=>{r.cst(No(n.$cstNode,"values").slice(1)).prepend(Q.oneSpace),r.keywords(",").prepend(Q.noSpace).append(Q.oneSpace)})}formatDeploymentRelation(e){this.on(e,Ji,(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(...He([n.target,n.tags],ce)).prepend(Q.oneSpace),r.properties("title","technology").prepend(Q.oneSpace)})}formatRelation(e){
|
|
1887
|
-
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(...He([n.target,n.tags],ce)).prepend(Q.oneSpace),r.properties("title","technology").prepend(Q.oneSpace)}),this.on(e,yv,(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(
|
|
1888
|
-
"-[").prepend(Q.oneSpace).append(Q.noSpace),r.properties("title").prepend(Q.oneSpace)}),this.on(e,hv)?.property("target").prepend(Q.oneSpace),this.on(e,Cv,(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,Rv)?.keyword("->").prepend(Q.oneSpace)}removeIndentFromTopLevelStatements(e){(_C(e)||Nv(e)||Nl(e)||SC(e)||$v(e)||PC(e))&&this.getNodeFormatter(e).keywords("specificat\
|
|
1889
|
-
ion","model","views","likec4lib","global","deployments").prepend(Q.noIndent)}indentContentInBraces(e){if(SC(e)||Nv(e)||ya(e)||wa(e)||ma(e)||$v(e)||ca(e)||uo(e)||bl(e)||wl(e)||uo(e)||_C(e)||nl(e)||kC(e)||O8(e)||Th(e)||I8(e)||Nl(e)||DC(e)||k8(e)||D8(e)||od(e)||Ih(e)||y8(e)||v8(e)||Qi(e)||mv(e)||PC(e)||b8(e)||$8(e)||w8(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let o=null;for(const a of s.nodes)(!o||!H6(o,a))&&n.cst([a]).prepend(Q.indent),o=a;r.prepend(
|
|
1890
|
-
Q.noIndent).prepend(Q.oneSpace),i.prepend(Q.noIndent).prepend(Ki.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,$C)?.keywords("element").append(Q.oneSpace)}formatView(e){this.on(e,uh,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(Q.oneSpace),r.keywords("of","extends").surround(Q.oneSpace)}),this.on(e,wC)?.keywords("dynamic","view").append(Q.oneSpace),this.on(e,fv)?.keywords("deployment","view").append(Q.oneSpace)}formatLeafProperty(e){if(dl(e)||Vl(e)||M8(e)||pa(
|
|
1891
|
-
e)||xv(e)||IC(e)||io(e)||Sl(e)||Hc(e)||Wr(e)||Ch(e)||Wp(e)||$h(e)||kv(e)||Pv(e)||Av(e)||Ov(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","size","padding","textSize");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,wh,(n,r)=>{r.keyword("link").
|
|
1892
|
-
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,Eh)?.property("key").append(Q.oneSpace)}formatAutolayoutProperty(e){this.on(e,td,(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,N8,(n,r)=>{r.property("key").append(Q.oneSpace),
|
|
1893
|
-
r.keyword(":").prepend(Q.noSpace).append(Q.oneSpace),r.keyword(";").prepend(Q.noSpace).append(Q.newLine)})}formatElementDeclaration(e){this.on(e,pn,(n,r)=>{const i=dn(n.$cstNode,"kind"),s=dn(n.$cstNode,"name");s&&i&&(Dw(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,ca,(n,r)=>{r.keyword("style").append(Q.oneSpace),r.property("id").append(Q.oneSpace)}),this.on(e,uo,(n,r)=>{
|
|
1894
|
-
r.keyword("styleGroup").append(Q.oneSpace)}),this.on(e,bl,(n,r)=>{r.keyword("predicateGroup").append(Q.oneSpace)}),this.on(e,wl,(n,r)=>{r.keyword("dynamicPredicateGroup").append(Q.oneSpace)})}formatSpecificationRule(e){if((ya(e)||wa(e)||_h(e)||ma(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag","deploymentNode").append(Q.oneSpace),Sh(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(Q.oneSpace),n.property("name").append(Q.oneSpace)}}formatWithPredicate(e){const n=this.
|
|
1895
|
-
getNodeFormatter(e);(oh(e)||_v(e))&&n.keyword("with").prepend(Q.oneSpace)}formatDeploymentNodeDeclaration(e){this.on(e,qn,(n,r)=>{const i=dn(n.$cstNode,"kind"),s=dn(n.$cstNode,"name");s&&i&&(Dw(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,Bn,(n,r)=>{const i=n.$cstNode?.content.find(s=>s.text==="=");i&&r.cst([i]).surround(Q.oneSpace),r.keyword("instanceOf").append(
|
|
1896
|
-
Q.oneSpace),r.property("title").prepend(Q.oneSpace)})}formatViewRuleGlobalStyle(e){this.on(e,Mv,(n,r)=>{r.keywords("global","style").append(Q.oneSpace)})}formatViewRuleGlobalPredicate(e){const n=this.getNodeFormatter(e);(Fv(e)||bC(e))&&n.keywords("global","predicate").append(Q.oneSpace)}formatViewRuleGroup(e){this.on(e,Ih,(n,r)=>{r.keyword("group").append(Q.oneSpace)})}formatViewRuleStyle(e){this.on(e,od)?.keyword("style").append(Q.oneSpace),this.on(e,vC)?.keyword("style").append(Q.oneSpace),this.
|
|
1897
|
-
on(e,C8)?.keyword(",").prepend(Q.noSpace).append(Q.oneSpace),this.on(e,_8)?.keyword(",").prepend(Q.noSpace).append(Q.oneSpace)}formatWhereExpression(e){(u8(e)||t8(e))&&this.getNodeFormatter(e).keyword("where").append(Q.oneSpace)}formatWhereExpressionV2(e){(c8(e)||n8(e))&&this.getNodeFormatter(e).keyword("where").append(Q.oneSpace)}formatWhereRelationExpression(e){if(this.on(e,m8,(n,r)=>{r.property("operator").surround(Q.oneSpace)}),this.on(e,qC,(n,r)=>{r.keyword("not").append(Q.oneSpace)}),yC(e)||
|
|
1898
|
-
G8(e)||BC(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(Q.oneSpace),n.property("not").surround(Q.oneSpace)}}formatWhereElementExpression(e){if(this.on(e,p8,(n,r)=>{r.property("operator").surround(Q.oneSpace)}),this.on(e,MC,(n,r)=>{r.keyword("not").append(Q.oneSpace)}),mC(e)||j8(e)||q8(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(Q.oneSpace),n.property("not").surround(Q.oneSpace)}}formatIncludeExcludeExpressions(e){if(Cp(e)||gh(e)||ml(e)||na(e)){const n=this.
|
|
1899
|
-
getNodeFormatter(e);(!e.$cstNode||!nm(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&&nm(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,Dv,(n,r)=>{r.keyword("->").append(Q.oneSpace)}),this.on(e,AC,(n,r)=>{r.keyword("->").prepend(Q.oneSpace)}),this.on(e,Tv,(n,r)=>{
|
|
1900
|
-
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,pv,(n,r)=>{r.property("target").prepend(Q.oneSpace)})}formatDeploymentViewRulePredicateExpressions(e){if(Cp(e)||gh(e)||ml(e)||na(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!nm(e.$cstNode))&&n.keywords("include","exclude").append(Q.oneSpace)}if(R8(
|
|
1901
|
-
e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&nm(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||Cp(n)||gh(n)||ml(n)||na(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 X6 extends AR{projects;constructor(e){super(e),this.projects=e.shared.workspace.ProjectsManager}createDescription(e,n,r){
|
|
1902
|
-
const i=r??lt(e),s=super.createDescription(e,n,r);return i.likec4ProjectId??=this.projects.belongsTo(i.uri),s.likec4ProjectId=i.likec4ProjectId,s}}var Mt=Ws();class Y6 extends SR{projects;constructor(e){super(e),this.projects=e.workspace.ProjectsManager}async updateContent(e,n=Mt.CancellationToken.None){e.likec4ProjectId=this.projects.belongsTo(e.uri),await super.updateContent(e,n)}projectElements(e,n,r){return We(this.symbolIndex.keys()).filter(i=>this.projects.belongsTo(i)===e&&(!r||r.has(i))).
|
|
1903
|
-
flatMap(i=>this.getFileDescriptions(i,n))}}class J6 extends bR{projects;constructor(e){super(e),this.projects=e.workspace.ProjectsManager}get allExcludingBuiltin(){return super.all.filter(e=>!wo(e)||vd(e.uri)?!1:(e.likec4ProjectId||(e.likec4ProjectId=this.projects.belongsTo(e.uri)),!0))}projectDocuments(e){return this.allExcludingBuiltin.filter(n=>n.likec4ProjectId===e)}groupedByProject(){return Jo(this.allExcludingBuiltin.toArray(),ui("likec4ProjectId"))}}class Q6 extends _R{documentFactory;projects;constructor(e){
|
|
1904
|
-
super(e),this.documentFactory=e.workspace.LangiumDocumentFactory,this.projects=e.workspace.ProjectsManager}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(zC,Et.parse(K8))),await super.loadAdditionalDocuments(e,n)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async o=>{if(!await this.projects.loadConfigFile(o)&&this.includeEntry(e,o,r)){if(o.isDirectory)await this.traverseFolder(e,o.uri,r,i);else if(o.isFile){const a=await this.
|
|
1905
|
-
langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}workspace(){return this.folders&&T_(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return Ie(e,"Workspace not initialized"),Et.parse(e.uri)}get workspaceURL(){const e=this.workspace();return Ie(e,"Workspace not initialized"),new URL(e.uri)}}const Z6=ot.getChild("LikeC4LanguageServices");class eH{constructor(e){this.services=e,this.views=e.likec4.Views,this.builder=e.likec4.ModelBuilder,this.projectsManager=e.
|
|
1906
|
-
shared.workspace.ProjectsManager}views;builder;projectsManager;get workspaceUri(){return this.services.shared.workspace.WorkspaceManager.workspaceUri}projects(){const e=this.services.shared.workspace.ProjectsManager,n=Xe(this.services.shared.workspace.LangiumDocuments.groupedByProject(),Qu(),xt(([r,i])=>{const s=r,{folder:o,config:a}=e.getProject(s);return{id:s,folder:o,config:a,documents:xt(i,ui("uri"))}}));return jr(n,1)?n:[{id:Qn.DefaultProjectId,folder:this.services.shared.workspace.WorkspaceManager.
|
|
1907
|
-
workspaceUri,config:{name:"default"},documents:null}]}async diagrams(){return await this.views.diagrams()}async computedModel(e){const n=this.projectsManager.ensureProjectId(e);return await this.builder.buildLikeC4Model(n)}async layoutedModel(e){const n=this.projectsManager.ensureProjectId(e),r=await this.builder.parseModel(n);if(!r)throw new Error("Failed to parse model");const i=await this.views.diagrams(n);return ys.create({...r,__:"layouted",views:Ju(i,ui("id"))})}getErrors(){return this.services.
|
|
1908
|
-
shared.workspace.LangiumDocuments.allExcludingBuiltin.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===xs.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}async notifyUpdate({changed:e,removed:n}){if(!e&&!n)return!1;const r=this.services.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.services.shared.workspace.DocumentBuilder.update(e?[Et.file(e)]:[],n?[Et.file(n)]:[],s),i=!s.isCancellationRequested}),
|
|
1909
|
-
i}catch(i){return Z6.error(hr(i)),!1}}}class Rw{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){qv(n)}}throwIfDisposed(){if(this.isDisposed)throw new Error("This has already been disposed")}}function An(t){return t.el.ref}function bo(t){const e=[t.$type==="StrictFqnRef"?t.value.$refText:t.el.$refText];let n=t.parent;for(;n;)e.push(n.$type==="StrictFqnRef"?n.value.$refText:
|
|
1910
|
-
n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}function tH(t){let e;for(;e=t.value?.ref;){if(qn(e))return null;if(Bn(e))return e;if(Tt(t.parent))return null;t=t.parent}return null}function Sn(t){const e=Rt(t)?lt(t):t;return Wt(e.likec4ProjectId,()=>`Invalid state, document ${e.uri} has no project ID assigned`)}function xd(...t){var e=t.length>1?t.join(":::"):t[0];return C_(e)}class nH{constructor(e){this.services=e}async provideCodeLens(e,n,r){return wo(e)?(e.state<=je.
|
|
1911
|
-
Linked&&(ot.debug(`Waiting for document ${e.uri.path} to be Linked`),await this.services.shared.workspace.DocumentBuilder.waitUntil(je.Linked,e.uri,r),ot.debug("Document is linked")),e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=em.readId(i),o=i.$cstNode?.range;if(!o||!s)return[];const a=Sn(i);return{range:{start:o.start,end:{line:o.start.line,character:o.start.character+4}},command:{command:"likec4.open-preview",arguments:[s,a],title:"open preview"}}})):void 0}}const kw=["co\
|
|
1912
|
-
lor","shape","icon","border","opacity","multiple","size","textSize"].join(",");class rH extends _T{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(n.value==="deployment"&&qi(e.node,Nl))return r(e,{label:n.value,detail:"Insert deployment view",kind:Pt.Class,insertTextFormat:Mn.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
|
|
1913
|
-
`)});if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:Pt.Property,insertTextFormat:Mn.Snippet,insertText:`${n.value} '\${0}'`});if(n.value==="color")return r(e,{label:n.value,kind:Pt.Property,insertTextFormat:Mn.Snippet,insertText:`${n.value} \${1|${A_.join(",")}|}$0`});if(n.value==="opacity")return r(e,{label:n.value,kind:Pt.Property,insertTextFormat:Mn.Snippet,insertText:`${n.value} \${0:100}%`});if(["views","specification","model","deployment","with"].includes(
|
|
1914
|
-
n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Pt.Module,insertTextFormat:Mn.Snippet,insertText:`${n.value} {
|
|
1915
|
-
$0
|
|
1916
|
-
}`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:Pt.Class,insertTextFormat:Mn.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
|
|
1917
|
-
`)});if(n.value==="dynamic"&&qi(e.node,Nl))return r(e,{label:n.value,detail:"Insert dynamic view",kind:Pt.Class,insertTextFormat:Mn.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
|
|
1918
|
-
`)});if(n.value==="style"&&e.node)return qi(e.node,ca)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Pt.Module,insertTextFormat:Mn.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
|
|
1919
|
-
\${3|${kw}|} $0
|
|
1920
|
-
}`}):qi(e.node,JG([Nl,uo]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Pt.Module,insertTextFormat:Mn.Snippet,insertText:`${n.value} \${1:*} {
|
|
1921
|
-
\${2|${kw}|} $0
|
|
1922
|
-
}`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Pt.Module,insertTextFormat:Mn.Snippet,insertText:`${n.value} {
|
|
1923
|
-
\${1|${kw}|} $0
|
|
1924
|
-
}`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:Pt.Class,insertTextFormat:Mn.Snippet,insertText:`extend $1 {
|
|
1925
|
-
$0
|
|
1926
|
-
}`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:Pt.Class,insertTextFormat:Mn.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class iH extends PT{createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range,ge.DocumentHighlightKind.Read)}}class sH{constructor(e){this.services=e}async getDocumentLinks(e,n,r){return wo(e)?Or(e.parseResult.value).
|
|
1927
|
-
filter(wh).map(i=>{try{const s=dn(i.$cstNode,"value")?.range,o=s&&this.resolveLink(e,i.value);if(o&&lo(o))return{range:s,target:o}}catch(s){Re(s)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(lo(n)||Oh(n))return n;const r=KC(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 YC(n);if(KC(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return YC(tU(i,this.services.
|
|
1928
|
-
shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}const wS=ot.getChild("DocumentSymbolProvider");class oH{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;async getSymbols(e,n,r){if(!wo(e))return[];e.state<=je.Linked&&(wS.debug(`Waiting for document ${e.uri.path} to be Linked`),await this.
|
|
1929
|
-
services.shared.workspace.DocumentBuilder.waitUntil(je.Linked,e.uri,r),wS.debug("document is Linked"));const{parseResult:{value:{specifications:i,models:s,deployments:o,views:a,likec4lib:u}}}=e;return[...u.map(c=>()=>this.getLikec4LibSymbol(c)),...i.map(c=>()=>this.getSpecSymbol(c)),...s.map(c=>()=>this.getModelSymbol(c)),...o.map(c=>()=>this.getDeploymentModelSymbol(c)),...a.map(c=>()=>this.getModelViewsSymbol(c))].flatMap(c=>{try{return c()??[]}catch(l){return Re(l),[]}})}getLikec4LibSymbol(e){
|
|
1930
|
-
const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ce);return r.length===0?[]:[{kind:br.Namespace,name:"icons",range:n.range,selectionRange:Eu(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=dn(n,"name");if(!r)return[];const i=Xe([...e.elements,...e.tags,...e.relationships],xt(s=>{try{if(ya(s)||wa(s)||ma(s))return this.getKindSymbol(s);if(_h(s))return this.getTagSymbol(s)}catch(o){return Re(o),null}qe(s)}),
|
|
1931
|
-
He(ce));return i.length===0?[]:[{kind:br.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=dn(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=dn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,
|
|
1932
|
-
children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(sa(e))return this.getExtendElementSymbol(e);if(pn(e))return this.getElementSymbol(e)}catch(n){Re(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:bo(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=dn(n,"name");if(!r||
|
|
1933
|
-
!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(o=>this.getElementsSymbol(o))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=dn(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||jt(e.kind.name)?null:{kind:this.symbolKind(e),
|
|
1934
|
-
name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||jt(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||jt(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?dn(n,"name"):null;return r?[{kind:this.
|
|
1935
|
-
symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if(qn(e))return this.getDeploymentNodeSymbol(e);if(Bn(e))return this.getDeployedInstanceSymbol(e);if(oo(e))return[]}catch(n){Re(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,
|
|
1936
|
-
children:e.body?.elements.flatMap(o=>this.getDeploymentElementSymbol(o))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=lt(e),s=this.parser.forDocument(i).parseDeployedInstance(e),o=this.nameProvider.getNameStrict(e),a="instance of "+s.element;return[{kind:this.symbolKind(e),name:o,range:n.range,selectionRange:r.range,detail:a,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}class aH extends OT{parser;locator;constructor(e){
|
|
1937
|
-
super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(FC(e))return{contents:{kind:"markdown",value:"tag `"+e.name+"`"}};if(qn(e)){const n=lt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("deployment node `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
|
|
1938
|
-
`)}}}if(Bn(e)){const n=lt(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 kind `"+i.kind+"` "),{contents:{kind:"markdown",value:s.join(`
|
|
1939
|
-
`)}}}if($C(e))return{contents:{kind:"markdown",value:"element kind `"+e.name+"`"}};if(E8(e))return{contents:{kind:"markdown",value:"deployment node `"+e.name+"`"}};if(pn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"element kind `"+n.kind+"` "].join(`
|
|
1940
|
-
`)}}:void 0}}}class uH extends y4{highlightElement(e,n){if(pn(e)||qn(e))return this.highlightNameAndKind(e,n);if(Bn(e)){"name"in e&&n({node:e,property:"name",type:Ne.variable,modifier:[ze.definition,ze.readonly]});return}if(ov(e))return this.highlightView(e,n);if(F8(e))return n({node:e,property:"name",type:Ne.function});if(P8(e))return n({node:e,property:"name",type:Ne.type,modifier:[ze.definition]}),"prune";if(Cv(e)&&"kind"in e){n({node:e,property:"kind",type:Ne.function});return}if(ki(e)&&"kin\
|
|
1941
|
-
d"in e&&n({node:e,property:"kind",type:Ne.function}),Eh(e)||Gl(e))return n({node:e,property:"key",type:Ne.property}),n({node:e,property:"value",type:Ne.variable,modifier:[ze.definition,ze.readonly]}),"prune";if((vv(e)||co(e))&&e.$cstNode)return n({cst:e.$cstNode,type:Ne.variable,modifier:[ze.definition,ze.readonly]}),"prune";if(Ev(e)){e.selector&&n({node:e,property:"selector",type:Ne.variable,modifier:[ze.definition,ze.readonly]});return}if(BC(e)&&ce(e.value)){n({node:e,property:"value",type:Ne.
|
|
1942
|
-
function});return}if((mC(e)||yC(e))&&ce(e.value)){n({node:e,property:"value",type:Ne.type,modifier:[ze.definition,ze.readonly]});return}if((jC(e)||GC(e))&&n({node:e,property:"participant",type:Ne.keyword}),sh(e)&&ce(e.kind))return n({node:e,property:"kind",type:Ne.type,modifier:[ze.definition]}),"prune";if(uo(e)||ca(e)){n({node:e,property:"id",type:Ne.variable,modifier:[ze.definition,ze.readonly]});return}if(Mv(e)){n({node:e,property:"style",type:Ne.variable,modifier:[ze.definition,ze.readonly]});
|
|
1943
|
-
return}if(bl(e)||wl(e)){n({node:e,property:"name",type:Ne.variable,modifier:[ze.definition,ze.readonly]});return}if(Fv(e)){n({node:e,property:"predicate",type:Ne.variable,modifier:[ze.definition,ze.readonly]});return}if(ah(e)&&ce(e.tag))return n({node:e,property:"tag",type:Ne.type,modifier:[ze.definition]}),"prune";if(TC(e)||LC(e))return n({node:e,property:"value",type:e.parent?Ne.property:Ne.variable,modifier:[ze.definition,ze.readonly]}),e.parent?void 0:"prune";if(cl(e)||OC(e))return n({node:e,
|
|
1944
|
-
property:"el",type:e.parent?Ne.property:Ne.variable,modifier:[ze.definition,ze.readonly]}),e.parent?void 0:"prune";if(Sh(e)){n({node:e,keyword:"color",type:Ne.keyword}),n({node:e,property:"name",type:Ne.type,modifier:[ze.declaration,ze.readonly]});return}if((ya(e)||wa(e)||ma(e))&&n({node:e,property:"kind",type:Ne.type,modifier:[ze.declaration,ze.readonly]}),Iv(e))return n({node:e,property:"values",type:Ne.interface});if(FC(e))return n({node:e,property:"name",type:Ne.type,modifier:[ze.definition]});
|
|
1945
|
-
if((Th(e)||Qi(e)&&nl(e.$container))&&n({node:e,property:"key",type:Ne.property}),$h(e))return n({node:e,property:"key",type:Ne.property}),n({node:e,property:"value",type:Ne.number}),"prune";if(wh(e)||Wr(e)||hC(e))return n({node:e,property:"key",type:Ne.property}),Wr(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:Ne.enum,modifier:[ze.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:Ne.string}),"prune");if(io(e)||Ch(e)||Hc(e)||
|
|
1946
|
-
Sl(e)||Wp(e)||l8(e))return n({node:e,property:"key",type:Ne.property}),"value"in e&&n({node:e,property:"value",type:Ne.enum}),"prune"}highlightNameAndKind(e,n){if(n({node:e,property:"name",type:Ne.variable,modifier:[ze.declaration,ze.readonly]}),n({node:e,property:"kind",type:Ne.keyword,modifier:[]}),pn(e)){e.props.length>0&&n({node:e,property:"props",type:Ne.string});return}e.title&&n({node:e,property:"title",type:Ne.string})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Ne.variable,
|
|
1947
|
-
modifier:[ze.declaration,ze.readonly,"local"]})}}class bS extends Rw{constructor(e,n="fqn-index"){super(),this.services=e,this.cachePrefix=n,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.projects=e.shared.workspace.ProjectsManager,this.documentCache=new m0(r=>this.createDocumentIndex(r)),this.workspaceCache=new fp(e.shared,je.IndexedContent),this.onDispose(e.shared.workspace.DocumentBuilder.onDocumentPhase(je.IndexedContent,async(r,i)=>(wo(r)&&this.documentCache.set(r,this.createDocumentIndex(
|
|
1948
|
-
r)),await Promise.resolve())))}projects;langiumDocuments;documentCache;workspaceCache;documents(e){return this.langiumDocuments.projectDocuments(e).filter(n=>wo(n)&&n.state>=je.IndexedContent)}get(e){return e.state<je.IndexedContent&&Re(`Document ${e.uri.path} is not indexed`),this.documentCache.get(e)}getFqn(e){Ie(pn(e)||ev(e));let n=tm.readId(e);if(ce(n))return n;const r=lt(e);return Ie(wo(r)),Re(`Document ${r.uri.path} is not indexed, but getFqn was called`),this.get(r),Wt(tm.readId(e),"Eleme\
|
|
1949
|
-
nt fqn must be set, invalid state")}byFqn(e,n){return We(this.workspaceCache.get(`${this.cachePrefix}:${e}:${n}`,()=>this.documents(e).toArray().flatMap(r=>this.get(r).byFqn(n))))}directChildrenOf(e,n){return We(this.workspaceCache.get(`${this.cachePrefix}:${e}:directChildrenOf:${n}`,()=>{const r=this.documents(e).reduce((i,s)=>(this.get(s).children(n).forEach(o=>{i.set(o.name,o)}),i),new er);return ES(r).sort((i,s)=>g0(i.name,s.name))}))}uniqueDescedants(e,n){return We(this.workspaceCache.get(`${this.
|
|
1950
|
-
cachePrefix}:${e}:uniqueDescedants:${n}`,()=>{const{children:r,descendants:i}=this.documents(e).reduce((a,u)=>{const c=this.get(u);return c.children(n).forEach(l=>{a.children.set(l.name,l)}),c.descendants(n).forEach(l=>{a.descendants.set(l.name,l)}),a},{children:new er,descendants:new er}),s=ES(r).sort((a,u)=>g0(a.name,u.name)),o=[...i.associations()].flatMap(([a,u])=>u.length===1&&!r.has(a)?u:[]);return[...s,...q_(o)]}))}createDocumentIndex(e){const n=e.parseResult.value.models.flatMap(l=>l.elements);
|
|
1951
|
-
if(n.length===0)return _a.EMPTY;const r=new Array,i=new er,s=new er,o=new er,a=this.services.workspace.AstNodeDescriptionProvider,u=(l,f,d)=>{const p={...a.createDescription(l,f,e),id:d};return tm.writeId(l,d),o.set(d,p),p},c=(l,f)=>{let d;if(pn(l)){d=F_(l.name,f);const h=u(l,l.name,d);f?i.set(f,h):r.push(h)}else d=bo(l.element);let p=[];if(an(l.body)&&!jt(l.body.elements)){for(const h of l.body.elements)if(!ki(h))try{p.push(...c(h,d))}catch(v){Re(v)}}p=[...i.get(d)??[],...p];for(const h of p)s.
|
|
1952
|
-
set(d,h);if(sa(l))for(const h of j_(d))for(const v of p)s.set(h,v);return s.get(d)??[]};for(const l of n)try{if(ki(l))continue;c(l,null)}catch(f){Re(f)}return new _a(r,i,s,o,this.projects.belongsTo(e))}}function ES(t){return[...t.associations()].flatMap(([e,n])=>n.length===1?n:[])}class _a{constructor(e,n,r,i,s){this._rootElements=e,this._children=n,this._descendants=r,this._byfqn=i,this.projectId=s}static EMPTY=new _a([],new er,new er,new er,Qn.DefaultProjectId);rootElements(){return this._rootElements}byFqn(e){
|
|
1953
|
-
return this._byfqn.get(e)??[]}children(e){return this._children.get(e)??[]}descendants(e){return this._descendants.get(e)??[]}}class cH extends bS{constructor(e){super(e,"deployments-index"),this.services=e,this.Names=e.references.NameProvider}Names;createDocumentIndex(e){const n=e.parseResult.value.deployments.flatMap(f=>f.elements);if(n.length===0)return _a.EMPTY;const r=new Array,i=new er,s=new er,o=new er,a=this.Names,u=this.services.workspace.AstNodeDescriptionProvider,c=(f,d,p)=>{const h={
|
|
1954
|
-
...u.createDescription(f,d,e),id:p};return tm.writeId(f,p),o.set(p,h),h},l=(f,d)=>{let p;if(oo(f))p=bo(f.deploymentNode);else{const v=a.getName(f);if(!ce(v))return[];p=S_(v,d);const b=c(f,v,p);if(d?i.set(d,b):r.push(b),Bn(f))return[]}let h=[];if(an(f.body)){for(const v of f.body.elements)if(!Ji(v))try{h.push(...l(v,p))}catch(b){Re(b)}}h=[...i.get(p)??[],...h];for(const v of h)s.set(p,v);if(oo(f))for(const v of __(p))for(const b of h)s.set(v,b);return s.get(p)??[]};for(const f of n)try{if(Ji(f))continue;
|
|
1955
|
-
l(f,null)}catch(d){Re(d)}return new _a(r,i,s,o,this.projects.belongsTo(e))}}const $S=t=>Number.isFinite(t)?t:0;function lH(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($S(t*1e3)%1e3),nanoseconds:Math.trunc($S(t*1e6)%1e3)}}function dH(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}
|
|
1956
|
-
function fH(t){switch(typeof t){case"number":{if(Number.isFinite(t))return lH(t);break}case"bigint":return dH(t)}throw new TypeError("Expected a finite number or bigint")}const pH=t=>t===0||t===0n,hH=(t,e)=>e===1||e===1n?t:`${t}s`,mH=1e-7,gH=24n*60n*60n*1000n;function rm(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=
|
|
1957
|
-
!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,f)=>{const d=Math.floor(l*10**f+mH);return(Math.round(d)/10**f).toFixed(f)},o=(l,f,d,p)=>{if(!((i.length===0||!e.colonNotation)&&pH(l)&&!(e.colonNotation&&d==="m"))){if(p??=String(l),e.colonNotation){const h=p.includes(".")?p.split(".")[0].length:p.length,v=i.length>0?2:1;p="0".repeat(Math.max(0,v-h))+p}else p+=e.verbose?" "+hH(f,l):d;i.push(p)}},a=fH(t),u=BigInt(a.days);if(e.hideYearAndDays?
|
|
1958
|
-
o(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(u,"day","d"):(o(u/365n,"year","y"),o(u%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),f=Number(a.milliseconds),d=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(f,"millisecond","ms"),o(d,"microsecond","\xB5s"),o(p,"nanosecond","ns");else{const h=f+
|
|
1959
|
-
d/1e3+p/1e6,v=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,b=h>=1?Math.round(h):Math.ceil(h),y=v?h.toFixed(v):b;o(Number.parseFloat(y),"millisecond","ms",y)}}else{const l=(n?Number(t%gH):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(l,f),p=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const c=e.colonNotation?":":" ";return typeof e.
|
|
1960
|
-
unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(c)}function yH(t){const e=new Map;for(const n of t)if(Oa.isElement(n)&&n.viewOf&&Tt(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=Bd.modelRef(i);if(i.navigateTo||!s)continue;const o=tk(e.get(s)??[],a=>a!==n);o&&(i.navigateTo=o)}return t}function vH(t,e="/"){const n=Xe(t,xt(u=>u.docUri),He(ce),Xo());if(n.length===0)return"";if(n.length===1){const u=$a(
|
|
1961
|
-
n[0]).pathname.split(e);return u.length<=1?e:(u.pop(),u.join(e)+e)}Ie(jr(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=$a(r).pathname.split(e);let o=s.length;for(const u of i){if(u===r)continue;const c=$a(u).pathname.split(e);for(let l=0;l<o;l++)c[l]!==s[l]&&(o=l);if(o===0)return""}const a=s.slice(0,o).join(e);return a.endsWith(e)?a:a+e}function wH(t){const e="/",n=vH(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=$a(r.docUri).pathname;return n.length>0?(Ie(i.startsWith(
|
|
1962
|
-
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 o=o0(r.parts[s],i.parts[s]);if(o!==0)return o}return o0(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}class DS{mergedData=new Map;merge(e){for(const n of e){
|
|
1963
|
-
const{id:r,links:i,tags:s,metadata:o}=n,a=this.mergedData.get(r)??{links:[],tags:[],metadata:{}};i&&a.links.push(...i),s&&(a.tags=Xo([...a.tags,...s])),o&&(a.metadata={...a.metadata,...o}),this.mergedData.set(r,a)}}apply(e){const n=this.mergedData.get(e.id);if(!n)return e;let r=n.links;e.links&&e.links.length>0&&(r=[...e.links,...r]);let i=n.tags;e.tags&&e.tags.length>0&&(i=Xo([...e.tags,...i]));let s=n.metadata;return e.metadata&&(s={...e.metadata,...n.metadata}),{...e,tags:jr(i,1)?i:null,links:jr(
|
|
1964
|
-
r,1)?r:null,...!jt(s)&&{metadata:s}}}}class bH{specs={tags:new Set,elements:{},deployments:{},relationships:{},colors:{}};globals={predicates:{},dynamicPredicates:{},styles:{}};constructor(e){for(const n of e){const{c4Specification:r,c4Globals:i}=n;r.tags.forEach(s=>this.specs.tags.add(s)),Object.assign(this.specs.elements,r.elements),Object.assign(this.specs.relationships,r.relationships),Object.assign(this.specs.colors,r.colors),Object.assign(this.specs.deployments,r.deployments),Object.assign(
|
|
1965
|
-
this.globals.predicates,i.predicates),Object.assign(this.globals.dynamicPredicates,i.dynamicPredicates),Object.assign(this.globals.styles,i.styles)}}toModelElement=({tags:e,links:n,style:{color:r,shape:i,icon:s,opacity:o,border:a,size:u,multiple:c,padding:l,textSize:f},id:d,kind:p,title:h,description:v,technology:b,metadata:y})=>{try{const E=this.specs.elements[p];return E?(r??=E.style.color,i??=E.style.shape,s??=E.style.icon,o??=E.style.opacity,a??=E.style.border,b??=E.technology,c??=E.style.multiple,
|
|
1966
|
-
u??=E.style.size,l??=E.style.padding,f??=E.style.textSize,{...r&&{color:r},...i&&{shape:i},...s&&{icon:s},...y&&!jt(y)&&{metadata:y},...E.notation&&{notation:E.notation},style:{...a&&{border:a},...u&&{size:u},...l&&{padding:l},...f&&{textSize:f},...xy(c)&&{multiple:c},...vp(o)&&{opacity:o}},links:n??null,tags:e??null,technology:b??null,description:v??null,title:h,kind:p,id:d}):(ot.warn`No kind '${p}' found for ${d}`,null)}catch(E){Re(E)}return null};toModelRelation=({astPath:e,source:n,target:r,
|
|
1967
|
-
kind:i,links:s,id:o,...a})=>fn(i)&&this.specs.relationships[i]?{...this.specs.relationships[i],...a,...s&&{links:s},source:n,target:r,kind:i,id:o}:{...s&&{links:s},...a,source:n,target:r,id:o};toDeploymentElement=e=>{if(!a0.isDeploymentNode(e))return e;try{const n=this.specs.deployments[e.kind];if(!n)return ot.warn`No kind ${e.kind} found for ${e.id}`,null;let{technology:r=n.technology,notation:i=n.notation,style:s}=e;return{...e,...i&&{notation:i},...r&&{technology:r},style:{border:"dashed",opacity:10,
|
|
1968
|
-
...n.style,...s}}}catch(n){Re(n)}return null};toDeploymentRelation=({astPath:e,source:n,target:r,kind:i,links:s,id:o,...a})=>fn(i)&&this.specs.relationships[i]?{...this.specs.relationships[i],...a,...s&&{links:s},source:n,target:r,kind:i,id:o}:{...s&&{links:s},...a,source:n,target:r,id:o}}function EH(t){const e=new bH(t),n=Yo(e.specs.colors,d=>P_(d.color)),r=new DS,i=new DS,s=Xe(t,ci(d=>(r.merge(d.c4ExtendElements),xt(d.c4Elements,e.toModelElement))),He(ce),u0,_y((d,p)=>{const h=c0(p.id);return h&&
|
|
1969
|
-
Tt(d[h])?(ot.debug`No parent found for ${p.id}`,d):(d[p.id]=r.apply(p),d)},{})),o=Xe(t,ci(d=>xt(d.c4Relations,e.toModelRelation)),He(d=>d?Tt(s[d.source])||Tt(s[d.target])?(ot.debug`Invalid relation ${d.id}
|
|
1970
|
-
source: ${d.source} resolved: ${!!s[d.source]}
|
|
1971
|
-
target: ${d.target} resolved: ${!!s[d.target]}\n`,!1):!0:!1),Ju(ui("id"))),a=Xe(t,ci(d=>(i.merge(d.c4ExtendDeployments),xt(d.c4Deployments,e.toDeploymentElement))),He(ce),u0,_y((d,p)=>{const h=c0(p.id);return h&&Tt(d[h])?(ot.debug`No parent found for deployment element ${p.id}`,d):(d[p.id]=a0.isDeploymentNode(p)?i.apply(p):p,d)},{})),u=Xe(t,ci(d=>xt(d.c4DeploymentRelations,e.toDeploymentRelation)),He(d=>d?Tt(a[d.source.id])||Tt(a[d.target.id])?(ot.debug`Invalid deployment relation ${d.id}
|
|
1972
|
-
source: ${d.source.id} resolved: ${!!a[d.source.id]}
|
|
1973
|
-
target: ${d.target.id} resolved: ${!!a[d.target.id]}\n`,!1):!0:!1),_y((d,p)=>an(d[p.id])?(ot.debug`Duplicate deployment relation ${p.id}`,d):(d[p.id]=p,d),{}));function c(d){const p=d.uri.toString();return h=>{let{id:v,title:b,description:y,astPath:E,...R}=h;return h.__==="element"&&Tt(b)&&"viewOf"in h&&(b=s[h.viewOf]?.title??null),Tt(b)&&v==="index"&&(b="Landscape view"),{...R,customColorDefinitions:n,docUri:p,description:y,title:b,id:v}}}const l=Xe(t,ci(d=>xt(d.c4Views,c(d))),wH);l.some(d=>d.
|
|
1974
|
-
id==="index")||l.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:n,rules:[{include:[{wildcard:!0}]}]});const f=Xe(l,Ju(ui("id")),B_);return{specification:{tags:Array.from(e.specs.tags),elements:e.specs.elements,relationships:e.specs.relationships,deployments:e.specs.deployments},elements:s,relations:o,globals:e.globals,views:f,deployments:{elements:a,relations:u}}}const Tw=t=>`parsed-model-${t}`,RS=t=>`computed-model-${t}`,Eo=ot.
|
|
1975
|
-
getChild("ModelBuilder");class $H extends Rw{projects;parser;listeners=[];cache;DocumentBuilder;LangiumDocuments;mutex;constructor(e){super(),this.projects=e.shared.workspace.ProjectsManager,this.parser=e.likec4.ModelParser,this.cache=e.ValidatedWorkspaceCache,this.DocumentBuilder=e.shared.workspace.DocumentBuilder,this.LangiumDocuments=e.shared.workspace.LangiumDocuments,this.mutex=e.shared.workspace.WorkspaceLock,this.onDispose(this.DocumentBuilder.onUpdate((n,r)=>{r.length>0&&this.notifyListeners(
|
|
1976
|
-
r)})),this.onDispose(this.DocumentBuilder.onBuildPhase(je.Validated,(n,r)=>{const i=n.map(ui("uri")).filter(kG(vd));i.length>0&&this.notifyListeners(i)})),Eo.debug`created`}unsafeSyncParseModel(e){const n=this.cache,r=Eo.getChild(["project",e]);return n.has(Tw(e))&&r.debug("unsafeSyncParseModel from cache"),n.get(Tw(e),()=>{const i=this.documents(e);return i.length===0?(Eo.debug(`no documents to build model - project ${e}`),null):(r.debug("unsafeSyncParseModel from documents"),EH(i))})}async parseModel(e,n=Mt.
|
|
1977
|
-
CancellationToken.None){const r=this.projects.ensureProjectId(e),i=Eo.getChild(["project",r]),s=this.cache.get(Tw(r));if(s)return i.debug("parseModel from cache"),s;const o=performance.now();return await this.mutex.read(async()=>{await qt(n);const a=this.unsafeSyncParseModel(r);return i.debug(`parseModel in ${rm(performance.now()-o)}`),a})}previousViews={};unsafeSyncBuildModel(e){const n=this.cache,r=this.cache;return n.get(RS(e),()=>{const i=this.unsafeSyncParseModel(e);if(!i)return ys.EMPTY;const{
|
|
1978
|
-
views:s,...o}=i,a=ys.makeCompute(i),u=[];for(const l of yp(s)){const f=a(l);if(!f.isSuccess){Eo.warn(hr(f.error));continue}u.push(f.view)}yH(u);const c=Gr(u,l=>{const f=kS(e,l.id),d=this.previousViews[f],p=d&&Qv(l,d)?d:l;return r.set(f,p),[l.id,p]});return this.previousViews={...this.previousViews,...c},ys.create({...o,views:c})})}async buildLikeC4Model(e,n=Mt.CancellationToken.None){const r=this.projects.ensureProjectId(e),i=Eo.getChild(["project",r]),s=this.cache.get(RS(r));if(s)return i.debug(
|
|
1979
|
-
"buildLikeC4Model from cache"),s;const o=performance.now();return await this.mutex.read(async()=>{await qt(n);const a=this.unsafeSyncBuildModel(r);return i.debug(`buildLikeC4Model in ${rm(performance.now()-o)}`),a})}async computeView(e,n,r=Mt.CancellationToken.None){const i=this.projects.ensureProjectId(n),s=Eo.getChild(["project",i]),o=this.cache,a=kS(i,e);if(o.has(a))return o.get(a);const u=await this.parseModel(i,r);return u?o.get(a,()=>{const c=u.views[e];if(!c)return s.warn`computeView: cant find view ${e}`,
|
|
1980
|
-
null;s.debug`computeView: ${e}`;const l=ys.makeCompute(u)(c);if(!l.isSuccess)return Re(l.error),null;let f=l.view;const d=Xe(u.views,yp(),He(x_),He(h=>h.id!==e),Jo(h=>h.viewOf));for(const h of f.nodes)if(!h.navigateTo){const v=d[h.id];v&&(h.navigateTo=v[0].id)}const p=this.previousViews[a];return p&&Qv(f,p)?f=p:this.previousViews[a]=f,f}):null}onModelParsed(e){return this.listeners.push(e),Bs.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(e){return this.
|
|
1981
|
-
parser.documents(e).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){Re(r)}}}function kS(t,e){return`computed-view-${t}-${e}`}const{findNodeForKeyword:DH,findNodeForProperty:im}=ng,{getDocument:RH}=wu;class kH{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.parser=e.likec4.ModelParser,this.projects=e.shared.workspace.ProjectsManager}fqnIndex;deploymentsIndex;langiumDocuments;parser;projects;documents(e){
|
|
1982
|
-
return this.parser.documents(e)}getParsedElement(...e){let n,r;if(e.length===2?(n=e[0],r=e[1]):(n=e[0],r=Py(n)?this.projects.ensureProjectId():Sn(n)),Py(n)){const s=n,o=this.fqnIndex.byFqn(r,n).head();if(!o)return null;const a=this.langiumDocuments.getDocument(o.documentUri);return a?this.parser.parse(a).c4Elements.find(u=>u.id===s)??null:null}const i=this.fqnIndex.getFqn(n);return this.parser.parse(RH(n)).c4Elements.find(s=>s.id===i)??null}locateElement(e,n){const r=this.projects.ensureProjectId(
|
|
1983
|
-
n),i=this.fqnIndex.byFqn(r,e).head(),s=i?.nameSegment??i?.selectionSegment;return!i||!s?null:{uri:i.documentUri.toString(),range:s.range}}locateDeploymentElement(e,n){const r=this.projects.ensureProjectId(n),i=this.deploymentsIndex.byFqn(r,e).head(),s=i?.nameSegment??i?.selectionSegment;return!i||!s?null:{uri:i.documentUri.toString(),range:s.range}}locateRelation(e,n){const r=this.projects.ensureProjectId(n);for(const i of this.documents(r)){const s=i.c4Relations.find(u=>u.id===e)??i.c4DeploymentRelations.
|
|
1984
|
-
find(u=>u.id===e);if(!s)continue;const o=this.services.workspace.AstNodeLocator.getAstNode(i.parseResult.value,s.astPath);if(!ki(o)&&!Ji(o))continue;let a=o.title?im(o.$cstNode,"title"):void 0;if(a??=o.kind?im(o.$cstNode,"kind"):void 0,a??=im(o.$cstNode,"target"),a??=o.$cstNode,!!a)return{uri:i.uri.toString(),range:a.range}}return null}locateViewAst(e,n){const r=this.projects.ensureProjectId(n);for(const i of this.documents(r)){const s=i.c4Views.find(a=>a.id===e);if(!s)continue;const o=this.services.
|
|
1985
|
-
workspace.AstNodeLocator.getAstNode(i.parseResult.value,s.astPath);if(ov(o))return{doc:i,view:s,viewAst:o}}return null}locateView(e,n){const r=this.locateViewAst(e,n);if(!r)return null;const i=r.viewAst;let s=i.name?im(i.$cstNode,"name"):void 0;return s??=DH(i.$cstNode,"view"),s??=i.$cstNode,s?{uri:r.doc.uri.toString(),range:s.range}:null}}var Cw,TS;function TH(){return TS||(TS=1,Cw=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),Cw}var CH=TH();const AH=Fi(
|
|
1986
|
-
CH);function CS(t){const e=AH(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}const $o=["this","it","self","super","likec4lib","global"];function ht(t){return async function(e,n,r){try{const i=t(e,n,r);RG(i)&&await i;return}catch(i){const s=i instanceof Error?i.message:String(i);n("error",`Validation failed: ${s}`,{node:e}),Re(i)}}}const{getDocument:SH}=wu,_H=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return ht((r,i)=>{const s=n.getName(
|
|
1987
|
-
r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const o=Wt(n.getNameNode(r),"name CstNode not found").range;$o.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=Sn(r),u=e.getFqn(r);e.byFqn(a,u).limit(2).toArray().length>1&&i("error",`Duplicate node name "${u}"`,{node:r,range:o})})},PH=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return ht((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique inside nod\
|
|
1988
|
-
e",{node:r});return}const o=Wt(n.getNameNode(r),"name CstNode not found").range;$o.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=Sn(r),u=e.getFqn(r);e.byFqn(a,u).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${u}"`,{node:r,range:o})})},xH=t=>{const e=t.likec4.ModelParser;return ht((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?.
|
|
1989
|
-
value?.ref){let u=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${u}' not resolved`,{node:n,property:"target"});return}const i=SH(n),s=e.forDocument(i),o=s.parseFqnRef(n.source);if(La.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const a=s.parseFqnRef(n.target);if(La.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}l0(o.deployment,a.deployment)&&r("e\
|
|
1990
|
-
rror","Invalid parent-child relationship",{node:n})})},NH=t=>ht((e,n)=>{const r=e.deploymentNode.value.ref;(!r||!qn(r))&&n("error","ExtendDeployment allows only DeploymentNode",{node:e,property:"deploymentNode"})}),IH=t=>ht((e,n)=>{const r=vS(e.value);switch(!0){case sh(r):case ah(r):case co(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}}),OH=t=>{const e=t.likec4.FqnIndex;return ht((n,r)=>{const i=An(n.source),s=i&&e.getFqn(i);s||r("error","Source no\
|
|
1991
|
-
t found (not parsed/indexed yet)",{node:n,property:"source"});const o=An(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(um(s,a)||um(a,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:LH}=wu,FH=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return ht((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}$o.includes(r.name)&&i("error",`Reserv\
|
|
1992
|
-
ed word: ${r.name}`,{node:r,property:"name"});const o=LH(r),a=o.uri,u=n.getAstNodePath(r),c=e.byFqn(Sn(o),s).filter(l=>l.documentUri!==a||l.path!==u).head();if(c){const l=c.documentUri!==a;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...l&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},MH=t=>ht((e,n)=>{const r=parseFloat(e.value);(isNaN(
|
|
1993
|
-
r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})}),BH=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Wr(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Qi(r)&&nl(r.$container)&&r.$container.props.some(i=>Wr(i))&&n("warning","Redundant as icon defined on element",{node:e})},qH=t=>(e,n)=>{qi(e,yv)||n("error","Notes can be defined only inside dynamic view",{node:e})},jH=t=>{const e=t.likec4.FqnIndex;return ht((n,r)=>{const i=An(n.target),
|
|
1994
|
-
s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(an(n.source)){if(o=An(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!nl(n.$container))return r("error","Sourceless relation must be nested",{node:n});o=n.$container.$container}const a=e.getFqn(o);a||r("error","Source not resolved",{node:n}),a&&s&&l0(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},GH=t=>ht((e,n)=>{e.$container.tags?.values&&e.tags?.values&&
|
|
1995
|
-
n("error","Relation cannot have tags in both header and body",{node:e.tags})}),UH=t=>ht((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),WH=t=>ht((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),zH=t=>ht((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),HH=t=>{const e=t.shared.
|
|
1996
|
-
workspace.IndexManager;return ht((n,r)=>{$o.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Sn(n),s=e.projectElements(i,Di).filter(o=>o.name===n.name&&o.node!==n).head();if(s){const o=s.documentUri!==lt(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},VH=t=>{const e=t.shared.workspace.IndexManager;
|
|
1997
|
-
return ht((n,r)=>{$o.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Sn(n),s=e.projectElements(i,$i).filter(o=>o.name===n.name&&o.node!==n).head();if(s){const o=s.documentUri!==lt(n).uri;r("error",`Duplicate deploymentNode kind '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},KH=t=>{const e=t.shared.workspace.IndexManager;return ht((n,r)=>{
|
|
1998
|
-
const i="#"+n.name,s=Sn(n),o=e.projectElements(s,es).filter(a=>a.name===i&&a.node!==n).head();if(o){const a=o.documentUri!==lt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[{location:{range:o.nameSegment.range,uri:o.documentUri.toString()},message:"conflicting definition"}]}})}})},XH=t=>{const e=t.shared.workspace.IndexManager;return ht((n,r)=>{$o.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Sn(n);e.projectElements(
|
|
1999
|
-
i,Zi).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},AS=t=>{const e=t.shared.workspace.IndexManager;return ht((n,r)=>{const i=Sn(n),s=e.projectElements(i,aa),o=e.projectElements(i,oa);s.concat(o).filter(a=>a.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},YH=t=>{const e=t.shared.workspace.IndexManager;return ht(
|
|
2000
|
-
(n,r)=>{const i=Sn(n);e.projectElements(i,El).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},JH=t=>{const e=t.shared.workspace.IndexManager;return ht((n,r)=>{if(!n.name)return;$o.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Sn(n);e.projectElements(i,ro).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"})})},QH=t=>ht(
|
|
2001
|
-
(e,n)=>{const r=wn(e,qp);ml(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=wv(e.subject)?e.subject.subject:e.subject;switch(!0){case cl(i):case vv(i):case RC(i):case co(i):return;case sh(i):case ah(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:qe(i)}}),ZH=t=>ht((e,n)=>{qi(e,uv)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})}),e5=t=>{const e=t.likec4.
|
|
2002
|
-
ModelParser;return ht((n,r)=>{if(n.$container.$type!=="DeploymentViewRulePredicateExpression")return;const i=wn(n,na);if(!i||i.isInclude!==!0)return;const s=lt(n),o=e.forDocument(s),a="Model reference is allowed in exclude predicate only";if(pv(n)){Fa.isModelRef(o.parseFqnExpr(n.source.from))&&r("error",a,{node:n.source,property:"from"}),Fa.isModelRef(o.parseFqnExpr(n.target))&&r("error",a,{node:n,property:"target"});return}let u;if(Dv(n)?u=n.to:Tv(n)?u=n.from:u=n.inout.to,Fa.isModelRef(o.parseFqnExpr(
|
|
2003
|
-
u))){r("error",a,{node:n});return}})},t5=t=>{const e=t.likec4.ModelParser;return ht((n,r)=>{const i=n.ref.value.ref;if(Tt(i)){r("error","Invalid empty reference",{node:n});return}const s=lt(n),o=e.forDocument(s).parseFqnRefExpr(n);if(n.$container.$type==="DeploymentViewRulePredicateExpression"){if(Fa.isModelRef(o)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(Fa.isDeploymentRef(o)&&La.isInsideInstanceRef(o.ref)){r("error","Must reference deployment no\
|
|
2004
|
-
des or instances, but not internals",{node:n});return}}!qn(i)&&fn(n.selector)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"})})},n5=t=>ht((e,n)=>{if(co(e.to)&&!Rv(e.$container)){const r=wn(e,uh);Tt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),r5=t=>ht((e,n)=>{if(co(e.from)&&!hv(e.$container)){const r=wn(e,uh);Tt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all rela\
|
|
2005
|
-
tionships",{node:e})}}),i5=t=>ht((e,n)=>{const r=wn(e,qp);ml(r)&&n("error",'Invalid usage inside "exclude"',{node:e})});function s5(t){return e=>t.some(n=>n(e))}const o5=s5([$v,bl,wl,ca,uo,EC,oh,_v,nv,uv,mv,yv,Z4,na,i8,fC,Ev,d8,lv,o8,Iv,f8,Cp,ov,dv,Bn,qn,Ji,pC,Xi,ki,r8,hC,Eh,pn,sa,oo,ya,wa,ma,_h,Sh,Nv]),a5=t=>{let e=t;for(;e&&!x8(e);){if(o5(e))return e;e=e.$container}};function u5(t){const e=t.state>=je.Validated?t.diagnostics?.filter(r=>r.severity===xs.Error)??[]:[],n=new WeakSet;for(const{node:r}of e){
|
|
2006
|
-
if(Tt(r)||n.has(r))continue;n.add(r);const i=a5(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function c5(t){ot.debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:PH(t),DeploymentNodeKind:VH(t),DeploymentNode:_H(t),DeploymentRelation:xH(t),ExtendDeployment:NH(),FqnRefExpr:t5(t),RelationExpr:e5(t),NotesProperty:qH(),OpacityProperty:MH(),IconProperty:BH(),SpecificationRule:UH(),Model:WH(),Globals:zH(),GlobalPredicateGroup:AS(t),GlobalDynamicPredicateGroup:AS(
|
|
2007
|
-
t),GlobalStyleId:YH(t),DynamicViewStep:OH(t),LikeC4View:JH(t),Element:FH(t),ElementKind:HH(t),Relation:jH(t),RelationBody:GH(),Tag:KH(t),DynamicViewPredicateIterator:IH(),ElementPredicateWith:QH(),RelationPredicateWith:i5(),ExpandElementExpression:ZH(),RelationshipKind:XH(t),IncomingRelationExpression:n5(),OutgoingRelationExpression:r5()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)ot.debug(`clear diagnostics for deleted ${i.path}`),e.
|
|
2008
|
-
sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function Hr(t){return fn(t)?mt(t).split(`
|
|
2009
|
-
`).join(" "):void 0}function mt(t){return fn(t)?CS(t).trim():void 0}class l5{constructor(e,n){this.services=e,this.doc=n,this.isValid=u5(n).isValid}isValid;resolveFqn(e){return sa(e)?bo(e.element):oo(e)?bo(e.deploymentNode):ev(e)?this.services.likec4.DeploymentsIndex.getFqn(e):this.services.likec4.FqnIndex.getFqn(e)}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!e||!this.isValid(e)||jt(e.props))return;const n=Xe(e.props,xt(r=>[r.key,mt(r.value)]),
|
|
2010
|
-
He(([r,i])=>ce(i)),BG());return jt(n)?void 0:n}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;let r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ce);i.length>0&&r.push(...i)}}catch{}n=n.prev}return r=Xo(r.reverse()),Gn(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return Xe(e.props,He(wh),ci(n=>{if(!this.isValid(n))return[];const r=n.value;if(ce(r)){const i=ce(n.title)?
|
|
2011
|
-
Hr(n.title):void 0,s=this.services.lsp.DocumentLinkProvider.relativeLink(this.doc,r);return{url:r,...i&&{title:i},...s&&s!==r&&{relative:s}}}return[]}))}}function*d5(t){const e=d0.from(t.parseResult.value.deployments.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(Ji(r)){n.push(r);continue}if(Bn(r)){yield r;continue}if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function f5(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of d5(
|
|
2012
|
-
e))try{switch(!0){case Ji(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case Bn(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case qn(n):{e.c4Deployments.push(this.parseDeploymentNode(n));break}case oo(n):{const r=this.parseExtendDeployment(n);r&&e.c4ExtendDeployments.push(r);break}default:qe(n)}}catch(r){Re(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=Wt(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(
|
|
2013
|
-
e.body),o=e.body?.props.find(Qi)?.props,a=os(o,n),u=this.getMetadata(e.body?.props.find(Xi)),c=Xe(e.body?.props??[],He(n),He(dl),Gr(v=>[v.key,v.value||void 0])),l=mt(e.title??c.title),f=mt(c.description),d=Hr(c.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Wr);if(h&&n(h)){const v=h.libicon?.ref?.name??h.value;ce(v)&&(a.icon=v)}return{id:r,kind:i,title:l??am(r),...u&&{metadata:u},...s&&{tags:s},...p&&Gn(p)&&{links:p},...ce(d)&&{technology:d},...ce(f)&&{description:f},style:a}}parseDeployedInstance(e){
|
|
2014
|
-
const n=this.isValid,r=this.resolveFqn(e),i=this.resolveFqn(Wt(An(e.element),"DeployedInstance element not found")),s=this.convertTags(e.body),o=e.body?.props.find(Qi)?.props,a=os(o,n),u=this.getMetadata(e.body?.props.find(Xi)),c=Xe(e.body?.props??[],He(n),He(dl),Gr(v=>[v.key,v.value||void 0])),l=mt(e.title??c.title),f=mt(c.description),d=Hr(c.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Wr);if(h&&n(h)){const v=h.libicon?.ref?.name??h.value;ce(v)&&(a.icon=v)}return{id:r,element:i,
|
|
2015
|
-
...u&&{metadata:u},...l&&{title:l},...s&&{tags:s},...p&&Gn(p)&&{links:p},...ce(d)&&{technology:d},...ce(f)&&{description:f},style:a}}parseExtendDeployment(e){if(!this.isValid(e))return null;const n=this.resolveFqn(e),r=this.parseTags(e.body),i=this.getMetadata(e.body?.props.find(Xi)),s=this.getAstNodePath(e),o=this.parseLinks(e.body)??[];return!r&&jt(i??{})&&jt(o)?null:{id:n,astPath:s,...i&&{metadata:i},...r&&{tags:r},...o&&Gn(o)&&{links:o}}}parseDeploymentRelation(e){const n=this.isValid,r=this.
|
|
2016
|
-
getAstNodePath(e),i=La.toDeploymentRef(this.parseFqnRef(e.source)),s=La.toDeploymentRef(this.parseFqnRef(e.target)),o=this.convertTags(e)??this.convertTags(e.body),a=this.convertLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Xi)),l=Gr(e.body?.props.filter(Vl)??[],b=>[b.key,b.value]),f=Xe(e.body?.props??[],He(Gl),xt(b=>b.value.view.ref?.name),He(ce),Qo()),d=mt(e.title??l.title),p=mt(l.description),h=Hr(e.technology)??mt(l.technology),v=e.body?.props.find(Th);return{id:xd(
|
|
2017
|
-
"deployment",r,i.id,s.id),source:i,target:s,...d&&{title:d},...c&&{metadata:c},...ce(h)&&{technology:h},...ce(p)&&{description:p},...u&&{kind:u},...o&&{tags:o},...Gn(a)&&{links:a},...Ew(v?.props,n),...f&&{navigateTo:f},astPath:r}}}}function p5(t){const e=t.length;let n=0,r=0;for(;r<e;){let i=t.charCodeAt(r++);if((i&4294967168)===0){n++;continue}else if((i&4294965248)===0)n+=2;else{if(i>=55296&&i<=56319&&r<e){const s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===
|
|
2018
|
-
0?n+=3:n+=4}}return n}function h5(t,e,n){const r=t.length;let i=n,s=0;for(;s<r;){let o=t.charCodeAt(s++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){const a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const m5=new TextEncoder,g5=50;function y5(t,e,n){m5.encodeInto(
|
|
2019
|
-
t,e.subarray(n))}function v5(t,e,n){t.length>g5?y5(t,e,n):h5(t,e,n)}const w5=4096;function SS(t,e,n){let r=e;const i=r+n,s=[];let o="";for(;r<i;){const a=t[r++];if((a&128)===0)s.push(a);else if((a&224)===192){const u=t[r++]&63;s.push((a&31)<<6|u)}else if((a&240)===224){const u=t[r++]&63,c=t[r++]&63;s.push((a&31)<<12|u<<6|c)}else if((a&248)===240){const u=t[r++]&63,c=t[r++]&63,l=t[r++]&63;let f=(a&7)<<18|u<<12|c<<6|l;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(
|
|
2020
|
-
a);s.length>=w5&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const b5=new TextDecoder,E5=200;function $5(t,e,n){const r=t.subarray(e,e+n);return b5.decode(r)}function D5(t,e,n){return n>E5?$5(t,e,n):SS(t,e,n)}class sm{constructor(e,n){this.type=e,this.data=n}}class Jn extends Error{constructor(e){super(e);const n=Object.create(Jn.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Jn.name})}}
|
|
2021
|
-
const Nd=4294967295;function R5(t,e,n){const r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function _S(t,e,n){const r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function PS(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function k5(t,e){const n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}const T5=-1,C5=4294967296-1,A5=17179869184-1;function S5({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=A5)if(e===0&&t<=C5){const n=new Uint8Array(4);return new DataView(
|
|
2022
|
-
n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|n&3),s.setUint32(4,r),i}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),_S(r,4,t),n}}function _5(t){const 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 P5(t){if(t instanceof Date){const e=_5(t);return S5(e)}else return null}function x5(t){const e=new DataView(t.buffer,
|
|
2023
|
-
t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),i=(n&3)*4294967296+r,s=n>>>2;return{sec:i,nsec:s}}case 12:{const n=PS(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Jn(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function N5(t){const e=x5(t);return new Date(e.sec*1e3+e.nsec/1e6)}const I5={type:T5,encode:P5,decode:N5};class om{constructor(){this.builtInEncoders=[],
|
|
2024
|
-
this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(I5)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const i=-1-e;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const i=this.builtInEncoders[r];if(i!=null){const s=i(e,n);if(s!=null){const o=-1-r;return new sm(o,s)}}}for(let r=0;r<this.encoders.length;r++){const i=this.encoders[r];if(i!=null){const s=i(e,n);if(s!=null){
|
|
2025
|
-
const o=r;return new sm(o,s)}}}return e instanceof sm?e:null}decode(e,n,r){const i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new sm(n,e)}}om.defaultCodec=new om;function O5(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Aw(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):O5(t)?new Uint8Array(t):Uint8Array.from(t)}const L5=100,F5=2048;class n0{constructor(e){
|
|
2026
|
-
this.entered=!1,this.extensionCodec=e?.extensionCodec??om.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??L5,this.initialBufferSize=e?.initialBufferSize??F5,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){
|
|
2027
|
-
return new n0({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,
|
|
2028
|
-
this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${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.
|
|
2029
|
-
useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),
|
|
2030
|
-
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)}encodeNumberAsFloat(e){
|
|
2031
|
-
this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(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: ${e} bytes in UTF-8`)}encodeString(e){const r=p5(
|
|
2032
|
-
e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),v5(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const 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: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),
|
|
2033
|
-
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: ${n}`);const r=Aw(e);this.writeU8a(r)}encodeArray(e,n){const 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: ${r}`);for(const i of e)this.doEncode(i,n+1)}countWithoutUndefined(e,n){let r=0;for(const i of n)
|
|
2034
|
-
e[i]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const 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: ${i}`);for(const s of r){const o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="functi\
|
|
2035
|
-
on"){const r=e.data(this.pos+6),i=r.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(r);return}const 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(
|
|
2036
|
-
201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(
|
|
2037
|
-
2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),R5(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(
|
|
2038
|
-
8),_S(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function M5(t,e){return new n0(e).encodeSharedRef(t)}function Sw(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const B5=16,q5=16;class j5{constructor(e=B5,n=q5){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let r=0;r<
|
|
2039
|
-
this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,n,r){const i=this.caches[r-1];e:for(const s of i){const o=s.bytes;for(let a=0;a<r;a++)if(o[a]!==e[n+a])continue e;return s.str}return null}store(e,n){const 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)}decode(e,n,r){const i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;const s=SS(e,n,r),o=Uint8Array.prototype.slice.call(
|
|
2040
|
-
e,n,n+r);return this.store(o,s),s}}const _w="array",Id="map_key",xS="map_value",G5=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new Jn("The type of key must be string or number but "+typeof t)};class U5{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=_w,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.
|
|
2041
|
-
getUninitializedStateFromPool();n.type=Id,n.readCount=0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const 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]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===_w){const r=e;r.size=0,r.array=
|
|
2042
|
-
void 0,r.position=0,r.type=void 0}if(e.type===Id||e.type===xS){const r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const Od=-1,Pw=new DataView(new ArrayBuffer(0)),W5=new Uint8Array(Pw.buffer);try{Pw.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")}const NS=new RangeError(
|
|
2043
|
-
"Insufficient data"),z5=new j5;class r0{constructor(e){this.totalPos=0,this.pos=0,this.view=Pw,this.bytes=W5,this.headByte=Od,this.stack=new U5,this.entered=!1,this.extensionCodec=e?.extensionCodec??om.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??Nd,this.maxBinLength=e?.maxBinLength??Nd,this.maxArrayLength=e?.maxArrayLength??Nd,this.maxMapLength=e?.maxMapLength??Nd,this.maxExtLength=e?.maxExtLength??
|
|
2044
|
-
Nd,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:z5,this.mapKeyConverter=e?.mapKeyConverter??G5}clone(){return new r0({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=Od,this.stack.reset()}setBuffer(e){
|
|
2045
|
-
const n=Aw(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===Od&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),r=Aw(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:r}=this;return new RangeError(`Extra ${n.byteLength-r} of ${n.byteLength} byte(s) found at buf\
|
|
2046
|
-
fer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.
|
|
2047
|
-
entered)return this.clone().decodeAsync(e);try{this.entered=!0;let n=!1,r;for await(const a of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{r=this.doDecodeSync(),n=!0}catch(u){if(!(u instanceof RangeError))throw u}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}const{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${Sw(i)} at ${o} (${s} in the curr\
|
|
2048
|
-
ent buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let r=n,i=-1;for await(const s of e){if(n&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))
|
|
2049
|
-
throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else{const 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===
|
|
2050
|
-
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){const i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();n=this.decodeString(i,2)}else if(e===
|
|
2051
|
-
219){const i=this.lookU32();n=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===
|
|
2052
|
-
196){const i=this.lookU8();n=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();n=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();n=this.decodeBinary(i,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){const i=this.lookU8();n=this.decodeExtension(i,1)}else if(e===200){const i=this.
|
|
2053
|
-
lookU16();n=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();n=this.decodeExtension(i,4)}else throw new Jn(`Unrecognized type byte: ${Sw(e)}`);this.complete();const r=this.stack;for(;r.length>0;){const i=r.top();if(i.type===_w)if(i.array[i.position]=n,i.position++,i.position===i.size)n=i.array,r.release(i);else continue e;else if(i.type===Id){if(n==="__proto__")throw new Jn("The key __proto__ is not allowed");i.key=this.mapKeyConverter(n),i.type=xS;continue e}else if(i.map[i.key]=
|
|
2054
|
-
n,i.readCount++,i.readCount===i.size)n=i.map,r.release(i);else{i.key=null,i.type=Id;continue e}}return n}}readHeadByte(){return this.headByte===Od&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=Od}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new Jn(`Unrecognized array type byte: ${Sw(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new Jn(`Max length exceeded: ma\
|
|
2055
|
-
p length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new Jn(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){if(e>this.maxStrLength)throw new Jn(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.
|
|
2056
|
-
maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw NS;const r=this.pos+n;let i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,r,e):i=D5(this.bytes,r,e),this.pos+=n+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Id:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new Jn(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw NS;const r=this.pos+n,i=this.bytes.
|
|
2057
|
-
subarray(r,r+e);return this.pos+=n+e,i}decodeExtension(e,n){if(e>this.maxExtLength)throw new Jn(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){
|
|
2058
|
-
const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=k5(this.view,this.pos);return this.pos+=8,e}readI64(){const e=PS(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(
|
|
2059
|
-
this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function H5(t,e){return new r0(e).decode(t)}const V5=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",K5=(t,e=0,n=t.byteLength-e)=>{if(!V5(t))throw new TypeError(`The "input" arg\
|
|
2060
|
-
ument must be ArrayBuffer. Received type ${typeof t} (${t})`);return cm.from(t,e,n)},IS=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?cm.from(t,e):cm.from(t)},X5=/^[A-Za-z0-9+/]*={0,2}$/,Y5=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!X5.exec(t))throw new TypeError("Invalid base64 string.");const e=IS(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},
|
|
2061
|
-
J5=t=>{const e=IS(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Q5=t=>{let e;if(typeof t=="string"?e=J5(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 K5(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:Z5}=wu;function e9({nodes:t,edges:e,...n}){return{...n,nodes:Yo(t,({x:r,y:i,width:s,
|
|
2062
|
-
height:o,isCompound:a,...u})=>({...u,b:[r,i,s,o],c:a})),edges:Yo(e,({points:r,controlPoints:i,labelBBox:s,dotpos:o,...a})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!o&&{dp:o},...a,p:r}))}}function t9({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:N_(n)?{direction:n}:n,nodes:Yo(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:Yo(e,({p:i,cp:s,l:o,dp:a,...u})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...u,points:i}))}}const OS=500;
|
|
2063
|
-
function n9(t){const e=M5(e9(t)),n=Q5(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+OS,n.length))),i+=OS;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
|
|
2064
|
-
`)}function LS(t){return t.includes("@likec4-generated")}function r9(t){if(!LS(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
|
|
2065
|
-
`).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=Y5(e);return t9(H5(n))}function xw(t){const e=Sm(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!LS(e.text)))try{return r9(e.text)}catch(n){const r=Z5(t);Re(n),ot.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function i9(t){return class extends t{parseDeploymentView(e){const n=e.body;Ie(n,"DynamicElementView body is \
|
|
2066
|
-
not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+xd(this.doc.uri.toString(),i));const o=Hr(r.find(f=>f.key==="title")?.value)??null,a=mt(r.find(f=>f.key==="description")?.value)??null,u=this.convertTags(n),c=this.convertLinks(n);em.writeId(e,s);const l=xw(e);return{__:"deployment",id:s,astPath:i,title:o,description:a,tags:u,links:Gn(c)?c:null,rules:n.rules.flatMap(f=>{try{return this.isValid(f)?this.parseDeploymentViewRule(f):[]}catch(d){
|
|
2067
|
-
return Re(d),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(na(e))return this.parseDeploymentViewRulePredicate(e);if(td(e))return $w(e);if(vC(e))return this.parseDeploymentViewRuleStyle(e);qe(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;if(fn(i)&&this.isValid(i))switch(!0){case s8(i):n.unshift(this.parseFqnExpr(i));break;case A8(i):n.unshift(this.parseElementWhereExpr(i));break;case fC(i):n.unshift(this.parseRelationExpr(i));break;case L8(
|
|
2068
|
-
i):n.unshift(this.parseRelationWhereExpr(i));break;default:qe(i)}}catch(i){Re(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=e.props.filter(lv),r=e.props.find(pa),i=mt(r?.value);return{targets:this.parseFqnExpressions(e.targets),...i&&{notation:i},style:{...os(n,this.isValid)}}}}}const FS=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function MS(t){return!jC(t)&&!GC(t)?null:t.participant}function Do(t){
|
|
2069
|
-
switch(!0){case g8(t):{const e=t.value?.ref?.name,n=MS(t);Ie(e,"Expected tag name");const r={tag:FS(t,e)};return n?{participant:n,operator:r}:r}case h8(t):{const e=t.value?.ref?.name,n=MS(t);Ie(e,"Expected kind name");const r={kind:FS(t,e)};return n?{participant:n,operator:r}:r}case(MC(t)||qC(t)):return{not:Do(t.value)};case B8(t):{const e=Do(t.left),n=Do(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[p0(e)?e.and:e,p0(n)?n.and:n].flat();return Ie(Gn(i),"Expected non-empty arra\
|
|
2070
|
-
y"),{and:i}}case"or":{const i=[f0(e)?e.or:e,f0(n)?n.or:n].flat();return Ie(Gn(i),"Expected non-empty array"),{or:i}}default:qe(r)}}default:qe(t)}}function s9(t){return class extends t{parseFqnRef(e){const n=Wt(e.value.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(pn(n)){const r=tH(e);if(!r)return{model:this.resolveFqn(n)};const i=this.resolveFqn(r),s=this.resolveFqn(n);return{deployment:i,element:s}}if(ev(n))return{deployment:this.resolveFqn(n)};qe(
|
|
2071
|
-
n)}parseFqnExpr(e){if(co(e))return{wildcard:!0};if(Ev(e))return this.parseFqnRefExpr(e);qe(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}}}parseElementWhereExpr(e){return{where:{expr:this.parseFqnExpr(e.subject),condition:e.where?Do(e.where):{kind:{neq:"--always-true--"}}}}}parseFqnExpressions(e){
|
|
2072
|
-
const n=[];let r=e;for(;r;){try{fn(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){Re(i)}r=r.prev}return n.reverse()}parseRelationWhereExpr(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Do(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationExpr(e){if(Sv(e),pv(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)};
|
|
2073
|
-
if(Tv(e))return{outgoing:this.parseFqnExpr(e.from)};if(Dv(e))return{incoming:this.parseFqnExpr(e.to)};qe(e)}}}function o9(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(a=>a.predicates.filter(r));for(const a of s)try{const u=a.name;if(!ce(u))continue;if(u in n.predicates){ot.warn(`Global predicate named "${u}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(a,u,n)}catch(u){Re(
|
|
2074
|
-
u)}const o=i.flatMap(a=>a.styles.filter(r));for(const a of o)try{const u=a.id.name;if(!ce(u))continue;if(u in n.styles){ot.warn(`Global style named "${u}" is already defined`);continue}const c=this.parseGlobalStyleOrGroup(a);c.length>0&&(n.styles[u]=c)}catch(u){Re(u)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(bl(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(wl(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=
|
|
2075
|
-
i);return}qe(e)}parseGlobalPredicateGroup(e){return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(ca(e))return[this.parseViewRuleStyle(e)];if(uo(e))return e.styles.map(n=>this.parseViewRuleStyle(n));qe(e)}}}const a9=ot.getChild("ModelParser");function u9(t){const e=An(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(an(t.source)){
|
|
2076
|
-
const n=An(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!nl(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function*c9(t){const e=d0.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(ki(r)){n.push(r);continue}if(r.body&&r.body.elements&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);
|
|
2077
|
-
yield r}yield*n}function l9(t){return class extends t{parseModel(){const e=this.doc;for(const n of c9(e))try{if(pn(n)){e.c4Elements.push(this.parseElement(n));continue}if(ki(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}if(sa(n)){const r=this.parseExtendElement(n);r&&e.c4ExtendElements.push(r);continue}qe(n)}catch(r){const i=this.getAstNodePath(n),s=hr(r),o=r instanceof Error?r.message:String(s);a9.warn(`Error on {eltype}: ${o}
|
|
2078
|
-
document: {path}
|
|
2079
|
-
astpath: {astPath}
|
|
2080
|
-
${s}`,{path:e.uri.path,eltype:n.$type,astPath:i})}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=Wt(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),o=e.body?.props.find(Qi)?.props,a=os(o,n),u=this.getMetadata(e.body?.props.find(Xi)),c=this.getAstNodePath(e);let[l,f,d]=e.props??[];const p=Xe(e.body?.props??[],He(n),He(dl),Gr(b=>[b.key,b.value||void 0]));l=mt(l??p.title),f=mt(p.description??f),d=Hr(p.technology??d);const h=this.parseLinks(e.body),v=e.body?.props.
|
|
2081
|
-
find(Wr);if(v&&n(v)){const b=v.libicon?.ref?.name??v.value;ce(b)&&(a.icon=b)}return{id:r,kind:i,astPath:c,title:l??e.name,...u&&{metadata:u},...s&&{tags:s},...h&&Gn(h)&&{links:h},...ce(d)&&{technology:d},...ce(f)&&{description:f},style:a}}parseExtendElement(e){this.isValid;const n=this.resolveFqn(e),r=this.parseTags(e.body),i=this.getMetadata(e.body?.props.find(Xi)),s=this.getAstNodePath(e),o=this.parseLinks(e.body)??[];return!r&&jt(i??{})&&jt(o)?null:{id:n,astPath:s,...i&&{metadata:i},...r&&{tags:r},
|
|
2082
|
-
...o&&Gn(o)&&{links:o}}}parseRelation(e){const n=this.isValid,r=u9(e),i=this.resolveFqn(r.target),s=this.resolveFqn(r.source),o=this.parseTags(e)??this.parseTags(e.body),a=this.parseLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Xi)),l=this.getAstNodePath(e),f=Gr(e.body?.props.filter(Vl).filter(y=>fn(y.value))??[],y=>[y.key,y.value]),d=Xe(e.body?.props??[],He(Gl),xt(y=>y.value.view.ref?.name),He(ce),Qo()),p=mt(e.title??f.title)??"",h=mt(f.description),v=Hr(e.technology)??
|
|
2083
|
-
mt(f.technology),b=e.body?.props.find(Th);return{id:xd(l,s,i),astPath:l,source:s,target:i,title:p,...c&&{metadata:c},...ce(v)&&{technology:v},...ce(h)&&{description:h},...u&&{kind:u},...o&&{tags:o},...Gn(a)&&{links:a},...Ew(b?.props,n),...d&&{navigateTo:d}}}}}function d9(t){return class extends t{parsePredicate(e){if(e8(e))return this.parseElementPredicate(e);if(a8(e))return this.parseRelationPredicate(e);qe(e)}parseElementPredicate(e){if(oh(e))return this.parseElementPredicateWith(e);if(wv(e))return this.
|
|
2084
|
-
parseElementPredicateWhere(e);if(nv(e))return this.parseElementExpression(e);qe(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{r.value&&n.unshift(this.parseElementExpression(r.value))}catch(i){Re(i)}r=r.prev}return n}parseElementExpression(e){if(co(e))return{wildcard:!0};if(sh(e))return Ie(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(ah(e)){Ie(e.tag?.ref,"ElementTagExpr tag is not resolved: "+e.$cstNode?.
|
|
2085
|
-
text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if(RC(e)){const n=An(e.expand);return Ie(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(vv(e)){const n=An(e.parent);return Ie(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isChildren:e.suffix===".*",isDescendants:e.suffix===".**"}}if(cl(e)){const n=An(e);return Ie(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}
|
|
2086
|
-
qe(e)}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpression(e.subject),condition:e.where?Do(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(Eh(i)){const s=i.value.view.$refText;return ce(s)&&(r.custom.navigateTo=s),r}if(dl(i))return an(i.value)&&(r.custom[i.key]=mt(i.value)||""),r;if(Wr(i)){const s=i.libicon?.ref?.name??i.value;return an(
|
|
2087
|
-
s)&&(r.custom[i.key]=s),r}if(io(i)){const s=Pd(i);return an(s)&&(r.custom[i.key]=s),r}if(Ch(i)||Wp(i))return an(i.value)&&(r.custom[i.key]=i.value),r;if($h(i))return an(i.value)&&(r.custom[i.key]=yS(i)),r;if(pa(i))return ce(i.value)&&(r.custom[i.key]=mt(i.value)),r;if(kv(i))return xy(i.value)&&(r.custom[i.key]=i.value),r;if(Pv(i)||Ov(i)||Av(i))return ce(i.value)&&(r.custom[i.key]=Aa(i)),r;qe(i)},{custom:{expr:n}})}parseRelationPredicate(e){if(_v(e)){let n=Sv(e.subject)?this.parseRelationPredicateWhere(
|
|
2088
|
-
e.subject):this.parseRelationExpression(e.subject);return this.parseRelationPredicateWith(e,n)}if(Sv(e))return this.parseRelationPredicateWhere(e);if(uv(e))return this.parseRelationExpression(e);qe(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpression(e.subject),condition:e.where?Do(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(Vl(i)||pa(i)||xC(i))return an(i.value)&&(r.customRelation[i.key]=mt(
|
|
2089
|
-
i.value)??""),r;if(Hc(i))return ce(i.value)&&(r.customRelation[i.key]=i.value),r;if(io(i)){const s=Pd(i);return ce(s)&&(r.customRelation[i.key]=s),r}if(Sl(i))return ce(i.value)&&(r.customRelation[i.key]=i.value),r;if(Gl(i)){const s=i.value.view.ref?.name;return ce(s)&&(r.customRelation.navigateTo=s),r}qe(i)},{customRelation:{relation:n}})}parseRelationExpression(e){if(hv(e))return{source:this.parseElementExpression(e.source.from),target:this.parseElementExpression(e.target),isBidirectional:e.source.
|
|
2090
|
-
isBidirectional};if(Rv(e))return{inout:this.parseElementExpression(e.inout.to)};if(Cv(e))return{outgoing:this.parseElementExpression(e.from)};if(CC(e))return{incoming:this.parseElementExpression(e.to)};qe(e)}}}function f9(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 f=c.name;if(!ce(f))continue;if(f in n.elements){ot.warn(
|
|
2091
|
-
`Element kind "${f}" is already defined`);continue}const d=l.find(Qi),p=Xe(l.filter(xv)??[],He(h=>this.isValid(h)&&fn(h.value)),Gr(h=>[h.key,mt(h.value)]));n.elements[f]={...p,style:{...os(d?.props,this.isValid)}}}catch(f){Re(f)}const s=e.flatMap(c=>c.relationships.filter(this.isValid));for(const{kind:c,props:l}of s)try{const f=c.name;if(!ce(f))continue;if(f in n.relationships){ot.warn(`Relationship kind "${f}" is already defined`);continue}const d=Xe(l.filter(IC)??[],He(p=>this.isValid(p)&&fn(p.
|
|
2092
|
-
value)),Gr(p=>[p.key,mt(p.value)]));n.relationships[f]={...d,...Ew(l,this.isValid)}}catch(f){Re(f)}const o=e.flatMap(c=>c.tags.filter(this.isValid));for(const c of o){const l=c.tag.name;ce(l)&&n.tags.add(l)}const a=e.flatMap(c=>c.deploymentNodes.filter(r));for(const c of a)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(c))}catch(l){Re(l)}const u=e.flatMap(c=>c.colors.filter(r));for(const{name:c,color:l}of u)try{const f=c.name;if(f in n.colors){ot.warn(`Custom color "${f}\
|
|
2093
|
-
" is already defined`);continue}n.colors[f]={color:l}}catch(f){Re(f)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ce(r))throw new Error("DeploymentNodeKind name is not resolved");const i=n.find(Qi),s=Xe(n.filter(xv)??[],He(o=>this.isValid(o)&&fn(o.value)),Gr(o=>[o.key,mt(o.value)]));return{[r]:{...s,style:{...os(i?.props,this.isValid)}}}}}}function p9(t){return class extends t{parseViews(){const e=this.isValid;for(const n of this.doc.parseResult.value.views){const r=n.
|
|
2094
|
-
styles.flatMap(i=>{try{return e(i)?this.parseViewRuleStyleOrGlobalRef(i):[]}catch(s){return Re(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case uh(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case wC(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case fv(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:qe(i)}}catch(s){Re(s)}}}parseElementView(e,n){const r=e.body;Ie(r,"ElementView body is not defined");const i=this.getAstNodePath(
|
|
2095
|
-
e);let s=null;if("viewOf"in e){const p=An(e.viewOf),h=p&&this.resolveFqn(p);h?s=h:ot.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+xd(this.doc.uri.toString(),i,s??""));const a=Hr(r.props.find(p=>p.key==="title")?.value)??null,u=mt(r.props.find(p=>p.key==="description")?.value)??null,c=this.convertTags(r),l=this.convertLinks(r),f=xw(e),d={__:"element",id:o,astPath:i,title:a,description:u,tags:c,links:Gn(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(
|
|
2096
|
-
p)?this.parseViewRule(p):[]}catch(h){return Re(h),[]}})],...s&&{viewOf:s},...f&&{manualLayout:f}};if(em.writeId(e,d.id),"extends"in e){const p=e.extends.view.ref;return Ie(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(d,{extends:p.name})}return d}parseViewRule(e){if(qp(e))return this.parseViewRulePredicate(e);if(Fv(e))return this.parseViewRuleGlobalPredicateRef(e);if(dv(e))return this.parseViewRuleStyleOrGlobalRef(e);if(td(e))return $w(e);if(Ih(e))return this.parseViewRuleGroup(
|
|
2097
|
-
e);qe(e)}parseViewRulePredicate(e){const n=[];let r=e.predicates;for(;r;){const{value:i,prev:s}=r;try{ce(i)&&this.isValid(i)&&n.unshift(this.parsePredicate(i))}catch(o){Re(o)}if(!s)break;r=s}return gh(e)?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(od(e))return this.parseViewRuleStyle(e);if(Mv(e))return this.parseViewRuleGlobalStyle(e);qe(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{
|
|
2098
|
-
if(!this.isValid(r))continue;if(qp(r)){n.push(this.parseViewRulePredicate(r));continue}if(Ih(r)){n.push(this.parseViewRuleGroup(r));continue}qe(r)}catch(i){Re(i)}return{title:Hr(e.title)??null,groupRules:n,...os(e.props,this.isValid)}}parseViewRuleStyle(e){const n=e.props.filter(lv),r=e.target,i=e.props.find(pa);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=os(e,this.isValid),s=mt(r?.value);return{targets:this.parseElementExpressionsIterator(n),...s&&{notation:s},style:{...i}}}parseViewRuleGlobalStyle(e){
|
|
2099
|
-
return{styleId:e.style.$refText}}parseDynamicElementView(e,n){const r=e.body;Ie(r,"DynamicElementView body is not defined");const i=this.isValid,s=r.props.filter(i),o=this.getAstNodePath(e);let a=e.name;a||(a="dynamic_"+xd(this.doc.uri.toString(),o));const u=Hr(s.find(p=>p.key==="title")?.value)??null,c=mt(s.find(p=>p.key==="description")?.value)??null,l=this.convertTags(r),f=this.convertLinks(r);em.writeId(e,a);const d=xw(e);return{__:"dynamic",id:a,astPath:o,title:u,description:c,tags:l,links:Gn(
|
|
2100
|
-
f)?f:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(h){return Re(h),[]}},[])],steps:r.steps.reduce((p,h)=>{try{i(h)&&(mv(h)?p.push(this.parseDynamicParallelSteps(h)):p.push(this.parseDynamicStep(h)))}catch(v){Re(v)}return p},[]),...d&&{manualLayout:d}}}parseDynamicViewRule(e){if(T8(e))return this.parseDynamicViewIncludePredicate(e);if(bC(e))return this.parseViewRuleGlobalPredicateRef(e);if(dv(e))return this.parseViewRuleStyleOrGlobalRef(e);if(td(e))
|
|
2101
|
-
return $w(e);qe(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.predicates;for(;r;){try{if(fn(r.value)&&this.isValid(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){Re(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=An(e.source);if(!n)throw new Error("Invalid reference to source");const r=An(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.
|
|
2102
|
-
resolveFqn(n),s=this.resolveFqn(r);const o=mt(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),!TG(e.custom?.props))return a;for(const u of e.custom.props)try{switch(!0){case Gl(u):{const c=u.value.view.ref?.name;ce(c)&&(a.navigateTo=c);break}case Vl(u):case pa(u):case xC(u):{an(u.value)&&(a[u.key]=mt(u.value)??"");break}case Hc(u):{an(u.value)&&(a[u.key]=u.value);break}case io(u):{const c=Pd(u);an(c)&&(a[u.key]=c);break}case Sl(u):{
|
|
2103
|
-
an(u.value)&&(a[u.key]=u.value);break}default:qe(u)}}catch(c){Re(c)}return a}}}const h9=Xe(l5,s9,l9,f5,i9,d9,f9,p9,o9);class m9 extends h9{}const BS=ot.getChild("ModelParser");class g9{constructor(e){this.services=e,e.shared.workspace.DocumentBuilder.onDocumentPhase(je.Linked,n=>{try{vd(n.uri)||this.cachedParsers.set(n,this.createParser(n))}catch(r){BS.warn(hr(r))}}),e.shared.workspace.DocumentBuilder.onDocumentPhase(je.Validated,n=>{n.diagnostics?.some(r=>r.severity===xs.Error)&&this.cachedParsers.
|
|
2104
|
-
delete(n)})}cachedParsers=new m0(e=>this.createParser(e));documents(e){return this.services.shared.workspace.LangiumDocuments.projectDocuments(e).map(n=>this.parse(n))}parse(e){try{return this.forDocument(e).doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return e.state<je.Linked&&BS.warn(`Document ${e.uri.toString()} is not linked`),this.cachedParsers.get(e)}createParser(e){e=Object.assign(e,{c4Specification:{tags:new Set,elements:{},relationships:{},
|
|
2105
|
-
colors:{},deployments:{}},c4Elements:[],c4ExtendElements:[],c4ExtendDeployments:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[]});const n=new m9(this.services,e);return n.parseSpecification(),n.parseModel(),n.parseGlobals(),n.parseDeployment(),n.parseViews(),n}}const{findNodeForKeyword:y9}=ng,v9=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Qu(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+
|
|
2106
|
-
"%":s}`),r+"}"]},w9=(t,e)=>n=>{if(!od(n))return!1;const r=n.target.value;if(!r||ce(n.target.prev)||!cl(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function b9(t,{view:e,viewAst:n,targets:r,style:i}){Ie(n.body,`View ${e.id} has no body`);const s=n.$cstNode;Ie(s,"viewCstNode");const o=Yu(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;Ie(o,"insertPos is not defined");const a=s.range.start.character+2,u=t.likec4.FqnIndex,c=He(n.body.rules,od),l=e.__==="element"?e.viewOf:
|
|
2107
|
-
null,f=[],d=[];r.forEach(b=>{const y=nk(c,w9(b,u)),E=l&&um(l,b)?b.substring(l.length+1):b;y?f.push({fqn:E,rule:y}):d.push({fqn:E})});const p={start:o,end:o},h=b=>{b.start.line<=p.start.line&&(b.start.line==p.start.line?p.start.character=Math.min(b.start.character,p.start.character):p.start=b.start),b.end.line>=p.end.line&&(b.end.line==p.end.line?p.end.character=Math.max(b.end.character,p.end.character):p.end=b.end)},v=[];if(d.length>0){const b=d.flatMap(({fqn:y})=>v9(y,i,a));v.push(Fn.insert(o,`\
|
|
2108
|
-
|
|
2109
|
-
`+b.join(`
|
|
2110
|
-
`))),p.start={line:o.line+1,character:a},p.end={line:o.line+b.length,character:Yu(b)?.length??0}}if(f.length>0)for(const{rule:b}of f){const y=b.$cstNode;Ie(y,"RuleCstNode not found");for(const[E,R]of Qu(i)){const A=E==="opacity"?R.toString()+"%":R,N=b.props.find(ie=>ie.key===E);if(N&&N.$cstNode){const{range:{start:ie,end:we}}=N.$cstNode;h({start:ie,end:we}),v.push(Fn.replace({start:ie,end:we},E+" "+A));continue}const K=y9(y,"{")?.range.end;Ie(K,"Opening brace not found");const J=" ".repeat(2+y.range.
|
|
2111
|
-
start.character),se=J+E+" "+A;v.push(Fn.insert(K,`
|
|
2112
|
-
`+se)),h({start:{line:K.line+1,character:J.length},end:{line:K.line+1,character:se.length}})}}return{modifiedRange:p,edits:v}}const{findNodeForKeyword:E9}=ng;function $9(t,{view:e,viewAst:n,layout:r}){Ie(n.body,`View ${e.id} has no body`);const i=n.$cstNode;Ie(i,"viewCstNode");const s=W6(r.direction),o=nk(n.body.rules,td);let a=`autoLayout ${s}`;if(vp(r.rankSep)&&(a+=` ${r.rankSep}`,vp(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return Fn.replace(o.$cstNode.range,a);const u=E9(n.body.$cstNode,
|
|
2113
|
-
"}")?.range.start;Ie(u,"Closing brace not found");const c=` ${a}
|
|
2114
|
-
`;return Fn.insert(u,c)}function D9(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===
|
|
2115
|
-
0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function R9(t,{viewAst:e,layout:n}){Ie(e.$cstNode,"invalid view.$cstNode");const r=Sm(e.$cstNode,["BLOCK_COMMENT"]);let i=n9(n);return e.$cstNode.range.start.character>0&&(i=D9(i,e.$cstNode.range.start.character)),r?Fn.replace(r.range,i.trimStart()):Fn.insert({line:e.$cstNode.range.start.line,character:0},i+`
|
|
2116
|
-
`)}class k9{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;Ie(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:o}=this.convertToTextEdit(e),a={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:{
|
|
2117
|
-
[a.uri]:s}}});if(!u.applied){n.window.showErrorMessage(`Failed to apply changes ${u.failureReason}`);return}r={uri:a.uri,range:o}})}catch(i){vn.error(`Failed to apply change ${e.change.op} ${e.viewId}`,{error:i})}return r}convertToTextEdit({viewId:e,projectId:n,change:r}){const i=this.locator.locateViewAst(e,n);if(!i)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(r.op){case"change-element-style":return{doc:i.doc,...b9(this.services,{...i,targets:r.targets,style:r.style})};case"\
|
|
2118
|
-
change-autolayout":{const o=$9(this.services,{...i,layout:r.layout});return{doc:i.doc,modifiedRange:o.range,edits:[o]}}case"save-manual-layout":const s=R9(this.services,{...i,layout:r.layout});return{doc:i.doc,modifiedRange:s.range,edits:[s]};default:qe(r)}}}class T9 extends ER{constructor(e){super(),this.services=e}getNameStrict(e){return Wt(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(dp(e))return e.name;if(Bn(e))return e.element.
|
|
2119
|
-
el.$refText}getNameNode(e){if(dp(e))return super.getNameNode(e);if(Bn(e))return e.element.el.$refNode}}function C9(t){return Xe(t,Jo(e=>`${e.type}.${e.name}`),Qu(),ci(([e,n])=>n.length===1?n:[]))}class A9 extends DR{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,globals:a,likec4lib:u,deployments:c}=e.parseResult.value;this.exportLibrary(u,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e),this.exportGlobals(
|
|
2120
|
-
a,r,e),this.exportDeployments(c,r,e)}catch(i){Re(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(Tt(i)||i.length===0))for(const s of i)try{ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){Re(o)}}exportGlobals(e,n,r){if(!(Tt(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){Re(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ce(s.name)&&n.push(
|
|
2121
|
-
this.descriptions.createDescription(s,s.name,r))}catch(s){Re(s)}}}exportModel(e,n,r){if(!(Tt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{pn(i)&&ce(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Re(s)}}exportLibrary(e,n,r){if(!Tt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){Re(i)}}exportSpecification(e,n,r){if(!(Tt(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,
|
|
2122
|
-
...s.deploymentNodes,...s.tags,...s.colors]))try{switch(!0){case ma(i):case ya(i):{ce(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case _h(i):{ce(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case wa(i):{ce(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 Sh(i):{ce(i.name.name)&&n.push(this.descriptions.
|
|
2123
|
-
createDescription(i.name,i.name.name,r));continue}default:qe(i)}}catch(s){Re(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(Tt(i)||i.length===0))for(const s of i)try{qn(s)&&ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){Re(o)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],o=new Fs;for(const a of i.models)try{s.push(...this.processContainer(a,o,e))}catch(u){Re(u)}for(const a of i.deployments)try{s.push(...this.processDeployments(
|
|
2124
|
-
a,o,e))}catch(u){Re(u)}C9(s).forEach(a=>{o.add(i,a)}),r(o)})}processContainer(e,n,r){const i=new Fs,s=[];for(const a of e.elements){if(ki(a))continue;let u;if(pn(a)?(ce(a.name)&&i.add(a.name,this.descriptions.createDescription(a,a.name,r)),u=a.body):sa(a)&&(u=a.body),u&&u.elements.length>0)try{s.push(...this.processContainer(u,n,r))}catch(c){Re(c)}}s.length&&Xe(s,He(a=>!i.has(a.name)),Jo(a=>a.name),ZR((a,u)=>{a.length===1&&i.add(u,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}processDeployments(e,n,r){
|
|
2125
|
-
const i=new Fs,s=[];for(const a of e.elements)if(!Ji(a)){if(!oo(a)){let u=this.nameProvider.getName(a);if(ce(u)){const c=this.descriptions.createDescription(a,u,r);i.add(u,c)}}if(!Bn(a)&&a.body)try{s.push(...this.processDeployments(a.body,n,r))}catch(u){Re(u)}}s.length&&Xe(s,He(a=>!i.has(a.name)),Jo(a=>a.name),ZR((a,u)=>{a.length===1&&i.add(u,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}}const{getDocument:S9}=wu;class _9 extends TR{deploymentsIndex;fqnIndex;indexManager;constructor(e){
|
|
2126
|
-
super(e),this.indexManager=e.shared.workspace.IndexManager,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}getScope(e){try{const n=Sn(e.container),r=this.reflection.getReferenceType(e);try{const i=e.container;if(TC(i))return new Ms(this.streamForFqnRef(n,i,e));if(LC(i))return this.getScopeForStrictFqnRef(n,i,e);if(r!==Dr)return this.getProjectScope(n,r,e);if(OC(i)&&e.property==="el"){const s=i.parent;return s?new Ms(this.fqnIndex.directChildrenOf(n,bo(s))):this.getProjectScope(
|
|
2127
|
-
n,r,e)}if(cl(i)&&e.property==="el"){const s=i.parent;if(s)return new Ms(this.streamScopeElementRef(s));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const o=wn(i,pn);return o?new Ey([this.descriptions.createDescription(o,e.reference.$refText)]):RR}}return new Ms(We(this.computeScope(n,e)))}catch(i){return Re(i),this.getProjectScope(n,r,e)}}catch(n){return Re(n),RR}}*genUniqueDescedants(e){const n=e();if(!n)return;const r=Sn(n);if(pn(n)){const i=this.fqnIndex.getFqn(n);yield*this.
|
|
2128
|
-
fqnIndex.uniqueDescedants(r,i);return}if(qn(n)){const i=this.deploymentsIndex.getFqn(n);yield*this.deploymentsIndex.uniqueDescedants(r,i)}}streamScopeElementRef(e){return We(this.genUniqueDescedants(()=>e.el.ref))}streamScopeExtendElement({element:e}){return We([e.el.$nodeDescription]).nonNullable().concat(this.genUniqueDescedants(()=>An(e)))}streamScopeElementView({viewOf:e,extends:n}){return e?We([e.el.$nodeDescription]).nonNullable().concat(this.genUniqueDescedants(()=>An(e))):n?We([n]).flatMap(
|
|
2129
|
-
r=>{const i=r.view.ref;return i?this.streamScopeElementView(i):bs}):bs}getScopeForStrictFqnRef(e,n,r){const i=n.parent;return i?new Ms(this.deploymentsIndex.directChildrenOf(e,bo(i)).filter(s=>this.reflection.isSubtype(s.type,Ur))):this.getProjectScope(e,Ur,r)}streamScopeExtendDeployment({deploymentNode:e}){return We([e.value.$nodeDescription]).nonNullable().concat(this.genUniqueDescedants(()=>{const n=e.value.ref;return n&&qn(n)?n:void 0}))}streamForFqnRef(e,n,r){const i=n.parent;if(!i)return We(
|
|
2130
|
-
this.genScopeForFqnRef(e,n,r));const s=i.value.ref;return s?qn(s)?We(this.genUniqueDescedants(()=>s)):Bn(s)?We(this.streamScopeElementRef(s.element)):pn(s)?We(this.genUniqueDescedants(()=>s)):qe(s):bs}*genScopeForFqnRef(e,n,r){yield*this.computeScope(e,r,Ur),yield*this.computeScope(e,r,Yi),qi(n,fv)&&(yield*this.computeScope(e,r,Dr))}*computeScope(e,n,r=this.reflection.getReferenceType(n)){const i=this.reflection.isSubtype(r,Dr),s=this.reflection.isSubtype(r,kp),o=S9(n.container).precomputedScopes;
|
|
2131
|
-
if(!o){yield*this.getProjectScope(e,r,n).getAllElements();return}const a=c=>this.reflection.isSubtype(c.type,r);let u=n.container;for(;u;){const c=o.get(u).filter(a);c.length>0&&(yield*c),s&&S8(u)&&(yield*this.streamScopeExtendDeployment(u.$container)),i&&kC(u)&&(yield*this.streamScopeExtendElement(u.$container)),i&&DC(u)&&(yield*this.streamScopeElementView(u.$container)),u=u.$container}yield*this.getProjectScope(e,r,n).getAllElements()}getProjectScope(e,n,r){return n===Ri?super.getGlobalScope(n,
|
|
2132
|
-
r):this.globalScopeCache.get(`${e}::${n}`,()=>new Ey(this.indexManager.projectElements(e,n)))}getGlobalScope(e,n){if(e===Ri)return super.getGlobalScope(e,n);const r=Sn(n.container);return this.getProjectScope(r,e,n)}}var Nw;(t=>{t.type=new Mt.NotificationType("likec4/onDidChangeModel")})(Nw||(Nw={}));var Iw;(t=>{t.req=new Mt.RequestType("likec4/fetchComputedModel")})(Iw||(Iw={}));var Ow;(t=>{t.req=new Mt.RequestType0("likec4/fetchViewsFromAllProjects")})(Ow||(Ow={}));var Lw;(t=>{t.req=new Mt.RequestType(
|
|
2133
|
-
"likec4/computeView")})(Lw||(Lw={}));var Fw;(t=>{t.req=new Mt.RequestType("likec4/fetchLayoutedModel")})(Fw||(Fw={}));var Mw;(t=>{t.req=new Mt.RequestType("likec4/layout-view")})(Mw||(Mw={}));var Bw;(t=>{t.Req=new Mt.RequestType("likec4/validate-layout")})(Bw||(Bw={}));var qw;(t=>{t.req=new Mt.RequestType0("likec4/fetch-projects")})(qw||(qw={}));var jw;(t=>{t.Req=new Mt.RequestType("likec4/build")})(jw||(jw={}));var Gw;(t=>{t.Req=new Mt.RequestType("likec4/locate")})(Gw||(Gw={}));var Uw;(t=>{t.Req=
|
|
2134
|
-
new Mt.RequestType("likec4/change-view")})(Uw||(Uw={}));var Ww;(t=>{t.req=new Mt.RequestType0("likec4/metrics")})(Ww||(Ww={}));const fr=ot.getChild("rpc");class P9 extends Rw{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,o=this.services.shared.workspace.ProjectsManager;if(!s){fr.info("[ServerRpc] no connection, not in\
|
|
2135
|
-
itializing");return}fr.info("[ServerRpc] init");const a=this.services.shared.workspace.LangiumDocuments,u=this.services.shared.workspace.DocumentBuilder,c=CG(()=>{fr.debug`sendNotification ${"onDidChangeModel"}`,s.sendNotification(Nw.type,"").catch(d=>(fr.warn(`[ServerRpc] error sending onDidChangeModel: ${d}`),Promise.resolve()))},{triggerAt:"end",minQuietPeriodMs:100,maxBurstDurationMs:500,minGapMs:300});let l=!0;this.onDispose(e.onModelParsed(()=>c.call()),s.onRequest(Iw.req,async({projectId:d,
|
|
2136
|
-
cleanCaches:p},h)=>{if(fr.debug`received request ${"fetchComputedModel"} for project ${d}`,p){const b=(d?a.projectDocuments(d):a.all).map(y=>y.uri).toArray();await u.update(b,[],h)}const v=await e.buildLikeC4Model(d,h);return v!==ys.EMPTY?{model:v.$model}:{model:null}}),s.onRequest(Lw.req,async({viewId:d,projectId:p},h)=>({view:await e.computeView(d,p,h)})),s.onRequest(Fw.req,async({projectId:d},p)=>{const h=await e.parseModel(d,p);if(h===null)return{model:null};const v=await i.diagrams(d,p);return{
|
|
2137
|
-
model:{...h,__:"layouted",views:Ju(v,b=>b.id)}}}),s.onRequest(Mw.req,async({viewId:d,projectId:p},h)=>(fr.debug`received request ${"layoutView"} of ${d} from project ${p}`,{result:await i.layoutView(d,p,h)})),s.onRequest(Bw.Req,async({projectId:d},p)=>{const h=await i.layoutAllViews(d,p);return{result:f(h.map(v=>v.diagram))}}),s.onRequest(qw.req,async d=>{fr.debug`received request ${"FetchProjects"}`;const p=a.groupedByProject();return{projects:Yo(p,h=>xt(h,v=>v.uri.toString()))}}),s.onRequest(Ow.
|
|
2138
|
-
req,async d=>{fr.debug`received request ${"FetchViewsFromAllProjects"}`;const p=o.all.map(async v=>{const b=await i.computedViews(v,d);return Xe(b,xt(y=>({id:y.id,title:y.title??y.id,projectId:v})),QR((y,E)=>y.id==="index"?-1:E.id==="index"?1:y.title.localeCompare(E.title)))}),h=await Promise.allSettled(p);return await qt(d),{views:Xe(h,He(v=>v.status==="fulfilled"),ci(v=>v.value))}}),s.onRequest(jw.Req,async({docs:d},p)=>{const h=d.map(y=>Et.parse(y)),v=y=>h.every(E=>!pt.equals(E,y)),b=a.allExcludingBuiltin.
|
|
2139
|
-
toArray().filter(y=>v(y.uri)).map(y=>y.uri);fr.debug(`[ServerRpc] received request to build:
|
|
2140
|
-
changed (total ${h.length}):${d.map(y=>`
|
|
2141
|
-
- `+y).join("")}
|
|
2142
|
-
deleted (total ${b.length}):${b.map(y=>`
|
|
2143
|
-
- `+y.toString()).join(`
|
|
2144
|
-
`)}`),!l&&h.length+b.length>0&&await Promise.allSettled([...h,...b].map(async y=>{const E=y.toString();fr.debug(`clear diagnostics for ${E}`);try{await s.sendDiagnostics({uri:E,diagnostics:[]})}catch(R){fr.warn(`error clearing diagnostics for ${E}: ${R}`)}})),l=!1,await qt(p),await u.update(h,b,p)}),s.onRequest(Gw.Req,d=>{switch(!0){case"element"in d:return n.locateElement(d.element,d.projectId);case"relation"in d:return n.locateRelation(d.relation,d.projectId);case"view"in d:return n.locateView(
|
|
2145
|
-
d.view,d.projectId);case"deployment"in d:return n.locateDeploymentElement(d.deployment,d.projectId);default:qe(d)}}),s.onRequest(Uw.Req,async(d,p)=>(fr.debug`received request ${"changeView"} of ${d.viewId} from project ${d.projectId}`,await r.applyChange(d))),s.onRequest(Ww.req,async d=>{const p=[...o.all].map(async b=>{const y=await e.buildLikeC4Model(b,d);return y===ys.EMPTY?Promise.reject(new Error("Model is empty")):{elementKinds:Xu(y.$model.specification.elements).length,relationshipKinds:Xu(
|
|
2146
|
-
y.$model.specification.relationships).length,tags:y.$model.specification.tags.length,elements:Xu(y.$model.elements).length,relationships:Xu(y.$model.relations).length,views:Xu(y.$model.views).length,projects:1}}),h=await Promise.allSettled(p);await qt(d);const v=h.filter(b=>b.status==="fulfilled").map(b=>b.value);return{metrics:v.length>0?v.reduce((b,y)=>({elementKinds:b.elementKinds+y.elementKinds,relationshipKinds:b.relationshipKinds+y.relationshipKinds,tags:b.tags+y.tags,elements:b.elements+y.
|
|
2147
|
-
elements,relationships:b.relationships+y.relationships,views:b.views+y.views,projects:b.projects+1})):null}}),Bs.create(()=>{c.cancel()}));function f(d){return Xe(d,He(p=>!!p.hasLayoutDrift),xt(p=>({uri:n.locateView(p.id).uri,viewId:p.id,severity:ge.DiagnosticSeverity.Warning,message:`Layout drift detected for view '${p.id}'`,range:n.locateView(p.id).range})))}}}class x9{constructor(e){this.services=e}getSymbolKind(e){const n=Rt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(
|
|
2148
|
-
n,s));switch(!0){case r(Dr,ao,Ur,Yi):return br.Constructor;case r(la,fa,da,ua,ba):return br.Namespace;case r(ro):return br.Class;case r(es,Ri,so,Ea):return br.EnumMember;case r(Zi,va):return br.Event;case r(Di,$i,ga,ha):return br.TypeParameter}return br.Field}getCompletionItemKind(e){const n=Rt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(so):return Pt.Color;case r(Dr,Ur,Yi,ao):return Pt.Constructor;case r(la,fa,da,ua,ba):return Pt.Module;case r(
|
|
2149
|
-
ro):return Pt.Class;case r(es,Ri,so,Ea):return Pt.EnumMember;case r(Zi,va):return Pt.Event;case r(Di,ga,$i,ha):return Pt.TypeParameter;default:return Pt.Reference}}}class N9 extends FT{}const Sa=ot.getChild("Views");class I9{constructor(e){this.services=e,this.ModelBuilder=e.likec4.ModelBuilder}cache=new WeakMap;viewsWithReportedErrors=new Set;ModelBuilder;get layouter(){return this.services.likec4.Layouter}async computedViews(e,n=Mt.CancellationToken.None){const r=await this.ModelBuilder.buildLikeC4Model(
|
|
2150
|
-
e,n);return yp(r.$model.views)}async layoutAllViews(e,n=Mt.CancellationToken.None){const r=await this.computedViews(e,n);if(r.length===0)return[];Sa.debug`layoutAll: ${r.length} views`;const i=[],s=[];for(const o of r)this.viewsWithReportedErrors.delete(o.id),s.push(this.layouter.layout(o).then(a=>(this.viewsWithReportedErrors.delete(o.id),this.cache.set(o,a),a)).catch(a=>(this.cache.delete(o),Re(a),Promise.reject(a))));for(const o of await Promise.allSettled(s))o.status==="fulfilled"&&i.push(o.
|
|
2151
|
-
value);return i.length!==r.length?Sa.warn`layouted ${i.length} of ${r.length} views`:i.length>0&&Sa.debug`layouted all ${i.length} views`,i}async layoutView(e,n,r=Mt.CancellationToken.None){const i=(await this.ModelBuilder.buildLikeC4Model(n,r)).findView(e)?.$view;if(!i)return Sa.warn`layoutView ${e} not found`,null;let s=this.cache.get(i);if(s)return Sa.debug`layout ${e} from cache`,await Promise.resolve(s);try{const o=performance.now(),a=await this.layouter.layout(i);return this.viewsWithReportedErrors.
|
|
2152
|
-
delete(e),this.cache.set(i,a),Sa.debug(`layout {viewId} ready in ${rm(performance.now()-o)}`,{viewId:e}),a}catch(o){if(!this.viewsWithReportedErrors.has(e)){const a=hr(o);this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${a}`),this.viewsWithReportedErrors.add(e),qv(o)}return Promise.reject(o)}}async diagrams(e,n=Mt.CancellationToken.None){return(await this.layoutAllViews(e,n)).map(r=>r.diagram)}async viewsAsGraphvizOut(e,n=Mt.CancellationToken.None){const r="All-LayoutedView\
|
|
2153
|
-
s-DotWithSvg",i=this.services.ValidatedWorkspaceCache;if(i.has(r))return await Promise.resolve(i.get(r));const s=(await this.computedViews(e,n)).map(async u=>{const{dot:c,svg:l}=await this.layouter.svg(u);return{id:u.id,dot:c,svg:l}}),o=[],a=await Promise.allSettled(s);for(const u of a)u.status==="fulfilled"?o.push(u.value):Re(u.reason);return i.set(r,o),o}async overviewGraph(){const e="OverviewGraph",n=this.services.ValidatedWorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.
|
|
2154
|
-
computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const O9={lsp:{NodeKindProvider:t=>new x9(t),WorkspaceSymbolProvider:t=>new N9(t)},workspace:{IndexManager:t=>new Y6(t),LangiumDocuments:t=>new J6(t),ProjectsManager:t=>new Qn(t),WorkspaceManager:t=>new Q6(t)}};function Nt(t){return e=>new t(e)}const L9={documentation:{DocumentationProvider:Nt(z6)},ValidatedWorkspaceCache:t=>new fp(t.shared,je.Validated),Rpc:Nt(P9),likec4:{LanguageServices:Nt(eH),Layouter:t=>(ot.debug(
|
|
2155
|
-
"Creating GraphvizLayouter with GraphvizWasmAdapter"),new hS(new xa)),Views:Nt(I9),DeploymentsIndex:Nt(cH),ModelChanges:Nt(k9),FqnIndex:Nt(bS),ModelParser:Nt(g9),ModelBuilder:Nt($H),ModelLocator:Nt(kH)},lsp:{CompletionProvider:Nt(rH),DocumentHighlightProvider:Nt(iH),DocumentSymbolProvider:Nt(oH),SemanticTokenProvider:Nt(uH),HoverProvider:Nt(aH),CodeLensProvider:Nt(nH),DocumentLinkProvider:Nt(sH),Formatter:Nt(K6)},workspace:{AstNodeDescriptionProvider:Nt(X6)},references:{NameProvider:Nt(T9),ScopeComputation:Nt(
|
|
2156
|
-
A9),ScopeProvider:Nt(_9)}};function F9(t,e,n,r){const i=M9(t),s=[R4({shared:i}),H8,L9,e,n,r].reduce(qS,{}),o=mp(s);return i.ServiceRegistry.register(o),c5(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function M9(t={}){const e={...VR,...t};return mp(T4(e),z8,O9)}function qS(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]=qS(i,r):t[n]=r}}return t}const B9=t=>({
|
|
2157
|
-
start:Li.hrtime.bigint(),command:t.map(e=>q9(p_(e))).join(" "),state:{stdout:"",stderr:"",output:""}}),q9=t=>/[^\w./-]/.test(t)?`'${t.replaceAll("'","'\\''")}'`:t,j9=({stdin:t,stdout:e,stderr:n,stdio:r=[t,e,n],env:i,preferLocal:s,cwd:o=".",...a})=>{const u=o instanceof URL?c_(o):Ii.resolve(o),c=i?{...Li.env,...i}:void 0,l=r[0]?.string;return{...a,input:l,stdio:l===void 0?r:["pipe",...r.slice(1)],env:s?G9(c??Li.env,u):c,cwd:u}},G9=({Path:t="",PATH:e=t,...n},r)=>{const i=e.split(Ii.delimiter),s=jS(
|
|
2158
|
-
[],Ii.resolve(r)).map(o=>Ii.join(o,"node_modules/.bin")).filter(o=>!i.includes(o));return{...n,PATH:[...s,e].filter(Boolean).join(Ii.delimiter)}},jS=(t,e)=>t.at(-1)===e?t:jS([...t,e],Ii.resolve(e,"..")),U9=async(t,e,n)=>await W9(t,n)?[zw(t),e.map(r=>K9(r)),{...n,shell:!0}]:[t,e,n],W9=async(t,{shell:e,cwd:n,env:r=Li.env})=>Li.platform==="win32"&&!e&&!await z9(t,n,r),z9=async(t,e,{Path:n="",PATH:r=n})=>GS.some(i=>t.toLowerCase().endsWith(i))||(H9[`${t}\0${e}\0${r}`]??=await V9(t,e,r)),H9={},V9=async(t,e,n)=>{
|
|
2159
|
-
const r=n.split(Ii.delimiter).filter(Boolean).map(i=>i.replace(/^"(.*)"$/,"$1"));try{await Promise.all(GS.flatMap(i=>[e,...r].map(s=>`${Ii.resolve(s,t)}${i}`)).map(async i=>{try{await z_(i)}catch{return}throw 0}))}catch{return!0}return!1},GS=[".exe",".com"],K9=t=>zw(zw(`"${t.replaceAll(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`)),zw=t=>t.replaceAll(/([()\][%!^"`<>&|;, *?])/g,"^$1"),X9=async(t,{input:e},n)=>{const r=await t;e!==void 0&&r.stdin.end(e);const i=v0(r,"close");try{return await Promise.
|
|
2160
|
-
race([i,...r.stdio.filter(Boolean).map(s=>Y9(s))]),J9(n,WS(r)),zS(n)}catch(s){throw await Promise.allSettled([i]),US(s,r,n)}},Y9=async t=>{for await(const[e]of W_(t,"error"))if(!["ERR_STREAM_PREMATURE_CLOSE","EPIPE"].includes(e?.code))throw e},J9=({command:t},{exitCode:e,signalName:n})=>{if(n!==void 0)throw new Ro(`Command was terminated with ${n}: ${t}`);if(e!==void 0)throw new Ro(`Command failed with exit code ${e}: ${t}`)},US=(t,e,n)=>Object.assign(Q9(t,n),WS(e),zS(n)),Q9=(t,{command:e})=>t instanceof
|
|
2161
|
-
Ro?t:new Ro(`Command failed: ${e}`,{cause:t});class Ro extends Error{name="SubprocessError"}const WS=({exitCode:t,signalCode:e})=>({...t<1?{}:{exitCode:t},...e===null?{}:{signalName:e}}),zS=({state:{stdout:t,stderr:e,output:n},command:r,start:i})=>({stdout:Hw(t),stderr:Hw(e),output:Hw(n),command:r,durationMs:Number(Li.hrtime.bigint()-i)/1e6}),Hw=t=>t.at(-1)===`
|
|
2162
|
-
`?t.slice(0,t.at(-2)==="\r"?-2:-1):t,Z9=async(t,e,n,r)=>{try{[t,e]=["node","node.exe"].includes(t.toLowerCase())?[Li.execPath,[...Li.execArgv.filter(s=>!s.startsWith("--inspect")),...e]]:[t,e];const i=U_(...await U9(t,e,n));return HS(i.stdout,r,"stdout"),HS(i.stderr,r,"stderr"),i.once("error",()=>{}),await v0(i,"spawn"),i}catch(i){throw US(i,{},r)}},HS=(t,{state:e},n)=>{t&&(t.setEncoding("utf8"),e.isIterating||(e.isIterating=!1,t.on("data",r=>{e[n]+=r,e.output+=r})))},eV=async t=>{const[[e,n]]=await Promise.
|
|
2163
|
-
all([Promise.allSettled(t),tV(t)]);if(n.reason)throw n.reason.pipedFrom=e.reason??e.value,n.reason;if(e.reason)throw e.reason;return{...n.value,pipedFrom:e.value}},tV=async t=>{try{const[{stdout:e},{stdin:n}]=await Promise.all(t.map(({nodeChildProcess:r})=>r));if(n===null)throw new Error('The "stdin" option must be set on the first "spawn()" call in the pipeline.');if(e===null)throw new Error('The "stdout" option must be set on the last "spawn()" call in the pipeline.');H_(e,n).catch(()=>{})}catch(e){
|
|
2164
|
-
throw await Promise.allSettled(t.map(({nodeChildProcess:n})=>nV(n))),e}},nV=async t=>{const{stdin:e}=await t;e.end()},VS=async function*(t,{state:e},n){if(e.isIterating===!1)throw new Error(`The subprocess must be iterated right away, for example:
|
|
2165
|
-
for await (const line of spawn(...)) { ... }`);e.isIterating=!0;try{const{[n]:r}=await t.nodeChildProcess;if(!r)return;let i="";for await(const s of r.iterator({destroyOnReturn:!1})){const o=`${i}${s}`.split(/\r?\n/);i=o.pop(),yield*o}i&&(yield i)}finally{await t}},rV=async function*(...t){try{let e=[];for(;t.length>0;){e=t.map((o,a)=>e[a]??iV(o));const[{value:n,done:r},i]=await Promise.race(e.map((o,a)=>Promise.all([o,a]))),[s]=t.splice(i,1);e.splice(i,1),r||(t.push(s),yield n)}}finally{await Promise.
|
|
2166
|
-
all(t.map(e=>e.return()))}},iV=async t=>{try{return await t.next()}catch(e){await t.throw(e)}};function Ld(t,e,n,r){const[i=[],s={}]=Array.isArray(e)?[e,n]:[[],e],o=B9([t,...i]),a=j9(s),u=Z9(t,i,a,o);let c=X9(u,a,o);Object.assign(c,{nodeChildProcess:u}),c=r?eV([r,c]):c;const l=VS(c,o,"stdout"),f=VS(c,o,"stderr");return Object.assign(c,{nodeChildProcess:u,stdout:l,stderr:f,[Symbol.asyncIterator]:()=>rV(l,f),pipe:(d,p,h)=>Ld(d,p,h,c)})}var Ar={},ko={},KS;function sV(){if(KS)return ko;KS=1,Object.defineProperty(
|
|
2167
|
-
ko,"__esModule",{value:!0}),ko.sync=ko.isexe=void 0;const t=Na,e=w0,n=async(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return i(await(0,e.stat)(o),a)}catch(c){const l=c;if(u||l.code==="EACCES")return!1;throw l}};ko.isexe=n;const r=(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return i((0,t.statSync)(o),a)}catch(c){const l=c;if(u||l.code==="EACCES")return!1;throw l}};ko.sync=r;const i=(o,a)=>o.isFile()&&s(o,a),s=(o,a)=>{const u=a.uid??process.getuid?.(),c=a.groups??process.getgroups?.()??[],l=a.gid??process.
|
|
2168
|
-
getgid?.()??c[0];if(u===void 0||l===void 0)throw new Error("cannot get uid or gid");const f=new Set([l,...c]),d=o.mode,p=o.uid,h=o.gid,v=parseInt("100",8),b=parseInt("010",8),y=parseInt("001",8),E=v|b;return!!(d&y||d&b&&f.has(h)||d&v&&p===u||d&E&&u===0)};return ko}var To={},XS;function oV(){if(XS)return To;XS=1,Object.defineProperty(To,"__esModule",{value:!0}),To.sync=To.isexe=void 0;const t=Na,e=w0,n=async(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return s(await(0,e.stat)(o),o,a)}catch(c){const l=c;
|
|
2169
|
-
if(u||l.code==="EACCES")return!1;throw l}};To.isexe=n;const r=(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return s((0,t.statSync)(o),o,a)}catch(c){const l=c;if(u||l.code==="EACCES")return!1;throw l}};To.sync=r;const i=(o,a)=>{const{pathExt:u=process.env.PATHEXT||""}=a,c=u.split(";");if(c.indexOf("")!==-1)return!0;for(let l=0;l<c.length;l++){const f=c[l].toLowerCase(),d=o.substring(o.length-f.length).toLowerCase();if(f&&d===f)return!0}return!1},s=(o,a,u)=>o.isFile()&&i(a,u);return To}var Vw={},YS;function aV(){
|
|
2170
|
-
return YS||(YS=1,Object.defineProperty(Vw,"__esModule",{value:!0})),Vw}var JS;function uV(){return JS||(JS=1,function(t){var e=Ar&&Ar.__createBinding||(Object.create?function(c,l,f,d){d===void 0&&(d=f);var p=Object.getOwnPropertyDescriptor(l,f);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[f]}}),Object.defineProperty(c,d,p)}:function(c,l,f,d){d===void 0&&(d=f),c[d]=l[f]}),n=Ar&&Ar.__setModuleDefault||(Object.create?function(c,l){Object.defineProperty(
|
|
2171
|
-
c,"default",{enumerable:!0,value:l})}:function(c,l){c.default=l}),r=Ar&&Ar.__importStar||function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var f in c)f!=="default"&&Object.prototype.hasOwnProperty.call(c,f)&&e(l,c,f);return n(l,c),l},i=Ar&&Ar.__exportStar||function(c,l){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(l,f)&&e(l,c,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=t.posix=t.win32=void 0;const s=r(sV());t.posix=s;const o=r(oV());t.
|
|
2172
|
-
win32=o,i(aV(),t);const u=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?o:s;t.isexe=u.isexe,t.sync=u.sync}(Ar)),Ar}var Kw,QS;function cV(){if(QS)return Kw;QS=1;const{isexe:t,sync:e}=uV(),{join:n,delimiter:r,sep:i,posix:s}=Oi,o=process.platform==="win32",a=new RegExp(`[${s.sep}${i===s.sep?"":i}]`.replace(/(\\)/g,"\\$1")),u=new RegExp(`^\\.${a.source}`),c=h=>Object.assign(new Error(`not found: ${h}`),{code:"ENOENT"}),l=(h,{path:v=process.env.PATH,pathExt:b=process.env.PATHEXT,delimiter:y=r})=>{
|
|
2173
|
-
const E=h.match(a)?[""]:[...o?[process.cwd()]:[],...(v||"").split(y)];if(o){const R=b||[".EXE",".CMD",".BAT",".COM"].join(y),A=R.split(y).flatMap(N=>[N,N.toLowerCase()]);return h.includes(".")&&A[0]!==""&&A.unshift(""),{pathEnv:E,pathExt:A,pathExtExe:R}}return{pathEnv:E,pathExt:[""]}},f=(h,v)=>{const b=/^".*"$/.test(h)?h.slice(1,-1):h;return(!b&&u.test(v)?v.slice(0,2):"")+n(b,v)},d=async(h,v={})=>{const{pathEnv:b,pathExt:y,pathExtExe:E}=l(h,v),R=[];for(const A of b){const N=f(A,h);for(const K of y){
|
|
2174
|
-
const J=N+K;if(await t(J,{pathExt:E,ignoreErrors:!0})){if(!v.all)return J;R.push(J)}}}if(v.all&&R.length)return R;if(v.nothrow)return null;throw c(h)},p=(h,v={})=>{const{pathEnv:b,pathExt:y,pathExtExe:E}=l(h,v),R=[];for(const A of b){const N=f(A,h);for(const K of y){const J=N+K;if(e(J,{pathExt:E,ignoreErrors:!0})){if(!v.all)return J;R.push(J)}}}if(v.all&&R.length)return R;if(v.nothrow)return null;throw c(h)};return Kw=d,d.sync=p,Kw}var lV=cV();const ZS=Fi(lV),Xw=mS(Math.max(1,V_.cpus().length));
|
|
2175
|
-
class dV{dotpath;unflattenpath;constructor(e){this.dotpath=e||ZS.sync("dot"),this.unflattenpath=ZS.sync("unflatten")}async unflatten(e){return await Xw(async()=>{const n=vn.getChild("graphviz-binary");let r;try{const i=await Ld(this.unflattenpath,["-l 1","-c 3"],{timeout:1e4,stdin:{string:e}});r=i.stdout,jt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){n.error("FAILED GraphvizBinaryAdapter.unflatten",{error:i}),i instanceof Ro&&!jt(i.stdout)&&(n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.
|
|
2176
|
-
exitCode}): "${i.stderr}"`,r=i.stdout)}return r&&(e=r.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await Xw(async()=>{const n=vn.getChild("graphviz-binary");let r;try{const i=await Ld(this.dotpath,["-Tjson","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,jt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){if(n.error("FAILED GraphvizBinaryAdapter.layoutJson",{error:i}),n.warn(`FAILED DOT:
|
|
2177
|
-
${e}`),i instanceof Ro&&!jt(i.stdout))n.warn(`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`),r=i.stdout;else throw i}return r})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await Xw(async()=>{const n=vn.getChild("graphviz-binary");let r;try{const i=await Ld(this.dotpath,["-Tsvg","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,jt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){
|
|
2178
|
-
if(n.error("FAILED GraphvizBinaryAdapter.svg",{error:i}),n.warn(`FAILED DOT:
|
|
2179
|
-
${e}`),i instanceof Ro&&!jt(i.stdout))n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`,r=i.stdout;else throw i}return r})}}const fV="likec4",e_="1.27.2",Yw=vn.getChild("cli");Gt.bold(Gt.bgRed(Gt.white("ERROR"))),Gt.bold(Gt.yellow("WARN")),Gt.bold(Gt.green("INFO"));function t_(t){const e=vn.getChild(t);return{info(n){e.info(n)},warn(n){if(n instanceof Error){e.warn(`${Gt.red(n.name+" "+n.message)}`,{msg:n});return}if(typeof n=="string"){e.warn(
|
|
2180
|
-
n);return}e.warn`${n}`},warnOnce(n){e.warn(n)},error(n,r){let i=r?.error??n;if(i instanceof Error){if(n===i){e.error(`${Gt.red(i.name+" "+i.message)}`,{error:i});return}e.error(`${n}`,{error:i});return}if(typeof n=="string"){e.error(`${Gt.red(n)}`);return}e.error`${n}`},clearScreen:function(n){},hasErrorLogged:function(n){throw new Error("Function not implemented.")},hasWarned:!1}}const Jw=()=>{},pV={info:Jw,warn:Jw,error:Jw},hV=1e6;function n_(t){const[e,n]=y0(t),r=e*1e3+n/hV;return{ms:r,pretty:rm(
|
|
2181
|
-
r)}}function mV(t){const e=y0();return{stopAndLog(n="done in "){n=Gt.green(`${n}${n_(e).pretty}`),(t||Yw).info(n)}}}function gV(t,e){console.log(G_(t,{padding:1,margin:1,dimBorder:!0,...e}))}class yV{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(`${Gt.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,
|
|
2182
|
-
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;this.services.likec4.ModelBuilder;const n=this.services.shared.workspace.LangiumDocuments,r=this.services.shared.workspace.DocumentBuilder,i=n.all.toArray(),s=i.filter(o=>!vd(o.uri));if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${Gt.dim("w\
|
|
2183
|
-
orkspace:")} found ${s.length} source files`),s.length>1?await r.update(s.map(o=>o.uri),[],void 0):await r.build(i,{validation:!0})}}function vV(t){return e=>new t(e)}const wV={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:vV(yV)}};function r_(t){const e=Tm(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=pV;break;case"vite":n=t_("lang");break;case"default":n=Yw.getChild(
|
|
2184
|
-
"lang");break;default:n=e.logger;break}const r=e.graphviz==="binary";n.info(`${Gt.dim("version")} ${e_}`),n.info(`${Gt.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new hS(r===!0?new dV:new xa)}};return F9(e.useFileSystem?OU:{},wV,i).likec4}const i_=t=>new Error(`Invalid model:
|
|
2185
|
-
${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
|
|
2186
|
-
`)}`);class as{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=r_(Tm(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Et.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=pt.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new as(
|
|
2187
|
-
i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject(i_(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=a_(e);if(!o_(r))throw new Error(`Workspace not found: ${r}`);let i=as.likec4Instances.get(r);if(!i){const s=r_(Tm(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:l_(r).toString(),name:u_(r)}),await s.cli.Workspace.init(),i=new as(r,s,n?.printErrors??!0),as.likec4Instances.
|
|
2188
|
-
set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(i_(i))):i}logger;get languageServices(){return this.langium.likec4.LanguageServices}get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}ensureSingleProject(){const e=this.langium.likec4.LanguageServices.projects();if(e.length>1)throw this.logger.error(`Multiple projects found:
|
|
2189
|
-
${e.map(n=>` - ${n.folder.fsPath}`).join(`
|
|
2190
|
-
`)}
|
|
2191
|
-
|
|
2192
|
-
${Gt.red("Please specify a project folder")}
|
|
2193
|
-
`),new Error("Multiple projects found")}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(e){const n=this.langium.shared.workspace.ProjectsManager.ensureProjectId(e);return this.langium.likec4.ModelBuilder.unsafeSyncBuildModel(n)}async projects(){const e=this.langium.shared.workspace.ProjectsManager.defaultProjectId;if(e)return[e];const n=(await Promise.allSettled(this.langium.shared.workspace.ProjectsManager.all.map(async r=>await this.langium.likec4.ModelBuilder.
|
|
2194
|
-
parseModel(r)?r:void 0))).filter(r=>r.status==="fulfilled").flatMap(r=>r.value??[]);return jr(n,1)?n:["default"]}async layoutedModel(e){const n=this.langium.shared.workspace.ProjectsManager.ensureProjectId(e),r=await this.langium.likec4.ModelBuilder.parseModel(n);if(!r)throw new Error("Failed to parse model");const i=await this.viewsService.diagrams(n);return K_.create({...r,__:"layouted",views:Ju(i,ui("id"))})}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).
|
|
2195
|
-
filter(n=>n.severity===xs.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===xs.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 o=s.range.start.line,a=s.message.split(`
|
|
2196
|
-
`);return a.length>10&&(a.length=10,a.push("...")),a.map((u,c)=>c===0?" "+Gt.dim(`Line ${o}: `)+Gt.red(u):" ".repeat(10)+Gt.red(u))}).join(`
|
|
2197
|
-
`);this.logger.error(`Invalid ${n.uri.fsPath}
|
|
2198
|
-
${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){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?[Et.file(e)]:[],n?[Et.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(hr(i)),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of as.likec4Instances)n===this&&as.likec4Instances.
|
|
2199
|
-
delete(e)}}export{fV as A,jt as B,Xe as C,Ld as D,e_ as E,Yw as F,hr as G,mV as H,CS as I,jr as J,g1 as K,as as L,Rb as N,_o as T,ib as Y,Xo as a,He as b,ce as c,eA as d,Qo as e,No as f,lt as g,t_ as h,Rt as i,iU as j,tk as k,Gr as l,xt as m,Tt as n,vn as o,ui as p,Fi as q,lo as r,eU as s,Py as t,Gt as u,gV as v,XC as w,ik as x,n_ as y,eP as z};
|