From a6d3cb05fc8056fb85f78f65fc1c71ef8370ec4c Mon Sep 17 00:00:00 2001 From: Paul Abumov Date: Mon, 2 Dec 2024 14:02:34 -0500 Subject: [PATCH] Ported core packages and examples to Typecript --- .github/workflows/annotated-pkgs.yml | 9 +- .../workflows/cypress-end-to-end-tests.yml | 77 ++- .github/workflows/deploy-docs.yml | 4 +- .github/workflows/npm-check.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/python-test.yml | 2 +- .github/workflows/test-deploy-docs.yml | 4 +- .github/workflows/version-sync.yml | 2 +- .yarn/releases/yarn-3.2.4.cjs | 17 +- .yarnrc.yml | 2 + .../webapp/package-lock.json | 288 +++++----- .../form_composer_demo/webapp/package.json | 9 +- .../src/{app_dynamic.jsx => app_dynamic.tsx} | 13 +- .../src/app_dynamic_remote_procedure.tsx} | 18 +- .../src/{app_simple.jsx => app_simple.tsx} | 119 ++-- ...re.jsx => app_simple_remote_procedure.tsx} | 16 +- ...ynamic.jsx => core_components_dynamic.tsx} | 25 +- ...e_components_dynamic_remote_procedure.tsx} | 42 +- ..._simple.jsx => core_components_simple.tsx} | 38 +- ...re_components_simple_remote_procedure.tsx} | 32 +- .../webapp/src/main_dynamic.js | 11 - ...ic_remote_procedure.js => main_dynamic.ts} | 10 +- .../src/main_dynamic_remote_procedure.ts | 23 + .../src/{main_simple.js => main_simple.ts} | 2 +- .../src/main_simple_remote_procedure.js | 10 - .../src/main_simple_remote_procedure.ts} | 2 +- .../webapp/src/review_dynamic.js | 10 - .../{review_simple.js => review_dynamic.ts} | 2 +- .../webapp/src/review_simple.ts} | 2 +- .../webapp/src/reviewapp_dynamic.jsx | 62 -- .../webapp/src/reviewapp_dynamic.tsx | 17 + .../webapp/src/reviewapp_simple.jsx | 62 -- .../webapp/src/reviewapp_simple.tsx | 17 + .../form_composer_demo/webapp/tsconfig.json | 27 + .../webapp/webpack.config.js | 14 +- .../webapp/webpack.config.remote_procedure.js | 14 +- .../webapp/webpack.config.review.js | 14 +- .../webapp/src/reviewapp.jsx | 56 +- .../webapp/package-lock.json | 299 +++++----- .../webapp/package.json | 9 +- .../webapp/src/app_remote_procedure.tsx} | 19 +- ...x => core_components_remote_procedure.tsx} | 41 +- ..._procedure.js => main_remote_procedure.ts} | 8 +- .../webapp/src/{review.js => review.ts} | 2 +- .../webapp/src/reviewapp.jsx | 62 -- .../webapp/src/reviewapp.tsx | 17 + .../webapp/tsconfig.json | 25 + .../webapp/webpack.config.remote_procedure.js | 12 +- .../webapp/webpack.config.review.js | 12 +- .../mnist/webapp/src/reviewapp.jsx | 55 +- .../webapp/src/reviewapp.jsx | 54 +- .../webapp/package-lock.json | 288 +++++----- .../video_annotator_demo/webapp/package.json | 9 +- .../src/{app_dynamic.jsx => app_dynamic.tsx} | 11 +- .../src/{app_simple.jsx => app_simple.tsx} | 98 +--- ...ynamic.jsx => core_components_dynamic.tsx} | 29 +- ..._simple.jsx => core_components_simple.tsx} | 29 +- .../webapp/src/main_dynamic.js | 11 - .../webapp/src/main_dynamic.ts | 23 + .../src/{main_simple.js => main_simple.ts} | 2 +- .../webapp/src/review_dynamic.ts | 10 + .../webapp/src/review_simple.ts | 10 + .../webapp/src/reviewapp_dynamic.jsx | 62 -- .../webapp/src/reviewapp_dynamic.tsx | 15 + .../webapp/src/reviewapp_simple.jsx | 62 -- .../webapp/src/reviewapp_simple.tsx | 15 + .../video_annotator_demo/webapp/tsconfig.json | 27 + .../webapp/webpack.config.js | 14 +- .../webapp/webpack.config.review.js | 14 +- .../providers/inhouse/wrap_crowd_source.js | 6 +- .../form_composer/webapp/package-lock.json | 237 ++++---- .../form_composer/webapp/package.json | 9 +- .../webapp/src/{app.jsx => app.tsx} | 88 +-- ...ore_components.jsx => core_components.tsx} | 48 +- .../webapp/src/main.ts} | 8 +- .../webapp/src/{review.js => review.ts} | 2 +- .../form_composer/webapp/src/reviewapp.tsx | 15 + .../form_composer/webapp/tsconfig.json | 25 + .../form_composer/webapp/webpack.config.js | 12 +- .../webapp/webpack.config.review.js | 12 +- .../config_validation_constants.py | 4 + .../generators_utils/remote_procedures.py | 24 +- .../video_annotator/webapp/package-lock.json | 299 +++++----- .../video_annotator/webapp/package.json | 9 +- .../webapp/src/{app.jsx => app.tsx} | 86 +-- ...ore_components.jsx => core_components.tsx} | 56 +- .../webapp/src/main.ts} | 8 +- .../webapp/src/{review.js => review.ts} | 2 +- .../video_annotator/webapp/src/reviewapp.jsx | 60 -- .../video_annotator/webapp/src/reviewapp.tsx | 15 + .../video_annotator/webapp/tsconfig.json | 25 + .../video_annotator/webapp/webpack.config.js | 12 +- .../webapp/webpack.config.review.js | 12 +- mephisto/review_app/client/package-lock.json | 303 +++++----- mephisto/review_app/client/package.json | 13 +- mephisto/review_app/client/tsconfig.json | 2 +- mephisto/scripts/tests/react_apps.py | 4 + mephisto/tools/building_react_apps/main.py | 23 + mephisto/tools/building_react_apps/utils.py | 16 + packages/mephisto-addons/build/bundle.js | 2 +- .../build/bundle.js.LICENSE.txt | 30 +- packages/mephisto-addons/package.json | 8 +- .../src/FormComposer/{Field.jsx => Field.tsx} | 63 ++- .../{FieldSet.jsx => FieldSet.tsx} | 15 +- .../src/FormComposer/FormComposer.jsx | 476 ---------------- .../src/FormComposer/FormComposer.tsx | 535 ++++++++++++++++++ .../{FormErrors.jsx => FormErrors.tsx} | 10 +- ...ormHeaderBlock.jsx => FormHeaderBlock.tsx} | 14 +- .../src/FormComposer/{Row.jsx => Row.tsx} | 18 +- .../FormComposer/{Section.jsx => Section.tsx} | 42 +- .../{SectionErrors.jsx => SectionErrors.tsx} | 26 +- .../FormComposer/SectionErrorsCountBadge.jsx | 31 - .../FormComposer/SectionErrorsCountBadge.tsx | 39 ++ ...tButtonBlock.jsx => SubmitButtonBlock.tsx} | 13 +- .../{constants.js => constants.ts} | 26 +- .../{ButtonField.jsx => ButtonField.tsx} | 41 +- .../{CheckboxField.jsx => CheckboxField.tsx} | 59 +- .../fields/{Errors.jsx => Errors.tsx} | 11 +- .../fields/{FileField.jsx => FileField.tsx} | 60 +- .../{HiddenField.jsx => HiddenField.tsx} | 24 +- .../fields/{InputField.jsx => InputField.tsx} | 45 +- .../fields/{RadioField.jsx => RadioField.tsx} | 42 +- .../{SelectField.jsx => SelectField.tsx} | 81 ++- .../{TextareaField.jsx => TextareaField.tsx} | 46 +- .../src/FormComposer/fields/index.js | 8 - .../src/FormComposer/fields/index.ts | 8 + .../src/FormComposer/{utils.js => utils.ts} | 430 ++++++++------ .../{errorMessages.js => errorMessages.ts} | 18 +- .../src/FormComposer/validation/helpers.js | 166 ------ .../src/FormComposer/validation/helpers.ts | 169 ++++++ ...{validatorLookup.js => validatorLookup.ts} | 2 +- ...{fieldIsRequired.js => fieldIsRequired.ts} | 20 +- .../validators/fileExtensionSatisfied.js | 46 -- .../validators/fileExtensionSatisfied.ts | 47 ++ .../validators/maxLengthSatisfied.js | 56 -- .../validators/maxLengthSatisfied.ts | 61 ++ .../validators/minLengthSatisfied.js | 56 -- .../validators/minLengthSatisfied.ts | 61 ++ ...{regexpSatisfied.js => regexpSatisfied.ts} | 20 +- ...onButton.jsx => TaskInstructionButton.tsx} | 10 +- ...tionModal.jsx => TaskInstructionModal.tsx} | 25 +- ...nnotationTrack.jsx => AnnotationTrack.tsx} | 250 +++++--- .../src/VideoAnnotator/AnnotationTracks.jsx | 141 ----- .../src/VideoAnnotator/AnnotationTracks.tsx | 173 ++++++ .../{TrackSegment.jsx => TrackSegment.tsx} | 58 +- ...gmentMobile.jsx => TrackSegmentMobile.tsx} | 18 +- ...{VideoAnnotator.jsx => VideoAnnotator.tsx} | 140 +++-- .../{VideoPlayer.jsx => VideoPlayer.tsx} | 76 ++- .../{constants.js => constants.ts} | 35 +- .../src/VideoAnnotator/helpers.js | 58 -- .../src/VideoAnnotator/helpers.ts | 66 +++ .../src/VideoAnnotator/utils.js | 202 ------- .../src/VideoAnnotator/utils.ts | 237 ++++++++ .../{Question.jsx => Question.tsx} | 28 +- .../{Reducers.js => Reducers.ts} | 5 +- .../{SubmitButton.jsx => SubmitButton.tsx} | 22 +- .../{TextArea.jsx => TextArea.tsx} | 25 +- .../{WorkerOpinion.jsx => WorkerOpinion.tsx} | 67 ++- .../{Functions.js => helpers.ts} | 149 ++--- .../mephisto-addons/src/apps/ReviewApp.tsx | 27 +- .../src/constants/{files.js => files.ts} | 2 +- .../src/constants/{index.js => index.ts} | 0 .../src/constants/localStorage.ts | 7 + .../mephisto-addons/src/helpers/format.js | 25 - .../mephisto-addons/src/helpers/format.ts | 61 ++ .../src/helpers/{index.js => index.ts} | 0 .../src/{index.jsx => index.ts} | 18 +- .../mephisto-addons/src/pages/WelcomePage.tsx | 64 +++ .../mephisto-addons/src/types/common.d.ts | 20 + .../src/types/formComposer.d.ts | 193 +++++++ .../mephisto-addons/src/types/reviewApp.d.ts | 12 + .../src/types/videoAnotator.d.ts | 51 ++ .../src/types/workerOpinion.d.ts | 47 ++ packages/mephisto-addons/tsconfig.json | 22 + packages/mephisto-addons/webpack.config.js | 12 +- packages/mephisto-core/build/bundle.js | 2 +- packages/mephisto-core/package.json | 1 + packages/mephisto-core/src/utils.js | 10 + .../test_remote_procedures.py | 4 +- test/utils/test_db.py | 3 +- yarn.lock | 168 +++++- 181 files changed, 5342 insertions(+), 3972 deletions(-) rename examples/form_composer_demo/webapp/src/{app_dynamic.jsx => app_dynamic.tsx} (73%) rename examples/{remote_procedure/interactive_image_generation/webapp/src/app_remote_procedure.jsx => form_composer_demo/webapp/src/app_dynamic_remote_procedure.tsx} (70%) rename examples/form_composer_demo/webapp/src/{app_simple.jsx => app_simple.tsx} (57%) rename examples/form_composer_demo/webapp/src/{app_dynamic_remote_procedure.jsx => app_simple_remote_procedure.tsx} (70%) rename examples/form_composer_demo/webapp/src/components/{core_components_dynamic.jsx => core_components_dynamic.tsx} (74%) rename examples/form_composer_demo/webapp/src/components/{core_components_dynamic_remote_procedure.jsx => core_components_dynamic_remote_procedure.tsx} (77%) rename examples/form_composer_demo/webapp/src/components/{core_components_simple.jsx => core_components_simple.tsx} (76%) rename examples/form_composer_demo/webapp/src/components/{core_components_simple_remote_procedure.jsx => core_components_simple_remote_procedure.tsx} (82%) delete mode 100644 examples/form_composer_demo/webapp/src/main_dynamic.js rename examples/form_composer_demo/webapp/src/{main_dynamic_remote_procedure.js => main_dynamic.ts} (74%) create mode 100644 examples/form_composer_demo/webapp/src/main_dynamic_remote_procedure.ts rename examples/form_composer_demo/webapp/src/{main_simple.js => main_simple.ts} (93%) delete mode 100644 examples/form_composer_demo/webapp/src/main_simple_remote_procedure.js rename examples/{video_annotator_demo/webapp/src/review_dynamic.js => form_composer_demo/webapp/src/main_simple_remote_procedure.ts} (88%) delete mode 100644 examples/form_composer_demo/webapp/src/review_dynamic.js rename examples/form_composer_demo/webapp/src/{review_simple.js => review_dynamic.ts} (90%) rename examples/{video_annotator_demo/webapp/src/review_simple.js => form_composer_demo/webapp/src/review_simple.ts} (90%) delete mode 100644 examples/form_composer_demo/webapp/src/reviewapp_dynamic.jsx create mode 100644 examples/form_composer_demo/webapp/src/reviewapp_dynamic.tsx delete mode 100644 examples/form_composer_demo/webapp/src/reviewapp_simple.jsx create mode 100644 examples/form_composer_demo/webapp/src/reviewapp_simple.tsx create mode 100644 examples/form_composer_demo/webapp/tsconfig.json rename examples/{form_composer_demo/webapp/src/app_simple_remote_procedure.jsx => remote_procedure/interactive_image_generation/webapp/src/app_remote_procedure.tsx} (65%) rename examples/remote_procedure/interactive_image_generation/webapp/src/components/{core_components_remote_procedure.jsx => core_components_remote_procedure.tsx} (78%) rename examples/remote_procedure/interactive_image_generation/webapp/src/{main_remote_procedure.js => main_remote_procedure.ts} (73%) rename examples/remote_procedure/interactive_image_generation/webapp/src/{review.js => review.ts} (92%) delete mode 100644 examples/remote_procedure/interactive_image_generation/webapp/src/reviewapp.jsx create mode 100644 examples/remote_procedure/interactive_image_generation/webapp/src/reviewapp.tsx create mode 100644 examples/remote_procedure/interactive_image_generation/webapp/tsconfig.json rename examples/video_annotator_demo/webapp/src/{app_dynamic.jsx => app_dynamic.tsx} (78%) rename examples/video_annotator_demo/webapp/src/{app_simple.jsx => app_simple.tsx} (51%) rename examples/video_annotator_demo/webapp/src/components/{core_components_dynamic.jsx => core_components_dynamic.tsx} (69%) rename examples/video_annotator_demo/webapp/src/components/{core_components_simple.jsx => core_components_simple.tsx} (65%) delete mode 100644 examples/video_annotator_demo/webapp/src/main_dynamic.js create mode 100644 examples/video_annotator_demo/webapp/src/main_dynamic.ts rename examples/video_annotator_demo/webapp/src/{main_simple.js => main_simple.ts} (93%) create mode 100644 examples/video_annotator_demo/webapp/src/review_dynamic.ts create mode 100644 examples/video_annotator_demo/webapp/src/review_simple.ts delete mode 100644 examples/video_annotator_demo/webapp/src/reviewapp_dynamic.jsx create mode 100644 examples/video_annotator_demo/webapp/src/reviewapp_dynamic.tsx delete mode 100644 examples/video_annotator_demo/webapp/src/reviewapp_simple.jsx create mode 100644 examples/video_annotator_demo/webapp/src/reviewapp_simple.tsx create mode 100644 examples/video_annotator_demo/webapp/tsconfig.json rename mephisto/generators/form_composer/webapp/src/{app.jsx => app.tsx} (51%) rename mephisto/generators/form_composer/webapp/src/components/{core_components.jsx => core_components.tsx} (74%) rename mephisto/generators/{video_annotator/webapp/src/main.js => form_composer/webapp/src/main.ts} (76%) rename mephisto/generators/form_composer/webapp/src/{review.js => review.ts} (92%) create mode 100644 mephisto/generators/form_composer/webapp/src/reviewapp.tsx create mode 100644 mephisto/generators/form_composer/webapp/tsconfig.json rename mephisto/generators/video_annotator/webapp/src/{app.jsx => app.tsx} (52%) rename mephisto/generators/video_annotator/webapp/src/components/{core_components.jsx => core_components.tsx} (71%) rename mephisto/generators/{form_composer/webapp/src/main.js => video_annotator/webapp/src/main.ts} (76%) rename mephisto/generators/video_annotator/webapp/src/{review.js => review.ts} (92%) delete mode 100644 mephisto/generators/video_annotator/webapp/src/reviewapp.jsx create mode 100644 mephisto/generators/video_annotator/webapp/src/reviewapp.tsx create mode 100644 mephisto/generators/video_annotator/webapp/tsconfig.json create mode 100644 mephisto/tools/building_react_apps/main.py rename packages/mephisto-addons/src/FormComposer/{Field.jsx => Field.tsx} (77%) rename packages/mephisto-addons/src/FormComposer/{FieldSet.jsx => FieldSet.tsx} (75%) delete mode 100644 packages/mephisto-addons/src/FormComposer/FormComposer.jsx create mode 100644 packages/mephisto-addons/src/FormComposer/FormComposer.tsx rename packages/mephisto-addons/src/FormComposer/{FormErrors.jsx => FormErrors.tsx} (73%) rename packages/mephisto-addons/src/FormComposer/{FormHeaderBlock.jsx => FormHeaderBlock.tsx} (85%) rename packages/mephisto-addons/src/FormComposer/{Row.jsx => Row.tsx} (56%) rename packages/mephisto-addons/src/FormComposer/{Section.jsx => Section.tsx} (76%) rename packages/mephisto-addons/src/FormComposer/{SectionErrors.jsx => SectionErrors.tsx} (64%) delete mode 100644 packages/mephisto-addons/src/FormComposer/SectionErrorsCountBadge.jsx create mode 100644 packages/mephisto-addons/src/FormComposer/SectionErrorsCountBadge.tsx rename packages/mephisto-addons/src/FormComposer/{SubmitButtonBlock.jsx => SubmitButtonBlock.tsx} (87%) rename packages/mephisto-addons/src/FormComposer/{constants.js => constants.ts} (54%) rename packages/mephisto-addons/src/FormComposer/fields/{ButtonField.jsx => ButtonField.tsx} (68%) rename packages/mephisto-addons/src/FormComposer/fields/{CheckboxField.jsx => CheckboxField.tsx} (63%) rename packages/mephisto-addons/src/FormComposer/fields/{Errors.jsx => Errors.tsx} (67%) rename packages/mephisto-addons/src/FormComposer/fields/{FileField.jsx => FileField.tsx} (75%) rename packages/mephisto-addons/src/FormComposer/fields/{HiddenField.jsx => HiddenField.tsx} (57%) rename packages/mephisto-addons/src/FormComposer/fields/{InputField.jsx => InputField.tsx} (68%) rename packages/mephisto-addons/src/FormComposer/fields/{RadioField.jsx => RadioField.tsx} (67%) rename packages/mephisto-addons/src/FormComposer/fields/{SelectField.jsx => SelectField.tsx} (62%) rename packages/mephisto-addons/src/FormComposer/fields/{TextareaField.jsx => TextareaField.tsx} (67%) delete mode 100644 packages/mephisto-addons/src/FormComposer/fields/index.js create mode 100644 packages/mephisto-addons/src/FormComposer/fields/index.ts rename packages/mephisto-addons/src/FormComposer/{utils.js => utils.ts} (59%) rename packages/mephisto-addons/src/FormComposer/validation/{errorMessages.js => errorMessages.ts} (58%) delete mode 100644 packages/mephisto-addons/src/FormComposer/validation/helpers.js create mode 100644 packages/mephisto-addons/src/FormComposer/validation/helpers.ts rename packages/mephisto-addons/src/FormComposer/validation/{validatorLookup.js => validatorLookup.ts} (90%) rename packages/mephisto-addons/src/FormComposer/validation/validators/{fieldIsRequired.js => fieldIsRequired.ts} (63%) delete mode 100644 packages/mephisto-addons/src/FormComposer/validation/validators/fileExtensionSatisfied.js create mode 100644 packages/mephisto-addons/src/FormComposer/validation/validators/fileExtensionSatisfied.ts delete mode 100644 packages/mephisto-addons/src/FormComposer/validation/validators/maxLengthSatisfied.js create mode 100644 packages/mephisto-addons/src/FormComposer/validation/validators/maxLengthSatisfied.ts delete mode 100644 packages/mephisto-addons/src/FormComposer/validation/validators/minLengthSatisfied.js create mode 100644 packages/mephisto-addons/src/FormComposer/validation/validators/minLengthSatisfied.ts rename packages/mephisto-addons/src/FormComposer/validation/validators/{regexpSatisfied.js => regexpSatisfied.ts} (56%) rename packages/mephisto-addons/src/TaskInstructionModal/{TaskInstructionButton.jsx => TaskInstructionButton.tsx} (72%) rename packages/mephisto-addons/src/TaskInstructionModal/{TaskInstructionModal.jsx => TaskInstructionModal.tsx} (82%) rename packages/mephisto-addons/src/VideoAnnotator/{AnnotationTrack.jsx => AnnotationTrack.tsx} (73%) delete mode 100644 packages/mephisto-addons/src/VideoAnnotator/AnnotationTracks.jsx create mode 100644 packages/mephisto-addons/src/VideoAnnotator/AnnotationTracks.tsx rename packages/mephisto-addons/src/VideoAnnotator/{TrackSegment.jsx => TrackSegment.tsx} (63%) rename packages/mephisto-addons/src/VideoAnnotator/{TrackSegmentMobile.jsx => TrackSegmentMobile.tsx} (69%) rename packages/mephisto-addons/src/VideoAnnotator/{VideoAnnotator.jsx => VideoAnnotator.tsx} (74%) rename packages/mephisto-addons/src/VideoAnnotator/{VideoPlayer.jsx => VideoPlayer.tsx} (60%) rename packages/mephisto-addons/src/VideoAnnotator/{constants.js => constants.ts} (53%) delete mode 100644 packages/mephisto-addons/src/VideoAnnotator/helpers.js create mode 100644 packages/mephisto-addons/src/VideoAnnotator/helpers.ts delete mode 100644 packages/mephisto-addons/src/VideoAnnotator/utils.js create mode 100644 packages/mephisto-addons/src/VideoAnnotator/utils.ts rename packages/mephisto-addons/src/WorkerOpinion/{Question.jsx => Question.tsx} (67%) rename packages/mephisto-addons/src/WorkerOpinion/{Reducers.js => Reducers.ts} (94%) rename packages/mephisto-addons/src/WorkerOpinion/{SubmitButton.jsx => SubmitButton.tsx} (68%) rename packages/mephisto-addons/src/WorkerOpinion/{TextArea.jsx => TextArea.tsx} (75%) rename packages/mephisto-addons/src/WorkerOpinion/{WorkerOpinion.jsx => WorkerOpinion.tsx} (80%) rename packages/mephisto-addons/src/WorkerOpinion/{Functions.js => helpers.ts} (63%) rename mephisto/generators/form_composer/webapp/src/reviewapp.jsx => packages/mephisto-addons/src/apps/ReviewApp.tsx (68%) rename packages/mephisto-addons/src/constants/{files.js => files.ts} (84%) rename packages/mephisto-addons/src/constants/{index.js => index.ts} (100%) create mode 100644 packages/mephisto-addons/src/constants/localStorage.ts delete mode 100644 packages/mephisto-addons/src/helpers/format.js create mode 100644 packages/mephisto-addons/src/helpers/format.ts rename packages/mephisto-addons/src/helpers/{index.js => index.ts} (100%) rename packages/mephisto-addons/src/{index.jsx => index.ts} (75%) create mode 100644 packages/mephisto-addons/src/pages/WelcomePage.tsx create mode 100644 packages/mephisto-addons/src/types/common.d.ts create mode 100644 packages/mephisto-addons/src/types/formComposer.d.ts create mode 100644 packages/mephisto-addons/src/types/reviewApp.d.ts create mode 100644 packages/mephisto-addons/src/types/videoAnotator.d.ts create mode 100644 packages/mephisto-addons/src/types/workerOpinion.d.ts create mode 100644 packages/mephisto-addons/tsconfig.json diff --git a/.github/workflows/annotated-pkgs.yml b/.github/workflows/annotated-pkgs.yml index 494f18a4f..70eac94b0 100644 --- a/.github/workflows/annotated-pkgs.yml +++ b/.github/workflows/annotated-pkgs.yml @@ -24,17 +24,22 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - uses: actions/setup-node@v4 env: FORCE_COLOR: 0 with: - node-version: 16 + node-version: 20.18.1 - name: Install yarn 3 run: npm i -g yarn - name: Install package dependencies - run: yarn install + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build + run: | + yarn cache clean --all + yarn install - name: Test that docusarus compiles run: | diff --git a/.github/workflows/cypress-end-to-end-tests.yml b/.github/workflows/cypress-end-to-end-tests.yml index 382182a2e..2756b39cf 100644 --- a/.github/workflows/cypress-end-to-end-tests.yml +++ b/.github/workflows/cypress-end-to-end-tests.yml @@ -37,8 +37,8 @@ jobs: continue-on-error: true - uses: actions/setup-node@v4 with: - cache: "yarn" - node-version: 16 + cache: yarn + node-version: 20.18.1 - uses: dorny/paths-filter@v3 id: filter with: @@ -86,12 +86,12 @@ jobs: # - name: 🐍 Installing python # uses: actions/setup-python@v5 # with: - # python-version: 3.8 + # python-version: 3.9 # # - name: 🪨 Setup Node # uses: actions/setup-node@v4 # with: - # node-version: 16.16.0 + # node-version: 20.18.1 # # - name: 🤖 Install Mephisto # run: pip install -e . @@ -139,12 +139,12 @@ jobs: # - name: 🐍 Installing python # uses: actions/setup-python@v5 # with: - # python-version: 3.8 + # python-version: 3.9 # # - name: 🪨 Setup Node # uses: actions/setup-node@v4 # with: - # node-version: 16.16.0 + # node-version: 20.18.1 # # - name: 🤖 Install Mephisto # run: pip install -e . @@ -193,12 +193,12 @@ jobs: - name: 🐍 Installing python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🪨 Setup Node uses: actions/setup-node@v4 with: - node-version: 16.16.0 + node-version: 20.18.1 - name: 🤖 Install Mephisto run: pip install -e . @@ -213,8 +213,11 @@ jobs: run: mephisto register inhouse - name: 📦 Setting up mephisto-core package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-core + yarn cache clean --all yarn install yarn build npm link @@ -243,12 +246,12 @@ jobs: - name: 🐍 Installing python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🪨 Setup Node uses: actions/setup-node@v4 with: - node-version: 16.16.0 + node-version: 20.18.1 - name: 🤖 Install Mephisto run: pip install -e . @@ -263,8 +266,11 @@ jobs: run: mephisto register inhouse - name: 📦 Setting up mephisto-core package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-core + yarn cache clean --all yarn install yarn build npm link @@ -293,12 +299,12 @@ jobs: - name: 🐍 Installing python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🪨 Setup Node uses: actions/setup-node@v4 with: - node-version: 16.16.0 + node-version: 20.18.1 - name: 🤖 Install Mephisto run: pip install -e . @@ -313,8 +319,11 @@ jobs: run: mephisto register inhouse - name: 📦 Setting up mephisto-core package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-core + yarn cache clean --all yarn install yarn build npm link @@ -343,12 +352,12 @@ jobs: # - name: 🐍 Installing python # uses: actions/setup-python@v5 # with: - # python-version: 3.8 + # python-version: 3.9 # # - name: 🪨 Setup Node # uses: actions/setup-node@v4 # with: - # node-version: 16.16.0 + # node-version: 20.18.1 # # - name: 🤖 Install Mephisto # run: pip install -e . @@ -396,12 +405,12 @@ jobs: - name: 🐍 Installing python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🪨 Setup Node uses: actions/setup-node@v4 with: - node-version: 16.16.0 + node-version: 20.18.1 - name: 🤖 Install Mephisto run: | @@ -418,8 +427,11 @@ jobs: run: mephisto register inhouse - name: 📦 Setting up mephisto-core package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-core + yarn cache clean --all yarn install yarn build npm link @@ -447,12 +459,12 @@ jobs: - name: 🐍 Installing python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🪨 Setup Node uses: actions/setup-node@v4 with: - node-version: 16.16.0 + node-version: 20.18.1 - name: 🤖 Install Mephisto run: | @@ -469,8 +481,11 @@ jobs: run: mephisto register inhouse - name: 📦 Setting up mephisto-core package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-core + yarn cache clean --all yarn install yarn build npm link @@ -495,15 +510,16 @@ jobs: steps: - name: 🔀 Checking out repo uses: actions/checkout@v2 + - name: 🐍 Installing python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🪨 Setup Node uses: actions/setup-node@v4 with: - node-version: 16.16.0 + node-version: 20.18.1 - name: 🤖 Install Mephisto run: | @@ -520,15 +536,21 @@ jobs: run: mephisto register inhouse - name: 📦 Setting up mephisto-core package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-core + yarn cache clean --all yarn install yarn build npm link - name: 📦 Setting up mephisto-addons package + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false # prevents error YN0028 during build run: | cd packages/mephisto-addons + yarn cache clean --all yarn install yarn build npm link @@ -548,17 +570,10 @@ jobs: - name: 🔪 Killing the web server run: | - lsof -nPi :3000 - lsof -i -P -n | grep LISTEN | grep python | awk '{print $2}' - kill -INT $(lsof -i -P -n | grep LISTEN | grep python | awk '{print $2}') - echo "killed 1" - sleep 0.5 - kill -INT $(lsof -i -P -n | grep LISTEN | grep python | awk '{print $2}') - echo "killed 2" - lsof -i -P -n | grep LISTEN | grep node | awk '{print $2}' - kill -INT $(lsof -i -P -n | grep LISTEN | grep node | awk '{print $2}') - sleep 30 - echo "30 seconds passed" + sudo apt install procps -y # Installing `pkill` + sudo pkill -9 python + sudo pkill -9 node + echo "Web server killed" - name: 🥛 Expiring units run: | diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 484bb034d..b27136f6d 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -20,11 +20,11 @@ jobs: env: FORCE_COLOR: 0 with: - node-version: 16.16.0 cache: yarn + node-version: 20.18.1 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🤖 Install Mephisto run: | cd ../../ diff --git a/.github/workflows/npm-check.yml b/.github/workflows/npm-check.yml index d57cc3263..d95612a3f 100644 --- a/.github/workflows/npm-check.yml +++ b/.github/workflows/npm-check.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install Mephisto run: pip install -e . - name: Run version sync script diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index f6730a17a..41784c8e1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -12,5 +12,5 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 35325c4c6..caaeed926 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test-deploy-docs.yml b/.github/workflows/test-deploy-docs.yml index 09cd898e3..24b7caae4 100644 --- a/.github/workflows/test-deploy-docs.yml +++ b/.github/workflows/test-deploy-docs.yml @@ -20,11 +20,11 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v4 with: - node-version: 16.16.0 cache: yarn + node-version: 20.18.1 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: 🤖 Install Mephisto run: | diff --git a/.github/workflows/version-sync.yml b/.github/workflows/version-sync.yml index b38a94900..a81b4a950 100644 --- a/.github/workflows/version-sync.yml +++ b/.github/workflows/version-sync.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install Mephisto run: pip install -e . - name: Run version sync script diff --git a/.yarn/releases/yarn-3.2.4.cjs b/.yarn/releases/yarn-3.2.4.cjs index 78b905ef1..38f17fd49 100755 --- a/.yarn/releases/yarn-3.2.4.cjs +++ b/.yarn/releases/yarn-3.2.4.cjs @@ -141,7 +141,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. `),type:ir.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Je.performRuntimeChecks=aye;function Aye(r,e,t){var i=[],n=!1,s=(0,Se.compact)((0,Se.flatten)((0,Se.mapValues)(r.modes,function(l){return l}))),o=(0,Se.reject)(s,function(l){return l[Po]===ir.Lexer.NA}),a=_j(t);return e&&(0,Se.forEach)(o,function(l){var c=Vj(l,a);if(c!==!1){var u=Xj(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Se.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,hf.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:ir.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Je.performWarningRuntimeChecks=Aye;function lye(r){var e={},t=(0,Se.keys)(r);return(0,Se.forEach)(t,function(i){var n=r[i];if((0,Se.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Je.cloneEmptyGroups=lye;function Qx(r){var e=r.PATTERN;if((0,Se.isRegExp)(e))return!1;if((0,Se.isFunction)(e))return!0;if((0,Se.has)(e,"exec"))return!0;if((0,Se.isString)(e))return!1;throw Error("non exhaustive match")}Je.isCustomPattern=Qx;function zj(r){return(0,Se.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Je.isShortPattern=zj;Je.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type `)+(" Root cause: "+e.errMsg+`. @@ -164,8 +164,8 @@ but found: '`+a+"'";if(n)return o+n+l;var c=(0,_s.reduce)(e,function(h,p){return but found: '`+o+"'";if(i)return s+i+a;var l=(0,_s.map)(e,function(u){return"["+(0,_s.map)(u,function(g){return(0,Cf.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Pa.defaultParserErrorProvider);Pa.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+r.name+"<-";return t}};Pa.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Nx.Terminal?u.terminalType.name:u instanceof Nx.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,_s.first)(e),s=n.idx,o=(0,Lq.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` `),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. `+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. @@ -184,7 +184,7 @@ This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){ `+(" inside <"+r.topLevelRule.name+`> Rule. has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=Yye.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. `+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: +`)+(`without consuming any Tokens. The grammar path that causes this is: `+i+` `)+` To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Nx.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var Mq=y(UA=>{"use strict";var jye=UA&&UA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(UA,"__esModule",{value:!0});UA.GastRefResolverVisitor=UA.resolveGrammar=void 0;var qye=Un(),Tq=Gt(),Jye=df();function Wye(r,e){var t=new Oq(r,e);return t.resolveRefs(),t.errors}UA.resolveGrammar=Wye;var Oq=function(r){jye(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,Tq.forEach)((0,Tq.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:qye.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(Jye.GAstVisitor);UA.GastRefResolverVisitor=Oq});var _d=y(Lr=>{"use strict";var Rc=Lr&&Lr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.nextPossibleTokensAfter=Lr.possiblePathsFrom=Lr.NextTerminalAfterAtLeastOneSepWalker=Lr.NextTerminalAfterAtLeastOneWalker=Lr.NextTerminalAfterManySepWalker=Lr.NextTerminalAfterManyWalker=Lr.AbstractNextTerminalAfterProductionWalker=Lr.NextAfterTokenWalker=Lr.AbstractNextPossibleTokensWalker=void 0;var Kq=Fy(),Kt=Gt(),zye=Rx(),Dt=Cn(),Uq=function(r){Rc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){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=(0,Kt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Kt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Kt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(Kq.RestWalker);Lr.AbstractNextPossibleTokensWalker=Uq;var Vye=function(r){Rc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new Dt.Alternative({definition:s});this.possibleTokTypes=(0,zye.first)(o),this.found=!0}},e}(Uq);Lr.NextAfterTokenWalker=Vye;var Xd=function(r){Rc(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(Kq.RestWalker);Lr.AbstractNextTerminalAfterProductionWalker=Xd;var Xye=function(r){Rc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(Xd);Lr.NextTerminalAfterManyWalker=Xye;var _ye=function(r){Rc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(Xd);Lr.NextTerminalAfterManySepWalker=_ye;var Zye=function(r){Rc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(Xd);Lr.NextTerminalAfterAtLeastOneWalker=Zye;var $ye=function(r){Rc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(Xd);Lr.NextTerminalAfterAtLeastOneSepWalker=$ye;function Hq(r,e,t){t===void 0&&(t=[]),t=(0,Kt.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Kt.drop)(r,n+1))}function o(c){var u=Hq(s(c),e,t);return i.concat(u)}for(;t.length=0;ue--){var _=B.definition[ue],T={idx:p,def:_.definition.concat((0,Kt.drop)(h)),ruleStack:m,occurrenceStack:w};g.push(T),g.push(o)}else if(B instanceof Dt.Alternative)g.push({idx:p,def:B.definition.concat((0,Kt.drop)(h)),ruleStack:m,occurrenceStack:w});else if(B instanceof Dt.Rule)g.push(twe(B,p,m,w));else throw Error("non exhaustive match")}}return u}Lr.nextPossibleTokensAfter=ewe;function twe(r,e,t,i){var n=(0,Kt.cloneArr)(t);n.push(r.name);var s=(0,Kt.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var Zd=y(_t=>{"use strict";var jq=_t&&_t.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(_t,"__esModule",{value:!0});_t.areTokenCategoriesNotUsed=_t.isStrictPrefixOfPath=_t.containsPath=_t.getLookaheadPathsForOptionalProd=_t.getLookaheadPathsForOr=_t.lookAheadSequenceFromAlternatives=_t.buildSingleAlternativeLookaheadFunction=_t.buildAlternativesLookAheadFunc=_t.buildLookaheadFuncForOptionalProd=_t.buildLookaheadFuncForOr=_t.getProdType=_t.PROD_TYPE=void 0;var sr=Gt(),Gq=_d(),rwe=Fy(),Ky=pf(),HA=Cn(),iwe=df(),li;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(li=_t.PROD_TYPE||(_t.PROD_TYPE={}));function nwe(r){if(r instanceof HA.Option)return li.OPTION;if(r instanceof HA.Repetition)return li.REPETITION;if(r instanceof HA.RepetitionMandatory)return li.REPETITION_MANDATORY;if(r instanceof HA.RepetitionMandatoryWithSeparator)return li.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof HA.RepetitionWithSeparator)return li.REPETITION_WITH_SEPARATOR;if(r instanceof HA.Alternation)return li.ALTERNATION;throw Error("non exhaustive match")}_t.getProdType=nwe;function swe(r,e,t,i,n,s){var o=Jq(r,e,t),a=Ox(o)?Ky.tokenStructuredMatcherNoCategories:Ky.tokenStructuredMatcher;return s(o,i,a,n)}_t.buildLookaheadFuncForOr=swe;function owe(r,e,t,i,n,s){var o=Wq(r,e,n,t),a=Ox(o)?Ky.tokenStructuredMatcherNoCategories:Ky.tokenStructuredMatcher;return s(o[0],a,i)}_t.buildLookaheadFuncForOptionalProd=owe;function awe(r,e,t,i){var n=r.length,s=(0,sr.every)(r,function(l){return(0,sr.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,sr.map)(l,function(D){return D.GATE}),u=0;u{"use strict";var Mx=zt&&zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zt,"__esModule",{value:!0});zt.checkPrefixAlternativesAmbiguities=zt.validateSomeNonEmptyLookaheadPath=zt.validateTooManyAlts=zt.RepetionCollector=zt.validateAmbiguousAlternationAlternatives=zt.validateEmptyOrAlternative=zt.getFirstNoneTerminal=zt.validateNoLeftRecursion=zt.validateRuleIsOverridden=zt.validateRuleDoesNotAlreadyExist=zt.OccurrenceValidationCollector=zt.identifyProductionForDuplicates=zt.validateGrammar=void 0;var er=Gt(),Qr=Gt(),Fo=Un(),Kx=zd(),mf=Zd(),gwe=_d(),Zs=Cn(),Ux=df();function fwe(r,e,t,i,n){var s=er.map(r,function(h){return hwe(h,i)}),o=er.map(r,function(h){return Hx(h,h,i)}),a=[],l=[],c=[];(0,Qr.every)(o,Qr.isEmpty)&&(a=(0,Qr.map)(r,function(h){return $q(h,i)}),l=(0,Qr.map)(r,function(h){return eJ(h,e,i)}),c=iJ(r,e,i));var u=Cwe(r,t,i),g=(0,Qr.map)(r,function(h){return rJ(h,i)}),f=(0,Qr.map)(r,function(h){return Zq(h,r,n,i)});return er.flatten(s.concat(c,o,a,l,u,g,f))}zt.validateGrammar=fwe;function hwe(r,e){var t=new _q;r.accept(t);var i=t.allProductions,n=er.groupBy(i,Vq),s=er.pick(n,function(a){return a.length>1}),o=er.map(er.values(s),function(a){var l=er.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,Kx.getProductionDslName)(l),g={message:c,type:Fo.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},f=Xq(l);return f&&(g.parameter=f),g});return o}function Vq(r){return(0,Kx.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+Xq(r)}zt.identifyProductionForDuplicates=Vq;function Xq(r){return r instanceof Zs.Terminal?r.terminalType.name:r instanceof Zs.NonTerminal?r.nonTerminalName:""}var _q=function(r){Mx(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(Ux.GAstVisitor);zt.OccurrenceValidationCollector=_q;function Zq(r,e,t,i){var n=[],s=(0,Qr.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:Fo.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}zt.validateRuleDoesNotAlreadyExist=Zq;function pwe(r,e,t){var i=[],n;return er.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:Fo.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}zt.validateRuleIsOverridden=pwe;function Hx(r,e,t,i){i===void 0&&(i=[]);var n=[],s=$d(e.definition);if(er.isEmpty(s))return[];var o=r.name,a=er.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:Fo.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=er.difference(s,i.concat([r])),c=er.map(l,function(u){var g=er.cloneArr(i);return g.push(u),Hx(r,u,t,g)});return n.concat(er.flatten(c))}zt.validateNoLeftRecursion=Hx;function $d(r){var e=[];if(er.isEmpty(r))return e;var t=er.first(r);if(t instanceof Zs.NonTerminal)e.push(t.referencedRule);else if(t instanceof Zs.Alternative||t instanceof Zs.Option||t instanceof Zs.RepetitionMandatory||t instanceof Zs.RepetitionMandatoryWithSeparator||t instanceof Zs.RepetitionWithSeparator||t instanceof Zs.Repetition)e=e.concat($d(t.definition));else if(t instanceof Zs.Alternation)e=er.flatten(er.map(t.definition,function(o){return $d(o.definition)}));else if(!(t instanceof Zs.Terminal))throw Error("non exhaustive match");var i=(0,Kx.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=er.drop(r);return e.concat($d(s))}else return e}zt.getFirstNoneTerminal=$d;var Gx=function(r){Mx(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(Ux.GAstVisitor);function $q(r,e){var t=new Gx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){var a=er.dropRight(o.definition),l=er.map(a,function(c,u){var g=(0,gwe.nextPossibleTokensAfter)([c],[],null,1);return er.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:Fo.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(er.compact(l))},[]);return n}zt.validateEmptyOrAlternative=$q;function eJ(r,e,t){var i=new Gx;r.accept(i);var n=i.alternations;n=(0,Qr.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=er.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,mf.getLookaheadPathsForOr)(l,r,c,a),g=dwe(u,a,r,t),f=nJ(u,a,r,t);return o.concat(g,f)},[]);return s}zt.validateAmbiguousAlternationAlternatives=eJ;var tJ=function(r){Mx(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(Ux.GAstVisitor);zt.RepetionCollector=tJ;function rJ(r,e){var t=new Gx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:Fo.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}zt.validateTooManyAlts=rJ;function iJ(r,e,t){var i=[];return(0,Qr.forEach)(r,function(n){var s=new tJ;n.accept(s);var o=s.allProductions;(0,Qr.forEach)(o,function(a){var l=(0,mf.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,mf.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,Qr.isEmpty)((0,Qr.flatten)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:Fo.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}zt.validateSomeNonEmptyLookaheadPath=iJ;function dwe(r,e,t,i){var n=[],s=(0,Qr.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,Qr.forEach)(l,function(u){var g=[c];(0,Qr.forEach)(r,function(f,h){c!==h&&(0,mf.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,mf.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=er.map(s,function(a){var l=(0,Qr.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:Fo.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function nJ(r,e,t,i){var n=[],s=(0,Qr.reduce)(r,function(o,a,l){var c=(0,Qr.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,Qr.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,Qr.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.validateGrammar=Ef.resolveGrammar=void 0;var jx=Gt(),mwe=Mq(),Ewe=Yx(),sJ=Vd();function Iwe(r){r=(0,jx.defaults)(r,{errMsgProvider:sJ.defaultGrammarResolverErrorProvider});var e={};return(0,jx.forEach)(r.rules,function(t){e[t.name]=t}),(0,mwe.resolveGrammar)(e,r.errMsgProvider)}Ef.resolveGrammar=Iwe;function ywe(r){return r=(0,jx.defaults)(r,{errMsgProvider:sJ.defaultGrammarValidatorErrorProvider}),(0,Ewe.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}Ef.validateGrammar=ywe});var If=y(En=>{"use strict";var eC=En&&En.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(En,"__esModule",{value:!0});En.EarlyExitException=En.NotAllInputParsedException=En.NoViableAltException=En.MismatchedTokenException=En.isRecognitionException=void 0;var wwe=Gt(),aJ="MismatchedTokenException",AJ="NoViableAltException",lJ="EarlyExitException",cJ="NotAllInputParsedException",uJ=[aJ,AJ,lJ,cJ];Object.freeze(uJ);function Bwe(r){return(0,wwe.contains)(uJ,r.name)}En.isRecognitionException=Bwe;var Uy=function(r){eC(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),Qwe=function(r){eC(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=aJ,s}return e}(Uy);En.MismatchedTokenException=Qwe;var bwe=function(r){eC(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=AJ,s}return e}(Uy);En.NoViableAltException=bwe;var Swe=function(r){eC(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=cJ,n}return e}(Uy);En.NotAllInputParsedException=Swe;var vwe=function(r){eC(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=lJ,s}return e}(Uy);En.EarlyExitException=vwe});var Jx=y(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.attemptInRepetitionRecovery=Ui.Recoverable=Ui.InRuleRecoveryException=Ui.IN_RULE_RECOVERY_EXCEPTION=Ui.EOF_FOLLOW_KEY=void 0;var Hy=KA(),cs=Gt(),xwe=If(),Pwe=Fx(),Dwe=Un();Ui.EOF_FOLLOW_KEY={};Ui.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function qx(r){this.name=Ui.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Ui.InRuleRecoveryException=qx;qx.prototype=Error.prototype;var kwe=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,cs.has)(e,"recoveryEnabled")?e.recoveryEnabled:Dwe.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=gJ)},r.prototype.getTokenToInsert=function(e){var t=(0,Hy.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),m=new xwe.MismatchedTokenException(p,u,s.LA(0));m.resyncedTokens=(0,cs.dropRight)(l),s.SAVE_ERROR(m)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new qx("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,cs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,cs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,cs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,cs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Ui.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,cs.map)(t,function(n,s){return s===0?Ui.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,cs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,cs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Ui.EOF_FOLLOW_KEY)return[Hy.EOF];var t=e.ruleName+e.idxInCallingRule+Pwe.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,Hy.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,cs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,cs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,cs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Ui.Recoverable=kwe;function gJ(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=Hy.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(r,e,t,f)}Ui.attemptInRepetitionRecovery=gJ});var Gy=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.getKeyForAutomaticLookahead=qt.AT_LEAST_ONE_SEP_IDX=qt.MANY_SEP_IDX=qt.AT_LEAST_ONE_IDX=qt.MANY_IDX=qt.OPTION_IDX=qt.OR_IDX=qt.BITS_FOR_ALT_IDX=qt.BITS_FOR_RULE_IDX=qt.BITS_FOR_OCCURRENCE_IDX=qt.BITS_FOR_METHOD_TYPE=void 0;qt.BITS_FOR_METHOD_TYPE=4;qt.BITS_FOR_OCCURRENCE_IDX=8;qt.BITS_FOR_RULE_IDX=12;qt.BITS_FOR_ALT_IDX=8;qt.OR_IDX=1<{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.LooksAhead=void 0;var Da=Zd(),$s=Gt(),fJ=Un(),ka=Gy(),Fc=zd(),Fwe=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,$s.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:fJ.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,$s.has)(e,"maxLookahead")?e.maxLookahead:fJ.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,$s.isES2015MapSupported)()?new Map:[],(0,$s.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,$s.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,Fc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,$s.forEach)(s,function(g){var f=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,Fc.getProductionDslName)(g)+f,function(){var h=(0,Da.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),p=(0,ka.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],ka.OR_IDX,g.idx);t.setLaFuncCache(p,h)})}),(0,$s.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,ka.MANY_IDX,Da.PROD_TYPE.REPETITION,g.maxLookahead,(0,Fc.getProductionDslName)(g))}),(0,$s.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,ka.OPTION_IDX,Da.PROD_TYPE.OPTION,g.maxLookahead,(0,Fc.getProductionDslName)(g))}),(0,$s.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,ka.AT_LEAST_ONE_IDX,Da.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,Fc.getProductionDslName)(g))}),(0,$s.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,ka.AT_LEAST_ONE_SEP_IDX,Da.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,Fc.getProductionDslName)(g))}),(0,$s.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,ka.MANY_SEP_IDX,Da.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,Fc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,Da.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,ka.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,Da.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,Da.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,ka.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();Yy.LooksAhead=Fwe});var pJ=y(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.addNoneTerminalToCst=No.addTerminalToCst=No.setNodeLocationFull=No.setNodeLocationOnlyOffset=void 0;function Nwe(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(GA,"__esModule",{value:!0});GA.defineNameProp=GA.functionName=GA.classNameFromInstance=void 0;var Mwe=Gt();function Kwe(r){return CJ(r.constructor)}GA.classNameFromInstance=Kwe;var dJ="name";function CJ(r){var e=r.name;return e||"anonymous"}GA.functionName=CJ;function Uwe(r,e){var t=Object.getOwnPropertyDescriptor(r,dJ);return(0,Mwe.isUndefined)(t)||t.configurable?(Object.defineProperty(r,dJ,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}GA.defineNameProp=Uwe});var wJ=y(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateRedundantMethods=vi.validateMissingCstMethods=vi.validateVisitor=vi.CstVisitorDefinitionError=vi.createBaseVisitorConstructorWithDefaults=vi.createBaseSemanticVisitorConstructor=vi.defaultVisit=void 0;var us=Gt(),tC=Wx();function mJ(r,e){for(var t=(0,us.keys)(r),i=t.length,n=0;n: @@ -231,7 +231,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis