@likec4/mcp 1.48.0 → 1.49.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.
@@ -0,0 +1 @@
1
+ const e={tomato1:`#fffcfc`,tomato2:`#fff8f7`,tomato3:`#feebe7`,tomato4:`#ffdcd3`,tomato5:`#ffcdc2`,tomato6:`#fdbdaf`,tomato7:`#f5a898`,tomato8:`#ec8e7b`,tomato9:`#e54d2e`,tomato10:`#dd4425`,tomato11:`#d13415`,tomato12:`#5c271f`},t={red1:`#fffcfc`,red2:`#fff7f7`,red3:`#feebec`,red4:`#ffdbdc`,red5:`#ffcdce`,red6:`#fdbdbe`,red7:`#f4a9aa`,red8:`#eb8e90`,red9:`#e5484d`,red10:`#dc3e42`,red11:`#ce2c31`,red12:`#641723`},n={ruby1:`#fffcfd`,ruby2:`#fff7f8`,ruby3:`#feeaed`,ruby4:`#ffdce1`,ruby5:`#ffced6`,ruby6:`#f8bfc8`,ruby7:`#efacb8`,ruby8:`#e592a3`,ruby9:`#e54666`,ruby10:`#dc3b5d`,ruby11:`#ca244d`,ruby12:`#64172b`},r={crimson1:`#fffcfd`,crimson2:`#fef7f9`,crimson3:`#ffe9f0`,crimson4:`#fedce7`,crimson5:`#facedd`,crimson6:`#f3bed1`,crimson7:`#eaacc3`,crimson8:`#e093b2`,crimson9:`#e93d82`,crimson10:`#df3478`,crimson11:`#cb1d63`,crimson12:`#621639`},i={pink1:`#fffcfe`,pink2:`#fef7fb`,pink3:`#fee9f5`,pink4:`#fbdcef`,pink5:`#f6cee7`,pink6:`#efbfdd`,pink7:`#e7acd0`,pink8:`#dd93c2`,pink9:`#d6409f`,pink10:`#cf3897`,pink11:`#c2298a`,pink12:`#651249`},a={purple1:`#fefcfe`,purple2:`#fbf7fe`,purple3:`#f7edfe`,purple4:`#f2e2fc`,purple5:`#ead5f9`,purple6:`#e0c4f4`,purple7:`#d1afec`,purple8:`#be93e4`,purple9:`#8e4ec6`,purple10:`#8347b9`,purple11:`#8145b5`,purple12:`#402060`},o={violet1:`#fdfcfe`,violet2:`#faf8ff`,violet3:`#f4f0fe`,violet4:`#ebe4ff`,violet5:`#e1d9ff`,violet6:`#d4cafe`,violet7:`#c2b5f5`,violet8:`#aa99ec`,violet9:`#6e56cf`,violet10:`#654dc4`,violet11:`#6550b9`,violet12:`#2f265f`},s={indigo1:`#fdfdfe`,indigo2:`#f7f9ff`,indigo3:`#edf2fe`,indigo4:`#e1e9ff`,indigo5:`#d2deff`,indigo6:`#c1d0ff`,indigo7:`#abbdf9`,indigo8:`#8da4ef`,indigo9:`#3e63dd`,indigo10:`#3358d4`,indigo11:`#3a5bc7`,indigo12:`#1f2d5c`},c={blue1:`#fbfdff`,blue2:`#f4faff`,blue3:`#e6f4fe`,blue4:`#d5efff`,blue5:`#c2e5ff`,blue6:`#acd8fc`,blue7:`#8ec8f6`,blue8:`#5eb1ef`,blue9:`#0090ff`,blue10:`#0588f0`,blue11:`#0d74ce`,blue12:`#113264`},l={teal1:`#fafefd`,teal2:`#f3fbf9`,teal3:`#e0f8f3`,teal4:`#ccf3ea`,teal5:`#b8eae0`,teal6:`#a1ded2`,teal7:`#83cdc1`,teal8:`#53b9ab`,teal9:`#12a594`,teal10:`#0d9b8a`,teal11:`#008573`,teal12:`#0d3d38`},u={grass1:`#fbfefb`,grass2:`#f5fbf5`,grass3:`#e9f6e9`,grass4:`#daf1db`,grass5:`#c9e8ca`,grass6:`#b2ddb5`,grass7:`#94ce9a`,grass8:`#65ba74`,grass9:`#46a758`,grass10:`#3e9b4f`,grass11:`#2a7e3b`,grass12:`#203c25`},d={lime1:`#fcfdfa`,lime2:`#f8faf3`,lime3:`#eef6d6`,lime4:`#e2f0bd`,lime5:`#d3e7a6`,lime6:`#c2da91`,lime7:`#abc978`,lime8:`#8db654`,lime9:`#bdee63`,lime10:`#b0e64c`,lime11:`#5c7c2f`,lime12:`#37401c`},f={yellow1:`#fdfdf9`,yellow2:`#fefce9`,yellow3:`#fffab8`,yellow4:`#fff394`,yellow5:`#ffe770`,yellow6:`#f3d768`,yellow7:`#e4c767`,yellow8:`#d5ae39`,yellow9:`#ffe629`,yellow10:`#ffdc00`,yellow11:`#9e6c00`,yellow12:`#473b1f`},p={amber1:`#fefdfb`,amber2:`#fefbe9`,amber3:`#fff7c2`,amber4:`#ffee9c`,amber5:`#fbe577`,amber6:`#f3d673`,amber7:`#e9c162`,amber8:`#e2a336`,amber9:`#ffc53d`,amber10:`#ffba18`,amber11:`#ab6400`,amber12:`#4f3422`},m={orange1:`#fefcfb`,orange2:`#fff7ed`,orange3:`#ffefd6`,orange4:`#ffdfb5`,orange5:`#ffd19a`,orange6:`#ffc182`,orange7:`#f5ae73`,orange8:`#ec9455`,orange9:`#f76b15`,orange10:`#ef5f00`,orange11:`#cc4e00`,orange12:`#582d1d`};export{s as a,i as c,n as d,l as f,f as h,u as i,a as l,o as m,c as n,d as o,e as p,r,m as s,p as t,t as u};
@@ -1,2 +1,2 @@
1
- import{C as e,D as t,T as n,c as r,d as i,f as a,h as o,ht as s,l as c,o as l,p as u,u as d,ut as f}from"./@chevrotain/gast.mjs";import{c as ee,d as p,f as m,g as h,h as g,i as _,m as v,p as te,r as ne,s as re}from"./chevrotain.mjs";function ie(e,t){return e<t}var ae=ie;function oe(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(c===void 0?o===o&&!s(o):n(o,c)))var c=o,l=a}return l}var se=oe;function ce(e){return e&&e.length?se(e,f,ae):void 0}var le=ce;function ue(e,n){return e&&e.length?p(e,t(n,2)):[]}var y=ue;function b(e,t,n){return`${e.name}_${t}_${n}`}var x=class{constructor(e){this.target=e}isEpsilon(){return!1}},S=class extends x{constructor(e,t){super(e),this.tokenType=t}},C=class extends x{constructor(e){super(e)}isEpsilon(){return!0}},w=class extends x{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}};function de(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};fe(t,e);let n=e.length;for(let r=0;r<n;r++){let n=e[r],i=k(t,n,n);i!==void 0&&ge(t,n,i)}return t}function fe(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r],i=B(e,n,void 0,{type:2}),a=B(e,n,void 0,{type:7});i.stop=a,e.ruleToStartState.set(n,i),e.ruleToStopState.set(n,a)}}function T(e,t,n){return n instanceof o?L(e,t,n.terminalType,n):n instanceof r?R(e,t,n):n instanceof l?D(e,t,n):n instanceof c?O(e,t,n):n instanceof d?pe(e,t,n):n instanceof u?me(e,t,n):n instanceof i?he(e,t,n):n instanceof a?E(e,t,n):k(e,t,n)}function pe(e,t,n){let r=B(e,t,n,{type:5});return N(e,r),j(e,t,n,P(e,t,r,n,k(e,t,n)))}function me(e,t,n){let r=B(e,t,n,{type:5});return N(e,r),j(e,t,n,P(e,t,r,n,k(e,t,n)),L(e,t,n.separator,n))}function he(e,t,n){let r=B(e,t,n,{type:4});return N(e,r),A(e,t,n,P(e,t,r,n,k(e,t,n)))}function E(e,t,n){let r=B(e,t,n,{type:4});return N(e,r),A(e,t,n,P(e,t,r,n,k(e,t,n)),L(e,t,n.separator,n))}function D(t,n,r){let i=B(t,n,r,{type:1});return N(t,i),P(t,n,i,r,...e(r.definition,e=>T(t,n,e)))}function O(e,t,n){let r=B(e,t,n,{type:1});return N(e,r),M(e,t,n,P(e,t,r,n,k(e,t,n)))}function k(t,n,r){let i=g(e(r.definition,e=>T(t,n,e)),e=>e!==void 0);return i.length===1?i[0]:i.length===0?void 0:I(t,i)}function A(e,t,n,r,i){let a=r.left,o=r.right,s=B(e,t,n,{type:11});N(e,s);let c=B(e,t,n,{type:12});return a.loopback=s,c.loopback=s,e.decisionMap[b(t,i?`RepetitionMandatoryWithSeparator`:`RepetitionMandatory`,n.idx)]=s,z(o,s),i===void 0?(z(s,a),z(s,c)):(z(s,c),z(s,i.left),z(i.right,a)),{left:a,right:c}}function j(e,t,n,r,i){let a=r.left,o=r.right,s=B(e,t,n,{type:10});N(e,s);let c=B(e,t,n,{type:12}),l=B(e,t,n,{type:9});return s.loopback=l,c.loopback=l,z(s,a),z(s,c),z(o,l),i===void 0?z(l,s):(z(l,c),z(l,i.left),z(i.right,a)),e.decisionMap[b(t,i?`RepetitionWithSeparator`:`Repetition`,n.idx)]=s,{left:s,right:c}}function M(e,t,n,r){let i=r.left,a=r.right;return z(i,a),e.decisionMap[b(t,`Option`,n.idx)]=i,r}function N(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function P(e,t,n,r,...i){let a=B(e,t,r,{type:8,start:n});n.end=a;for(let e of i)e===void 0?z(n,a):(z(n,e.left),z(e.right,a));let o={left:n,right:a};return e.decisionMap[b(t,F(r),r.idx)]=n,o}function F(e){if(e instanceof l)return`Alternation`;if(e instanceof c)return`Option`;if(e instanceof d)return`Repetition`;if(e instanceof u)return`RepetitionWithSeparator`;if(e instanceof i)return`RepetitionMandatory`;if(e instanceof a)return`RepetitionMandatoryWithSeparator`;throw Error(`Invalid production type encountered`)}function I(e,t){let n=t.length;for(let r=0;r<n-1;r++){let n=t[r],i;n.left.transitions.length===1&&(i=n.left.transitions[0]);let a=i instanceof w,o=i,s=t[r+1].left;n.left.type===1&&n.right.type===1&&i!==void 0&&(a&&o.followState===n.right||i.target===n.right)?(a?o.followState=s:i.target=s,_e(e,n.right)):z(n.right,s)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function L(e,t,n,r){let i=B(e,t,r,{type:1}),a=B(e,t,r,{type:1});return V(i,new S(a,n)),{left:i,right:a}}function R(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),a=B(e,t,n,{type:1}),o=B(e,t,n,{type:1});return V(a,new w(i,r,o)),{left:a,right:o}}function ge(e,t,n){let r=e.ruleToStartState.get(t);z(r,n.left);let i=e.ruleToStopState.get(t);return z(n.right,i),{left:r,right:i}}function z(e,t){V(e,new C(t))}function B(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function V(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function _e(e,t){e.states.splice(e.states.indexOf(t),1)}const H={};var U=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=W(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return e(this.configs,e=>e.alt)}get key(){let e=``;for(let t in this.map)e+=t+`:`;return e}};function W(e,t=!0){return`${t?`a${e.alt}`:``}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join(`_`)}`}function ve(e,t){let n={};return r=>{let i=r.toString(),a=n[i];return a===void 0?(a={atnStartState:e,decision:t,states:{}},n[i]=a,a):a}}var G=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e=``,t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?`1`:`0`;return e}};const K=new G;var ye=class extends ne{constructor(e){super(),this.logging=e?.logging??(e=>console.log(e))}initialize(e){this.atn=de(e.rules),this.dfas=be(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:r,rule:i,hasPredicates:a,dynamicTokensEnabled:o}=t,s=this.dfas,c=this.logging,l=b(i,`Alternation`,r),u=this.atn.decisionMap[l].decision,d=e(_({maxLookahead:1,occurrence:r,prodType:`Alternation`,rule:i}),t=>e(t,e=>e[0]));if(q(d,!1)&&!o){let e=m(d,(e,t,r)=>(n(t,t=>{t&&(e[t.tokenTypeIdx]=r,n(t.categoryMatches,t=>{e[t]=r}))}),e),{});return a?function(t){let n=e[this.LA(1).tokenTypeIdx];if(t!==void 0&&n!==void 0){let e=t[n]?.GATE;if(e!==void 0&&e.call(this)===!1)return}return n}:function(){return e[this.LA(1).tokenTypeIdx]}}else if(a)return function(e){let t=new G,n=e===void 0?0:e.length;for(let r=0;r<n;r++){let n=e?.[r].GATE;t.set(r,n===void 0||n.call(this))}let r=J.call(this,s,u,t,c);return typeof r==`number`?r:void 0};else return function(){let e=J.call(this,s,u,K,c);return typeof e==`number`?e:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:r,rule:i,prodType:a,dynamicTokensEnabled:o}=t,s=this.dfas,c=this.logging,l=b(i,a,r),u=this.atn.decisionMap[l].decision,d=e(_({maxLookahead:1,occurrence:r,prodType:a,rule:i}),t=>e(t,e=>e[0]));if(q(d)&&d[0][0]&&!o){let e=d[0],t=h(e);if(t.length===1&&te(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=m(t,(e,t)=>(t!==void 0&&(e[t.tokenTypeIdx]=!0,n(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}return function(){let e=J.call(this,s,u,K,c);return typeof e==`object`?!1:e===0}}};function q(e,t=!0){let n=new Set;for(let r of e){let e=new Set;for(let i of r){if(i===void 0){if(t)break;return!1}let r=[i.tokenTypeIdx].concat(i.categoryMatches);for(let t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function be(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=ve(e.decisionStates[r],r);return n}function J(e,t,n,r){let i=e[t](n),a=i.start;return a===void 0&&(a=Z(i,Y(je(i.atnStartState))),i.start=a),xe.apply(this,[i,a,n,r])}function xe(e,t,n,r){let i=t,a=1,o=[],s=this.LA(a++);for(;;){let t=De(i,s);if(t===void 0&&(t=Se.apply(this,[e,i,s,a,n,r])),t===H)return Ee(o,i,s);if(t.isAcceptState===!0)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function Se(e,t,n,r,i,a){let o=Oe(t.configs,n,i);if(o.size===0)return X(e,t,n,H),H;let s=Y(o),c=Ae(o,i);if(c!==void 0)s.isAcceptState=!0,s.prediction=c,s.configs.uniqueAlt=c;else if($(o)){let t=le(o.alts);s.isAcceptState=!0,s.prediction=t,s.configs.uniqueAlt=t,Ce.apply(this,[e,r,o.alts,a])}return s=X(e,t,n,s),s}function Ce(e,t,n,r){let i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);let a=e.atnStartState,o=a.rule,s=a.production;r(we({topLevelRule:o,ambiguityIndices:n,production:s,prefixPath:i}))}function we(t){let n=e(t.prefixPath,e=>re(e)).join(`, `),r=t.production.idx===0?``:t.production.idx,i=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(`, `)}> in <${Te(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,\n<${n}> may appears as a prefix path in all these alternatives.\n`;return i+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
2
- For Further details.`,i}function Te(e){if(e instanceof r)return`SUBRULE`;if(e instanceof c)return`OPTION`;if(e instanceof l)return`OR`;if(e instanceof i)return`AT_LEAST_ONE`;if(e instanceof a)return`AT_LEAST_ONE_SEP`;if(e instanceof u)return`MANY_SEP`;if(e instanceof d)return`MANY`;if(e instanceof o)return`CONSUME`;throw Error(`non exhaustive match`)}function Ee(e,t,n){return{actualToken:n,possibleTokenTypes:y(v(t.configs.elements,e=>e.state.transitions).filter(e=>e instanceof S).map(e=>e.tokenType),e=>e.tokenTypeIdx),tokenPath:e}}function De(e,t){return e.edges[t.tokenTypeIdx]}function Oe(e,t,n){let r=new U,i=[];for(let a of e.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===7){i.push(a);continue}let e=a.state.transitions.length;for(let n=0;n<e;n++){let e=a.state.transitions[n],i=ke(e,t);i!==void 0&&r.add({state:i,alt:a.alt,stack:a.stack})}}let a;if(i.length===0&&r.size===1&&(a=r),a===void 0){a=new U;for(let e of r.elements)Q(e,a)}if(i.length>0&&!Ne(a))for(let e of i)a.add(e);return a}function ke(e,t){if(e instanceof S&&ee(t,e.tokenType))return e.target}function Ae(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Y(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function X(e,t,n,r){return r=Z(e,r),t.edges[n.tokenTypeIdx]=r,r}function Z(e,t){if(t===H)return t;let n=t.configs.key,r=e.states[n];return r===void 0?(t.configs.finalize(),e.states[n]=t,t):r}function je(e){let t=new U,n=e.transitions.length;for(let r=0;r<n;r++)Q({state:e.transitions[r].target,alt:r,stack:[]},t);return t}function Q(e,t){let n=e.state;if(n.type===7){if(e.stack.length>0){let n=[...e.stack];Q({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let r=n.transitions[i],a=Me(e,r);a!==void 0&&Q(a,t)}}function Me(e,t){if(t instanceof C)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof w){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function Ne(e){for(let t of e.elements)if(t.state.type===7)return!0;return!1}function Pe(e){for(let t of e.elements)if(t.state.type!==7)return!1;return!0}function $(e){if(Pe(e))return!0;let t=Fe(e.elements);return Ie(t)&&!Le(t)}function Fe(e){let t=new Map;for(let n of e){let e=W(n,!1),r=t.get(e);r===void 0&&(r={},t.set(e,r)),r[n.alt]=!0}return t}function Ie(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function Le(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}export{ye as t};
1
+ import{C as e,D as t,T as n,c as r,d as i,f as a,h as o,ht as s,l as c,o as l,p as u,u as d,ut as f}from"./@chevrotain/gast.mjs";import{c as ee,d as p,f as m,g as te,h as ne,i as h,m as re,p as ie,r as g,s as _}from"./chevrotain.mjs";function v(e,t){return e<t}function y(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(c===void 0?o===o&&!s(o):n(o,c)))var c=o,l=a}return l}function b(e){return e&&e.length?y(e,f,v):void 0}function x(e,n){return e&&e.length?p(e,t(n,2)):[]}function S(e,t,n){return`${e.name}_${t}_${n}`}var C=class{constructor(e){this.target=e}isEpsilon(){return!1}},w=class extends C{constructor(e,t){super(e),this.tokenType=t}},T=class extends C{constructor(e){super(e)}isEpsilon(){return!0}},E=class extends C{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}};function ae(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};oe(t,e);let n=e.length;for(let r=0;r<n;r++){let n=e[r],i=O(t,n,n);i!==void 0&&R(t,n,i)}return t}function oe(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r],i=B(e,n,void 0,{type:2}),a=B(e,n,void 0,{type:7});i.stop=a,e.ruleToStartState.set(n,i),e.ruleToStopState.set(n,a)}}function D(e,t,n){return n instanceof o?I(e,t,n.terminalType,n):n instanceof r?L(e,t,n):n instanceof l?de(e,t,n):n instanceof c?fe(e,t,n):n instanceof d?se(e,t,n):n instanceof u?ce(e,t,n):n instanceof i?le(e,t,n):n instanceof a?ue(e,t,n):O(e,t,n)}function se(e,t,n){let r=B(e,t,n,{type:5});return M(e,r),A(e,t,n,N(e,t,r,n,O(e,t,n)))}function ce(e,t,n){let r=B(e,t,n,{type:5});return M(e,r),A(e,t,n,N(e,t,r,n,O(e,t,n)),I(e,t,n.separator,n))}function le(e,t,n){let r=B(e,t,n,{type:4});return M(e,r),k(e,t,n,N(e,t,r,n,O(e,t,n)))}function ue(e,t,n){let r=B(e,t,n,{type:4});return M(e,r),k(e,t,n,N(e,t,r,n,O(e,t,n)),I(e,t,n.separator,n))}function de(t,n,r){let i=B(t,n,r,{type:1});return M(t,i),N(t,n,i,r,...e(r.definition,e=>D(t,n,e)))}function fe(e,t,n){let r=B(e,t,n,{type:1});return M(e,r),j(e,t,n,N(e,t,r,n,O(e,t,n)))}function O(t,n,r){let i=ne(e(r.definition,e=>D(t,n,e)),e=>e!==void 0);return i.length===1?i[0]:i.length===0?void 0:F(t,i)}function k(e,t,n,r,i){let a=r.left,o=r.right,s=B(e,t,n,{type:11});M(e,s);let c=B(e,t,n,{type:12});return a.loopback=s,c.loopback=s,e.decisionMap[S(t,i?`RepetitionMandatoryWithSeparator`:`RepetitionMandatory`,n.idx)]=s,z(o,s),i===void 0?(z(s,a),z(s,c)):(z(s,c),z(s,i.left),z(i.right,a)),{left:a,right:c}}function A(e,t,n,r,i){let a=r.left,o=r.right,s=B(e,t,n,{type:10});M(e,s);let c=B(e,t,n,{type:12}),l=B(e,t,n,{type:9});return s.loopback=l,c.loopback=l,z(s,a),z(s,c),z(o,l),i===void 0?z(l,s):(z(l,c),z(l,i.left),z(i.right,a)),e.decisionMap[S(t,i?`RepetitionWithSeparator`:`Repetition`,n.idx)]=s,{left:s,right:c}}function j(e,t,n,r){let i=r.left,a=r.right;return z(i,a),e.decisionMap[S(t,`Option`,n.idx)]=i,r}function M(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function N(e,t,n,r,...i){let a=B(e,t,r,{type:8,start:n});n.end=a;for(let e of i)e===void 0?z(n,a):(z(n,e.left),z(e.right,a));let o={left:n,right:a};return e.decisionMap[S(t,P(r),r.idx)]=n,o}function P(e){if(e instanceof l)return`Alternation`;if(e instanceof c)return`Option`;if(e instanceof d)return`Repetition`;if(e instanceof u)return`RepetitionWithSeparator`;if(e instanceof i)return`RepetitionMandatory`;if(e instanceof a)return`RepetitionMandatoryWithSeparator`;throw Error(`Invalid production type encountered`)}function F(e,t){let n=t.length;for(let r=0;r<n-1;r++){let n=t[r],i;n.left.transitions.length===1&&(i=n.left.transitions[0]);let a=i instanceof E,o=i,s=t[r+1].left;n.left.type===1&&n.right.type===1&&i!==void 0&&(a&&o.followState===n.right||i.target===n.right)?(a?o.followState=s:i.target=s,pe(e,n.right)):z(n.right,s)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function I(e,t,n,r){let i=B(e,t,r,{type:1}),a=B(e,t,r,{type:1});return V(i,new w(a,n)),{left:i,right:a}}function L(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),a=B(e,t,n,{type:1}),o=B(e,t,n,{type:1});return V(a,new E(i,r,o)),{left:a,right:o}}function R(e,t,n){let r=e.ruleToStartState.get(t);z(r,n.left);let i=e.ruleToStopState.get(t);return z(n.right,i),{left:r,right:i}}function z(e,t){V(e,new T(t))}function B(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function V(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function pe(e,t){e.states.splice(e.states.indexOf(t),1)}const H={};var U=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=W(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return e(this.configs,e=>e.alt)}get key(){let e=``;for(let t in this.map)e+=t+`:`;return e}};function W(e,t=!0){return`${t?`a${e.alt}`:``}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join(`_`)}`}function me(e,t){let n={};return r=>{let i=r.toString(),a=n[i];return a===void 0?(a={atnStartState:e,decision:t,states:{}},n[i]=a,a):a}}var G=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e=``,t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?`1`:`0`;return e}};const K=new G;var he=class extends g{constructor(e){super(),this.logging=e?.logging??(e=>console.log(e))}initialize(e){this.atn=ae(e.rules),this.dfas=ge(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:r,rule:i,hasPredicates:a,dynamicTokensEnabled:o}=t,s=this.dfas,c=this.logging,l=S(i,`Alternation`,r),u=this.atn.decisionMap[l].decision,d=e(h({maxLookahead:1,occurrence:r,prodType:`Alternation`,rule:i}),t=>e(t,e=>e[0]));if(q(d,!1)&&!o){let e=m(d,(e,t,r)=>(n(t,t=>{t&&(e[t.tokenTypeIdx]=r,n(t.categoryMatches,t=>{e[t]=r}))}),e),{});return a?function(t){let n=e[this.LA(1).tokenTypeIdx];if(t!==void 0&&n!==void 0){let e=t[n]?.GATE;if(e!==void 0&&e.call(this)===!1)return}return n}:function(){return e[this.LA(1).tokenTypeIdx]}}else if(a)return function(e){let t=new G,n=e===void 0?0:e.length;for(let r=0;r<n;r++){let n=e?.[r].GATE;t.set(r,n===void 0||n.call(this))}let r=J.call(this,s,u,t,c);return typeof r==`number`?r:void 0};else return function(){let e=J.call(this,s,u,K,c);return typeof e==`number`?e:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:r,rule:i,prodType:a,dynamicTokensEnabled:o}=t,s=this.dfas,c=this.logging,l=S(i,a,r),u=this.atn.decisionMap[l].decision,d=e(h({maxLookahead:1,occurrence:r,prodType:a,rule:i}),t=>e(t,e=>e[0]));if(q(d)&&d[0][0]&&!o){let e=d[0],t=te(e);if(t.length===1&&ie(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=m(t,(e,t)=>(t!==void 0&&(e[t.tokenTypeIdx]=!0,n(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}return function(){let e=J.call(this,s,u,K,c);return typeof e==`object`?!1:e===0}}};function q(e,t=!0){let n=new Set;for(let r of e){let e=new Set;for(let i of r){if(i===void 0){if(t)break;return!1}let r=[i.tokenTypeIdx].concat(i.categoryMatches);for(let t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function ge(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=me(e.decisionStates[r],r);return n}function J(e,t,n,r){let i=e[t](n),a=i.start;return a===void 0&&(a=Z(i,Y(De(i.atnStartState))),i.start=a),_e.apply(this,[i,a,n,r])}function _e(e,t,n,r){let i=t,a=1,o=[],s=this.LA(a++);for(;;){let t=Ce(i,s);if(t===void 0&&(t=ve.apply(this,[e,i,s,a,n,r])),t===H)return Se(o,i,s);if(t.isAcceptState===!0)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function ve(e,t,n,r,i,a){let o=we(t.configs,n,i);if(o.size===0)return X(e,t,n,H),H;let s=Y(o),c=Ee(o,i);if(c!==void 0)s.isAcceptState=!0,s.prediction=c,s.configs.uniqueAlt=c;else if($(o)){let t=b(o.alts);s.isAcceptState=!0,s.prediction=t,s.configs.uniqueAlt=t,ye.apply(this,[e,r,o.alts,a])}return s=X(e,t,n,s),s}function ye(e,t,n,r){let i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);let a=e.atnStartState,o=a.rule,s=a.production;r(be({topLevelRule:o,ambiguityIndices:n,production:s,prefixPath:i}))}function be(t){let n=e(t.prefixPath,e=>_(e)).join(`, `),r=t.production.idx===0?``:t.production.idx,i=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(`, `)}> in <${xe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,\n<${n}> may appears as a prefix path in all these alternatives.\n`;return i+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
2
+ For Further details.`,i}function xe(e){if(e instanceof r)return`SUBRULE`;if(e instanceof c)return`OPTION`;if(e instanceof l)return`OR`;if(e instanceof i)return`AT_LEAST_ONE`;if(e instanceof a)return`AT_LEAST_ONE_SEP`;if(e instanceof u)return`MANY_SEP`;if(e instanceof d)return`MANY`;if(e instanceof o)return`CONSUME`;throw Error(`non exhaustive match`)}function Se(e,t,n){return{actualToken:n,possibleTokenTypes:x(re(t.configs.elements,e=>e.state.transitions).filter(e=>e instanceof w).map(e=>e.tokenType),e=>e.tokenTypeIdx),tokenPath:e}}function Ce(e,t){return e.edges[t.tokenTypeIdx]}function we(e,t,n){let r=new U,i=[];for(let a of e.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===7){i.push(a);continue}let e=a.state.transitions.length;for(let n=0;n<e;n++){let e=a.state.transitions[n],i=Te(e,t);i!==void 0&&r.add({state:i,alt:a.alt,stack:a.stack})}}let a;if(i.length===0&&r.size===1&&(a=r),a===void 0){a=new U;for(let e of r.elements)Q(e,a)}if(i.length>0&&!ke(a))for(let e of i)a.add(e);return a}function Te(e,t){if(e instanceof w&&ee(t,e.tokenType))return e.target}function Ee(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Y(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function X(e,t,n,r){return r=Z(e,r),t.edges[n.tokenTypeIdx]=r,r}function Z(e,t){if(t===H)return t;let n=t.configs.key,r=e.states[n];return r===void 0?(t.configs.finalize(),e.states[n]=t,t):r}function De(e){let t=new U,n=e.transitions.length;for(let r=0;r<n;r++)Q({state:e.transitions[r].target,alt:r,stack:[]},t);return t}function Q(e,t){let n=e.state;if(n.type===7){if(e.stack.length>0){let n=[...e.stack];Q({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let r=n.transitions[i],a=Oe(e,r);a!==void 0&&Q(a,t)}}function Oe(e,t){if(t instanceof T)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof E){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function ke(e){for(let t of e.elements)if(t.state.type===7)return!0;return!1}function Ae(e){for(let t of e.elements)if(t.state.type!==7)return!1;return!0}function $(e){if(Ae(e))return!0;let t=je(e.elements);return Me(t)&&!Ne(t)}function je(e){let t=new Map;for(let n of e){let e=W(n,!1),r=t.get(e);r===void 0&&(r={},t.set(e,r)),r[n.alt]=!0}return t}function Me(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function Ne(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}export{he as t};