@yancyyu/openhermit 1.5.8
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/LICENSE +611 -0
- package/README.md +220 -0
- package/bin/hermit.mjs +364 -0
- package/bin/kill-dev.js +20 -0
- package/dist-renderer/assets/01-BApSFlV4.png +0 -0
- package/dist-renderer/assets/02-CRQGs29u.png +0 -0
- package/dist-renderer/assets/03-BFCM2jnD.png +0 -0
- package/dist-renderer/assets/04-B2FThbKO.png +0 -0
- package/dist-renderer/assets/05-D9p0Znkd.png +0 -0
- package/dist-renderer/assets/06-DZAfbDlP.png +0 -0
- package/dist-renderer/assets/07-B_PXWGCc.png +0 -0
- package/dist-renderer/assets/08-DGRMZ6sl.png +0 -0
- package/dist-renderer/assets/09-SGCQvc7U.png +0 -0
- package/dist-renderer/assets/10-Cve81Q3W.png +0 -0
- package/dist-renderer/assets/11-DGglolDW.png +0 -0
- package/dist-renderer/assets/12-C3lnu79c.png +0 -0
- package/dist-renderer/assets/13-M59meqdw.png +0 -0
- package/dist-renderer/assets/ProjectEditorOverlay-BNoDw9T1.js +57 -0
- package/dist-renderer/assets/TeamGraphOverlay-CfGRKQIu.js +1 -0
- package/dist-renderer/assets/_basePickBy-Ct8Hm5_h.js +1 -0
- package/dist-renderer/assets/_baseUniq-BofrAFBx.js +1 -0
- package/dist-renderer/assets/apl-B4CMkyY2.js +1 -0
- package/dist-renderer/assets/arc-AbJgatzR.js +1 -0
- package/dist-renderer/assets/architectureDiagram-VXUJARFQ-gpniCJVk.js +36 -0
- package/dist-renderer/assets/asciiarmor-Df11BRmG.js +1 -0
- package/dist-renderer/assets/asn1-EdZsLKOL.js +1 -0
- package/dist-renderer/assets/asterisk-B-8jnY81.js +1 -0
- package/dist-renderer/assets/blockDiagram-VD42YOAC-aBbbmONC.js +122 -0
- package/dist-renderer/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/dist-renderer/assets/c4Diagram-YG6GDRKO-DJio1IsU.js +10 -0
- package/dist-renderer/assets/channel-CZ8sd5Xf.js +1 -0
- package/dist-renderer/assets/chunk-4BX2VUAB-D1_HKao2.js +1 -0
- package/dist-renderer/assets/chunk-55IACEB6-NAmVxF4k.js +1 -0
- package/dist-renderer/assets/chunk-B4BG7PRW-Ce829laz.js +165 -0
- package/dist-renderer/assets/chunk-DI55MBZ5-Ct2Le12y.js +220 -0
- package/dist-renderer/assets/chunk-FMBD7UC4-Cie3DzKk.js +15 -0
- package/dist-renderer/assets/chunk-QN33PNHL-4f5Yb50e.js +1 -0
- package/dist-renderer/assets/chunk-QZHKN3VN-D9ranl9c.js +1 -0
- package/dist-renderer/assets/chunk-TZMSLE5B-bdGZWlEy.js +1 -0
- package/dist-renderer/assets/classDiagram-2ON5EDUG-CMcfSKj5.js +1 -0
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-CMcfSKj5.js +1 -0
- package/dist-renderer/assets/clike-B9uivgTg.js +1 -0
- package/dist-renderer/assets/clojure-BMjYHr_A.js +1 -0
- package/dist-renderer/assets/clone-CMuwA8RV.js +1 -0
- package/dist-renderer/assets/cmake-BQqOBYOt.js +1 -0
- package/dist-renderer/assets/cobol-CWcv1MsR.js +1 -0
- package/dist-renderer/assets/coffeescript-S37ZYGWr.js +1 -0
- package/dist-renderer/assets/commonlisp-DBKNyK5s.js +1 -0
- package/dist-renderer/assets/cose-bilkent-S5V4N54A-C6tvfcVi.js +1 -0
- package/dist-renderer/assets/crystal-SjHAIU92.js +1 -0
- package/dist-renderer/assets/css-BnMrqG3P.js +1 -0
- package/dist-renderer/assets/cypher-C_CwsFkJ.js +1 -0
- package/dist-renderer/assets/cytoscape.esm-DsxaTqgk.js +331 -0
- package/dist-renderer/assets/d-pRatUO7H.js +1 -0
- package/dist-renderer/assets/dagre-6UL2VRFP-B-4qcZam.js +4 -0
- package/dist-renderer/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist-renderer/assets/diagram-PSM6KHXK-CwT3TLjx.js +24 -0
- package/dist-renderer/assets/diagram-QEK2KX5R-BWH6-ZFd.js +43 -0
- package/dist-renderer/assets/diagram-S2PKOQOG-DfpPnfi1.js +24 -0
- package/dist-renderer/assets/diff-DbItnlRl.js +1 -0
- package/dist-renderer/assets/dockerfile-BKs6k2Af.js +1 -0
- package/dist-renderer/assets/dtd-DF_7sFjM.js +1 -0
- package/dist-renderer/assets/dylan-DwRh75JA.js +1 -0
- package/dist-renderer/assets/ebnf-CDyGwa7X.js +1 -0
- package/dist-renderer/assets/ecl-Cabwm37j.js +1 -0
- package/dist-renderer/assets/eiffel-CnydiIhH.js +1 -0
- package/dist-renderer/assets/elm-vLlmbW-K.js +1 -0
- package/dist-renderer/assets/erDiagram-Q2GNP2WA-BFbEFR4x.js +60 -0
- package/dist-renderer/assets/erlang-BNw1qcRV.js +1 -0
- package/dist-renderer/assets/factor-kuTfRLto.js +1 -0
- package/dist-renderer/assets/favicon-B8xY-GVk.png +0 -0
- package/dist-renderer/assets/fcl-Kvtd6kyn.js +1 -0
- package/dist-renderer/assets/flowDiagram-NV44I4VS-Dg3cf5hW.js +162 -0
- package/dist-renderer/assets/forth-Ffai-XNe.js +1 -0
- package/dist-renderer/assets/fortran-DYz_wnZ1.js +1 -0
- package/dist-renderer/assets/ganttDiagram-JELNMOA3-B21y55W5.js +267 -0
- package/dist-renderer/assets/gas-Bneqetm1.js +1 -0
- package/dist-renderer/assets/gherkin-heZmZLOM.js +1 -0
- package/dist-renderer/assets/gitGraphDiagram-V2S2FVAM-BDV3BJzn.js +65 -0
- package/dist-renderer/assets/graph-BfaZ4hZt.js +1 -0
- package/dist-renderer/assets/groovy-D9Dt4D0W.js +1 -0
- package/dist-renderer/assets/haskell-BWDZoCOh.js +1 -0
- package/dist-renderer/assets/haxe-H-WmDvRZ.js +1 -0
- package/dist-renderer/assets/http-DBlCnlav.js +1 -0
- package/dist-renderer/assets/idl-BEugSyMb.js +1 -0
- package/dist-renderer/assets/index-BMXHMpkG.js +1 -0
- package/dist-renderer/assets/index-CCqtDawH.js +1 -0
- package/dist-renderer/assets/index-CVMSpK8C.js +1 -0
- package/dist-renderer/assets/index-CZltVMDP.js +1844 -0
- package/dist-renderer/assets/index-CaG9mf8s.css +1 -0
- package/dist-renderer/assets/index-Ct0-y9TF.js +1 -0
- package/dist-renderer/assets/index-pMg_LlsS.js +1 -0
- package/dist-renderer/assets/infoDiagram-HS3SLOUP-DvMlS0CL.js +2 -0
- package/dist-renderer/assets/init-Gi6I4Gst.js +1 -0
- package/dist-renderer/assets/javascript-qCveANmP.js +1 -0
- package/dist-renderer/assets/journeyDiagram-XKPGCS4Q-DIyMluRv.js +139 -0
- package/dist-renderer/assets/julia-DuME0IfC.js +1 -0
- package/dist-renderer/assets/kanban-definition-3W4ZIXB7-CVOx8f-7.js +89 -0
- package/dist-renderer/assets/katex-DGN8GczM.js +261 -0
- package/dist-renderer/assets/layout-BPKIXUf4.js +1 -0
- package/dist-renderer/assets/linear-CScZGLr2.js +1 -0
- package/dist-renderer/assets/livescript-BwQOo05w.js +1 -0
- package/dist-renderer/assets/lua-BgMRiT3U.js +1 -0
- package/dist-renderer/assets/mathematica-DTrFuWx2.js +1 -0
- package/dist-renderer/assets/mbox-CNhZ1qSd.js +1 -0
- package/dist-renderer/assets/mindmap-definition-VGOIOE7T-CmDQ7Wo6.js +68 -0
- package/dist-renderer/assets/mirc-CjQqDB4T.js +1 -0
- package/dist-renderer/assets/mllike-CXdrOF99.js +1 -0
- package/dist-renderer/assets/modelica-Dc1JOy9r.js +1 -0
- package/dist-renderer/assets/mscgen-BA5vi2Kp.js +1 -0
- package/dist-renderer/assets/mumps-BT43cFF4.js +1 -0
- package/dist-renderer/assets/nginx-DdIZxoE0.js +1 -0
- package/dist-renderer/assets/nsis-LdVXkNf5.js +1 -0
- package/dist-renderer/assets/ntriples-BfvgReVJ.js +1 -0
- package/dist-renderer/assets/octave-Ck1zUtKM.js +1 -0
- package/dist-renderer/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist-renderer/assets/oz-BzwKVEFT.js +1 -0
- package/dist-renderer/assets/pascal--L3eBynH.js +1 -0
- package/dist-renderer/assets/perl-CdXCOZ3F.js +1 -0
- package/dist-renderer/assets/pieDiagram-ADFJNKIX-DbVClin-.js +30 -0
- package/dist-renderer/assets/pig-CevX1Tat.js +1 -0
- package/dist-renderer/assets/powershell-CFHJl5sT.js +1 -0
- package/dist-renderer/assets/properties-C78fOPTZ.js +1 -0
- package/dist-renderer/assets/protobuf-ChK-085T.js +1 -0
- package/dist-renderer/assets/pug-DukmZTjD.js +1 -0
- package/dist-renderer/assets/puppet-DMA9R1ak.js +1 -0
- package/dist-renderer/assets/python-BuPzkPfP.js +1 -0
- package/dist-renderer/assets/q-pXgVlZs6.js +1 -0
- package/dist-renderer/assets/quadrantDiagram-AYHSOK5B-CAB0MYcW.js +7 -0
- package/dist-renderer/assets/r-DUYO_cvP.js +1 -0
- package/dist-renderer/assets/requirementDiagram-UZGBJVZJ-w2Lfpg3T.js +64 -0
- package/dist-renderer/assets/rpm-CTu-6PCP.js +1 -0
- package/dist-renderer/assets/ruby-B2Rjki9n.js +1 -0
- package/dist-renderer/assets/sankeyDiagram-TZEHDZUN-kvG1QoKY.js +10 -0
- package/dist-renderer/assets/sas-B4kiWyti.js +1 -0
- package/dist-renderer/assets/scheme-C41bIUwD.js +1 -0
- package/dist-renderer/assets/sequenceDiagram-WL72ISMW-DCVBQ23J.js +145 -0
- package/dist-renderer/assets/shell-CjFT_Tl9.js +1 -0
- package/dist-renderer/assets/sieve-C3Gn_uJK.js +1 -0
- package/dist-renderer/assets/simple-mode-GW_nhZxv.js +1 -0
- package/dist-renderer/assets/smalltalk-CnHTOXQT.js +1 -0
- package/dist-renderer/assets/solr-DehyRSwq.js +1 -0
- package/dist-renderer/assets/sparql-DkYu6x3z.js +1 -0
- package/dist-renderer/assets/splashScene-C8lWNnm4.js +1 -0
- package/dist-renderer/assets/spreadsheet-BCZA_wO0.js +1 -0
- package/dist-renderer/assets/sql-D0XecflT.js +1 -0
- package/dist-renderer/assets/stateDiagram-FKZM4ZOC-ItZ0JBvq.js +1 -0
- package/dist-renderer/assets/stateDiagram-v2-4FDKWEC3-Hpmw4dMm.js +1 -0
- package/dist-renderer/assets/stex-C3f8Ysf7.js +1 -0
- package/dist-renderer/assets/stylus-B533Al4x.js +1 -0
- package/dist-renderer/assets/swift-BzpIVaGY.js +1 -0
- package/dist-renderer/assets/tcl-DVfN8rqt.js +1 -0
- package/dist-renderer/assets/textile-CnDTJFAw.js +1 -0
- package/dist-renderer/assets/tiddlywiki-DO-Gjzrf.js +1 -0
- package/dist-renderer/assets/tiki-DGYXhP31.js +1 -0
- package/dist-renderer/assets/timeline-definition-IT6M3QCI-BzSFaAjV.js +61 -0
- package/dist-renderer/assets/toml-Bm5Em-hy.js +1 -0
- package/dist-renderer/assets/treemap-GDKQZRPO-fSz4hQn0.js +162 -0
- package/dist-renderer/assets/troff-wAsdV37c.js +1 -0
- package/dist-renderer/assets/ttcn-CfJYG6tj.js +1 -0
- package/dist-renderer/assets/ttcn-cfg-B9xdYoR4.js +1 -0
- package/dist-renderer/assets/turtle-B1tBg_DP.js +1 -0
- package/dist-renderer/assets/vb-CmGdzxic.js +1 -0
- package/dist-renderer/assets/vbscript-BuJXcnF6.js +1 -0
- package/dist-renderer/assets/velocity-D8B20fx6.js +1 -0
- package/dist-renderer/assets/verilog-C6RDOZhf.js +1 -0
- package/dist-renderer/assets/vhdl-lSbBsy5d.js +1 -0
- package/dist-renderer/assets/webidl-ZXfAyPTL.js +1 -0
- package/dist-renderer/assets/xquery-CQfU5ijd.js +1 -0
- package/dist-renderer/assets/xychartDiagram-PRI3JC2R-CT1kaGlv.js +7 -0
- package/dist-renderer/assets/yacas-BJ4BC0dw.js +1 -0
- package/dist-renderer/assets/z80-Hz9HOZM7.js +1 -0
- package/dist-renderer/index.html +1274 -0
- package/package.json +181 -0
- package/src/features/README.md +24 -0
- package/src/features/agent-graph/README.md +21 -0
- package/src/features/agent-graph/STABLE_SLOT_LAYOUT_PLAN.md +2846 -0
- package/src/features/agent-graph/core/domain/buildInlineActivityEntries.ts +416 -0
- package/src/features/agent-graph/core/domain/collapseOverflowStacks.ts +126 -0
- package/src/features/agent-graph/core/domain/graphOwnerIdentity.ts +55 -0
- package/src/features/agent-graph/core/domain/taskGraphSemantics.ts +48 -0
- package/src/features/agent-graph/renderer/adapters/TeamGraphAdapter.ts +1400 -0
- package/src/features/agent-graph/renderer/hooks/useGraphActivityContext.ts +34 -0
- package/src/features/agent-graph/renderer/hooks/useGraphCreateTaskDialog.tsx +126 -0
- package/src/features/agent-graph/renderer/hooks/useGraphMemberPopoverContext.ts +34 -0
- package/src/features/agent-graph/renderer/hooks/useGraphSidebarVisibility.ts +52 -0
- package/src/features/agent-graph/renderer/hooks/useTeamGraphAdapter.ts +173 -0
- package/src/features/agent-graph/renderer/hooks/useTeamGraphSurfaceActions.ts +98 -0
- package/src/features/agent-graph/renderer/index.ts +14 -0
- package/src/features/agent-graph/renderer/ui/GraphActivityCard.tsx +96 -0
- package/src/features/agent-graph/renderer/ui/GraphActivityHud.tsx +498 -0
- package/src/features/agent-graph/renderer/ui/GraphBlockingEdgePopover.tsx +207 -0
- package/src/features/agent-graph/renderer/ui/GraphNodePopover.tsx +573 -0
- package/src/features/agent-graph/renderer/ui/GraphProvisioningHud.tsx +113 -0
- package/src/features/agent-graph/renderer/ui/GraphTaskCard.tsx +149 -0
- package/src/features/agent-graph/renderer/ui/GraphTransientHandoffHud.tsx +176 -0
- package/src/features/agent-graph/renderer/ui/TeamGraphOverlay.tsx +224 -0
- package/src/features/agent-graph/renderer/ui/TeamGraphTab.tsx +257 -0
- package/src/features/agent-graph/renderer/ui/buildTransientHandoffMessage.ts +70 -0
- package/src/features/recent-projects/contracts/api.ts +5 -0
- package/src/features/recent-projects/contracts/channels.ts +2 -0
- package/src/features/recent-projects/contracts/dto.ts +24 -0
- package/src/features/recent-projects/contracts/index.ts +4 -0
- package/src/features/recent-projects/contracts/normalize.ts +32 -0
- package/src/features/recent-projects/core/application/models/ListDashboardRecentProjectsResponse.ts +6 -0
- package/src/features/recent-projects/core/application/ports/ClockPort.ts +3 -0
- package/src/features/recent-projects/core/application/ports/ListDashboardRecentProjectsOutputPort.ts +5 -0
- package/src/features/recent-projects/core/application/ports/LoggerPort.ts +5 -0
- package/src/features/recent-projects/core/application/ports/RecentProjectsCachePort.ts +5 -0
- package/src/features/recent-projects/core/application/ports/RecentProjectsSourcePort.ts +14 -0
- package/src/features/recent-projects/core/application/use-cases/ListDashboardRecentProjectsUseCase.ts +191 -0
- package/src/features/recent-projects/core/domain/models/ProviderId.ts +1 -0
- package/src/features/recent-projects/core/domain/models/RecentProjectAggregate.ts +14 -0
- package/src/features/recent-projects/core/domain/models/RecentProjectCandidate.ts +14 -0
- package/src/features/recent-projects/core/domain/models/RecentProjectOpenTarget.ts +3 -0
- package/src/features/recent-projects/core/domain/policies/mergeRecentProjectCandidates.ts +88 -0
- package/src/features/recent-projects/main/adapters/input/http/registerRecentProjectsHttp.ts +30 -0
- package/src/features/recent-projects/main/adapters/output/presenters/DashboardRecentProjectsPresenter.ts +27 -0
- package/src/features/recent-projects/main/adapters/output/sources/ClaudeRecentProjectsSourceAdapter.ts +91 -0
- package/src/features/recent-projects/main/adapters/output/sources/CodexRecentProjectsSourceAdapter.ts +326 -0
- package/src/features/recent-projects/main/composition/createRecentProjectsFeature.ts +43 -0
- package/src/features/recent-projects/main/index.ts +3 -0
- package/src/features/recent-projects/main/infrastructure/cache/InMemoryRecentProjectsCache.ts +34 -0
- package/src/features/recent-projects/main/infrastructure/codex/CodexAppServerClient.ts +116 -0
- package/src/features/recent-projects/main/infrastructure/identity/RecentProjectIdentityResolver.ts +20 -0
- package/src/features/recent-projects/main/infrastructure/identity/normalizeIdentityPath.ts +10 -0
- package/src/features/recent-projects/renderer/adapters/RecentProjectsSectionAdapter.ts +132 -0
- package/src/features/recent-projects/renderer/hooks/useOpenRecentProject.ts +143 -0
- package/src/features/recent-projects/renderer/hooks/useRecentProjectsSection.ts +289 -0
- package/src/features/recent-projects/renderer/index.ts +2 -0
- package/src/features/recent-projects/renderer/ui/RecentProjectCard.tsx +221 -0
- package/src/features/recent-projects/renderer/ui/RecentProjectsSection.tsx +167 -0
- package/src/features/recent-projects/renderer/utils/activeProjectTeams.ts +48 -0
- package/src/features/recent-projects/renderer/utils/navigation.ts +65 -0
- package/src/features/recent-projects/renderer/utils/projectDecorations.ts +11 -0
- package/src/features/recent-projects/renderer/utils/recentProjectOpenHistory.ts +268 -0
- package/src/features/recent-projects/renderer/utils/recentProjectsClientCache.ts +78 -0
- package/src/main/constants/messageTags.ts +46 -0
- package/src/main/constants/worktreePatterns.ts +47 -0
- package/src/main/server.ts +3705 -0
- package/src/main/services/UpdateService.ts +166 -0
- package/src/main/services/ccConnect/CcConnectBridge.ts +313 -0
- package/src/main/services/ccConnect/CcConnectClient.ts +397 -0
- package/src/main/services/ccConnect/MessageBridge.ts +162 -0
- package/src/main/services/ccConnect/ProjectMappingStore.ts +148 -0
- package/src/main/services/ccConnect/index.ts +8 -0
- package/src/main/services/teams-mvp/TeamProvisioningService.ts +275 -0
- package/src/main/services/teams-mvp/TeamWorkspaceService.ts +404 -0
- package/src/main/services/teams-mvp/index.ts +26 -0
- package/src/main/types/chunks.ts +506 -0
- package/src/main/types/domain.ts +342 -0
- package/src/main/types/index.ts +24 -0
- package/src/main/types/jsonl.ts +355 -0
- package/src/main/types/messages.ts +395 -0
- package/src/renderer/App.tsx +287 -0
- package/src/renderer/api/httpClient.ts +2207 -0
- package/src/renderer/api/index.ts +19 -0
- package/src/renderer/api/providers.ts +77 -0
- package/src/renderer/assets/participant-avatars/01.png +0 -0
- package/src/renderer/assets/participant-avatars/02.png +0 -0
- package/src/renderer/assets/participant-avatars/03.png +0 -0
- package/src/renderer/assets/participant-avatars/04.png +0 -0
- package/src/renderer/assets/participant-avatars/05.png +0 -0
- package/src/renderer/assets/participant-avatars/06.png +0 -0
- package/src/renderer/assets/participant-avatars/07.png +0 -0
- package/src/renderer/assets/participant-avatars/08.png +0 -0
- package/src/renderer/assets/participant-avatars/09.png +0 -0
- package/src/renderer/assets/participant-avatars/10.png +0 -0
- package/src/renderer/assets/participant-avatars/11.png +0 -0
- package/src/renderer/assets/participant-avatars/12.png +0 -0
- package/src/renderer/assets/participant-avatars/13.png +0 -0
- package/src/renderer/components/chat/AIChatGroup.tsx +519 -0
- package/src/renderer/components/chat/ChatHistory.tsx +1115 -0
- package/src/renderer/components/chat/ChatHistoryEmptyState.tsx +15 -0
- package/src/renderer/components/chat/ChatHistoryItem.tsx +144 -0
- package/src/renderer/components/chat/ChatHistoryLoadingState.tsx +45 -0
- package/src/renderer/components/chat/CompactBoundary.tsx +169 -0
- package/src/renderer/components/chat/ContextBadge.tsx +582 -0
- package/src/renderer/components/chat/DisplayItemList.tsx +431 -0
- package/src/renderer/components/chat/LastOutputDisplay.tsx +259 -0
- package/src/renderer/components/chat/SessionContextPanel/DirectoryTree/DirectoryTreeNode.tsx +125 -0
- package/src/renderer/components/chat/SessionContextPanel/DirectoryTree/buildDirectoryTree.ts +47 -0
- package/src/renderer/components/chat/SessionContextPanel/DirectoryTree/types.ts +12 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ClaudeMdFilesSection.tsx +90 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ClaudeMdSection.tsx +86 -0
- package/src/renderer/components/chat/SessionContextPanel/components/CollapsibleSection.tsx +77 -0
- package/src/renderer/components/chat/SessionContextPanel/components/FlatInjectionList.tsx +248 -0
- package/src/renderer/components/chat/SessionContextPanel/components/MentionedFilesSection.tsx +50 -0
- package/src/renderer/components/chat/SessionContextPanel/components/RankedInjectionList.tsx +284 -0
- package/src/renderer/components/chat/SessionContextPanel/components/SessionContextHeader.tsx +290 -0
- package/src/renderer/components/chat/SessionContextPanel/components/SessionContextHelpTooltip.tsx +165 -0
- package/src/renderer/components/chat/SessionContextPanel/components/TaskCoordinationSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ThinkingTextSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/components/ToolOutputsSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/components/UserMessagesSection.tsx +47 -0
- package/src/renderer/components/chat/SessionContextPanel/index.tsx +314 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ClaudeMdItem.tsx +76 -0
- package/src/renderer/components/chat/SessionContextPanel/items/MentionedFileItem.tsx +91 -0
- package/src/renderer/components/chat/SessionContextPanel/items/TaskCoordinationItem.tsx +116 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ThinkingTextItem.tsx +96 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ToolBreakdownItem.tsx +38 -0
- package/src/renderer/components/chat/SessionContextPanel/items/ToolOutputItem.tsx +113 -0
- package/src/renderer/components/chat/SessionContextPanel/items/UserMessageItem.tsx +69 -0
- package/src/renderer/components/chat/SessionContextPanel/types.ts +96 -0
- package/src/renderer/components/chat/SessionContextPanel/utils/formatting.ts +6 -0
- package/src/renderer/components/chat/SessionContextPanel/utils/pathParsing.ts +23 -0
- package/src/renderer/components/chat/SystemChatGroup.tsx +60 -0
- package/src/renderer/components/chat/UserChatGroup.tsx +668 -0
- package/src/renderer/components/chat/items/BaseItem.tsx +213 -0
- package/src/renderer/components/chat/items/ExecutionTrace.tsx +279 -0
- package/src/renderer/components/chat/items/LinkedToolItem.tsx +235 -0
- package/src/renderer/components/chat/items/MetricsPill.tsx +215 -0
- package/src/renderer/components/chat/items/SlashItem.tsx +81 -0
- package/src/renderer/components/chat/items/SubagentItem.tsx +592 -0
- package/src/renderer/components/chat/items/TeammateMessageItem.tsx +261 -0
- package/src/renderer/components/chat/items/TextItem.tsx +82 -0
- package/src/renderer/components/chat/items/ThinkingItem.tsx +82 -0
- package/src/renderer/components/chat/items/baseItemHelpers.ts +42 -0
- package/src/renderer/components/chat/items/linkedTool/CollapsibleOutputSection.tsx +57 -0
- package/src/renderer/components/chat/items/linkedTool/DefaultToolViewer.tsx +56 -0
- package/src/renderer/components/chat/items/linkedTool/EditToolViewer.tsx +74 -0
- package/src/renderer/components/chat/items/linkedTool/ReadToolViewer.tsx +102 -0
- package/src/renderer/components/chat/items/linkedTool/SkillToolViewer.tsx +67 -0
- package/src/renderer/components/chat/items/linkedTool/ToolErrorDisplay.tsx +43 -0
- package/src/renderer/components/chat/items/linkedTool/WriteToolViewer.tsx +66 -0
- package/src/renderer/components/chat/items/linkedTool/index.ts +13 -0
- package/src/renderer/components/chat/items/linkedTool/renderHelpers.tsx +259 -0
- package/src/renderer/components/chat/markdownComponents.tsx +257 -0
- package/src/renderer/components/chat/markdownCopyUtils.ts +18 -0
- package/src/renderer/components/chat/searchHighlightUtils.ts +166 -0
- package/src/renderer/components/chat/viewers/CodeBlockViewer.tsx +244 -0
- package/src/renderer/components/chat/viewers/DiffViewer.tsx +459 -0
- package/src/renderer/components/chat/viewers/FileLink.tsx +182 -0
- package/src/renderer/components/chat/viewers/MarkdownViewer.tsx +1093 -0
- package/src/renderer/components/chat/viewers/MermaidDiagram.tsx +116 -0
- package/src/renderer/components/chat/viewers/index.ts +3 -0
- package/src/renderer/components/chat/viewers/syntaxHighlighter.ts +583 -0
- package/src/renderer/components/common/AppLogo.tsx +61 -0
- package/src/renderer/components/common/CliInstallWarningBanner.tsx +57 -0
- package/src/renderer/components/common/ConfirmDialog.tsx +176 -0
- package/src/renderer/components/common/ConnectionStatusBadge.tsx +56 -0
- package/src/renderer/components/common/ContextSwitchOverlay.tsx +38 -0
- package/src/renderer/components/common/CopyButton.tsx +85 -0
- package/src/renderer/components/common/CopyablePath.tsx +68 -0
- package/src/renderer/components/common/ErrorBoundary.tsx +211 -0
- package/src/renderer/components/common/ExportDropdown.tsx +142 -0
- package/src/renderer/components/common/FileTree.tsx +182 -0
- package/src/renderer/components/common/GlobalProviderStatusHeader.tsx +316 -0
- package/src/renderer/components/common/OngoingIndicator.tsx +67 -0
- package/src/renderer/components/common/ProviderBrandLogo.tsx +206 -0
- package/src/renderer/components/common/RepositoryDropdown.tsx +230 -0
- package/src/renderer/components/common/TokenUsageDisplay.tsx +581 -0
- package/src/renderer/components/common/WarningBanner.tsx +25 -0
- package/src/renderer/components/common/WorkspaceIndicator.tsx +183 -0
- package/src/renderer/components/common/WorktreeBadge.tsx +123 -0
- package/src/renderer/components/dashboard/CliStatusBanner.tsx +1845 -0
- package/src/renderer/components/dashboard/DashboardView.tsx +274 -0
- package/src/renderer/components/extensions/ExtensionStoreView.tsx +591 -0
- package/src/renderer/components/extensions/ExtensionsSubTabTrigger.tsx +52 -0
- package/src/renderer/components/extensions/apikeys/ApiKeyCard.tsx +143 -0
- package/src/renderer/components/extensions/apikeys/ApiKeyFormDialog.tsx +282 -0
- package/src/renderer/components/extensions/apikeys/ApiKeysPanel.tsx +280 -0
- package/src/renderer/components/extensions/common/InstallButton.tsx +186 -0
- package/src/renderer/components/extensions/common/InstallCountBadge.tsx +21 -0
- package/src/renderer/components/extensions/common/SearchInput.tsx +70 -0
- package/src/renderer/components/extensions/common/SourceBadge.tsx +31 -0
- package/src/renderer/components/extensions/mcp/CustomMcpServerDialog.tsx +560 -0
- package/src/renderer/components/extensions/mcp/McpServerCard.tsx +314 -0
- package/src/renderer/components/extensions/mcp/McpServerDetailDialog.tsx +669 -0
- package/src/renderer/components/extensions/mcp/McpServersPanel.tsx +543 -0
- package/src/renderer/components/extensions/plugins/CapabilityChips.tsx +70 -0
- package/src/renderer/components/extensions/plugins/CategoryChips.tsx +67 -0
- package/src/renderer/components/extensions/plugins/PluginCard.tsx +146 -0
- package/src/renderer/components/extensions/plugins/PluginDetailDialog.tsx +270 -0
- package/src/renderer/components/extensions/plugins/PluginsPanel.tsx +436 -0
- package/src/renderer/components/extensions/skills/SkillCodeEditor.tsx +117 -0
- package/src/renderer/components/extensions/skills/SkillDetailDialog.tsx +372 -0
- package/src/renderer/components/extensions/skills/SkillEditorDialog.tsx +856 -0
- package/src/renderer/components/extensions/skills/SkillImportDialog.tsx +343 -0
- package/src/renderer/components/extensions/skills/SkillReviewDialog.tsx +166 -0
- package/src/renderer/components/extensions/skills/SkillsPanel.tsx +784 -0
- package/src/renderer/components/extensions/skills/skillDraftUtils.ts +234 -0
- package/src/renderer/components/extensions/skills/skillFolderNameUtils.ts +19 -0
- package/src/renderer/components/extensions/skills/skillProjectUtils.ts +13 -0
- package/src/renderer/components/extensions/skills/skillValidationUtils.ts +31 -0
- package/src/renderer/components/layout/MiddlePanel.tsx +18 -0
- package/src/renderer/components/layout/MoreMenu.tsx +243 -0
- package/src/renderer/components/layout/PaneContainer.tsx +27 -0
- package/src/renderer/components/layout/PaneContent.tsx +84 -0
- package/src/renderer/components/layout/PaneResizeHandle.tsx +85 -0
- package/src/renderer/components/layout/PaneSplitDropZone.tsx +54 -0
- package/src/renderer/components/layout/PaneView.tsx +75 -0
- package/src/renderer/components/layout/SessionTabContent.tsx +102 -0
- package/src/renderer/components/layout/Sidebar.tsx +205 -0
- package/src/renderer/components/layout/SortableTab.tsx +261 -0
- package/src/renderer/components/layout/TabBar.tsx +354 -0
- package/src/renderer/components/layout/TabBarActions.tsx +176 -0
- package/src/renderer/components/layout/TabBarRow.tsx +99 -0
- package/src/renderer/components/layout/TabContextMenu.tsx +171 -0
- package/src/renderer/components/layout/TabbedLayout.tsx +186 -0
- package/src/renderer/components/layout/TeamTabSectionNav.tsx +146 -0
- package/src/renderer/components/notifications/NotificationRow.tsx +228 -0
- package/src/renderer/components/notifications/NotificationsView.tsx +371 -0
- package/src/renderer/components/report/AssessmentBadge.tsx +78 -0
- package/src/renderer/components/report/ReportSection.tsx +58 -0
- package/src/renderer/components/report/SessionReportTab.tsx +102 -0
- package/src/renderer/components/report/sections/CostSection.tsx +259 -0
- package/src/renderer/components/report/sections/ErrorSection.tsx +100 -0
- package/src/renderer/components/report/sections/FrictionSection.tsx +91 -0
- package/src/renderer/components/report/sections/GitSection.tsx +72 -0
- package/src/renderer/components/report/sections/InsightsSection.tsx +207 -0
- package/src/renderer/components/report/sections/KeyTakeawaysSection.tsx +55 -0
- package/src/renderer/components/report/sections/OverviewSection.tsx +64 -0
- package/src/renderer/components/report/sections/QualitySection.tsx +151 -0
- package/src/renderer/components/report/sections/SubagentSection.tsx +88 -0
- package/src/renderer/components/report/sections/TimelineSection.tsx +111 -0
- package/src/renderer/components/report/sections/TokenSection.tsx +116 -0
- package/src/renderer/components/report/sections/ToolSection.tsx +77 -0
- package/src/renderer/components/runtime/ProviderModelBadges.tsx +142 -0
- package/src/renderer/components/runtime/ProviderRuntimeBackendSelector.tsx +327 -0
- package/src/renderer/components/runtime/ProviderRuntimeSettingsDialog.tsx +288 -0
- package/src/renderer/components/runtime/providerConnectionUi.ts +408 -0
- package/src/renderer/components/schedules/SchedulesView.tsx +529 -0
- package/src/renderer/components/search/CommandPalette.tsx +610 -0
- package/src/renderer/components/search/SearchBar.tsx +171 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/AddTriggerForm.tsx +233 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/ColorPaletteSelector.tsx +144 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/DynamicConfigSection.tsx +189 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/GeneralInfoSection.tsx +68 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/IgnorePatternsSection.tsx +73 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/ModeSelector.tsx +45 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/RepositoryScopeSection.tsx +63 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/SectionHeader.tsx +15 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerCard.tsx +150 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerCardHeader.tsx +125 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerConfiguration.tsx +342 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/components/TriggerPreview.tsx +108 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useAddTriggerFormHandlers.ts +218 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useAddTriggerFormState.ts +135 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useRepositoryLookup.ts +47 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useTriggerCardState.ts +281 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/hooks/useTriggerForm.ts +185 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/index.tsx +87 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/types.ts +39 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/utils/constants.ts +50 -0
- package/src/renderer/components/settings/NotificationTriggerSettings/utils/trigger.ts +113 -0
- package/src/renderer/components/settings/SettingsTabs.tsx +110 -0
- package/src/renderer/components/settings/SettingsView.tsx +153 -0
- package/src/renderer/components/settings/components/SettingRow.tsx +44 -0
- package/src/renderer/components/settings/components/SettingsSectionHeader.tsx +24 -0
- package/src/renderer/components/settings/components/SettingsSelect.tsx +100 -0
- package/src/renderer/components/settings/components/SettingsToggle.tsx +45 -0
- package/src/renderer/components/settings/components/index.ts +8 -0
- package/src/renderer/components/settings/hooks/index.ts +6 -0
- package/src/renderer/components/settings/hooks/useSettingsConfig.ts +270 -0
- package/src/renderer/components/settings/hooks/useSettingsHandlers.ts +468 -0
- package/src/renderer/components/settings/sections/AdvancedSection.tsx +234 -0
- package/src/renderer/components/settings/sections/CliStatusSection.tsx +930 -0
- package/src/renderer/components/settings/sections/ConfigEditorDialog.tsx +391 -0
- package/src/renderer/components/settings/sections/GeneralSection.tsx +665 -0
- package/src/renderer/components/settings/sections/HarnessSection.tsx +133 -0
- package/src/renderer/components/settings/sections/PlatformsSection.tsx +517 -0
- package/src/renderer/components/settings/sections/index.ts +8 -0
- package/src/renderer/components/sidebar/DateGroupedSessions.tsx +1115 -0
- package/src/renderer/components/sidebar/GlobalTaskList.tsx +853 -0
- package/src/renderer/components/sidebar/SessionContextMenu.tsx +182 -0
- package/src/renderer/components/sidebar/SessionFiltersPopover.tsx +115 -0
- package/src/renderer/components/sidebar/SessionItem.tsx +393 -0
- package/src/renderer/components/sidebar/SidebarSessions.tsx +542 -0
- package/src/renderer/components/sidebar/SidebarTaskItem.tsx +286 -0
- package/src/renderer/components/sidebar/TaskContextMenu.tsx +86 -0
- package/src/renderer/components/sidebar/TaskFiltersPopover.tsx +203 -0
- package/src/renderer/components/sidebar/WorkspaceBrowser.tsx +370 -0
- package/src/renderer/components/sidebar/dateGroupedSessionsSelection.ts +33 -0
- package/src/renderer/components/sidebar/projectGroupPagination.ts +89 -0
- package/src/renderer/components/sidebar/taskFiltersState.ts +82 -0
- package/src/renderer/components/splash/splashScene.ts +979 -0
- package/src/renderer/components/team/CcSessionsSection.tsx +202 -0
- package/src/renderer/components/team/ClaudeLogsDialog.tsx +71 -0
- package/src/renderer/components/team/ClaudeLogsFilterPopover.tsx +213 -0
- package/src/renderer/components/team/ClaudeLogsPanel.tsx +170 -0
- package/src/renderer/components/team/ClaudeLogsSection.tsx +154 -0
- package/src/renderer/components/team/CliLogsRichView.tsx +640 -0
- package/src/renderer/components/team/CollapsibleTeamSection.tsx +177 -0
- package/src/renderer/components/team/HarnessCards.ts +38 -0
- package/src/renderer/components/team/MemberBadge.tsx +117 -0
- package/src/renderer/components/team/ProcessesSection.tsx +193 -0
- package/src/renderer/components/team/ProvisioningProgressBlock.tsx +389 -0
- package/src/renderer/components/team/RoleSelect.tsx +171 -0
- package/src/renderer/components/team/StepProgressBar.tsx +165 -0
- package/src/renderer/components/team/TaskTooltip.tsx +197 -0
- package/src/renderer/components/team/TeamDetailView.tsx +3002 -0
- package/src/renderer/components/team/TeamEmptyState.tsx +102 -0
- package/src/renderer/components/team/TeamListFilterPopover.tsx +183 -0
- package/src/renderer/components/team/TeamListView.tsx +1336 -0
- package/src/renderer/components/team/TeamProvisioningBanner.tsx +16 -0
- package/src/renderer/components/team/TeamProvisioningPanel.tsx +115 -0
- package/src/renderer/components/team/TeamSessionsSection.tsx +267 -0
- package/src/renderer/components/team/ToolApprovalDiffPreview.tsx +206 -0
- package/src/renderer/components/team/ToolApprovalSheet.tsx +675 -0
- package/src/renderer/components/team/UnreadCommentsBadge.tsx +37 -0
- package/src/renderer/components/team/activity/ActiveTasksBlock.tsx +191 -0
- package/src/renderer/components/team/activity/ActivityItem.tsx +1649 -0
- package/src/renderer/components/team/activity/ActivityTimeline.tsx +959 -0
- package/src/renderer/components/team/activity/AnimatedHeightReveal.tsx +117 -0
- package/src/renderer/components/team/activity/LeadThoughtsGroup.tsx +1152 -0
- package/src/renderer/components/team/activity/MessageExpandDialog.tsx +213 -0
- package/src/renderer/components/team/activity/PendingRepliesBlock.tsx +275 -0
- package/src/renderer/components/team/activity/ReplyQuoteBlock.tsx +79 -0
- package/src/renderer/components/team/activity/ThoughtBodyContent.tsx +150 -0
- package/src/renderer/components/team/activity/activityMarkdown.ts +36 -0
- package/src/renderer/components/team/activity/activityMessageContext.ts +68 -0
- package/src/renderer/components/team/activity/collapseState.ts +66 -0
- package/src/renderer/components/team/activity/useNewItemKeys.ts +70 -0
- package/src/renderer/components/team/attachments/AttachmentDisplay.tsx +132 -0
- package/src/renderer/components/team/attachments/AttachmentPreviewItem.tsx +62 -0
- package/src/renderer/components/team/attachments/AttachmentPreviewList.tsx +193 -0
- package/src/renderer/components/team/attachments/AttachmentThumbnail.tsx +42 -0
- package/src/renderer/components/team/attachments/DropZoneOverlay.tsx +54 -0
- package/src/renderer/components/team/attachments/ImageLightbox.tsx +132 -0
- package/src/renderer/components/team/attachments/SourceMessageAttachments.tsx +70 -0
- package/src/renderer/components/team/dialogs/AddMemberDialog.tsx +222 -0
- package/src/renderer/components/team/dialogs/AdvancedCliSection.tsx +347 -0
- package/src/renderer/components/team/dialogs/AnthropicFastModeSelector.tsx +120 -0
- package/src/renderer/components/team/dialogs/CreateTaskDialog.tsx +489 -0
- package/src/renderer/components/team/dialogs/CreateTeamDialog.tsx +484 -0
- package/src/renderer/components/team/dialogs/EditTeamDialog.tsx +448 -0
- package/src/renderer/components/team/dialogs/EffortLevelSelector.tsx +69 -0
- package/src/renderer/components/team/dialogs/GlobalTaskDetailDialog.tsx +165 -0
- package/src/renderer/components/team/dialogs/LaunchTeamDialog.tsx +2859 -0
- package/src/renderer/components/team/dialogs/LimitContextCheckbox.tsx +57 -0
- package/src/renderer/components/team/dialogs/MembersJsonEditor.tsx +123 -0
- package/src/renderer/components/team/dialogs/OptionalSettingsSection.tsx +124 -0
- package/src/renderer/components/team/dialogs/PlatformManualForm.tsx +145 -0
- package/src/renderer/components/team/dialogs/PlatformSetupQR.tsx +289 -0
- package/src/renderer/components/team/dialogs/ProjectPathSelector.tsx +330 -0
- package/src/renderer/components/team/dialogs/ProvisioningProviderStatusList.tsx +744 -0
- package/src/renderer/components/team/dialogs/ReviewDialog.tsx +130 -0
- package/src/renderer/components/team/dialogs/SendMessageDialog.tsx +530 -0
- package/src/renderer/components/team/dialogs/SkipPermissionsCheckbox.tsx +62 -0
- package/src/renderer/components/team/dialogs/StatusHistoryTimeline.tsx +229 -0
- package/src/renderer/components/team/dialogs/TaskAttachments.tsx +394 -0
- package/src/renderer/components/team/dialogs/TaskCommentAwaitingReply.tsx +57 -0
- package/src/renderer/components/team/dialogs/TaskCommentInput.tsx +420 -0
- package/src/renderer/components/team/dialogs/TaskCommentsSection.tsx +620 -0
- package/src/renderer/components/team/dialogs/TaskDetailDialog.tsx +1480 -0
- package/src/renderer/components/team/dialogs/TeamModelSelector.tsx +560 -0
- package/src/renderer/components/team/dialogs/TeammateRuntimeCompatibilityNotice.tsx +60 -0
- package/src/renderer/components/team/dialogs/ToolApprovalSettingsPanel.tsx +173 -0
- package/src/renderer/components/team/dialogs/editTeamRuntimeChanges.ts +179 -0
- package/src/renderer/components/team/dialogs/globalTaskDetailDialogLoading.ts +34 -0
- package/src/renderer/components/team/dialogs/launchDialogPrefill.ts +125 -0
- package/src/renderer/components/team/dialogs/memberModelScope.ts +77 -0
- package/src/renderer/components/team/dialogs/platformMeta.ts +118 -0
- package/src/renderer/components/team/dialogs/projectPathOptions.ts +50 -0
- package/src/renderer/components/team/dialogs/providerPrepareDiagnostics.ts +222 -0
- package/src/renderer/components/team/dialogs/providerPrepareRequestSignature.ts +122 -0
- package/src/renderer/components/team/dialogs/provisioningMemberScope.ts +10 -0
- package/src/renderer/components/team/dialogs/provisioningModelIssues.ts +124 -0
- package/src/renderer/components/team/dialogs/teamNameSets.ts +67 -0
- package/src/renderer/components/team/dialogs/teamRelaunchFlow.ts +30 -0
- package/src/renderer/components/team/dialogs/teammateLaunchMode.ts +49 -0
- package/src/renderer/components/team/dialogs/teammateRuntimeCompatibility.tsx +101 -0
- package/src/renderer/components/team/editor/CodeMirrorEditor.tsx +506 -0
- package/src/renderer/components/team/editor/EditorBinaryPlaceholder.tsx +43 -0
- package/src/renderer/components/team/editor/EditorBinaryState.tsx +29 -0
- package/src/renderer/components/team/editor/EditorBreadcrumb.tsx +84 -0
- package/src/renderer/components/team/editor/EditorContextMenu.tsx +213 -0
- package/src/renderer/components/team/editor/EditorEmptyState.tsx +35 -0
- package/src/renderer/components/team/editor/EditorErrorBoundary.tsx +63 -0
- package/src/renderer/components/team/editor/EditorErrorState.tsx +41 -0
- package/src/renderer/components/team/editor/EditorFileTree.tsx +903 -0
- package/src/renderer/components/team/editor/EditorImagePreview.tsx +138 -0
- package/src/renderer/components/team/editor/EditorSearchPanel.tsx +508 -0
- package/src/renderer/components/team/editor/EditorSelectionMenu.tsx +112 -0
- package/src/renderer/components/team/editor/EditorShortcutsHelp.tsx +125 -0
- package/src/renderer/components/team/editor/EditorStatusBar.tsx +72 -0
- package/src/renderer/components/team/editor/EditorTabBar.tsx +265 -0
- package/src/renderer/components/team/editor/EditorTabContextMenu.tsx +88 -0
- package/src/renderer/components/team/editor/EditorToolbar.tsx +163 -0
- package/src/renderer/components/team/editor/FileIcon.tsx +66 -0
- package/src/renderer/components/team/editor/GitStatusBadge.tsx +47 -0
- package/src/renderer/components/team/editor/GoToLineDialog.tsx +186 -0
- package/src/renderer/components/team/editor/MarkdownPreviewPane.tsx +57 -0
- package/src/renderer/components/team/editor/MarkdownSplitView.tsx +127 -0
- package/src/renderer/components/team/editor/NewFileDialog.tsx +131 -0
- package/src/renderer/components/team/editor/ProjectEditorOverlay.tsx +924 -0
- package/src/renderer/components/team/editor/QuickOpenDialog.tsx +163 -0
- package/src/renderer/components/team/editor/SearchInFilesPanel.tsx +358 -0
- package/src/renderer/components/team/editor/fileIcons.ts +222 -0
- package/src/renderer/components/team/kanban/KanbanBoard.tsx +664 -0
- package/src/renderer/components/team/kanban/KanbanColumn.tsx +61 -0
- package/src/renderer/components/team/kanban/KanbanFilterPopover.tsx +210 -0
- package/src/renderer/components/team/kanban/KanbanGridLayout.tsx +460 -0
- package/src/renderer/components/team/kanban/KanbanSearchInput.tsx +284 -0
- package/src/renderer/components/team/kanban/KanbanSortPopover.tsx +140 -0
- package/src/renderer/components/team/kanban/KanbanTaskCard.test.tsx +199 -0
- package/src/renderer/components/team/kanban/KanbanTaskCard.tsx +446 -0
- package/src/renderer/components/team/kanban/TrashDialog.tsx +112 -0
- package/src/renderer/components/team/members/CurrentTaskIndicator.tsx +56 -0
- package/src/renderer/components/team/members/LeadModelRow.test.tsx +133 -0
- package/src/renderer/components/team/members/LeadModelRow.tsx +183 -0
- package/src/renderer/components/team/members/MemberCard.tsx +665 -0
- package/src/renderer/components/team/members/MemberDetailDialog.tsx +309 -0
- package/src/renderer/components/team/members/MemberDetailHeader.tsx +183 -0
- package/src/renderer/components/team/members/MemberDetailStats.tsx +80 -0
- package/src/renderer/components/team/members/MemberDraftRow.test.tsx +184 -0
- package/src/renderer/components/team/members/MemberDraftRow.tsx +515 -0
- package/src/renderer/components/team/members/MemberExecutionLog.tsx +224 -0
- package/src/renderer/components/team/members/MemberHoverCard.tsx +292 -0
- package/src/renderer/components/team/members/MemberLaunchDiagnosticsButton.tsx +60 -0
- package/src/renderer/components/team/members/MemberList.tsx +405 -0
- package/src/renderer/components/team/members/MemberLogsTab.tsx +958 -0
- package/src/renderer/components/team/members/MemberMessagesTab.tsx +251 -0
- package/src/renderer/components/team/members/MemberPresenceDot.tsx +28 -0
- package/src/renderer/components/team/members/MemberRoleEditor.tsx +84 -0
- package/src/renderer/components/team/members/MemberStatsTab.tsx +299 -0
- package/src/renderer/components/team/members/MemberTasksTab.tsx +87 -0
- package/src/renderer/components/team/members/MemberWorkspaceTab.tsx +141 -0
- package/src/renderer/components/team/members/MembersEditorSection.tsx +495 -0
- package/src/renderer/components/team/members/SubagentRecentMessagesPreview.tsx +125 -0
- package/src/renderer/components/team/members/TeamRosterEditorSection.tsx +153 -0
- package/src/renderer/components/team/members/memberActivityEntries.ts +42 -0
- package/src/renderer/components/team/members/memberDetailTypes.ts +3 -0
- package/src/renderer/components/team/members/memberNameSets.ts +65 -0
- package/src/renderer/components/team/members/membersEditorTypes.ts +21 -0
- package/src/renderer/components/team/members/membersEditorUtils.ts +267 -0
- package/src/renderer/components/team/messages/MessageComposer.tsx +939 -0
- package/src/renderer/components/team/messages/MessagesFilterPopover.tsx +228 -0
- package/src/renderer/components/team/messages/MessagesPanel.tsx +1508 -0
- package/src/renderer/components/team/messages/OpenCodeDeliveryWarning.tsx +151 -0
- package/src/renderer/components/team/messages/StatusBlock.tsx +126 -0
- package/src/renderer/components/team/provisioningSteps.ts +363 -0
- package/src/renderer/components/team/review/ChangeReviewDialog.tsx +133 -0
- package/src/renderer/components/team/schedule/CcCronScheduleDialog.tsx +218 -0
- package/src/renderer/components/team/schedule/CronScheduleInput.tsx +254 -0
- package/src/renderer/components/team/schedule/ScheduleEmptyState.tsx +15 -0
- package/src/renderer/components/team/schedule/ScheduleRunLogDialog.tsx +277 -0
- package/src/renderer/components/team/schedule/ScheduleRunRow.tsx +106 -0
- package/src/renderer/components/team/schedule/ScheduleSection.tsx +281 -0
- package/src/renderer/components/team/schedule/ScheduleStatusBadge.tsx +55 -0
- package/src/renderer/components/team/sidebar/TeamSidebarHost.tsx +76 -0
- package/src/renderer/components/team/sidebar/TeamSidebarPortalManager.ts +173 -0
- package/src/renderer/components/team/sidebar/TeamSidebarPortalSource.tsx +66 -0
- package/src/renderer/components/team/sidebar/TeamSidebarRail.tsx +68 -0
- package/src/renderer/components/team/sidebar/teamSidebarUiState.ts +136 -0
- package/src/renderer/components/team/taskLogs/ExactTaskLogCard.tsx +132 -0
- package/src/renderer/components/team/taskLogs/ExactTaskLogsSection.tsx +258 -0
- package/src/renderer/components/team/taskLogs/ExecutionSessionsSection.tsx +48 -0
- package/src/renderer/components/team/taskLogs/TaskActivityLinkedToolCard.tsx +31 -0
- package/src/renderer/components/team/taskLogs/TaskActivitySection.tsx +462 -0
- package/src/renderer/components/team/taskLogs/TaskLogStreamSection.tsx +375 -0
- package/src/renderer/components/team/taskLogs/TaskLogsPanel.tsx +294 -0
- package/src/renderer/components/team/taskLogs/featureGates.ts +22 -0
- package/src/renderer/components/team/tasks/TaskList.tsx +111 -0
- package/src/renderer/components/team/tasks/TaskRow.tsx +65 -0
- package/src/renderer/components/team/teamProjectSelection.ts +156 -0
- package/src/renderer/components/team/teamSessionFetchGuards.ts +26 -0
- package/src/renderer/components/team/useClaudeLogsController.ts +668 -0
- package/src/renderer/components/team/useTeamProvisioningPresentation.ts +54 -0
- package/src/renderer/components/terminal/TerminalLogPanel.tsx +37 -0
- package/src/renderer/components/ui/ChipInteractionLayer.tsx +255 -0
- package/src/renderer/components/ui/CodeChipBadge.tsx +37 -0
- package/src/renderer/components/ui/ExpandableContent.tsx +110 -0
- package/src/renderer/components/ui/MemberSelect.tsx +209 -0
- package/src/renderer/components/ui/MentionInteractionLayer.tsx +121 -0
- package/src/renderer/components/ui/MentionSuggestionList.tsx +274 -0
- package/src/renderer/components/ui/MentionableTextarea.tsx +1426 -0
- package/src/renderer/components/ui/SlashCommandInteractionLayer.tsx +88 -0
- package/src/renderer/components/ui/TaskReferenceInteractionLayer.tsx +101 -0
- package/src/renderer/components/ui/UrlInteractionLayer.tsx +102 -0
- package/src/renderer/components/ui/alert-dialog.tsx +127 -0
- package/src/renderer/components/ui/auto-resize-textarea.tsx +93 -0
- package/src/renderer/components/ui/badge.tsx +37 -0
- package/src/renderer/components/ui/button.tsx +54 -0
- package/src/renderer/components/ui/checkbox.tsx +29 -0
- package/src/renderer/components/ui/combobox.tsx +168 -0
- package/src/renderer/components/ui/context-menu.tsx +124 -0
- package/src/renderer/components/ui/dialog.tsx +114 -0
- package/src/renderer/components/ui/hover-card.tsx +30 -0
- package/src/renderer/components/ui/input.tsx +22 -0
- package/src/renderer/components/ui/label.tsx +21 -0
- package/src/renderer/components/ui/popover.tsx +31 -0
- package/src/renderer/components/ui/select.tsx +150 -0
- package/src/renderer/components/ui/tabs.tsx +52 -0
- package/src/renderer/components/ui/textarea.tsx +21 -0
- package/src/renderer/components/ui/tiptap/TiptapBubbleMenu.tsx +75 -0
- package/src/renderer/components/ui/tiptap/TiptapEditor.tsx +73 -0
- package/src/renderer/components/ui/tiptap/TiptapToolbar.tsx +269 -0
- package/src/renderer/components/ui/tiptap/index.ts +3 -0
- package/src/renderer/components/ui/tiptap/presets.ts +46 -0
- package/src/renderer/components/ui/tiptap/tiptapStyles.css +235 -0
- package/src/renderer/components/ui/tiptap/types.ts +32 -0
- package/src/renderer/components/ui/tiptap/useTiptapEditor.ts +94 -0
- package/src/renderer/components/ui/tooltip.tsx +32 -0
- package/src/renderer/constants/cssVariables.ts +226 -0
- package/src/renderer/constants/layout.ts +6 -0
- package/src/renderer/constants/teamColors.ts +397 -0
- package/src/renderer/constants/teamRoles.ts +41 -0
- package/src/renderer/contexts/TabUIContext.tsx +51 -0
- package/src/renderer/contexts/useTabUIContext.ts +18 -0
- package/src/renderer/favicon.png +0 -0
- package/src/renderer/features/CLAUDE.md +19 -0
- package/src/renderer/hooks/navigation/utils.ts +263 -0
- package/src/renderer/hooks/useAttachments.ts +312 -0
- package/src/renderer/hooks/useAutoScrollBottom.ts +285 -0
- package/src/renderer/hooks/useBranchSync.ts +105 -0
- package/src/renderer/hooks/useChipDraftPersistence.ts +172 -0
- package/src/renderer/hooks/useCliInstaller.ts +106 -0
- package/src/renderer/hooks/useCollapsedGroups.ts +71 -0
- package/src/renderer/hooks/useComposerDraft.ts +504 -0
- package/src/renderer/hooks/useContinuousScrollNav.ts +50 -0
- package/src/renderer/hooks/useCreateTeamDraft.ts +280 -0
- package/src/renderer/hooks/useDraftPersistence.ts +140 -0
- package/src/renderer/hooks/useEditorKeyboardShortcuts.ts +257 -0
- package/src/renderer/hooks/useEffectiveCliProviderStatus.ts +66 -0
- package/src/renderer/hooks/useExtensionsTabState.ts +206 -0
- package/src/renderer/hooks/useFileListCacheWarmer.ts +38 -0
- package/src/renderer/hooks/useFileSuggestions.ts +255 -0
- package/src/renderer/hooks/useKeyboardShortcuts.ts +363 -0
- package/src/renderer/hooks/useLazyFileContent.ts +150 -0
- package/src/renderer/hooks/useMarkCommentsRead.ts +27 -0
- package/src/renderer/hooks/useMarkdownScrollSync.ts +158 -0
- package/src/renderer/hooks/useMemberStats.ts +45 -0
- package/src/renderer/hooks/useMentionDetection.ts +375 -0
- package/src/renderer/hooks/usePersistedGridLayout.ts +109 -0
- package/src/renderer/hooks/useResizableColumns.ts +140 -0
- package/src/renderer/hooks/useResizablePanel.ts +144 -0
- package/src/renderer/hooks/useStableTeamMentionMeta.ts +68 -0
- package/src/renderer/hooks/useSyncedAnimationStyle.ts +29 -0
- package/src/renderer/hooks/useTabNavigationController.ts +524 -0
- package/src/renderer/hooks/useTabUI.ts +252 -0
- package/src/renderer/hooks/useTaskLocalState.ts +163 -0
- package/src/renderer/hooks/useTaskSuggestions.ts +131 -0
- package/src/renderer/hooks/useTeamMessagesExpanded.ts +34 -0
- package/src/renderer/hooks/useTeamMessagesRead.ts +52 -0
- package/src/renderer/hooks/useTeamSuggestions.ts +78 -0
- package/src/renderer/hooks/useTheme.ts +138 -0
- package/src/renderer/hooks/useToolApprovalDiff.ts +212 -0
- package/src/renderer/hooks/useUnreadCommentCount.ts +14 -0
- package/src/renderer/hooks/useViewedFiles.ts +74 -0
- package/src/renderer/hooks/useViewportCommentRead.ts +147 -0
- package/src/renderer/hooks/useViewportObserver.ts +138 -0
- package/src/renderer/hooks/useVisibleAIGroup.ts +122 -0
- package/src/renderer/hooks/useVisibleFileSection.ts +114 -0
- package/src/renderer/hooks/useZoomFactor.ts +36 -0
- package/src/renderer/index.css +1560 -0
- package/src/renderer/index.html +1293 -0
- package/src/renderer/lib/utils.ts +6 -0
- package/src/renderer/main.tsx +30 -0
- package/src/renderer/sentry.ts +104 -0
- package/src/renderer/services/__tests__/createTeamPreferences.test.ts +67 -0
- package/src/renderer/services/commentReadStorage.ts +349 -0
- package/src/renderer/services/composerDraftStorage.ts +271 -0
- package/src/renderer/services/contextStorage.ts +201 -0
- package/src/renderer/services/createTeamDraftStorage.ts +151 -0
- package/src/renderer/services/createTeamPreferences.ts +361 -0
- package/src/renderer/services/dashboardCliStatusBannerPreference.ts +20 -0
- package/src/renderer/services/draftStorage.ts +128 -0
- package/src/renderer/services/layout-system/BrowserGridLayoutRepository.ts +111 -0
- package/src/renderer/services/layout-system/GridLayoutRepository.ts +8 -0
- package/src/renderer/services/layout-system/gridLayoutSchema.ts +137 -0
- package/src/renderer/services/layout-system/gridLayoutTypes.ts +17 -0
- package/src/renderer/store/index.ts +1556 -0
- package/src/renderer/store/slices/changeReviewSlice.ts +1694 -0
- package/src/renderer/store/slices/cliInstallerSlice.ts +689 -0
- package/src/renderer/store/slices/configSlice.ts +111 -0
- package/src/renderer/store/slices/connectionSlice.ts +221 -0
- package/src/renderer/store/slices/contextSlice.ts +394 -0
- package/src/renderer/store/slices/conversationSlice.ts +510 -0
- package/src/renderer/store/slices/editorSlice.ts +1455 -0
- package/src/renderer/store/slices/extensionsSlice.ts +1415 -0
- package/src/renderer/store/slices/notificationSlice.ts +277 -0
- package/src/renderer/store/slices/paneSlice.ts +357 -0
- package/src/renderer/store/slices/projectSlice.ts +70 -0
- package/src/renderer/store/slices/repositorySlice.ts +165 -0
- package/src/renderer/store/slices/scheduleSlice.ts +246 -0
- package/src/renderer/store/slices/sessionDetailSlice.ts +755 -0
- package/src/renderer/store/slices/sessionSlice.ts +539 -0
- package/src/renderer/store/slices/subagentSlice.ts +145 -0
- package/src/renderer/store/slices/tabSlice.ts +842 -0
- package/src/renderer/store/slices/tabUISlice.ts +319 -0
- package/src/renderer/store/slices/teamSlice.ts +5080 -0
- package/src/renderer/store/slices/uiSlice.ts +45 -0
- package/src/renderer/store/types.ts +103 -0
- package/src/renderer/store/utils/paneHelpers.ts +134 -0
- package/src/renderer/store/utils/pathResolution.ts +121 -0
- package/src/renderer/store/utils/stateResetHelpers.ts +72 -0
- package/src/renderer/types/api.ts +8 -0
- package/src/renderer/types/claudeMd.ts +74 -0
- package/src/renderer/types/contextInjection.ts +309 -0
- package/src/renderer/types/data.ts +144 -0
- package/src/renderer/types/groups.ts +406 -0
- package/src/renderer/types/inlineChip.ts +110 -0
- package/src/renderer/types/mention.ts +38 -0
- package/src/renderer/types/notifications.ts +18 -0
- package/src/renderer/types/panes.ts +35 -0
- package/src/renderer/types/sessionReport.ts +386 -0
- package/src/renderer/types/tabs.ts +249 -0
- package/src/renderer/types/teamMessagesPanelMode.ts +1 -0
- package/src/renderer/utils/__tests__/teamEffortOptions.test.ts +217 -0
- package/src/renderer/utils/__tests__/teamModelAvailability.codexCatalog.test.ts +383 -0
- package/src/renderer/utils/agentMessageFormatting.ts +139 -0
- package/src/renderer/utils/aiGroupEnhancer.ts +78 -0
- package/src/renderer/utils/aiGroupHelpers.ts +208 -0
- package/src/renderer/utils/attachmentUtils.ts +60 -0
- package/src/renderer/utils/bootstrapPromptSanitizer.ts +225 -0
- package/src/renderer/utils/bugReportUtils.ts +157 -0
- package/src/renderer/utils/buildSelectionAction.ts +116 -0
- package/src/renderer/utils/chipUtils.ts +372 -0
- package/src/renderer/utils/claudeCodeOnlyProviders.ts +126 -0
- package/src/renderer/utils/claudeMdTracker.ts +644 -0
- package/src/renderer/utils/codemirrorLanguages.ts +141 -0
- package/src/renderer/utils/codemirrorSelectionInfo.ts +41 -0
- package/src/renderer/utils/codemirrorTheme.ts +138 -0
- package/src/renderer/utils/contextMath.ts +55 -0
- package/src/renderer/utils/contextTracker.ts +1100 -0
- package/src/renderer/utils/crossTeamPendingReplies.ts +92 -0
- package/src/renderer/utils/dateGrouping.ts +91 -0
- package/src/renderer/utils/diffViewedStorage.ts +120 -0
- package/src/renderer/utils/displayItemBuilder.ts +587 -0
- package/src/renderer/utils/displaySummary.ts +74 -0
- package/src/renderer/utils/editorBridge.ts +90 -0
- package/src/renderer/utils/fileTreeBuilder.ts +110 -0
- package/src/renderer/utils/formatAgentRole.ts +24 -0
- package/src/renderer/utils/formatters.ts +61 -0
- package/src/renderer/utils/groupTransformer.ts +744 -0
- package/src/renderer/utils/idleNotificationSemantics.ts +76 -0
- package/src/renderer/utils/keyboardUtils.ts +92 -0
- package/src/renderer/utils/lastOutputDetector.ts +150 -0
- package/src/renderer/utils/markdownPlugins.ts +60 -0
- package/src/renderer/utils/memberAvatarCatalog.ts +38 -0
- package/src/renderer/utils/memberHelpers.ts +858 -0
- package/src/renderer/utils/memberLaunchDiagnostics.ts +216 -0
- package/src/renderer/utils/memberRuntimeSummary.ts +122 -0
- package/src/renderer/utils/memberSpawnStatusPolling.ts +29 -0
- package/src/renderer/utils/mentionLinkify.ts +90 -0
- package/src/renderer/utils/mentionSuggestions.ts +34 -0
- package/src/renderer/utils/mergeTeamMessages.ts +27 -0
- package/src/renderer/utils/messageRenderEquality.ts +158 -0
- package/src/renderer/utils/modelExtractor.ts +90 -0
- package/src/renderer/utils/multimodelProviderVisibility.ts +32 -0
- package/src/renderer/utils/openCodeModelRecommendations.ts +1326 -0
- package/src/renderer/utils/openCodeRuntimeDeliveryDiagnostics.ts +79 -0
- package/src/renderer/utils/pathDisplay.ts +149 -0
- package/src/renderer/utils/pathNormalize.ts +61 -0
- package/src/renderer/utils/pathUtils.ts +47 -0
- package/src/renderer/utils/platformKeys.ts +24 -0
- package/src/renderer/utils/previewRegistry.ts +45 -0
- package/src/renderer/utils/projectColor.ts +54 -0
- package/src/renderer/utils/projectLookup.ts +64 -0
- package/src/renderer/utils/providerBackendIdentity.ts +43 -0
- package/src/renderer/utils/providerSlashCommands.ts +122 -0
- package/src/renderer/utils/quickOpenCache.ts +40 -0
- package/src/renderer/utils/refreshCliStatus.ts +17 -0
- package/src/renderer/utils/reportAssessments.ts +555 -0
- package/src/renderer/utils/reviewDecisionScope.ts +81 -0
- package/src/renderer/utils/reviewKey.ts +132 -0
- package/src/renderer/utils/runtimeDisplayName.ts +26 -0
- package/src/renderer/utils/scheduleFormatters.ts +45 -0
- package/src/renderer/utils/sessionAnalyzer.ts +1346 -0
- package/src/renderer/utils/sessionExporter.ts +427 -0
- package/src/renderer/utils/sessionTitleParser.ts +69 -0
- package/src/renderer/utils/skillCommandSuggestions.ts +77 -0
- package/src/renderer/utils/slashCommandExtractor.ts +154 -0
- package/src/renderer/utils/streamJsonParser.ts +393 -0
- package/src/renderer/utils/stringUtils.ts +50 -0
- package/src/renderer/utils/syntaxHighlighter.ts +158 -0
- package/src/renderer/utils/tabLabelDisambiguation.ts +99 -0
- package/src/renderer/utils/taskChangePresence.ts +19 -0
- package/src/renderer/utils/taskChangeRequest.ts +122 -0
- package/src/renderer/utils/taskCommentPendingReply.ts +74 -0
- package/src/renderer/utils/taskGrouping.ts +151 -0
- package/src/renderer/utils/taskReferenceUtils.ts +331 -0
- package/src/renderer/utils/teamEffortOptions.ts +150 -0
- package/src/renderer/utils/teamLaunchSummaryCopy.ts +17 -0
- package/src/renderer/utils/teamMessageExpandStorage.ts +39 -0
- package/src/renderer/utils/teamMessageFiltering.ts +95 -0
- package/src/renderer/utils/teamMessageKey.ts +14 -0
- package/src/renderer/utils/teamMessageReadStorage.ts +49 -0
- package/src/renderer/utils/teamModelAvailability.ts +465 -0
- package/src/renderer/utils/teamModelCatalog.ts +502 -0
- package/src/renderer/utils/teamModelContext.ts +34 -0
- package/src/renderer/utils/teamProvisioningPresentation.ts +772 -0
- package/src/renderer/utils/teamRuntimeSummary.ts +53 -0
- package/src/renderer/utils/toolLinkingEngine.ts +117 -0
- package/src/renderer/utils/toolRendering/index.ts +14 -0
- package/src/renderer/utils/toolRendering/toolContentChecks.ts +58 -0
- package/src/renderer/utils/toolRendering/toolSummaryHelpers.ts +276 -0
- package/src/renderer/utils/toolRendering/toolTokens.ts +57 -0
- package/src/renderer/utils/unwrapIpc.ts +31 -0
- package/src/renderer/utils/urlMatchUtils.ts +45 -0
- package/src/renderer/vite-env.d.ts +21 -0
- package/src/shared/constants/agentBlocks.ts +129 -0
- package/src/shared/constants/attachments.ts +175 -0
- package/src/shared/constants/cache.ts +12 -0
- package/src/shared/constants/cli.ts +15 -0
- package/src/shared/constants/crossTeam.ts +126 -0
- package/src/shared/constants/index.ts +15 -0
- package/src/shared/constants/kanban.ts +9 -0
- package/src/shared/constants/memberColors.ts +140 -0
- package/src/shared/constants/opencodeTaskLogAttribution.ts +1 -0
- package/src/shared/constants/teamLimits.ts +2 -0
- package/src/shared/constants/trafficLights.ts +60 -0
- package/src/shared/constants/triggerColors.ts +126 -0
- package/src/shared/constants/window.ts +12 -0
- package/src/shared/types/api.ts +1062 -0
- package/src/shared/types/ccConnect.ts +399 -0
- package/src/shared/types/cliInstaller.ts +335 -0
- package/src/shared/types/editor.ts +279 -0
- package/src/shared/types/extensions/api.ts +90 -0
- package/src/shared/types/extensions/apikey.ts +40 -0
- package/src/shared/types/extensions/common.ts +16 -0
- package/src/shared/types/extensions/index.ts +67 -0
- package/src/shared/types/extensions/mcp.ts +132 -0
- package/src/shared/types/extensions/plugin.ts +85 -0
- package/src/shared/types/extensions/skill.ts +173 -0
- package/src/shared/types/index.ts +48 -0
- package/src/shared/types/ipc.ts +5 -0
- package/src/shared/types/notifications.ts +407 -0
- package/src/shared/types/providers.ts +116 -0
- package/src/shared/types/review.ts +319 -0
- package/src/shared/types/schedule.ts +124 -0
- package/src/shared/types/team.ts +1726 -0
- package/src/shared/types/terminal.ts +49 -0
- package/src/shared/types/visualization.ts +60 -0
- package/src/shared/utils/__tests__/contextMetrics.test.ts +260 -0
- package/src/shared/utils/__tests__/ephemeralProjectPath.test.ts +42 -0
- package/src/shared/utils/__tests__/teamProvider.test.ts +29 -0
- package/src/shared/utils/agentLanguage.ts +122 -0
- package/src/shared/utils/anthropicLaunchModel.ts +96 -0
- package/src/shared/utils/anthropicModelDefaults.ts +3 -0
- package/src/shared/utils/apiErrorDetector.ts +13 -0
- package/src/shared/utils/boardTaskActivityLabels.ts +128 -0
- package/src/shared/utils/boardTaskActivityPresentation.ts +75 -0
- package/src/shared/utils/cliArgsParser.ts +129 -0
- package/src/shared/utils/contentSanitizer.ts +207 -0
- package/src/shared/utils/contextMetrics.ts +236 -0
- package/src/shared/utils/costFormatting.ts +45 -0
- package/src/shared/utils/diffContextHash.ts +22 -0
- package/src/shared/utils/effortLevels.ts +73 -0
- package/src/shared/utils/ephemeralProjectPath.ts +41 -0
- package/src/shared/utils/errorHandling.ts +26 -0
- package/src/shared/utils/extensionNormalizers.ts +336 -0
- package/src/shared/utils/idleNotificationSemantics.ts +86 -0
- package/src/shared/utils/inboxNoise.ts +158 -0
- package/src/shared/utils/leadDetection.ts +63 -0
- package/src/shared/utils/logger.ts +69 -0
- package/src/shared/utils/markdownTextSearch.ts +210 -0
- package/src/shared/utils/mcpScopes.ts +36 -0
- package/src/shared/utils/modelParser.ts +158 -0
- package/src/shared/utils/opencodeModelRef.ts +78 -0
- package/src/shared/utils/platformPath.ts +103 -0
- package/src/shared/utils/pricing.ts +129 -0
- package/src/shared/utils/providerBackend.ts +90 -0
- package/src/shared/utils/providerExtensionCapabilities.ts +92 -0
- package/src/shared/utils/providerModelSelection.ts +5 -0
- package/src/shared/utils/providerModelVisibility.ts +47 -0
- package/src/shared/utils/rateLimitDetector.ts +334 -0
- package/src/shared/utils/reviewState.ts +74 -0
- package/src/shared/utils/sentryConfig.ts +26 -0
- package/src/shared/utils/skillRoots.ts +93 -0
- package/src/shared/utils/slashCommands.ts +128 -0
- package/src/shared/utils/taskChangePresence.ts +35 -0
- package/src/shared/utils/taskChangeSince.ts +51 -0
- package/src/shared/utils/taskChangeState.ts +49 -0
- package/src/shared/utils/taskHistory.ts +82 -0
- package/src/shared/utils/taskIdentity.ts +32 -0
- package/src/shared/utils/teamGraphDefaultLayout.ts +97 -0
- package/src/shared/utils/teamMemberColors.ts +107 -0
- package/src/shared/utils/teamMemberName.ts +77 -0
- package/src/shared/utils/teamProvider.ts +73 -0
- package/src/shared/utils/teamStableOwnerId.ts +12 -0
- package/src/shared/utils/teammateMessageParser.ts +52 -0
- package/src/shared/utils/tokenFormatting.ts +91 -0
- package/src/shared/utils/toolSummary.ts +279 -0
- package/src/shared/utils/version.ts +29 -0
- package/src/types/agent-teams-controller.d.ts +163 -0
- package/src/types/node-pty.d.ts +22 -0
- package/src/types/pidusage.d.ts +23 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import{e6 as kp,e7 as Cp,bj as uf,dS as Np,bn as wp,bk as je,aV as bp,aW as Il,dI as _p,dL as df,dM as ff,dJ as Ip,dX as $l,aY as Hn,aZ as oe,bl as $p,bf as Pp,ba as gt,e8 as Lp,e9 as _n}from"./index-CZltVMDP.js";import{k as Sr,j as nl,g as Ur,S as Op,w as xp,x as Dp,c as hf,v as Le,y as pf,l as Mp,z as Fp,A as Gp,B as Up,C as jp,a as mf,d as j,i as tn,r as Ye,f as dt,D as Me}from"./_baseUniq-BofrAFBx.js";import{j as rl,m as M,d as zp,f as yt,g as kr,h as B,i as il,l as jn,e as Bp}from"./_basePickBy-Ct8Hm5_h.js";import{c as Be}from"./clone-CMuwA8RV.js";var qp=Object.prototype,Wp=qp.hasOwnProperty,ut=kp(function(t,e){if(Cp(e)||uf(e)){Np(e,Sr(e),t);return}for(var n in e)Wp.call(e,n)&&wp(t,n,e[n])});function gf(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function Ui(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}function Vp(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(r,a,n(a),t)}return r}function Kp(t,e,n,r){return nl(t,function(i,s,a){e(r,i,n(i),a)}),r}function Hp(t,e){return function(n,r){var i=je(n)?Vp:Kp,s=e?e():{};return i(n,t,Ur(r),s)}}var Yp=200;function Xp(t,e,n,r){var i=-1,s=xp,a=!0,o=t.length,c=[],l=e.length;if(!o)return c;e.length>=Yp&&(s=Dp,a=!1,e=new Op(e));e:for(;++i<o;){var u=t[i],f=u;if(u=u!==0?u:0,a&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;c.push(u)}else s(e,f,r)||c.push(u)}return c}var ga=bp(function(t,e){return Il(t)?Xp(t,hf(e,1,Il,!0)):[]});function Fe(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:rl(e),gf(t,e<0?0:e,r)):[]}function Ci(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:rl(e),e=r-e,gf(t,0,e<0?0:e)):[]}function Jp(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 Qp(t,e){var n=!0;return nl(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function Nt(t,e,n){var r=je(t)?Jp:Qp;return r(t,Ur(e))}function bt(t){return t&&t.length?t[0]:void 0}function lt(t,e){return hf(M(t,e))}var Zp=Object.prototype,em=Zp.hasOwnProperty,tm=Hp(function(t,e,n){em.call(t,n)?t[n].push(e):_p(t,n,[e])}),nm="[object String]";function tt(t){return typeof t=="string"||!je(t)&&df(t)&&ff(t)==nm}var rm=Math.max;function Qe(t,e,n,r){t=uf(t)?t:Le(t),n=n?rl(n):0;var i=t.length;return n<0&&(n=rm(i+n,0)),tt(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&pf(t,e,n)>-1}function Pl(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return pf(t,e,i)}var im="[object RegExp]";function sm(t){return df(t)&&ff(t)==im}var Ll=$l&&$l.isRegExp,nn=Ll?Ip(Ll):sm,am="Expected a function";function om(t){if(typeof t!="function")throw new TypeError(am);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function _t(t,e){if(t==null)return{};var n=Mp(Fp(t),function(r){return[r]});return e=Ur(e),zp(t,n,function(r,i){return e(r,i[0])})}function ya(t,e){var n=je(t)?Gp:Up;return n(t,om(Ur(e)))}function cm(t,e){var n;return nl(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function yf(t,e,n){var r=je(t)?jp:cm;return r(t,Ur(e))}function sl(t){return t&&t.length?mf(t):[]}function lm(t,e){return t&&t.length?mf(t,Ur(e)):[]}function We(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function kt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function fn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function um(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function ni(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class Tf{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const n=this.types[e.container.$type];if(!n)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=n.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const n=this.types[e];return n||{name:e,properties:{},superTypes:[]}}isInstance(e,n){return We(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,n)):!1;return r[n]=a,a}}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 Ni(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Rf(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function vf(t){return Ni(t)&&typeof t.fullText=="string"}class Ge{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Ge(()=>({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 ot})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=dm(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Ge(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?ot:{done:!1,value:e(i)}})}filter(e){return new Ge(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return ot})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Ge(()=>({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(Us(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return ot})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Ge(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Us(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return ot})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Ge(()=>{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 Ge(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?ot:this.nextFn(n.state)))}distinct(e){return new Ge(()=>({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 ot})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function dm(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Us(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Ef=new Ge(()=>{},()=>ot),ot=Object.freeze({done:!0,value:void 0});function he(...t){if(t.length===1){const e=t[0];if(e instanceof Ge)return e;if(Us(e))return new Ge(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Ge(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:ot)}return t.length>1?new Ge(()=>({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++];Us(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return ot}):Ef}class al extends Ge{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return ot})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var ho;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(ho||(ho={}));function po(t,e={}){for(const[n,r]of Object.entries(t))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,s)=>{We(i)&&(i.$container=t,i.$containerProperty=n,i.$containerIndex=s,e.deep&&po(i,e))}):We(r)&&(r.$container=t,r.$containerProperty=n,e.deep&&po(r,e)))}function Ta(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Qt(t){const n=Cs(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Cs(t){for(;t.$container;)t=t.$container;return t}function Ol(t){return kt(t)?t.ref?[t.ref]:[]:fn(t)?t.items.map(e=>e.ref):[]}function ol(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Ge(()=>({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(We(s)){if(r.keyIndex++,xl(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(We(o)&&xl(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return ot})}function ji(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new al(t,n=>ol(n,e))}function Zt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new al(t,n=>ol(n,e),{includeRoot:!0})}function xl(t,e){if(!e)return!0;const n=t.$cstNode?.range;return n?Om(n,e):!1}function js(t){return new Ge(()=>({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(kt(r)||fn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(kt(s)||fn(r))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return ot})}function fm(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=Af(i.defaultValue))}function Af(t){return Array.isArray(t)?[...t.map(Af)]:t}const at={$type:"AbstractElement",cardinality:"cardinality"};function hm(t){return Z.isInstance(t,at.$type)}const Ns={$type:"AbstractParserRule"};function zi(t){return Z.isInstance(t,Ns.$type)}const hs={$type:"AbstractRule"},At={$type:"AbstractType"},Ln={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ra(t){return Z.isInstance(t,Ln.$type)}const ws={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Sf(t){return Z.isInstance(t,ws.$type)}const Dl={$type:"ArrayLiteral",elements:"elements"},Ml={$type:"ArrayType",elementType:"elementType"},On={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function zn(t){return Z.isInstance(t,On.$type)}const mo={$type:"BooleanLiteral",true:"true"};function pm(t){return Z.isInstance(t,mo.$type)}const xn={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function mm(t){return Z.isInstance(t,xn.$type)}const tr={$type:"Condition"},bs={$type:"Conjunction",left:"left",right:"right"};function gm(t){return Z.isInstance(t,bs.$type)}const Dn={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function va(t){return Z.isInstance(t,Dn.$type)}const _s={$type:"Disjunction",left:"left",right:"right"};function ym(t){return Z.isInstance(t,_s.$type)}const go={$type:"EndOfFile",cardinality:"cardinality"};function Tm(t){return Z.isInstance(t,go.$type)}const In={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Fl={$type:"GrammarImport",path:"path"},or={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function cl(t){return Z.isInstance(t,or.$type)}const yo={$type:"InferredType",name:"name"};function kf(t){return Z.isInstance(t,yo.$type)}const Vt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function zs(t){return Z.isInstance(t,Vt.$type)}const qa={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},Gl={$type:"InfixRuleOperators",precedences:"precedences"},pi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Rm(t){return Z.isInstance(t,pi.$type)}const mi={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Bn(t){return Z.isInstance(t,mi.$type)}const ps={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},cr={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function vm(t){return Z.isInstance(t,cr.$type)}const To={$type:"Negation",value:"value"};function Em(t){return Z.isInstance(t,To.$type)}const Ul={$type:"NumberLiteral",value:"value"},ms={$type:"Parameter",name:"name"},Ro={$type:"ParameterReference",parameter:"parameter"};function Am(t){return Z.isInstance(t,Ro.$type)}const Lt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function an(t){return Z.isInstance(t,Lt.$type)}const Wa={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},lr={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Sm(t){return Z.isInstance(t,lr.$type)}const vo={$type:"ReturnType",name:"name"};function km(t){return Z.isInstance(t,vo.$type)}const ur={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function qn(t){return Z.isInstance(t,ur.$type)}const gi={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Cm(t){return Z.isInstance(t,gi.$type)}const jl={$type:"StringLiteral",value:"value"},dr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Nm(t){return Z.isInstance(t,dr.$type)}const pt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},fr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function wm(t){return Z.isInstance(t,fr.$type)}const dn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function on(t){return Z.isInstance(t,dn.$type)}const hr={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function bm(t){return Z.isInstance(t,hr.$type)}const Is={$type:"Type",name:"name",type:"type"};function _m(t){return Z.isInstance(t,Is.$type)}const ri={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},ii={$type:"TypeDefinition"},zl={$type:"UnionType",types:"types"},$s={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Cf(t){return Z.isInstance(t,$s.$type)}const pr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Im(t){return Z.isInstance(t,pr.$type)}const si={$type:"ValueLiteral"},yi={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function $m(t){return Z.isInstance(t,yi.$type)}class Nf extends Tf{constructor(){super(...arguments),this.types={AbstractElement:{name:at.$type,properties:{cardinality:{name:at.cardinality}},superTypes:[]},AbstractParserRule:{name:Ns.$type,properties:{},superTypes:[hs.$type,At.$type]},AbstractRule:{name:hs.$type,properties:{},superTypes:[]},AbstractType:{name:At.$type,properties:{},superTypes:[]},Action:{name:Ln.$type,properties:{cardinality:{name:Ln.cardinality},feature:{name:Ln.feature},inferredType:{name:Ln.inferredType},operator:{name:Ln.operator},type:{name:Ln.type,referenceType:At.$type}},superTypes:[at.$type]},Alternatives:{name:ws.$type,properties:{cardinality:{name:ws.cardinality},elements:{name:ws.elements,defaultValue:[]}},superTypes:[at.$type]},ArrayLiteral:{name:Dl.$type,properties:{elements:{name:Dl.elements,defaultValue:[]}},superTypes:[si.$type]},ArrayType:{name:Ml.$type,properties:{elementType:{name:Ml.elementType}},superTypes:[ii.$type]},Assignment:{name:On.$type,properties:{cardinality:{name:On.cardinality},feature:{name:On.feature},operator:{name:On.operator},predicate:{name:On.predicate},terminal:{name:On.terminal}},superTypes:[at.$type]},BooleanLiteral:{name:mo.$type,properties:{true:{name:mo.true,defaultValue:!1}},superTypes:[tr.$type,si.$type]},CharacterRange:{name:xn.$type,properties:{cardinality:{name:xn.cardinality},left:{name:xn.left},lookahead:{name:xn.lookahead},parenthesized:{name:xn.parenthesized,defaultValue:!1},right:{name:xn.right}},superTypes:[pt.$type]},Condition:{name:tr.$type,properties:{},superTypes:[]},Conjunction:{name:bs.$type,properties:{left:{name:bs.left},right:{name:bs.right}},superTypes:[tr.$type]},CrossReference:{name:Dn.$type,properties:{cardinality:{name:Dn.cardinality},deprecatedSyntax:{name:Dn.deprecatedSyntax,defaultValue:!1},isMulti:{name:Dn.isMulti,defaultValue:!1},terminal:{name:Dn.terminal},type:{name:Dn.type,referenceType:At.$type}},superTypes:[at.$type]},Disjunction:{name:_s.$type,properties:{left:{name:_s.left},right:{name:_s.right}},superTypes:[tr.$type]},EndOfFile:{name:go.$type,properties:{cardinality:{name:go.cardinality}},superTypes:[at.$type]},Grammar:{name:In.$type,properties:{imports:{name:In.imports,defaultValue:[]},interfaces:{name:In.interfaces,defaultValue:[]},isDeclared:{name:In.isDeclared,defaultValue:!1},name:{name:In.name},rules:{name:In.rules,defaultValue:[]},types:{name:In.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Fl.$type,properties:{path:{name:Fl.path}},superTypes:[]},Group:{name:or.$type,properties:{cardinality:{name:or.cardinality},elements:{name:or.elements,defaultValue:[]},guardCondition:{name:or.guardCondition},predicate:{name:or.predicate}},superTypes:[at.$type]},InferredType:{name:yo.$type,properties:{name:{name:yo.name}},superTypes:[At.$type]},InfixRule:{name:Vt.$type,properties:{call:{name:Vt.call},dataType:{name:Vt.dataType},inferredType:{name:Vt.inferredType},name:{name:Vt.name},operators:{name:Vt.operators},parameters:{name:Vt.parameters,defaultValue:[]},returnType:{name:Vt.returnType,referenceType:At.$type}},superTypes:[Ns.$type]},InfixRuleOperatorList:{name:qa.$type,properties:{associativity:{name:qa.associativity},operators:{name:qa.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Gl.$type,properties:{precedences:{name:Gl.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:pi.$type,properties:{attributes:{name:pi.attributes,defaultValue:[]},name:{name:pi.name},superTypes:{name:pi.superTypes,defaultValue:[],referenceType:At.$type}},superTypes:[At.$type]},Keyword:{name:mi.$type,properties:{cardinality:{name:mi.cardinality},predicate:{name:mi.predicate},value:{name:mi.value}},superTypes:[at.$type]},NamedArgument:{name:ps.$type,properties:{calledByName:{name:ps.calledByName,defaultValue:!1},parameter:{name:ps.parameter,referenceType:ms.$type},value:{name:ps.value}},superTypes:[]},NegatedToken:{name:cr.$type,properties:{cardinality:{name:cr.cardinality},lookahead:{name:cr.lookahead},parenthesized:{name:cr.parenthesized,defaultValue:!1},terminal:{name:cr.terminal}},superTypes:[pt.$type]},Negation:{name:To.$type,properties:{value:{name:To.value}},superTypes:[tr.$type]},NumberLiteral:{name:Ul.$type,properties:{value:{name:Ul.value}},superTypes:[si.$type]},Parameter:{name:ms.$type,properties:{name:{name:ms.name}},superTypes:[]},ParameterReference:{name:Ro.$type,properties:{parameter:{name:Ro.parameter,referenceType:ms.$type}},superTypes:[tr.$type]},ParserRule:{name:Lt.$type,properties:{dataType:{name:Lt.dataType},definition:{name:Lt.definition},entry:{name:Lt.entry,defaultValue:!1},fragment:{name:Lt.fragment,defaultValue:!1},inferredType:{name:Lt.inferredType},name:{name:Lt.name},parameters:{name:Lt.parameters,defaultValue:[]},returnType:{name:Lt.returnType,referenceType:At.$type}},superTypes:[Ns.$type]},ReferenceType:{name:Wa.$type,properties:{isMulti:{name:Wa.isMulti,defaultValue:!1},referenceType:{name:Wa.referenceType}},superTypes:[ii.$type]},RegexToken:{name:lr.$type,properties:{cardinality:{name:lr.cardinality},lookahead:{name:lr.lookahead},parenthesized:{name:lr.parenthesized,defaultValue:!1},regex:{name:lr.regex}},superTypes:[pt.$type]},ReturnType:{name:vo.$type,properties:{name:{name:vo.name}},superTypes:[]},RuleCall:{name:ur.$type,properties:{arguments:{name:ur.arguments,defaultValue:[]},cardinality:{name:ur.cardinality},predicate:{name:ur.predicate},rule:{name:ur.rule,referenceType:hs.$type}},superTypes:[at.$type]},SimpleType:{name:gi.$type,properties:{primitiveType:{name:gi.primitiveType},stringType:{name:gi.stringType},typeRef:{name:gi.typeRef,referenceType:At.$type}},superTypes:[ii.$type]},StringLiteral:{name:jl.$type,properties:{value:{name:jl.value}},superTypes:[si.$type]},TerminalAlternatives:{name:dr.$type,properties:{cardinality:{name:dr.cardinality},elements:{name:dr.elements,defaultValue:[]},lookahead:{name:dr.lookahead},parenthesized:{name:dr.parenthesized,defaultValue:!1}},superTypes:[pt.$type]},TerminalElement:{name:pt.$type,properties:{cardinality:{name:pt.cardinality},lookahead:{name:pt.lookahead},parenthesized:{name:pt.parenthesized,defaultValue:!1}},superTypes:[at.$type]},TerminalGroup:{name:fr.$type,properties:{cardinality:{name:fr.cardinality},elements:{name:fr.elements,defaultValue:[]},lookahead:{name:fr.lookahead},parenthesized:{name:fr.parenthesized,defaultValue:!1}},superTypes:[pt.$type]},TerminalRule:{name:dn.$type,properties:{definition:{name:dn.definition},fragment:{name:dn.fragment,defaultValue:!1},hidden:{name:dn.hidden,defaultValue:!1},name:{name:dn.name},type:{name:dn.type}},superTypes:[hs.$type]},TerminalRuleCall:{name:hr.$type,properties:{cardinality:{name:hr.cardinality},lookahead:{name:hr.lookahead},parenthesized:{name:hr.parenthesized,defaultValue:!1},rule:{name:hr.rule,referenceType:dn.$type}},superTypes:[pt.$type]},Type:{name:Is.$type,properties:{name:{name:Is.name},type:{name:Is.type}},superTypes:[At.$type]},TypeAttribute:{name:ri.$type,properties:{defaultValue:{name:ri.defaultValue},isOptional:{name:ri.isOptional,defaultValue:!1},name:{name:ri.name},type:{name:ri.type}},superTypes:[]},TypeDefinition:{name:ii.$type,properties:{},superTypes:[]},UnionType:{name:zl.$type,properties:{types:{name:zl.types,defaultValue:[]}},superTypes:[ii.$type]},UnorderedGroup:{name:$s.$type,properties:{cardinality:{name:$s.cardinality},elements:{name:$s.elements,defaultValue:[]}},superTypes:[at.$type]},UntilToken:{name:pr.$type,properties:{cardinality:{name:pr.cardinality},lookahead:{name:pr.lookahead},parenthesized:{name:pr.parenthesized,defaultValue:!1},terminal:{name:pr.terminal}},superTypes:[pt.$type]},ValueLiteral:{name:si.$type,properties:{},superTypes:[]},Wildcard:{name:yi.$type,properties:{cardinality:{name:yi.cardinality},lookahead:{name:yi.lookahead},parenthesized:{name:yi.parenthesized,defaultValue:!1}},superTypes:[pt.$type]}}}}const Z=new Nf;function Eo(t){return new al(t,e=>Ni(e)?e.content:[],{includeRoot:!0})}function Pm(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Ao(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Bs(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Xt;(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"})(Xt||(Xt={}));function Lm(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Xt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Xt.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?Xt.Inside:n?Xt.OverlapBack:r?Xt.OverlapFront:Xt.Outside}function Om(t,e){return Lm(t,e)>Xt.After}const xm=/^[\w\p{L}]$/u;function Dm(t,e){if(t){const n=Mm(t,!0);if(n&&Bl(n,e))return n;if(vf(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(Bl(s,e))return s}}}}function Bl(t,e){return Rf(t)&&e.includes(t.tokenType.name)}function Mm(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}}class wf extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Bi(t,e="Error: Got unexpected value."){throw new Error(e)}function W(t){return t.charCodeAt(0)}function Va(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function ai(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function nr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Fm(){throw Error("Internal Error - Should never get here!")}function ql(t){return t.type==="Character"}const qs=[];for(let t=W("0");t<=W("9");t++)qs.push(t);const Ws=[W("_")].concat(qs);for(let t=W("a");t<=W("z");t++)Ws.push(t);for(let t=W("A");t<=W("Z");t++)Ws.push(t);const Wl=[W(" "),W("\f"),W(`
|
|
2
|
+
`),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],Gm=/[0-9a-fA-F]/,gs=/[0-9]/,Um=/[1-9]/;class bf{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ai(r,"global");break;case"i":ai(r,"ignoreCase");break;case"m":ai(r,"multiLine");break;case"u":ai(r,"unicode");break;case"y":ai(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}nr(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return Fm()}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;nr(n);break}if(!(e===!0&&n===void 0)&&nr(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()),nr(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
|
|
3
|
+
`),W("\r"),W("\u2028"),W("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=qs;break;case"D":e=qs,n=!0;break;case"s":e=Wl;break;case"S":e=Wl,n=!0;break;case"w":e=Ws;break;case"W":e=Ws,n=!0;break}if(nr(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
|
|
4
|
+
`);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(nr(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:W("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:W(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:W(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,ql(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,ql(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else Va(r.value,e),e.push(W("-")),Va(i.value,e)}else Va(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:W("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(Um.test(e)===!1)throw Error("Expecting a positive integer");for(;gs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(gs.test(e)===!1)throw Error("Expecting an integer");for(;gs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:W(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 gs.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(Gm.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Ea{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const jm=/\r?\n/gm,zm=new bf;class Bm extends Ea{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
|
|
10
|
+
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Aa(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
|
|
11
|
+
`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const Ka=new Bm;function qm(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Ka.reset(t),Ka.visit(zm.pattern(t)),Ka.multiline}catch{return!1}}const Wm=`\f
|
|
12
|
+
\r \v \u2028\u2029 \uFEFF`.split("");function _f(t){const e=typeof t=="string"?new RegExp(t):t;return Wm.some(n=>e.test(n))}function Aa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vm(t,e){const n=Km(t),r=e.match(n);return!!r&&r[0].length>0}function Km(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(l){s+=n.substr(r,l),r+=l}function c(l){s+="(?:"+n.substr(r,l)+"|$)",r+=l}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],c(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function Hm(t){return t.rules.find(e=>an(e)&&e.entry)}function Ym(t){return t.rules.filter(e=>on(e)&&e.hidden)}function If(t,e){const n=new Set,r=Hm(t);if(!r)return new Set(t.rules);const i=[r].concat(Ym(t));for(const a of i)$f(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||on(a)&&a.hidden)&&s.add(a);return s}function $f(t,e,n){e.add(t.name),ji(t).forEach(r=>{if(qn(r)||n){const i=r.rule.ref;i&&!e.has(i.name)&&$f(i,e,n)}})}function Xm(t){if(t.terminal)return t.terminal;if(t.type.ref)return Lf(t.type.ref)?.terminal}function Jm(t){return t.hidden&&!_f(ul(t))}function Qm(t,e){return!t||!e?[]:ll(t,e,t.astNode,!0)}function Pf(t,e,n){if(!t||!e)return;const r=ll(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 ll(t,e,n,r){if(!r){const i=Ta(t.grammarSource,zn);if(i&&i.feature===e)return[t]}return Ni(t)&&t.astNode===n?t.content.flatMap(i=>ll(i,e,n,!1)):[]}function Zm(t,e,n){if(!t)return;const r=eg(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 eg(t,e,n){if(t.astNode!==n)return[];if(Bn(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Eo(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?Bn(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function tg(t){const e=t.astNode;for(;e===t.container?.astNode;){const n=Ta(t.grammarSource,zn);if(n)return n;t=t.container}}function Lf(t){let e=t;return kf(e)&&(Ra(e.$container)?e=e.$container.$container:zi(e.$container)?e=e.$container:Bi(e.$container)),Of(t,e,new Map)}function Of(t,e,n){function r(i,s){let a;return Ta(i,zn)||(a=Of(s,s,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const i of ji(e)){if(zn(i)&&i.feature.toLowerCase()==="name")return n.set(t,i),i;if(qn(i)&&an(i.rule.ref))return r(i,i.rule.ref);if(Cm(i)&&i.typeRef?.ref)return r(i,i.typeRef.ref)}}function xf(t){return Df(t,new Set)}function Df(t,e){if(e.has(t))return!0;e.add(t);for(const n of ji(t))if(qn(n)){if(!n.rule.ref||an(n.rule.ref)&&!Df(n.rule.ref,e)||zs(n.rule.ref))return!1}else{if(zn(n))return!1;if(Ra(n))return!1}return!!t.definition}function Mf(t){if(!on(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}function wi(t){if(zi(t))return an(t)&&xf(t)?t.name:Mf(t)??t.name;if(Rm(t)||_m(t)||km(t))return t.name;if(Ra(t)){const e=ng(t);if(e)return e}else if(kf(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function ng(t){if(t.inferredType)return t.inferredType.name;if(t.type?.ref)return wi(t.type.ref)}function rg(t){return on(t)?t.type?.name??"string":Mf(t)??t.name}function ul(t){const e={s:!1,i:!1,u:!1},n=jr(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const dl=/[\s\S]/.source;function jr(t,e){if(Nm(t))return ig(t);if(wm(t))return sg(t);if(mm(t))return cg(t);if(bm(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return en(jr(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(vm(t))return og(t);if(Im(t))return ag(t);if(Sm(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),en(r,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if($m(t))return en(dl,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t?.$type}, ${t?.$cstNode?.text}`)}}}function ig(t){return en(t.elements.map(e=>jr(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function sg(t){return en(t.elements.map(e=>jr(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function ag(t){return en(`${dl}*?${jr(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function og(t){return en(`(?!${jr(t.terminal)})${dl}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function cg(t){return t.right?en(`[${Ha(t.left)}-${Ha(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):en(Ha(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Ha(t){return Aa(t.value)}function en(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function lg(t){const e=[],n=t.Grammar;for(const r of n.rules)on(r)&&Jm(r)&&qm(ul(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:xm}}function So(t){console&&console.error&&console.error(`Error: ${t}`)}function Ff(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Gf(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function Uf(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function ug(t){return dg(t)?t.LABEL:t.name}function dg(t){return tt(t.LABEL)&&t.LABEL!==""}class Ut{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),j(this.definition,n=>{n.accept(e)})}}class Xe extends Ut{constructor(e){super([]),this.idx=1,ut(this,_t(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class zr extends Ut{constructor(e){super(e.definition),this.orgText="",ut(this,_t(e,n=>n!==void 0))}}class nt extends Ut{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ut(this,_t(e,n=>n!==void 0))}}let ze=class extends Ut{constructor(e){super(e.definition),this.idx=1,ut(this,_t(e,n=>n!==void 0))}};class ft extends Ut{constructor(e){super(e.definition),this.idx=1,ut(this,_t(e,n=>n!==void 0))}}class ht extends Ut{constructor(e){super(e.definition),this.idx=1,ut(this,_t(e,n=>n!==void 0))}}class Ae extends Ut{constructor(e){super(e.definition),this.idx=1,ut(this,_t(e,n=>n!==void 0))}}class rt extends Ut{constructor(e){super(e.definition),this.idx=1,ut(this,_t(e,n=>n!==void 0))}}class it extends Ut{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,ut(this,_t(e,n=>n!==void 0))}}class le{constructor(e){this.idx=1,ut(this,_t(e,n=>n!==void 0))}accept(e){e.visit(this)}}function fg(t){return M(t,Ps)}function Ps(t){function e(n){return M(n,Ps)}if(t instanceof Xe){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return tt(t.label)&&(n.label=t.label),n}else{if(t instanceof nt)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ze)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof ft)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ht)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Ps(new le({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof rt)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Ps(new le({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ae)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof it)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof le){const n={type:"Terminal",name:t.terminalType.name,label:ug(t.terminalType),idx:t.idx};tt(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=nn(r)?r.source:r),n}else{if(t instanceof zr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Br{visit(e){const n=e;switch(n.constructor){case Xe:return this.visitNonTerminal(n);case nt:return this.visitAlternative(n);case ze:return this.visitOption(n);case ft:return this.visitRepetitionMandatory(n);case ht:return this.visitRepetitionMandatoryWithSeparator(n);case rt:return this.visitRepetitionWithSeparator(n);case Ae:return this.visitRepetition(n);case it:return this.visitAlternation(n);case le:return this.visitTerminal(n);case zr: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 hg(t){return t instanceof nt||t instanceof ze||t instanceof Ae||t instanceof ft||t instanceof ht||t instanceof rt||t instanceof le||t instanceof zr}function Vs(t,e=[]){return t instanceof ze||t instanceof Ae||t instanceof rt?!0:t instanceof it?yf(t.definition,r=>Vs(r,e)):t instanceof Xe&&Qe(e,t)?!1:t instanceof Ut?(t instanceof Xe&&e.push(t),Nt(t.definition,r=>Vs(r,e))):!1}function pg(t){return t instanceof it}function Ot(t){if(t instanceof Xe)return"SUBRULE";if(t instanceof ze)return"OPTION";if(t instanceof it)return"OR";if(t instanceof ft)return"AT_LEAST_ONE";if(t instanceof ht)return"AT_LEAST_ONE_SEP";if(t instanceof rt)return"MANY_SEP";if(t instanceof Ae)return"MANY";if(t instanceof le)return"CONSUME";throw Error("non exhaustive match")}class Sa{walk(e,n=[]){j(e.definition,(r,i)=>{const s=Fe(e.definition,i+1);if(r instanceof Xe)this.walkProdRef(r,s,n);else if(r instanceof le)this.walkTerminal(r,s,n);else if(r instanceof nt)this.walkFlat(r,s,n);else if(r instanceof ze)this.walkOption(r,s,n);else if(r instanceof ft)this.walkAtLeastOne(r,s,n);else if(r instanceof ht)this.walkAtLeastOneSep(r,s,n);else if(r instanceof rt)this.walkManySep(r,s,n);else if(r instanceof Ae)this.walkMany(r,s,n);else if(r instanceof it)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 ze({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=Vl(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new ze({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=Vl(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);j(e.definition,s=>{const a=new nt({definition:[s]});this.walk(a,i)})}}function Vl(t,e,n){return[new ze({definition:[new le({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function qi(t){if(t instanceof Xe)return qi(t.referencedRule);if(t instanceof le)return yg(t);if(hg(t))return mg(t);if(pg(t))return gg(t);throw Error("non exhaustive match")}function mg(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=Vs(s),e=e.concat(qi(s)),r=r+1,i=n.length>r;return sl(e)}function gg(t){const e=M(t.definition,n=>qi(n));return sl(yt(e))}function yg(t){return[t.terminalType]}const jf="_~IN~_";class Tg extends Sa{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=vg(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new nt({definition:s}),o=qi(a);this.follows[i]=o}}function Rg(t){const e={};return j(t,n=>{const r=new Tg(n).startWalking();ut(e,r)}),e}function vg(t,e){return t.name+e+jf}let Ls={};const Eg=new bf;function ka(t){const e=t.toString();if(Ls.hasOwnProperty(e))return Ls[e];{const n=Eg.pattern(e);return Ls[e]=n,n}}function Ag(){Ls={}}const zf="Complement Sets are not supported for first char optimization",Ks=`Unable to use "first char" lexer optimizations:
|
|
13
|
+
`;function Sg(t,e=!1){try{const n=ka(t);return ko(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===zf)e&&Ff(`${Ks} Unable to optimize: < ${t.toString()} >
|
|
14
|
+
Complement Sets cannot be automatically optimized.
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
|
|
17
|
+
This will disable the lexer's first char optimizations.
|
|
18
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),So(`${Ks}
|
|
19
|
+
Failed parsing: < ${t.toString()} >
|
|
20
|
+
Using the @chevrotain/regexp-to-ast library
|
|
21
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function ko(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)ko(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"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":ys(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(zf);j(a.value,c=>{if(typeof c=="number")ys(c,e,n);else{const l=c;if(n===!0)for(let u=l.from;u<=l.to;u++)ys(u,e,n);else{for(let u=l.from;u<=l.to&&u<Ri;u++)ys(u,e,n);if(l.to>=Ri){const u=l.from>=Ri?l.from:Ri,f=l.to,p=Tn(u),g=Tn(f);for(let S=p;S<=g;S++)e[S]=S}}}});break;case"Group":ko(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&Co(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Le(e)}function ys(t,e,n){const r=Tn(t);e[r]=r,n===!0&&kg(t,e)}function kg(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Tn(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Tn(i.charCodeAt(0));e[s]=s}}}function Kl(t,e){return kr(t.value,n=>{if(typeof n=="number")return Qe(e,n);{const r=n;return kr(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Co(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?je(t.value)?Nt(t.value,Co):Co(t.value):!1}class Cg extends Ea{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;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Qe(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Kl(e,this.targetCharCodes)===void 0&&(this.found=!0):Kl(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function fl(t,e){if(e instanceof RegExp){const n=ka(e),r=new Cg(t);return r.visit(n),r.found}else return kr(e,n=>Qe(t,n.charCodeAt(0)))!==void 0}const Wn="PATTERN",Ti="defaultMode",Ts="modes";function Ng(t,e){e=il(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(L,b)=>b()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{Xg()});let r;n("Reject Lexer.NA",()=>{r=ya(t,L=>L[Wn]===et.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=M(r,L=>{const b=L[Wn];if(nn(b)){const O=b.source;return O.length===1&&O!=="^"&&O!=="$"&&O!=="."&&!b.ignoreCase?O:O.length===2&&O[0]==="\\"&&!Qe(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],O[1])?O[1]:Hl(b)}else{if(Hn(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const O=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),X=new RegExp(O);return Hl(X)}}else throw Error("non exhaustive match")}})});let a,o,c,l,u;n("misc mapping",()=>{a=M(r,L=>L.tokenTypeIdx),o=M(r,L=>{const b=L.GROUP;if(b!==et.SKIPPED){if(tt(b))return b;if(tn(b))return!1;throw Error("non exhaustive match")}}),c=M(r,L=>{const b=L.LONGER_ALT;if(b)return je(b)?M(b,X=>Pl(r,X)):[Pl(r,b)]}),l=M(r,L=>L.PUSH_MODE),u=M(r,L=>B(L,"POP_MODE"))});let f;n("Line Terminator Handling",()=>{const L=Wf(e.lineTerminatorCharacters);f=M(r,b=>!1),e.positionTracking!=="onlyOffset"&&(f=M(r,b=>B(b,"LINE_BREAKS")?!!b.LINE_BREAKS:qf(b,L)===!1&&fl(L,b.PATTERN)))});let p,g,S,N;n("Misc Mapping #2",()=>{p=M(r,Bf),g=M(s,Kg),S=Ye(r,(L,b)=>{const O=b.GROUP;return tt(O)&&O!==et.SKIPPED&&(L[O]=[]),L},{}),N=M(s,(L,b)=>({pattern:s[b],longerAlt:c[b],canLineTerminator:f[b],isCustom:p[b],short:g[b],group:o[b],push:l[b],pop:u[b],tokenTypeIdx:a[b],tokenType:r[b]}))});let x=!0,w=[];return e.safeMode||n("First Char Optimization",()=>{w=Ye(r,(L,b,O)=>{if(typeof b.PATTERN=="string"){const X=b.PATTERN.charCodeAt(0),te=Tn(X);Ya(L,te,N[O])}else if(je(b.START_CHARS_HINT)){let X;j(b.START_CHARS_HINT,te=>{const ne=typeof te=="string"?te.charCodeAt(0):te,ge=Tn(ne);X!==ge&&(X=ge,Ya(L,ge,N[O]))})}else if(nn(b.PATTERN))if(b.PATTERN.unicode)x=!1,e.ensureOptimizations&&So(`${Ks} Unable to analyze < ${b.PATTERN.toString()} > pattern.
|
|
23
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
|
+
This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const X=Sg(b.PATTERN,e.ensureOptimizations);oe(X)&&(x=!1),j(X,te=>{Ya(L,te,N[O])})}else e.ensureOptimizations&&So(`${Ks} TokenType: <${b.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
|
+
This will disable the lexer's first char optimizations.
|
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),x=!1;return L},[])}),{emptyGroups:S,patternIdxToConfig:N,charCodeToPatternIdxToConfig:w,hasCustom:i,canBeOptimized:x}}function wg(t,e){let n=[];const r=_g(t);n=n.concat(r.errors);const i=Ig(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(bg(s)),n=n.concat(Fg(s)),n=n.concat(Gg(s,e)),n=n.concat(Ug(s)),n}function bg(t){let e=[];const n=dt(t,r=>nn(r[Wn]));return e=e.concat(Pg(n)),e=e.concat(xg(n)),e=e.concat(Dg(n)),e=e.concat(Mg(n)),e=e.concat(Lg(n)),e}function _g(t){const e=dt(t,i=>!B(i,Wn)),n=M(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Se.MISSING_PATTERN,tokenTypes:[i]})),r=ga(t,e);return{errors:n,valid:r}}function Ig(t){const e=dt(t,i=>{const s=i[Wn];return!nn(s)&&!Hn(s)&&!B(s,"exec")&&!tt(s)}),n=M(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Se.INVALID_PATTERN,tokenTypes:[i]})),r=ga(t,e);return{errors:n,valid:r}}const $g=/[^\\][$]/;function Pg(t){class e extends Ea{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=dt(t,i=>{const s=i.PATTERN;try{const a=ka(s),o=new e;return o.visit(a),o.found}catch{return $g.test(s.source)}});return M(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Se.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Lg(t){const e=dt(t,r=>r.PATTERN.test(""));return M(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Se.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const Og=/[^\\[][\^]|^\^/;function xg(t){class e extends Ea{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=dt(t,i=>{const s=i.PATTERN;try{const a=ka(s),o=new e;return o.visit(a),o.found}catch{return Og.test(s.source)}});return M(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
30
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Se.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Dg(t){const e=dt(t,r=>{const i=r[Wn];return i instanceof RegExp&&(i.multiline||i.global)});return M(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Se.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function Mg(t){const e=[];let n=M(t,s=>Ye(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!Qe(e,o)&&o.PATTERN!==et.NA&&(e.push(o),a.push(o)),a),[]));n=Ui(n);const r=dt(n,s=>s.length>1);return M(r,s=>{const a=M(s,c=>c.name);return{message:`The same RegExp pattern ->${bt(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Se.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function Fg(t){const e=dt(t,r=>{if(!B(r,"GROUP"))return!1;const i=r.GROUP;return i!==et.SKIPPED&&i!==et.NA&&!tt(i)});return M(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Se.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function Gg(t,e){const n=dt(t,i=>i.PUSH_MODE!==void 0&&!Qe(e,i.PUSH_MODE));return M(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:Se.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function Ug(t){const e=[],n=Ye(t,(r,i,s)=>{const a=i.PATTERN;return a===et.NA||(tt(a)?r.push({str:a,idx:s,tokenType:i}):nn(a)&&zg(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return j(t,(r,i)=>{j(n,({str:s,idx:a,tokenType:o})=>{if(i<a&&jg(s,r.PATTERN)){const c=`Token: ->${o.name}<- can never be matched.
|
|
32
|
+
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Se.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function jg(t,e){if(nn(e)){if(Bg(e))return!1;const n=e.exec(t);return n!==null&&n.index===0}else{if(Hn(e))return e(t,0,[],{});if(B(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function zg(t){return kr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function Bg(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function Hl(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function qg(t,e,n){const r=[];return B(t,Ti)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ti+`> property in its definition
|
|
34
|
+
`,type:Se.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),B(t,Ts)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ts+`> property in its definition
|
|
35
|
+
`,type:Se.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),B(t,Ts)&&B(t,Ti)&&!B(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Ti}: <${t.defaultMode}>which does not exist
|
|
36
|
+
`,type:Se.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),B(t,Ts)&&j(t.modes,(i,s)=>{j(i,(a,o)=>{if(tn(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
|
|
37
|
+
`,type:Se.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(B(a,"LONGER_ALT")){const c=je(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];j(c,l=>{!tn(l)&&!Qe(i,l)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${a.name}> outside of mode <${s}>
|
|
38
|
+
`,type:Se.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function Wg(t,e,n){const r=[];let i=!1;const s=Ui(yt(Le(t.modes))),a=ya(s,c=>c[Wn]===et.NA),o=Wf(n);return e&&j(a,c=>{const l=qf(c,o);if(l!==!1){const f={message:Yg(c,l),type:l.issue,tokenType:c};r.push(f)}else B(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):fl(o,c.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
|
+
This Lexer has been defined to track line and column information,
|
|
40
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
41
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
42
|
+
for details.`,type:Se.NO_LINE_BREAKS_FLAGS}),r}function Vg(t){const e={},n=Sr(t);return j(n,r=>{const i=t[r];if(je(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Bf(t){const e=t.PATTERN;if(nn(e))return!1;if(Hn(e))return!0;if(B(e,"exec"))return!0;if(tt(e))return!1;throw Error("non exhaustive match")}function Kg(t){return tt(t)&&t.length===1?t.charCodeAt(0):!1}const Hg={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function qf(t,e){if(B(t,"LINE_BREAKS"))return!1;if(nn(t.PATTERN)){try{fl(e,t.PATTERN)}catch(n){return{issue:Se.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(tt(t.PATTERN))return!1;if(Bf(t))return{issue:Se.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Yg(t,e){if(e.issue===Se.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
43
|
+
The problem is in the <${t.name}> Token Type
|
|
44
|
+
Root cause: ${e.errMsg}.
|
|
45
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Se.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
|
+
The problem is in the <${t.name}> Token Type
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function Wf(t){return M(t,n=>tt(n)?n.charCodeAt(0):n)}function Ya(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Ri=256;let Os=[];function Tn(t){return t<Ri?t:Os[t]}function Xg(){if(oe(Os)){Os=new Array(65536);for(let t=0;t<65536;t++)Os[t]=t>255?255+~~(t/255):t}}function Wi(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function Hs(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let Yl=1;const Vf={};function Vi(t){const e=Jg(t);Qg(e),ey(e),Zg(e),j(e,n=>{n.isParent=n.categoryMatches.length>0})}function Jg(t){let e=Be(t),n=t,r=!0;for(;r;){n=Ui(yt(M(n,s=>s.CATEGORIES)));const i=ga(n,e);e=e.concat(i),oe(i)?r=!1:n=i}return e}function Qg(t){j(t,e=>{Hf(e)||(Vf[Yl]=e,e.tokenTypeIdx=Yl++),Xl(e)&&!je(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Xl(e)||(e.CATEGORIES=[]),ty(e)||(e.categoryMatches=[]),ny(e)||(e.categoryMatchesMap={})})}function Zg(t){j(t,e=>{e.categoryMatches=[],j(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(Vf[r].tokenTypeIdx)})})}function ey(t){j(t,e=>{Kf([],e)})}function Kf(t,e){j(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),j(e.CATEGORIES,n=>{const r=t.concat(e);Qe(r,n)||Kf(r,n)})}function Hf(t){return B(t,"tokenTypeIdx")}function Xl(t){return B(t,"CATEGORIES")}function ty(t){return B(t,"categoryMatches")}function ny(t){return B(t,"categoryMatchesMap")}function ry(t){return B(t,"tokenTypeIdx")}const No={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var Se;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Se||(Se={}));const vi={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:No,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(vi);class et{constructor(e,n=vi){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);const{time:o,value:c}=Gf(s),l=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,c}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
|
+
a boolean 2nd argument is no longer supported`);this.config=ut({},vi,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===vi.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Hg;else if(this.config.lineTerminatorCharacters===vi.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),je(e)?i={modes:{defaultMode:Be(e)},defaultMode:Ti}:(s=!1,i=Be(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(qg(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Wg(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},j(i.modes,(o,c)=>{i.modes[c]=ya(o,l=>tn(l))});const a=Sr(i.modes);if(j(i.modes,(o,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(wg(o,a))}),oe(this.lexerDefinitionErrors)){Vi(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Ng(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=ut({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!oe(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=M(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
|
|
51
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
+
`+c)}j(this.lexerDefinitionWarning,o=>{Ff(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(s&&(this.handleModes=Me),this.trackStartLines===!1&&(this.computeNewColumn=$p),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Me),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Ye(this.canModeBeOptimized,(c,l,u)=>(l===!1&&c.push(u),c),[]);if(n.ensureOptimizations&&!oe(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
53
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Ag()}),this.TRACE_INIT("toFastProperties",()=>{Uf(this)})})}tokenize(e,n=this.defaultMode){if(!oe(this.lexerDefinitionErrors)){const i=M(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
55
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
+
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,c,l,u,f,p,g,S,N,x,w;const L=e,b=L.length;let O=0,X=0;const te=this.hasCustom?0:Math.floor(e.length/10),ne=new Array(te),ge=[];let ke=this.trackStartLines?1:void 0,ue=this.trackStartLines?1:void 0;const C=Vg(this.emptyGroups),T=this.trackStartLines,m=this.config.lineTerminatorsPattern;let A=0,y=[],R=[];const E=[],$=[];Object.freeze($);let D=!1;const P=q=>{if(E.length===1&&q.tokenType.PUSH_MODE===void 0){const re=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(q);ge.push({offset:q.startOffset,line:q.startLine,column:q.startColumn,length:q.image.length,message:re})}else{E.pop();const re=jn(E);y=this.patternIdxToConfig[re],R=this.charCodeToPatternIdxToConfig[re],A=y.length;const xe=this.canModeBeOptimized[re]&&this.config.safeMode===!1;R&&xe?D=!0:D=!1}};function z(q){E.push(q),R=this.charCodeToPatternIdxToConfig[q],y=this.patternIdxToConfig[q],A=y.length,A=y.length;const re=this.canModeBeOptimized[q]&&this.config.safeMode===!1;R&&re?D=!0:D=!1}z.call(this,n);let G;const se=this.config.recoveryEnabled;for(;O<b;){c=null,f=-1;const q=L.charCodeAt(O);let re;if(D){const ye=Tn(q),de=R[ye];re=de!==void 0?de:$}else re=y;const xe=re.length;for(r=0;r<xe;r++){G=re[r];const ye=G.pattern;l=null;const de=G.short;if(de!==!1?q===de&&(f=1,c=ye):G.isCustom===!0?(w=ye.exec(L,O,ne,C),w!==null?(c=w[0],f=c.length,w.payload!==void 0&&(l=w.payload)):c=null):(ye.lastIndex=O,f=this.matchLength(ye,e,O)),f!==-1){if(o=G.longerAlt,o!==void 0){c=e.substring(O,O+f);const $e=o.length;for(s=0;s<$e;s++){const De=y[o[s]],be=De.pattern;if(u=null,De.isCustom===!0?(w=be.exec(L,O,ne,C),w!==null?(a=w[0],w.payload!==void 0&&(u=w.payload)):a=null):(be.lastIndex=O,a=this.match(be,e,O)),a&&a.length>c.length){c=a,f=a.length,l=u,G=De;break}}}break}}if(f!==-1){if(p=G.group,p!==void 0&&(c=c!==null?c:e.substring(O,O+f),g=G.tokenTypeIdx,S=this.createTokenInstance(c,O,g,G.tokenType,ke,ue,f),this.handlePayload(S,l),p===!1?X=this.addToken(ne,X,S):C[p].push(S)),T===!0&&G.canLineTerminator===!0){let ye=0,de,$e;m.lastIndex=0;do c=c!==null?c:e.substring(O,O+f),de=m.test(c),de===!0&&($e=m.lastIndex-1,ye++);while(de===!0);ye!==0?(ke=ke+ye,ue=f-$e,this.updateTokenEndLineColumnLocation(S,p,$e,ye,ke,ue,f)):ue=this.computeNewColumn(ue,f)}else ue=this.computeNewColumn(ue,f);O=O+f,this.handleModes(G,P,z,S)}else{const ye=O,de=ke,$e=ue;let De=se===!1;for(;De===!1&&O<b;)for(O++,i=0;i<A;i++){const be=y[i],Q=be.pattern,st=be.short;if(st!==!1?L.charCodeAt(O)===st&&(De=!0):be.isCustom===!0?De=Q.exec(L,O,ne,C)!==null:(Q.lastIndex=O,De=Q.exec(e)!==null),De===!0)break}if(N=O-ye,ue=this.computeNewColumn(ue,N),x=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(L,ye,N,de,$e,jn(E)),ge.push({offset:ye,line:de,column:$e,length:N,message:x}),se===!1)break}}return this.hasCustom||(ne.length=X),{tokens:ne,groups:C,errors:ge}}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)}updateTokenEndLineColumnLocation(e,n,r,i,s,a,o){let c,l;n!==void 0&&(c=r===o-1,l=c?-1:0,i===1&&c===!0||(e.endLine=s+l,e.endColumn=a-1+-l))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,a){return{image:e,startOffset:n,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:n+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}match(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchLength(e,n,r){return e.test(n)===!0?e.lastIndex-r:-1}}et.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";et.NA=/NOT_APPLICABLE/;function Ar(t){return Yf(t)?t.LABEL:t.name}function Yf(t){return tt(t.LABEL)&&t.LABEL!==""}const iy="parent",Jl="categories",Ql="label",Zl="group",eu="push_mode",tu="pop_mode",nu="longer_alt",ru="line_breaks",iu="start_chars_hint";function Xf(t){return sy(t)}function sy(t){const e=t.pattern,n={};if(n.name=t.name,tn(e)||(n.PATTERN=e),B(t,iy))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return B(t,Jl)&&(n.CATEGORIES=t[Jl]),Vi([n]),B(t,Ql)&&(n.LABEL=t[Ql]),B(t,Zl)&&(n.GROUP=t[Zl]),B(t,tu)&&(n.POP_MODE=t[tu]),B(t,eu)&&(n.PUSH_MODE=t[eu]),B(t,nu)&&(n.LONGER_ALT=t[nu]),B(t,ru)&&(n.LINE_BREAKS=t[ru]),B(t,iu)&&(n.START_CHARS_HINT=t[iu]),n}const Rn=Xf({name:"EOF",pattern:et.NA});Vi([Rn]);function hl(t,e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Jf(t,e){return Wi(t,e)}const vr={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${Yf(t)?`--> ${Ar(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
|
|
58
|
+
but found: '`+bt(e).image+"'";if(r)return s+r+o;{const c=Ye(t,(p,g)=>p.concat(g),[]),l=M(c,p=>`[${M(p,g=>Ar(g)).join(", ")}]`),f=`one of these possible Token sequences:
|
|
59
|
+
${M(l,(p,g)=>` ${g+1}. ${p}`).join(`
|
|
60
|
+
`)}`;return s+f+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=`
|
|
61
|
+
but found: '`+bt(e).image+"'";if(n)return i+n+a;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
+
<${M(t,l=>`[${M(l,u=>Ar(u)).join(",")}]`).join(" ,")}>`;return i+c+a}}};Object.freeze(vr);const ay={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},Gn={buildDuplicateFoundError(t,e){function n(u){return u instanceof le?u.terminalType.name:u instanceof Xe?u.nonTerminalName:""}const r=t.name,i=bt(e),s=i.idx,a=Ot(i),o=n(i),c=s>0;let l=`->${a}${c?s:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
64
|
+
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
65
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
+
`;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
|
|
67
|
+
`),l},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
68
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
69
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
70
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
71
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=M(t.prefixPath,i=>Ar(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
+
in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
75
|
+
For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,n=t.prefixPath.length===0;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
|
|
76
|
+
`;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
77
|
+
Only the last alternative may be empty.
|
|
78
|
+
`;else{const i=M(t.prefixPath,s=>Ar(s)).join(", ");r+=`<${i}> may appears as a prefix path in all these alternatives.
|
|
79
|
+
`}return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
80
|
+
For Further details.`,r},buildEmptyRepetitionError(t){let e=Ot(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
81
|
+
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.
|
|
82
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
83
|
+
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
84
|
+
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=M(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
85
|
+
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
86
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
87
|
+
${r}
|
|
88
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
89
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof zr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function oy(t,e){const n=new cy(t,e);return n.resolveRefs(),n.errors}class cy extends Br{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){j(Le(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:Je.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class ly extends Sa{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Be(this.path.ruleStack).reverse(),this.occurrenceStack=Be(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){oe(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class uy extends ly{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new nt({definition:i});this.possibleTokTypes=qi(s),this.found=!0}}}class Ca extends Sa{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class dy extends Ca{walkMany(e,n,r){if(e.idx===this.occurrence){const i=bt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class su extends Ca{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=bt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class fy extends Ca{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=bt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class au extends Ca{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=bt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function wo(t,e,n=[]){n=Be(n);let r=[],i=0;function s(o){return o.concat(Fe(t,i+1))}function a(o){const c=wo(s(o),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const o=t[i];if(o instanceof nt)return a(o.definition);if(o instanceof Xe)return a(o.definition);if(o instanceof ze)r=a(o.definition);else if(o instanceof ft){const c=o.definition.concat([new Ae({definition:o.definition})]);return a(c)}else if(o instanceof ht){const c=[new nt({definition:o.definition}),new Ae({definition:[new le({terminalType:o.separator})].concat(o.definition)})];return a(c)}else if(o instanceof rt){const c=o.definition.concat([new Ae({definition:[new le({terminalType:o.separator})].concat(o.definition)})]);r=a(c)}else if(o instanceof Ae){const c=o.definition.concat([new Ae({definition:o.definition})]);r=a(c)}else{if(o instanceof it)return j(o.definition,c=>{oe(c.definition)===!1&&(r=a(c.definition))}),r;if(o instanceof le)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Fe(t,i)}),r}function Qf(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const c=e.length,l=c-r-1,u=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!oe(f);){const p=f.pop();if(p===a){o&&jn(f).idx<=l&&f.pop();continue}const g=p.def,S=p.idx,N=p.ruleStack,x=p.occurrenceStack;if(oe(g))continue;const w=g[0];if(w===i){const L={idx:S,def:Fe(g),ruleStack:Ci(N),occurrenceStack:Ci(x)};f.push(L)}else if(w instanceof le)if(S<c-1){const L=S+1,b=e[L];if(n(b,w.terminalType)){const O={idx:L,def:Fe(g),ruleStack:N,occurrenceStack:x};f.push(O)}}else if(S===c-1)u.push({nextTokenType:w.terminalType,nextTokenOccurrence:w.idx,ruleStack:N,occurrenceStack:x}),o=!0;else throw Error("non exhaustive match");else if(w instanceof Xe){const L=Be(N);L.push(w.nonTerminalName);const b=Be(x);b.push(w.idx);const O={idx:S,def:w.definition.concat(s,Fe(g)),ruleStack:L,occurrenceStack:b};f.push(O)}else if(w instanceof ze){const L={idx:S,def:Fe(g),ruleStack:N,occurrenceStack:x};f.push(L),f.push(a);const b={idx:S,def:w.definition.concat(Fe(g)),ruleStack:N,occurrenceStack:x};f.push(b)}else if(w instanceof ft){const L=new Ae({definition:w.definition,idx:w.idx}),b=w.definition.concat([L],Fe(g)),O={idx:S,def:b,ruleStack:N,occurrenceStack:x};f.push(O)}else if(w instanceof ht){const L=new le({terminalType:w.separator}),b=new Ae({definition:[L].concat(w.definition),idx:w.idx}),O=w.definition.concat([b],Fe(g)),X={idx:S,def:O,ruleStack:N,occurrenceStack:x};f.push(X)}else if(w instanceof rt){const L={idx:S,def:Fe(g),ruleStack:N,occurrenceStack:x};f.push(L),f.push(a);const b=new le({terminalType:w.separator}),O=new Ae({definition:[b].concat(w.definition),idx:w.idx}),X=w.definition.concat([O],Fe(g)),te={idx:S,def:X,ruleStack:N,occurrenceStack:x};f.push(te)}else if(w instanceof Ae){const L={idx:S,def:Fe(g),ruleStack:N,occurrenceStack:x};f.push(L),f.push(a);const b=new Ae({definition:w.definition,idx:w.idx}),O=w.definition.concat([b],Fe(g)),X={idx:S,def:O,ruleStack:N,occurrenceStack:x};f.push(X)}else if(w instanceof it)for(let L=w.definition.length-1;L>=0;L--){const b=w.definition[L],O={idx:S,def:b.definition.concat(Fe(g)),ruleStack:N,occurrenceStack:x};f.push(O),f.push(a)}else if(w instanceof nt)f.push({idx:S,def:w.definition.concat(Fe(g)),ruleStack:N,occurrenceStack:x});else if(w instanceof zr)f.push(hy(w,S,N,x));else throw Error("non exhaustive match")}return u}function hy(t,e,n,r){const i=Be(n);i.push(t.name);const s=Be(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var pe;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(pe||(pe={}));function pl(t){if(t instanceof ze||t==="Option")return pe.OPTION;if(t instanceof Ae||t==="Repetition")return pe.REPETITION;if(t instanceof ft||t==="RepetitionMandatory")return pe.REPETITION_MANDATORY;if(t instanceof ht||t==="RepetitionMandatoryWithSeparator")return pe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof rt||t==="RepetitionWithSeparator")return pe.REPETITION_WITH_SEPARATOR;if(t instanceof it||t==="Alternation")return pe.ALTERNATION;throw Error("non exhaustive match")}function ou(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=pl(r);return s===pe.ALTERNATION?Na(e,n,i):wa(e,n,s,i)}function py(t,e,n,r,i,s){const a=Na(t,e,n),o=th(a)?Hs:Wi;return s(a,r,o,i)}function my(t,e,n,r,i,s){const a=wa(t,e,i,n),o=th(a)?Hs:Wi;return s(a[0],o,r)}function gy(t,e,n,r){const i=t.length,s=Nt(t,a=>Nt(a,o=>o.length===1));if(e)return function(a){const o=M(a,c=>c.GATE);for(let c=0;c<i;c++){const l=t[c],u=l.length,f=o[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<u;p++){const g=l[p],S=g.length;for(let N=0;N<S;N++){const x=this.LA(N+1);if(n(x,g[N])===!1)continue e}return c}}};if(s&&!r){const a=M(t,c=>yt(c)),o=Ye(a,(c,l,u)=>(j(l,f=>{B(c,f.tokenTypeIdx)||(c[f.tokenTypeIdx]=u),j(f.categoryMatches,p=>{B(c,p)||(c[p]=u)})}),c),{});return function(){const c=this.LA(1);return o[c.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],c=o.length;e:for(let l=0;l<c;l++){const u=o[l],f=u.length;for(let p=0;p<f;p++){const g=this.LA(p+1);if(n(g,u[p])===!1)continue e}return a}}}}function yy(t,e,n){const r=Nt(t,s=>s.length===1),i=t.length;if(r&&!n){const s=yt(t);if(s.length===1&&oe(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=Ye(s,(o,c,l)=>(o[c.tokenTypeIdx]=!0,j(c.categoryMatches,u=>{o[u]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let c=0;c<o;c++){const l=this.LA(c+1);if(e(l,a[c])===!1)continue e}return!0}return!1}}class Ty extends Sa{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,pe.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,pe.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,pe.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,pe.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,pe.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class Zf extends Br{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,pe.OPTION)}visitRepetition(e){this.checkIsTarget(e,pe.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,pe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,pe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,pe.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,pe.ALTERNATION)}}function cu(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Xa(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+r.tokenTypeIdx);for(let o=0;o<r.categoryMatches.length;o++){const c="_"+r.categoryMatches[o];i.push(a+c)}}e=i}return e}function Ry(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function eh(t,e){const n=M(t,a=>wo([a],1)),r=cu(n.length),i=M(n,a=>{const o={};return j(a,c=>{const l=Xa(c.partialPath);j(l,u=>{o[u]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=cu(o.length);for(let c=0;c<o.length;c++){const l=o[c];for(let u=0;u<l.length;u++){const f=l[u].partialPath,p=l[u].suffixDef,g=Xa(f);if(Ry(i,g,c)||oe(p)||f.length===e){const N=r[c];if(bo(N,f)===!1){N.push(f);for(let x=0;x<g.length;x++){const w=g[x];i[c][w]=!0}}}else{const N=wo(p,a+1,f);s[c]=s[c].concat(N),j(N,x=>{const w=Xa(x.partialPath);j(w,L=>{i[c][L]=!0})})}}}}return r}function Na(t,e,n,r){const i=new Zf(t,pe.ALTERNATION,r);return e.accept(i),eh(i.result,n)}function wa(t,e,n,r){const i=new Zf(t,n);e.accept(i);const s=i.result,o=new Ty(e,t,n).startWalking(),c=new nt({definition:s}),l=new nt({definition:o});return eh([c,l],r)}function bo(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],a=r[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function vy(t,e){return t.length<e.length&&Nt(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function th(t){return Nt(t,e=>Nt(e,n=>Nt(n,r=>oe(r.categoryMatches))))}function Ey(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return M(e,n=>Object.assign({type:Je.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Ay(t,e,n,r){const i=lt(t,c=>Sy(c,n)),s=xy(t,e,n),a=lt(t,c=>$y(c,n)),o=lt(t,c=>Ny(c,t,r,n));return i.concat(s,a,o)}function Sy(t,e){const n=new Cy;t.accept(n);const r=n.allProductions,i=tm(r,ky),s=_t(i,o=>o.length>1);return M(Le(s),o=>{const c=bt(o),l=e.buildDuplicateFoundError(t,o),u=Ot(c),f={message:l,type:Je.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},p=nh(c);return p&&(f.parameter=p),f})}function ky(t){return`${Ot(t)}_#_${t.idx}_#_${nh(t)}`}function nh(t){return t instanceof le?t.terminalType.name:t instanceof Xe?t.nonTerminalName:""}class Cy extends Br{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function Ny(t,e,n,r){const i=[];if(Ye(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:Je.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function wy(t,e,n){const r=[];let i;return Qe(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:Je.INVALID_RULE_OVERRIDE,ruleName:t})),r}function rh(t,e,n,r=[]){const i=[],s=xs(e.definition);if(oe(s))return[];{const a=t.name;Qe(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:Je.LEFT_RECURSION,ruleName:a});const c=ga(s,r.concat([t])),l=lt(c,u=>{const f=Be(r);return f.push(u),rh(t,u,n,f)});return i.concat(l)}}function xs(t){let e=[];if(oe(t))return e;const n=bt(t);if(n instanceof Xe)e.push(n.referencedRule);else if(n instanceof nt||n instanceof ze||n instanceof ft||n instanceof ht||n instanceof rt||n instanceof Ae)e=e.concat(xs(n.definition));else if(n instanceof it)e=yt(M(n.definition,s=>xs(s.definition)));else if(!(n instanceof le))throw Error("non exhaustive match");const r=Vs(n),i=t.length>1;if(r&&i){const s=Fe(t);return e.concat(xs(s))}else return e}class ml extends Br{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function by(t,e){const n=new ml;t.accept(n);const r=n.alternations;return lt(r,s=>{const a=Ci(s.definition);return lt(a,(o,c)=>{const l=Qf([o],[],Wi,1);return oe(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:Je.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function _y(t,e,n){const r=new ml;t.accept(r);let i=r.alternations;return i=ya(i,a=>a.ignoreAmbiguities===!0),lt(i,a=>{const o=a.idx,c=a.maxLookahead||e,l=Na(o,t,c,a),u=Ly(l,a,t,n),f=Oy(l,a,t,n);return u.concat(f)})}class Iy extends Br{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 $y(t,e){const n=new ml;t.accept(n);const r=n.alternations;return lt(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Je.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function Py(t,e,n){const r=[];return j(t,i=>{const s=new Iy;i.accept(s);const a=s.allProductions;j(a,o=>{const c=pl(o),l=o.maxLookahead||e,u=o.idx,p=wa(u,i,c,l)[0];if(oe(yt(p))){const g=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:g,type:Je.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function Ly(t,e,n,r){const i=[],s=Ye(t,(o,c,l)=>(e.definition[l].ignoreAmbiguities===!0||j(c,u=>{const f=[l];j(t,(p,g)=>{l!==g&&bo(p,u)&&e.definition[g].ignoreAmbiguities!==!0&&f.push(g)}),f.length>1&&!bo(i,u)&&(i.push(u),o.push({alts:f,path:u}))}),o),[]);return M(s,o=>{const c=M(o.alts,u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:o.path}),type:Je.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function Oy(t,e,n,r){const i=Ye(t,(a,o,c)=>{const l=M(o,u=>({idx:c,path:u}));return a.concat(l)},[]);return Ui(lt(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const c=a.idx,l=a.path,u=dt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<c&&vy(p.path,l));return M(u,p=>{const g=[p.idx+1,c+1],S=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:g,prefixPath:p.path}),type:Je.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:S,alternatives:g}})}))}function xy(t,e,n){const r=[],i=M(e,s=>s.name);return j(t,s=>{const a=s.name;if(Qe(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:Je.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function Dy(t){const e=il(t,{errMsgProvider:ay}),n={};return j(t.rules,r=>{n[r.name]=r}),oy(n,e.errMsgProvider)}function My(t){return t=il(t,{errMsgProvider:Gn}),Ay(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const ih="MismatchedTokenException",sh="NoViableAltException",ah="EarlyExitException",oh="NotAllInputParsedException",ch=[ih,sh,ah,oh];Object.freeze(ch);function Ys(t){return Qe(ch,t.name)}class ba 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 lh extends ba{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=ih}}class Fy extends ba{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=sh}}class Gy extends ba{constructor(e,n){super(e,n),this.name=oh}}class Uy extends ba{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=ah}}const Ja={},uh="InRuleRecoveryException";class jy extends Error{constructor(e){super(e),this.name=uh}}class zy{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=B(e,"recoveryEnabled")?e.recoveryEnabled:rn.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=By)}getTokenToInsert(e){const n=hl(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let c=!1;const l=this.LA(1);let u=this.LA(1);const f=()=>{const p=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),S=new lh(g,l,this.LA(0));S.resyncedTokens=Ci(o),this.SAVE_ERROR(S)};for(;!c;)if(this.tokenMatcher(u,i)){f();return}else if(r.call(this)){f(),e.apply(this,n);return}else this.tokenMatcher(u,s)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new jy("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||oe(n))return!1;const r=this.LA(1);return kr(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return Qe(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=kr(e,s=>Jf(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Ja;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return M(e,(r,i)=>i===0?Ja:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=M(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return yt(e)}getFollowSetFromFollowKey(e){if(e===Ja)return[Rn];const n=e.ruleName+e.idxInCallingRule+jf+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,Rn)||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 Ci(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=Be(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return M(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function By(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[o];if(c===void 0){const p=this.getCurrRuleFullName(),g=this.getGAstProductions()[p];c=new s(g,i).startWalking(),this.firstAfterRepMap[o]=c}let l=c.token,u=c.occurrence;const f=c.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=Rn,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,a)&&this.tryInRepetitionRecovery(t,e,n,l)}const qy=4,An=8,dh=1<<An,fh=2<<An,_o=3<<An,Io=4<<An,$o=5<<An,Ds=6<<An;function Qa(t,e,n){return n|e|t}class gl{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:rn.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(oe(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 lt(e,n=>rh(n,n,Gn))}validateEmptyOrAlternatives(e){return lt(e,n=>by(n,Gn))}validateAmbiguousAlternationAlternatives(e,n){return lt(e,r=>_y(r,n,Gn))}validateSomeNonEmptyLookaheadPath(e,n){return Py(e,n,Gn)}buildLookaheadForAlternation(e){return py(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,gy)}buildLookaheadForOptional(e){return my(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,pl(e.prodType),yy)}}class Wy{initLooksAhead(e){this.dynamicTokensEnabled=B(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:rn.dynamicTokensEnabled,this.maxLookahead=B(e,"maxLookahead")?e.maxLookahead:rn.maxLookahead,this.lookaheadStrategy=B(e,"lookaheadStrategy")?e.lookaheadStrategy:new gl({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){j(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:c}=Ky(n);j(r,l=>{const u=l.idx===0?"":l.idx;this.TRACE_INIT(`${Ot(l)}${u}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:n,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=Qa(this.fullRuleNameToShort[n.name],dh,l.idx);this.setLaFuncCache(p,f)})}),j(i,l=>{this.computeLookaheadFunc(n,l.idx,_o,"Repetition",l.maxLookahead,Ot(l))}),j(s,l=>{this.computeLookaheadFunc(n,l.idx,fh,"Option",l.maxLookahead,Ot(l))}),j(a,l=>{this.computeLookaheadFunc(n,l.idx,Io,"RepetitionMandatory",l.maxLookahead,Ot(l))}),j(o,l=>{this.computeLookaheadFunc(n,l.idx,Ds,"RepetitionMandatoryWithSeparator",l.maxLookahead,Ot(l))}),j(c,l=>{this.computeLookaheadFunc(n,l.idx,$o,"RepetitionWithSeparator",l.maxLookahead,Ot(l))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Qa(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return Qa(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Vy extends Br{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const Rs=new Vy;function Ky(t){Rs.reset(),t.accept(Rs);const e=Rs.dslMethods;return Rs.reset(),e}function lu(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function uu(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function Hy(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function Yy(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const Xy="name";function hh(t,e){Object.defineProperty(t,Xy,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Jy(t,e){const n=Sr(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],a=t[s],o=a.length;for(let c=0;c<o;c++){const l=a[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function Qy(t,e){const n=function(){};hh(n,t+"BaseSemantics");const r={visit:function(i,s){if(je(i)&&(i=i[0]),!tn(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=eT(this,e);if(!oe(i)){const s=M(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
90
|
+
${s.join(`
|
|
91
|
+
|
|
92
|
+
`).replace(/\n/g,`
|
|
93
|
+
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function Zy(t,e,n){const r=function(){};hh(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return j(e,s=>{i[s]=Jy}),r.prototype=i,r.prototype.constructor=r,r}var Po;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Po||(Po={}));function eT(t,e){return tT(t,e)}function tT(t,e){const n=dt(e,i=>Hn(t[i])===!1),r=M(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Po.MISSING_METHOD,methodName:i}));return Ui(r)}class nT{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=B(e,"nodeLocationTracking")?e.nodeLocationTracking:rn.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Me,this.cstFinallyStateUpdate=Me,this.cstPostTerminal=Me,this.cstPostNonTerminal=Me,this.cstPostRule=Me;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=uu,this.setNodeLocationFromNode=uu,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=lu,this.setNodeLocationFromNode=lu,this.cstPostRule=Me,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Me,this.setNodeLocationFromNode=Me,this.cstPostRule=Me,this.setInitialNodeLocation=Me;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Hy(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Yy(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(tn(this.baseCstVisitorConstructor)){const e=Qy(this.className,Sr(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(tn(this.baseCstVisitorWithDefaultsConstructor)){const e=Zy(this.className,Sr(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 rT{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Js}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?Js:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class iT{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=Qs){if(Qe(this.definedRulesNames,e)){const a={message:Gn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Je.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=Qs){const i=wy(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Ys(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return fg(Le(this.gastProductionsCache))}}class sT{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Hs,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},B(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
94
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
95
|
+
For Further details.`);if(je(e)){if(oe(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
96
|
+
Note that the first argument for the parser constructor
|
|
97
|
+
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.
|
|
98
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
99
|
+
For Further details.`)}if(je(e))this.tokensMap=Ye(e,(s,a)=>(s[a.name]=a,s),{});else if(B(e,"modes")&&Nt(yt(Le(e.modes)),ry)){const s=yt(Le(e.modes)),a=sl(s);this.tokensMap=Ye(a,(o,c)=>(o[c.name]=c,o),{})}else if(Pp(e))this.tokensMap=Be(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=Rn;const r=B(e,"modes")?yt(Le(e.modes)):Le(e),i=Nt(r,s=>oe(s.categoryMatches));this.tokenMatcher=i?Hs:Wi,Vi(Le(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'
|
|
100
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=B(r,"resyncEnabled")?r.resyncEnabled:Qs.resyncEnabled,s=B(r,"recoveryValueFunc")?r.recoveryValueFunc:Qs.recoveryValueFunc,a=this.ruleShortNameIdx<<qy+An;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...u){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,u);const f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...u){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,u)}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(Ys(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,a.partialCstResult=c}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(fh,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const a=e.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Io,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,pe.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Io,e,fy)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Ds,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,au],o,Ds,e,au)}else throw this.raiseEarlyExitException(e,pe.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(_o,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const c=i;i=()=>o.call(this)&&c.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,_o,e,dy,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead($o,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,su],o,$o,e,su)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Ds,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(dh,n),i=je(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Gy(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw Ys(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new lh(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===uh?r:s}}else throw r}saveRecogState(){const e=this.errors,n=Be(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Rn)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class aT{initErrorHandler(e){this._errors=[],this.errorMessageProvider=B(e,"errorMessageProvider")?e.errorMessageProvider:rn.errorMessageProvider}SAVE_ERROR(e){if(Ys(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Be(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Be(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=wa(e,s,n,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new Uy(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Na(e,i,this.maxLookahead),a=[];for(let l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));const o=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Fy(c,this.LA(1),o))}}class oT{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(tn(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Qf([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=bt(e.ruleStack),i=this.getGAstProductions()[n];return new uy(i,e).startWalking()}}const _a={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(_a);const du=!0,fu=Math.pow(2,An)-1,ph=Xf({name:"RECORDING_PHASE_TOKEN",pattern:et.NA});Vi([ph]);const mh=hl(ph,`This IToken indicates the Parser is in Recording Phase
|
|
101
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(mh);const cT={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
102
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class lT{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return Js}topLevelRuleRecord(e,n){try{const r=new zr({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
103
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
104
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return oi.call(this,ze,e,n)}atLeastOneInternalRecord(e,n){oi.call(this,ft,n,e)}atLeastOneSepFirstInternalRecord(e,n){oi.call(this,ht,n,e,du)}manyInternalRecord(e,n){oi.call(this,Ae,n,e)}manySepFirstInternalRecord(e,n){oi.call(this,rt,n,e,du)}orInternalRecord(e,n){return uT.call(this,e,n)}subruleInternalRecord(e,n,r){if(Xs(n),!e||B(e,"ruleName")===!1){const o=new Error(`<SUBRULE${hu(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
105
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=jn(this.recordingProdStack),s=e.ruleName,a=new Xe({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?cT:_a}consumeInternalRecord(e,n,r){if(Xs(n),!Hf(e)){const a=new Error(`<CONSUME${hu(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
106
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=jn(this.recordingProdStack),s=new le({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),mh}}function oi(t,e,n,r=!1){Xs(n);const i=jn(this.recordingProdStack),s=Hn(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),B(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),_a}function uT(t,e){Xs(e);const n=jn(this.recordingProdStack),r=je(t)===!1,i=r===!1?t:t.DEF,s=new it({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});B(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=yf(i,o=>Hn(o.GATE));return s.hasPredicates=a,n.definition.push(s),j(i,o=>{const c=new nt({definition:[]});s.definition.push(c),B(o,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:B(o,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),o.ALT.call(this),this.recordingProdStack.pop()}),_a}function hu(t){return t===0?"":`${t}`}function Xs(t){if(t<0||t>fu){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
107
|
+
Idx value must be a none negative value smaller than ${fu+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class dT{initPerformanceTracer(e){if(B(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=rn.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=Gf(n),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function fT(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 Js=hl(Rn,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Js);const rn=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:vr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Qs=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Je;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Je||(Je={}));function pu(t=void 0){return function(){return t}}class Ki{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",()=>{Uf(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),j(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=Dy({rules:Le(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(oe(r)&&this.skipValidations===!1){const i=My({rules:Le(this.gastProductionsCache),tokenTypes:Le(this.tokensMap),errMsgProvider:Gn,grammarName:n}),s=Ey({lookaheadStrategy:this.lookaheadStrategy,rules:Le(this.gastProductionsCache),tokenTypes:Le(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),oe(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Rg(Le(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:Le(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Le(this.gastProductionsCache))})),!Ki.DEFER_DEFINITION_ERRORS_HANDLING&&!oe(this.definitionErrors))throw e=M(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
108
|
+
${e.join(`
|
|
109
|
+
-------------------------------
|
|
110
|
+
`)}`)})}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),B(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
111
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
112
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
113
|
+
For further details.`);this.skipValidations=B(n,"skipValidations")?n.skipValidations:rn.skipValidations}}Ki.DEFER_DEFINITION_ERRORS_HANDLING=!1;fT(Ki,[zy,Wy,nT,rT,sT,iT,aT,oT,lT,dT]);class hT extends Ki{constructor(e,n=rn){const r=Be(n);r.outputCst=!1,super(e,r)}}function Cr(t,e,n){return`${t.name}_${e}_${n}`}const vn=1,pT=2,gh=4,yh=5,Hi=7,mT=8,gT=9,yT=10,TT=11,Th=12;class yl{constructor(e){this.target=e}isEpsilon(){return!1}}class Tl extends yl{constructor(e,n){super(e),this.tokenType=n}}class Rh extends yl{constructor(e){super(e)}isEpsilon(){return!0}}class Rl extends yl{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function RT(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};vT(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Yn(e,i,i);s!==void 0&&$T(e,i,s)}return e}function vT(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Oe(t,i,void 0,{type:pT}),a=Oe(t,i,void 0,{type:Hi});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function vh(t,e,n){return n instanceof le?vl(t,e,n.terminalType,n):n instanceof Xe?IT(t,e,n):n instanceof it?CT(t,e,n):n instanceof ze?NT(t,e,n):n instanceof Ae?ET(t,e,n):n instanceof rt?AT(t,e,n):n instanceof ft?ST(t,e,n):n instanceof ht?kT(t,e,n):Yn(t,e,n)}function ET(t,e,n){const r=Oe(t,e,n,{type:yh});Sn(t,r);const i=qr(t,e,r,n,Yn(t,e,n));return Ah(t,e,n,i)}function AT(t,e,n){const r=Oe(t,e,n,{type:yh});Sn(t,r);const i=qr(t,e,r,n,Yn(t,e,n)),s=vl(t,e,n.separator,n);return Ah(t,e,n,i,s)}function ST(t,e,n){const r=Oe(t,e,n,{type:gh});Sn(t,r);const i=qr(t,e,r,n,Yn(t,e,n));return Eh(t,e,n,i)}function kT(t,e,n){const r=Oe(t,e,n,{type:gh});Sn(t,r);const i=qr(t,e,r,n,Yn(t,e,n)),s=vl(t,e,n.separator,n);return Eh(t,e,n,i,s)}function CT(t,e,n){const r=Oe(t,e,n,{type:vn});Sn(t,r);const i=M(n.definition,a=>vh(t,e,a));return qr(t,e,r,n,...i)}function NT(t,e,n){const r=Oe(t,e,n,{type:vn});Sn(t,r);const i=qr(t,e,r,n,Yn(t,e,n));return wT(t,e,n,i)}function Yn(t,e,n){const r=dt(M(n.definition,i=>vh(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:_T(t,r)}function Eh(t,e,n,r,i){const s=r.left,a=r.right,o=Oe(t,e,n,{type:TT});Sn(t,o);const c=Oe(t,e,n,{type:Th});return s.loopback=o,c.loopback=o,t.decisionMap[Cr(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,_e(a,o),i===void 0?(_e(o,s),_e(o,c)):(_e(o,c),_e(o,i.left),_e(i.right,s)),{left:s,right:c}}function Ah(t,e,n,r,i){const s=r.left,a=r.right,o=Oe(t,e,n,{type:yT});Sn(t,o);const c=Oe(t,e,n,{type:Th}),l=Oe(t,e,n,{type:gT});return o.loopback=l,c.loopback=l,_e(o,s),_e(o,c),_e(a,l),i!==void 0?(_e(l,c),_e(l,i.left),_e(i.right,s)):_e(l,o),t.decisionMap[Cr(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:c}}function wT(t,e,n,r){const i=r.left,s=r.right;return _e(i,s),t.decisionMap[Cr(e,"Option",n.idx)]=i,r}function Sn(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function qr(t,e,n,r,...i){const s=Oe(t,e,r,{type:mT,start:n});n.end=s;for(const o of i)o!==void 0?(_e(n,o.left),_e(o.right,s)):_e(n,s);const a={left:n,right:s};return t.decisionMap[Cr(e,bT(r),r.idx)]=n,a}function bT(t){if(t instanceof it)return"Alternation";if(t instanceof ze)return"Option";if(t instanceof Ae)return"Repetition";if(t instanceof rt)return"RepetitionWithSeparator";if(t instanceof ft)return"RepetitionMandatory";if(t instanceof ht)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function _T(t,e){const n=e.length;for(let s=0;s<n-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const c=o instanceof Rl,l=o,u=e[s+1].left;a.left.type===vn&&a.right.type===vn&&o!==void 0&&(c&&l.followState===a.right||o.target===a.right)?(c?l.followState=u:o.target=u,PT(t,a.right)):_e(a.right,u)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function vl(t,e,n,r){const i=Oe(t,e,r,{type:vn}),s=Oe(t,e,r,{type:vn});return El(i,new Tl(s,n)),{left:i,right:s}}function IT(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Oe(t,e,n,{type:vn}),a=Oe(t,e,n,{type:vn}),o=new Rl(i,r,a);return El(s,o),{left:s,right:a}}function $T(t,e,n){const r=t.ruleToStartState.get(e);_e(r,n.left);const i=t.ruleToStopState.get(e);return _e(n.right,i),{left:r,right:i}}function _e(t,e){const n=new Rh(e);El(t,n)}function Oe(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function El(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function PT(t,e){t.states.splice(t.states.indexOf(e),1)}const Zs={};class Lo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=Sh(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return M(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function Sh(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function LT(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 kh{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const mu=new kh;class OT extends gl{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=RT(e.rules),this.dfas=xT(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=Cr(r,"Alternation",n),u=this.atn.decisionMap[c].decision,f=M(ou({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),p=>M(p,g=>g[0]));if(gu(f,!1)&&!s){const p=Ye(f,(g,S,N)=>(j(S,x=>{x&&(g[x.tokenTypeIdx]=N,j(x.categoryMatches,w=>{g[w]=N}))}),g),{});return i?function(g){var S;const N=this.LA(1),x=p[N.tokenTypeIdx];if(g!==void 0&&x!==void 0){const w=(S=g[x])===null||S===void 0?void 0:S.GATE;if(w!==void 0&&w.call(this)===!1)return}return x}:function(){const g=this.LA(1);return p[g.tokenTypeIdx]}}else return i?function(p){const g=new kh,S=p===void 0?0:p.length;for(let x=0;x<S;x++){const w=p?.[x].GATE;g.set(x,w===void 0||w.call(this))}const N=Za.call(this,a,u,g,o);return typeof N=="number"?N:void 0}:function(){const p=Za.call(this,a,u,mu,o);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=Cr(r,i,n),u=this.atn.decisionMap[c].decision,f=M(ou({maxLookahead:1,occurrence:n,prodType:i,rule:r}),p=>M(p,g=>g[0]));if(gu(f)&&f[0][0]&&!s){const p=f[0],g=yt(p);if(g.length===1&&oe(g[0].categoryMatches)){const N=g[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===N}}else{const S=Ye(g,(N,x)=>(x!==void 0&&(N[x.tokenTypeIdx]=!0,j(x.categoryMatches,w=>{N[w]=!0})),N),{});return function(){const N=this.LA(1);return S[N.tokenTypeIdx]===!0}}}return function(){const p=Za.call(this,a,u,mu,o);return typeof p=="object"?!1:p===0}}}function gu(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function xT(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=LT(t.decisionStates[r],r);return n}function Za(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const o=VT(i.atnStartState);s=Nh(i,Ch(o)),i.start=s}return DT.apply(this,[i,s,n,r])}function DT(t,e,n,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let c=zT(i,o);if(c===void 0&&(c=MT.apply(this,[t,i,o,s,n,r])),c===Zs)return jT(a,i,o);if(c.isAcceptState===!0)return c.prediction;i=c,a.push(o),o=this.LA(s++)}}function MT(t,e,n,r,i,s){const a=BT(e.configs,n,i);if(a.size===0)return yu(t,e,n,Zs),Zs;let o=Ch(a);const c=WT(a,i);if(c!==void 0)o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c;else if(XT(a)){const l=Bp(a.alts);o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l,FT.apply(this,[t,r,a.alts,s])}return o=yu(t,e,n,o),o}function FT(t,e,n,r){const i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);const s=t.atnStartState,a=s.rule,o=s.production,c=GT({topLevelRule:a,ambiguityIndices:n,production:o,prefixPath:i});r(c)}function GT(t){const e=M(t.prefixPath,i=>Ar(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${UT(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
114
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
115
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
116
|
+
For Further details.`,r}function UT(t){if(t instanceof Xe)return"SUBRULE";if(t instanceof ze)return"OPTION";if(t instanceof it)return"OR";if(t instanceof ft)return"AT_LEAST_ONE";if(t instanceof ht)return"AT_LEAST_ONE_SEP";if(t instanceof rt)return"MANY_SEP";if(t instanceof Ae)return"MANY";if(t instanceof le)return"CONSUME";throw Error("non exhaustive match")}function jT(t,e,n){const r=lt(e.configs.elements,s=>s.state.transitions),i=lm(r.filter(s=>s instanceof Tl).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function zT(t,e){return t.edges[e.tokenTypeIdx]}function BT(t,e,n){const r=new Lo,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===Hi){i.push(a);continue}const o=a.state.transitions.length;for(let c=0;c<o;c++){const l=a.state.transitions[c],u=qT(l,e);u!==void 0&&r.add({state:u,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Lo;for(const a of r.elements)ea(a,s)}if(i.length>0&&!HT(s))for(const a of i)s.add(a);return s}function qT(t,e){if(t instanceof Tl&&Jf(e,t.tokenType))return t.target}function WT(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 Ch(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function yu(t,e,n,r){return r=Nh(t,r),e.edges[n.tokenTypeIdx]=r,r}function Nh(t,e){if(e===Zs)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function VT(t){const e=new Lo,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};ea(s,e)}return e}function ea(t,e){const n=t.state;if(n.type===Hi){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};ea(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],a=KT(t,s);a!==void 0&&ea(a,e)}}function KT(t,e){if(e instanceof Rh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Rl){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function HT(t){for(const e of t.elements)if(e.state.type===Hi)return!0;return!1}function YT(t){for(const e of t.elements)if(e.state.type!==Hi)return!1;return!0}function XT(t){if(YT(t))return!0;const e=JT(t.elements);return QT(e)&&!ZT(e)}function JT(t){const e=new Map;for(const n of t){const r=Sh(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function QT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function ZT(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Oo;(function(t){function e(n){return typeof n=="string"}t.is=e})(Oo||(Oo={}));var ta;(function(t){function e(n){return typeof n=="string"}t.is=e})(ta||(ta={}));var xo;(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})(xo||(xo={}));var bi;(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})(bi||(bi={}));var ee;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=bi.MAX_VALUE),i===Number.MAX_VALUE&&(i=bi.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&v.uinteger(i.line)&&v.uinteger(i.character)}t.is=n})(ee||(ee={}));var Y;(function(t){function e(r,i,s,a){if(v.uinteger(r)&&v.uinteger(i)&&v.uinteger(s)&&v.uinteger(a))return{start:ee.create(r,i),end:ee.create(s,a)};if(ee.is(r)&&ee.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&ee.is(i.start)&&ee.is(i.end)}t.is=n})(Y||(Y={}));var _i;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&Y.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=n})(_i||(_i={}));var Do;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&Y.is(i.targetRange)&&v.string(i.targetUri)&&Y.is(i.targetSelectionRange)&&(Y.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=n})(Do||(Do={}));var na;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.numberRange(i.red,0,1)&&v.numberRange(i.green,0,1)&&v.numberRange(i.blue,0,1)&&v.numberRange(i.alpha,0,1)}t.is=n})(na||(na={}));var Mo;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&Y.is(i.range)&&na.is(i.color)}t.is=n})(Mo||(Mo={}));var Fo;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||Mt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,Mt.is))}t.is=n})(Fo||(Fo={}));var Go;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Go||(Go={}));var Uo;(function(t){function e(r,i,s,a,o,c){const l={startLine:r,endLine:i};return v.defined(s)&&(l.startCharacter=s),v.defined(a)&&(l.endCharacter=a),v.defined(o)&&(l.kind=o),v.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.uinteger(i.startLine)&&v.uinteger(i.startLine)&&(v.undefined(i.startCharacter)||v.uinteger(i.startCharacter))&&(v.undefined(i.endCharacter)||v.uinteger(i.endCharacter))&&(v.undefined(i.kind)||v.string(i.kind))}t.is=n})(Uo||(Uo={}));var ra;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&_i.is(i.location)&&v.string(i.message)}t.is=n})(ra||(ra={}));var jo;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(jo||(jo={}));var zo;(function(t){t.Unnecessary=1,t.Deprecated=2})(zo||(zo={}));var Bo;(function(t){function e(n){const r=n;return v.objectLiteral(r)&&v.string(r.href)}t.is=e})(Bo||(Bo={}));var Ii;(function(t){function e(r,i,s,a,o,c){let l={range:r,message:i};return v.defined(s)&&(l.severity=s),v.defined(a)&&(l.code=a),v.defined(o)&&(l.source=o),v.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return v.defined(s)&&Y.is(s.range)&&v.string(s.message)&&(v.number(s.severity)||v.undefined(s.severity))&&(v.integer(s.code)||v.string(s.code)||v.undefined(s.code))&&(v.undefined(s.codeDescription)||v.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(s.source)||v.undefined(s.source))&&(v.undefined(s.relatedInformation)||v.typedArray(s.relatedInformation,ra.is))}t.is=n})(Ii||(Ii={}));var Vn;(function(t){function e(r,i,...s){let a={title:r,command:i};return v.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.title)&&v.string(i.command)}t.is=n})(Vn||(Vn={}));var Mt;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return v.objectLiteral(a)&&v.string(a.newText)&&Y.is(a.range)}t.is=i})(Mt||(Mt={}));var Un;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.string(i.label)&&(v.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(v.string(i.description)||i.description===void 0)}t.is=n})(Un||(Un={}));var Ue;(function(t){function e(n){const r=n;return v.string(r)}t.is=e})(Ue||(Ue={}));var Jt;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return Mt.is(a)&&(Un.is(a.annotationId)||Ue.is(a.annotationId))}t.is=i})(Jt||(Jt={}));var $i;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&Pi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})($i||($i={}));var Nr;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&v.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ue.is(i.annotationId))}t.is=n})(Nr||(Nr={}));var wr;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&v.string(i.oldUri)&&v.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ue.is(i.annotationId))}t.is=n})(wr||(wr={}));var br;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&v.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||v.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||v.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Ue.is(i.annotationId))}t.is=n})(br||(br={}));var ia;(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=>v.string(i.kind)?Nr.is(i)||wr.is(i)||br.is(i):$i.is(i)))}t.is=e})(ia||(ia={}));class vs{constructor(e,n){this.edits=e,this.changeAnnotations=n}insert(e,n,r){let i,s;if(r===void 0?i=Mt.insert(e,n):Ue.is(r)?(s=r,i=Jt.insert(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Jt.insert(e,n,s)),this.edits.push(i),s!==void 0)return s}replace(e,n,r){let i,s;if(r===void 0?i=Mt.replace(e,n):Ue.is(r)?(s=r,i=Jt.replace(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Jt.replace(e,n,s)),this.edits.push(i),s!==void 0)return s}delete(e,n){let r,i;if(n===void 0?r=Mt.del(e):Ue.is(n)?(i=n,r=Jt.del(e,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Jt.del(e,i)),this.edits.push(r),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class Tu{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,n){let r;if(Ue.is(e)?r=e:(r=this.nextId(),n=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class eR{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Tu(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(n=>{if($i.is(n)){const r=new vs(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(n=>{const r=new vs(e.changes[n]);this._textEditChanges[n]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Pi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:e.uri,version:e.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],s={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(s),r=new vs(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[e];if(!n){let r=[];this._workspaceEdit.changes[e]=r,n=new vs(r),this._textEditChanges[e]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Tu,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Un.is(n)||Ue.is(n)?i=n:r=n;let s,a;if(i===void 0?s=Nr.create(e,r):(a=Ue.is(i)?i:this._changeAnnotations.manage(i),s=Nr.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}renameFile(e,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;Un.is(r)||Ue.is(r)?s=r:i=r;let a,o;if(s===void 0?a=wr.create(e,n,i):(o=Ue.is(s)?s:this._changeAnnotations.manage(s),a=wr.create(e,n,i,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Un.is(n)||Ue.is(n)?i=n:r=n;let s,a;if(i===void 0?s=br.create(e,r):(a=Ue.is(i)?i:this._changeAnnotations.manage(i),s=br.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}}var qo;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)}t.is=n})(qo||(qo={}));var Wo;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)&&v.integer(i.version)}t.is=n})(Wo||(Wo={}));var Pi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)&&(i.version===null||v.integer(i.version))}t.is=n})(Pi||(Pi={}));var Vo;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)&&v.string(i.languageId)&&v.integer(i.version)&&v.string(i.text)}t.is=n})(Vo||(Vo={}));var sa;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(sa||(sa={}));var _r;(function(t){function e(n){const r=n;return v.objectLiteral(n)&&sa.is(r.kind)&&v.string(r.value)}t.is=e})(_r||(_r={}));var Ko;(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})(Ko||(Ko={}));var Ho;(function(t){t.PlainText=1,t.Snippet=2})(Ho||(Ho={}));var Yo;(function(t){t.Deprecated=1})(Yo||(Yo={}));var Xo;(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&&v.string(i.newText)&&Y.is(i.insert)&&Y.is(i.replace)}t.is=n})(Xo||(Xo={}));var Jo;(function(t){t.asIs=1,t.adjustIndentation=2})(Jo||(Jo={}));var Qo;(function(t){function e(n){const r=n;return r&&(v.string(r.detail)||r.detail===void 0)&&(v.string(r.description)||r.description===void 0)}t.is=e})(Qo||(Qo={}));var Zo;(function(t){function e(n){return{label:n}}t.create=e})(Zo||(Zo={}));var ec;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(ec||(ec={}));var Li;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=n})(Li||(Li={}));var tc;(function(t){function e(n){let r=n;return!!r&&v.objectLiteral(r)&&(_r.is(r.contents)||Li.is(r.contents)||v.typedArray(r.contents,Li.is))&&(n.range===void 0||Y.is(n.range))}t.is=e})(tc||(tc={}));var nc;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(nc||(nc={}));var rc;(function(t){function e(n,r,...i){let s={label:n};return v.defined(r)&&(s.documentation=r),v.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(rc||(rc={}));var ic;(function(t){t.Text=1,t.Read=2,t.Write=3})(ic||(ic={}));var sc;(function(t){function e(n,r){let i={range:n};return v.number(r)&&(i.kind=r),i}t.create=e})(sc||(sc={}));var ac;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(ac||(ac={}));var oc;(function(t){t.Deprecated=1})(oc||(oc={}));var cc;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(cc||(cc={}));var lc;(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})(lc||(lc={}));var uc;(function(t){function e(r,i,s,a,o,c){let l={name:r,detail:i,kind:s,range:a,selectionRange:o};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&v.string(i.name)&&v.number(i.kind)&&Y.is(i.range)&&Y.is(i.selectionRange)&&(i.detail===void 0||v.string(i.detail))&&(i.deprecated===void 0||v.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(uc||(uc={}));var dc;(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"})(dc||(dc={}));var Oi;(function(t){t.Invoked=1,t.Automatic=2})(Oi||(Oi={}));var fc;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return v.defined(i)&&v.typedArray(i.diagnostics,Ii.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Oi.Invoked||i.triggerKind===Oi.Automatic)}t.is=n})(fc||(fc={}));var hc;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):Vn.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,Ii.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Vn.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||ia.is(i.edit))}t.is=n})(hc||(hc={}));var pc;(function(t){function e(r,i){let s={range:r};return v.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return v.defined(i)&&Y.is(i.range)&&(v.undefined(i.command)||Vn.is(i.command))}t.is=n})(pc||(pc={}));var mc;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.uinteger(i.tabSize)&&v.boolean(i.insertSpaces)}t.is=n})(mc||(mc={}));var gc;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return v.defined(i)&&Y.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=n})(gc||(gc={}));var yc;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&Y.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(yc||(yc={}));var Tc;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Tc||(Tc={}));var Rc;(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"})(Rc||(Rc={}));var vc;(function(t){function e(n){const r=n;return v.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})(vc||(vc={}));var Ec;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Y.is(i.range)&&v.string(i.text)}t.is=n})(Ec||(Ec={}));var Ac;(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&&Y.is(i.range)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=n})(Ac||(Ac={}));var Sc;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Y.is(i.range)&&(v.string(i.expression)||i.expression===void 0)}t.is=n})(Sc||(Sc={}));var kc;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return v.defined(i)&&Y.is(r.stoppedLocation)}t.is=n})(kc||(kc={}));var aa;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(aa||(aa={}));var oa;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||_r.is(i.tooltip))&&(i.location===void 0||_i.is(i.location))&&(i.command===void 0||Vn.is(i.command))}t.is=n})(oa||(oa={}));var Cc;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&ee.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,oa.is))&&(i.kind===void 0||aa.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,Mt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||_r.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=n})(Cc||(Cc={}));var Nc;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(Nc||(Nc={}));var wc;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(wc||(wc={}));var bc;(function(t){function e(n){return{items:n}}t.create=e})(bc||(bc={}));var _c;(function(t){t.Invoked=0,t.Automatic=1})(_c||(_c={}));var Ic;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(Ic||(Ic={}));var $c;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})($c||($c={}));var Pc;(function(t){function e(n){const r=n;return v.objectLiteral(r)&&ta.is(r.uri)&&v.string(r.name)}t.is=e})(Pc||(Pc={}));const tR=[`
|
|
117
|
+
`,`\r
|
|
118
|
+
`,"\r"];var Lc;(function(t){function e(s,a,o,c){return new nR(s,a,o,c)}t.create=e;function n(s){let a=s;return!!(v.defined(a)&&v.string(a.uri)&&(v.undefined(a.languageId)||v.string(a.languageId))&&v.uinteger(a.lineCount)&&v.func(a.getText)&&v.func(a.positionAt)&&v.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),c=i(a,(u,f)=>{let p=u.range.start.line-f.range.start.line;return p===0?u.range.start.character-f.range.start.character:p}),l=o.length;for(let u=c.length-1;u>=0;u--){let f=c[u],p=s.offsetAt(f.range.start),g=s.offsetAt(f.range.end);if(g<=l)o=o.substring(0,p)+f.newText+o.substring(g,o.length);else throw new Error("Overlapping edit");l=p}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,c=s.slice(0,o),l=s.slice(o);i(c,a),i(l,a);let u=0,f=0,p=0;for(;u<c.length&&f<l.length;)a(c[u],l[f])<=0?s[p++]=c[u++]:s[p++]=l[f++];for(;u<c.length;)s[p++]=c[u++];for(;f<l.length;)s[p++]=l[f++];return s}})(Lc||(Lc={}));let nR=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
119
|
+
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
120
|
+
`&&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 ee.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return ee.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var v;(function(t){const e=Object.prototype.toString;function n(g){return typeof g<"u"}t.defined=n;function r(g){return typeof g>"u"}t.undefined=r;function i(g){return g===!0||g===!1}t.boolean=i;function s(g){return e.call(g)==="[object String]"}t.string=s;function a(g){return e.call(g)==="[object Number]"}t.number=a;function o(g,S,N){return e.call(g)==="[object Number]"&&S<=g&&g<=N}t.numberRange=o;function c(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=c;function l(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=l;function u(g){return e.call(g)==="[object Function]"}t.func=u;function f(g){return g!==null&&typeof g=="object"}t.objectLiteral=f;function p(g,S){return Array.isArray(g)&&g.every(S)}t.typedArray=p})(v||(v={}));const rR=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Jt},get ChangeAnnotation(){return Un},get ChangeAnnotationIdentifier(){return Ue},get CodeAction(){return hc},get CodeActionContext(){return fc},get CodeActionKind(){return dc},get CodeActionTriggerKind(){return Oi},get CodeDescription(){return Bo},get CodeLens(){return pc},get Color(){return na},get ColorInformation(){return Mo},get ColorPresentation(){return Fo},get Command(){return Vn},get CompletionItem(){return Zo},get CompletionItemKind(){return Ko},get CompletionItemLabelDetails(){return Qo},get CompletionItemTag(){return Yo},get CompletionList(){return ec},get CreateFile(){return Nr},get DeleteFile(){return br},get Diagnostic(){return Ii},get DiagnosticRelatedInformation(){return ra},get DiagnosticSeverity(){return jo},get DiagnosticTag(){return zo},get DocumentHighlight(){return sc},get DocumentHighlightKind(){return ic},get DocumentLink(){return gc},get DocumentSymbol(){return uc},get DocumentUri(){return Oo},EOL:tR,get FoldingRange(){return Uo},get FoldingRangeKind(){return Go},get FormattingOptions(){return mc},get Hover(){return tc},get InlayHint(){return Cc},get InlayHintKind(){return aa},get InlayHintLabelPart(){return oa},get InlineCompletionContext(){return $c},get InlineCompletionItem(){return wc},get InlineCompletionList(){return bc},get InlineCompletionTriggerKind(){return _c},get InlineValueContext(){return kc},get InlineValueEvaluatableExpression(){return Sc},get InlineValueText(){return Ec},get InlineValueVariableLookup(){return Ac},get InsertReplaceEdit(){return Xo},get InsertTextFormat(){return Ho},get InsertTextMode(){return Jo},get Location(){return _i},get LocationLink(){return Do},get MarkedString(){return Li},get MarkupContent(){return _r},get MarkupKind(){return sa},get OptionalVersionedTextDocumentIdentifier(){return Pi},get ParameterInformation(){return nc},get Position(){return ee},get Range(){return Y},get RenameFile(){return wr},get SelectedCompletionInfo(){return Ic},get SelectionRange(){return yc},get SemanticTokenModifiers(){return Rc},get SemanticTokenTypes(){return Tc},get SemanticTokens(){return vc},get SignatureInformation(){return rc},get StringValue(){return Nc},get SymbolInformation(){return cc},get SymbolKind(){return ac},get SymbolTag(){return oc},get TextDocument(){return Lc},get TextDocumentEdit(){return $i},get TextDocumentIdentifier(){return qo},get TextDocumentItem(){return Vo},get TextEdit(){return Mt},get URI(){return ta},get VersionedTextDocumentIdentifier(){return Wo},WorkspaceChange:eR,get WorkspaceEdit(){return ia},get WorkspaceFolder(){return Pc},get WorkspaceSymbol(){return lc},get integer(){return xo},get uinteger(){return bi}},Symbol.toStringTag,{value:"Module"}));class iR{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new bh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new Al;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new Oc(e.startOffset,e.image.length,Ao(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new Oc(s.startOffset,s.image.length,Ao(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class wh{get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Oc extends wh{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 Al extends wh{constructor(){super(...arguments),this.content=new Sl(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:ee.create(0,0),end:ee.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 Sl extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Sl.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class bh extends Al{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const xc=Symbol("Datatype");function eo(t){return t.$type===xc}const Ru="",_h=t=>t.endsWith(Ru)?t:t+Ru;class Ih{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new lR(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Ph(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class sR extends Ih{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new iR,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=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);let i;zs(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(_h(e.name),this.startImplementation(r,i,n).bind(this));return this.allRules.set(e.name,s),an(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){const n=e.name,r=new Map;for(let i=0;i<e.operators.precedences.length;i++){const s=e.operators.precedences[i];for(const a of s.operators)r.set(a.value,{precedence:i,rightAssoc:s.associativity==="right"})}this.operatorPrecedence.set(n,r)}computeRuleType(e){return zs(e)?wi(e):e.fragment?void 0:xf(e)?xc:wi(e)}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=this.doParse(i);return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,po(s,{deep:!0}),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}doParse(e){let n=this.wrapper.rule(e);if(this.stack.length>0&&(n=this.construct()),n===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return n}startImplementation(e,n,r){return i=>{const s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===xc?a.value="":n!==void 0&&(a.$infixName=n)}return r(i),s?this.construct():void 0}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,crossRef:c}=this.getAssignment(r),l=this.current;if(o){const u=Bn(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,u,a,c)}else if(eo(l)){let u=i.image;Bn(r)||(u=this.converter.convert(u,a).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,n,s)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,n,r){const{assignment:i,crossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(eo(a))a.value+=e.toString();else if(typeof e=="object"&&e){const c=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(c)}}}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)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):eo(e)?this.converter.convert(e.value,e.$cstNode):(fm(this.astReflection,e),e)}constructInfix(e,n){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const i=e.operators;if(!Array.isArray(i)||r.length<2)return r[0];let s=0,a=-1;for(let N=0;N<i.length;N++){const x=i[N],w=n.get(x)??{precedence:1/0,rightAssoc:!1};w.precedence>a?(a=w.precedence,s=N):w.precedence===a&&(w.rightAssoc||(s=N))}const o=i.slice(0,s),c=i.slice(s+1),l=r.slice(0,s+1),u=r.slice(s+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},p={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:c},g=this.constructInfix(f,n),S=this.constructInfix(p,n);return{$type:e.$type,$cstNode:e.$cstNode,left:g,operator:i[s],right:S}}getAssignment(e){if(!this.assignmentMap.has(e)){const n=Ta(e,zn);this.assignmentMap.set(e,{assignment:n,crossRef:n&&va(n.terminal)?n.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s==="single"&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):s==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class aR{buildMismatchTokenMessage(e){return vr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return vr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return vr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return vr.buildEarlyExitMessage(e)}}class $h extends aR{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 oR extends Ih{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(_h(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const cR={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new $h};class Ph extends hT{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,{...cR,lookaheadStrategy:r?new gl({maxLookahead:n.maxLookahead}):new OT({logging:n.skipValidations?()=>{}:void 0}),...n})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n,r){return this.RULE(e,n,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n,void 0)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}rule(e){return e.call(this,{})}}class lR extends Ph{constructor(e,n,r){super(e,n),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,n,r){this.task.startSubTask(this.ruleName(n));try{return super.subrule(e,n,r)}finally{this.task.stopSubTask(this.ruleName(n))}}}function Lh(t,e,n){return uR({parser:e,tokens:n,ruleNames:new Map},t),e}function uR(t,e){const n=If(e,!1),r=he(e.rules).filter(an).filter(s=>n.has(s));for(const s of r){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,Kn(a,s.definition))}const i=he(e.rules).filter(zs).filter(s=>n.has(s));for(const s of i)t.parser.rule(s,dR(t,s))}function dR(t,e){const n=e.call.rule.ref;if(!n)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(on(n))throw new Error("Cannot use terminal rule in infix expression");const r=e.operators.precedences.flatMap(g=>g.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const c={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:r}},l={...s,$container:a};a.elements.push(c,l);const f=r.map(g=>t.tokens[g.value]).map((g,S)=>({ALT:()=>t.parser.consume(S,g,c)}));let p;return g=>{p??(p=kl(t,n)),t.parser.subrule(0,p,!1,s,g),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,p,!1,l,g)}})}}function Kn(t,e,n=!1){let r;if(Bn(e))r=TR(t,e);else if(Ra(e))r=fR(t,e);else if(zn(e))r=Kn(t,e.terminal);else if(va(e))r=Oh(t,e);else if(qn(e))r=hR(t,e);else if(Sf(e))r=mR(t,e);else if(Cf(e))r=gR(t,e);else if(cl(e))r=yR(t,e);else if(Tm(e)){const i=t.consume++;r=()=>t.parser.consume(i,Rn,e)}else throw new wf(e.$cstNode,`Unexpected element type: ${e.$type}`);return xh(t,n?void 0:ca(e),r,e.cardinality)}function fR(t,e){const n=wi(e);return()=>t.parser.action(n,e)}function hR(t,e){const n=e.rule.ref;if(zi(n)){const r=t.subrule++,i=an(n)&&n.fragment,s=e.arguments.length>0?pR(n,e.arguments):()=>({});let a;return o=>{a??(a=kl(t,n)),t.parser.subrule(r,a,i,e,s(o))}}else if(on(n)){const r=t.consume++,i=Dc(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Bi();else throw new wf(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function pR(t,e){if(e.some(r=>r.calledByName)){const r=e.map(i=>({parameterName:i.parameter?.ref?.name,predicate:xt(i.value)}));return i=>{const s={};for(const{parameterName:a,predicate:o}of r)a&&(s[a]=o(i));return s}}else{const r=e.map(i=>xt(i.value));return i=>{const s={};for(let a=0;a<r.length;a++)if(a<t.parameters.length){const o=t.parameters[a].name,c=r[a];s[o]=c(i)}return s}}}function xt(t){if(ym(t)){const e=xt(t.left),n=xt(t.right);return r=>e(r)||n(r)}else if(gm(t)){const e=xt(t.left),n=xt(t.right);return r=>e(r)&&n(r)}else if(Em(t)){const e=xt(t.value);return n=>!e(n)}else if(Am(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(pm(t)){const e=!!t.true;return()=>e}Bi()}function mR(t,e){if(e.elements.length===1)return Kn(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Kn(t,i,!0)},a=ca(i);a&&(s.GATE=xt(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function gR(t,e){if(e.elements.length===1)return Kn(t,e.elements[0]);const n=[];for(const o of e.elements){const c={ALT:Kn(t,o,!0)},l=ca(o);l&&(c.GATE=xt(l)),n.push(c)}const r=t.or++,i=(o,c)=>{const l=c.getRuleStack().join("-");return`uGroup_${o}_${l}`},s=o=>t.parser.alternatives(r,n.map((c,l)=>{const u={ALT:()=>!0},f=t.parser;u.ALT=()=>{if(c.ALT(o),!f.isRecording()){const g=i(r,f);f.unorderedGroups.get(g)||f.unorderedGroups.set(g,[]);const S=f.unorderedGroups.get(g);typeof S?.[l]>"u"&&(S[l]=!0)}};const p=c.GATE;return p?u.GATE=()=>p(o):u.GATE=()=>!f.unorderedGroups.get(i(r,f))?.[l],u})),a=xh(t,ca(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function yR(t,e){const n=e.elements.map(r=>Kn(t,r));return r=>n.forEach(i=>i(r))}function ca(t){if(cl(t))return t.guardCondition}function Oh(t,e,n=e.terminal){if(n)if(qn(n)&&an(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;let s;return a=>{s??(s=kl(t,r)),t.parser.subrule(i,s,!1,e,a)}}else if(qn(n)&&on(n.rule.ref)){const r=t.consume++,i=Dc(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Bn(n)){const r=t.consume++,i=Dc(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 i=Lf(e.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+wi(e.type.ref));return Oh(t,e,i)}}function TR(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function xh(t,e,n,r){const i=e&&xt(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:pu(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:pu(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else Bi()}function kl(t,e){const n=RR(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function RR(t,e){if(zi(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!an(r);)(cl(r)||Sf(r)||Cf(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function Dc(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function vR(t){const e=t.Grammar,n=t.parser.Lexer,r=new oR(t);return Lh(e,r,n.definition),r.finalize(),r}function ER(t){const e=AR(t);return e.finalize(),e}function AR(t){const e=t.Grammar,n=t.parser.Lexer,r=new sR(t);return Lh(e,r,n.definition)}class Dh{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=he(If(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(on).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=ul(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=_f(n)?et.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}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(zi).flatMap(i=>ji(i).filter(Bn)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(Aa(e.value),"i"):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&Vm("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Mh{convert(e,n){let r=n.grammarSource;if(va(r)&&(r=Xm(r)),qn(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){switch(e.name.toUpperCase()){case"INT":return Ht.convertInt(n);case"STRING":return Ht.convertString(n);case"ID":return Ht.convertID(n)}switch(rg(e)?.toLowerCase()){case"number":return Ht.convertNumber(n);case"boolean":return Ht.convertBoolean(n);case"bigint":return Ht.convertBigint(n);case"date":return Ht.convertDate(n);default:return n}}}var Ht;(function(t){function e(l){let u="";for(let f=1;f<l.length-1;f++){const p=l.charAt(f);if(p==="\\"){const g=l.charAt(++f);u+=n(g)}else u+=p}return u}t.convertString=e;function n(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
121
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function r(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=r;function i(l){return parseInt(l)}t.convertInt=i;function s(l){return BigInt(l)}t.convertBigint=s;function a(l){return new Date(l)}t.convertDate=a;function o(l){return Number(l)}t.convertNumber=o;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(Ht||(Ht={}));var En={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});let Mc;function Fc(){if(Mc===void 0)throw new Error("No runtime abstraction layer installed");return Mc}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Mc=n}t.install=e})(Fc||(Fc={}));cn.default=Fc;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.stringArray=Ie.array=Ie.func=Ie.error=Ie.number=Ie.string=Ie.boolean=void 0;function SR(t){return t===!0||t===!1}Ie.boolean=SR;function Fh(t){return typeof t=="string"||t instanceof String}Ie.string=Fh;function kR(t){return typeof t=="number"||t instanceof Number}Ie.number=kR;function CR(t){return t instanceof Error}Ie.error=CR;function NR(t){return typeof t=="function"}Ie.func=NR;function Gh(t){return Array.isArray(t)}Ie.array=Gh;function wR(t){return Gh(t)&&t.every(e=>Fh(e))}Ie.stringArray=wR;var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});var Uh=Ft.Emitter=Ft.Event=void 0;const bR=cn;var vu;(function(t){const e={dispose(){}};t.None=function(){return e}})(vu||(Ft.Event=vu={}));class _R{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,a=r.length;s<a;s++)try{n.push(r[s].apply(i[s],e))}catch(o){(0,bR.default)().console.error(o)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class Ia{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new _R),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=Ia._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}Uh=Ft.Emitter=Ia;Ia._noop=function(){};var me;Object.defineProperty(En,"__esModule",{value:!0});var Cl=En.CancellationTokenSource=me=En.CancellationToken=void 0;const IR=cn,$R=Ie,Gc=Ft;var la;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gc.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Gc.Event.None});function e(n){const r=n;return r&&(r===t.None||r===t.Cancelled||$R.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(la||(me=En.CancellationToken=la={}));const PR=Object.freeze(function(t,e){const n=(0,IR.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}});class Eu{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?PR:(this._emitter||(this._emitter=new Gc.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class LR{get token(){return this._token||(this._token=new Eu),this._token}cancel(){this._token?this._token.cancel():this._token=la.Cancelled}dispose(){this._token?this._token instanceof Eu&&this._token.dispose():this._token=la.None}}Cl=En.CancellationTokenSource=LR;function OR(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Ms=0,xR=10;function DR(){return Ms=performance.now(),new Cl}const Er=Symbol("OperationCancelled");function $a(t){return t===Er}async function He(t){if(t===me.None)return;const e=performance.now();if(e-Ms>=xR&&(Ms=e,await OR(),Ms=performance.now()),t.isCancellationRequested)throw Er}class Nl{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class xi{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(xi.isIncremental(r)){const i=zh(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let l=this._lineOffsets;const u=Au(r.text,!1,s);if(c-o===u.length)for(let p=0,g=u.length;p<g;p++)l[p+o+1]=u[p];else u.length<1e4?l.splice(o+1,c-o,...u):this._lineOffsets=l=l.slice(0,o+1).concat(u,l.slice(c+1));const f=r.text.length-(a-s);if(f!==0)for(let p=o+1+u.length,g=l.length;p<g;p++)l[p]=l[p]+f}else if(xi.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Au(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 a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.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&&jh(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||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 Uc;(function(t){function e(i,s,a,o){return new xi(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof xi)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const a=i.getText(),o=jc(s.map(MR),(u,f)=>{const p=u.range.start.line-f.range.start.line;return p===0?u.range.start.character-f.range.start.character:p});let c=0;const l=[];for(const u of o){const f=i.offsetAt(u.range.start);if(f<c)throw new Error("Overlapping edit");f>c&&l.push(a.substring(c,f)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end)}return l.push(a.substr(c)),l.join("")}t.applyEdits=r})(Uc||(Uc={}));function jc(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);jc(r,e),jc(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function Au(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);jh(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function jh(t){return t===13||t===10}function zh(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 MR(t){const e=zh(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Bh;(()=>{var t={975:C=>{function T(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function m(y,R){for(var E,$="",D=0,P=-1,z=0,G=0;G<=y.length;++G){if(G<y.length)E=y.charCodeAt(G);else{if(E===47)break;E=47}if(E===47){if(!(P===G-1||z===1))if(P!==G-1&&z===2){if($.length<2||D!==2||$.charCodeAt($.length-1)!==46||$.charCodeAt($.length-2)!==46){if($.length>2){var se=$.lastIndexOf("/");if(se!==$.length-1){se===-1?($="",D=0):D=($=$.slice(0,se)).length-1-$.lastIndexOf("/"),P=G,z=0;continue}}else if($.length===2||$.length===1){$="",D=0,P=G,z=0;continue}}R&&($.length>0?$+="/..":$="..",D=2)}else $.length>0?$+="/"+y.slice(P+1,G):$=y.slice(P+1,G),D=G-P-1;P=G,z=0}else E===46&&z!==-1?++z:z=-1}return $}var A={resolve:function(){for(var y,R="",E=!1,$=arguments.length-1;$>=-1&&!E;$--){var D;$>=0?D=arguments[$]:(y===void 0&&(y=process.cwd()),D=y),T(D),D.length!==0&&(R=D+"/"+R,E=D.charCodeAt(0)===47)}return R=m(R,!E),E?R.length>0?"/"+R:"/":R.length>0?R:"."},normalize:function(y){if(T(y),y.length===0)return".";var R=y.charCodeAt(0)===47,E=y.charCodeAt(y.length-1)===47;return(y=m(y,!R)).length!==0||R||(y="."),y.length>0&&E&&(y+="/"),R?"/"+y:y},isAbsolute:function(y){return T(y),y.length>0&&y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var y,R=0;R<arguments.length;++R){var E=arguments[R];T(E),E.length>0&&(y===void 0?y=E:y+="/"+E)}return y===void 0?".":A.normalize(y)},relative:function(y,R){if(T(y),T(R),y===R||(y=A.resolve(y))===(R=A.resolve(R)))return"";for(var E=1;E<y.length&&y.charCodeAt(E)===47;++E);for(var $=y.length,D=$-E,P=1;P<R.length&&R.charCodeAt(P)===47;++P);for(var z=R.length-P,G=D<z?D:z,se=-1,q=0;q<=G;++q){if(q===G){if(z>G){if(R.charCodeAt(P+q)===47)return R.slice(P+q+1);if(q===0)return R.slice(P+q)}else D>G&&(y.charCodeAt(E+q)===47?se=q:q===0&&(se=0));break}var re=y.charCodeAt(E+q);if(re!==R.charCodeAt(P+q))break;re===47&&(se=q)}var xe="";for(q=E+se+1;q<=$;++q)q!==$&&y.charCodeAt(q)!==47||(xe.length===0?xe+="..":xe+="/..");return xe.length>0?xe+R.slice(P+se):(P+=se,R.charCodeAt(P)===47&&++P,R.slice(P))},_makeLong:function(y){return y},dirname:function(y){if(T(y),y.length===0)return".";for(var R=y.charCodeAt(0),E=R===47,$=-1,D=!0,P=y.length-1;P>=1;--P)if((R=y.charCodeAt(P))===47){if(!D){$=P;break}}else D=!1;return $===-1?E?"/":".":E&&$===1?"//":y.slice(0,$)},basename:function(y,R){if(R!==void 0&&typeof R!="string")throw new TypeError('"ext" argument must be a string');T(y);var E,$=0,D=-1,P=!0;if(R!==void 0&&R.length>0&&R.length<=y.length){if(R.length===y.length&&R===y)return"";var z=R.length-1,G=-1;for(E=y.length-1;E>=0;--E){var se=y.charCodeAt(E);if(se===47){if(!P){$=E+1;break}}else G===-1&&(P=!1,G=E+1),z>=0&&(se===R.charCodeAt(z)?--z==-1&&(D=E):(z=-1,D=G))}return $===D?D=G:D===-1&&(D=y.length),y.slice($,D)}for(E=y.length-1;E>=0;--E)if(y.charCodeAt(E)===47){if(!P){$=E+1;break}}else D===-1&&(P=!1,D=E+1);return D===-1?"":y.slice($,D)},extname:function(y){T(y);for(var R=-1,E=0,$=-1,D=!0,P=0,z=y.length-1;z>=0;--z){var G=y.charCodeAt(z);if(G!==47)$===-1&&(D=!1,$=z+1),G===46?R===-1?R=z:P!==1&&(P=1):R!==-1&&(P=-1);else if(!D){E=z+1;break}}return R===-1||$===-1||P===0||P===1&&R===$-1&&R===E+1?"":y.slice(R,$)},format:function(y){if(y===null||typeof y!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof y);return function(R,E){var $=E.dir||E.root,D=E.base||(E.name||"")+(E.ext||"");return $?$===E.root?$+D:$+"/"+D:D}(0,y)},parse:function(y){T(y);var R={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return R;var E,$=y.charCodeAt(0),D=$===47;D?(R.root="/",E=1):E=0;for(var P=-1,z=0,G=-1,se=!0,q=y.length-1,re=0;q>=E;--q)if(($=y.charCodeAt(q))!==47)G===-1&&(se=!1,G=q+1),$===46?P===-1?P=q:re!==1&&(re=1):P!==-1&&(re=-1);else if(!se){z=q+1;break}return P===-1||G===-1||re===0||re===1&&P===G-1&&P===z+1?G!==-1&&(R.base=R.name=z===0&&D?y.slice(1,G):y.slice(z,G)):(z===0&&D?(R.name=y.slice(1,P),R.base=y.slice(1,G)):(R.name=y.slice(z,P),R.base=y.slice(z,G)),R.ext=y.slice(P,G)),z>0?R.dir=y.slice(0,z-1):D&&(R.dir="/"),R},sep:"/",delimiter:":",win32:null,posix:null};A.posix=A,C.exports=A}},e={};function n(C){var T=e[C];if(T!==void 0)return T.exports;var m=e[C]={exports:{}};return t[C](m,m.exports,n),m.exports}n.d=(C,T)=>{for(var m in T)n.o(T,m)&&!n.o(C,m)&&Object.defineProperty(C,m,{enumerable:!0,get:T[m]})},n.o=(C,T)=>Object.prototype.hasOwnProperty.call(C,T),n.r=C=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>p,Utils:()=>ue}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function c(C,T){if(!C.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${C.authority}", path: "${C.path}", query: "${C.query}", fragment: "${C.fragment}"}`);if(C.scheme&&!s.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!a.test(C.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",u="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class p{static isUri(T){return T instanceof p||!!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,m,A,y,R,E=!1){typeof T=="object"?(this.scheme=T.scheme||l,this.authority=T.authority||l,this.path=T.path||l,this.query=T.query||l,this.fragment=T.fragment||l):(this.scheme=function($,D){return $||D?$:"file"}(T,E),this.authority=m||l,this.path=function($,D){switch($){case"https":case"http":case"file":D?D[0]!==u&&(D=u+D):D=u}return D}(this.scheme,A||l),this.query=y||l,this.fragment=R||l,c(this,E))}get fsPath(){return L(this)}with(T){if(!T)return this;let{scheme:m,authority:A,path:y,query:R,fragment:E}=T;return m===void 0?m=this.scheme:m===null&&(m=l),A===void 0?A=this.authority:A===null&&(A=l),y===void 0?y=this.path:y===null&&(y=l),R===void 0?R=this.query:R===null&&(R=l),E===void 0?E=this.fragment:E===null&&(E=l),m===this.scheme&&A===this.authority&&y===this.path&&R===this.query&&E===this.fragment?this:new S(m,A,y,R,E)}static parse(T,m=!1){const A=f.exec(T);return A?new S(A[2]||l,te(A[4]||l),te(A[5]||l),te(A[7]||l),te(A[9]||l),m):new S(l,l,l,l,l)}static file(T){let m=l;if(i&&(T=T.replace(/\\/g,u)),T[0]===u&&T[1]===u){const A=T.indexOf(u,2);A===-1?(m=T.substring(2),T=u):(m=T.substring(2,A),T=T.substring(A)||u)}return new S("file",m,T,l,l)}static from(T){const m=new S(T.scheme,T.authority,T.path,T.query,T.fragment);return c(m,!0),m}toString(T=!1){return b(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof p)return T;{const m=new S(T);return m._formatted=T.external,m._fsPath=T._sep===g?T.fsPath:null,m}}return T}}const g=i?1:void 0;class S extends p{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=L(this)),this._fsPath}toString(T=!1){return T?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=g),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 N={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function x(C,T,m){let A,y=-1;for(let R=0;R<C.length;R++){const E=C.charCodeAt(R);if(E>=97&&E<=122||E>=65&&E<=90||E>=48&&E<=57||E===45||E===46||E===95||E===126||T&&E===47||m&&E===91||m&&E===93||m&&E===58)y!==-1&&(A+=encodeURIComponent(C.substring(y,R)),y=-1),A!==void 0&&(A+=C.charAt(R));else{A===void 0&&(A=C.substr(0,R));const $=N[E];$!==void 0?(y!==-1&&(A+=encodeURIComponent(C.substring(y,R)),y=-1),A+=$):y===-1&&(y=R)}}return y!==-1&&(A+=encodeURIComponent(C.substring(y))),A!==void 0?A:C}function w(C){let T;for(let m=0;m<C.length;m++){const A=C.charCodeAt(m);A===35||A===63?(T===void 0&&(T=C.substr(0,m)),T+=N[A]):T!==void 0&&(T+=C[m])}return T!==void 0?T:C}function L(C,T){let m;return m=C.authority&&C.path.length>1&&C.scheme==="file"?`//${C.authority}${C.path}`:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?C.path[1].toLowerCase()+C.path.substr(2):C.path,i&&(m=m.replace(/\//g,"\\")),m}function b(C,T){const m=T?w:x;let A="",{scheme:y,authority:R,path:E,query:$,fragment:D}=C;if(y&&(A+=y,A+=":"),(R||y==="file")&&(A+=u,A+=u),R){let P=R.indexOf("@");if(P!==-1){const z=R.substr(0,P);R=R.substr(P+1),P=z.lastIndexOf(":"),P===-1?A+=m(z,!1,!1):(A+=m(z.substr(0,P),!1,!1),A+=":",A+=m(z.substr(P+1),!1,!0)),A+="@"}R=R.toLowerCase(),P=R.lastIndexOf(":"),P===-1?A+=m(R,!1,!0):(A+=m(R.substr(0,P),!1,!0),A+=R.substr(P))}if(E){if(E.length>=3&&E.charCodeAt(0)===47&&E.charCodeAt(2)===58){const P=E.charCodeAt(1);P>=65&&P<=90&&(E=`/${String.fromCharCode(P+32)}:${E.substr(3)}`)}else if(E.length>=2&&E.charCodeAt(1)===58){const P=E.charCodeAt(0);P>=65&&P<=90&&(E=`${String.fromCharCode(P+32)}:${E.substr(2)}`)}A+=m(E,!0,!1)}return $&&(A+="?",A+=m($,!1,!1)),D&&(A+="#",A+=T?D:x(D,!1,!1)),A}function O(C){try{return decodeURIComponent(C)}catch{return C.length>3?C.substr(0,3)+O(C.substr(3)):C}}const X=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function te(C){return C.match(X)?C.replace(X,T=>O(T)):C}var ne=n(975);const ge=ne.posix||ne,ke="/";var ue;(function(C){C.joinPath=function(T,...m){return T.with({path:ge.join(T.path,...m)})},C.resolvePath=function(T,...m){let A=T.path,y=!1;A[0]!==ke&&(A=ke+A,y=!0);let R=ge.resolve(A,...m);return y&&R[0]===ke&&!T.authority&&(R=R.substring(1)),T.with({path:R})},C.dirname=function(T){if(T.path.length===0||T.path===ke)return T;let m=ge.dirname(T.path);return m.length===1&&m.charCodeAt(0)===46&&(m=""),T.with({path:m})},C.basename=function(T){return ge.basename(T.path)},C.extname=function(T){return ge.extname(T.path)}})(ue||(ue={})),Bh=r})();const{URI:wt,Utils:ci}=Bh;var ct;(function(t){t.basename=ci.basename,t.dirname=ci.dirname,t.extname=ci.extname,t.joinPath=ci.joinPath,t.resolvePath=ci.resolvePath;const e=typeof process=="object"&&process?.platform==="win32";function n(a,o){return a?.toString()===o?.toString()}t.equals=n;function r(a,o){const c=typeof a=="string"?wt.parse(a).path:a.path,l=typeof o=="string"?wt.parse(o).path:o.path,u=c.split("/").filter(N=>N.length>0),f=l.split("/").filter(N=>N.length>0);if(e){const N=/^[A-Z]:$/;if(u[0]&&N.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&N.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return l.substring(1)}let p=0;for(;p<u.length&&u[p]===f[p];p++);const g="../".repeat(u.length-p),S=f.slice(p).join("/");return g+S}t.relative=r;function i(a){return wt.parse(a.toString()).toString()}t.normalize=i;function s(a,o){let c=typeof a=="string"?a:a.path,l=typeof o=="string"?o:o.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=s})(ct||(ct={}));class FR{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return ct.normalize(e)}clear(){this.root.children.clear()}insert(e,n){const r=this.getNode(this.normalizeUri(e),!0);r.element=n}delete(e){const n=this.getNode(this.normalizeUri(e),!1);n?.parent&&n.parent.children.delete(n.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);if(r)return{name:r.name,uri:ct.joinPath(wt.parse(n),r.name).toString(),element:r.element}}findChildren(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);return r?Array.from(r.children.values()).map(i=>({name:i.name,uri:ct.joinPath(wt.parse(n),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const n=this.getNode(ct.normalize(e),!1);return n?this.collectValues(n):[]}getNode(e,n){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let i=this.root;for(const s of r){let a=i.children.get(s);if(!a)if(n)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){const n=[];e.element&&n.push(e.element);for(const r of e.children.values())n.push(...this.collectValues(r));return n}}var K;(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"})(K||(K={}));class GR{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=me.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??wt.parse(e.uri),me.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return me.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:K.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:K.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,n){const r=e.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const a=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:a})}return r!==s&&(e.parseResult=await this.parseAsync(e.uri,s,n),e.parseResult.value.$document=e),e.state=K.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=Uc.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class UR{constructor(e){this.documentTrie=new FR,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return he(this.documentTrie.all())}addDocument(e){const n=e.uri.toString();if(this.documentTrie.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentTrie.insert(n,e)}getDocument(e){const n=e.toString();return this.documentTrie.find(n)}getDocuments(e){const n=e.toString();return this.documentTrie.findAll(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&this.documentBuilder().resetToState(r,K.Changed),r}deleteDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&(r.state=K.Changed,this.documentTrie.delete(n)),r}deleteDocuments(e){const n=e.toString(),r=this.documentTrie.findAll(n);for(const i of r)i.state=K.Changed;return this.documentTrie.delete(n),r}}const rr=Symbol("RefResolving");class jR{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,n=me.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const i of Zt(e.parseResult.value))await He(n),js(i).forEach(s=>{const a=`${i.$type}:${s.property}`;r.startSubTask(a);try{this.doLink(s,e)}finally{r.stopSubTask(a)}})}finally{r.stop()}}else for(const r of Zt(e.parseResult.value))await He(n),js(r).forEach(i=>this.doLink(i,e))}doLink(e,n){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=rr;try{const i=this.getCandidate(e);if(ni(i))r._ref=i;else{r._nodeDescription=i;const s=this.loadAstNode(i);r._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${r.$refText}':`,i);const s=i.message??String(i);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${s}`}}n.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=rr;try{const i=this.getCandidates(e),s=[];if(ni(i))r._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}r._items=s}catch(i){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`},r._items=[]}n.references.push(r)}}unlink(e){for(const n of e.references)"_ref"in n?(n._ref=void 0,delete n._nodeDescription):"_items"in n&&(n._items=void 0,delete n._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_ref:void 0,get ref(){if(We(this._ref))return this._ref;if(um(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=rr;const o=Cs(e).$document,c=s.getLinkedNode({reference:a,container:e,property:n});if(c.error&&o&&o.state<K.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,o?.references.push(this)}else this._ref===rr&&s.throwCyclicReferenceError(e,n,i);return We(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return ni(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=rr;const o=Cs(e).$document,c=s.getCandidates({reference:a,container:e,property:n}),l=[];if(ni(c))this._linkingError=c;else for(const u of c){const f=s.loadAstNode(u);f&&l.push({ref:f,$nodeDescription:u})}this._items=l,o?.references.push(this)}else this._items===rr&&s.throwCyclicReferenceError(e,n,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:n})}};return a}throwCyclicReferenceError(e,n,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${r}')`)}getLinkedNode(e){try{const n=this.getCandidate(e);if(ni(n))return{error:n};const r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const r=n.message??String(n);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}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=Cs(e.container).$document;r&&r.state<K.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n}}}function zR(t){return typeof t.name=="string"}class BR{getName(e){if(zR(e))return e.name}getNameNode(e){return Pf(e.$cstNode,"name")}}class qR{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=Zt(e.Grammar).some(n=>va(n)&&n.isMulti)}findDeclarations(e){if(e){const n=tg(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(kt(i)||fn(i))return Ol(i);if(Array.isArray(i)){for(const s of i)if((kt(s)||fn(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return Ol(s)}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||Pm(e,i)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(n.head());if(r){for(const i of js(r))if(fn(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const n=this.documents.getDocument(e.sourceUri);if(n)return this.nodeLocator.getAstNode(n.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const n=this.findDeclarations(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&r.push(s)}return r}findReferences(e,n){const r=[];n.includeDeclaration&&r.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>ct.equals(s.sourceUri,n.documentUri))),r.push(...i),he(r)}getSelfReferences(e){const n=this.getSelfNodes(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i);if(s){const a=Qt(i),o=this.nodeLocator.getAstNodePath(i);r.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:Bs(s),local:!0})}}return r}}class Di{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return ho.sum(he(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const n=this.map.get(e);return n?he(n):Ef}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return he(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return he(this.map.keys())}values(){return he(this.map.values()).flat()}entriesGroupedByKey(){return he(this.map.entries())}}class Su{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class WR{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,n=me.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,n)}async collectExportedSymbolsForNode(e,n,r=ol,i=me.None){const s=[];this.addExportedSymbol(e,s,n);for(const a of r(e))await He(i),this.addExportedSymbol(a,s,n);return s}addExportedSymbol(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async collectLocalSymbols(e,n=me.None){const r=e.parseResult.value,i=new Di;for(const s of ji(r))await He(n),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class ku{constructor(e,n,r){this.elements=e,this.outerScope=n,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===n):this.elements.find(i=>i.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===n):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}}class VR{constructor(e,n,r){this.elements=new Di,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);return(this.concatOuterScope||r.length===0)&&this.outerScope?he(r).concat(this.outerScope.getElements(e)):he(r)}getAllElements(){let e=he(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class qh{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 KR extends qh{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class HR extends qh{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class YR extends KR{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class XR{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 YR(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=Qt(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&n.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,r))),a=a.$container;while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new ku(he(e),n,r)}createScopeForNodes(e,n,r){const i=he(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new ku(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new VR(this.indexManager.allElements(e)))}}function JR(t){return typeof t.$comment=="string"}function Cu(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class QR{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(o,c)=>this.replacer(o,c,r),a=i?(o,c)=>i(o,c,s):s;try{return this.currentDocument=Qt(e),JSON.stringify(e,a,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){if(!this.ignoreProperties.has(e))if(kt(n)){const c=n.ref,l=r?n.$refText:void 0;if(c){const u=Qt(c);let f="";this.currentDocument&&this.currentDocument!==u&&(o?f=o(u.uri,c):f=u.uri.toString());const p=this.astNodeLocator.getAstNodePath(c);return{$ref:`${f}#${p}`,$refText:l}}else return{$error:n.error?.message??"Could not resolve reference",$refText:l}}else if(fn(n)){const c=r?n.$refText:void 0,l=[];for(const u of n.items){const f=u.ref,p=Qt(u.ref);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,f):g=p.uri.toString());const S=this.astNodeLocator.getAstNodePath(f);l.push(`${g}#${S}`)}return{$refs:l,$refText:c}}else if(We(n)){let c;if(s&&(c=this.addAstNodeRegionWithAssignmentsTo({...n}),(!e||n.$document)&&c?.$textRegion&&(c.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!e&&(c??(c={...n}),c.$sourceText=n.$cstNode?.text),a){c??(c={...n});const l=this.commentProvider.getComment(n);l&&(c.$comment=l.replace(/\r/g,""))}return c??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=Qm(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u<l.length;u++){const f=l[u];Cu(f)?l[u]=this.reviveReference(e,c,n,f,r):We(f)&&this.linkNode(f,n,r,e,c,u)}else Cu(l)?e[c]=this.reviveReference(e,c,n,l,r):We(l)&&this.linkNode(l,n,r,e,c);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,n,r,i,s){let a=i.$refText,o=i.$error,c;if(i.$ref){const l=this.getRefNode(r,i.$ref,s.uriConverter);if(We(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}else if(i.$refs){const l=[];for(const u of i.$refs){const f=this.getRefNode(r,u,s.uriConverter);We(f)&&l.push({ref:f})}if(l.length===0)c={$refText:a??"",items:l},o??(o="Could not resolve multi-reference");else return{$refText:a??"",items:l}}if(o)return c??(c={$refText:a??"",ref:void 0}),c.error={info:{container:e,property:n,reference:c},message:o},c}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):wt.parse(n),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):wt.parse(n.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+n;if(i===n.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,n.substring(i+1));return o||"Could not resolve URI: "+n}catch(i){return String(i)}}}class ZR{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);if(n.fileNames)for(const r of n.fileNames)this.fileNameMap.has(r)&&console.warn(`The file name ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileNameMap.set(r,e);this.languageIdMap.set(n.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const n=this.textDocuments?.get(e)?.languageId;if(n!==void 0){const a=this.languageIdMap.get(n);if(a)return a}const r=ct.extname(e),i=ct.basename(e),s=this.fileNameMap.get(i)??this.fileExtensionMap.get(r);if(!s)throw n?new Error(`The service registry contains no services for the extension '${r}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${r}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Ei(t){return{code:t}}var zc;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(zc||(zc={}));class ev{constructor(e){this.entries=new Di,this.knownCategories=new Set(zc.defaults),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.");this.knownCategories.add(r);for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const c={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,c)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,o)}else Bi()}}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($a(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=he(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const tv=Object.freeze({validateNode:!0,validateChildren:!0});class nv{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,n={},r=me.None){const i=e.parseResult,s=[];if(await He(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>a.data?.code===St.LexingError)||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>a.data?.code===St.ParsingError))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>a.data?.code===St.LinkingError))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if($a(a))throw a;console.error("An error occurred during validation:",a)}return await He(r),s}processLexingErrors(e,n,r){const i=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const s of i){const a=s.severity??"error",o={severity:to(a),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:iv(a),source:this.getSource()};n.push(o)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=Ao(i.token);if(s){const a={severity:to("error"),range:s,message:i.message,data:Ei(St.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.info.container,range:i.$refNode?.range,property:s.info.property,index:s.info.index,data:{code:St.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};n.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,n,r=me.None){const i=[],s=(a,o,c)=>{i.push(this.toDiagnostic(a,o,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=me.None){const s=this.validationRegistry.checksBefore;for(const a of s)await He(i),await a(e,r,n.categories??[],i)}async validateAstNodes(e,n,r,i=me.None){if(this.profiler?.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const a=Zt(e).iterator();for(const o of a){s.startSubTask(o.$type);const c=this.validateSingleNodeOptions(o,n);if(c.validateNode)try{const l=this.validationRegistry.getChecks(o.$type,n.categories);for(const u of l)await u(o,r,i)}finally{s.stopSubTask(o.$type)}c.validateChildren||a.prune()}}finally{s.stop()}}else{const s=Zt(e).iterator();for(const a of s){await He(i);const o=this.validateSingleNodeOptions(a,n);if(o.validateNode){const c=this.validationRegistry.getChecks(a.$type,n.categories);for(const l of c)await l(a,r,i)}o.validateChildren||s.prune()}}}validateSingleNodeOptions(e,n){return tv}async validateAstAfter(e,n,r,i=me.None){const s=this.validationRegistry.checksAfter;for(const a of s)await He(i),await a(e,r,n.categories??[],i)}toDiagnostic(e,n,r){return{message:n,range:rv(r),severity:to(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 rv(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Pf(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Zm(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 to(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 iv(t){switch(t){case"error":return Ei(St.LexingError);case"warning":return Ei(St.LexingWarning);case"info":return Ei(St.LexingInfo);case"hint":return Ei(St.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var St;(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"})(St||(St={}));class sv{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??Qt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>a??(a=Bs(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:n,get nameSegment(){return o()},selectionSegment:Bs(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class av{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=me.None){const r=[],i=e.parseResult.value;for(const s of Zt(i))await He(n),js(s).forEach(a=>{a.reference.error||r.push(...this.createInfoDescriptions(a))});return r}createInfoDescriptions(e){const n=e.reference;if(n.error||!n.$refNode)return[];let r=[];kt(n)&&n.$nodeDescription?r=[n.$nodeDescription]:fn(n)&&(r=n.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));const i=Qt(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=Bs(n.$refNode);for(const c of r)a.push({sourceUri:i,sourcePath:s,targetUri:c.documentUri,targetPath:c.path,segment:o,local:ct.equals(c.documentUri,i)});return a}}class ov{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),c=parseInt(s.substring(a+1));return i[o]?.[c]}return i[s]},e)}}class cv{constructor(e){this._ready=new Nl,this.onConfigurationSectionUpdateEmitter=new Uh,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([n,r])=>{this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Ai={},Xn={},wl={},no={},U={},Nu;function Wh(){if(Nu)return U;Nu=1,Object.defineProperty(U,"__esModule",{value:!0}),U.Message=U.NotificationType9=U.NotificationType8=U.NotificationType7=U.NotificationType6=U.NotificationType5=U.NotificationType4=U.NotificationType3=U.NotificationType2=U.NotificationType1=U.NotificationType0=U.NotificationType=U.RequestType9=U.RequestType8=U.RequestType7=U.RequestType6=U.RequestType5=U.RequestType4=U.RequestType3=U.RequestType2=U.RequestType1=U.RequestType=U.RequestType0=U.AbstractMessageSignature=U.ParameterStructures=U.ResponseError=U.ErrorCodes=void 0;const t=Ie;var e;(function(T){T.ParseError=-32700,T.InvalidRequest=-32600,T.MethodNotFound=-32601,T.InvalidParams=-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||(U.ErrorCodes=e={}));class n extends Error{constructor(m,A,y){super(A),this.code=t.number(m)?m:e.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,n.prototype)}toJson(){const m={code:this.code,message:this.message};return this.data!==void 0&&(m.data=this.data),m}}U.ResponseError=n;class r{constructor(m){this.kind=m}static is(m){return m===r.auto||m===r.byName||m===r.byPosition}toString(){return this.kind}}U.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(m,A){this.method=m,this.numberOfParams=A}get parameterStructures(){return r.auto}}U.AbstractMessageSignature=i;class s extends i{constructor(m){super(m,0)}}U.RequestType0=s;class a extends i{constructor(m,A=r.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}U.RequestType=a;class o extends i{constructor(m,A=r.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}U.RequestType1=o;class c extends i{constructor(m){super(m,2)}}U.RequestType2=c;class l extends i{constructor(m){super(m,3)}}U.RequestType3=l;class u extends i{constructor(m){super(m,4)}}U.RequestType4=u;class f extends i{constructor(m){super(m,5)}}U.RequestType5=f;class p extends i{constructor(m){super(m,6)}}U.RequestType6=p;class g extends i{constructor(m){super(m,7)}}U.RequestType7=g;class S extends i{constructor(m){super(m,8)}}U.RequestType8=S;class N extends i{constructor(m){super(m,9)}}U.RequestType9=N;class x extends i{constructor(m,A=r.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}U.NotificationType=x;class w extends i{constructor(m){super(m,0)}}U.NotificationType0=w;class L extends i{constructor(m,A=r.auto){super(m,1),this._parameterStructures=A}get parameterStructures(){return this._parameterStructures}}U.NotificationType1=L;class b extends i{constructor(m){super(m,2)}}U.NotificationType2=b;class O extends i{constructor(m){super(m,3)}}U.NotificationType3=O;class X extends i{constructor(m){super(m,4)}}U.NotificationType4=X;class te extends i{constructor(m){super(m,5)}}U.NotificationType5=te;class ne extends i{constructor(m){super(m,6)}}U.NotificationType6=ne;class ge extends i{constructor(m){super(m,7)}}U.NotificationType7=ge;class ke extends i{constructor(m){super(m,8)}}U.NotificationType8=ke;class ue extends i{constructor(m){super(m,9)}}U.NotificationType9=ue;var C;return function(T){function m(R){const E=R;return E&&t.string(E.method)&&(t.string(E.id)||t.number(E.id))}T.isRequest=m;function A(R){const E=R;return E&&t.string(E.method)&&R.id===void 0}T.isNotification=A;function y(R){const E=R;return E&&(E.result!==void 0||!!E.error)&&(t.string(E.id)||t.number(E.id)||E.id===null)}T.isResponse=y}(C||(U.Message=C={})),U}var Bt={},wu;function Vh(){if(wu)return Bt;wu=1;var t;Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.LRUCache=Bt.LinkedMap=Bt.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||(Bt.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,a=e.None){const o=this._map.get(s);if(o)return a!==e.None&&this.touch(o,a),o.value}set(s,a,o=e.None){let c=this._map.get(s);if(c)c.value=a,o!==e.None&&this.touch(c,o);else{switch(c={key:s,value:a,next:void 0,previous:void 0},o){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const a=this._map.get(s);if(a)return this._map.delete(s),this.removeItem(a),this._size--,a.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,a){const o=this._state;let c=this._head;for(;c;){if(a?s.bind(a)(c.value,c.key,this):s(c.value,c.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const c={value:a.key,done:!1};return a=a.next,c}else return{value:void 0,done:!0}}};return o}values(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const c={value:a.value,done:!1};return a=a.next,c}else return{value:void 0,done:!0}}};return o}entries(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const c={value:[a.key,a.value],done:!1};return a=a.next,c}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let a=this._head,o=this.size;for(;a&&o>s;)this._map.delete(a.key),a=a.next,o--;this._head=a,this._size=o,a&&(a.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const a=s.next,o=s.previous;if(!a||!o)throw new Error("Invalid list");a.previous=o,o.next=a}s.next=void 0,s.previous=void 0,this._state++}touch(s,a){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(a!==e.First&&a!==e.Last)){if(a===e.First){if(s===this._head)return;const o=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(o.previous=c,c.next=o),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(a===e.Last){if(s===this._tail)return;const o=s.next,c=s.previous;s===this._head?(o.previous=void 0,this._head=o):(o.previous=c,c.next=o),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((a,o)=>{s.push([o,a])}),s}fromJSON(s){this.clear();for(const[a,o]of s)this.set(a,o)}}Bt.LinkedMap=n;class r extends n{constructor(s,a=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,a),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,a=e.AsNew){return super.get(s,a)}peek(s){return super.get(s,e.None)}set(s,a){return super.set(s,a,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return Bt.LRUCache=r,Bt}var li={},bu;function lv(){if(bu)return li;bu=1,Object.defineProperty(li,"__esModule",{value:!0}),li.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(li.Disposable=t={})),li}var $n={},_u;function uv(){if(_u)return $n;_u=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.SharedArrayReceiverStrategy=$n.SharedArraySenderStrategy=void 0;const t=En;var e;(function(a){a.Continue=0,a.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const c=new SharedArrayBuffer(4),l=new Int32Array(c,0,1);l[0]=e.Continue,this.buffers.set(o.id,c),o.$cancellationData=c}async sendCancellation(o,c){const l=this.buffers.get(c);if(l===void 0)return;const u=new Int32Array(l,0,1);Atomics.store(u,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}$n.SharedArraySenderStrategy=n;class r{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new r(o)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(o){const c=o.$cancellationData;return c===void 0?new t.CancellationTokenSource:new i(c)}}return $n.SharedArrayReceiverStrategy=s,$n}var qt={},ui={},Iu;function Kh(){if(Iu)return ui;Iu=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.Semaphore=void 0;const t=cn;class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return ui.Semaphore=e,ui}var $u;function dv(){if($u)return qt;$u=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.ReadableStreamMessageReader=qt.AbstractMessageReader=qt.MessageReader=void 0;const t=cn,e=Ie,n=Ft,r=Kh();var i;(function(c){function l(u){let f=u;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&e.func(f.onPartialMessage)}c.is=l})(i||(qt.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(l){this.errorEmitter.fire(this.asError(l))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(l){this.partialMessageEmitter.fire(l)}asError(l){return l instanceof Error?l:new Error(`Reader received error. Reason: ${e.string(l.message)?l.message:"unknown"}`)}}qt.AbstractMessageReader=s;var a;(function(c){function l(u){let f,p;const g=new Map;let S;const N=new Map;if(u===void 0||typeof u=="string")f=u??"utf-8";else{if(f=u.charset??"utf-8",u.contentDecoder!==void 0&&(p=u.contentDecoder,g.set(p.name,p)),u.contentDecoders!==void 0)for(const x of u.contentDecoders)g.set(x.name,x);if(u.contentTypeDecoder!==void 0&&(S=u.contentTypeDecoder,N.set(S.name,S)),u.contentTypeDecoders!==void 0)for(const x of u.contentTypeDecoders)N.set(x.name,x)}return S===void 0&&(S=(0,t.default)().applicationJson.decoder,N.set(S.name,S)),{charset:f,contentDecoder:p,contentDecoders:g,contentTypeDecoder:S,contentTypeDecoders:N}}c.fromOptions=l})(a||(a={}));class o extends s{constructor(l,u){super(),this.readable=l,this.options=a.fromOptions(u),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(l){this._partialMessageTimeout=l}get partialMessageTimeout(){return this._partialMessageTimeout}listen(l){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=l;const u=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),u}onData(l){try{for(this.buffer.append(l);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const p=f.get("content-length");if(!p){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
122
|
+
${JSON.stringify(Object.fromEntries(f))}`));return}const g=parseInt(p);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${p}`));return}this.nextMessageLength=g}const u=this.buffer.tryReadBody(this.nextMessageLength);if(u===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(u):u,p=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(p)}).catch(f=>{this.fireError(f)})}}catch(u){this.fireError(u)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((l,u)=>{this.partialMessageTimer=void 0,l===this.messageToken&&(this.firePartialMessage({messageToken:l,waitingTime:u}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return qt.ReadableStreamMessageReader=o,qt}var Wt={},Pu;function fv(){if(Pu)return Wt;Pu=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.WriteableStreamMessageWriter=Wt.AbstractMessageWriter=Wt.MessageWriter=void 0;const t=cn,e=Ie,n=Kh(),r=Ft,i="Content-Length: ",s=`\r
|
|
123
|
+
`;var a;(function(u){function f(p){let g=p;return g&&e.func(g.dispose)&&e.func(g.onClose)&&e.func(g.onError)&&e.func(g.write)}u.is=f})(a||(Wt.MessageWriter=a={}));class o{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,p,g){this.errorEmitter.fire([this.asError(f),p,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}Wt.AbstractMessageWriter=o;var c;(function(u){function f(p){return p===void 0||typeof p=="string"?{charset:p??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:p.charset??"utf-8",contentEncoder:p.contentEncoder,contentTypeEncoder:p.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}u.fromOptions=f})(c||(c={}));class l extends o{constructor(f,p){super(),this.writable=f,this.options=c.fromOptions(p),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const S=[];return S.push(i,g.byteLength.toString(),s),S.push(s),this.doWrite(f,S,g)},g=>{throw this.fireError(g),g}))}async doWrite(f,p,g){try{return await this.writable.write(p.join(""),"ascii"),this.writable.write(g)}catch(S){return this.handleError(S,f),Promise.reject(S)}}handleError(f,p){this.errorCount++,this.fireError(f,p,this.errorCount)}end(){this.writable.end()}}return Wt.WriteableStreamMessageWriter=l,Wt}var di={},Lu;function hv(){if(Lu)return di;Lu=1,Object.defineProperty(di,"__esModule",{value:!0}),di.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
|
|
124
|
+
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const a=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(a),this._totalLength+=a.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let a=0,o=0,c=0,l=0;e:for(;o<this._chunks.length;){const g=this._chunks[o];for(c=0;c<g.length;){switch(g[c]){case t:switch(a){case 0:a=1;break;case 2:a=3;break;default:a=0}break;case e:switch(a){case 1:a=2;break;case 3:a=4,c++;break e;default:a=0}break;default:a=0}c++}l+=g.byteLength,o++}if(a!==4)return;const u=this._read(l+c),f=new Map,p=this.toString(u,"ascii").split(n);if(p.length<2)return f;for(let g=0;g<p.length-2;g++){const S=p[g],N=S.indexOf(":");if(N===-1)throw new Error(`Message header must separate key and value using ':'
|
|
125
|
+
${S}`);const x=S.substr(0,N),w=S.substr(N+1).trim();f.set(s?x.toLowerCase():x,w)}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 l=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(l)}if(this._chunks[0].byteLength>s){const l=this._chunks[0],u=this.asNative(l,s);return this._chunks[0]=l.slice(s),this._totalLength-=s,u}const a=this.allocNative(s);let o=0,c=0;for(;s>0;){const l=this._chunks[c];if(l.byteLength>s){const u=l.slice(0,s);a.set(u,o),o+=s,this._chunks[c]=l.slice(s),this._totalLength-=s,s-=s}else a.set(l,o),o+=l.byteLength,this._chunks.shift(),this._totalLength-=l.byteLength,s-=l.byteLength}return a}}return di.AbstractMessageBuffer=r,di}var ro={},Ou;function pv(){return Ou||(Ou=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=cn,n=Ie,r=Wh(),i=Vh(),s=Ft,a=En;var o;(function(m){m.type=new r.NotificationType("$/cancelRequest")})(o||(o={}));var c;(function(m){function A(y){return typeof y=="string"||typeof y=="number"}m.is=A})(c||(t.ProgressToken=c={}));var l;(function(m){m.type=new r.NotificationType("$/progress")})(l||(l={}));class u{constructor(){}}t.ProgressType=u;var f;(function(m){function A(y){return n.func(y)}m.is=A})(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var p;(function(m){m[m.Off=0]="Off",m[m.Messages=1]="Messages",m[m.Compact=2]="Compact",m[m.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var g;(function(m){m.Off="off",m.Messages="messages",m.Compact="compact",m.Verbose="verbose"})(g||(t.TraceValues=g={})),function(m){function A(R){if(!n.string(R))return m.Off;switch(R=R.toLowerCase(),R){case"off":return m.Off;case"messages":return m.Messages;case"compact":return m.Compact;case"verbose":return m.Verbose;default:return m.Off}}m.fromString=A;function y(R){switch(R){case m.Off:return"off";case m.Messages:return"messages";case m.Compact:return"compact";case m.Verbose:return"verbose";default:return"off"}}m.toString=y}(p||(t.Trace=p={}));var S;(function(m){m.Text="text",m.JSON="json"})(S||(t.TraceFormat=S={})),function(m){function A(y){return n.string(y)?(y=y.toLowerCase(),y==="json"?m.JSON:m.Text):m.Text}m.fromString=A}(S||(t.TraceFormat=S={}));var N;(function(m){m.type=new r.NotificationType("$/setTrace")})(N||(t.SetTraceNotification=N={}));var x;(function(m){m.type=new r.NotificationType("$/logTrace")})(x||(t.LogTraceNotification=x={}));var w;(function(m){m[m.Closed=1]="Closed",m[m.Disposed=2]="Disposed",m[m.AlreadyListening=3]="AlreadyListening"})(w||(t.ConnectionErrors=w={}));class L extends Error{constructor(A,y){super(y),this.code=A,Object.setPrototypeOf(this,L.prototype)}}t.ConnectionError=L;var b;(function(m){function A(y){const R=y;return R&&n.func(R.cancelUndispatched)}m.is=A})(b||(t.ConnectionStrategy=b={}));var O;(function(m){function A(y){const R=y;return R&&(R.kind===void 0||R.kind==="id")&&n.func(R.createCancellationTokenSource)&&(R.dispose===void 0||n.func(R.dispose))}m.is=A})(O||(t.IdCancellationReceiverStrategy=O={}));var X;(function(m){function A(y){const R=y;return R&&R.kind==="request"&&n.func(R.createCancellationTokenSource)&&(R.dispose===void 0||n.func(R.dispose))}m.is=A})(X||(t.RequestCancellationReceiverStrategy=X={}));var te;(function(m){m.Message=Object.freeze({createCancellationTokenSource(y){return new a.CancellationTokenSource}});function A(y){return O.is(y)||X.is(y)}m.is=A})(te||(t.CancellationReceiverStrategy=te={}));var ne;(function(m){m.Message=Object.freeze({sendCancellation(y,R){return y.sendNotification(o.type,{id:R})},cleanup(y){}});function A(y){const R=y;return R&&n.func(R.sendCancellation)&&n.func(R.cleanup)}m.is=A})(ne||(t.CancellationSenderStrategy=ne={}));var ge;(function(m){m.Message=Object.freeze({receiver:te.Message,sender:ne.Message});function A(y){const R=y;return R&&te.is(R.receiver)&&ne.is(R.sender)}m.is=A})(ge||(t.CancellationStrategy=ge={}));var ke;(function(m){function A(y){const R=y;return R&&n.func(R.handleMessage)}m.is=A})(ke||(t.MessageStrategy=ke={}));var ue;(function(m){function A(y){const R=y;return R&&(ge.is(R.cancellationStrategy)||b.is(R.connectionStrategy)||ke.is(R.messageStrategy))}m.is=A})(ue||(t.ConnectionOptions=ue={}));var C;(function(m){m[m.New=1]="New",m[m.Listening=2]="Listening",m[m.Closed=3]="Closed",m[m.Disposed=4]="Disposed"})(C||(C={}));function T(m,A,y,R){const E=y!==void 0?y:t.NullLogger;let $=0,D=0,P=0;const z="2.0";let G;const se=new Map;let q;const re=new Map,xe=new Map;let ye,de=new i.LinkedMap,$e=new Map,De=new Set,be=new Map,Q=p.Off,st=S.Text,Te,Rt=C.New;const Zn=new s.Emitter,Wr=new s.Emitter,Vr=new s.Emitter,Kr=new s.Emitter,Hr=new s.Emitter,vt=R&&R.cancellationStrategy?R.cancellationStrategy:ge.Message;function Yr(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}function Yi(h){return h===null?"res-unknown-"+(++P).toString():"res-"+h.toString()}function Xi(){return"not-"+(++D).toString()}function Ji(h,k){r.Message.isRequest(k)?h.set(Yr(k.id),k):r.Message.isResponse(k)?h.set(Yi(k.id),k):h.set(Xi(),k)}function Qi(h){}function Xr(){return Rt===C.Listening}function Jr(){return Rt===C.Closed}function jt(){return Rt===C.Disposed}function Qr(){(Rt===C.New||Rt===C.Listening)&&(Rt=C.Closed,Wr.fire(void 0))}function Zi(h){Zn.fire([h,void 0,void 0])}function es(h){Zn.fire(h)}m.onClose(Qr),m.onError(Zi),A.onClose(Qr),A.onError(es);function Zr(){ye||de.size===0||(ye=(0,e.default)().timer.setImmediate(()=>{ye=void 0,ts()}))}function ei(h){r.Message.isRequest(h)?rs(h):r.Message.isNotification(h)?ss(h):r.Message.isResponse(h)?is(h):as(h)}function ts(){if(de.size===0)return;const h=de.shift();try{const k=R?.messageStrategy;ke.is(k)?k.handleMessage(h,ei):ei(h)}finally{Zr()}}const ns=h=>{try{if(r.Message.isNotification(h)&&h.method===o.type.method){const k=h.params.id,I=Yr(k),F=de.get(I);if(r.Message.isRequest(F)){const ae=R?.connectionStrategy,Re=ae&&ae.cancelUndispatched?ae.cancelUndispatched(F,Qi):void 0;if(Re&&(Re.error!==void 0||Re.result!==void 0)){de.delete(I),be.delete(k),Re.id=F.id,bn(Re,h.method,Date.now()),A.write(Re).catch(()=>E.error("Sending response for canceled message failed."));return}}const ce=be.get(k);if(ce!==void 0){ce.cancel(),er(h);return}else De.add(k)}Ji(de,h)}finally{Zr()}};function rs(h){if(jt())return;function k(J,fe,ie){const Pe={jsonrpc:z,id:h.id};J instanceof r.ResponseError?Pe.error=J.toJson():Pe.result=J===void 0?null:J,bn(Pe,fe,ie),A.write(Pe).catch(()=>E.error("Sending response failed."))}function I(J,fe,ie){const Pe={jsonrpc:z,id:h.id,error:J.toJson()};bn(Pe,fe,ie),A.write(Pe).catch(()=>E.error("Sending response failed."))}function F(J,fe,ie){J===void 0&&(J=null);const Pe={jsonrpc:z,id:h.id,result:J};bn(Pe,fe,ie),A.write(Pe).catch(()=>E.error("Sending response failed."))}ls(h);const ce=se.get(h.method);let ae,Re;ce&&(ae=ce.type,Re=ce.handler);const we=Date.now();if(Re||G){const J=h.id??String(Date.now()),fe=O.is(vt.receiver)?vt.receiver.createCancellationTokenSource(J):vt.receiver.createCancellationTokenSource(h);h.id!==null&&De.has(h.id)&&fe.cancel(),h.id!==null&&be.set(J,fe);try{let ie;if(Re)if(h.params===void 0){if(ae!==void 0&&ae.numberOfParams!==0){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${h.method} defines ${ae.numberOfParams} params but received none.`),h.method,we);return}ie=Re(fe.token)}else if(Array.isArray(h.params)){if(ae!==void 0&&ae.parameterStructures===r.ParameterStructures.byName){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,we);return}ie=Re(...h.params,fe.token)}else{if(ae!==void 0&&ae.parameterStructures===r.ParameterStructures.byPosition){I(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,we);return}ie=Re(h.params,fe.token)}else G&&(ie=G(h.method,h.params,fe.token));const Pe=ie;ie?Pe.then?Pe.then(Ke=>{be.delete(J),k(Ke,h.method,we)},Ke=>{be.delete(J),Ke instanceof r.ResponseError?I(Ke,h.method,we):Ke&&n.string(Ke.message)?I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${Ke.message}`),h.method,we):I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}):(be.delete(J),k(ie,h.method,we)):(be.delete(J),F(ie,h.method,we))}catch(ie){be.delete(J),ie instanceof r.ResponseError?k(ie,h.method,we):ie&&n.string(ie.message)?I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${ie.message}`),h.method,we):I(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}}else I(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,we)}function is(h){if(!jt())if(h.id===null)h.error?E.error(`Received response message without id: Error is:
|
|
126
|
+
${JSON.stringify(h.error,void 0,4)}`):E.error("Received response message without id. No further error information provided.");else{const k=h.id,I=$e.get(k);if(us(h,I),I!==void 0){$e.delete(k);try{if(h.error){const F=h.error;I.reject(new r.ResponseError(F.code,F.message,F.data))}else if(h.result!==void 0)I.resolve(h.result);else throw new Error("Should never happen.")}catch(F){F.message?E.error(`Response handler '${I.method}' failed with message: ${F.message}`):E.error(`Response handler '${I.method}' failed unexpectedly.`)}}}}function ss(h){if(jt())return;let k,I;if(h.method===o.type.method){const F=h.params.id;De.delete(F),er(h);return}else{const F=re.get(h.method);F&&(I=F.handler,k=F.type)}if(I||q)try{if(er(h),I)if(h.params===void 0)k!==void 0&&k.numberOfParams!==0&&k.parameterStructures!==r.ParameterStructures.byName&&E.error(`Notification ${h.method} defines ${k.numberOfParams} params but received none.`),I();else if(Array.isArray(h.params)){const F=h.params;h.method===l.type.method&&F.length===2&&c.is(F[0])?I({token:F[0],value:F[1]}):(k!==void 0&&(k.parameterStructures===r.ParameterStructures.byName&&E.error(`Notification ${h.method} defines parameters by name but received parameters by position`),k.numberOfParams!==h.params.length&&E.error(`Notification ${h.method} defines ${k.numberOfParams} params but received ${F.length} arguments`)),I(...F))}else k!==void 0&&k.parameterStructures===r.ParameterStructures.byPosition&&E.error(`Notification ${h.method} defines parameters by position but received parameters by name`),I(h.params);else q&&q(h.method,h.params)}catch(F){F.message?E.error(`Notification handler '${h.method}' failed with message: ${F.message}`):E.error(`Notification handler '${h.method}' failed unexpectedly.`)}else Vr.fire(h)}function as(h){if(!h){E.error("Received empty message.");return}E.error(`Received message which is neither a response nor a notification message:
|
|
127
|
+
${JSON.stringify(h,null,4)}`);const k=h;if(n.string(k.id)||n.number(k.id)){const I=k.id,F=$e.get(I);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}function Et(h){if(h!=null)switch(Q){case p.Verbose:return JSON.stringify(h,null,4);case p.Compact:return JSON.stringify(h);default:return}}function os(h){if(!(Q===p.Off||!Te))if(st===S.Text){let k;(Q===p.Verbose||Q===p.Compact)&&h.params&&(k=`Params: ${Et(h.params)}
|
|
128
|
+
|
|
129
|
+
`),Te.log(`Sending request '${h.method} - (${h.id})'.`,k)}else zt("send-request",h)}function cs(h){if(!(Q===p.Off||!Te))if(st===S.Text){let k;(Q===p.Verbose||Q===p.Compact)&&(h.params?k=`Params: ${Et(h.params)}
|
|
130
|
+
|
|
131
|
+
`:k=`No parameters provided.
|
|
132
|
+
|
|
133
|
+
`),Te.log(`Sending notification '${h.method}'.`,k)}else zt("send-notification",h)}function bn(h,k,I){if(!(Q===p.Off||!Te))if(st===S.Text){let F;(Q===p.Verbose||Q===p.Compact)&&(h.error&&h.error.data?F=`Error data: ${Et(h.error.data)}
|
|
134
|
+
|
|
135
|
+
`:h.result?F=`Result: ${Et(h.result)}
|
|
136
|
+
|
|
137
|
+
`:h.error===void 0&&(F=`No result returned.
|
|
138
|
+
|
|
139
|
+
`)),Te.log(`Sending response '${k} - (${h.id})'. Processing request took ${Date.now()-I}ms`,F)}else zt("send-response",h)}function ls(h){if(!(Q===p.Off||!Te))if(st===S.Text){let k;(Q===p.Verbose||Q===p.Compact)&&h.params&&(k=`Params: ${Et(h.params)}
|
|
140
|
+
|
|
141
|
+
`),Te.log(`Received request '${h.method} - (${h.id})'.`,k)}else zt("receive-request",h)}function er(h){if(!(Q===p.Off||!Te||h.method===x.type.method))if(st===S.Text){let k;(Q===p.Verbose||Q===p.Compact)&&(h.params?k=`Params: ${Et(h.params)}
|
|
142
|
+
|
|
143
|
+
`:k=`No parameters provided.
|
|
144
|
+
|
|
145
|
+
`),Te.log(`Received notification '${h.method}'.`,k)}else zt("receive-notification",h)}function us(h,k){if(!(Q===p.Off||!Te))if(st===S.Text){let I;if((Q===p.Verbose||Q===p.Compact)&&(h.error&&h.error.data?I=`Error data: ${Et(h.error.data)}
|
|
146
|
+
|
|
147
|
+
`:h.result?I=`Result: ${Et(h.result)}
|
|
148
|
+
|
|
149
|
+
`:h.error===void 0&&(I=`No result returned.
|
|
150
|
+
|
|
151
|
+
`)),k){const F=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";Te.log(`Received response '${k.method} - (${h.id})' in ${Date.now()-k.timerStart}ms.${F}`,I)}else Te.log(`Received response ${h.id} without active response promise.`,I)}else zt("receive-response",h)}function zt(h,k){if(!Te||Q===p.Off)return;const I={isLSPMessage:!0,type:h,message:k,timestamp:Date.now()};Te.log(I)}function ln(){if(Jr())throw new L(w.Closed,"Connection is closed.");if(jt())throw new L(w.Disposed,"Connection is disposed.")}function ds(){if(Xr())throw new L(w.AlreadyListening,"Connection is already listening")}function fs(){if(!Xr())throw new Error("Call listen() first.")}function un(h){return h===void 0?null:h}function ti(h){if(h!==null)return h}function d(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function Ce(h,k){switch(h){case r.ParameterStructures.auto:return d(k)?ti(k):[un(k)];case r.ParameterStructures.byName:if(!d(k))throw new Error("Received parameters by name but param is not an object literal.");return ti(k);case r.ParameterStructures.byPosition:return[un(k)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function Ne(h,k){let I;const F=h.numberOfParams;switch(F){case 0:I=void 0;break;case 1:I=Ce(h.parameterStructures,k[0]);break;default:I=[];for(let ce=0;ce<k.length&&ce<F;ce++)I.push(un(k[ce]));if(k.length<F)for(let ce=k.length;ce<F;ce++)I.push(null);break}return I}const V={sendNotification:(h,...k)=>{ln();let I,F;if(n.string(h)){I=h;const ae=k[0];let Re=0,we=r.ParameterStructures.auto;r.ParameterStructures.is(ae)&&(Re=1,we=ae);let J=k.length;const fe=J-Re;switch(fe){case 0:F=void 0;break;case 1:F=Ce(we,k[Re]);break;default:if(we===r.ParameterStructures.byName)throw new Error(`Received ${fe} parameters for 'by Name' notification parameter structure.`);F=k.slice(Re,J).map(ie=>un(ie));break}}else{const ae=k;I=h.method,F=Ne(h,ae)}const ce={jsonrpc:z,method:I,params:F};return cs(ce),A.write(ce).catch(ae=>{throw E.error("Sending notification failed."),ae})},onNotification:(h,k)=>{ln();let I;return n.func(h)?q=h:k&&(n.string(h)?(I=h,re.set(h,{type:void 0,handler:k})):(I=h.method,re.set(h.method,{type:h,handler:k}))),{dispose:()=>{I!==void 0?re.delete(I):q=void 0}}},onProgress:(h,k,I)=>{if(xe.has(k))throw new Error(`Progress handler for token ${k} already registered`);return xe.set(k,I),{dispose:()=>{xe.delete(k)}}},sendProgress:(h,k,I)=>V.sendNotification(l.type,{token:k,value:I}),onUnhandledProgress:Kr.event,sendRequest:(h,...k)=>{ln(),fs();let I,F,ce;if(n.string(h)){I=h;const J=k[0],fe=k[k.length-1];let ie=0,Pe=r.ParameterStructures.auto;r.ParameterStructures.is(J)&&(ie=1,Pe=J);let Ke=k.length;a.CancellationToken.is(fe)&&(Ke=Ke-1,ce=fe);const $t=Ke-ie;switch($t){case 0:F=void 0;break;case 1:F=Ce(Pe,k[ie]);break;default:if(Pe===r.ParameterStructures.byName)throw new Error(`Received ${$t} parameters for 'by Name' request parameter structure.`);F=k.slice(ie,Ke).map(Sp=>un(Sp));break}}else{const J=k;I=h.method,F=Ne(h,J);const fe=h.numberOfParams;ce=a.CancellationToken.is(J[fe])?J[fe]:void 0}const ae=$++;let Re;ce&&(Re=ce.onCancellationRequested(()=>{const J=vt.sender.sendCancellation(V,ae);return J===void 0?(E.log(`Received no promise from cancellation strategy when cancelling id ${ae}`),Promise.resolve()):J.catch(()=>{E.log(`Sending cancellation messages for id ${ae} failed`)})}));const we={jsonrpc:z,id:ae,method:I,params:F};return os(we),typeof vt.sender.enableCancellation=="function"&&vt.sender.enableCancellation(we),new Promise(async(J,fe)=>{const ie=$t=>{J($t),vt.sender.cleanup(ae),Re?.dispose()},Pe=$t=>{fe($t),vt.sender.cleanup(ae),Re?.dispose()},Ke={method:I,timerStart:Date.now(),resolve:ie,reject:Pe};try{await A.write(we),$e.set(ae,Ke)}catch($t){throw E.error("Sending request failed."),Ke.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,$t.message?$t.message:"Unknown reason")),$t}})},onRequest:(h,k)=>{ln();let I=null;return f.is(h)?(I=void 0,G=h):n.string(h)?(I=null,k!==void 0&&(I=h,se.set(h,{handler:k,type:void 0}))):k!==void 0&&(I=h.method,se.set(h.method,{type:h,handler:k})),{dispose:()=>{I!==null&&(I!==void 0?se.delete(I):G=void 0)}}},hasPendingResponse:()=>$e.size>0,trace:async(h,k,I)=>{let F=!1,ce=S.Text;I!==void 0&&(n.boolean(I)?F=I:(F=I.sendNotification||!1,ce=I.traceFormat||S.Text)),Q=h,st=ce,Q===p.Off?Te=void 0:Te=k,F&&!Jr()&&!jt()&&await V.sendNotification(N.type,{value:p.toString(h)})},onError:Zn.event,onClose:Wr.event,onUnhandledNotification:Vr.event,onDispose:Hr.event,end:()=>{A.end()},dispose:()=>{if(jt())return;Rt=C.Disposed,Hr.fire(void 0);const h=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const k of $e.values())k.reject(h);$e=new Map,be=new Map,De=new Set,de=new i.LinkedMap,n.func(A.dispose)&&A.dispose(),n.func(m.dispose)&&m.dispose()},listen:()=>{ln(),ds(),Rt=C.Listening,m.listen(ns)},inspect:()=>{(0,e.default)().console.log("inspect")}};return V.onNotification(x.type,h=>{if(Q===p.Off||!Te)return;const k=Q===p.Verbose||Q===p.Compact;Te.log(h.message,k?h.verbose:void 0)}),V.onNotification(l.type,h=>{const k=xe.get(h.token);k?k(h.value):Kr.fire(h)}),V}t.createMessageConnection=T}(ro)),ro}var xu;function Bc(){return xu||(xu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Wh();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=Vh();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=lv();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ft;Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=En;Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=uv();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const o=dv();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const c=fv();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=hv();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const u=pv();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const f=cn;t.RAL=f.default}(no)),no}Object.defineProperty(wl,"__esModule",{value:!0});const Dt=Bc();class Pa extends Dt.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Pa.emptyBuffer}fromString(e,n){return new TextEncoder().encode(e)}toString(e,n){return n==="ascii"?this.asciiDecoder.decode(e):new TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e:e.slice(0,n)}allocNative(e){return new Uint8Array(e)}}Pa.emptyBuffer=new Uint8Array(0);class mv{constructor(e){this.socket=e,this._onData=new Dt.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Dt.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Dt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Dt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Dt.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class gv{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Dt.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Dt.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Dt.Disposable.create(()=>this.socket.removeEventListener("end",e))}write(e,n){if(typeof e=="string"){if(n!==void 0&&n!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${n}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const yv=new TextEncoder,Hh=Object.freeze({messageBuffer:Object.freeze({create:t=>new Pa(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{if(e.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${e.charset}`);return Promise.resolve(yv.encode(JSON.stringify(t,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{if(!(t instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(t)))}})}),stream:Object.freeze({asReadableStream:t=>new mv(t),asWritableStream:t=>new gv(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){const r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){const n=setTimeout(t,0,...e);return{dispose:()=>clearTimeout(n)}},setInterval(t,e,...n){const r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function qc(){return Hh}(function(t){function e(){Dt.RAL.install(Hh)}t.install=e})(qc||(qc={}));wl.default=qc;(function(t){var e=gt&>.__createBinding||(Object.create?function(c,l,u,f){f===void 0&&(f=u);var p=Object.getOwnPropertyDescriptor(l,u);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(c,f,p)}:function(c,l,u,f){f===void 0&&(f=u),c[f]=l[u]}),n=gt&>.__exportStar||function(c,l){for(var u in c)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&e(l,c,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,wl.default.install();const i=Bc();n(Bc(),t);class s extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},l.addEventListener("error",u=>this.fireError(u)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}t.BrowserMessageReader=s;class a extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",u=>this.fireError(u))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(u){return this.handleError(u,l),Promise.reject(u)}}handleError(l,u){this.errorCount++,this.fireError(l,u,this.errorCount)}end(){}}t.BrowserMessageWriter=a;function o(c,l,u,f){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(c,l,u,f)}t.createMessageConnection=o})(Xn);var Du=Xn,Yh={};const bl=Lp(rR);var H={};Object.defineProperty(H,"__esModule",{value:!0});H.ProtocolNotificationType=H.ProtocolNotificationType0=H.ProtocolRequestType=H.ProtocolRequestType0=H.RegistrationType=H.MessageDirection=void 0;const Ir=Xn;var Mu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Mu||(H.MessageDirection=Mu={}));class Tv{constructor(e){this.method=e}}H.RegistrationType=Tv;class Rv extends Ir.RequestType0{constructor(e){super(e)}}H.ProtocolRequestType0=Rv;class vv extends Ir.RequestType{constructor(e){super(e,Ir.ParameterStructures.byName)}}H.ProtocolRequestType=vv;class Ev extends Ir.NotificationType0{constructor(e){super(e)}}H.ProtocolNotificationType0=Ev;class Av extends Ir.NotificationType{constructor(e){super(e,Ir.ParameterStructures.byName)}}H.ProtocolNotificationType=Av;var Xh={},Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.objectLiteral=Ee.typedArray=Ee.stringArray=Ee.array=Ee.func=Ee.error=Ee.number=Ee.string=Ee.boolean=void 0;function Sv(t){return t===!0||t===!1}Ee.boolean=Sv;function Jh(t){return typeof t=="string"||t instanceof String}Ee.string=Jh;function kv(t){return typeof t=="number"||t instanceof Number}Ee.number=kv;function Cv(t){return t instanceof Error}Ee.error=Cv;function Nv(t){return typeof t=="function"}Ee.func=Nv;function Qh(t){return Array.isArray(t)}Ee.array=Qh;function wv(t){return Qh(t)&&t.every(e=>Jh(e))}Ee.stringArray=wv;function bv(t,e){return Array.isArray(t)&&t.every(e)}Ee.typedArray=bv;function _v(t){return t!==null&&typeof t=="object"}Ee.objectLiteral=_v;var La={};Object.defineProperty(La,"__esModule",{value:!0});La.ImplementationRequest=void 0;const Fu=H;var Gu;(function(t){t.method="textDocument/implementation",t.messageDirection=Fu.MessageDirection.clientToServer,t.type=new Fu.ProtocolRequestType(t.method)})(Gu||(La.ImplementationRequest=Gu={}));var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.TypeDefinitionRequest=void 0;const Uu=H;var ju;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Uu.MessageDirection.clientToServer,t.type=new Uu.ProtocolRequestType(t.method)})(ju||(Oa.TypeDefinitionRequest=ju={}));var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.DidChangeWorkspaceFoldersNotification=$r.WorkspaceFoldersRequest=void 0;const ua=H;var zu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ua.MessageDirection.serverToClient,t.type=new ua.ProtocolRequestType0(t.method)})(zu||($r.WorkspaceFoldersRequest=zu={}));var Bu;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ua.MessageDirection.clientToServer,t.type=new ua.ProtocolNotificationType(t.method)})(Bu||($r.DidChangeWorkspaceFoldersNotification=Bu={}));var xa={};Object.defineProperty(xa,"__esModule",{value:!0});xa.ConfigurationRequest=void 0;const qu=H;var Wu;(function(t){t.method="workspace/configuration",t.messageDirection=qu.MessageDirection.serverToClient,t.type=new qu.ProtocolRequestType(t.method)})(Wu||(xa.ConfigurationRequest=Wu={}));var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.ColorPresentationRequest=Pr.DocumentColorRequest=void 0;const da=H;var Vu;(function(t){t.method="textDocument/documentColor",t.messageDirection=da.MessageDirection.clientToServer,t.type=new da.ProtocolRequestType(t.method)})(Vu||(Pr.DocumentColorRequest=Vu={}));var Ku;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=da.MessageDirection.clientToServer,t.type=new da.ProtocolRequestType(t.method)})(Ku||(Pr.ColorPresentationRequest=Ku={}));var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.FoldingRangeRefreshRequest=Lr.FoldingRangeRequest=void 0;const fa=H;var Hu;(function(t){t.method="textDocument/foldingRange",t.messageDirection=fa.MessageDirection.clientToServer,t.type=new fa.ProtocolRequestType(t.method)})(Hu||(Lr.FoldingRangeRequest=Hu={}));var Yu;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=fa.MessageDirection.serverToClient,t.type=new fa.ProtocolRequestType0(t.method)})(Yu||(Lr.FoldingRangeRefreshRequest=Yu={}));var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.DeclarationRequest=void 0;const Xu=H;var Ju;(function(t){t.method="textDocument/declaration",t.messageDirection=Xu.MessageDirection.clientToServer,t.type=new Xu.ProtocolRequestType(t.method)})(Ju||(Da.DeclarationRequest=Ju={}));var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.SelectionRangeRequest=void 0;const Qu=H;var Zu;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Qu.MessageDirection.clientToServer,t.type=new Qu.ProtocolRequestType(t.method)})(Zu||(Ma.SelectionRangeRequest=Zu={}));var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.WorkDoneProgressCancelNotification=hn.WorkDoneProgressCreateRequest=hn.WorkDoneProgress=void 0;const Iv=Xn,ha=H;var ed;(function(t){t.type=new Iv.ProgressType;function e(n){return n===t.type}t.is=e})(ed||(hn.WorkDoneProgress=ed={}));var td;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ha.MessageDirection.serverToClient,t.type=new ha.ProtocolRequestType(t.method)})(td||(hn.WorkDoneProgressCreateRequest=td={}));var nd;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ha.MessageDirection.clientToServer,t.type=new ha.ProtocolNotificationType(t.method)})(nd||(hn.WorkDoneProgressCancelNotification=nd={}));var pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.CallHierarchyOutgoingCallsRequest=pn.CallHierarchyIncomingCallsRequest=pn.CallHierarchyPrepareRequest=void 0;const Or=H;var rd;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Or.MessageDirection.clientToServer,t.type=new Or.ProtocolRequestType(t.method)})(rd||(pn.CallHierarchyPrepareRequest=rd={}));var id;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Or.MessageDirection.clientToServer,t.type=new Or.ProtocolRequestType(t.method)})(id||(pn.CallHierarchyIncomingCallsRequest=id={}));var sd;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Or.MessageDirection.clientToServer,t.type=new Or.ProtocolRequestType(t.method)})(sd||(pn.CallHierarchyOutgoingCallsRequest=sd={}));var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.SemanticTokensRefreshRequest=Ze.SemanticTokensRangeRequest=Ze.SemanticTokensDeltaRequest=Ze.SemanticTokensRequest=Ze.SemanticTokensRegistrationType=Ze.TokenFormat=void 0;const sn=H;var ad;(function(t){t.Relative="relative"})(ad||(Ze.TokenFormat=ad={}));var Mi;(function(t){t.method="textDocument/semanticTokens",t.type=new sn.RegistrationType(t.method)})(Mi||(Ze.SemanticTokensRegistrationType=Mi={}));var od;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=sn.MessageDirection.clientToServer,t.type=new sn.ProtocolRequestType(t.method),t.registrationMethod=Mi.method})(od||(Ze.SemanticTokensRequest=od={}));var cd;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=sn.MessageDirection.clientToServer,t.type=new sn.ProtocolRequestType(t.method),t.registrationMethod=Mi.method})(cd||(Ze.SemanticTokensDeltaRequest=cd={}));var ld;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=sn.MessageDirection.clientToServer,t.type=new sn.ProtocolRequestType(t.method),t.registrationMethod=Mi.method})(ld||(Ze.SemanticTokensRangeRequest=ld={}));var ud;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=sn.MessageDirection.serverToClient,t.type=new sn.ProtocolRequestType0(t.method)})(ud||(Ze.SemanticTokensRefreshRequest=ud={}));var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.ShowDocumentRequest=void 0;const dd=H;var fd;(function(t){t.method="window/showDocument",t.messageDirection=dd.MessageDirection.serverToClient,t.type=new dd.ProtocolRequestType(t.method)})(fd||(Fa.ShowDocumentRequest=fd={}));var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.LinkedEditingRangeRequest=void 0;const hd=H;var pd;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(pd||(Ga.LinkedEditingRangeRequest=pd={}));var qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.WillDeleteFilesRequest=qe.DidDeleteFilesNotification=qe.DidRenameFilesNotification=qe.WillRenameFilesRequest=qe.DidCreateFilesNotification=qe.WillCreateFilesRequest=qe.FileOperationPatternKind=void 0;const Tt=H;var md;(function(t){t.file="file",t.folder="folder"})(md||(qe.FileOperationPatternKind=md={}));var gd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Tt.MessageDirection.clientToServer,t.type=new Tt.ProtocolRequestType(t.method)})(gd||(qe.WillCreateFilesRequest=gd={}));var yd;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Tt.MessageDirection.clientToServer,t.type=new Tt.ProtocolNotificationType(t.method)})(yd||(qe.DidCreateFilesNotification=yd={}));var Td;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Tt.MessageDirection.clientToServer,t.type=new Tt.ProtocolRequestType(t.method)})(Td||(qe.WillRenameFilesRequest=Td={}));var Rd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Tt.MessageDirection.clientToServer,t.type=new Tt.ProtocolNotificationType(t.method)})(Rd||(qe.DidRenameFilesNotification=Rd={}));var vd;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Tt.MessageDirection.clientToServer,t.type=new Tt.ProtocolNotificationType(t.method)})(vd||(qe.DidDeleteFilesNotification=vd={}));var Ed;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Tt.MessageDirection.clientToServer,t.type=new Tt.ProtocolRequestType(t.method)})(Ed||(qe.WillDeleteFilesRequest=Ed={}));var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.MonikerRequest=mn.MonikerKind=mn.UniquenessLevel=void 0;const Ad=H;var Sd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Sd||(mn.UniquenessLevel=Sd={}));var kd;(function(t){t.$import="import",t.$export="export",t.local="local"})(kd||(mn.MonikerKind=kd={}));var Cd;(function(t){t.method="textDocument/moniker",t.messageDirection=Ad.MessageDirection.clientToServer,t.type=new Ad.ProtocolRequestType(t.method)})(Cd||(mn.MonikerRequest=Cd={}));var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.TypeHierarchySubtypesRequest=gn.TypeHierarchySupertypesRequest=gn.TypeHierarchyPrepareRequest=void 0;const xr=H;var Nd;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=xr.MessageDirection.clientToServer,t.type=new xr.ProtocolRequestType(t.method)})(Nd||(gn.TypeHierarchyPrepareRequest=Nd={}));var wd;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=xr.MessageDirection.clientToServer,t.type=new xr.ProtocolRequestType(t.method)})(wd||(gn.TypeHierarchySupertypesRequest=wd={}));var bd;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=xr.MessageDirection.clientToServer,t.type=new xr.ProtocolRequestType(t.method)})(bd||(gn.TypeHierarchySubtypesRequest=bd={}));var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.InlineValueRefreshRequest=Dr.InlineValueRequest=void 0;const pa=H;var _d;(function(t){t.method="textDocument/inlineValue",t.messageDirection=pa.MessageDirection.clientToServer,t.type=new pa.ProtocolRequestType(t.method)})(_d||(Dr.InlineValueRequest=_d={}));var Id;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=pa.MessageDirection.serverToClient,t.type=new pa.ProtocolRequestType0(t.method)})(Id||(Dr.InlineValueRefreshRequest=Id={}));var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.InlayHintRefreshRequest=yn.InlayHintResolveRequest=yn.InlayHintRequest=void 0;const Mr=H;var $d;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.ProtocolRequestType(t.method)})($d||(yn.InlayHintRequest=$d={}));var Pd;(function(t){t.method="inlayHint/resolve",t.messageDirection=Mr.MessageDirection.clientToServer,t.type=new Mr.ProtocolRequestType(t.method)})(Pd||(yn.InlayHintResolveRequest=Pd={}));var Ld;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Mr.MessageDirection.serverToClient,t.type=new Mr.ProtocolRequestType0(t.method)})(Ld||(yn.InlayHintRefreshRequest=Ld={}));var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.DiagnosticRefreshRequest=mt.WorkspaceDiagnosticRequest=mt.DocumentDiagnosticRequest=mt.DocumentDiagnosticReportKind=mt.DiagnosticServerCancellationData=void 0;const Zh=Xn,$v=Ee,Fr=H;var Od;(function(t){function e(n){const r=n;return r&&$v.boolean(r.retriggerRequest)}t.is=e})(Od||(mt.DiagnosticServerCancellationData=Od={}));var xd;(function(t){t.Full="full",t.Unchanged="unchanged"})(xd||(mt.DocumentDiagnosticReportKind=xd={}));var Dd;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Fr.MessageDirection.clientToServer,t.type=new Fr.ProtocolRequestType(t.method),t.partialResult=new Zh.ProgressType})(Dd||(mt.DocumentDiagnosticRequest=Dd={}));var Md;(function(t){t.method="workspace/diagnostic",t.messageDirection=Fr.MessageDirection.clientToServer,t.type=new Fr.ProtocolRequestType(t.method),t.partialResult=new Zh.ProgressType})(Md||(mt.WorkspaceDiagnosticRequest=Md={}));var Fd;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Fr.MessageDirection.serverToClient,t.type=new Fr.ProtocolRequestType0(t.method)})(Fd||(mt.DiagnosticRefreshRequest=Fd={}));var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.DidCloseNotebookDocumentNotification=ve.DidSaveNotebookDocumentNotification=ve.DidChangeNotebookDocumentNotification=ve.NotebookCellArrayChange=ve.DidOpenNotebookDocumentNotification=ve.NotebookDocumentSyncRegistrationType=ve.NotebookDocument=ve.NotebookCell=ve.ExecutionSummary=ve.NotebookCellKind=void 0;const Fi=bl,Ct=Ee,Gt=H;var Wc;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Wc||(ve.NotebookCellKind=Wc={}));var Vc;(function(t){function e(i,s){const a={executionOrder:i};return(s===!0||s===!1)&&(a.success=s),a}t.create=e;function n(i){const s=i;return Ct.objectLiteral(s)&&Fi.uinteger.is(s.executionOrder)&&(s.success===void 0||Ct.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Vc||(ve.ExecutionSummary=Vc={}));var ma;(function(t){function e(s,a){return{kind:s,document:a}}t.create=e;function n(s){const a=s;return Ct.objectLiteral(a)&&Wc.is(a.kind)&&Fi.DocumentUri.is(a.document)&&(a.metadata===void 0||Ct.objectLiteral(a.metadata))}t.is=n;function r(s,a){const o=new Set;return s.document!==a.document&&o.add("document"),s.kind!==a.kind&&o.add("kind"),s.executionSummary!==a.executionSummary&&o.add("executionSummary"),(s.metadata!==void 0||a.metadata!==void 0)&&!i(s.metadata,a.metadata)&&o.add("metadata"),(s.executionSummary!==void 0||a.executionSummary!==void 0)&&!Vc.equals(s.executionSummary,a.executionSummary)&&o.add("executionSummary"),o}t.diff=r;function i(s,a){if(s===a)return!0;if(s==null||a===null||a===void 0||typeof s!=typeof a||typeof s!="object")return!1;const o=Array.isArray(s),c=Array.isArray(a);if(o!==c)return!1;if(o&&c){if(s.length!==a.length)return!1;for(let l=0;l<s.length;l++)if(!i(s[l],a[l]))return!1}if(Ct.objectLiteral(s)&&Ct.objectLiteral(a)){const l=Object.keys(s),u=Object.keys(a);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let f=0;f<l.length;f++){const p=l[f];if(!i(s[p],a[p]))return!1}}return!0}})(ma||(ve.NotebookCell=ma={}));var Gd;(function(t){function e(r,i,s,a){return{uri:r,notebookType:i,version:s,cells:a}}t.create=e;function n(r){const i=r;return Ct.objectLiteral(i)&&Ct.string(i.uri)&&Fi.integer.is(i.version)&&Ct.typedArray(i.cells,ma.is)}t.is=n})(Gd||(ve.NotebookDocument=Gd={}));var Gr;(function(t){t.method="notebookDocument/sync",t.messageDirection=Gt.MessageDirection.clientToServer,t.type=new Gt.RegistrationType(t.method)})(Gr||(ve.NotebookDocumentSyncRegistrationType=Gr={}));var Ud;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Gt.MessageDirection.clientToServer,t.type=new Gt.ProtocolNotificationType(t.method),t.registrationMethod=Gr.method})(Ud||(ve.DidOpenNotebookDocumentNotification=Ud={}));var jd;(function(t){function e(r){const i=r;return Ct.objectLiteral(i)&&Fi.uinteger.is(i.start)&&Fi.uinteger.is(i.deleteCount)&&(i.cells===void 0||Ct.typedArray(i.cells,ma.is))}t.is=e;function n(r,i,s){const a={start:r,deleteCount:i};return s!==void 0&&(a.cells=s),a}t.create=n})(jd||(ve.NotebookCellArrayChange=jd={}));var zd;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Gt.MessageDirection.clientToServer,t.type=new Gt.ProtocolNotificationType(t.method),t.registrationMethod=Gr.method})(zd||(ve.DidChangeNotebookDocumentNotification=zd={}));var Bd;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Gt.MessageDirection.clientToServer,t.type=new Gt.ProtocolNotificationType(t.method),t.registrationMethod=Gr.method})(Bd||(ve.DidSaveNotebookDocumentNotification=Bd={}));var qd;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Gt.MessageDirection.clientToServer,t.type=new Gt.ProtocolNotificationType(t.method),t.registrationMethod=Gr.method})(qd||(ve.DidCloseNotebookDocumentNotification=qd={}));var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.InlineCompletionRequest=void 0;const Wd=H;var Vd;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Wd.MessageDirection.clientToServer,t.type=new Wd.ProtocolRequestType(t.method)})(Vd||(Ua.InlineCompletionRequest=Vd={}));(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=H,n=bl,r=Ee,i=La;Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=Oa;Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=$r;Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const o=xa;Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const c=Pr;Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const l=Lr;Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const u=Da;Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const f=Ma;Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const p=hn;Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return p.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return p.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return p.WorkDoneProgressCancelNotification}});const g=pn;Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return g.CallHierarchyPrepareRequest}});const S=Ze;Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return S.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return S.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return S.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return S.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return S.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return S.SemanticTokensRegistrationType}});const N=Fa;Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return N.ShowDocumentRequest}});const x=Ga;Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return x.LinkedEditingRangeRequest}});const w=qe;Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const L=mn;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return L.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return L.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return L.MonikerRequest}});const b=gn;Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const O=Dr;Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return O.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return O.InlineValueRefreshRequest}});const X=yn;Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return X.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return X.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return X.InlayHintRefreshRequest}});const te=mt;Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return te.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return te.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return te.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return te.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return te.DiagnosticRefreshRequest}});const ne=ve;Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return ne.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return ne.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return ne.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return ne.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ne.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ne.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ne.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ne.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ne.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ne.DidCloseNotebookDocumentNotification}});const ge=Ua;Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return ge.InlineCompletionRequest}});var ke;(function(d){function Ce(Ne){const V=Ne;return r.string(V)||r.string(V.language)||r.string(V.scheme)||r.string(V.pattern)}d.is=Ce})(ke||(t.TextDocumentFilter=ke={}));var ue;(function(d){function Ce(Ne){const V=Ne;return r.objectLiteral(V)&&(r.string(V.notebookType)||r.string(V.scheme)||r.string(V.pattern))}d.is=Ce})(ue||(t.NotebookDocumentFilter=ue={}));var C;(function(d){function Ce(Ne){const V=Ne;return r.objectLiteral(V)&&(r.string(V.notebook)||ue.is(V.notebook))&&(V.language===void 0||r.string(V.language))}d.is=Ce})(C||(t.NotebookCellTextDocumentFilter=C={}));var T;(function(d){function Ce(Ne){if(!Array.isArray(Ne))return!1;for(let V of Ne)if(!r.string(V)&&!ke.is(V)&&!C.is(V))return!1;return!0}d.is=Ce})(T||(t.DocumentSelector=T={}));var m;(function(d){d.method="client/registerCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(m||(t.RegistrationRequest=m={}));var A;(function(d){d.method="client/unregisterCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(A||(t.UnregistrationRequest=A={}));var y;(function(d){d.Create="create",d.Rename="rename",d.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var R;(function(d){d.Abort="abort",d.Transactional="transactional",d.TextOnlyTransactional="textOnlyTransactional",d.Undo="undo"})(R||(t.FailureHandlingKind=R={}));var E;(function(d){d.UTF8="utf-8",d.UTF16="utf-16",d.UTF32="utf-32"})(E||(t.PositionEncodingKind=E={}));var $;(function(d){function Ce(Ne){const V=Ne;return V&&r.string(V.id)&&V.id.length>0}d.hasId=Ce})($||(t.StaticRegistrationOptions=$={}));var D;(function(d){function Ce(Ne){const V=Ne;return V&&(V.documentSelector===null||T.is(V.documentSelector))}d.is=Ce})(D||(t.TextDocumentRegistrationOptions=D={}));var P;(function(d){function Ce(V){const h=V;return r.objectLiteral(h)&&(h.workDoneProgress===void 0||r.boolean(h.workDoneProgress))}d.is=Ce;function Ne(V){const h=V;return h&&r.boolean(h.workDoneProgress)}d.hasWorkDoneProgress=Ne})(P||(t.WorkDoneProgressOptions=P={}));var z;(function(d){d.method="initialize",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(z||(t.InitializeRequest=z={}));var G;(function(d){d.unknownProtocolVersion=1})(G||(t.InitializeErrorCodes=G={}));var se;(function(d){d.method="initialized",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(se||(t.InitializedNotification=se={}));var q;(function(d){d.method="shutdown",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType0(d.method)})(q||(t.ShutdownRequest=q={}));var re;(function(d){d.method="exit",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType0(d.method)})(re||(t.ExitNotification=re={}));var xe;(function(d){d.method="workspace/didChangeConfiguration",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(xe||(t.DidChangeConfigurationNotification=xe={}));var ye;(function(d){d.Error=1,d.Warning=2,d.Info=3,d.Log=4,d.Debug=5})(ye||(t.MessageType=ye={}));var de;(function(d){d.method="window/showMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(de||(t.ShowMessageNotification=de={}));var $e;(function(d){d.method="window/showMessageRequest",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})($e||(t.ShowMessageRequest=$e={}));var De;(function(d){d.method="window/logMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(De||(t.LogMessageNotification=De={}));var be;(function(d){d.method="telemetry/event",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(be||(t.TelemetryEventNotification=be={}));var Q;(function(d){d.None=0,d.Full=1,d.Incremental=2})(Q||(t.TextDocumentSyncKind=Q={}));var st;(function(d){d.method="textDocument/didOpen",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(st||(t.DidOpenTextDocumentNotification=st={}));var Te;(function(d){function Ce(V){let h=V;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}d.isIncremental=Ce;function Ne(V){let h=V;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}d.isFull=Ne})(Te||(t.TextDocumentContentChangeEvent=Te={}));var Rt;(function(d){d.method="textDocument/didChange",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Rt||(t.DidChangeTextDocumentNotification=Rt={}));var Zn;(function(d){d.method="textDocument/didClose",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Zn||(t.DidCloseTextDocumentNotification=Zn={}));var Wr;(function(d){d.method="textDocument/didSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Wr||(t.DidSaveTextDocumentNotification=Wr={}));var Vr;(function(d){d.Manual=1,d.AfterDelay=2,d.FocusOut=3})(Vr||(t.TextDocumentSaveReason=Vr={}));var Kr;(function(d){d.method="textDocument/willSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Kr||(t.WillSaveTextDocumentNotification=Kr={}));var Hr;(function(d){d.method="textDocument/willSaveWaitUntil",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Hr||(t.WillSaveTextDocumentWaitUntilRequest=Hr={}));var vt;(function(d){d.method="workspace/didChangeWatchedFiles",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(vt||(t.DidChangeWatchedFilesNotification=vt={}));var Yr;(function(d){d.Created=1,d.Changed=2,d.Deleted=3})(Yr||(t.FileChangeType=Yr={}));var Yi;(function(d){function Ce(Ne){const V=Ne;return r.objectLiteral(V)&&(n.URI.is(V.baseUri)||n.WorkspaceFolder.is(V.baseUri))&&r.string(V.pattern)}d.is=Ce})(Yi||(t.RelativePattern=Yi={}));var Xi;(function(d){d.Create=1,d.Change=2,d.Delete=4})(Xi||(t.WatchKind=Xi={}));var Ji;(function(d){d.method="textDocument/publishDiagnostics",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(Ji||(t.PublishDiagnosticsNotification=Ji={}));var Qi;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.TriggerForIncompleteCompletions=3})(Qi||(t.CompletionTriggerKind=Qi={}));var Xr;(function(d){d.method="textDocument/completion",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Xr||(t.CompletionRequest=Xr={}));var Jr;(function(d){d.method="completionItem/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Jr||(t.CompletionResolveRequest=Jr={}));var jt;(function(d){d.method="textDocument/hover",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(jt||(t.HoverRequest=jt={}));var Qr;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.ContentChange=3})(Qr||(t.SignatureHelpTriggerKind=Qr={}));var Zi;(function(d){d.method="textDocument/signatureHelp",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Zi||(t.SignatureHelpRequest=Zi={}));var es;(function(d){d.method="textDocument/definition",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(es||(t.DefinitionRequest=es={}));var Zr;(function(d){d.method="textDocument/references",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Zr||(t.ReferencesRequest=Zr={}));var ei;(function(d){d.method="textDocument/documentHighlight",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ei||(t.DocumentHighlightRequest=ei={}));var ts;(function(d){d.method="textDocument/documentSymbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ts||(t.DocumentSymbolRequest=ts={}));var ns;(function(d){d.method="textDocument/codeAction",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ns||(t.CodeActionRequest=ns={}));var rs;(function(d){d.method="codeAction/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(rs||(t.CodeActionResolveRequest=rs={}));var is;(function(d){d.method="workspace/symbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(is||(t.WorkspaceSymbolRequest=is={}));var ss;(function(d){d.method="workspaceSymbol/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ss||(t.WorkspaceSymbolResolveRequest=ss={}));var as;(function(d){d.method="textDocument/codeLens",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(as||(t.CodeLensRequest=as={}));var Et;(function(d){d.method="codeLens/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Et||(t.CodeLensResolveRequest=Et={}));var os;(function(d){d.method="workspace/codeLens/refresh",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType0(d.method)})(os||(t.CodeLensRefreshRequest=os={}));var cs;(function(d){d.method="textDocument/documentLink",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(cs||(t.DocumentLinkRequest=cs={}));var bn;(function(d){d.method="documentLink/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(bn||(t.DocumentLinkResolveRequest=bn={}));var ls;(function(d){d.method="textDocument/formatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ls||(t.DocumentFormattingRequest=ls={}));var er;(function(d){d.method="textDocument/rangeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(er||(t.DocumentRangeFormattingRequest=er={}));var us;(function(d){d.method="textDocument/rangesFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(us||(t.DocumentRangesFormattingRequest=us={}));var zt;(function(d){d.method="textDocument/onTypeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(zt||(t.DocumentOnTypeFormattingRequest=zt={}));var ln;(function(d){d.Identifier=1})(ln||(t.PrepareSupportDefaultBehavior=ln={}));var ds;(function(d){d.method="textDocument/rename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ds||(t.RenameRequest=ds={}));var fs;(function(d){d.method="textDocument/prepareRename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(fs||(t.PrepareRenameRequest=fs={}));var un;(function(d){d.method="workspace/executeCommand",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(un||(t.ExecuteCommandRequest=un={}));var ti;(function(d){d.method="workspace/applyEdit",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType("workspace/applyEdit")})(ti||(t.ApplyWorkspaceEditRequest=ti={}))})(Xh);var ja={};Object.defineProperty(ja,"__esModule",{value:!0});ja.createProtocolConnection=void 0;const Kd=Xn;function Pv(t,e,n,r){return Kd.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Kd.createMessageConnection)(t,e,n,r)}ja.createProtocolConnection=Pv;(function(t){var e=gt&>.__createBinding||(Object.create?function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}:function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]}),n=gt&>.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Xn,t),n(bl,t),n(H,t),n(Xh,t);var r=ja;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={}))})(Yh);(function(t){var e=gt&>.__createBinding||(Object.create?function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}:function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]}),n=gt&>.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Du;n(Du,t),n(Yh,t);function i(s,a,o,c){return(0,r.createMessageConnection)(s,a,o,c)}t.createProtocolConnection=i})(Ai);var ki;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(ki||(ki={}));class Lv{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Di,this.documentPhaseListeners=new Di,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=K.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=me.None){for(const i of e){const s=i.uri.toString();if(i.state===K.Validated){if(typeof n.validation=="boolean"&&n.validation)this.resetToState(i,K.IndexedReferences);else if(typeof n.validation=="object"){const a=this.findMissingValidationCategories(i,n);a.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:a}},result:this.buildState.get(s)?.result}),i.state=K.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=K.Changed,await this.emitUpdate(e.map(i=>i.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=me.None){this.currentState=K.Changed;const i=[];for(const c of n){const l=this.langiumDocuments.deleteDocuments(c);for(const u of l)i.push(u.uri),this.cleanUpDeleted(u)}const s=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(const c of s){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=K.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,K.Changed)}const a=he(s).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!a.has(c.uri.toString())&&this.shouldRelink(c,a)).forEach(c=>this.resetToState(c,K.ComputedScopes)),await this.emitUpdate(s,i),await He(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(c=>c.state<K.Validated||!this.buildState.get(c.uri.toString())?.completed||this.resultsAreIncomplete(c,this.updateBuildOptions)).toArray());await this.buildDocuments(o,this.updateBuildOptions,r)}resultsAreIncomplete(e,n){return this.findMissingValidationCategories(e,n).length>=1}findMissingValidationCategories(e,n){const r=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?i:new Set,a=n===void 0||n.validation===!0?i:typeof n.validation=="object"?n.validation.categories??i:[];return he(a).filter(o=>!s.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}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){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),ki.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}resetToState(e,n){switch(n){case K.Changed:case K.Parsed:this.indexManager.removeContent(e.uri);case K.IndexedContent:e.localSymbols=void 0;case K.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case K.Linked:this.indexManager.removeReferences(e.uri);case K.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case K.Validated:}e.state>n&&(e.state=n)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=K.Changed}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,K.Parsed,r,a=>this.langiumDocumentFactory.update(a,r)),await this.runCancelable(e,K.IndexedContent,r,a=>this.indexManager.updateContent(a,r)),await this.runCancelable(e,K.ComputedScopes,r,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,r)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,K.Linked,r,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,r)),await this.runCancelable(i,K.IndexedReferences,r,a=>this.indexManager.updateReferences(a,r));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,K.Validated,r,async a=>{await this.validate(a,r),this.markAsCompleted(a)})}markAsCompleted(e){const n=this.buildState.get(e.uri.toString());n&&(n.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){for(const a of e)a.state<n&&(await He(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r));const s=e.filter(a=>a.state===n);await this.notifyBuildPhase(s,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),ki.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),ki.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;return n&&"path"in n?i=n:r=n,r??(r=me.None),i?this.awaitDocumentState(e,i,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,n,r){const i=this.langiumDocuments.getDocument(n);if(i){if(i.state>=e)return Promise.resolve(n);if(r.isCancellationRequested)return Promise.reject(Er);if(this.currentState>=e&&e>i.state)return Promise.reject(new Ai.ResponseError(Ai.LSPErrorCodes.RequestFailed,`Document state of ${n.toString()} is ${K[i.state]}, requiring ${K[e]}, but workspace state is already ${K[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Ai.ResponseError(Ai.LSPErrorCodes.ServerCancelled,`No document found for URI: ${n.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,l=>{ct.equals(l.uri,n)&&(o.dispose(),c.dispose(),s(l.uri))}),c=r.onCancellationRequested(()=>{o.dispose(),c.dispose(),a(Er)})})}awaitBuilderState(e,n){return this.currentState>=e?Promise.resolve():n.isCancellationRequested?Promise.reject(Er):new Promise((r,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),r()}),a=n.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(Er)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await He(r),await a(e,r)}catch(o){if(!$a(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await He(r),await a(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await r.validateDocument(e,s,n);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=he(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}}class Ov{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new HR,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=Qt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{ct.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),he(i)}allElements(e,n){let r=he(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){return n?this.symbolByTypeIndex.get(e,n,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,n))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n)}removeReferences(e){const n=e.toString();this.referenceIndex.delete(n)}async updateContent(e,n=me.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=me.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class xv{constructor(e){this.initialBuildOptions={},this._ready=new Nl,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){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(n=>this.initializeWorkspace(this.folders??[],n))}async initializeWorkspace(e,n=me.None){const r=await this.performStartup(e);await He(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=[],r=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,r);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=he(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,r),this._ready.resolve(),n}async loadWorkspaceDocuments(e,n){await Promise.all(e.map(async r=>{const i=await this.langiumDocuments.getOrCreateDocument(r);n(i)}))}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return wt.parse(e.uri)}async traverseFolder(e,n){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,n):i.isFile&&n.push(i.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const n=[];return await this.traverseFolder(e,n),n}shouldIncludeEntry(e){const n=ct.basename(e.uri);return n.startsWith(".")?!1:e.isDirectory?n!=="node_modules"&&n!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class Dv{buildUnexpectedCharactersMessage(e,n,r,i,s){return No.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return No.buildUnableToPopLexerModeMessage(e)}}const Mv={mode:"full"};class Fv{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=Hd(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new et(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=Mv){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Hd(e))return e;const n=ep(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function Gv(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function ep(t){return t&&"modes"in t&&"defaultMode"in t}function Hd(t){return!Gv(t)&&!ep(t)}function Uv(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=ee.create(0,0));const s=tp(t),a=_l(r),o=Bv({lines:s,position:i,options:a});return Hv({index:0,tokens:o,position:i})}function jv(t,e){const n=_l(e),r=tp(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!a?.exec(i)&&!!o?.exec(s)}function tp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(jm)}const Yd=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,zv=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Bv(t){const e=[];let n=t.position.line,r=t.position.character;for(let i=0;i<t.lines.length;i++){const s=i===0,a=i===t.lines.length-1;let o=t.lines[i],c=0;if(s&&t.options.start){const u=t.options.start?.exec(o);u&&(c=u.index+u[0].length)}else{const u=t.options.line?.exec(o);u&&(c=u.index+u[0].length)}if(a){const u=t.options.end?.exec(o);u&&(o=o.substring(0,u.index))}if(o=o.substring(0,Kv(o)),Kc(o,c)>=o.length){if(e.length>0){const u=ee.create(n,r);e.push({type:"break",content:"",range:Y.create(u,u)})}}else{Yd.lastIndex=c;const u=Yd.exec(o);if(u){const f=u[0],p=u[1],g=ee.create(n,r+c),S=ee.create(n,r+c+f.length);e.push({type:"tag",content:p,range:Y.create(g,S)}),c+=f.length,c=Kc(o,c)}if(c<o.length){const f=o.substring(c),p=Array.from(f.matchAll(zv));e.push(...qv(p,f,n,r+c))}}n++,r=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function qv(t,e,n,r){const i=[];if(t.length===0){const s=ee.create(n,r),a=ee.create(n,r+e.length);i.push({type:"text",content:e,range:Y.create(s,a)})}else{let s=0;for(const o of t){const c=o.index,l=e.substring(s,c);l.length>0&&i.push({type:"text",content:e.substring(s,c),range:Y.create(ee.create(n,s+r),ee.create(n,c+r))});let u=l.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:Y.create(ee.create(n,s+u+r),ee.create(n,s+u+f.length+r))}),u+=f.length,o.length===4){u+=o[2].length;const p=o[3];i.push({type:"text",content:p,range:Y.create(ee.create(n,s+u+r),ee.create(n,s+u+p.length+r))})}else i.push({type:"text",content:"",range:Y.create(ee.create(n,s+u+r),ee.create(n,s+u+r))});s=c+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:Y.create(ee.create(n,s+r),ee.create(n,s+r+a.length))})}return i}const Wv=/\S/,Vv=/\s*$/;function Kc(t,e){const n=t.substring(e).match(Wv);return n?e+n.index:t.length}function Kv(t){const e=t.match(Vv);if(e&&typeof e.index=="number")return e.index}function Hv(t){const e=ee.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Xd([],Y.create(e,e));const n=[];for(;t.index<t.tokens.length;){const s=Yv(t,n[n.length-1]);s&&n.push(s)}const r=n[0]?.range.start??e,i=n[n.length-1]?.range.end??e;return new Xd(n,Y.create(r,i))}function Yv(t,e){const n=t.tokens[t.index];if(n.type==="tag")return rp(t,!1);if(n.type==="text"||n.type==="inline-tag")return np(t);Xv(n,e),t.index++}function Xv(t,e){if(e){const n=new sp("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function np(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(Jv(t)),r=e,e=t.tokens[t.index];return new Hc(i,Y.create(n.range.start,r.range.end))}function Jv(t){return t.tokens[t.index].type==="inline-tag"?rp(t,!0):ip(t)}function rp(t,e){const n=t.tokens[t.index++],r=n.content.substring(1);if(t.tokens[t.index]?.type==="text")if(e){const s=ip(t);return new so(r,new Hc([s],s.range),e,Y.create(n.range.start,s.range.end))}else{const s=np(t);return new so(r,s,e,Y.create(n.range.start,s.range.end))}else{const s=n.range;return new so(r,new Hc([],s),e,s)}}function ip(t){const e=t.tokens[t.index++];return new sp(e.content,e.range)}function _l(t){if(!t)return _l({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:io(e,!0),end:io(n,!1),line:io(r,!0)}}function io(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Aa(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class Xd{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=Jd(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+=Jd(n)+i}return n.trim()}}class so{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}
|
|
152
|
+
${n}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=Qv(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} — ${n}`:this.content.inlines.length>1&&(i=`${i}
|
|
153
|
+
${n}`),this.inline?`{${i}}`:i}}function Qv(t,e,n){if(t==="linkplain"||t==="linkcode"||t==="link"){const r=e.indexOf(" ");let i=e;if(r>0){const a=Kc(e,r);i=e.substring(a),e=e.substring(0,r)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(i=`\`${i}\``),n.renderLink?.(e,i)??Zv(e,i)}}function Zv(t,e){try{return wt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Hc{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
|
|
154
|
+
`)}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+=`
|
|
155
|
+
`)}return n}}class sp{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function Jd(t){return t.endsWith(`
|
|
156
|
+
`)?`
|
|
157
|
+
`:`
|
|
158
|
+
|
|
159
|
+
`}class eE{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&jv(n))return Uv(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){const i=this.findNameInLocalSymbols(e,n)??this.findNameInGlobalScope(e,n);if(i&&i.nameSegment){const s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,n){}findNameInLocalSymbols(e,n){const i=Qt(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(c=>c.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class tE{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return JR(e)?e.$comment:Dm(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}}class nE{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class rE{constructor(){this.previousTokenSource=new Cl,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=DR();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=me.None){const i=new Nl,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){$a(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class iE{constructor(e){this.grammarElementIdMap=new Su,this.tokenTypeIdMap=new Su,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>({...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 Zt(e))n.set(i,{});if(e.$cstNode)for(const i of Eo(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)We(o)?a.push(this.dehydrateAstNode(o,n)):kt(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else We(s)?r[i]=this.dehydrateAstNode(s,n):kt(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return vf(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Ni(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):Rf(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Zt(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Eo(e.$cstNode)){let a;"fullText"in s?(a=new bh(s.fullText),i=a):"content"in s?a=new Al:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)We(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):kt(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else We(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):kt(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Ni(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,c=e.endColumn,l=e.hidden;return new Oc(r,i,{start:{line:s,character:a},end:{line:o,character:c}},n,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Zt(this.grammar))hm(n)&&this.grammarElementIdMap.set(n,e++)}}function kn(t){return{documentation:{CommentProvider:e=>new tE(e),DocumentationProvider:e=>new eE(e)},parser:{AsyncParser:e=>new nE(e),GrammarConfig:e=>lg(e),LangiumParser:e=>ER(e),CompletionParser:e=>vR(e),ValueConverter:()=>new Mh,TokenBuilder:()=>new Dh,Lexer:e=>new Fv(e),ParserErrorMessageProvider:()=>new $h,LexerErrorMessageProvider:()=>new Dv},workspace:{AstNodeLocator:()=>new ov,AstNodeDescriptionProvider:e=>new sv(e),ReferenceDescriptionProvider:e=>new av(e)},references:{Linker:e=>new jR(e),NameProvider:()=>new BR,ScopeProvider:e=>new XR(e),ScopeComputation:e=>new WR(e),References:e=>new qR(e)},serializer:{Hydrator:e=>new iE(e),JsonSerializer:e=>new QR(e)},validation:{DocumentValidator:e=>new nv(e),ValidationRegistry:e=>new ev(e)},shared:()=>t.shared}}function Cn(t){return{ServiceRegistry:e=>new ZR(e),workspace:{LangiumDocuments:e=>new UR(e),LangiumDocumentFactory:e=>new GR(e),DocumentBuilder:e=>new Lv(e),IndexManager:e=>new Ov(e),WorkspaceManager:e=>new xv(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new rE,ConfigurationProvider:e=>new cv(e)},profilers:{}}}var Qd;(function(t){t.merge=(e,n)=>Gi(Gi({},e),n)})(Qd||(Qd={}));function Ve(t,e,n,r,i,s,a,o,c){const l=[t,e,n,r,i,s,a,o,c].reduce(Gi,{});return ap(l)}const sE=Symbol("isProxy");function ap(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===sE?!0:ef(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(ef(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const Zd=Symbol();function ef(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]===Zd)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=Zd;try{t[e]=typeof i=="function"?i(r):ap(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Gi(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!=null)if(typeof r=="object"){const i=t[n];typeof i=="object"&&i!==null?t[n]=Gi(i,r):t[n]=Gi({},r)}else t[n]=r}return t}class aE{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}}const Nn={fileSystemProvider:()=>new aE},oE={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},cE={AstReflection:()=>new Nf};function lE(){const t=Ve(Cn(Nn),cE),e=Ve(kn({shared:t}),oE);return t.ServiceRegistry.register(e),e}function Jn(t){const e=lE(),n=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(n,wt.parse(`memory:/${n.name??"grammar"}.langium`)),n}var uE=Object.defineProperty,_=(t,e)=>uE(t,"name",{value:e,configurable:!0}),Yc;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[[\w ]+\]/}})(Yc||(Yc={}));var Xc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(Xc||(Xc={}));var Jc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Jc||(Jc={}));var Qc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Qc||(Qc={}));var Zc;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Zc||(Zc={}));var el;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(el||(el={}));var tl;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(tl||(tl={}));({...Yc.Terminals,...Xc.Terminals,...Jc.Terminals,...Qc.Terminals,...Zc.Terminals,...el.Terminals,...tl.Terminals});var Kt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function dE(t){return It.isInstance(t,Kt.$type)}_(dE,"isArchitecture");var Es={$type:"Axis",label:"label",name:"name"},Fs={$type:"Branch",name:"name",order:"order"};function fE(t){return It.isInstance(t,Fs.$type)}_(fE,"isBranch");var tf={$type:"Checkout",branch:"branch"},As={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},ao={$type:"ClassDefStatement",className:"className",styleText:"styleText"},mr={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function hE(t){return It.isInstance(t,mr.$type)}_(hE,"isCommit");var Ss={$type:"Curve",entries:"entries",label:"label",name:"name"},ir={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Pt={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},oo={$type:"Entry",axis:"axis",value:"value"},Mn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function pE(t){return It.isInstance(t,Mn.$type)}_(pE,"isGitGraph");var fi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Si={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function mE(t){return It.isInstance(t,Si.$type)}_(mE,"isInfo");var hi={$type:"Item",classSelector:"classSelector",name:"name"},co={$type:"Junction",id:"id",in:"in"},ks={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},gr={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function gE(t){return It.isInstance(t,gr.$type)}_(gE,"isMerge");var lo={$type:"Option",name:"name",value:"value"},yr={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function yE(t){return It.isInstance(t,yr.$type)}_(yE,"isPacket");var Tr={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function TE(t){return It.isInstance(t,Tr.$type)}_(TE,"isPacketBlock");var Fn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function RE(t){return It.isInstance(t,Fn.$type)}_(RE,"isPie");var Gs={$type:"PieSection",label:"label",value:"value"};function vE(t){return It.isInstance(t,Gs.$type)}_(vE,"isPieSection");var Pn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},uo={$type:"Section",classSelector:"classSelector",name:"name"},sr={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},ar={$type:"Statement"},Rr={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function EE(t){return It.isInstance(t,Rr.$type)}_(EE,"isTreemap");var fo={$type:"TreemapRow",indent:"indent",item:"item"},op=class extends Tf{constructor(){super(...arguments),this.types={Architecture:{name:Kt.$type,properties:{accDescr:{name:Kt.accDescr},accTitle:{name:Kt.accTitle},edges:{name:Kt.edges,defaultValue:[]},groups:{name:Kt.groups,defaultValue:[]},junctions:{name:Kt.junctions,defaultValue:[]},services:{name:Kt.services,defaultValue:[]},title:{name:Kt.title}},superTypes:[]},Axis:{name:Es.$type,properties:{label:{name:Es.label},name:{name:Es.name}},superTypes:[]},Branch:{name:Fs.$type,properties:{name:{name:Fs.name},order:{name:Fs.order}},superTypes:[ar.$type]},Checkout:{name:tf.$type,properties:{branch:{name:tf.branch}},superTypes:[ar.$type]},CherryPicking:{name:As.$type,properties:{id:{name:As.id},parent:{name:As.parent},tags:{name:As.tags,defaultValue:[]}},superTypes:[ar.$type]},ClassDefStatement:{name:ao.$type,properties:{className:{name:ao.className},styleText:{name:ao.styleText}},superTypes:[]},Commit:{name:mr.$type,properties:{id:{name:mr.id},message:{name:mr.message},tags:{name:mr.tags,defaultValue:[]},type:{name:mr.type}},superTypes:[ar.$type]},Curve:{name:Ss.$type,properties:{entries:{name:Ss.entries,defaultValue:[]},label:{name:Ss.label},name:{name:Ss.name}},superTypes:[]},Direction:{name:ir.$type,properties:{accDescr:{name:ir.accDescr},accTitle:{name:ir.accTitle},dir:{name:ir.dir},statements:{name:ir.statements,defaultValue:[]},title:{name:ir.title}},superTypes:[Mn.$type]},Edge:{name:Pt.$type,properties:{lhsDir:{name:Pt.lhsDir},lhsGroup:{name:Pt.lhsGroup,defaultValue:!1},lhsId:{name:Pt.lhsId},lhsInto:{name:Pt.lhsInto,defaultValue:!1},rhsDir:{name:Pt.rhsDir},rhsGroup:{name:Pt.rhsGroup,defaultValue:!1},rhsId:{name:Pt.rhsId},rhsInto:{name:Pt.rhsInto,defaultValue:!1},title:{name:Pt.title}},superTypes:[]},Entry:{name:oo.$type,properties:{axis:{name:oo.axis,referenceType:Es.$type},value:{name:oo.value}},superTypes:[]},GitGraph:{name:Mn.$type,properties:{accDescr:{name:Mn.accDescr},accTitle:{name:Mn.accTitle},statements:{name:Mn.statements,defaultValue:[]},title:{name:Mn.title}},superTypes:[]},Group:{name:fi.$type,properties:{icon:{name:fi.icon},id:{name:fi.id},in:{name:fi.in},title:{name:fi.title}},superTypes:[]},Info:{name:Si.$type,properties:{accDescr:{name:Si.accDescr},accTitle:{name:Si.accTitle},title:{name:Si.title}},superTypes:[]},Item:{name:hi.$type,properties:{classSelector:{name:hi.classSelector},name:{name:hi.name}},superTypes:[]},Junction:{name:co.$type,properties:{id:{name:co.id},in:{name:co.in}},superTypes:[]},Leaf:{name:ks.$type,properties:{classSelector:{name:ks.classSelector},name:{name:ks.name},value:{name:ks.value}},superTypes:[hi.$type]},Merge:{name:gr.$type,properties:{branch:{name:gr.branch},id:{name:gr.id},tags:{name:gr.tags,defaultValue:[]},type:{name:gr.type}},superTypes:[ar.$type]},Option:{name:lo.$type,properties:{name:{name:lo.name},value:{name:lo.value,defaultValue:!1}},superTypes:[]},Packet:{name:yr.$type,properties:{accDescr:{name:yr.accDescr},accTitle:{name:yr.accTitle},blocks:{name:yr.blocks,defaultValue:[]},title:{name:yr.title}},superTypes:[]},PacketBlock:{name:Tr.$type,properties:{bits:{name:Tr.bits},end:{name:Tr.end},label:{name:Tr.label},start:{name:Tr.start}},superTypes:[]},Pie:{name:Fn.$type,properties:{accDescr:{name:Fn.accDescr},accTitle:{name:Fn.accTitle},sections:{name:Fn.sections,defaultValue:[]},showData:{name:Fn.showData,defaultValue:!1},title:{name:Fn.title}},superTypes:[]},PieSection:{name:Gs.$type,properties:{label:{name:Gs.label},value:{name:Gs.value}},superTypes:[]},Radar:{name:Pn.$type,properties:{accDescr:{name:Pn.accDescr},accTitle:{name:Pn.accTitle},axes:{name:Pn.axes,defaultValue:[]},curves:{name:Pn.curves,defaultValue:[]},options:{name:Pn.options,defaultValue:[]},title:{name:Pn.title}},superTypes:[]},Section:{name:uo.$type,properties:{classSelector:{name:uo.classSelector},name:{name:uo.name}},superTypes:[hi.$type]},Service:{name:sr.$type,properties:{icon:{name:sr.icon},iconText:{name:sr.iconText},id:{name:sr.id},in:{name:sr.in},title:{name:sr.title}},superTypes:[]},Statement:{name:ar.$type,properties:{},superTypes:[]},Treemap:{name:Rr.$type,properties:{accDescr:{name:Rr.accDescr},accTitle:{name:Rr.accTitle},title:{name:Rr.title},TreemapRows:{name:Rr.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:fo.$type,properties:{indent:{name:fo.indent},item:{name:fo.item}},superTypes:[]}}}static{_(this,"MermaidAstReflection")}},It=new op,nf,AE=_(()=>nf??(nf=Jn(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),rf,SE=_(()=>rf??(rf=Jn(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),sf,kE=_(()=>sf??(sf=Jn(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),af,CE=_(()=>af??(af=Jn(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),of,NE=_(()=>of??(of=Jn(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),cf,wE=_(()=>cf??(cf=Jn(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),lf,bE=_(()=>lf??(lf=Jn(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),_E={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},IE={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$E={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},PE={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},LE={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},OE={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xE={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Qn={AstReflection:_(()=>new op,"AstReflection")},DE={Grammar:_(()=>AE(),"Grammar"),LanguageMetaData:_(()=>_E,"LanguageMetaData"),parser:{}},ME={Grammar:_(()=>SE(),"Grammar"),LanguageMetaData:_(()=>IE,"LanguageMetaData"),parser:{}},FE={Grammar:_(()=>kE(),"Grammar"),LanguageMetaData:_(()=>$E,"LanguageMetaData"),parser:{}},GE={Grammar:_(()=>CE(),"Grammar"),LanguageMetaData:_(()=>PE,"LanguageMetaData"),parser:{}},UE={Grammar:_(()=>NE(),"Grammar"),LanguageMetaData:_(()=>LE,"LanguageMetaData"),parser:{}},jE={Grammar:_(()=>wE(),"Grammar"),LanguageMetaData:_(()=>OE,"LanguageMetaData"),parser:{}},zE={Grammar:_(()=>bE(),"Grammar"),LanguageMetaData:_(()=>xE,"LanguageMetaData"),parser:{}},BE=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,qE=/accTitle[\t ]*:([^\n\r]*)/,WE=/title([\t ][^\n\r]*|)/,VE={ACC_DESCR:BE,ACC_TITLE:qE,TITLE:WE},za=class extends Mh{static{_(this,"AbstractMermaidValueConverter")}runConverter(t,e,n){let r=this.runCommonConverter(t,e,n);return r===void 0&&(r=this.runCustomConverter(t,e,n)),r===void 0?super.runConverter(t,e,n):r}runCommonConverter(t,e,n){const r=VE[t.name];if(r===void 0)return;const i=r.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
160
|
+
`)}}},Ba=class extends za{static{_(this,"CommonValueConverter")}runCustomConverter(t,e,n){}},wn=class extends Dh{static{_(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,n){const r=super.buildKeywordTokens(t,e,n);return r.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),r}};(class extends wn{static{_(this,"CommonTokenBuilder")}});var KE=class extends wn{static{_(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},cp={parser:{TokenBuilder:_(()=>new KE,"TokenBuilder"),ValueConverter:_(()=>new Ba,"ValueConverter")}};function lp(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),ME,cp);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}_(lp,"createGitGraphServices");var HE=class extends wn{static{_(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},up={parser:{TokenBuilder:_(()=>new HE,"TokenBuilder"),ValueConverter:_(()=>new Ba,"ValueConverter")}};function dp(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),FE,up);return e.ServiceRegistry.register(n),{shared:e,Info:n}}_(dp,"createInfoServices");var YE=class extends wn{static{_(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},fp={parser:{TokenBuilder:_(()=>new YE,"TokenBuilder"),ValueConverter:_(()=>new Ba,"ValueConverter")}};function hp(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),GE,fp);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}_(hp,"createPacketServices");var XE=class extends wn{static{_(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},JE=class extends za{static{_(this,"PieValueConverter")}runCustomConverter(t,e,n){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},pp={parser:{TokenBuilder:_(()=>new XE,"TokenBuilder"),ValueConverter:_(()=>new JE,"ValueConverter")}};function mp(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),UE,pp);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}_(mp,"createPieServices");var QE=class extends wn{static{_(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},ZE=class extends za{static{_(this,"ArchitectureValueConverter")}runCustomConverter(t,e,n){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},gp={parser:{TokenBuilder:_(()=>new QE,"TokenBuilder"),ValueConverter:_(()=>new ZE,"ValueConverter")}};function yp(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),DE,gp);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}_(yp,"createArchitectureServices");var eA=class extends wn{static{_(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Tp={parser:{TokenBuilder:_(()=>new eA,"TokenBuilder"),ValueConverter:_(()=>new Ba,"ValueConverter")}};function Rp(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),jE,Tp);return e.ServiceRegistry.register(n),{shared:e,Radar:n}}_(Rp,"createRadarServices");var tA=class extends wn{static{_(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},nA=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,rA=class extends za{static{_(this,"TreemapValueConverter")}runCustomConverter(t,e,n){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR")return e.substring(1,e.length-1);if(t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;const r=nA.exec(e);if(r)return{$type:"ClassDefStatement",className:r[1],styleText:r[2]||void 0}}}};function vp(t){const e=t.validation.TreemapValidator,n=t.validation.ValidationRegistry;if(n){const r={Treemap:e.checkSingleRoot.bind(e)};n.register(r,e)}}_(vp,"registerValidationChecks");var iA=class{static{_(this,"TreemapValidator")}checkSingleRoot(t,e){let n;for(const r of t.TreemapRows)r.item&&(n===void 0&&r.indent===void 0?n=0:r.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}):n!==void 0&&n>=parseInt(r.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}))}},Ep={parser:{TokenBuilder:_(()=>new tA,"TokenBuilder"),ValueConverter:_(()=>new rA,"ValueConverter")},validation:{TreemapValidator:_(()=>new iA,"TreemapValidator")}};function Ap(t=Nn){const e=Ve(Cn(t),Qn),n=Ve(kn({shared:e}),zE,Ep);return e.ServiceRegistry.register(n),vp(n),{shared:e,Treemap:n}}_(Ap,"createTreemapServices");var Yt={},sA={info:_(async()=>{const{createInfoServices:t}=await _n(async()=>{const{createInfoServices:n}=await Promise.resolve().then(()=>cA);return{createInfoServices:n}},void 0),e=t().Info.parser.LangiumParser;Yt.info=e},"info"),packet:_(async()=>{const{createPacketServices:t}=await _n(async()=>{const{createPacketServices:n}=await Promise.resolve().then(()=>lA);return{createPacketServices:n}},void 0),e=t().Packet.parser.LangiumParser;Yt.packet=e},"packet"),pie:_(async()=>{const{createPieServices:t}=await _n(async()=>{const{createPieServices:n}=await Promise.resolve().then(()=>uA);return{createPieServices:n}},void 0),e=t().Pie.parser.LangiumParser;Yt.pie=e},"pie"),architecture:_(async()=>{const{createArchitectureServices:t}=await _n(async()=>{const{createArchitectureServices:n}=await Promise.resolve().then(()=>dA);return{createArchitectureServices:n}},void 0),e=t().Architecture.parser.LangiumParser;Yt.architecture=e},"architecture"),gitGraph:_(async()=>{const{createGitGraphServices:t}=await _n(async()=>{const{createGitGraphServices:n}=await Promise.resolve().then(()=>fA);return{createGitGraphServices:n}},void 0),e=t().GitGraph.parser.LangiumParser;Yt.gitGraph=e},"gitGraph"),radar:_(async()=>{const{createRadarServices:t}=await _n(async()=>{const{createRadarServices:n}=await Promise.resolve().then(()=>hA);return{createRadarServices:n}},void 0),e=t().Radar.parser.LangiumParser;Yt.radar=e},"radar"),treemap:_(async()=>{const{createTreemapServices:t}=await _n(async()=>{const{createTreemapServices:n}=await Promise.resolve().then(()=>pA);return{createTreemapServices:n}},void 0),e=t().Treemap.parser.LangiumParser;Yt.treemap=e},"treemap")};async function aA(t,e){const n=sA[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);Yt[t]||await n();const i=Yt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new oA(i);return i.value}_(aA,"parse");var oA=class extends Error{constructor(t){const e=t.lexerErrors.map(r=>r.message).join(`
|
|
161
|
+
`),n=t.parserErrors.map(r=>r.message).join(`
|
|
162
|
+
`);super(`Parsing failed: ${e} ${n}`),this.result=t}static{_(this,"MermaidParseError")}};const cA=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:up,createInfoServices:dp},Symbol.toStringTag,{value:"Module"})),lA=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:fp,createPacketServices:hp},Symbol.toStringTag,{value:"Module"})),uA=Object.freeze(Object.defineProperty({__proto__:null,PieModule:pp,createPieServices:mp},Symbol.toStringTag,{value:"Module"})),dA=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:gp,createArchitectureServices:yp},Symbol.toStringTag,{value:"Module"})),fA=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:cp,createGitGraphServices:lp},Symbol.toStringTag,{value:"Module"})),hA=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Tp,createRadarServices:Rp},Symbol.toStringTag,{value:"Module"})),pA=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Ep,createTreemapServices:Ap},Symbol.toStringTag,{value:"Module"}));export{aA as p};
|